Gradient calculation method, vehicle and computer readable storage medium

By coupling the longitudinal and lateral dynamic equations and combining them with the extended Kalman filter algorithm, the joint calculation of longitudinal and lateral slopes is realized, which solves the error problem existing in the independent estimation method, improves the accuracy and stability of slope calculation, and ensures the safety and control precision of vehicles under complex road conditions.

CN121947510APending Publication Date: 2026-05-01GREAT WALL MOTOR CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GREAT WALL MOTOR CO LTD
Filing Date
2026-01-30
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

In existing technologies, independent estimation methods for longitudinal and lateral slopes are difficult to guarantee calculation accuracy under complex working conditions. In particular, the estimation of lateral slope lacks key state information, which leads to a reduction in driving safety.

Method used

By coupling the longitudinal and lateral dynamic equations, a unified coupled dynamic model is constructed. The extended Kalman filter algorithm is then used for parameter calibration to achieve joint calculation and synchronous output of longitudinal and lateral slopes, thereby eliminating vehicle attitude interference and improving calculation accuracy.

Benefits of technology

It significantly improves the accuracy and stability of slope calculation, ensuring vehicle safety and control precision under complex road conditions, and reducing the risk of vehicle skidding on laterally inclined roads.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121947510A_ABST
    Figure CN121947510A_ABST
Patent Text Reader

Abstract

The invention provides a gradient calculation method, a vehicle and a computer readable storage medium, which are applied to the technical field of vehicle control, and the method comprises the following steps: obtaining a first state parameter of the vehicle at a first moment and first input parameters of the first moment obtained by a plurality of sensors of the vehicle; based on the first state parameter, the first input parameter and a coupling kinetic equation, a discrete prediction equation is established, the discrete prediction equation can predict a second state parameter of the vehicle at the second moment, and the coupling kinetic equation is obtained by coupling a longitudinal kinetic equation and a lateral kinetic equation; acquiring a second observation parameter of the vehicle at a second moment, and calculating an updated second state parameter based on the second observation parameter and the second state parameter; and the updated second state parameters are corrected, and the actual longitudinal gradient and the actual lateral gradient of the vehicle at the second moment are obtained. The slope calculation accuracy and stability can be effectively improved, so that the driving safety is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of vehicle control technology, specifically to a slope calculation method, a vehicle, and a computer-readable storage medium. Background Technology

[0002] With the rapid development of automotive intelligence, accurately obtaining the longitudinal and lateral slopes of roads is of great significance for ensuring vehicle stability and improving control precision in applications such as intelligent driving, advanced driver assistance systems, and vehicle chassis control.

[0003] Currently, longitudinal and lateral slopes are typically calculated independently. While research on longitudinal slope is relatively mature, research on lateral slope estimation is significantly lacking. This separate calculation method struggles to guarantee accuracy under complex conditions such as steep inclines or uneven road surfaces, often resulting in substantial estimation errors. Furthermore, relying on triaxial accelerometers for slope estimation suffers from insufficient observational information, particularly in lateral slope estimation. The lack of observable data on critical states such as lateral vehicle speed and roll rate further reduces the accuracy and stability of slope calculations, thereby impacting driving safety. Summary of the Invention

[0004] This application provides a slope calculation method, a vehicle, and a computer-readable storage medium. This application can effectively improve the accuracy and stability of slope calculation, thereby enhancing driving safety.

[0005] Firstly, a slope calculation method is provided for vehicles. This method includes: acquiring first state parameters of the vehicle at a first moment and first input parameters acquired by multiple sensors of the vehicle at the first moment; establishing a discrete prediction equation based on the first state parameters, the first input parameters, and a coupled dynamic equation, wherein the discrete prediction equation can predict the second state parameters of the vehicle at a second moment, and the coupled dynamic equation is obtained by coupling the longitudinal dynamic equation and the lateral dynamic equation; acquiring second observation parameters of the vehicle at the second moment; calculating updated second state parameters based on the second observation parameters and the second state parameters; and correcting the updated second state parameters to obtain the actual longitudinal slope and actual lateral slope of the vehicle at the second moment.

[0006] Based on the above technical solution, this embodiment of the application overcomes the problem of large calculation errors caused by traditional separate estimation methods of longitudinal and lateral dynamics by coupling the longitudinal dynamic equations and lateral dynamic equations. A unified coupled dynamic model is constructed and transformed into discrete prediction equations to accurately predict the vehicle's state parameters at the next moment, achieving joint calculation and synchronous output of longitudinal and lateral states. Subsequently, based on the extended Kalman filter algorithm, the predicted state parameters are calibrated to correct prediction deviations and improve the accuracy of parameter prediction. Finally, combined with vehicle attitude parameters, the calibrated slope parameters are corrected, effectively eliminating interference from vehicle attitude and obtaining longitudinal and lateral slopes that truly reflect the road terrain. This effectively improves the accuracy and stability of slope calculation, thereby enhancing driving safety.

[0007] In conjunction with the first aspect, in some implementations of the first aspect, the above-mentioned calculation of the updated second state parameter based on the second observation parameter and the second state parameter includes: obtaining the third observation parameter based on the second state parameter and the measurement matrix; calculating the difference between the second observation parameter and the third observation parameter; determining the first gain coefficient based on the measurement matrix; calibrating the second state parameter based on the first gain coefficient and the difference, and calculating the updated second state parameter.

[0008] Based on the above technical solution, this application embodiment directly quantifies the deviation between the theoretical prediction of the vehicle dynamics model and the actual data under real road conditions by calculating the difference between the second observation parameter (actual sensor data) and the third observation parameter (theoretically derived observation value). Then, combined with Kalman gain, the second state parameter is calibrated. This not only preserves the fit of the dynamics model to the law of vehicle motion, but also incorporates the authenticity of actual observation data. It avoids theoretical deviations caused by relying solely on the model or noise interference caused by relying solely on observation. Ultimately, the estimation results of longitudinal and lateral slopes are closer to real road conditions, effectively improving the accuracy of longitudinal and lateral slope calculations.

[0009] Combining the first aspect and the above implementation methods, in some implementation methods of the first aspect, the above determination of the first gain coefficient based on the measurement matrix includes: obtaining the first gain coefficient based on the error covariance matrix corresponding to the measurement matrix and the second state parameter.

[0010] Based on the above technical solution, the embodiments of this application consider the selection characteristics of the observation data for different state variables and the reliability of the current estimate of each state variable when determining the first gain coefficient. This enables the state calibration process to adaptively adjust the correction weight of each state component according to the current working condition, effectively avoiding slope calculation errors caused by blind correction, thereby improving the accuracy of longitudinal and lateral slope calculations.

[0011] In conjunction with the first aspect, in some implementations of the first aspect, the first state parameters include a first longitudinal vehicle speed, a first lateral vehicle speed, a first longitudinal slope, and a first lateral slope, and the first input parameters include longitudinal acceleration, lateral acceleration, and yaw rate. The method further includes: obtaining a longitudinal dynamic equation based on the longitudinal acceleration, the first longitudinal vehicle speed, the first longitudinal slope, and the yaw rate; obtaining a lateral dynamic equation based on the lateral acceleration, the first lateral vehicle speed, the first lateral slope, and the yaw rate; and coupling the longitudinal dynamic equation and the lateral dynamic equation to obtain a coupled dynamic equation.

