Adaptive headlight range adjustment method for new energy buses based on ambient light intensity

Through multi-resolution feature extraction and attention mechanism, integrating ambient light intensity characteristics, combining hierarchical prediction of vehicle speed and time information, a double-layer long and short-term memory network and multi-head attention mechanism optical path compensation neural network is used to solve the problem of hysteresis and instability in the adaptive headlight system of new energy buses in complex lighting scenarios and working conditions, and intelligent adjustment of headlight path is achieved, improving night driving safety and lighting effects.

CN120270154BActive Publication Date: 2025-08-22CHANGZHOU WENTONG OPTOELECTRONICS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510740446.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-05
Publication Date
2025-08-22
Estimated Expiration
2045-06-05

AI Technical Summary

Technical Problem

The existing adaptive headlight system for new energy buses has a hysteresis response, unstable adjustment, inaccurate compensation in complex lighting scenarios and working conditions, and lacks forward-looking prediction and abnormal handling mechanisms, resulting in poor safety in night driving.

Method used

Adaptive headlight path adjustment method based on ambient light intensity is adopted, and ambient light intensity characteristics are integrated through multi-resolution feature extraction and attention mechanism, and a hierarchical prediction is performed by combining vehicle speed and time information. A double-layer long and short-term memory network is used for multi-factor constraint compensation, and a multi-head attention mechanism optical path compensation neural network is introduced to process inclination data to realize intelligent adjustment of headlight path.

Benefits of technology

It improves the real-time and forward-looking nature of headlight path adjustment, ensures the accuracy and stability of irradiation, and improves the safety of driving at night and driving experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120270154B_ABST
    Figure CN120270154B_ABST
Patent Text Reader

Abstract

The present invention provides a method for adaptively adjusting the headlight range of a new energy bus based on ambient light intensity, which relates to the field of intelligent control technology. The method comprises collecting vehicle speed data and timestamp data of the new energy bus, ambient light intensity data of the front, and tilt angle data of the headlight; inputting the ambient light intensity data into three parallel feature extraction branches at different resolutions, performing attention feature fusion of spatial dimensions and channel dimensions and performing dynamic calibration to obtain ambient light intensity features; forming a feature sequence of the ambient light intensity features, vehicle speed data, and timestamp data, and inputting the feature sequence into a double-layer long short-term memory network for hierarchical prediction to a target headlight range; inputting the tilt angle data into a pre-trained optical path compensation neural network based on a multi-head attention mechanism to obtain an optical path compensation coefficient; compensating the target headlight range according to the optical path compensation coefficient to obtain a compensated optical path, and adjusting the headlight illumination angle based on the compensated optical path to improve driving safety.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to intelligent control technology, and in particular to a method for adjusting the range of adaptive headlights of new energy buses based on ambient light intensity. Background Art

[0002] Light range adjustment in adaptive headlight systems for new energy buses is crucial for nighttime driving safety. The current mainstream technology uses ambient light sensors to detect light intensity, combined with simple threshold judgment and vehicle speed information for light range adjustment. This approach has numerous drawbacks: The ambient light intensity feature extraction is overly simplistic, unable to accurately identify complex lighting scenarios; the light intensity classification standard is fixed, resulting in poor adaptability; the light range adjustment strategy lacks forward-looking predictions, resulting in delayed system response; and the adjustment process is susceptible to transient interference and lacks stability.

[0003] Some improvement plans introduce tilt compensation control and dynamic adjustment mechanisms for illumination angles, but the core problems remain unsolved: the tilt compensation model is too simple to adapt to complex working conditions; the compensation parameters are fixed and have limited accuracy, and cannot be dynamically adjusted according to actual conditions; there is a lack of effective detection and processing mechanisms under abnormal working conditions; the adjustment process frequently oscillates, resulting in a poor driving experience; and each subsystem operates independently, lacking a collaborative optimization strategy.

[0004] Common issues with existing technologies mean adaptive headlight systems are unable to meet the safety requirements of new energy buses at night. These issues are particularly prominent under complex operating conditions, such as drastic changes in lighting conditions, frequent acceleration and deceleration, and bumpy roads. These issues include delayed system response, unstable adjustment, and inaccurate compensation. Summary of the Invention

[0005] The embodiments of the present invention provide a method for adaptively adjusting the headlight range of a new energy bus based on ambient light intensity, which can solve the problems in the prior art.

[0006] According to a first aspect of the embodiments of the present invention,

[0007] Provides a method for adaptive headlight range adjustment for new energy buses based on ambient light intensity, including:

[0008] Collect new energy bus speed data and timestamp data, front ambient light intensity data, and headlamp inclination data;

[0009] The ambient light intensity data is input into three parallel feature extraction branches at different resolutions, each branch including a multi-layer residual convolution structure, to obtain a feature atlas, and the feature atlas is subjected to attention feature fusion in the spatial dimension and channel dimension and dynamic calibration to obtain an ambient light intensity feature; the ambient light intensity feature is combined with the vehicle speed data and timestamp data into a feature sequence, which is input into a double-layer long short-term memory network for hierarchical prediction, and multi-factor constraint compensation is performed to obtain the target headlight range; the hierarchical prediction includes ambient light intensity hierarchical prediction and lighting scene conversion prediction;

[0010] Inputting the inclination data into a pre-trained optical path compensation neural network based on a multi-head attention mechanism, wherein the multi-head attention mechanism assigns weights to different feature dimensions of the inclination data to obtain an optical path compensation coefficient;

[0011] The target headlamp range is compensated according to the optical range compensation coefficient to obtain a compensated optical range, and the headlamp illumination angle is adjusted based on the compensated optical range.

[0012] In an optional embodiment,

[0013] The use of convolutional neural networks to extract ambient light intensity features includes:

[0014] The ambient light intensity data is input into the resolution adaptive assessment module, and the optimal resolution range is calculated based on image clarity, edge complexity, and illumination change gradient. Three target resolutions are determined within the optimal resolution range using a logarithmic interval method, and the ambient light intensity data is input into three parallel feature extraction branches according to the target resolution. Each feature extraction branch includes: a densely connected residual block for extracting multi-scale local features, a hollow convolution layer group for enhancing feature expression capabilities, and a channel reorganization module for feature recalibration. Feature atlases of different resolutions are obtained through the feature extraction branches.

[0015] The feature atlas is fused in spatial and channel dimensions, including: generating spatial attention weights to recalibrate the feature maps; extracting global context information in the channel dimension to generate channel weights; and progressively fusing attention features of features with different resolutions to obtain fused features.

[0016] The statistics of the fusion features are calculated to construct a feature distribution, calibration parameters are dynamically updated based on the feature distribution, the fusion features are calibrated using the calibration parameters and feedback correction is performed to obtain a calibrated ambient light intensity feature.

[0017] In an optional embodiment,

[0018] The ambient light intensity feature, vehicle speed data, and timestamp data are combined into a feature sequence, which is input into a two-layer long short-term memory network for hierarchical prediction. Multi-factor constraint compensation is performed to obtain the target headlight range. The hierarchical prediction includes ambient light intensity hierarchical prediction and lighting scene conversion prediction.

[0019] The ambient light intensity feature is combined with the vehicle speed data and the timestamp data to form a feature vector; the speed factor is calculated based on the vehicle speed data, and the illumination factor is obtained by calculating the illumination change variance based on the ambient light intensity feature; the time window length is determined according to the speed factor and the illumination factor; the feature vector is subjected to sliding sampling to generate an original feature sequence; the difference between adjacent sampling points of the original feature sequence is calculated to obtain a differential feature sequence; and the differential feature sequence is subjected to moving average processing to obtain a trend feature sequence;

[0020] Inputting the original feature sequence and the differential feature sequence into a first long short-term memory network to obtain hidden state information, calculating attention weights based on the hidden state information and the trend feature sequence to perform feature fusion, and inputting the fused features into a second long short-term memory network to obtain an ambient light intensity grading result and a light scene conversion prediction result;

[0021] The maximum change constraint is calculated based on vehicle speed data, and the ambient light intensity classification results are constrained to obtain a basic light path. The basic light path is subjected to progressive nonlinear adjustment to generate an intermediate light program sequence. Different types of anomalies are classified and processed through Mahalanobis distance anomaly detection. A trend factor is calculated based on the lighting scene conversion prediction results, and a speed compensation coefficient is calculated based on the vehicle speed data. The target headlight range is obtained by multiplying the processed intermediate light program sequence, the trend factor, and the speed compensation coefficient.

[0022] In an optional embodiment,

[0023] Gradual adjustment of basic optical path and exception handling include:

[0024] Calculating the difference between the basic optical path and the current optical path, decomposing the difference into multiple progressive adjustment amounts according to a preset maximum adjustment step, calculating the transition time of each progressive adjustment amount based on a preset basic transition time, and generating an intermediate optical path sequence during the transition period using a nonlinear interpolation method;

[0025] Extracting the characteristic vector of the intermediate optical program sequence; obtaining multiple normal operating modes and their mean vectors and covariance matrices based on Gaussian mixture model clustering within a sliding time window of the historical optical path adjustment sequence; calculating the Euclidean distance and cosine similarity between the characteristic vector of the intermediate optical program sequence and each normal operating mode, selecting the normal operating mode with the highest matching degree based on a weighted combination of the Euclidean distance and cosine similarity, and calculating the Mahalanobis distance using the mean vector and covariance matrix of the mode with the highest matching degree;

[0026] When the Mahalanobis distance exceeds a preset distance threshold, the abnormality type is determined: when a sudden change in illumination is detected, the intermediate light program sequence is replaced with a historical light path value; when a sensor abnormality is detected, the weight of the historical light path in the intermediate light program sequence is increased; when continuous oscillation is detected, the amplitude of the progressive adjustment amount is reduced;

