Vehicle deviation prevention method and apparatus, computer device, and storage medium
By judging the vehicle's straight-line state and the rate of change of offset, and combining multi-dimensional sensor data, the problem of insufficient sensitivity and accuracy in the existing technology of preventing vehicle deviation has been solved, realizing imperceptible deviation correction and improving driving safety and comfort.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- GUANGZHOU AUTOMOBILE GROUP CO LTD
- Filing Date
- 2026-01-05
- Publication Date
- 2026-07-30
AI Technical Summary
Existing car anti-velocity technologies lack sensitivity and precision, causing drivers to feel significant changes in steering force, which affects driving stability and comfort.
By determining whether the vehicle is traveling straight, the rate of change of offset is obtained. When the rate of change of offset exceeds a threshold, the target motor torque is determined based on the rate of change of offset to control the drive motor. By combining multi-dimensional sensor data such as lane curvature, steering angle, and longitudinal acceleration, the accuracy of judgment and response speed are improved.
It enables efficient deviation correction without interfering with the driver's steering effort, improving vehicle safety and comfort while reducing hardware upgrade costs.
Smart Images

Figure CN2026070323_30072026_PF_FP_ABST
Abstract
Description
Vehicle anti-vehicle deviation methods, devices, computer equipment and storage media
[0001] This application claims priority to Chinese Patent Application No. 202510097926.5, filed on January 21, 2025, entitled “Method, Device, Computer Equipment and Storage Medium for Preventing Vehicle Deviation”, the entire contents of which are incorporated herein by reference. Technical Field
[0002] This application relates to the field of intelligent driving, and in particular to a method, device, computer equipment, and storage medium for preventing vehicle deviation. Background Technology
[0003] With the development of the automotive industry, vehicle safety and driving experience have become the focus of consumers' attention. During vehicle operation, pulling to one side is a common safety hazard, affecting not only driving stability but also potentially threatening passenger comfort and overall driving safety. To address this issue, existing anti-pulling technologies primarily rely on monitoring vehicle state parameters to identify the vehicle's yaw angle and adjusting the electric power steering system accordingly to correct the pulling. However, these technologies lack sufficient sensitivity and precision in practical applications, and the pull-off correction directly affects the steering mechanism, resulting in a noticeable change in steering force for the driver and a less natural and smoother perception of vehicle control. Summary of the Invention
[0004] Therefore, it is necessary to provide a method, device, computer equipment, and storage medium for preventing vehicle deviation in order to improve the safety and comfort of vehicle driving.
[0005] A method for preventing a car from veering off course includes:
[0006] Determine whether the vehicle is traveling straight;
[0007] If the vehicle is traveling straight, obtain the rate of change of the vehicle's offset distance;
[0008] Determine whether the rate of change of the offset distance is greater than the threshold for the rate of change of the offset distance;
[0009] If the offset change rate is greater than the offset change rate threshold, then the target motor torque is determined based on the offset change rate, so that the drive motor controller executes the target motor torque.
[0010] Optionally, determining whether the vehicle is traveling straight includes:
[0011] Obtain the lane curvature in front of the vehicle;
[0012] Determine whether the lane curvature is greater than a preset curvature threshold;
[0013] If the lane curvature is greater than the preset curvature threshold, the vehicle is determined to be in a non-straight-going state.
[0014] If the lane curvature is less than or equal to the preset curvature threshold, the vehicle is determined to be in a straight-going state.
[0015] By detecting lane curvature, we can not only improve the accuracy of judging the straight-ahead status of vehicles, but also better support the vehicle anti-drift function, ensuring driving safety and comfort.
[0016] Optionally, determining whether the vehicle is traveling straight includes:
[0017] Obtain the steering angle of the vehicle;
[0018] Determine whether the steering angle is greater than a preset steering angle threshold;
[0019] If the steering angle is greater than the preset steering angle threshold, the vehicle is determined to be in a non-straight-going state.
[0020] If the steering angle is less than or equal to the preset steering angle threshold, the vehicle is determined to be in a straight-ahead state.
[0021] By detecting the steering angle, we can not only improve the accuracy of judging the straight-line state of the vehicle, but also better support the vehicle's anti-drift function, ensuring driving safety and comfort.
[0022] Optionally, determining whether the vehicle is traveling straight includes:
[0023] Obtain the longitudinal acceleration of the vehicle;
[0024] Determine whether the longitudinal acceleration is greater than a preset acceleration threshold;
[0025] If the absolute value of the longitudinal acceleration is greater than the preset acceleration threshold, the vehicle is determined to be in a non-straight-line state.
[0026] If the absolute value of the longitudinal acceleration is less than or equal to the preset acceleration threshold, the vehicle is determined to be traveling in a straight line.
[0027] By introducing longitudinal acceleration as an additional criterion, it is possible to more accurately distinguish between straight and non-straight driving states, especially when the vehicle is undergoing rapid acceleration or deceleration, thus reducing the possibility of misjudgment.
[0028] Optionally, determining whether the vehicle is traveling straight includes:
[0029] The curvature of the lane in front of the vehicle, the steering angle of the vehicle, and the longitudinal acceleration are obtained.
[0030] If the lane curvature is greater than a preset curvature threshold, the steering angle is greater than a preset steering angle threshold, or the absolute value of the longitudinal acceleration is greater than a preset acceleration threshold, then the vehicle is determined to be in a non-straight-going state.
[0031] If the lane curvature is less than or equal to a preset curvature threshold, the steering angle is less than or equal to a preset steering angle threshold, and the longitudinal acceleration is less than or equal to a preset acceleration threshold, then the vehicle is determined to be in a straight-ahead state.
[0032] By simultaneously considering lane curvature, steering angle, and longitudinal acceleration, it can more accurately distinguish between straight and non-straight driving states, reducing the possibility of misjudgment based on a single parameter. Before confirming that the vehicle is in a straight driving state, it ensures that there are no obvious steering operations, abrupt acceleration / deceleration behaviors, or situations about to enter a curve, thereby improving driving safety. Combining data from multiple sensors provides a multi-dimensional state judgment mechanism, increasing the reliability and fault tolerance of the anti-deviation system.
[0033] Optionally, obtaining the lane curvature in front of the vehicle includes:
[0034] Acquire images of the road ahead captured by the forward-facing camera;
[0035] Extract lane line position information from the road condition image ahead;
[0036] The lane curvature is determined based on the lane line position information. This can improve lane line recognition accuracy and enhance the accuracy of lane curvature calculation.
[0037] Optionally, obtaining the rate of change of the vehicle's offset includes:
[0038] Acquire a first and a second forward-facing road condition image captured by a forward-facing camera; the time difference between the capture time of the first and second forward-facing road condition images is a specified time difference.
[0039] The lane offset distance difference is determined based on the first forward road condition image and the second forward road condition image;
[0040] The offset time change rate is determined based on the specified time difference and the lane offset distance difference; the offset change rate includes the offset time change rate.
[0041] By using images from two different time points to calculate the offset difference, the lateral movement of a vehicle relative to the lane centerline over a short period of time can be more accurately reflected. Obtaining an accurate rate of change in offset helps to adjust the vehicle's driving status in a timely manner, especially when it is necessary to keep the vehicle centered in the lane, allowing for the implementation of necessary control measures in advance, thus improving driving safety and stability.
[0042] Optionally, obtaining the rate of change of the vehicle's offset includes:
[0043] Acquire a first and a second forward-facing road condition image captured by a forward-facing camera; the time difference between the capture time of the first and second forward-facing road condition images is a specified time difference.
[0044] The lane offset distance difference is determined based on the first forward road condition image and the second forward road condition image;
[0045] The vehicle speed is obtained, and the vehicle travel distance is determined based on the vehicle speed and the specified time difference.
[0046] The offset distance change rate is determined based on the difference between the vehicle travel distance and the lane offset distance; the offset distance change rate includes the offset distance change rate.
[0047] By combining vehicle speed and travel distance to calculate the rate of change of offset distance, the lateral movement of the vehicle relative to the lane centerline during driving can be more accurately reflected, avoiding errors that may be caused by relying solely on the rate of change of time. The fixed time difference and real-time vehicle speed data ensure the real-time response capability of the system, enabling the vehicle controller to react quickly when the vehicle shows a tendency to deviate. Accurate information on the rate of change of offset distance helps to adjust the vehicle's driving status in a timely manner, especially when it is necessary to keep the vehicle centered in the lane, allowing for the implementation of necessary control measures in advance, thereby improving driving safety and stability.
[0048] Optionally, determining the lane offset distance difference based on the first forward road condition image and the second forward road condition image includes:
[0049] Extract the position information of the first lane line from the first forward road condition image; extract the position information of the second lane line from the second forward road condition image;
[0050] Determine the first lane offset distance based on the first lane line position information; determine the second lane offset distance based on the second lane line position information;
[0051] The lane offset difference is determined based on the first lane offset distance and the second lane offset distance.
[0052] Precise lane line recognition ensures the accuracy of lane departure distance calculation, reducing errors caused by image noise or environmental factors. Fast image processing and efficient algorithm design ensure the system's real-time response capability, enabling the vehicle system to react quickly when the vehicle shows a tendency to deviate. Accurate lane departure distance information helps to adjust the vehicle's driving status in a timely manner, take necessary control measures in advance, and improve driving safety and stability.
[0053] Optionally, determining the target motor torque based on the rate of change of the offset includes:
[0054] Obtain the vehicle model parameters;
[0055] The motor compensation torque is determined based on the vehicle model parameters and the offset change rate.
[0056] Based on the vehicle's motor architecture and the motor's compensation torque, the compensation distribution torque is determined;
[0057] The target motor torque is determined based on the compensated distribution torque and the initial target torque.
[0058] By combining vehicle model parameters and offset change rate, the accuracy of motor compensation torque calculation is ensured, reducing errors caused by differences in vehicle characteristics. The fast control algorithm and efficient torque distribution mechanism ensure the system's real-time response capability, enabling the system to react quickly when the vehicle shows a tendency to deviate. Accurate motor compensation torque information helps to adjust the vehicle's driving status in a timely manner, especially when entering curves or needing to maintain lane centering, allowing for necessary control measures to be taken in advance, thus improving driving safety and stability. By performing deviation correction through target motor torque, deviation correction can be achieved without interfering with the driver's steering effort, eliminating the feeling of the machine grabbing the steering wheel, and efficiently achieving imperceptible deviation correction, greatly enhancing the user's driving experience.
[0059] A vehicle anti-vehicle drift device, comprising:
[0060] The straight-ahead status determination module is used to determine whether the vehicle is in a straight-ahead state;
[0061] The offset change rate calculation module is used to obtain the offset change rate of the vehicle if the vehicle is in a straight-ahead state.
[0062] The rate of change judgment module is used to determine whether the rate of change of the offset distance is greater than the rate of change of the offset distance threshold.
[0063] The target motor torque determination module is used to determine the target motor torque based on the offset change rate if the offset change rate is greater than the offset change rate threshold, so that the drive motor controller executes the target motor torque.
[0064] Optionally, the straight-ahead state determination module includes:
[0065] The acquisition unit is used to acquire the lane curvature in front of the vehicle, the vehicle's steering angle, and longitudinal acceleration.
[0066] The straight-ahead state determination unit is used to determine that the vehicle is in a straight-ahead state when the lane curvature is less than or equal to a preset curvature threshold, the steering angle is less than or equal to a preset steering angle threshold, and the longitudinal acceleration is less than or equal to a preset acceleration threshold.
[0067] By simultaneously considering lane curvature, steering angle, and longitudinal acceleration, it can more accurately distinguish between straight and non-straight driving states, reducing the possibility of misjudgment based on a single parameter. Before confirming that the vehicle is in a straight driving state, it ensures that there are no obvious steering operations, abrupt acceleration / deceleration behaviors, or situations about to enter a curve, thereby improving driving safety. Combining data from multiple sensors provides a multi-dimensional state judgment mechanism, increasing the reliability and fault tolerance of the anti-deviation system.
[0068] Optionally, the module for determining the target motor torque includes:
[0069] The vehicle model parameter acquisition unit is used to acquire the vehicle model parameters of the vehicle.
[0070] A motor compensation torque determination unit is used to determine the motor compensation torque based on the vehicle model parameters and the offset change rate.
[0071] A compensation distribution torque determination unit is used to determine the compensation distribution torque based on the vehicle's motor architecture and the motor compensation torque.
[0072] A target motor torque determination unit is used to determine the target motor torque based on the compensated torque and the initial target torque. By combining vehicle model parameters and the offset change rate, the accuracy of the motor compensation torque calculation is ensured, reducing errors caused by differences in vehicle characteristics. The fast control algorithm and efficient torque distribution mechanism ensure the system's real-time response capability, enabling the system to react quickly when the vehicle shows a tendency to deviate. Accurate motor compensation torque information helps to adjust the vehicle's driving state in a timely manner, especially when entering curves or needing to maintain lane centering, allowing for necessary control measures to be taken in advance, improving driving safety and stability. By performing drift correction through the target motor torque, drift correction can be achieved without interfering with the driver's steering effort, eliminating the feeling of the machine grabbing the steering wheel, and efficiently achieving imperceptible drift correction, greatly enhancing the user's driving experience.
[0073] A computer device includes a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, wherein the processor implements the above-described vehicle anti-deviation method when executing the computer-readable instructions.
[0074] One or more readable storage media storing computer-readable instructions, which, when executed by one or more processors, cause the one or more processors to perform the vehicle anti-deviation method described above.
[0075] The aforementioned vehicle anti-vehicle drift method, device, computer equipment, and storage medium reduce false alarms and enhance the robustness of anti-vehicle drift monitoring by determining whether the vehicle is traveling straight. If the vehicle is traveling straight, the system acquires the rate of change of the vehicle's offset distance to quickly detect any potential deviation trends. It then determines whether the rate of change of the offset distance is greater than a threshold value to decide whether to perform drift compensation. If the rate of change of the offset distance is greater than the threshold value, a target motor torque is determined based on the rate of change of the offset distance, causing the drive motor controller to execute the target motor torque. This reduces the need for manual corrections by the driver and provides a smoother and more comfortable driving experience. This application determines whether a vehicle is veering off course by detecting both straight-line status and the rate of change of offset, greatly improving the safety and stability of vehicle veering control. Various parameters during the veering control process can be provided by the existing vehicle infotainment system, requiring only software integration without increasing hardware costs, thus significantly reducing vehicle upgrade costs. By using the target motor torque to perform veering correction, it can achieve correction without interfering with the driver's steering effort, eliminating the feeling of the machine grabbing the steering wheel. This efficient and imperceptible veering correction greatly enhances the user's driving experience. Attached Figure Description
[0076] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0077] Figure 1 is a flowchart of a method for preventing vehicle deviation in one embodiment of this application;
[0078] Figure 2 is a structural schematic diagram of a vehicle anti-drift device according to an embodiment of this application;
[0079] Figure 3 is a schematic diagram of a computer device according to an embodiment of this application. Detailed Implementation
[0080] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0081] In one embodiment, as shown in FIG1, a method for preventing vehicle deviation is provided, including the following steps S10-S40.
[0082] S10. Determine whether the vehicle is traveling straight.
[0083] S20. If the vehicle is traveling straight, obtain the rate of change of the vehicle's offset distance;
[0084] S30. Determine whether the rate of change of the offset distance is greater than the threshold of the rate of change of the offset distance;
[0085] S40. If the offset change rate is greater than the offset change rate threshold, then the target motor torque is determined based on the offset change rate, so that the drive motor controller executes the target motor torque.
[0086] Understandably, the onboard controller can determine whether the vehicle is traveling straight by collecting various state parameters from the vehicle's infotainment system. These state parameters include, but are not limited to, steering angle, lane keeping assist (LKA) sensor data, and longitudinal acceleration. For example, the steering angle provided by the steering angle sensor can be read to confirm that the vehicle is not actively steering. Lane keeping assist sensor data can be obtained by using information from the forward-facing camera or other sensors to assess the vehicle's position relative to the lane. When traveling straight, the vehicle stably remains parallel to the lane centerline. Longitudinal acceleration, the acceleration along the vehicle's direction of travel, is an important parameter for assessing the vehicle's driving status. By monitoring longitudinal acceleration, it can be determined whether the vehicle is in a smooth driving state or whether there has been any sudden acceleration or deceleration.
[0087] If the vehicle is traveling straight, the onboard controller calculates the rate of change of the vehicle's offset to determine whether to perform anti-vehicle drift correction. If the vehicle is not traveling straight, no anti-vehicle drift correction is performed. The rate of change of offset describes the speed at which the vehicle's position relative to the lane centerline changes over time or distance traveled. The rate of change of offset is an important parameter for assessing whether the vehicle has deviated from its intended driving path.
[0088] A reasonable offset change rate threshold can be set to distinguish between small fluctuations under normal driving conditions and large deviations that could lead to unstable driving. If the calculated offset change rate exceeds the threshold, it indicates that the vehicle is at risk of deviating from its lane. If the calculated offset change rate does not exceed the threshold, it means that the vehicle is currently driving normally and has not deviated from its lane.
[0089] If the detected offset change rate exceeds the offset change rate threshold, measures need to be taken to correct the vehicle's trajectory. The onboard controller can calculate an appropriate compensation torque value ΔT based on the magnitude of the offset change rate and other vehicle parameters (such as wheelbase, track width, and weight). This compensation torque is then added to the original target motor torque to form a new target motor torque Tnew. The updated target motor torque Tnew is sent to the drive motor controller, guiding the drive motors on both sides to operate according to the new settings. Simultaneously, the onboard controller should continuously monitor the vehicle's status, including but not limited to vehicle speed, acceleration, and steering angle, to ensure good driving performance even in complex driving environments.
[0090] In steps S10-S40, determining whether the vehicle is traveling straight reduces false alarms and enhances the robustness of anti-deviation monitoring. If the vehicle is traveling straight, the rate of change of the vehicle's offset is obtained to quickly detect any potential deviation trends. It is then determined whether the rate of change of the offset is greater than a threshold to determine whether to perform deviation compensation. If the rate of change of the offset is greater than the threshold, the target motor torque is determined based on the rate of change of the offset, so that the drive motor controller executes the target motor torque, reducing the manual correction actions required by the driver and providing a smoother and more comfortable driving experience.
[0091] This embodiment determines whether the vehicle is veering off course by detecting both straight-line status and the rate of change of offset, greatly improving the safety and stability of vehicle veering control. Various parameters during the veering control process can be provided by the existing vehicle infotainment system, requiring only software integration without increasing hardware costs, thus significantly reducing vehicle upgrade costs. By using the target motor torque to perform veering correction, it can achieve correction without interfering with the driver's steering effort, eliminating the feeling of the machine grabbing the steering wheel. This efficient and imperceptible veering correction greatly enhances the user's driving experience.
[0092] Optionally, step S10, namely determining whether the vehicle is traveling straight, includes:
[0093] S111. Obtain the lane curvature in front of the vehicle and determine whether the lane curvature is greater than a preset curvature threshold.
[0094] S112. If the lane curvature is greater than the preset curvature threshold, then the vehicle is determined to be in a non-straight-going state.
[0095] S113. If the lane curvature is less than or equal to the preset curvature threshold, then the vehicle is determined to be in a straight-going state.
[0096] Understandably, a forward-facing camera can capture an image of the road ahead of the vehicle, and lane lines can be identified using edge detection, Hough transform, or deep learning models. After identifying the lane lines, lane curvature can be calculated by fitting a polynomial curve (such as a quadratic or cubic polynomial) onto the detected lane lines.
[0097] The preset curvature threshold can be set based on vehicle characteristics and expected safety standards. Specifically, the preset curvature threshold can be determined based on experimental data, regulatory requirements, or manufacturer standards. The calculated lane curvature is compared with the preset curvature threshold. If the lane curvature is greater than the preset curvature threshold, it indicates that the vehicle is traveling on a non-straight road, and therefore the vehicle can be determined to be in a non-straight-moving state.
[0098] This embodiment, by detecting lane curvature, can not only improve the accuracy of judging the straight-ahead state of a vehicle, but also better support the vehicle's anti-deviation function, ensuring driving safety and comfort.
[0099] Optionally, step S10, namely determining whether the vehicle is traveling straight, includes:
[0100] S121. Obtain the steering angle of the vehicle and determine whether the steering angle is greater than a preset steering angle threshold.
[0101] S122. If the steering angle is greater than the preset steering angle threshold, the vehicle is determined to be in a non-straight-going state.
[0102] S123. If the steering angle is less than or equal to the preset steering angle threshold, then the vehicle is determined to be in a straight-going state.
[0103] Understandably, the vehicle's steering angle can be obtained using an onboard steering angle sensor. A preset steering angle threshold can be set based on vehicle characteristics and expected safety standards. Specifically, the preset steering angle threshold can be determined based on experimental data, regulatory requirements, or manufacturer standards. The obtained steering angle is then compared to the preset steering angle threshold. If the steering angle is greater than the preset steering angle threshold, it indicates that the vehicle is turning, and therefore, it can be determined that the vehicle is not traveling straight.
[0104] This embodiment, by detecting the steering angle, can not only improve the accuracy of judging the straight-ahead state of the vehicle, but also better support the vehicle's anti-drift function, ensuring driving safety and comfort.
[0105] Optionally, step S10, namely determining whether the vehicle is traveling straight, includes:
[0106] S131. Obtain the longitudinal acceleration of the vehicle and determine whether the absolute value of the longitudinal acceleration is greater than a preset acceleration threshold.
[0107] S132. If the absolute value of the longitudinal acceleration is greater than the preset acceleration threshold, then the vehicle is determined to be in a non-straight-going state.
[0108] S133. If the absolute value of the longitudinal acceleration is less than or equal to the preset acceleration threshold, then the vehicle is determined to be in a straight-line state.
[0109] The vehicle's longitudinal acceleration can be obtained through an onboard accelerometer. Longitudinal acceleration is the acceleration along the vehicle's direction of travel. A preset acceleration threshold can be set based on vehicle characteristics and expected safety standards. The absolute value of the obtained longitudinal acceleration is compared to the preset acceleration threshold. If the absolute value of the longitudinal acceleration is greater than the preset acceleration threshold, it indicates that the vehicle is undergoing rapid acceleration or deceleration, and therefore it can be determined that the vehicle is not traveling in a straight line.
[0110] This embodiment introduces longitudinal acceleration as an additional criterion, which can more accurately distinguish between straight and non-straight driving states, especially when the vehicle is undergoing rapid acceleration or deceleration, thus reducing the possibility of misjudgment.
[0111] Optionally, step S10, namely determining whether the vehicle is traveling straight, includes:
[0112] S141. Obtain the lane curvature in front of the vehicle, the vehicle's steering angle, and longitudinal acceleration;
[0113] S142. If the lane curvature is greater than a preset curvature threshold, the steering angle is greater than a preset steering angle threshold, or the absolute value of the longitudinal acceleration is greater than a preset acceleration threshold, then the vehicle is determined to be in a non-straight-going state.
[0114] S143. If the lane curvature is less than or equal to a preset curvature threshold, the steering angle is less than or equal to a preset steering angle threshold, and the longitudinal acceleration is less than or equal to a preset acceleration threshold, then the vehicle is determined to be in a straight-ahead state.
[0115] Understandably, the lane curvature in front of the vehicle, the vehicle's steering angle, and longitudinal acceleration can be obtained. Simultaneously, corresponding preset steering angle thresholds, preset steering angle thresholds, and preset acceleration thresholds are also obtained. The specific acquisition method can be referred to the steps in the above embodiment, and will not be repeated here. The vehicle is determined to be in a straight-ahead state only when the lane curvature is less than or equal to the preset curvature threshold, the steering angle is less than or equal to the preset steering angle threshold, and the longitudinal acceleration is less than or equal to the preset acceleration threshold.
[0116] This embodiment, by simultaneously considering lane curvature, steering angle, and longitudinal acceleration, can more accurately distinguish between straight and non-straight driving states, reducing the possibility of misjudgment based on a single parameter. Before confirming that the vehicle is in a straight driving state, it ensures that there are no obvious steering operations, violent acceleration / deceleration behaviors, or situations about to enter a curve, thereby improving driving safety. Combining data from multiple sensors provides a multi-dimensional state judgment mechanism, increasing the reliability and fault tolerance of the anti-deviation system.
[0117] Optionally, step S111, namely obtaining the lane curvature in front of the vehicle, includes:
[0118] S1111, Obtain the image of the road conditions ahead captured by the forward-facing camera;
[0119] S1112. Extract lane line position information from the road condition image ahead;
[0120] S1113. Determine the lane curvature based on the lane line position information.
[0121] Understandably, a high-resolution forward-facing camera is installed at the front of the vehicle and precisely calibrated to ensure clear and accurate images of the road ahead are captured. This allows for real-time acquisition of images of the road ahead within a certain distance range. These images can cover distances from tens to hundreds of meters, depending on the camera's focal length and angle of view.
[0122] Lane position information in images of road conditions ahead can be detected and extracted using Hough transform, deep learning models, or traditional rule-based methods. In some examples, lane lines are tracked between consecutive frames, and Kalman filters or particle filters are used to predict the approximate position of the lane lines in the next frame to improve detection efficiency and accuracy.
[0123] The lane line position information in the image is transformed into the world coordinate system. A series of points are selected along the detected lane line distribution and fitted with a quadratic or cubic polynomial to calculate the lane curvature.
[0124] This embodiment can improve lane line recognition accuracy and enhance the accuracy of lane curvature calculation.
[0125] Optionally, step S20, namely obtaining the rate of change of the vehicle's offset distance, includes:
[0126] S211. Acquire a first forward road condition image and a second forward road condition image captured by a forward-facing camera; the time difference between the capture time of the first forward road condition image and the capture time of the second forward road condition image is a specified time difference.
[0127] S212. Determine the lane offset distance difference based on the first forward road condition image and the second forward road condition image;
[0128] S213. Determine the offset time change rate based on the specified time difference and the lane offset distance difference; the offset change rate includes the offset time change rate.
[0129] Understandably, two images of the road ahead, I1 and I2, taken at different times, can be acquired in real time. The time difference between their capture times is a specified time difference Δt. The specified time difference Δt can be set according to actual needs, such as 50 milliseconds or 100 milliseconds, to ensure that the time interval between the two images is small enough to capture the subtle movements of the vehicle, but not too short to cause data redundancy or increased noise.
[0130] Lane line position information is extracted from two images. Based on the extracted lane line position information, the distances d1 and d2 of the vehicle relative to the lane centerline in each image are calculated. The lane offset difference Δd = d2 - d1 is calculated between the two images. The lane offset difference Δd reflects the lateral displacement of the vehicle relative to the lane centerline within a specified time difference Δt.
[0131] The rate of change of lane offset over time (dt) is calculated using a specified time difference (Δt) and the lane offset difference (Δd). The unit of the rate of change of lane offset over time (dt) can be meters per second (m / s). The rate of change of lane offset over time (dt) describes the lateral velocity of the vehicle relative to the centerline of the lane.
[0132] This embodiment calculates the offset difference by using images from two different time points, which can more accurately reflect the lateral movement of the vehicle relative to the lane centerline in a short period of time. Obtaining an accurate offset change rate helps to adjust the vehicle's driving status in a timely manner, especially when it is necessary to keep the lane centered, so as to take necessary control measures in advance and improve driving safety and stability.
[0133] Optionally, step S20, namely obtaining the rate of change of the vehicle's offset distance, includes:
[0134] S221. Acquire a first forward road condition image and a second forward road condition image captured by a forward-facing camera; the time difference between the capture time of the first forward road condition image and the capture time of the second forward road condition image is a specified time difference.
[0135] S222. Determine the lane offset distance difference based on the first forward road condition image and the second forward road condition image;
[0136] S223. Obtain the vehicle speed and determine the vehicle travel distance based on the vehicle speed and the specified time difference;
[0137] S224. Determine the offset distance change rate based on the difference between the vehicle travel distance and the lane offset distance; the offset distance change rate includes the offset distance change rate.
[0138] Understandably, the vehicle's speed v can be acquired in real time using built-in speed sensors (such as wheel speed sensors). The vehicle speed v and a specified time difference Δt are used to calculate the vehicle's travel distance Δs during this time. The rate of change of lane offset ds is calculated using the travel distance Δs and the lane offset difference Δd. The unit of the rate of change of lane offset ds can be offset per meter (m / m). The rate of change of lane offset ds describes the rate of change of the vehicle's lateral displacement relative to the lane centerline after traveling a certain distance.
[0139] This embodiment calculates the offset distance change rate by combining vehicle speed and travel distance, which can more accurately reflect the lateral movement of the vehicle relative to the lane centerline during driving, avoiding errors that may be caused by relying solely on the time change rate. The fixed time difference and real-time vehicle speed data ensure the system's real-time response capability, allowing the vehicle controller to react quickly when the vehicle shows a tendency to deviate. Accurate offset distance change rate information helps to adjust the vehicle's driving status in a timely manner, especially when it is necessary to keep the vehicle centered in the lane, allowing for the implementation of necessary control measures in advance, thereby improving driving safety and stability.
[0140] Optionally, step S202, namely determining the lane offset distance difference based on the first forward road condition image and the second forward road condition image, includes:
[0141] S2021. Extract the position information of the first lane line from the first forward road condition image; extract the position information of the second lane line from the second forward road condition image;
[0142] S2022. Determine the first lane offset distance based on the first lane line position information; determine the second lane offset distance based on the second lane line position information;
[0143] S2023. Determine the lane offset difference based on the first lane offset distance and the second lane offset distance.
[0144] Understandably, the first and second road condition images ahead can be preprocessed, such as by grayscale conversion or binarization, to obtain a first preprocessed image and a second preprocessed image. An edge detection algorithm is used to identify significant edges in the images. Lane line position information in the first and second preprocessed images is detected and extracted using Hough transform, deep learning models, or traditional rule-based methods. In some examples, a classifier capable of recognizing different types of lane lines (solid lines, dashed lines, double yellow lines, etc.) can be pre-trained.
[0145] Based on the extracted first lane line position information, the position of the first lane centerline is calculated, and the lateral distance between the vehicle's center of gravity and the first lane centerline is determined, i.e., the first lane offset distance. Similarly, based on the extracted second lane line position information, the position of the second lane centerline is calculated, and the lateral distance between the vehicle's center of gravity and the second lane centerline is determined, i.e., the second lane offset distance.
[0146] The difference between the first lane offset and the second lane offset is called the lane offset difference. The lane offset difference reflects the change in the vehicle's lateral displacement relative to the lane centerline during this time period.
[0147] This embodiment ensures the accuracy of lane departure distance calculation through precise lane line recognition, reducing errors caused by image noise or environmental factors; the fast image processing flow and efficient algorithm design ensure the system's real-time response capability, enabling the vehicle system to react quickly when the vehicle shows a tendency to deviate; accurate lane departure distance information helps to adjust the vehicle's driving status in a timely manner, take necessary control measures in advance, and improve driving safety and stability.
[0148] Optionally, step S40, namely determining the target motor torque based on the rate of change of the offset distance, includes:
[0149] S401. Obtain the vehicle model parameters;
[0150] S402. Determine the motor compensation torque based on the vehicle model parameters and the offset change rate;
[0151] S403. Determine the compensation distribution torque based on the vehicle's motor architecture and the motor compensation torque;
[0152] S404. Determine the target motor torque based on the compensation distribution torque and the initial target torque.
[0153] Understandably, vehicle model parameters can be read from the vehicle's internal network (such as the CAN bus) using the Vehicle Identification Number (VIN) or an interface provided by the manufacturer. Here, model parameters refer to parameters related to motor control, such as vehicle weight, axle joints, wheelbase, drive type, motor type, and location.
[0154] Based on vehicle dynamics principles, a mathematical model incorporating offset change rate and vehicle model parameters is established to predict the required compensation torque. The vehicle's motor architecture is analyzed, including the number, location, and power distribution of the motors. Based on this architecture, optimization algorithms (such as least squares or genetic algorithms) are used to allocate the motor compensation torque to each motor; the allocated motor compensation torque is then known as the compensation distribution torque.
[0155] The initial target torque is the motor torque set by the driver's throttle input or other advanced driver assistance systems (such as cruise control). The target motor torque is obtained by superimposing the compensation torque and the initial target torque.
[0156] This embodiment ensures the accuracy of motor compensation torque calculation by combining vehicle model parameters and offset change rate, reducing errors caused by differences in vehicle characteristics. The fast control algorithm and efficient torque distribution mechanism ensure the system's real-time response capability, enabling the system to react quickly when the vehicle shows a tendency to deviate. Accurate motor compensation torque information helps to adjust the vehicle's driving state in a timely manner, especially when entering curves or needing to maintain lane centering, allowing for necessary control measures to be taken in advance, thus improving driving safety and stability. By performing deviation correction through target motor torque, deviation correction can be achieved without interfering with the driver's steering effort, eliminating the feeling of the machine grabbing the steering wheel, and efficiently achieving imperceptible deviation correction, greatly enhancing the user's driving experience.
[0157] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0158] In one embodiment, a vehicle anti-vehicle drift device is provided, which corresponds one-to-one with the vehicle anti-vehicle drift methods described in the above embodiments. As shown in Figure 2, the vehicle anti-vehicle drift device includes:
[0159] The straight-ahead state determination module 10 is used to determine whether the vehicle is in a straight-ahead state;
[0160] The offset change rate calculation module 20 is used to obtain the offset change rate of the vehicle if the vehicle is in a straight-moving state.
[0161] The rate of change judgment module 30 is used to determine whether the rate of change of the offset distance is greater than the rate of change of the offset distance threshold.
[0162] The target motor torque determination module 40 is used to determine the target motor torque based on the offset change rate if the offset change rate is greater than the offset change rate threshold, so that the drive motor controller executes the target motor torque.
[0163] Optionally, the straight-ahead status determination module 10 is also used for:
[0164] Obtain the lane curvature in front of the vehicle;
[0165] Determine whether the lane curvature is greater than a preset curvature threshold;
[0166] If the lane curvature is greater than the preset curvature threshold, the vehicle is determined to be in a non-straight-going state.
[0167] If the lane curvature is less than or equal to the preset curvature threshold, the vehicle is determined to be in a straight-going state.
[0168] Optionally, the straight-ahead status determination module 10 is also used for:
[0169] Obtain the steering angle of the vehicle;
[0170] Determine whether the steering angle is greater than a preset steering angle threshold;
[0171] If the steering angle is greater than the preset steering angle threshold, the vehicle is determined to be in a non-straight-going state.
[0172] If the steering angle is less than or equal to the preset steering angle threshold, the vehicle is determined to be in a straight-ahead state.
[0173] Optionally, the straight-ahead status determination module 10 is also used for:
[0174] Obtain the longitudinal acceleration of the vehicle;
[0175] Determine whether the absolute value of the longitudinal acceleration is greater than a preset acceleration threshold;
[0176] If the absolute value of the longitudinal acceleration is greater than the preset acceleration threshold, the vehicle is determined to be in a non-straight-line state.
[0177] If the absolute value of the longitudinal acceleration is less than or equal to the preset acceleration threshold, the vehicle is determined to be traveling in a straight line.
[0178] Optionally, the straight-ahead state determination module includes:
[0179] The acquisition unit is used to acquire the lane curvature in front of the vehicle, the vehicle's steering angle, and longitudinal acceleration.
[0180] The straight-ahead state determination unit is used to determine that the vehicle is in a non-straight-ahead state if the lane curvature is greater than a preset curvature threshold, the steering angle is greater than a preset steering angle threshold, or the absolute value of the longitudinal acceleration is greater than a preset acceleration threshold; and to determine that the vehicle is in a straight-ahead state if the lane curvature is less than or equal to a preset curvature threshold, the steering angle is less than or equal to a preset steering angle threshold, and the longitudinal acceleration is less than or equal to a preset acceleration threshold.
[0181] Optionally, the acquisition unit includes:
[0182] The forward image acquisition unit is used to acquire images of the road conditions ahead captured by the forward-facing camera;
[0183] The lane line position extraction unit is used to extract lane line position information from the road condition image ahead;
[0184] A lane curvature determination unit is used to determine the lane curvature based on the lane line position information.
[0185] Optionally, the offset change rate calculation module 20 is also used for:
[0186] Acquire a first and a second forward-facing road condition image captured by a forward-facing camera; the time difference between the capture time of the first and second forward-facing road condition images is a specified time difference.
[0187] The lane offset distance difference is determined based on the first forward road condition image and the second forward road condition image;
[0188] The offset time change rate is determined based on the specified time difference and the lane offset distance difference; the offset change rate includes the offset time change rate.
[0189] Optionally, the offset change rate calculation module 20 is also used for:
[0190] Acquire a first and a second forward-facing road condition image captured by a forward-facing camera; the time difference between the capture time of the first and second forward-facing road condition images is a specified time difference.
[0191] The lane offset distance difference is determined based on the first forward road condition image and the second forward road condition image;
[0192] The vehicle speed is obtained, and the vehicle travel distance is determined based on the vehicle speed and the specified time difference.
[0193] The offset distance change rate is determined based on the difference between the vehicle travel distance and the lane offset distance; the offset distance change rate includes the offset distance change rate.
[0194] Optionally, determining the lane offset distance difference based on the first forward road condition image and the second forward road condition image includes:
[0195] Extract the position information of the first lane line from the first forward road condition image; extract the position information of the second lane line from the second forward road condition image;
[0196] Determine the first lane offset distance based on the first lane line position information; determine the second lane offset distance based on the second lane line position information;
[0197] The lane offset difference is determined based on the first lane offset distance and the second lane offset distance.
[0198] Optionally, the target motor torque determination module 40 includes:
[0199] The vehicle model parameter acquisition unit is used to acquire the vehicle model parameters of the vehicle.
[0200] A motor compensation torque determination unit is used to determine the motor compensation torque based on the vehicle model parameters and the offset change rate.
[0201] A compensation distribution torque determination unit is used to determine the compensation distribution torque based on the vehicle's motor architecture and the motor compensation torque.
[0202] A target motor torque determination unit is used to determine the target motor torque based on the compensated distribution torque and the initial target torque.
[0203] Specific limitations regarding vehicle anti-vehicle deviation devices can be found in the limitations of vehicle anti-vehicle deviation methods described above, and will not be repeated here. Each module in the aforementioned vehicle anti-vehicle deviation device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the corresponding operations of each module.
[0204] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram is shown in Figure 3. The computer device includes a processor, memory, network interface, display screen, and input device connected via a system bus. The processor of the computer device provides computing and control capabilities. The memory of the computer device includes a readable storage medium and internal memory. The non-volatile storage medium stores an operating system and computer-readable instructions. The internal memory provides an environment for the operation of the operating system and computer-readable instructions in the readable storage medium. The network interface of the computer device is used to communicate with an external server via a network connection. When the computer-readable instructions are executed by the processor, a method for preventing vehicle deviation is implemented. The readable storage medium provided in this embodiment includes both non-volatile and volatile readable storage media.
[0205] In one embodiment, a computer device is provided, including a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, wherein the processor performs the following steps when executing the computer-readable instructions:
[0206] Determine whether the vehicle is traveling straight;
[0207] If the vehicle is traveling straight, obtain the rate of change of the vehicle's offset distance;
[0208] Determine whether the rate of change of the offset distance is greater than the threshold for the rate of change of the offset distance;
[0209] If the offset change rate is greater than the offset change rate threshold, then the target motor torque is determined based on the offset change rate, so that the drive motor controller executes the target motor torque.
[0210] In one embodiment, one or more computer-readable storage media storing computer-readable instructions are provided. The readable storage media provided in this embodiment include non-volatile readable storage media and volatile readable storage media. The readable storage media stores computer-readable instructions, which, when executed by one or more processors, perform the following steps:
[0211] Determine whether the vehicle is traveling straight;
[0212] If the vehicle is traveling straight, obtain the rate of change of the vehicle's offset distance;
[0213] Determine whether the rate of change of the offset distance is greater than the threshold for the rate of change of the offset distance;
[0214] If the offset change rate is greater than the offset change rate threshold, then the target motor torque is determined based on the offset change rate, so that the drive motor controller executes the target motor torque.
[0215] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing related hardware with computer-readable instructions. These computer-readable instructions can be stored in a non-volatile readable storage medium or a volatile readable storage medium. When executed, these computer-readable instructions can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0216] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0217] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A method of preventing a vehicle from running off a road, wherein, include: Determine whether the vehicle is traveling straight; If the vehicle is traveling straight, obtain the rate of change of the vehicle's offset distance; Determine whether the rate of change of the offset distance is greater than the threshold for the rate of change of the offset distance; If the offset change rate is greater than the offset change rate threshold, then the target motor torque is determined based on the offset change rate, so that the drive motor controller executes the target motor torque.
2. The method of claim 1, wherein, The determination of whether the vehicle is traveling straight includes: Obtain the lane curvature in front of the vehicle; Determine whether the lane curvature is greater than a preset curvature threshold; If the lane curvature is greater than the preset curvature threshold, the vehicle is determined to be in a non-straight-going state. If the lane curvature is less than or equal to the preset curvature threshold, the vehicle is determined to be in a straight-going state.
3. The method of claim 1, wherein, The determination of whether the vehicle is traveling straight includes: Obtain the steering angle of the vehicle; Determine whether the steering angle is greater than a preset steering angle threshold; If the steering angle is greater than the preset steering angle threshold, the vehicle is determined to be in a non-straight-going state. If the steering angle is less than or equal to the preset steering angle threshold, the vehicle is determined to be in a straight-ahead state.
4. The method of claim 1, wherein, The determination of whether the vehicle is traveling straight includes: Obtain the longitudinal acceleration of the vehicle; Determine whether the absolute value of the longitudinal acceleration is greater than a preset acceleration threshold; If the absolute value of the longitudinal acceleration is greater than the preset acceleration threshold, the vehicle is determined to be in a non-straight-line state. If the absolute value of the longitudinal acceleration is less than or equal to the preset acceleration threshold, the vehicle is determined to be traveling in a straight line.
5. The method of claim 1, wherein, The determination of whether the vehicle is traveling straight includes: The curvature of the lane in front of the vehicle, the steering angle of the vehicle, and the longitudinal acceleration are obtained. If the lane curvature is greater than a preset curvature threshold, the steering angle is greater than a preset steering angle threshold, or the absolute value of the longitudinal acceleration is greater than a preset acceleration threshold, then the vehicle is determined to be in a non-straight-going state. If the lane curvature is less than or equal to a preset curvature threshold, the steering angle is less than or equal to a preset steering angle threshold, and the absolute value of the longitudinal acceleration is less than or equal to a preset acceleration threshold, then the vehicle is determined to be in a straight-ahead state.
6. The method of claim 2 or 5, wherein, The process of obtaining the lane curvature in front of the vehicle includes: Acquire images of the road ahead captured by the forward-facing camera; Extract lane line position information from the road condition image ahead; The lane curvature is determined based on the lane line position information.
7. The method of claim 1, wherein, The step of obtaining the rate of change of the vehicle's offset includes: Acquire a first and a second forward-facing road condition image captured by a forward-facing camera; the time difference between the capture time of the first and second forward-facing road condition images is a specified time difference. The lane offset distance difference is determined based on the first forward road condition image and the second forward road condition image; The offset time change rate is determined based on the specified time difference and the lane offset distance difference; the offset change rate includes the offset time change rate.
8. The method of claim 1, wherein, The step of obtaining the rate of change of the vehicle's offset includes: Acquire a first and a second forward-facing road condition image captured by a forward-facing camera; the time difference between the capture time of the first and second forward-facing road condition images is a specified time difference. The lane offset distance difference is determined based on the first forward road condition image and the second forward road condition image; The vehicle speed is obtained, and the vehicle travel distance is determined based on the vehicle speed and the specified time difference. The deviation distance change rate is determined based on the difference between the vehicle travel distance and the lane deviation distance; the deviation distance change rate includes the deviation distance change rate.
9. The vehicle antiweave method of claim 7 or 8 wherein, Determining the lane offset difference based on the first forward road condition image and the second forward road condition image includes: Extract the position information of the first lane line from the first forward road condition image; extract the position information of the second lane line from the second forward road condition image; Determine the first lane offset distance based on the first lane line position information; determine the second lane offset distance based on the second lane line position information; The lane offset difference is determined based on the first lane offset distance and the second lane offset distance.
10. The method of claim 1, wherein, Determining the target motor torque based on the rate of change of the offset includes: Obtain the vehicle model parameters; The motor compensation torque is determined based on the vehicle model parameters and the offset change rate. Based on the vehicle's motor architecture and the motor's compensation torque, the compensation distribution torque is determined; The target motor torque is determined based on the compensated distribution torque and the initial target torque.
11. A vehicle anti-drift device wherein, include: The straight-ahead status determination module is used to determine whether the vehicle is in a straight-ahead state; The offset change rate calculation module is used to obtain the offset change rate of the vehicle if the vehicle is in a straight-ahead state. The rate of change judgment module is used to determine whether the rate of change of the offset distance is greater than the rate of change of the offset distance threshold. The target motor torque determination module is used to determine the target motor torque based on the offset change rate if the offset change rate is greater than the offset change rate threshold, so that the drive motor controller executes the target motor torque.
12. The vehicle antiweave device of claim 11 wherein, The straight-ahead status determination module includes: The acquisition unit is used to acquire the lane curvature in front of the vehicle, the vehicle's steering angle, and longitudinal acceleration. The straight-ahead state determination unit is used to determine that the vehicle is in a straight-ahead state when the lane curvature is less than or equal to a preset curvature threshold, the steering angle is less than or equal to a preset steering angle threshold, and the longitudinal acceleration is less than or equal to a preset acceleration threshold.
13. The vehicle antiweave device of claim 11 wherein, The identified target motor torque module includes: The vehicle model parameter acquisition unit is used to acquire the vehicle model parameters of the vehicle. A motor compensation torque determination unit is used to determine the motor compensation torque based on the vehicle model parameters and the offset change rate. A compensation distribution torque determination unit is used to determine the compensation distribution torque based on the vehicle's motor architecture and the motor compensation torque. A target motor torque determination unit is used to determine the target motor torque based on the compensated distribution torque and the initial target torque.
14. A computer device comprising a memory, a processor, and computer readable instructions stored in the memory and running on the processor, wherein, When the processor executes the computer-readable instructions, it implements the vehicle anti-deviation method as described in any one of claims 1 to 10.
15. One or more readable storage media having stored thereon computer- readable instructions, wherein, The computer readable instructions, when executed by one or more processors, cause the one or more processors to perform the method for preventing vehicle run-off as claimed in any one of claims 1 to 10.