[0012] Based on the above technical solution, this application embodiment couples the longitudinal and lateral dynamic processes into a model, enabling information sharing between the two directions in state estimation. When calculating the longitudinal speed change rate, the current lateral speed is incorporated; similarly, the influence of the longitudinal speed is included when deriving the lateral speed change rate. This coupling mechanism ensures that the estimation of longitudinal and lateral slopes is no longer isolated but mutually supportive and dynamically coordinated. Compared to traditional methods that treat longitudinal and lateral slopes independently, this effectively suppresses estimation errors in a single direction and significantly improves the accuracy of slope calculation.

[0013] In conjunction with the first aspect, in some implementations of the first aspect, the first state parameter further includes the first longitudinal slope change rate and the first lateral slope change rate. The above-mentioned establishment of a discrete prediction equation based on the first state parameter, the first input parameter and the coupled dynamic equation includes: constructing a slope change model based on the first longitudinal slope change rate and the first lateral slope change rate; discretizing the coupled dynamic equation and the slope change model to establish a discrete prediction equation.

[0014] Based on the above technical solution, this application embodiment establishes a discrete prediction equation that includes longitudinal slope, lateral slope, longitudinal slope change rate, and lateral slope change rate. This enables dynamic tracking of slope change characteristics and overcomes the estimation lag or distortion problems caused by treating slope as static in traditional methods. At the same time, it realizes the joint estimation of vehicle motion state and road slope. The longitudinal and lateral slope information support each other, effectively suppressing modeling errors in a single direction, thereby improving the accuracy of longitudinal and lateral slope calculations.

[0015] In conjunction with the first aspect, in some implementations of the first aspect, the method further includes: constructing a measurement matrix, the dimensions of which correspond to the dimensions of the second state parameter and the second observation parameter, and the values ​​of the elements in the measurement matrix are determined according to the correlation between the second state parameter and the second observation parameter.

[0016] Based on the above technical solution, this embodiment constructs measurement equations that match the system state and actual observed physical characteristics. It establishes a one-to-one linear observation relationship between longitudinal vehicle speed, pitch angular velocity, and roll angular velocity and the longitudinal vehicle speed, longitudinal slope change rate, and lateral slope change rate in the state vector, respectively. This ensures that the measurement matrix has a value of 1 only at the corresponding positions, with the remaining elements being 0. This avoids directly using the IMU attitude angle, which is affected by vehicle dynamics, as an observation, effectively suppressing the impact of attitude disturbances on slope estimation. This provides more reliable observation residuals in the subsequent extended Kalman filter update stage, ensuring reasonable convergence of the Kalman gain and effectively improving the accuracy of slope calculation.

[0017] In conjunction with the first aspect, in some implementations of the first aspect, the second state parameter includes a second longitudinal slope and a second lateral slope. The above-mentioned correction of the updated second state parameter to obtain the actual longitudinal slope and actual lateral slope of the vehicle at the second moment includes: correcting the second longitudinal slope based on the actual vehicle body pitch angle to obtain the actual longitudinal slope; and correcting the second lateral slope based on the actual vehicle body roll angle to obtain the actual lateral slope.

[0018] Based on the above technical solution, this application embodiment dynamically corrects the second longitudinal slope and second lateral slope output by the extended Kalman filter algorithm by introducing the actual vehicle pitch angle and roll angle. This effectively solves the problem of interference to slope estimation caused by vehicle attitude deviation due to suspension deformation and inertial force during vehicle acceleration, braking or turning. It ensures that the output actual longitudinal slope and actual lateral slope data can truly reflect the tilt characteristics of the road terrain and greatly improve the accuracy of slope calculation.

[0019] In conjunction with the first aspect, in some implementations of the first aspect, after obtaining the actual longitudinal slope and actual lateral slope of the vehicle at the second moment, the method further includes: determining a target torque based on the actual longitudinal slope and actual lateral slope; and controlling the vehicle based on the target torque.

[0020] Based on the above technical solution, this embodiment of the application dynamically determines the target torque and controls the vehicle by combining the actual longitudinal slope and the actual lateral slope. This enables more accurate compensation for the gravity component of the slope, effectively preventing the vehicle from slipping or lacking power when climbing. Simultaneously, by adjusting the torque distribution between the left and right wheels according to the lateral slope, the vehicle's driving stability on laterally inclined surfaces is improved, reducing the risk of sideslip. Overall, while ensuring safety, the accuracy and energy efficiency of drive control are improved.

[0021] Secondly, a slope calculation device is provided, the slope calculation device comprising:

[0022] The acquisition module is used to acquire the first state parameters of the vehicle at the first moment and the first input parameters acquired by multiple sensors of the vehicle at the first moment. A module is established to establish a discrete prediction equation based on the first state parameters, the first input parameters, and the coupled dynamic equation. The discrete prediction equation can predict the second state parameters of the vehicle at the second time. The coupled dynamic equation is obtained by coupling the longitudinal dynamic equation and the lateral dynamic equation. The calculation module is used to obtain the second observation parameters of the vehicle at the second time moment, and calculate the updated second state parameters based on the second observation parameters and the second state parameters. The correction module is used to correct the updated second state parameters to obtain the actual longitudinal slope and actual lateral slope of the vehicle at the second moment.

[0023] In one possible implementation, the computation module is used for: Based on the second state parameters and the measurement matrix, the third observation parameters are obtained; Calculate the difference between the second and third observation parameters; Based on the measurement matrix, determine the first gain coefficient; Based on the first gain coefficient and the difference, the second state parameters are calibrated, and the updated second state parameters are calculated.

[0024] In one possible implementation, the computation module is used for: The first gain coefficient is obtained based on the error covariance matrix corresponding to the measurement matrix and the second state parameter.

[0025] In one possible implementation, the slope calculation device includes a coupling module for: Based on the longitudinal acceleration, the first longitudinal speed, the first longitudinal gradient, and the yaw rate, the longitudinal dynamic equation is obtained; Based on the lateral acceleration, the first lateral vehicle speed, the first lateral slope, and the yaw rate, the lateral dynamics equation is obtained; By coupling the longitudinal and lateral dynamic equations, we obtain the coupled dynamic equations.

[0026] In one possible implementation, a module is created for: A slope change model is constructed based on the first longitudinal slope change rate and the first lateral slope change rate. Discretize the coupled dynamic equations and the slope change model to establish discrete prediction equations.

[0027] In one possible implementation, the slope calculation device includes a building module for: Construct a measurement matrix whose dimensions correspond to the dimensions of the second state parameter and the second observation parameter. The values ​​of the elements in the measurement matrix are determined based on the correlation between the second state parameter and the second observation parameter.

[0028] In one possible implementation, the correction module is used for: The actual longitudinal slope is obtained by correcting the second longitudinal slope based on the actual vehicle body pitch angle. The actual lateral slope is obtained by correcting the second lateral slope based on the actual vehicle body roll angle.

[0029] In one possible implementation, the slope calculation device further includes a control module for: The target torque is determined based on the actual longitudinal slope and the actual lateral slope. Vehicle control based on target torque.