[0027] The target headlamp range is obtained by multiplying the final value of the intermediate light program sequence after abnormal processing by the trend factor and the speed compensation coefficient.

[0028] In an optional embodiment,

[0029] The tilt angle data is input into a pre-trained optical path compensation neural network based on a multi-head attention mechanism. The multi-head attention mechanism assigns weights to different feature dimensions of the tilt angle data to obtain an optical path compensation coefficient including:

[0030] Obtaining time series dimension features and statistical dimension features of the inclination data, wherein the time series dimension features include the first-order difference and acceleration features of the inclination sequence, and the statistical dimension features include the sliding mean, variance, kurtosis coefficient, and trend index;

[0031] Inputting the temporal dimension features and statistical dimension features into a pre-trained optical path compensation neural network based on a multi-head attention mechanism, the optical path compensation neural network is jointly pre-trained through an inclination prediction task, an optical path mapping task, and a contrastive learning task. The joint pre-training uses an inclination sequence complexity score to quantify the difficulty of training samples, and constructs a course learning strategy based on the difficulty score;

[0032] The multi-head attention mechanism assigns weights to different feature dimensions of the inclination data, including: generating a query matrix, a key matrix, and a value matrix, calculating a multi-head attention score and performing feature fusion, and optimizing the fused features through residual connections;

[0033] Based on the output of the multi-head attention mechanism, the temporal feature importance and statistical feature importance are calculated, and the features are weighted and fused according to the feature importance to generate a basic compensation value; the compensation adjustment coefficient is calculated based on the historical compensation effect and the tilt angle change trend, and the basic compensation value is multiplied by the compensation adjustment coefficient to obtain the initial optical path compensation coefficient; according to the periodic analysis results of the headlamp tilt angle change pattern, an adaptive prediction interval is constructed. When the change of the compensation coefficient falls within the prediction interval, it responds quickly. When the change exceeds the prediction interval, it is gradually adjusted based on the change trend. In addition, the prediction interval boundary is dynamically updated in combination with the statistical characteristics of the historical compensation sequence to obtain the final optical path compensation coefficient.

[0034] In an optional embodiment,

[0035] The optical path compensation neural network is jointly pre-trained through the inclination prediction task, the optical path mapping task and the contrastive learning task, including:

[0036] The pre-training process of the optical path compensation neural network includes: constructing a hierarchical teacher network for tilt dynamic features, optical path mapping relationships, and tilt sequence prediction, and pre-training through feature-level and decision-level knowledge distillation and self-distillation mechanisms at different time scales; using the tilt sequence complexity score to quantify the difficulty of training samples, constructing a curriculum learning strategy based on the difficulty score, and introducing random masking, time series perturbation, and feature reorganization to generate multi-view enhanced samples;

[0037] The mutual information between the inclination prediction task, optical path mapping task, and contrastive learning task is calculated. The task weights are dynamically adjusted based on the mutual information and task performance. Prediction uncertainty estimation, mapping reliability assessment, and feature consistency verification are introduced as complementary tasks. The prediction confidence is calculated for the training samples of each task. Training samples with a confidence level lower than the preset confidence level are input into the auxiliary branch network for feature enhancement learning, and the enhanced features are re-input into the main network.

[0038] A performance score is calculated based on compensation accuracy and system stability, a sensitivity analysis is performed on network parameters based on the performance score, characteristic patterns of compensation samples whose performance scores exceed a preset score threshold are stored in a memory bank, and network parameters are dynamically adjusted based on the characteristic patterns in the memory bank.

[0039] In an optional embodiment,

[0040] The target headlight range is compensated according to the optical range compensation coefficient to obtain the compensated optical range. Adjusting the headlight illumination angle based on the compensated optical range includes:

[0041] The optical path compensation coefficient is multiplied by the target headlight path to obtain an initial compensation optical path, and the unit time rate of change and the change acceleration of the initial compensation optical path are calculated to construct a dynamic response curve;

[0042] Based on the dynamic response curve, a smoothness index and an urgency index of the compensation optical path change are calculated, wherein the smoothness index characterizes the continuous change characteristics of the compensation optical path, and the urgency index characterizes the degree of mutation of the compensation optical path; an adjustment response mode is selected according to the smoothness index and the urgency index, wherein the adjustment response mode includes a fast response mode and a gradual response mode; when the fast response mode is selected, the initial compensation optical path is mapped into an illumination angle adjustment instruction; when the gradual response mode is selected, a segmented adjustment sequence of the illumination angle is calculated based on the change trend of the initial compensation optical path, and the segmented adjustment sequence is mapped into the illumination angle adjustment instruction according to a preset adjustment step size;

[0043] The actual angle data during the illumination angle adjustment process is collected, the deviation between the actual angle and the target angle is calculated, the deviation is input into the adaptive corrector, an illumination angle compensation amount is generated, and subsequent angle adjustment instructions are corrected based on the illumination angle compensation amount.

[0044] According to a second aspect of the embodiments of the present invention,

[0045] An electronic device is provided, comprising:

[0046] processor;

[0047] a memory for storing processor-executable instructions;

[0048] The processor is configured to call the instructions stored in the memory to execute the aforementioned method.

[0049] According to a third aspect of the embodiments of the present invention,

[0050] A computer-readable storage medium is provided, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the method described above is implemented.

[0051] The adaptive headlight range adjustment method for new energy buses based on ambient light intensity provided by the present invention integrates ambient light intensity features through multi-resolution feature extraction and attention mechanism, and performs hierarchical prediction in combination with vehicle speed and time information, thereby realizing intelligent adjustment of headlight range and effectively improving nighttime driving safety.

[0052] The present invention uses a double-layer long short-term memory network to perform hierarchical prediction of ambient light intensity characteristics, which can accurately identify different lighting scenes and predict scene conversion trends, so that the headlight range adjustment can not only adapt to the current environment but also respond to upcoming lighting changes in advance, enhancing the real-time and forward-looking nature of the system.

[0053] The present invention introduces an optical path compensation neural network based on a multi-head attention mechanism to process the inclination angle data and generate a compensation coefficient, which solves the problem of headlamp illumination angle deviation caused by changes in road conditions, ensures the accuracy and stability of headlamp illumination, and improves the overall lighting effect and driving experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] Figure 1 Schematic diagram of a flow chart of a method for adaptive headlight range adjustment for new energy buses based on ambient light intensity according to an embodiment of the present invention;

[0055] Figure 2 A comparative analysis diagram of the feature extraction performance between the present invention and the prior art;

[0056] Figure 3 The following is a comparison chart of compensation effects under different road conditions;

[0057] Figure 4 This is a diagram of the real-time optical path adjustment process of the present invention. DETAILED DESCRIPTION

[0058] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.

[0059] The following specific embodiments are used to describe the technical solution of the present invention in detail. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.

[0060] Figure 1 FIG. 1 is a flow chart of a method for adaptively adjusting headlight range of a new energy bus based on ambient light intensity according to an embodiment of the present invention. Figure 1 As shown, the method includes:

[0061] Collect new energy bus speed data and timestamp data, front ambient light intensity data, and headlamp inclination data;

[0062] The ambient light intensity data is input into three parallel feature extraction branches at different resolutions, each branch including a multi-layer residual convolution structure, to obtain a feature atlas, and the feature atlas is subjected to attention feature fusion in the spatial dimension and channel dimension and dynamic calibration to obtain an ambient light intensity feature; the ambient light intensity feature is combined with the vehicle speed data and timestamp data into a feature sequence, which is input into a double-layer long short-term memory network for hierarchical prediction, and multi-factor constraint compensation is performed to obtain the target headlight range; the hierarchical prediction includes ambient light intensity hierarchical prediction and lighting scene conversion prediction;

[0063] Inputting the inclination data into a pre-trained optical path compensation neural network based on a multi-head attention mechanism, wherein the multi-head attention mechanism assigns weights to different feature dimensions of the inclination data to obtain an optical path compensation coefficient;

[0064] The target headlamp range is compensated according to the optical range compensation coefficient to obtain a compensated optical range, and the headlamp illumination angle is adjusted based on the compensated optical range.

[0065] In an optional embodiment, extracting ambient light intensity features using a convolutional neural network includes:

[0066] The ambient light intensity data is input into the resolution adaptive assessment module, and the optimal resolution range is calculated based on image clarity, edge complexity, and illumination change gradient. Three target resolutions are determined within the optimal resolution range using a logarithmic interval method, and the ambient light intensity data is input into three parallel feature extraction branches according to the target resolution. Each feature extraction branch includes: a densely connected residual block for extracting multi-scale local features, a hollow convolution layer group for enhancing feature expression capabilities, and a channel reorganization module for feature recalibration. Feature atlases of different resolutions are obtained through the feature extraction branches.

[0067] The feature atlas is fused in spatial and channel dimensions, including: generating spatial attention weights to recalibrate the feature maps; extracting global context information in the channel dimension to generate channel weights; and progressively fusing attention features of features with different resolutions to obtain fused features.

[0068] The statistics of the fusion features are calculated to construct a feature distribution, calibration parameters are dynamically updated based on the feature distribution, the fusion features are calibrated using the calibration parameters and feedback correction is performed to obtain a calibrated ambient light intensity feature.