[0030] Thirdly, a vehicle is provided, including a memory and a processor. The memory is used to store executable program code, and the processor is used to call and run the executable program code from the memory, causing the vehicle to perform the slope calculation method in the first aspect or any possible implementation thereof.

[0031] Fourthly, a computer program product is provided, comprising: computer program code, which, when run on a computer, causes the computer to execute the slope calculation method in the first aspect or any possible implementation thereof.

[0032] Fifthly, a computer-readable storage medium is provided, which stores a computer program that, when executed, causes the computer to perform the slope calculation method in the first aspect or any possible implementation thereof. Attached Figure Description

[0033] Figure 1 This illustration shows an application scenario diagram of a slope calculation method provided in an embodiment of this application; Figure 2 A schematic flowchart of a slope calculation method provided in an embodiment of this application is shown; Figure 3 A schematic diagram of the structure of a slope calculation device provided in an embodiment of this application is shown; Figure 4 A schematic diagram of the structure of a vehicle provided in an embodiment of this application is shown. Detailed Implementation

[0034] The technical solutions in this application will be clearly and thoroughly described below with reference to the accompanying drawings. In the description of the embodiments of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B. "And / or" in the text is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Furthermore, in the description of the embodiments of this application, "multiple" refers to two or more than two.

[0035] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature.

[0036] Figure 1 This illustration shows an application scenario diagram of a slope calculation method provided in an embodiment of this application, such as... Figure 1 As shown, vehicle 110 is traveling on a road surface with complex conditions. The road surface is inclined relative to the horizontal plane, and the components of this inclination in different directions constitute the slope information of the vehicle. In this scenario, the road not only has an inclination along the vehicle's direction of travel (i.e., longitudinal, as shown in the figure along the uphill / downhill direction of the slope), i.e., longitudinal slope, but also an inclination perpendicular to the direction of travel (i.e., lateral, as shown in the figure with the height difference between the left and right sides of the vehicle), i.e., lateral slope.

[0037] In complex road conditions, accurately obtaining the longitudinal and lateral slopes is crucial for ensuring vehicle stability and improving control precision. However, currently, longitudinal and lateral slopes are typically calculated independently. While research on longitudinal slope is relatively mature, research on lateral slope estimation is significantly insufficient. This separate calculation method struggles to guarantee accuracy under complex conditions such as steep inclines or uneven road surfaces, often resulting in substantial estimation errors. Furthermore, relying solely on triaxial accelerometers for slope estimation suffers from insufficient observational information, particularly in lateral slope estimation, where the lack of observable data on critical states such as lateral vehicle speed and roll rate further reduces the accuracy and stability of slope calculations, thus impacting driving safety.

[0038] To address the aforementioned issues, this application provides a slope calculation method, a vehicle, and a computer-readable storage medium. This application couples the longitudinal and lateral dynamic equations to construct a unified prediction model, enabling joint prediction and synchronous calculation of longitudinal and lateral state parameters, rather than the traditional separate calculation method. It can accurately predict the vehicle's state parameters at the next moment, and then calibrate the predicted parameters based on the extended Kalman filter algorithm to further correct prediction deviations. Finally, it combines the vehicle attitude parameters to correct the calibrated slope results, eliminating the interference of vehicle attitude on slope calculation, and obtaining longitudinal and lateral slopes that truly reflect the road terrain. This effectively improves the accuracy and stability of slope calculation, thereby enhancing driving safety.

[0039] Figure 2 This document illustrates a flowchart of a slope calculation method provided in an embodiment of this application; specifically as follows: Figure 2 As shown, the method includes the following steps: S210: Obtain the first state parameters of the vehicle at the first moment and the first input parameters of the vehicle at the first moment obtained by multiple sensors of the vehicle.

[0040] Here, the first moment refers to the current moment when state prediction is performed within the current control cycle, which can be denoted as moment k.

[0041] The first state parameters refer to the set of parameters that characterize the vehicle's motion state and the characteristics of the slope it is on at the current moment (e.g., time k) in the current control cycle, and can be denoted as: Specifically, the first state parameter is calculated from the previous control cycle (time k-1) and is used to characterize the vehicle motion state and slope characteristics at time k of the current control cycle. The vehicle motion state parameters include longitudinal speed and lateral speed, and the slope characteristic parameters include longitudinal slope, lateral slope, longitudinal slope change rate, and lateral slope change rate.

[0042] The first input parameter refers to the data collected by the vehicle sensors at the current time (time k) of the current control cycle, such as the longitudinal acceleration collected by the vehicle's six-axis inertial measurement unit (IMU). Lateral acceleration and yaw rate The six-axis inertial measurement unit (IMU) is a sensor device that integrates a three-axis accelerometer and a three-axis gyroscope, providing the vehicle with acceleration and angular velocity information in three-dimensional space. Longitudinal and lateral acceleration are primarily measured directly by the three-axis accelerometer, while yaw rate is primarily measured directly by the three-axis gyroscope.

[0043] S220: Based on the first state parameters, the first input parameters, and the coupled dynamic equations, a discrete prediction equation is established. The discrete prediction equation can predict the second state parameters of the vehicle at the second time. The coupled dynamic equation is obtained by coupling the longitudinal dynamic equation and the lateral dynamic equation.

[0044] The second time point refers to the time point of the next control cycle after the current control cycle (time point k), which can be denoted as time point k+1. For example, the interval between time point k and time point k+1 can be different period values ​​such as 5s or 10s, and this application embodiment does not limit this.

[0045] The second state parameters refer to the set of parameters used to characterize the vehicle's motion state and slope characteristics at time k+1 in the next control cycle, which can be denoted as: .

[0046] Step 1: Construct the coupled dynamic equations based on the acquired parameters.

[0047] Coupled dynamics equations refer to a unified dynamic model obtained by jointly modeling the longitudinal and lateral dynamics equations. These coupled dynamics equations not only consider the interaction between the vehicle's own motion states, but also introduce the influence of the components of gravity in the longitudinal and lateral slope directions on the vehicle's acceleration, thus more realistically reflecting the dynamic behavior of the vehicle in complex slope environments.

[0048] Optionally, the longitudinal dynamic equations and the lateral dynamic equations can be coupled to obtain coupled dynamic equations.

[0049] The longitudinal dynamics equation is a mathematical model describing the changes in a vehicle's motion along the forward direction. It determines the vehicle's speed change trend (i.e., the longitudinal speed change rate) based on the vehicle's current longitudinal speed, longitudinal slope, longitudinal acceleration, and yaw rate. The lateral dynamics equation is a mathematical model describing the changes in a vehicle's motion along the lateral direction. It determines the vehicle's speed change trend (i.e., the lateral speed change rate) based on the vehicle's current lateral speed, lateral slope, lateral acceleration, and yaw rate.

[0050] Optionally, the first state parameters may include a first longitudinal vehicle speed, a first lateral vehicle speed, a first longitudinal gradient, and a first lateral gradient, while the first input parameters include longitudinal acceleration, lateral acceleration, and yaw rate. In this case, the longitudinal dynamic equation can be obtained based on the longitudinal acceleration, the first longitudinal vehicle speed, the first longitudinal gradient, and the yaw rate; the lateral dynamic equation can be obtained based on the lateral acceleration, the first lateral vehicle speed, the first lateral gradient, and the yaw rate; and the longitudinal dynamic equation and the lateral dynamic equation can be coupled to obtain the coupled dynamic equation.