[0069] For example, ambient light intensity data is input into the adaptive resolution assessment module for processing. This module evaluates the input ambient light intensity data based on three key metrics: image clarity, edge complexity, and illumination gradient. Image clarity is calculated using the Laplacian operator, edge complexity is obtained by extracting edge pixels and calculating their density using a Sobel edge detector, and illumination gradient is determined by calculating the statistical distribution of the intensity difference between adjacent regions. Specifically, the input ambient light intensity image is scanned using a 30×30 pixel sliding window with a 50% window overlap. Within each window, the three metrics are calculated and a weighted score is calculated using the weights [0.4, 0.3, 0.3]. Based on this score, a resolution-score curve is constructed, and the optimal resolution range is determined by detecting the turning points of the curve. For example, when the input ambient light intensity data has a resolution of 1920×1080, the optimal resolution range that can be obtained through evaluation is [480×270, 960×540]. After determining the optimal resolution range, three target resolutions are determined using a logarithmic spacing method. Assuming the optimal resolution interval is [Rmin, Rmax], the three target resolutions R1, R2, and R3 can be calculated as follows: convert the interval to logarithmic space, sample uniformly within the logarithmic space, and then convert back to the original space. For the interval [480×270, 960×540] in the above example, the three target resolutions might be calculated as 480×270, 675×380, and 960×540. This logarithmically spaced sampling method provides denser sampling in lower-resolution areas, adapting to the human eye's greater sensitivity to changes at lower resolutions.

[0070] The ambient light intensity data is resized to the three target resolutions and then fed into three parallel feature extraction branches. Each feature extraction branch contains the same network structure but processes inputs at different resolutions. Each feature extraction branch consists of three key components:

[0071] The first component is a densely connected residual block, which is used to extract multi-scale local features. Each densely connected residual block contains 4 convolutional units, each of which contains two 3×3 convolutional layers, and the activation function uses ReLU. The dense connection method allows each convolutional unit to receive not only the output of the previous unit, but also the outputs of all previous units as input. For example, for the third convolutional unit, its input includes the original input features and the output features of the first and second convolutional units. To avoid excessive growth in the number of features, a 1×1 convolutional layer is set at the end of each densely connected residual block to compress the number of feature channels to 256. Densely connected residual blocks can effectively capture local features under different receptive fields and enhance the model's adaptability to multi-scale illumination changes.

[0072] The second component is a dilated convolutional layer group, which enhances feature representation. This layer group consists of three parallel dilated convolutional layers with dilation rates set to 1, 2, and 4, respectively. Each layer has a 3×3 kernel size and 128 output channels. Dilated convolutions can expand the receptive field without increasing the number of parameters and are particularly effective for capturing illumination patterns at different scales. The outputs of the three parallel dilated convolutional layers are concatenated along the channel dimension to form a 384-channel feature map.

[0073] The third component is the channel reorganization module, which is used for feature recalibration. This module first compresses the feature map into channel descriptors through global average pooling. It then learns the dependencies between channels through two fully connected layers (the first layer reduces the number of channels to 1 / 16 of the original number, and the second layer restores the original number of channels). Finally, it generates channel weights using a sigmoid activation function and multiplies them with the original features to complete the recalibration. For example, if the input feature has 384 channels and the intermediate layer has 24 channels, the output will still be the weight coefficients for 384 channels.

[0074] Through the cascade processing of the above three components, each branch ultimately outputs a feature map corresponding to the ambient light intensity feature expression at three different resolutions. For an input resolution of 480×270, the final output feature map size is 60×34 with 256 channels; for an input resolution of 675×380, the output feature map size is 84×48 with 256 channels; for an input resolution of 960×540, the output feature map size is 120×68 with 256 channels.

[0075] The three feature maps are fused with attention features in both the spatial and channel dimensions. First, spatial attention weights are generated to recalibrate the feature maps. This is done by extracting spatial information through two layers of 3×3 convolutions. Then, a sigmoid function is applied to generate a spatial attention weight map with weights ranging from [0, 1]. This weight map reflects the importance of different spatial locations. For example, areas near streetlights may receive higher weights (e.g., 0.8-0.9), while background areas such as the sky or ground may receive lower weights (e.g., 0.1-0.3). Simultaneously, global contextual information in the channel dimension is extracted to generate channel weights. Specifically, global average pooling is performed on each channel to obtain a channel descriptor. This is followed by two fully connected layers (with a channel compression ratio of 4) to capture inter-channel dependencies. Finally, a sigmoid function is applied to generate channel weights. For example, for a 256-channel feature map, the resulting channel weights may include higher weights (e.g., 0.7-0.95) for channels representing edge information and lower weights (e.g., 0.3-0.5) for channels representing texture information. After applying attention mechanisms in both spatial and channel dimensions to feature maps of three different resolutions, a progressive feature fusion strategy is performed. First, low-resolution features (60×34) are upsampled to a medium resolution (84×48) using bilinear interpolation and weighted fused with the medium-resolution features. The fusion weight is dynamically assigned based on the feature confidence, typically 0.4 for low-resolution features and 0.6 for medium-resolution features. The fused features are then upsampled again to a high resolution (120×68) and similarly weighted fused with the high-resolution features, with a weight of 0.5 for the former and 0.5 for the latter. This progressive fusion strategy leverages the strengths of features at different resolutions: low-resolution features typically contain more global information, while high-resolution features retain more detail.

[0076] Based on the fused features, statistics are calculated to construct the feature distribution, primarily including channel mean, variance, maximum, and minimum values. For example, the features for a particular channel might have a mean of 0.45, a variance of 0.18, a maximum of 0.92, and a minimum of 0.08. Based on these statistics, the calibration parameters α and β are dynamically updated, bringing the calibrated feature mean close to 0.5 and the variance close to 0.25, enhancing the feature's discriminability. The specific calibration process involves applying the transformation F' = (F - μ) / σ × β + α to the fused feature F, where μ and σ are the feature's mean and standard deviation, respectively, and α and β are the dynamically updated calibration parameters.

[0077] The initial values ​​of the calibration parameters are set to α = 0.5 and β = 0.25, and are dynamically adjusted during processing based on historical data. For example, if the current feature mean is lower than the target value (0.5), the α value is increased; if the feature variance is too small, the β value is increased. The adjustment step size is set to 0.01, and upper and lower bounds are set such that α ∈ [0.3, 0.7] and β ∈ [0.15, 0.35]. The calibrated features are feedback-corrected, that is, the calibrated features are residually connected with the original features to ensure that the original information is not lost. The final result is a calibrated ambient light intensity feature, which retains the advantages of multi-resolution information and has enhanced the expressiveness and discriminability of the feature through distribution calibration.

[0078] In the existing technology, ambient light intensity feature extraction is usually processed at a fixed resolution, which cannot adapt to the optimal perception requirements in different scenarios. To address the above problems, this application proposes a multi-resolution processing scheme based on resolution adaptive evaluation, which determines the target resolution through logarithmic intervals, thereby improving the efficiency of feature extraction; designs a feature extraction structure that combines densely connected residual blocks with void convolution, enhancing the feature expression capability; introduces a progressive feature fusion strategy with spatial and channel dual attention mechanisms, achieving refined feature fusion; finally, through dynamic calibration of feature distribution and feedback correction mechanism, the stability and distinguishability of features are improved.

[0079] Figure 2 This is a comparative analysis chart of the feature extraction performance of the present invention and the prior art. The figure shows the comparative results of the feature extraction performance of the method of the present invention with traditional CNN and ResNet50. The horizontal axis represents the calculation time (unit: milliseconds), and the vertical axis represents the accuracy (unit: percentage). The three methods are marked with different shapes: hollow squares (□) represent traditional CNN, triangles (△) represent ResNet50, and hollow circles (○) represent the present invention. The method of the present invention is significantly better than the comparison method at each time point. Specifically, compared with traditional CNN, the accuracy of the present invention is improved by an average of 7.7 percentage points under the same calculation time; compared with ResNet50, the accuracy is improved by an average of 3.4 percentage points. At the same time, the performance improvement curve of the method of the present invention has a larger slope, indicating that it has obvious advantages in computing efficiency. In particular, when the calculation time is short (within 20ms), the method of the present invention can achieve a higher accuracy (90.2%), which is of great significance to the real-time processing requirements in practical applications.

[0080] In an optional embodiment, the ambient light intensity feature, vehicle speed data, and timestamp data are combined into a feature sequence, which is input into a two-layer long short-term memory network for hierarchical prediction. Multi-factor constraint compensation is performed to obtain the target headlight range. The hierarchical prediction includes ambient light intensity hierarchical prediction and lighting scene conversion prediction, including:

[0081] The ambient light intensity feature is combined with the vehicle speed data and the timestamp data to form a feature vector; the speed factor is calculated based on the vehicle speed data, and the illumination factor is obtained by calculating the illumination change variance based on the ambient light intensity feature; the time window length is determined according to the speed factor and the illumination factor; the feature vector is subjected to sliding sampling to generate an original feature sequence; the difference between adjacent sampling points of the original feature sequence is calculated to obtain a differential feature sequence; and the differential feature sequence is subjected to moving average processing to obtain a trend feature sequence;

[0082] Inputting the original feature sequence and the differential feature sequence into a first long short-term memory network to obtain hidden state information, calculating attention weights based on the hidden state information and the trend feature sequence to perform feature fusion, and inputting the fused features into a second long short-term memory network to obtain an ambient light intensity grading result and a light scene conversion prediction result;

[0083] The maximum change constraint is calculated based on vehicle speed data, and the ambient light intensity classification results are constrained to obtain a basic light path. The basic light path is subjected to progressive nonlinear adjustment to generate an intermediate light program sequence. Different types of anomalies are classified and processed through Mahalanobis distance anomaly detection. A trend factor is calculated based on the lighting scene conversion prediction results, and a speed compensation coefficient is calculated based on the vehicle speed data. The target headlight range is obtained by multiplying the processed intermediate light program sequence, the trend factor, and the speed compensation coefficient.