[0051] Wherein, the first longitudinal speed refers to the velocity component of the vehicle along its forward direction at the first moment. The first lateral speed refers to the velocity component of the vehicle along the left-to-right direction at the first moment. The first longitudinal slope refers to the estimated angle of inclination of the road along the forward direction of the vehicle at the first moment. The first lateral slope refers to the estimated angle of inclination of the road along the left-to-right direction of the vehicle at the first moment.

[0052] Specifically, during vehicle operation, the longitudinal and lateral motion states are affected by the vehicle's own speed, acceleration, yaw rate, and road gradient.

[0053] In the longitudinal direction, the longitudinal acceleration measured by the IMU is not the acceleration of the vehicle's pure longitudinal motion, but rather the result of the combined effects of the inertial acceleration generated by the vehicle's own acceleration or deceleration, the Coriolis effect caused by yaw motion (determined by the product of lateral velocity and yaw rate), and the component of gravity on the longitudinal slope. Therefore, the component of gravity on the longitudinal slope (i.e., gsinθ) is first calculated based on the current first longitudinal slope, where θ is the first longitudinal slope. This leads to the longitudinal acceleration. The expression:

[0054] in, For longitudinal acceleration measured by IMU, The first lateral speed, The longitudinal vehicle speed change rate, The yaw rate is angular velocity. This is the first longitudinal slope. This is the acceleration due to gravity.

[0055] Rearranging the above equation, we obtain the longitudinal dynamic equation used for state prediction:

[0056] Similarly, for the lateral direction, the lateral acceleration measured by the IMU is not the acceleration of the vehicle's pure lateral motion, but rather the result of the combined effects of the vehicle's own acceleration and deceleration, the Coriolis effect caused by yaw motion (determined by the product of longitudinal speed and yaw rate), and the component of gravity on the lateral slope. Therefore, the component of gravity on the lateral slope (i.e., gsinφ) is calculated based on the current first lateral slope, where φ is the first lateral slope. This leads to the lateral acceleration. The expression:

[0057] It is lateral acceleration. The first longitudinal speed, Lateral speed change rate, The yaw rate is angular velocity. The first lateral slope is the angle between the vehicle body plane and the horizontal plane around the vehicle body's x-axis, with the left side higher than the right side being positive. This is the acceleration due to gravity.

[0058] Rearranging the above equation, we obtain the lateral dynamic equation used for state prediction:

[0059] Because the longitudinal and lateral motion states of a vehicle are not completely independent during movement (for example, yaw motion during steering affects both longitudinal and lateral acceleration), and the longitudinal and lateral slopes of the ramp also jointly affect the vehicle's motion, a coupled dynamic equation is formed by jointly modeling the longitudinal and lateral dynamic equations to describe the influence of slope on the vehicle's longitudinal and lateral motion. This provides a complete description of the coupled motion characteristics of the vehicle in complex ramp environments.

[0060] Finally, by coupling the longitudinal and lateral dynamic equations, we obtain the coupled dynamic equations, which can be expressed as:

[0061] Based on the above technical solution, this application embodiment couples the longitudinal and lateral dynamic processes into a model, enabling information sharing between the two directions in state estimation. When calculating the longitudinal speed change rate, the current lateral speed is incorporated; similarly, the influence of the longitudinal speed is included when deriving the lateral speed change rate. This coupling mechanism ensures that the estimation of longitudinal and lateral slopes is no longer isolated but mutually supportive and dynamically coordinated. Compared to traditional methods that treat longitudinal and lateral slopes independently, this effectively suppresses estimation errors in a single direction and significantly improves the accuracy of slope calculation.

[0062] Step 2: Establish discrete prediction equations.

[0063] Discrete prediction equations refer to the state prediction models obtained by discretizing the coupled dynamic equations using the Euler method. Based on the first state parameters and the first input parameters of the current control cycle (time k), it can directly predict the second state parameters of the next control cycle (time k+1), thus providing a real-time calculable state prediction basis for the dynamic control of the vehicle.

[0064] Optionally, the first state parameters may also include a first longitudinal slope change rate and a first lateral slope change rate. In this case, a slope change model can be constructed based on the first longitudinal slope change rate and the first lateral slope change rate; the coupled dynamic equation and the slope change model can be discretized to establish a discrete prediction equation.

[0065] The first longitudinal slope change rate refers to the rate at which the first longitudinal slope changes over time during vehicle operation. The first lateral slope change rate refers to the rate at which the first lateral slope changes over time during vehicle operation.

[0066] First, a slope change model is constructed. During vehicle movement, the longitudinal and lateral slopes of the road typically evolve dynamically with changes in position, rather than remaining constant. If the slope is treated as a constant value in state estimation, it can easily lead to estimation lag or divergence under varying slopes or complex road conditions. Therefore, this application introduces the longitudinal slope change rate and the lateral slope change rate as additional state variables into the state vector. However, the slope itself cannot be directly measured, and there is no dedicated sensor for its slope change rate. In addition to providing acceleration, the six-axis inertial measurement unit can also output the roll angular velocity around the vehicle's lateral axis (x-axis) and the pitch angular velocity around the longitudinal axis (y-axis). When the vehicle is traveling at low speed and the suspension deformation is small, the change in vehicle attitude is mainly caused by road tilt. In this case, it can be reasonably approximated that the pitch angular velocity reflects the rate of change of the longitudinal slope (i.e., longitudinal slope angular velocity), and the roll angular velocity reflects the rate of change of the lateral slope (i.e., lateral slope angular velocity).

[0067] Based on this, the slope variation model is constructed as follows:

[0068] We can obtain, = , =0, = , =0, where, This is the first longitudinal slope angular velocity (i.e., the longitudinal slope change rate). This is the first lateral slope angular velocity (i.e., the rate of change of lateral slope). The first longitudinal slope angle acceleration, This represents the first lateral slope angular acceleration. This model is a typical integrator model, assuming that the slope angular acceleration is 0 and the rate of change of slope remains constant, making it suitable for scenarios with gently changing slopes.

[0069] Secondly, the state variables are defined as follows: The state variables are longitudinal vehicle speed, lateral vehicle speed, longitudinal slope, lateral slope, longitudinal slope change rate, and lateral slope change rate, respectively.

[0070] Define the input quantity u as:

[0071] Finally, the coupled dynamic equations and slope change model described above are discretized to form the discrete prediction equations:

[0072] in, This is the process noise vector, representing dynamic factors not included in the model (such as road bumps, tire slippage, sudden slope changes, etc.) and uncertainties introduced by the discretization approximation. This noise vector follows a zero-mean Gaussian distribution. , The process covariance matrix is ​​used to quantify the degree to which each state variable is affected by uncertainties. Its diagonal elements correspond to the process noise intensity of longitudinal vehicle speed, lateral vehicle speed, longitudinal slope, rate of change of longitudinal slope, lateral slope, and rate of change of lateral slope, respectively, and can be tuned according to vehicle dynamics characteristics and measured data. This discrete prediction equation is used to predict the state at the second (k+1) time step from the state at the first (k) time step.

[0073] Based on the above technical solution, this application embodiment establishes a discrete prediction equation that includes longitudinal slope, lateral slope, longitudinal slope change rate, and lateral slope change rate. This enables dynamic tracking of slope change characteristics and overcomes the estimation lag or distortion problems caused by treating slope as static in traditional methods. At the same time, it realizes the joint estimation of vehicle motion state and road slope. The longitudinal and lateral slope information support each other, effectively suppressing modeling errors in a single direction, thereby improving the accuracy of longitudinal and lateral slope calculations.

[0074] S230: Obtain the second observation parameters of the vehicle at the second time, and calculate the updated second state parameters based on the second observation parameters and the second state parameters.

[0075] The second observation parameter refers to a set of multiple parameters that can be directly obtained through measurement and used to calibrate the predicted value. Specifically, it includes the longitudinal vehicle speed obtained directly by wheel speed sensors. The pitch and roll angular velocities are measured by the three-axis gyroscope in the six-axis inertial measurement unit. It is worth noting that the longitudinal vehicle speed in the first state parameter is the calibration calculation value from the previous control cycle, while the longitudinal vehicle speed in the second observation parameter is the sensor's actual measurement value at the second moment; the two are not the same data.

[0076] Specifically, after obtaining the second state parameters (i.e., the state parameters corresponding to the next control cycle obtained through the discrete prediction equation), the extended Kalman filter state update step is executed to fuse real-time sensor observation information and calibrate the second state parameters, thereby obtaining the updated second state parameters.

[0077] First, an observation model is constructed to describe the nonlinear relationship between state variables and directly measurable physical quantities. The observation data directly obtainable in this application includes: longitudinal vehicle speed provided by wheel speed sensors or the vehicle controller; angular velocity around the vehicle's lateral axis (i.e., pitch angular velocity) measured by a six-axis IMU; and angular velocity around the vehicle's longitudinal axis (i.e., roll angular velocity). This observation data has high real-time performance and reliability, and has a clear physical correlation with variables such as longitudinal vehicle speed, longitudinal slope, and lateral slope in the state vector.

[0078] Optionally, a measurement matrix is ​​constructed, the dimensions of which correspond to the dimensions of the second state parameter and the second observation parameter, and the values ​​of the elements in the measurement matrix are determined according to the correlation between the second state parameter and the second observation parameter.

[0079] The measurement matrix refers to a matrix that reflects the sensitivity of each state variable to the observed data, and its structure is determined by the local linearization of the observation model. In this embodiment, since the observed data includes longitudinal vehicle speed, pitch angular velocity, and roll angular velocity, each row of the measurement matrix corresponds to an observation channel, and its elements represent the influence weight of the corresponding state variable on the observation.

[0080] Specifically, the second state parameter includes six state variables: longitudinal vehicle speed, lateral vehicle speed, longitudinal slope, rate of change of longitudinal slope, lateral slope, and rate of change of lateral slope. The second observation parameter includes three observations: second longitudinal vehicle speed, pitch angular velocity, and roll angular velocity. When constructing the measurement matrix, the influence of each state variable on the observed values ​​needs to be determined based on the physical relationships: the first row corresponds to the longitudinal vehicle speed observation. Since the actual longitudinal vehicle speed is directly obtained from the wheel speed sensor or the vehicle network, its value is equal to the longitudinal vehicle speed in the state vector. Therefore, in the first row of the measurement matrix, the first column (corresponding to the longitudinal vehicle speed) is set to 1, and the remaining columns are 0. The second row corresponds to the pitch angular velocity observation. During vehicle operation, changes in the longitudinal slope of the road will cause vehicle pitch motion. The pitch angular velocity output by the IMU is numerically approximately equal to the negative value of the rate of change of longitudinal slope. However, in this application, to simplify the model and unify the notation system, the relationship is modeled as pitch angular velocity equal to the longitudinal slope change rate. Therefore, in the second row of the measurement matrix, the fourth column (corresponding to the longitudinal slope change rate) is set to 1, and the remaining columns are 0. The third row corresponds to the roll angular velocity observation. Similarly, when the vehicle drives over a lateral slope, the roll angular velocity is numerically approximately equal to the lateral slope change rate. Therefore, in the third row of the measurement matrix, the sixth column (corresponding to the lateral slope change rate) is set to 1, and the remaining columns are 0.

[0081] In summary, the measurement matrix H is:

[0082] Based on the above technical solution, this embodiment constructs measurement equations that match the system state and actual observed physical characteristics. It establishes a one-to-one linear observation relationship between longitudinal vehicle speed, pitch angular velocity, and roll angular velocity and the longitudinal vehicle speed, longitudinal slope change rate, and lateral slope change rate in the state vector, respectively. This ensures that the measurement matrix has a value of 1 only at the corresponding positions, with the remaining elements being 0. This avoids directly using the IMU attitude angle, which is affected by vehicle dynamics, as an observation, effectively suppressing the impact of attitude disturbances on slope estimation. This provides more reliable observation residuals in the subsequent extended Kalman filter update stage, ensuring reasonable convergence of the Kalman gain and effectively improving the accuracy of slope calculation.

[0083] Next, the second state parameters are substituted into the observation model to calculate the corresponding predicted observations. These predicted observations reflect the sensor outputs that should theoretically be observed under the current system model and prior states. The actual collected observation data is compared with the predicted observations to obtain the observation residuals, which characterize the inconsistency between the model predictions and the actual measurements. Based on this, the Kalman gain at the current moment is calculated using the state prediction error covariance matrix, the Jacobian matrix of the observation model at the second state parameters, and the preset observation noise covariance matrix. This Kalman gain is used to measure the reliability of the observation information and determine the extent to which the observation residuals are used to correct the prior state estimates. Finally, the calculated Kalman gain and the observation residuals are used to calibrate the second state parameters, resulting in updated second state parameters.

[0084] Optionally, based on the second observation parameters and the second state parameters, the updated second state parameters are calculated, including: Based on the second state parameters and the measurement matrix, the third observation parameters are obtained; Calculate the difference between the second and third observation parameters; Based on the measurement matrix, determine the first gain coefficient; Based on the first gain coefficient and the difference, the second state parameters are calibrated, and the updated second state parameters are calculated.

[0085] The second observation parameter refers to the directly measurable physical quantities actually collected by the onboard sensors at the second moment, specifically including: the longitudinal vehicle speed converted from the wheel speed signal, and the pitch and roll angular velocities measured by the six-axis IMU. The third observation parameter refers to the theoretical observation value derived from the system observation model based on the second state parameter. The first gain coefficient refers to the Kalman gain calculated under extended Kalman filtering.