[0084] Exemplarily, ambient light intensity features, vehicle speed data, and timestamp data are obtained to construct a feature sequence. The ambient light intensity features are collected by the light intensity sensor at the front of the vehicle, with a value range of 0-100,000 lux; the vehicle speed data is obtained from the vehicle CAN bus, with a range of 0-200 km / h; the timestamp data is the current sampling time, accurate to seconds, and these three types of data are combined into a feature vector. The speed factor is calculated based on the vehicle speed data. When the vehicle speed is lower than 30 km / h, the speed factor is set to 0.5; when the vehicle speed is between 30 km / h and 60 km / h, the speed factor is 0.8; when the vehicle speed is higher than 60 km / h, the speed factor is 1.0. The illumination factor is obtained by calculating the variance of the illumination change based on the ambient light intensity features. The standard deviation of the ambient light intensity of the last 10 sampling points is divided by 1000. For example, when the standard deviation is 5000, the illumination factor is 5.0. The time window length is equal to the basic window length 30 multiplied by the speed factor and then multiplied by the illumination factor. For example, when the speed factor is 0.8 and the illumination factor is 5.0, the time window length is 120 sampling points.

[0085] Sliding sampling is performed on the feature vectors to generate the original feature sequence. The sampling interval is 0.5 seconds, and the sliding is performed according to the calculated time window length. For example, when the window length is 120, the original feature sequence contains data from 120 sampling points. The difference between adjacent sampling points in the original feature sequence is calculated to obtain the differential feature sequence. For example, for the ambient light intensity feature [85000, 84500, 84000], the corresponding differential feature is [-500, -500]. A 5-point moving average is applied to the differential feature sequence to generate the trend feature sequence. That is, the average value of every five consecutive points constitutes a new sequence.

[0086] The first LSTM network consists of 64 memory units. The original feature sequence and the differential feature sequence are input into the first LSTM network to obtain the hidden state information, which has a dimension of 64. Attention weights are calculated based on the hidden state information and the trend feature sequence. The attention weight calculation method assigns a weight between 0 and 1 to each element in the trend feature sequence, and the total weight is 1. For example, the trend feature of 5 elements can be assigned weights [0.1, 0.15, 0.5, 0.15, 0.1]. Feature fusion is performed using the weighted sum of the attention weights and the trend feature sequence, and the fused feature dimension is 64.

[0087] The second LSTM network consists of 128 memory cells. The fused features are fed into the second LSTM network to generate ambient light intensity classification results and lighting scene transition prediction results. Ambient light intensity can be divided into five levels: extremely dim (0-10 lux), dim (10-1000 lux), moderate (1000-10,000 lux), bright (10,000-50,000 lux), and extremely bright (>50,000 lux). Light scene transition prediction includes four possible states: stable, gradually brightening, gradually dimming, and rapidly fluctuating. The prediction results are output as a probability distribution. For example, the prediction for a given moment might be: stable (0.15), gradually brightening (0.75), gradually dimming (0.05), or rapidly fluctuating (0.05), indicating that the ambient light at that moment is most likely to be gradually brightening.

[0088] The maximum change constraint is calculated based on vehicle speed data, with the constraint value positively correlated with vehicle speed. Constraints are applied to the ambient light intensity classification results to determine the base optical range. The ambient light intensity classification is mapped to the base optical range as follows: extremely dark corresponds to an optical range of 90 meters, dark corresponds to an optical range of 70 meters, medium corresponds to an optical range of 50 meters, bright corresponds to an optical range of 40 meters, and extremely bright corresponds to an optical range of 30 meters. The change in optical range between adjacent time points must not exceed the maximum change constraint.

[0089] The basic optical range is progressively and nonlinearly adjusted to generate an intermediate optical sequence, and anomaly detection and processing are performed. A trend factor is calculated based on the lighting scene transition prediction results: 1.0 for stable predictions, 0.9 for gradually brightening, 1.1 for gradually dimming, and 1.0 for rapidly fluctuating conditions with an added stabilization mechanism. A speed compensation coefficient is calculated based on vehicle speed data: 0.9 for speeds below 30 km / h, 1.0 between 30 and 60 km / h, 1.1 between 60 and 90 km / h, and 1.2 above 90 km / h. The target headlight range is calculated by multiplying the latest value of the processed intermediate optical sequence, the trend factor, and the speed compensation coefficient.

[0090] In the prior art, headlight range adjustment usually adopts simple threshold judgment or fixed rules, which lacks the ability to predict the trend of ambient lighting changes. In response to the above problems, this application proposes a hierarchical prediction method based on a two-layer long short-term memory network. Through the comprehensive analysis of ambient light intensity, vehicle speed and time information, it realizes the precise classification of light intensity and the accurate prediction of lighting scene transitions. In particular, this application designs an adaptive time window sampling strategy that can dynamically adjust the length of feature sequences according to vehicle speed and lighting changes; introduces multi-dimensional analysis of original features, differential features and trend features to improve the network's perception of environmental changes; adopts an attention mechanism to enhance the recognition of key time points; and ensures the smoothness and rationality of light range adjustment through a multi-factor constraint compensation mechanism. Finally, the anomaly detection and classification processing based on Mahalanobis distance improves the robustness of the system in complex environments.

[0091] In an optional embodiment, the gradual adjustment and exception handling of the basic optical path includes:

[0092] Calculating the difference between the basic optical path and the current optical path, decomposing the difference into multiple progressive adjustment amounts according to a preset maximum adjustment step, calculating the transition time of each progressive adjustment amount based on a preset basic transition time, and generating an intermediate optical path sequence during the transition period using a nonlinear interpolation method;

[0093] Extracting the characteristic vector of the intermediate optical program sequence; obtaining multiple normal operating modes and their mean vectors and covariance matrices based on Gaussian mixture model clustering within a sliding time window of the historical optical path adjustment sequence; calculating the Euclidean distance and cosine similarity between the characteristic vector of the intermediate optical program sequence and each normal operating mode, selecting the normal operating mode with the highest matching degree based on a weighted combination of the Euclidean distance and cosine similarity, and calculating the Mahalanobis distance using the mean vector and covariance matrix of the mode with the highest matching degree;

[0094] When the Mahalanobis distance exceeds a preset distance threshold, the abnormality type is determined: when a sudden change in illumination is detected, the intermediate light program sequence is replaced with a historical light path value; when a sensor abnormality is detected, the weight of the historical light path in the intermediate light program sequence is increased; when continuous oscillation is detected, the amplitude of the progressive adjustment amount is reduced;

[0095] The target headlamp range is obtained by multiplying the final value of the intermediate light program sequence after abnormal processing by the trend factor and the speed compensation coefficient.

[0096] For example, after the system determines the base optical range based on the vehicle's driving state, it needs to make gradual adjustments to the optical range to avoid sudden changes in the optical range that could cause driving discomfort. The difference between the base optical range and the current optical range is calculated. For example, if the base optical range is 1.5% and the current optical range is 0.8%, the difference is 0.7%. The system sets the maximum adjustment step size to 0.1%, and then decomposes 0.7% into seven gradual adjustments: [0.1%, 0.1%, 0.1%, 0.1%, 0.1%, 0.1%, 0.1%].

[0097] The transition time of each progressive adjustment amount is calculated based on the preset basic transition time. For example, if the basic transition time is set to 100 milliseconds, if it is detected that the vehicle is turning, the system increases the transition time to 150 milliseconds to ensure a smoother light path transition. For each progressive adjustment amount, a nonlinear transition sequence is generated using Bezier curve interpolation. Specifically, for the first 0.1% adjustment amount, an intermediate sequence from 0.8% to 0.9% [0.80%, 0.81%, 0.84%, 0.87%, 0.89%, 0.90%] is generated, and each value corresponds to a different moment of the transition time. After completing the nonlinear interpolation of all progressive adjustment amounts, a complete intermediate light path sequence is obtained, such as [0.80%, 0.81%, ..., 1.49%, 1.50%].

[0098] To detect anomalies that may occur during the adjustment process, the system extracts feature vectors from the intermediate optical sequence. Feature vectors include the optical sequence's mean, variance, maximum, minimum, rate of change, and energy distribution. For example, for the above sequence, the extracted feature vector might be [1.15%, 0.04%, 1.5%, 0.8%, 0.0047% / ms, 0.65].

[0099] The system maintains a sliding time window, such as the last 30 seconds of optical path adjustment data. Within this window, a Gaussian mixture model is applied for clustering to identify multiple normal operating modes. For example, the system may identify three normal operating modes: steady driving mode, acceleration mode, and cornering mode. Each mode has its own mean vector and covariance matrix. The mean vector for the steady driving mode might be [1.0%, 0.02%, 1.2%, 0.85%, 0.002% / ms, 0.3]. The covariance matrix represents the variance and covariance relationship between the characteristic components.

[0100] For the currently extracted feature vector, its Euclidean distance and cosine similarity with each normal operating mode are calculated. For example, the Euclidean distance with the steady driving mode is 0.18, and the cosine similarity is 0.92; the Euclidean distance with the acceleration mode is 0.25, and the cosine similarity is 0.86; and the Euclidean distance with the cornering mode is 0.35, and the cosine similarity is 0.78. The system sets a Euclidean distance weight of 0.4 and a cosine similarity weight of 0.6 to calculate the overall matching degree. For the steady driving mode, the overall matching degree is 0.4 × (1 - 0.18) + 0.6 × 0.92 = 0.632; for the acceleration mode, the overall matching degree is 0.4 × (1 - 0.25) + 0.6 × 0.86 = 0.596; and for the cornering mode, the overall matching degree is 0.4 × (1 - 0.35) + 0.6 × 0.78 = 0.524. Based on the matching comparison, the system selects the smooth driving mode with the highest matching score as the current operating mode. The Mahalanobis distance is calculated using the mode's mean vector and covariance matrix. The formula is: the difference between the eigenvector and the mode's mean vector, multiplied by the inverse of the covariance matrix, then multiplied by the transpose of the difference, and the square root is taken to obtain the Mahalanobis distance. For example, the calculated Mahalanobis distance is 2.8.

[0101] The system presets the Mahalanobis distance threshold to 2.5. When the calculated Mahalanobis distance of 2.8 exceeds the threshold, it is determined to be an abnormal situation. The system further analyzes the abnormality type:

[0102] Sudden light change detection: By analyzing the short-term rate of change of ambient light intensity sensor data, a sudden light change is detected when the rate of change exceeds a preset threshold of 50,000 lux / s. For example, when a vehicle enters a tunnel entrance, the ambient light intensity drops sharply from 80,000 lux to 5,000 lux, with a rate of change of -75,000 lux / s. This exceeds the threshold and the system determines a sudden light change. At this point, the system replaces the intermediate light sequence with historical light path values, for example, using 1.2% of the average light path value over the past three seconds to replace the currently calculated light sequence, to avoid unnecessary headlight adjustments due to sudden light changes.

[0103] Sensor anomaly detection: By comparing the data consistency of multiple sensors or the temporal continuity of a single sensor, a sensor anomaly is determined when the inconsistency exceeds a threshold of 25%. For example, if the primary light intensity sensor reads 85,000 lux and the auxiliary sensor reads 20,000 lux, the inconsistency is 76.5%, exceeding the threshold, and the system determines that the primary sensor may be anomaly. In this case, the system increases the weight of the historical optical path in the intermediate optical program sequence, for example, increasing the historical optical path weight from 0.3 to 0.7. The corrected optical program sequence is 0.7 × historical optical path + 0.3 × current calculated optical path, reducing the impact of sensor anomalies on optical path adjustment.

[0104] Continuous oscillation detection: Spectral analysis or local extreme point counting of the light sequence indicates continuous oscillation if more than six extreme points are detected within three seconds. For example, if a light sequence fluctuates repeatedly within a short period of time, forming a sequence such as [1.2%, 1.3%, 1.1%, 1.4%, 1.0%, 1.3%], the system detects five extreme points, approaching the oscillation threshold. At this point, the system reduces the amplitude of the incremental adjustment, reducing the original 0.1% adjustment step to 0.05%, extending the transition time, smoothing the adjustment curve, and suppressing oscillation.

[0105] After abnormal processing, the system obtains the corrected intermediate light program sequence, multiplies it with the trend factor and speed compensation coefficient, and obtains the target headlamp range.

[0106] The progressive optical path adjustment method based on nonlinear interpolation proposed in this application realizes a smooth transition of the optical path; a multi-mode anomaly detection mechanism based on the Gaussian mixture model is designed, which can identify normal working modes under different driving scenarios; a weighted combination evaluation strategy of Euclidean distance and cosine similarity is introduced to improve the accuracy of pattern matching; a refined anomaly classification and processing scheme is developed based on the Mahalanobis distance, and targeted measures are taken for different types of anomalies, significantly improving the robustness of the system.

[0107] In an optional embodiment, the tilt angle data is input into a pre-trained optical path compensation neural network based on a multi-head attention mechanism. The multi-head attention mechanism performs weight distribution on different feature dimensions of the tilt angle data, and the obtained optical path compensation coefficient includes:

[0108] Obtaining time series dimension features and statistical dimension features of the inclination data, wherein the time series dimension features include the first-order difference and acceleration features of the inclination sequence, and the statistical dimension features include the sliding mean, variance, kurtosis coefficient, and trend index;

[0109] Inputting the temporal dimension features and statistical dimension features into a pre-trained optical path compensation neural network based on a multi-head attention mechanism, the optical path compensation neural network is jointly pre-trained through an inclination prediction task, an optical path mapping task, and a contrastive learning task. The joint pre-training uses an inclination sequence complexity score to quantify the difficulty of training samples, and constructs a course learning strategy based on the difficulty score;

[0110] The multi-head attention mechanism assigns weights to different feature dimensions of the inclination data, including: generating a query matrix, a key matrix, and a value matrix, calculating a multi-head attention score and performing feature fusion, and optimizing the fused features through residual connections;

[0111] Based on the output of the multi-head attention mechanism, the temporal feature importance and statistical feature importance are calculated, and the features are weighted and fused according to the feature importance to generate a basic compensation value; the compensation adjustment coefficient is calculated based on the historical compensation effect and the tilt angle change trend, and the basic compensation value is multiplied by the compensation adjustment coefficient to obtain the initial optical path compensation coefficient; according to the periodic analysis results of the headlamp tilt angle change pattern, an adaptive prediction interval is constructed. When the change of the compensation coefficient falls within the prediction interval, it responds quickly. When the change exceeds the prediction interval, it is gradually adjusted based on the change trend. In addition, the prediction interval boundary is dynamically updated in combination with the statistical characteristics of the historical compensation sequence to obtain the final optical path compensation coefficient.

[0112] For example, the temporal and statistical dimension features of the tilt angle data are obtained. The temporal dimension features include the first-order difference of the tilt angle sequence and the acceleration feature. Taking the collected headlamp tilt angle data as an example, the original tilt angle sequence is [0.5°, 0.7°, 0.9°, 1.2°, 1.4°], the calculated first-order difference is [0.2°, 0.2°, 0.3°, 0.2°], and the acceleration feature is [0°, 0.1°, -0.1°]. The statistical dimension features include the sliding mean, variance, kurtosis coefficient, and trend index. For the above inclination sequence, using a sliding window with a window size of 3, the sliding mean characteristics are [0.7°, 0.933°, 1.167°], the variance characteristics are [0.033, 0.043, 0.053], the kurtosis coefficient is [1.5, 1.2, 1.3], and the trend indicator is [0.2, 0.25, 0.2] by calculating the least squares fitting slope.

[0113] The extracted features are fed into a pre-trained optical path compensation neural network based on a multi-head attention mechanism. This network is jointly pre-trained on three tasks: inclination prediction, optical path mapping, and contrastive learning. During pre-training, the difficulty of the training samples is quantified using an inclination sequence complexity score.

[0114] The multi-head attention mechanism assigns weights to the different feature dimensions of the inclination data as follows: First, a query matrix, a key matrix, and a value matrix are generated. Taking an 8-head attention mechanism as an example, the input feature dimension is 16, and each head outputs a dimension of 8. For the input feature vector X = [x1, x2, ..., x16], the query matrix Q, key matrix K, and value matrix V are generated using the linear transformation matrices WQ, WK, and WV. Multi-head attention scores are calculated for each head. For example, the first head might focus on temporal features, with a score of [0.3, 0.2, 0.4, 0.1], while the second head might focus on statistical features, with a score of [0.1, 0.3, 0.1, 0.5]. The outputs of each head are concatenated through feature fusion, and then the fused features are optimized using a residual connection, which adds the output of the attention mechanism to the original input.

[0115] Based on the output of the multi-head attention mechanism, the importance of the temporal features and the importance of the statistical features are calculated. For example, for a specific inclination sequence, the system may obtain a temporal feature importance of 0.65 and a statistical feature importance of 0.35, indicating that in the current scenario, the temporal feature contributes more to the prediction compensation coefficient. Based on these importance values, the features are weighted and fused to generate a basic compensation value. Specifically, if the output value of the temporal feature is 0.42 and the output value of the statistical feature is 0.38, the weighted fusion result is 0.65×0.42+0.35×0.38=0.406, which is used as the basic compensation value.

[0116] The compensation adjustment coefficient is calculated based on the historical compensation effect and the trend of inclination change. The historical compensation effect is evaluated by comparing the deviation between the predicted optical path and the actual optimal optical path in the past 30 seconds. For example, an average deviation of +5% in the past 30 seconds indicates that the predicted value is generally too high. The trend of inclination change is determined by analyzing the direction and rate of change of the last 10 inclination samples. For example, the current inclination shows an accelerating upward trend. Combining the two, the system calculates a compensation adjustment coefficient of 0.95, indicating that the basic compensation value needs to be slightly lowered. Multiplying the basic compensation value by the compensation adjustment coefficient, 0.406×0.95=0.386, obtains the initial optical path compensation coefficient.

[0117] An adaptive prediction interval is constructed based on the periodic analysis of headlamp tilt angle variation patterns. The system analyzes the spectrum of historical tilt angle data to identify the typical tilt angle variation period and amplitude under different road conditions. For example, when driving on urban roads, a tilt angle variation pattern with a period of approximately 8 seconds and an amplitude range of ±0.4° may be identified. Based on these analysis results, the system constructs a prediction interval of [0.35, 0.42], representing the reasonable range of variation for the expected compensation coefficient.

[0118] When the change in the compensation coefficient falls within the predicted range, the system adopts a rapid response strategy and directly uses the calculated initial optical path compensation coefficient of 0.386 as the final result. When the change exceeds the predicted range, the system makes gradual adjustments based on the change trend. For example, if the initial compensation coefficient is 0.33, which is below the lower limit of the predicted range of 0.35, the system will not directly adopt 0.33. Instead, it will gradually adjust the compensation coefficient by 0.01 steps based on the current change trend, moving from the previous compensation coefficient (assuming it is 0.38) to the target value. This time, 0.37 may be used as the final compensation coefficient.

[0119] The prediction interval boundaries are dynamically updated based on the statistical characteristics of the historical compensation sequence. Specifically, the mean, standard deviation, and trend of the compensation coefficient over the past 60 seconds are calculated. For example, the mean is 0.39, the standard deviation is 0.025, and the trend is slowly decreasing. Based on these statistical characteristics, the system updates the prediction interval to [0.34, 0.44], expanding the range to accommodate the potentially greater fluctuations in current road conditions.