[0086] Specifically, the second observation parameter yk+1 of the vehicle at the second moment is acquired in real time, including the longitudinal vehicle speed Vx and the pitch angular velocity (i.e., ), roll rate (i.e. Based on the measurement matrix H and the second state parameter, the theoretical observation value (or predicted observation value), i.e., the third observation parameter, can be calculated. .

[0087] The calculation formula is:

[0088] Vk+1 represents the measurement noise, which follows a zero-mean Gaussian distribution. , This is the measurement covariance matrix.

[0089] Further calculate the difference between the second and third observed parameters, i.e., using the formula Δyk+1= The measurement residuals were obtained, among which This is the second observation parameter. The third observation parameter (the theoretical observation value derived from the second state parameter) directly reflects the degree of deviation between the actual observation data and the theoretically predicted observation data, and is the core basis for subsequent state calibration. Based on the measurement matrix H, the first gain coefficient (i.e., Kalman gain) is determined. Based on the first gain coefficient and the aforementioned difference, the second state parameters are calibrated, and the updated second state parameters are calculated. The specific calibration formula is as follows: ,in, Let be the state quantity at time k+1 in the prediction phase. This is the state estimation during the state calibration phase. This process integrates the prior state predictions with corrections based on the differences, so that the updated state parameters conform to both the theoretical laws of vehicle dynamics and the actual observed road condition data.

[0090] Based on the above technical solution, this application embodiment directly quantifies the deviation between the theoretical prediction of the vehicle dynamics model and the actual data under real road conditions by calculating the difference between the second observation parameter (actual sensor data) and the third observation parameter (theoretically derived observation value). Then, combined with Kalman gain, the second state parameter is calibrated. This not only preserves the fit of the dynamics model to the law of vehicle motion, but also incorporates the authenticity of actual observation data. It avoids theoretical deviations caused by relying solely on the model or noise interference caused by relying solely on observation. Ultimately, the estimation results of longitudinal and lateral slopes are closer to real road conditions, effectively improving the accuracy of longitudinal and lateral slope calculations.

[0091] In one possible implementation, determining the first gain coefficient based on the measurement matrix includes the following steps: The first gain coefficient is obtained based on the error covariance matrix corresponding to the measurement matrix and the second state parameter.

[0092] It should be noted that the first gain coefficient is not a preset constant, but a dynamic weight determined by the current uncertainty distribution and observation sensitivity. Specifically, the determination of the first gain coefficient relies on the error covariance matrix and the measurement matrix. The error covariance matrix characterizes the estimation reliability of each state variable (including longitudinal slope, lateral slope, and their rate of change) during the prediction phase. The measurement matrix reflects the degree of influence of each state dimension on the actual observed measurements (such as pitch angular velocity and roll angular velocity). The error covariance matrix... The calculation formula is: ,in, The error covariance matrix at time k during the measurement state correction phase is given. Let k be the process covariance matrix at time k. It is a Jacobian matrix.

[0093]

[0094] Then, through the measurement matrix H and the error covariance matrix corresponding to the second state parameter... Combined with the measurement covariance matrix corresponding to the second state parameter The first gain coefficient can be calculated using the following formula: Furthermore, after calibrating the second state parameters based on the first gain coefficient and the difference, and obtaining the updated second state parameters, the error covariance is also updated, calculated using the following formula: , Let I be the updated error covariance matrix, where I is the identity matrix.

[0095] Based on the above technical solution, the embodiments of this application consider the selection characteristics of the observation data for different state variables and the reliability of the current estimate of each state variable when determining the first gain coefficient. This enables the state calibration process to adaptively adjust the correction weight of each state component according to the current working condition, effectively avoiding slope calculation errors caused by blind correction, thereby improving the accuracy of longitudinal and lateral slope calculations.

[0096] S240: Correct the updated second state parameters to obtain the actual longitudinal slope and actual lateral slope of the vehicle at the second moment.

[0097] The actual longitudinal slope refers to the degree of inclination of the road along the vehicle's direction of travel (i.e., the longitudinal axis of the vehicle), reflecting the elevation change of the road in the longitudinal direction, usually manifested as an uphill or downhill slope. The actual lateral slope refers to the degree of inclination of the road perpendicular to the direction of travel (i.e., the transverse axis of the vehicle), reflecting the elevation difference between the left and right sides, commonly seen in curves, superelevation sections, or transverse slopes in mountainous areas. Although both are slope parameters describing the geometric shape of the road, their directions of action are perpendicular to each other, and their physical meanings are completely different. The longitudinal slope mainly affects the vehicle's driving force requirements and the risk of slippage, determining how much total torque needs to be output to maintain stable driving or parking on a slope. The lateral slope mainly affects the vehicle's lateral stability, which may cause sideslip or trajectory deviation due to gravity, requiring active compensation through differentiated torque distribution between the left and right drive wheels. The necessity of introducing these two parameters lies in the fact that relying solely on traditional vehicle speed or acceleration signals cannot accurately perceive the true slope of the external road, easily leading to excessive or insufficient torque control. By using the actual longitudinal and lateral slopes, the vehicle control system can be provided with high-precision and interference-resistant environmental perception input, thereby achieving more accurate total torque calculation and reasonable left and right wheel torque distribution. This ensures safety on slopes while improving energy efficiency, stability, and driving smoothness.

[0098] Specifically, the updated second state parameters include the optimal state estimates obtained through the extended Kalman filter update stage, specifically the optimal estimates of longitudinal vehicle speed, lateral vehicle speed, longitudinal slope, lateral slope, longitudinal slope change rate, and lateral slope change rate. The optimal estimate of longitudinal slope is a slope parameter that incorporates the vehicle's pitch attitude influence, obtained by fusing vehicle dynamics model predictions and sensor observation data; therefore, it is also referred to as the "nominal longitudinal slope" in this application (defined as the angle between the vehicle plane and the horizontal plane around the vehicle's y-axis, with the front of the vehicle pointing upwards being positive). Similarly, the optimal estimate of lateral slope is a slope parameter that incorporates the vehicle's roll attitude influence, also referred to as the "nominal lateral slope" (defined as the angle between the vehicle plane and the horizontal plane around the vehicle's x-axis, with the left side higher than the right side being positive). Both are intermediate slope results without removing vehicle attitude interference. To obtain slope information reflecting the true geometric characteristics of the road, it is necessary to further obtain the vehicle attitude parameters at the second time step. Specifically, sensors synchronously collect the vehicle's pitch and roll angles at a second moment. The pitch angle is the vehicle's attitude angle around the y-axis as measured by the sensors, and the roll angle is the vehicle's attitude angle around the x-axis as measured by the sensors. Subsequently, an attitude correction formula is used to remove interference from the nominal slope, resulting in the actual slope after eliminating the interference of vehicle pitch attitude on slope measurement under acceleration and deceleration conditions. This actual slope can accurately reflect the longitudinal and lateral slope data of the road terrain characteristics, providing precise road condition input for the vehicle chassis control system.

[0099] In one possible implementation, the second state parameters include a second longitudinal slope and a second lateral slope. The step of correcting the updated second state parameters to obtain the actual longitudinal slope and actual lateral slope of the vehicle at the second moment includes the following steps: The actual longitudinal slope is obtained by correcting the second longitudinal slope based on the actual vehicle body pitch angle. The actual lateral slope is obtained by correcting the second lateral slope based on the actual vehicle body roll angle.

[0100] The second longitudinal slope refers to the longitudinal slope angle that includes the influence of the vehicle's pitch attitude, and can be denoted as... The second lateral slope refers to the lateral slope angle that includes the influence of the vehicle's roll posture, and can be denoted as... .

[0101] Specifically, because vehicles generate pitch and roll angles during acceleration, deceleration, or cornering, the IMU measurement reference deviates from the horizontal plane. Therefore, the second longitudinal slope obtained after the extended Kalman filter update actually includes vehicle pitch attitude interference under acceleration and deceleration conditions. To remove these interferences, data is first synchronously collected by a 6-axis IMU sensor. and Then, based on the theoretical relationship of the gravitational components, the deviation between the actual acceleration and the theoretical acceleration is calculated.