[0120] Through the above-mentioned adaptive prediction and gradual adjustment mechanism, the system finally obtains the optical path compensation coefficient of 0.386, which will be used in subsequent calculations with the target optical path to obtain the compensated optical path.

[0121] To illustrate the effectiveness of this method, we use a real-world data set as an example: The headlight tilt angle data for a new energy bus exhibits periodic fluctuations during driving. The original sequence is [1.2°, 1.3°, 1.4°, 1.5°, 1.4°, 1.3°, 1.2°, 1.1°, 1.0°, 0.9°, 1.0°, 1.1°]. By extracting temporal and statistical features and inputting them into a pre-trained network, an initial optical path compensation coefficient of 0.82 is obtained. The system also identifies a tilt angle variation cycle of approximately 10 sample points and constructs a prediction interval of [0.78, 0.86]. Since the initial compensation coefficient of 0.82 falls within the prediction interval, it is directly used as the final compensation coefficient. After applying this compensation coefficient, the actual headlight path is adjusted from 65 meters to 65 × 0.82 = 53.3 meters, making the front lighting area more suitable for the current road conditions and avoiding the problem of improper headlight angle caused by vehicle tilt.

[0122] In the prior art, headlight range compensation usually adopts methods based on simple thresholds or fixed rules, which results in untimely or over-compensation in dynamically changing scenarios. The optical range compensation method based on a multi-head attention mechanism proposed in this application achieves more accurate optical range compensation by extracting multi-dimensional features and assigning weights to inclination data. In particular, this application designs a feature system that combines temporal dimensions and statistical dimensions to comprehensively capture inclination change patterns; adopts a multi-head attention mechanism to automatically learn the importance of different feature dimensions, thereby improving the adaptability of the model; introduces a joint pre-training strategy and a curriculum learning mechanism, thereby enhancing the model's generalization ability for complex scenarios; and finally, through an adaptive prediction interval and a progressive adjustment mechanism, ensures the smoothness and reliability of the compensation process.

[0123] Figure 3 This is a comparison chart of compensation effects under different road conditions. The bar chart shows the comparison of the compensation effects of the present invention, traditional PID control and simple feedforward network under different road conditions. Experimental data show that the present invention has significant advantages in all tested road conditions, especially in complex road conditions. Under flat road conditions, the three methods have little difference, and the accuracy of the present invention reaches 99.2%, which is slightly higher than the traditional method; while in bumpy sections, sharp turns, slope driving and complex mixed road conditions, the present invention maintains a high accuracy of more than 92%, while the performance of traditional PID control and simple feedforward network drops significantly, with only accuracies of 65.3% and 70.2% respectively under complex mixed road conditions. The experimental results prove that the multi-head attention mechanism of the present invention can effectively extract key information of different feature dimensions, so that the system can maintain a stable optical path compensation effect under various complex road conditions.

[0124] Figure 4 This figure illustrates the real-time optical path adjustment process of the present invention, demonstrating the dynamic relationship between tilt angle changes and compensation adjustments during actual system operation. The gray dashed line represents the system's compensation adjustment process, which clearly follows the tilt angle changes but exhibits a smoother adjustment curve. This demonstrates that the compensation system effectively responds to tilt angle changes while avoiding over-adjustment and oscillation through appropriate filtering and smoothing. A slight time lag can be observed between the compensation adjustment curve and the tilt angle change curve, demonstrating the system's real-time response characteristics and the excellent balance between stability and response speed.

[0125] In an optional embodiment, the optical path compensation neural network is jointly pre-trained through the tilt angle prediction task, the optical path mapping task and the contrastive learning task, including:

[0126] The pre-training process of the optical path compensation neural network includes: constructing a hierarchical teacher network for tilt dynamic features, optical path mapping relationships, and tilt sequence prediction, and pre-training through feature-level and decision-level knowledge distillation and self-distillation mechanisms at different time scales; using the tilt sequence complexity score to quantify the difficulty of training samples, constructing a curriculum learning strategy based on the difficulty score, and introducing random masking, time series perturbation, and feature reorganization to generate multi-view enhanced samples;

[0127] The mutual information between the inclination prediction task, optical path mapping task, and contrastive learning task is calculated. The task weights are dynamically adjusted based on the mutual information and task performance. Prediction uncertainty estimation, mapping reliability assessment, and feature consistency verification are introduced as complementary tasks. The prediction confidence is calculated for the training samples of each task. Training samples with a confidence level lower than the preset confidence level are input into the auxiliary branch network for feature enhancement learning, and the enhanced features are re-input into the main network.

[0128] A performance score is calculated based on compensation accuracy and system stability, a sensitivity analysis is performed on network parameters based on the performance score, characteristic patterns of compensation samples whose performance scores exceed a preset score threshold are stored in a memory bank, and network parameters are dynamically adjusted based on the characteristic patterns in the memory bank.

[0129] For example, a hierarchical teacher network was constructed for knowledge distillation. The network consists of three layers: a dynamic feature extraction layer for inclination angles, a layer for modeling optical path mapping relationships, and a layer for predicting inclination angle sequences. During feature-level distillation, cosine similarity was used to measure the difference in feature distributions between the teacher and student networks. When the similarity was lower than 0.85, the feature distillation loss weight was increased. During decision-level distillation, a soft labeling mechanism was used with a temperature parameter set to 2.5. For self-distillation at different time scales, time windows of 5 seconds, 15 seconds, and 30 seconds were selected to construct multi-granularity temporal feature representations. Short-term features focused on capturing transient changes, while long-term features focused on trend changes.

[0130] The complexity score is calculated by analyzing the frequency and amplitude of tilt angle changes, as well as the noise level, to obtain a score between 0 and 1. For example, a smooth driving scenario has a complexity score of 0.2, while a bumpy road scenario has a score of 0.8. Based on the complexity score, a curriculum learning strategy is constructed, first training simple examples (score <0.4), then introducing medium-difficulty examples (score 0.4-0.7), and finally adding high-difficulty examples (score >0.7).

[0131] The difficulty of training samples is quantified and a curriculum is learned. The complexity score of the inclination sequence is calculated and evaluated based on three dimensions: signal spectrum analysis, volatility, and the number of change points. In the specific implementation, spectral complexity accounts for 40%, volatility accounts for 35%, and the number of change points accounts for 25%. For example, for an inclination sequence with a spectral entropy of 0.75, a volatility of 0.28, and 12 change points, its complexity score is (0.75 × 0.4) + (0.28 × 0.35) + (12 / 20 × 0.25) = 0.45. Based on this score, a curriculum learning strategy is constructed. Initially, simple samples with scores below 0.3 are selected; mid-term samples with scores between 0.4 and 0.7 are selected; and later, complex samples with scores above 0.7 are introduced. Furthermore, data augmentation strategies are introduced: random masking to set 20% of the inclination data in the sequence to zero; temporal perturbation by randomly inserting or deleting data from 1-3 time points in the original sequence; and feature reshuffling by randomly permuting 30% of adjacent feature blocks in the sequence.

[0132] The system dynamically adjusts the weights of multiple tasks and introduces complementary tasks. Normalized mutual information is used to quantify the correlation between tasks. A sample of 1,000 representative data points yields a mutual information of 0.62 between inclination prediction and optical path mapping, 0.47 between inclination prediction and contrastive learning, and 0.53 between optical path mapping and contrastive learning. Based on these results, the initial task weights are set to 0.40 for inclination prediction, 0.35 for optical path mapping, and 0.25 for contrastive learning. During training, if the performance improvement of a task falls below 20% of the average, the task weight is increased by 0.05; if the performance of a task exceeds a preset threshold, the task weight is reduced by 0.03. The complementary tasks introduced include: prediction uncertainty estimation, using the Monte Carlo random dropout method, performing 10 forward propagations in the inference phase, and calculating the standard deviation of the output as an uncertainty indicator; mapping reliability assessment by calculating the consistency score of the mapping results, and samples with a consistency score lower than 0.7 are marked as low-reliability samples; feature consistency verification calculates the Euclidean distance of feature representations under different enhanced views, and samples with a distance greater than a preset threshold of 1.5 are considered feature-inconsistent samples.

[0133] For each task's training samples, the system calculates prediction confidence. The confidence for the inclination prediction task is based on the correlation coefficient between the predicted sequence and the true sequence; for example, a correlation coefficient of 0.92 results in a confidence of 0.92. The confidence for the optical path mapping task is based on the relative error between the predicted and labeled optical path lengths; for example, a relative error of 8% results in a confidence of 0.92. The confidence for the contrastive learning task is based on the discrimination between positive and negative sample pairs; for example, a discrimination of 0.85 results in a confidence of 0.85. Training samples with confidence levels below a preset level (e.g., confidence levels <0.75) are fed into the auxiliary branch network for feature enhancement learning. The auxiliary branch network employs an attention enhancement module and a feature calibration module to refine low-confidence samples. For example, for a tilt prediction sample with a confidence level of 0.68, the original tilt sequence is [1.2°, 1.4°, 1.3°, 1.5°, 1.7°]. The auxiliary branch network uses an attention mechanism to identify key change points (the fourth and fifth points in this example), enhances the feature representation weights of these points, and adjusts the features through the feature calibration module to generate enhanced feature representations. The enhanced features are then re-input into the main network, where their confidence level increases to 0.81, exceeding the threshold and being included in the valid training sample set.

[0134] Perform sensitivity analysis and dynamic adjustment of network parameters. First, calculate a performance score based on two metrics: compensation accuracy and system stability. Compensation accuracy is assessed by the average relative error between the predicted and ideal optical path lengths. For example, a 5% average relative error yields an accuracy score of 0.95. System stability is assessed by the smoothness and continuity of the optical sequence. For example, a smoothness score of 0.88 yields a stability score of 0.88. The overall performance score is a weighted sum of these two metrics, with a weighting ratio of 6:4: for example, 0.95 × 0.6 + 0.88 × 0.4 = 0.922.