[0102] For the second longitudinal slope, through The longitudinal acceleration deviation is calculated (this deviation directly corresponds to the disturbance caused by the vehicle's pitch attitude). For the second lateral slope, through... The lateral acceleration deviation (corresponding to the disturbance caused by the vehicle's roll attitude) is calculated. Then, the pitch gradient obtained from vehicle parameter calibration is introduced. with roll gradient The above deviations are corrected by weighting: the longitudinal acceleration deviation is multiplied by... The interference value of the vehicle pitch attitude on the second longitudinal slope is obtained, and then this interference value is subtracted from the second longitudinal slope to obtain the actual longitudinal slope of the road. The corrected formula is as follows: Similarly, multiply the lateral acceleration deviation by The disturbance value of the vehicle body roll attitude on the second lateral slope is obtained. This disturbance value is then subtracted from the second lateral slope to obtain the actual lateral slope of the road. The corrected formula is as follows: Through this correction process, the embodiments of this application retain the high-precision calculation results of the extended Kalman filter for the slope, while eliminating the interference error caused by the vehicle's dynamic attitude. The final output of the actual longitudinal slope and actual lateral slope can truly reflect the tilt characteristics of the road terrain and can be directly used for key functional modules such as hill start assist, electronic stability program, and adaptive cruise control.

[0103] Based on the above technical solution, this application embodiment dynamically corrects the second longitudinal slope and second lateral slope output by the extended Kalman filter algorithm by introducing the actual vehicle pitch angle and roll angle. This effectively solves the problem of interference to slope estimation caused by vehicle attitude deviation due to suspension deformation and inertial force during vehicle acceleration, braking or turning. It ensures that the output actual longitudinal slope and actual lateral slope data can truly reflect the tilt characteristics of the road terrain and greatly improve the accuracy of slope calculation.

[0104] Based on the above technical solution, this embodiment of the application overcomes the problem of large calculation errors caused by traditional separate estimation methods of longitudinal and lateral dynamics by coupling the longitudinal dynamic equations and lateral dynamic equations. A unified coupled dynamic model is constructed and transformed into discrete prediction equations to accurately predict the vehicle's state parameters at the next moment, achieving joint calculation and synchronous output of longitudinal and lateral states. Subsequently, based on the extended Kalman filter algorithm, the predicted state parameters are calibrated to correct prediction deviations and improve the accuracy of parameter prediction. Finally, combined with vehicle attitude parameters, the calibrated slope parameters are corrected, effectively eliminating interference from vehicle attitude and obtaining longitudinal and lateral slopes that truly reflect the road terrain. This effectively improves the accuracy and stability of slope calculation, thereby enhancing driving safety.

[0105] In one possible implementation, after obtaining the vehicle's actual longitudinal slope and actual lateral slope at the second moment, the method further includes the following steps: The target torque is determined based on the actual longitudinal slope and the actual lateral slope. Vehicle control based on target torque.

[0106] The target torque refers to the output torque of the drive system required to maintain vehicle stability or achieve a predetermined motion state, calculated based on the actual longitudinal and lateral slopes and combined with vehicle dynamic parameters (such as vehicle mass, rolling resistance, and slope gravitational components).

[0107] Specifically, firstly, based on the actual longitudinal slope, the basic torque required by the vehicle to overcome the gravitational component along the slope direction, prevent slippage, or achieve uniform climbing is calculated. The magnitude of this basic torque is proportional to the sine of the slope and dynamically adjusts with changes in vehicle mass and rolling resistance. Simultaneously, based on the actual lateral slope, the lateral component of gravity acting on the vehicle on the transverse slope is assessed. The torque difference between the left and right drive wheels required to balance this lateral force and prevent unexpected sideslip or deviation from the driving trajectory is then calculated, generating the torque distribution ratio between the left and right wheels. Based on this, the calculated basic torque is differentially distributed according to this torque distribution ratio: a relatively larger driving torque is allocated to the wheels located on the upper side of the slope, while a relatively smaller driving torque is allocated to the lower-side wheels (or braking torque is applied when necessary), thereby creating an effective yaw moment to counteract the instability caused by the lateral slope. Ultimately, the vehicle drive system controls each drive motor to output corresponding torque based on the allocated target torque for the left and right wheels, so that the vehicle maintains stable climbing or parking ability in the longitudinal direction and good driving trajectory stability in the lateral direction, ensuring safe, stable and controllable operation under complex slope conditions.

[0108] Based on the above technical solution, this embodiment of the application dynamically determines the target torque and controls the vehicle by combining the actual longitudinal slope and the actual lateral slope. This enables more accurate compensation for the gravity component of the slope, effectively preventing the vehicle from slipping or lacking power when climbing. Simultaneously, by adjusting the torque distribution between the left and right wheels according to the lateral slope, the vehicle's driving stability on laterally inclined surfaces is improved, reducing the risk of sideslip. Overall, while ensuring safety, the accuracy and energy efficiency of drive control are improved.

[0109] Figure 3 A schematic diagram of the structure of a slope calculation device provided in an embodiment of this application is shown, as follows: Figure 3 As shown, the slope calculation device 300 includes: The acquisition module 310 is used to acquire the first state parameters of the vehicle at the first moment and the first input parameters of the vehicle at the first moment acquired by multiple sensors at the first moment. Module 320 is established to establish a discrete prediction equation based on the first state parameters, the first input parameters and the coupled dynamic equation. The discrete prediction equation can predict the second state parameters of the vehicle at the second time. The coupled dynamic equation is obtained by coupling the longitudinal dynamic equation and the lateral dynamic equation. The calculation module 330 is used to obtain the second observation parameters of the vehicle at the second time moment, and calculate the updated second state parameters based on the second observation parameters and the second state parameters. The correction module 340 is used to correct the updated second state parameters to obtain the actual longitudinal slope and actual lateral slope of the vehicle at the second moment.

[0110] In one possible implementation, the computing module 330 is used for: Based on the second state parameters and the measurement matrix, the third observation parameters are obtained; Calculate the difference between the second and third observation parameters; Based on the measurement matrix, determine the first gain coefficient; Based on the first gain coefficient and the difference, the second state parameters are calibrated, and the updated second state parameters are calculated.

[0111] In one possible implementation, the computing module 330 is used for: The first gain coefficient is obtained based on the error covariance matrix corresponding to the measurement matrix and the second state parameter.

[0112] In one possible implementation, the slope calculation device 300 includes a coupling module for: Based on the longitudinal acceleration, the first longitudinal speed, the first longitudinal gradient, and the yaw rate, the longitudinal dynamic equation is obtained; Based on the lateral acceleration, the first lateral vehicle speed, the first lateral slope, and the yaw rate, the lateral dynamics equation is obtained; By coupling the longitudinal and lateral dynamic equations, we obtain the coupled dynamic equations.

[0113] In one possible implementation, module 320 is established for: A slope change model is constructed based on the first longitudinal slope change rate and the first lateral slope change rate. Discretize the coupled dynamic equations and the slope change model to establish discrete prediction equations.

[0114] In one possible implementation, the slope calculation device 300 includes a building module for: Construct a measurement matrix whose dimensions correspond to the dimensions of the second state parameter and the second observation parameter. The values ​​of the elements in the measurement matrix are determined based on the correlation between the second state parameter and the second observation parameter.