[0135] We conducted a sensitivity analysis of network parameters based on performance scores by applying a ±1% perturbation to each parameter layer and observing the magnitude of the change in performance score. For example, applying a +1% perturbation to the weight matrix of the multi-head attention module resulted in a performance score change of -0.015, indicating that this parameter is sensitive to performance. Applying the same perturbation to the bias term of the output layer resulted in a performance score change of -0.002, indicating that this parameter is not very sensitive.

[0136] The characteristic patterns of compensation samples whose performance scores exceed a preset score threshold (such as 0.90) are stored in the memory bank. The specific operation is to extract the feature vector of the sample after processing by the multi-head attention layer, as well as the corresponding network parameter configuration. The memory bank uses a first-in-first-out strategy to maintain the characteristic patterns of the last 1,000 high-performance samples. After each training iteration, the network parameters are dynamically adjusted based on the characteristic patterns in the memory bank. The adjustment method is to calculate the similarity between the features of the current training batch and the features in the memory bank. For parameter configurations with high similarity, their weight in the parameter update is increased. For example, if the feature similarity between a sample in the current batch and a sample in the memory bank is 0.93, then during the parameter update, the gradient weight corresponding to this sample is increased by 10%, prompting the network parameters to converge to the known high-performance configuration. In this way, the system achieves effective exploration and utilization of the parameter space and avoids performance fluctuations during training.

[0137] The hierarchical teacher network and multi-scale self-distillation mechanism designed in this application realize comprehensive knowledge transfer from features to decisions; the curriculum learning and multi-view data enhancement strategy based on complexity scoring are adopted to improve the model's adaptability to samples of different difficulty levels; the introduction of mutual information calculation and dynamic task weight adjustment mechanism optimizes the balance of multi-task learning; the feature enhancement of low-confidence samples is performed through auxiliary branch networks, thereby improving the utilization efficiency of training samples; finally, sensitivity analysis and dynamic adjustment of network parameters are performed based on performance scoring and memory bank mechanism to ensure continuous optimization of the model.

[0138] In an optional embodiment, compensating the target headlamp light path according to the optical path compensation coefficient to obtain a compensated optical path, and adjusting the headlamp illumination angle based on the compensated optical path includes:

[0139] The optical path compensation coefficient is multiplied by the target headlight path to obtain an initial compensation optical path, and the unit time rate of change and the change acceleration of the initial compensation optical path are calculated to construct a dynamic response curve;

[0140] Based on the dynamic response curve, a smoothness index and an urgency index of the compensation optical path change are calculated, wherein the smoothness index characterizes the continuous change characteristics of the compensation optical path, and the urgency index characterizes the degree of mutation of the compensation optical path; an adjustment response mode is selected according to the smoothness index and the urgency index, wherein the adjustment response mode includes a fast response mode and a gradual response mode; when the fast response mode is selected, the initial compensation optical path is mapped into an illumination angle adjustment instruction; when the gradual response mode is selected, a segmented adjustment sequence of the illumination angle is calculated based on the change trend of the initial compensation optical path, and the segmented adjustment sequence is mapped into the illumination angle adjustment instruction according to a preset adjustment step size;

[0141] The actual angle data during the illumination angle adjustment process is collected, the deviation between the actual angle and the target angle is calculated, the deviation is input into the adaptive corrector, an illumination angle compensation amount is generated, and subsequent angle adjustment instructions are corrected based on the illumination angle compensation amount.

[0142] Exemplarily, the target headlight range and the optical range compensation coefficient are obtained. The optical range compensation coefficient is multiplied by the target headlight range to obtain the initial compensated optical range. The unit time rate of change and the change acceleration of the initial compensated optical range are calculated to construct a dynamic response curve. The unit time rate of change represents the amount of change in the optical range per second, and the change acceleration represents the speed of change of the change rate. Assuming that the initial compensated optical range increases from 80 meters to 110 meters within 5 seconds, the unit time rate of change is (110-80) / 5=6 meters / second. If the change rate increases from the initial 3 meters / second to the final 9 meters / second, the change acceleration is (9-3) / 5=1.2 meters / second². By recording the compensated optical range values ​​at different time points, a dynamic response curve that characterizes the change of the optical range over time can be constructed.

[0143] The smoothness index and urgency index of the compensated optical path change are calculated based on the dynamic response curve. The smoothness index can be obtained by calculating the standard deviation of the rate of change of the compensated optical path at multiple consecutive time points. The smaller the standard deviation, the smoother the change. For example, if the change rates of five consecutive sampling points are 5.8, 6.0, 6.2, 5.9, and 6.1 meters per second, respectively, the calculated standard deviation is approximately 0.16, indicating that the change is relatively smooth. The urgency index can be obtained by calculating the ratio of the maximum rate of change to the average rate of change. The larger the ratio, the higher the possibility of a sudden change. For example, if the maximum rate of change is 12 meters per second and the average rate of change is 6 meters per second, the urgency index is 2.0, indicating that there is a significant sudden change.

[0144] The response mode is selected based on the smoothness and urgency indicators. When the smoothness indicator is less than the preset threshold of 0.5 and the urgency indicator is less than 1.5, the gradual response mode is selected; when the smoothness indicator is greater than 0.5 or the urgency indicator is greater than 1.5, the rapid response mode is selected. In actual application, these thresholds can be adjusted according to vehicle characteristics and user habits.

[0145] When fast response mode is selected, the initial compensation optical path is directly mapped to the illumination angle adjustment command. A mapping relationship exists between the headlamp's illumination angle and optical path, typically obtained through a lookup table or functional relationship. For example, for a certain headlamp model, the relationship between the illumination angle θ (degrees) and the optical path L (meters) can be expressed as: θ = atan(h / L), where h is the headlamp mounting height (meters). Assuming the headlamp is mounted at a height of 1.2 meters and the initial compensation optical path is 110 meters, the illumination angle θ = atan(1.2 / 110) ≈ 0.62°. The system converts this angle value into a control signal for the adjustment motor.

[0146] When the progressive response mode is selected, a step-by-step adjustment sequence for the illumination angle is calculated based on the changing trend of the initial compensation optical path. First, the trend of the compensation optical path is analyzed. For example, the process of increasing the compensation optical path from 80 meters to 110 meters may show a characteristic of initially fast and then slowing down. Based on this trend, a sequence consisting of multiple intermediate optical path values ​​is designed, such as [80, 88, 95, 102, 107, 110]. This sequence is then mapped into illumination angle adjustment instructions based on the preset adjustment step size. Assuming a maximum angle adjustment step size of 0.1° per step, a current angle of 0.85°, a target angle of 0.62°, and a total adjustment of 0.23°, the adjustment must be completed in three steps, forming the angle sequence [0.85°, 0.75°, 0.68°, 0.62°]. After each adjustment step, the system waits for a predetermined time (e.g., 100 milliseconds) before executing the next adjustment step to ensure a smooth process.

[0147] During the illumination angle adjustment process, the system collects actual angle data and calculates the deviation between the actual angle and the target angle. For example, when the target angle is 0.62°, the actual angle measured at one time is 0.66°, with a deviation of 0.04°. This deviation is input into the adaptive corrector to generate the illumination angle compensation. The adaptive corrector uses a proportional-integral-derivative (PID) control algorithm with a proportional coefficient Kp = 1.2, an integral coefficient Ki = 0.05, and a differential coefficient Kd = 0.1. For the aforementioned 0.04° deviation, assuming the previous deviation was 0.06°, the deviation change is 0.04° - 0.06° = -0.02°. Assuming the deviations in the previous five control cycles were 0.05°, 0.03°, 0.02°, 0.04°, and 0.06°, respectively, these deviations are accumulated to a cumulative deviation of 0.2°. The compensation is then calculated as: 1.2 × 0.04 + 0.05 × 0.2 + 0.1 × (-0.02) = 0.06°. The generated angle compensation is then used to correct subsequent angle adjustment commands. For example, if the original planned angle adjustment command for the next step was 0.62°, the 0.06° compensation is added to the command, resulting in a correction of 0.56°. The system sends this corrected command to the headlamp control unit for adjustment, and then collects the actual angle again in the next cycle for feedback adjustment, forming a closed-loop control system.

[0148] This application realizes adaptive switching between fast response mode and progressive response mode by analyzing the dynamic response curve of the compensation optical path and calculating the smoothness and urgency indicators; in the progressive response mode, a segmented adjustment sequence is designed according to the trend of optical path change to ensure the smoothness of angle adjustment; an adaptive corrector is introduced to perform closed-loop control of the actual angle, effectively offsetting the influence of mechanical errors and environmental interference.

[0149] According to a second aspect of the embodiments of the present invention,

[0150] An electronic device is provided, comprising:

[0151] processor;

[0152] a memory for storing processor-executable instructions;

[0153] The processor is configured to call the instructions stored in the memory to execute the aforementioned method.

[0154] According to a third aspect of the embodiments of the present invention,

[0155] A computer-readable storage medium is provided, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the method described above is implemented.

[0156] The present invention may be a method, an apparatus, a system and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for executing various aspects of the present invention.

[0157] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for adjusting the adaptive headlight range of a new energy bus based on ambient light intensity, characterized in that: include: Collect new energy bus speed data and timestamp data, front ambient light intensity data, and headlamp inclination data; The ambient light intensity data is input into three parallel feature extraction branches according to different resolutions, each branch includes a multi-layer residual convolution structure, and a feature atlas is obtained. The feature atlas is fused with attention features of spatial dimension and channel dimension and dynamically calibrated to obtain ambient light intensity features, including: fusing attention features of spatial dimension and channel dimension on the feature atlas, generating spatial dimension attention weights to recalibrate the feature map; extracting global context information of channel dimension to generate channel weights; progressively fusing attention features of features of different resolutions to obtain fused features; calculating the statistics of the fused features to construct feature distribution, dynamically updating calibration parameters based on the feature distribution, calibrating the fused features using the calibration parameters and performing feedback correction to obtain calibrated ambient light intensity features; forming a feature sequence of ambient light intensity features, vehicle speed data and timestamp data, inputting the feature sequence into a double-layer long short-term memory network for hierarchical prediction, and performing multi-factor constraint compensation to obtain the target headlight range, wherein the hierarchical prediction includes ambient light intensity hierarchical prediction and lighting scene conversion prediction; Inputting the inclination data into a pre-trained optical path compensation neural network based on a multi-head attention mechanism, wherein the multi-head attention mechanism assigns weights to different feature dimensions of the inclination data to obtain an optical path compensation coefficient; The target headlamp range is compensated according to the optical range compensation coefficient to obtain a compensated optical range, and the headlamp illumination angle is adjusted based on the compensated optical range.

2. The method according to claim 1, characterized in that The use of convolutional neural networks to extract ambient light intensity features includes: The ambient light intensity data is input into the resolution adaptive evaluation module, and the optimal resolution range is calculated based on image clarity, edge complexity and illumination change gradient. Three target resolutions are determined within the optimal resolution range using a logarithmic interval method, and the ambient light intensity data is input into three parallel feature extraction branches according to the target resolution. Each feature extraction branch includes: a densely connected residual block for extracting multi-scale local features, a hollow convolution layer group for enhancing feature expression capabilities, and a channel reorganization module for feature recalibration. Feature atlases of different resolutions are obtained through the feature extraction branches.

3. The method according to claim 1, characterized in that The ambient light intensity feature, vehicle speed data, and timestamp data are combined into a feature sequence, which is input into a two-layer long short-term memory network for hierarchical prediction. Multi-factor constraint compensation is then performed to obtain the target headlight range. The hierarchical prediction includes ambient light intensity hierarchical prediction and lighting scene conversion prediction. The ambient light intensity feature is combined with the vehicle speed data and the timestamp data to form a feature vector; the speed factor is calculated based on the vehicle speed data, and the illumination factor is obtained by calculating the illumination change variance based on the ambient light intensity feature; the time window length is determined according to the speed factor and the illumination factor; the feature vector is subjected to sliding sampling to generate an original feature sequence; the difference between adjacent sampling points of the original feature sequence is calculated to obtain a differential feature sequence; and the differential feature sequence is subjected to moving average processing to obtain a trend feature sequence; Inputting the original feature sequence and the differential feature sequence into a first long short-term memory network to obtain hidden state information, calculating attention weights based on the hidden state information and the trend feature sequence to perform feature fusion, and inputting the fused features into a second long short-term memory network to obtain an ambient light intensity grading result and a light scene conversion prediction result; The maximum change constraint is calculated based on vehicle speed data, and the ambient light intensity classification results are constrained to obtain a basic light path. The basic light path is subjected to progressive nonlinear adjustment to generate an intermediate light program sequence. Different types of anomalies are classified and processed through Mahalanobis distance anomaly detection. A trend factor is calculated based on the lighting scene conversion prediction results, and a speed compensation coefficient is calculated based on the vehicle speed data. The target headlight range is obtained by multiplying the processed intermediate light program sequence, the trend factor, and the speed compensation coefficient.

4. The method according to claim 3, characterized in that Gradual adjustment of basic optical path and exception handling include: Calculating the difference between the basic optical path and the current optical path, decomposing the difference into multiple progressive adjustment amounts according to a preset maximum adjustment step, calculating the transition time of each progressive adjustment amount based on a preset basic transition time, and generating an intermediate optical path sequence during the transition period using a nonlinear interpolation method; Extracting the characteristic vector of the intermediate optical program sequence; obtaining multiple normal operating modes and their mean vectors and covariance matrices based on Gaussian mixture model clustering within a sliding time window of the historical optical path adjustment sequence; calculating the Euclidean distance and cosine similarity between the characteristic vector of the intermediate optical program sequence and each normal operating mode, selecting the normal operating mode with the highest matching degree based on a weighted combination of the Euclidean distance and cosine similarity, and calculating the Mahalanobis distance using the mean vector and covariance matrix of the mode with the highest matching degree; When the Mahalanobis distance exceeds a preset distance threshold, the abnormality type is determined: when a sudden change in illumination is detected, the intermediate light program sequence is replaced with a historical light path value; when a sensor abnormality is detected, the weight of the historical light path in the intermediate light program sequence is increased; when continuous oscillation is detected, the amplitude of the progressive adjustment amount is reduced; The target headlamp range is obtained by multiplying the final value of the intermediate light program sequence after abnormal processing by the trend factor and the speed compensation coefficient.

5. The method according to claim 1, wherein The tilt angle data is input into a pre-trained optical path compensation neural network based on a multi-head attention mechanism. The multi-head attention mechanism assigns weights to different feature dimensions of the tilt angle data to obtain an optical path compensation coefficient including: Obtaining time series dimension features and statistical dimension features of the inclination data, wherein the time series dimension features include the first-order difference and acceleration features of the inclination sequence, and the statistical dimension features include the sliding mean, variance, kurtosis coefficient, and trend index; Inputting the temporal dimension features and statistical dimension features into a pre-trained optical path compensation neural network based on a multi-head attention mechanism, the optical path compensation neural network is jointly pre-trained through an inclination prediction task, an optical path mapping task, and a contrastive learning task. The joint pre-training uses an inclination sequence complexity score to quantify the difficulty of training samples, and constructs a course learning strategy based on the difficulty score; The multi-head attention mechanism assigns weights to different feature dimensions of the inclination data, including: generating a query matrix, a key matrix, and a value matrix, calculating a multi-head attention score and performing feature fusion, and optimizing the fused features through residual connections; Based on the output of the multi-head attention mechanism, the temporal feature importance and statistical feature importance are calculated, and the features are weighted and fused according to the feature importance to generate a basic compensation value; the compensation adjustment coefficient is calculated based on the historical compensation effect and the tilt angle change trend, and the basic compensation value is multiplied by the compensation adjustment coefficient to obtain the initial optical path compensation coefficient; according to the periodic analysis results of the headlamp tilt angle change pattern, an adaptive prediction interval is constructed. When the change of the compensation coefficient falls within the prediction interval, it responds quickly. When the change exceeds the prediction interval, it is gradually adjusted based on the change trend. In addition, the prediction interval boundary is dynamically updated in combination with the statistical characteristics of the historical compensation sequence to obtain the final optical path compensation coefficient.

6. The method according to claim 5, characterized in that The optical path compensation neural network is jointly pre-trained through the inclination prediction task, the optical path mapping task and the contrastive learning task, including: The pre-training process of the optical path compensation neural network includes: constructing a hierarchical teacher network for tilt dynamic features, optical path mapping relationships, and tilt sequence prediction, and pre-training through feature-level and decision-level knowledge distillation and self-distillation mechanisms at different time scales; using the tilt sequence complexity score to quantify the difficulty of training samples, constructing a curriculum learning strategy based on the difficulty score, and introducing random masking, time series perturbation, and feature reorganization to generate multi-view enhanced samples; The mutual information between the inclination prediction task, optical path mapping task, and contrastive learning task is calculated. The task weights are dynamically adjusted based on the mutual information and task performance. Prediction uncertainty estimation, mapping reliability assessment, and feature consistency verification are introduced as complementary tasks. The prediction confidence is calculated for the training samples of each task. Training samples with a confidence level lower than the preset confidence level are input into the auxiliary branch network for feature enhancement learning, and the enhanced features are re-input into the main network. A performance score is calculated based on compensation accuracy and system stability, a sensitivity analysis is performed on network parameters based on the performance score, characteristic patterns of compensation samples whose performance scores exceed a preset score threshold are stored in a memory bank, and network parameters are dynamically adjusted based on the characteristic patterns in the memory bank.

7. The method according to claim 1, characterized in that The target headlight range is compensated according to the optical range compensation coefficient to obtain the compensated optical range. Adjusting the headlight illumination angle based on the compensated optical range includes: The optical path compensation coefficient is multiplied by the target headlight path to obtain an initial compensation optical path, and the unit time rate of change and the change acceleration of the initial compensation optical path are calculated to construct a dynamic response curve; Based on the dynamic response curve, a smoothness index and an urgency index of the compensation optical path change are calculated, wherein the smoothness index characterizes the continuous change characteristics of the compensation optical path, and the urgency index characterizes the degree of mutation of the compensation optical path; an adjustment response mode is selected according to the smoothness index and the urgency index, wherein the adjustment response mode includes a fast response mode and a gradual response mode; when the fast response mode is selected, the initial compensation optical path is mapped into an illumination angle adjustment instruction; when the gradual response mode is selected, a segmented adjustment sequence of the illumination angle is calculated based on the change trend of the initial compensation optical path, and the segmented adjustment sequence is mapped into the illumination angle adjustment instruction according to a preset adjustment step size; The actual angle data during the illumination angle adjustment process is collected, the deviation between the actual angle and the target angle is calculated, the deviation is input into the adaptive corrector, an illumination angle compensation amount is generated, and subsequent angle adjustment instructions are corrected based on the illumination angle compensation amount.

8. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to call the instructions stored in the memory to execute the method according to any one of claims 1 to 7.

9. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Intelligent transportation methods and systems

    CA3238745A1

  • Illuminating light switching method, device and equipment and storage medium

    CN118238719A