[0115] In one possible implementation, the correction module 340 is used for: The actual longitudinal slope is obtained by correcting the second longitudinal slope based on the actual vehicle body pitch angle. The actual lateral slope is obtained by correcting the second lateral slope based on the actual vehicle body roll angle.

[0116] In one possible implementation, the slope calculation device further includes a control module for: The target torque is determined based on the actual longitudinal slope and the actual lateral slope. Vehicle control based on target torque.

[0117] It should be noted that the slope calculation device provided in the above embodiments is only illustrated by the division of the above functional modules when executing the slope calculation method. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the slope calculation device and the slope calculation method embodiments provided in the above embodiments belong to the same concept. Therefore, for details not disclosed in the device embodiments of this application, please refer to the embodiments of the slope calculation method of this application, which will not be repeated here.

[0118] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0119] Figure 4 This application provides a schematic diagram of the structure of a vehicle according to an embodiment of the present application. Figure 4 As shown, the vehicle 400 includes a memory 401 and a processor 402. The memory 401 stores executable program code 4011, and the processor 402 is used to call and execute the executable program code 4011, which is a slope calculation method.

[0120] This embodiment can divide the vehicle into functional modules according to the above method example. For example, each function can be assigned to a separate module, or two or more functions can be integrated into one processing module. The integrated module can be implemented in hardware. It should be noted that the module division in this embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods.

[0121] The vehicle provided in this embodiment is used to perform the slope calculation method described above, and therefore can achieve the same effect as the above implementation method.

[0122] The vehicle may include a processing module and a storage module. The processing module is used to control and manage the vehicle's actions. The storage module is used to support the vehicle in executing relevant program code and data.

[0123] The processing module may be a processor or a controller, which can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. The processor may also be a combination of functions that implement computing capabilities, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, etc., and the storage module may be a memory.

[0124] In addition, the vehicle provided in the embodiments of this application may specifically be a chip, component or module. The vehicle may include a connected processor and a memory. The memory is used to store instructions. When the vehicle is running, the processor may call and execute the instructions to make the chip execute a slope calculation method in the above embodiments.

[0125] This embodiment also provides a computer-readable storage medium storing computer program code. When the computer program code is run on a computer, the computer executes the aforementioned method steps to implement a slope calculation method in the above embodiment.

[0126] The computer-readable storage medium may include, but is not limited to, any type of disk, including floppy disks, optical disks, Digital Video Discs (DVDs), Compact Disc Read-Only Memory (CD-ROMs), microdrives, and magneto-optical disks, read-only memory (ROMs), random access memory (RAMs), erasable programmable read-only memory (EPROMs), electrically erasable programmable read-only memory (EEPROMs), dynamic random access memory (DRAMs), video random access memory (VRAMs), flash memory devices, magnetic cards or optical cards, nanosystems (including molecular memory ICs), or any type of medium or device suitable for storing instructions and / or data.

[0127] This embodiment also provides a computer program product that, when run on a computer, causes the computer to perform the aforementioned steps to implement the slope calculation method provided in the above embodiment.

[0128] In this embodiment, the vehicle, computer-readable storage medium, computer program product, or chip are all used to execute the corresponding slope calculation method provided above. Therefore, the beneficial effects that can be achieved can be referred to the beneficial effects in the corresponding slope calculation method provided above, and will not be repeated here.

[0129] Through the above description of the embodiments, those skilled in the art will understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0130] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0131] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A slope calculation method, characterized in that, Applied to vehicles, the method includes: The first state parameters of the vehicle at a first moment and the first input parameters of the vehicle at the first moment obtained by multiple sensors of the vehicle are acquired. Based on the first state parameter, the first input parameter, and the coupled dynamic equation, a discrete prediction equation is established. The discrete prediction equation can predict the second state parameter of the vehicle at the second time. The coupled dynamic equation is obtained by coupling the longitudinal dynamic equation and the lateral dynamic equation. Obtain the second observation parameters of the vehicle at the second time, and calculate the updated second state parameters based on the second observation parameters and the second state parameters; The updated second state parameters are corrected to obtain the actual longitudinal slope and actual lateral slope of the vehicle at the second moment.

2. The method according to claim 1, characterized in that, The step of calculating the updated second state parameter based on the second observation parameter and the second state parameter includes: Based on the second state parameters and the measurement matrix, the third observation parameters are obtained; Calculate the difference between the second observation parameter and the third observation parameter; Based on the measurement matrix, determine the first gain coefficient; Based on the first gain coefficient and the difference, the second state parameter is calibrated, and the updated second state parameter is calculated.

3. The method according to claim 2, characterized in that, Determining the first gain coefficient based on the measurement matrix includes: The first gain coefficient is obtained based on the measurement matrix and the error covariance matrix corresponding to the second state parameter.

4. The method according to claim 1, characterized in that, The first state parameters include a first longitudinal vehicle speed, a first lateral vehicle speed, a first longitudinal gradient, and a first lateral gradient; the first input parameters include longitudinal acceleration, lateral acceleration, and yaw rate; the method further includes: The longitudinal dynamic equation is obtained based on the longitudinal acceleration, the first longitudinal vehicle speed, the first longitudinal slope, and the yaw rate. The lateral dynamics equation is obtained based on the lateral acceleration, the first lateral vehicle speed, the first lateral slope, and the yaw rate. The longitudinal dynamic equation and the lateral dynamic equation are coupled to obtain the coupled dynamic equation.

5. The method according to claim 1, characterized in that, The first state parameters also include a first longitudinal slope change rate and a first lateral slope change rate. The step of establishing a discrete prediction equation based on the first state parameters, the first input parameters, and the coupled dynamic equation includes: Based on the first longitudinal slope change rate and the first lateral slope change rate, a slope change model is constructed; The coupled dynamic equations and the slope change model are discretized to establish the discrete prediction equations.

6. The method according to claim 1, characterized in that, The second observation parameters include the second longitudinal vehicle speed, pitch rate, and roll rate. The method further includes: A measurement matrix is ​​constructed, the dimensions of which correspond to the dimensions of the second state parameter and the second observation parameter, and the values ​​of the elements in the measurement matrix are determined according to the correlation between the second state parameter and the second observation parameter.

7. The method according to claim 1, characterized in that, The second state parameters include a second longitudinal slope and a second lateral slope. The step of correcting the updated second state parameters to obtain the actual longitudinal slope and actual lateral slope of the vehicle at the second moment includes: The actual longitudinal slope is obtained by correcting the second longitudinal slope based on the actual vehicle body pitch angle. The actual lateral slope is obtained by correcting the second lateral slope based on the actual vehicle body roll angle.

8. The method according to claim 1, characterized in that, After obtaining the actual longitudinal slope and actual lateral slope of the vehicle at the second moment, the method further includes: The target torque is determined based on the actual longitudinal slope and the actual lateral slope; The vehicle is controlled based on the target torque.

9. A vehicle, characterized in that, The vehicles include: Memory, used to store executable program code; A processor is configured to call and run the executable program code from the memory, causing the vehicle to perform the slope calculation method as described in any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed, implements the slope calculation method as described in any one of claims 1 to 8.