Vehicle automatic headlamp control method and system and storage medium

By constructing a set of fuzzy variables and generating headlight control commands, the problem of malfunction in automatic headlight systems under changes in lighting and sensor failures was solved, thereby improving the reliability and adaptability of the system without increasing hardware costs.

CN121757036APending Publication Date: 2026-03-31GUANG DONG JIU LIAN KAI HONG KE JI FA ZHAN YOU XIAN GONG SI +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-02-10
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

Existing automatic headlight systems are prone to malfunctions in scenarios with faulty ambient light sensors or rapid changes in lighting conditions. Furthermore, high-precision sensors are expensive and difficult to promote in mainstream vehicle models.

Method used

By acquiring signals from ambient light sensors and vehicle status sensors, a set of input fuzzy variables is constructed and fuzzification processing is performed to generate headlight control commands, thereby achieving dynamic adjustment of the headlights and enhancing the system's reliability and scene adaptability.

Benefits of technology

It improves the control continuity and stability of the automatic headlight system, enhances its adaptability to complex lighting scenarios, and avoids the need for additional high-cost hardware.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121757036A_ABST
    Figure CN121757036A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a vehicle automatic headlamp control method and system and a storage medium, and belongs to the technical field of vehicle electronic control. The method comprises the following steps: acquiring an illumination signal output by an ambient light sensor and a running state signal output by a vehicle state sensor, converting the illumination signal to obtain an ambient illumination parameter, and analyzing the running state signal to obtain a vehicle running state parameter; constructing an input fuzzy variable set based on the ambient illuminance parameter and the vehicle running state parameter, and performing fuzzification processing on the input fuzzy variable set according to a preset membership function to generate a corresponding membership value; inputting the membership degree value into a preset fuzzy rule base to execute fuzzy reasoning and defuzzification processing, and generating a headlamp control instruction; and driving a vehicle headlamp execution unit to execute on-off control or brightness adjustment control based on the headlamp control instruction. According to the scheme, the reliability of automatic headlamp control of the vehicle is improved, and smooth self-adaptive control in a complex illumination scene is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of vehicle electronic control technology, specifically to a vehicle automatic headlight control method, a vehicle automatic headlight control system, and a storage medium. Background Technology

[0002] With the development of vehicle electronic control technology, automatic headlights have become a common driver assistance feature. Existing automatic headlight systems typically use a single ambient light sensor to detect external light intensity and compare the result with a preset fixed threshold to control the headlights' on / off state. Some high-end models combine this with vehicle speed signals to switch between high and low beams. However, this type of technology generally suffers from a simple structure and simplistic control logic. When the ambient light sensor malfunctions due to aging, surface contamination, or sudden failure, resulting in abnormal detection data, the system lacks an effective redundancy mechanism, easily leading to headlights accidentally turning off or failing to turn on, affecting driving safety. Furthermore, the fixed threshold-based control method struggles to handle rapidly changing lighting conditions, such as tunnel entrances and exits, or underground parking garage entrances, easily resulting in control lag or frequent switching, reducing operational stability. While using high-precision light sensors or image recognition solutions to improve performance can alleviate some problems, the hardware cost increases significantly, making widespread adoption in mainstream models difficult.

[0003] Therefore, how to improve the reliability, scene adaptability, and control smoothness of automatic headlight systems under limited cost conditions through reasonable utilization of sensor information and control strategy design has become an urgent technical problem to be solved. Summary of the Invention

[0004] The purpose of this invention is to provide a method, system, and storage medium for controlling automatic headlights in vehicles, so as to at least solve the problems of insufficient reliability, poor adaptability to different scenarios, and difficulty in balancing cost and performance in the prior art of automatic headlight systems.

[0005] To achieve the above objectives, the first aspect of the present invention provides a method for controlling automatic headlights in a vehicle. The method includes: acquiring an illumination signal output by an ambient light sensor and an operating status signal output by a vehicle status sensor; converting the illumination signal to obtain an ambient light illuminance parameter; parsing the operating status signal to obtain a vehicle operating status parameter; constructing an input fuzzy variable set based on the ambient light illuminance parameter and the vehicle operating status parameter; performing fuzzification processing on the input fuzzy variable set according to a preset membership function to generate corresponding membership values; inputting the membership values ​​into a preset fuzzy rule base to perform fuzzy inference and defuzzification processing to generate a headlight control command; and driving a vehicle headlight execution unit to perform on / off control or brightness adjustment control based on the headlight control command.

[0006] Optionally, the following steps are taken: acquiring the illumination signal output by the ambient light sensor and the operating status signal output by the vehicle status sensor; converting the illumination signal to obtain ambient light intensity parameters; and parsing the operating status signal to obtain vehicle operating status parameters. This includes: periodically sampling the illumination signal to obtain corresponding digital sample values; calculating the photoresistor resistance value based on the power supply voltage value and current-limiting resistor parameters of the voltage divider circuit where the ambient light sensor is located; determining the ambient light intensity parameters based on the monotonic correspondence between the photoresistor resistance value and the light intensity; performing edge detection processing on the operating status signal; counting the number of effective pulses within a unit time window; determining the engine rotation frequency based on the correspondence rule that each pulse corresponds to one change in the engine magnetic field; and determining the vehicle operating status parameters based on the correspondence rule between the engine rotation frequency and the vehicle operating status.

[0007] Optionally, constructing an input fuzzy variable set based on the ambient illuminance parameters and the vehicle operating status parameters includes: dividing the ambient illuminance parameters into multiple continuous illuminance level intervals according to a preset illuminance division interval, and establishing a corresponding illuminance membership interval boundary for each illuminance level interval; determining the corresponding illuminance input fuzzy variable based on the positional relationship of the ambient illuminance parameters within the illuminance membership interval boundary; dividing the vehicle operating status parameters into multiple continuous operating status level intervals according to a preset operating status division interval, and establishing a corresponding operating status membership interval boundary for each operating status level interval; determining the corresponding operating status input fuzzy variable based on the positional relationship of the vehicle operating status parameters within the operating status membership interval boundary; and combining the illuminance input fuzzy variable with the operating status input fuzzy variable to generate a fuzzy variable set.

[0008] Optionally, the set of input fuzzy variables is subjected to fuzzification processing according to a preset membership function to generate corresponding membership values. This includes: calling the corresponding membership function model for each input fuzzy variable in the set of input fuzzy variables, wherein the membership function model includes an increasing interval, a stable interval, and a decreasing interval; determining the membership change rule of each input fuzzy variable according to its interval position in the membership function model; wherein, when the input fuzzy variable is in the increasing interval, the membership value is calculated according to the monotonically increasing rule; when it is in the stable interval, a fixed membership value is assigned; and when it is in the decreasing interval, the membership value is calculated according to the monotonically decreasing rule; and calculating the membership value for each input fuzzy variable under multiple membership function models.

[0009] Optionally, the membership values ​​are input into a preset fuzzy rule base to perform fuzzy inference and defuzzification to generate headlight control commands. This includes: inputting the membership value set into the fuzzy rule base; matching the illumination input fuzzy variable and the running state input fuzzy variable in the antecedent of each rule one by one; calculating the activation intensity of each rule based on the corresponding membership values; generating rule activation results; performing truncation processing on the output fuzzy quantity corresponding to the consequent of each rule based on the activation results of each rule; generating corresponding rule output fuzzy subsets; performing a synthesis operation on all rule output fuzzy subsets to generate a comprehensive output fuzzy set; performing defuzzification processing on the comprehensive output fuzzy set; determining the target output quantity based on the distribution position of the output fuzzy set in the output universe; and generating headlight control commands based on the target output quantity.

[0010] Optionally, based on the activation results of each rule, the output fuzzy quantity corresponding to the rule consequent is truncated to generate a corresponding rule output fuzzy subset. This includes: for each triggered fuzzy rule, reading its corresponding rule activation result as the activation intensity of the rule; using the original membership degree distribution of the output fuzzy quantity corresponding to the rule consequent in the output universe as the baseline distribution, and using the rule activation intensity as a limiting threshold, the original membership degree distribution is amplitude-limited so that the membership degree value at any point in the output universe is not higher than the rule activation intensity; and truncating the amplitude-limited membership degree distribution of the output universe to form a rule output fuzzy subset corresponding to the rule.

[0011] Optionally, driving the vehicle headlight execution unit to perform switch control or brightness adjustment control based on the headlight control command includes: parsing the headlight control command for command type; when the headlight control command is a switch control command, generating a corresponding high-level or low-level control signal and outputting the control signal to the vehicle headlight execution unit to control the on / off state of the vehicle headlights; when the headlight control command is a brightness adjustment command, determining the duty cycle parameter according to the target output quantity corresponding to the headlight control command, generating a pulse width modulation control signal with a corresponding duty cycle, and outputting the pulse width modulation control signal to the vehicle headlight execution unit to control the brightness level of the vehicle headlights.

[0012] Optionally, when the headlight control command drives the vehicle headlight execution unit to perform switch control or brightness adjustment control, the method further includes: performing continuous sampling consistency detection on the ambient light illuminance parameter, determining whether the ambient light illuminance parameter is in a state of continuous over-range, constant value, or abnormal rate of change, and generating an anomaly judgment result based on the detection result; when the anomaly judgment result meets a preset anomaly condition, stopping the use of the headlight control command for control, and determining whether the vehicle is in a running state based on the vehicle operating state parameter; when the vehicle operating state parameter corresponds to a non-stationary state, generating a low beam control command with fixed brightness as a downgraded control command, and when the vehicle operating state parameter corresponds to a stationary state, generating a shutdown control command as a downgraded control command; and outputting the downgraded control command to the vehicle headlight execution unit instead of the headlight control command, and simultaneously generating an alarm signal to output to the vehicle alert module.

[0013] A second aspect of the present invention provides a vehicle automatic headlight control system, the system comprising: a data acquisition unit, configured to acquire an illumination signal output by an ambient light sensor and an operating status signal output by a vehicle status sensor, convert the illumination signal to obtain an ambient light illuminance parameter, and parse the operating status signal to obtain a vehicle operating status parameter; a fuzzy processing unit, configured to construct an input fuzzy variable set based on the ambient light illuminance parameter and the vehicle operating status parameter, and perform fuzzification processing on the input fuzzy variable set according to a preset membership function to generate corresponding membership values; an instruction generation unit, configured to input the membership values ​​into a preset fuzzy rule base to perform fuzzy inference and defuzzification processing to generate headlight control instructions; and an execution unit, configured to drive the vehicle headlight execution unit to perform switch control or brightness adjustment control based on the headlight control instructions.

[0014] On the other hand, the present invention provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the above-described automatic headlight control method for vehicles.

[0015] Through the above technical solution, this invention simultaneously acquires ambient light signals and vehicle operating status signals, and parses them into ambient light intensity parameters and vehicle operating status parameters respectively, forming multi-dimensional input information. Based on this, a set of input fuzzy variables is constructed and fuzzification processing is performed, enabling continuously changing ambient light and vehicle operating status to be smoothly mapped to membership values. Furthermore, inference is performed using a fuzzy rule base, and defuzzification is used to generate headlight control commands, achieving dynamic adjustment of headlight switching and brightness. This solution avoids the abrupt changes and jitter problems caused by a single fixed threshold judgment, improves the continuity and stability of the control process, and enhances the system's adaptability to complex lighting scenarios without increasing high-cost hardware.

[0016] Other features and advantages of the embodiments of the present invention will be described in detail in the following detailed description section. Attached Figure Description

[0017] The accompanying drawings are provided to further illustrate embodiments of the present invention and form part of the specification. They are used together with the following detailed description to explain the embodiments of the present invention, but do not constitute a limitation thereof. In the drawings:

[0018] Figure 1 This is a flowchart of the steps of a vehicle automatic headlight control method provided in one embodiment of the present invention; Figure 2 This is a system structure diagram of a vehicle automatic headlight control system provided in one embodiment of the present invention. Detailed Implementation

[0019] The specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.

[0020] Figure 1 This is a flowchart illustrating the steps of a vehicle automatic headlight control method according to one embodiment of the present invention. Figure 1 As shown, an embodiment of the present invention provides a method for controlling automatic headlights in a vehicle, the method comprising: Step S10: Obtain the illumination signal output by the ambient light sensor and the operating status signal output by the vehicle status sensor; convert the illumination signal to obtain the ambient light intensity parameter; and analyze the operating status signal to obtain the vehicle operating status parameter.

[0021] Specifically, the illumination signal is periodically sampled to obtain the corresponding digital sample value. The resistance value of the photoresistor is calculated based on the power supply voltage value and current limiting resistor parameters of the voltage divider circuit where the ambient light sensor is located. The ambient light intensity parameter is determined according to the monotonic correspondence between the photoresistor resistance value and the light intensity. Edge detection processing is performed on the operating status signal to count the number of effective pulses within a unit time window. The engine rotation frequency is determined according to the correspondence rule that each pulse corresponds to one change in the engine magnetic field. The vehicle operating status parameter is determined according to the correspondence rule between the engine rotation frequency and the vehicle operating status.

[0022] In this embodiment of the invention, the basic input information required for automatic headlight control comes from an ambient light sensor and a vehicle status sensor. The illumination signal output by the ambient light sensor is an analog voltage signal, which changes continuously with the intensity of external light. The illumination signal is periodically sampled, and the corresponding digital sample value is obtained in each sampling period. This digital value is then combined with the power supply voltage of the voltage divider circuit where the ambient light sensor is located and the current-limiting resistor parameters to perform a reverse calculation to obtain the resistance value of the photoresistor. Since there is a stable monotonic correspondence between the photoresistor resistance value and the light intensity, a decrease in resistance indicates increased light intensity, and an increase in resistance indicates decreased light intensity. Therefore, the photoresistor resistance value can be mapped to the ambient light intensity parameter based on this monotonic correspondence.

[0023] In practical applications, such as when a vehicle enters an underground parking garage, the resistance of the photoresistor rises rapidly in a short period of time. The above calculation process can reflect the changing trend of the ambient light intensity parameter in a timely manner.

[0024] The vehicle status sensor outputs a pulse signal, which originates from changes in the engine's magnetic field. Edge detection processing is performed on the signal to identify the rising or falling edge of the pulse, and the number of valid pulses is counted within a preset time window. Since each valid pulse corresponds to one change in the magnetic field of the engine crankshaft, the engine rotation frequency can be determined based on the number of pulses per unit time. A definite correspondence exists between the engine rotation frequency and the vehicle's operating state: when the engine rotation frequency is zero or within the stationary range, the vehicle is stationary; when the engine rotation frequency falls within the preset operating range, the vehicle is in operation. Through this analysis process, vehicle operating state parameters are generated.

[0025] This technical solution is not limited to obtaining corresponding parameters using photoresistors and engine magnetic field detection. Any solution that can deduce the resistance value corresponding to the monotonicity of the light intensity based on the voltage divider circuit parameters, and can determine the operating frequency related to the vehicle's motion state through pulse statistics rules, falls within the scope of this application. Without adding high-precision light detection devices, through explicit circuit parameter calculations and pulse statistics rules, stable generation of ambient light intensity parameters and vehicle operating state parameters is achieved, providing a reliable input foundation for subsequent control logic.

[0026] Preferably, in one possible implementation, the voltage signal output by the photoresistor is sampled in real time via an ADC channel, and the sampling result is mapped to an ambient light intensity parameter. Simultaneously, an engine speed pulse signal is captured by a Hall sensor; this pulse signal corresponds to vehicle speed and can be used to characterize whether the vehicle is in operation. Since the photoresistor and Hall sensor detect changes based on optical and magnetic field variations respectively, they are physically independent. Even when the light sensor signal is obstructed, drifts, or fails, the vehicle's operating status can still be determined based on the engine speed pulse, thus providing auxiliary judgment for subsequent control logic. This heterogeneous signal parallel acquisition method achieves redundant design at the input level.

[0027] Step S20: Construct an input fuzzy variable set based on the ambient light illuminance parameter and the vehicle operating status parameter, and perform fuzzification processing on the input fuzzy variable set according to the preset membership function to generate corresponding membership values.

[0028] Specifically, constructing an input fuzzy variable set based on the ambient illuminance parameters and the vehicle operating status parameters includes: dividing the ambient illuminance parameters into multiple continuous illuminance level intervals according to a preset illuminance division interval, and establishing a corresponding illuminance membership interval boundary for each illuminance level interval; determining the corresponding illuminance input fuzzy variable based on the positional relationship of the ambient illuminance parameters within the illuminance membership interval boundary; dividing the vehicle operating status parameters into multiple continuous operating status level intervals according to a preset operating status division interval, and establishing a corresponding operating status membership interval boundary for each operating status level interval; determining the corresponding operating status input fuzzy variable based on the positional relationship of the vehicle operating status parameters within the operating status membership interval boundary; and combining the illuminance input fuzzy variable with the operating status input fuzzy variable to generate a fuzzy variable set.

[0029] Furthermore, fuzzification processing is performed on the set of input fuzzy variables according to a preset membership function to generate corresponding membership values. This includes: calling the corresponding membership function model for each input fuzzy variable in the set of input fuzzy variables, wherein the membership function model includes an increasing interval, a stable interval, and a decreasing interval; determining the membership change rule of each input fuzzy variable according to its interval position in the membership function model; wherein, when the input fuzzy variable is in the increasing interval, the membership value is calculated according to the monotonically increasing rule; when it is in the stable interval, a fixed membership value is assigned; and when it is in the decreasing interval, the membership value is calculated according to the monotonically decreasing rule; and calculating the membership value for each input fuzzy variable under multiple membership function models.

[0030] In this embodiment of the invention, after obtaining the ambient light intensity parameters and vehicle operating status parameters, it is necessary to convert the continuously changing numerical parameters into an input format suitable for fuzzy inference. The ambient light intensity parameter is a continuous quantity, and its numerical range covers the entire interval from low to high illumination. To ensure that this continuous quantity has hierarchical expression capabilities, the ambient light intensity parameter is divided into multiple continuous illumination level intervals according to a preset illumination division interval, and a corresponding illumination sub-interval boundary is established for each illumination level interval. The illumination sub-interval boundaries can be set in a partially overlapping manner, so that there is a transition region between adjacent levels.

[0031] The positional relationship of the ambient illuminance parameter within the boundaries of different intervals determines its corresponding fuzzy illuminance input variable. When the ambient illuminance parameter is within the overlapping range of two level intervals, it can participate in the expression of both levels simultaneously, providing a basis for subsequent smooth inference.

[0032] Vehicle operating status parameters are also categorized into levels according to preset operating status intervals. These intervals are divided into multiple consecutive operating status level intervals, and a corresponding operating status membership boundary is established for each level interval. The positional relationship of the vehicle operating status parameters within different operating status level intervals determines the corresponding operating status input fuzzy variables. For example, when the vehicle is in a slow start-up state, the vehicle operating status parameters may be located in the transition region between the stationary and low-speed intervals, thus simultaneously possessing the participation of both operating states. The illumination input fuzzy variable is combined with the operating status input fuzzy variable to form a set of input fuzzy variables, providing a multi-dimensional input basis for subsequent inference.

[0033] After constructing the set of input fuzzy variables, fuzzification is performed on the set. For each input fuzzy variable in the set, the corresponding membership function model is called, which is divided into rising intervals, stable intervals, and falling intervals. Different membership change rules correspond to different interval positions of the input fuzzy variable. When the input fuzzy variable is in the rising interval, its membership value is calculated according to a monotonically increasing rule; when it is in the stable interval, its membership value remains a fixed value; and when it is in the falling interval, its membership value is calculated according to a monotonically decreasing rule. Through this interval-based calculation method, continuous input quantities form a smooth transition in membership expression at different levels.

[0034] For each input fuzzy variable, membership values ​​can be calculated under multiple membership function models, thereby generating a corresponding set of membership values. This set of membership values ​​represents the degree of participation of the current ambient light intensity parameter and the vehicle operating status parameter at each level.

[0035] By constructing fuzzy variables and calculating membership degrees as described above, the boundary abruptness problem caused by single threshold judgment is avoided, allowing the input parameters to exhibit continuous variation characteristics within the critical interval. Simultaneously, it provides a precise and calculable membership degree basis for subsequent matching and inference in the fuzzy rule base. The number of interval divisions, the method of setting interval boundaries, and the form of the membership degree function can all be adjusted according to actual application needs. As long as the technical approach of determining the input fuzzy variables based on the positional relationship of interval boundaries and calculating membership degrees through interval-based rules is met, it falls within the scope of protection of this application.

[0036] Step S30: Input the membership value into a preset fuzzy rule base to perform fuzzy inference and defuzzification to generate headlight control commands.

[0037] Specifically, the membership value set is input into the fuzzy rule base, and the illumination input fuzzy variable and the running state input fuzzy variable in the antecedent of each matching rule are matched one by one. The activation intensity of each rule is calculated based on the corresponding membership value to generate rule activation results. According to the activation results of each rule, the output fuzzy quantity corresponding to the consequent of the rule is truncated to generate the corresponding rule output fuzzy subset. A synthesis operation is performed on all rule output fuzzy subsets to generate a comprehensive output fuzzy set. Defuzzification processing is performed on the comprehensive output fuzzy set, and the target output quantity is determined according to the distribution position of the output fuzzy set in the output universe of discourse. The headlight control command is generated based on the target output quantity.

[0038] Furthermore, based on the activation results of each rule, the output fuzzy quantity corresponding to the rule consequent is truncated to generate a corresponding rule output fuzzy subset. This includes: for each triggered fuzzy rule, reading its corresponding rule activation result as the activation intensity of the rule; using the original membership degree distribution of the output fuzzy quantity corresponding to the rule consequent in the output universe as the baseline distribution, and using the rule activation intensity as a limiting threshold, the original membership degree distribution is amplitude-limited so that the membership degree value at any point in the output universe is not higher than the rule activation intensity; and the amplitude-limited output universe membership degree distribution is truncated to form a rule output fuzzy subset corresponding to the rule.

[0039] In this embodiment of the invention, after the membership value set is entered into the fuzzy rule base, the fuzzy inference and defuzzification process begins. The fuzzy rule base consists of multiple rules, each including a preamble and a consequent. The preamble corresponds to the combination of the illumination input fuzzy variable and the running state input fuzzy variable, while the consequent corresponds to the output fuzzy quantity of the headlight state. When the membership value set is input into the fuzzy rule base, a matching operation is performed on each rule one by one. The membership values ​​of each input fuzzy variable in the preamble are used as the participation degree, and the activation strength of the rule is calculated according to a preset logical operation method. The activation strength characterizes the degree to which the rule is triggered under the current input conditions, thereby generating a rule activation result.

[0040] After obtaining the rule activation result, the output fuzzy quantity corresponding to the rule consequent is truncated. Specifically, for each triggered fuzzy rule, its rule activation result is read as the activation strength of the rule, and this activation strength is used as a limit threshold. The output fuzzy quantity corresponding to the rule consequent originally has a complete membership degree distribution curve in the output universe, which reflects the probability distribution of different output values ​​under the rule. Using the rule activation strength as the limit threshold, the amplitude of the original membership degree distribution is limited so that the membership degree value at any point in the output universe does not exceed the rule activation strength, thus forming a truncated output membership degree distribution. Subsequently, the amplitude-limited output universe membership degree distribution is truncated to obtain the rule output fuzzy subset of the corresponding rule. This rule output fuzzy subset reflects the range of contribution of the rule to the output result under the current input conditions.

[0041] After all rules have been truncated, a synthesis operation is performed on the fuzzy subsets of each rule's output, superimposing multiple rule output fuzzy subsets to form a comprehensive output fuzzy set. The synthesis operation can merge membership values ​​at the same output universe position by taking the maximum value, integrating the output contributions of different rules within a unified output space. After the comprehensive output fuzzy set is formed, defuzzification processing is performed on it. In this embodiment, the centroid method can be used for calculation, determining the target output quantity based on the overall distribution position of the comprehensive output fuzzy set in the output universe. The target output quantity is a deterministic value, corresponding to the brightness level or on / off state required for headlight control.

[0042] Finally, a headlight control command is generated based on the target output, and this command is used to drive the vehicle's headlight actuator. Through the above reasoning and defuzzification process, the input fuzzy variables form a smooth and continuous output result under the action of multiple rules, while ensuring that the degree of participation of each rule in the final control result can be quantified.

[0043] In one specific implementation, during the input fuzzification stage, the collected ambient light intensity parameters and vehicle operating status parameters are input as continuous variables. For the ambient light intensity parameters, a preset set of light levels is defined as "dark," "medium," and "bright," and a corresponding membership function interval is assigned to each light level. For the vehicle operating status parameters, a preset set of operating status levels is defined as "stationary," "low speed," and "high speed," and corresponding membership function intervals are set. When the ambient light intensity parameter value is low, its membership value increases in the "dark" level and decreases in the "medium" and "bright" levels. When the engine rotation frequency corresponding to the vehicle operating status parameter is in a higher range, its membership value increases in the "high speed" level. Through the above membership function calculation, the continuous variables are fuzzified into linguistic variable expressions with different degrees of participation.

[0044] In the fuzzy rule base stage, a set of fuzzy rules based on preset empirical rules is established. For example, when the illuminance is "dark" and the vehicle speed is "stationary," the rule output is "low beam"; when the illuminance is "dark" and the vehicle speed is "high speed," the rule output is "high beam"; when an abnormal illuminance sensor signal is detected and the vehicle speed is "not stationary," the rule output is "low beam" and an alarm is triggered. Each rule is matched and calculated based on its antecedent membership value to obtain the activation degree of the corresponding rule and generate the corresponding output fuzzy quantity.

[0045] In the defuzzification stage, all rule-based output fuzzy quantities are synthesized, and the centroid method is used to calculate the centroid position of the output fuzzy set in the output universe of discourse, obtaining the target output quantity. This target output quantity is converted into a PWM duty cycle or a switching control signal to drive the LED headlight module. A low beam control signal is output when the target output quantity corresponds to low beam control; a high beam control signal is output when the target output quantity corresponds to high beam control; and an off signal is output when it corresponds to the off state. Through the above fuzzy decision-making and control process, dynamic headlight control based on illumination level and vehicle operating status is achieved, and the basic lighting control logic is maintained through rule constraints in the event of abnormal illumination signals.

[0046] Step S40: Based on the headlight control command, drive the vehicle headlight execution unit to perform switch control or brightness adjustment control.

[0047] Specifically, the headlight control command is parsed for command type. When the headlight control command is a switch control command, a corresponding high-level or low-level control signal is generated and the control signal is output to the vehicle headlight execution unit to control the on / off state of the vehicle headlights. When the headlight control command is a brightness adjustment command, the duty cycle parameter is determined according to the target output quantity in the headlight control command, and a pulse width modulation control signal with the corresponding duty cycle is generated and the pulse width modulation control signal is output to the vehicle headlight execution unit to control the brightness level of the vehicle headlights.

[0048] In this embodiment of the invention, the generated headlight control command is used to directly drive the vehicle's headlight execution unit to complete the corresponding control action. The headlight control command first undergoes command type parsing to determine whether it is a switch control command or a brightness adjustment command based on its content. When the headlight control command is a switch control command, a corresponding level control signal is generated; a high-level signal is output when the command indicates an on state, and a low-level signal is output when the command indicates a off state. The level control signal is output to the vehicle's headlight execution unit to control the on / off state of the vehicle's headlights.

[0049] When the headlight control command is a brightness adjustment command, the duty cycle parameter is determined based on the corresponding target output quantity in the headlight control command. The duty cycle parameter reflects the target brightness level of the headlight, and a pulse width modulation (PWM) control signal with the corresponding duty cycle is generated accordingly. The PWM control signal is output to the vehicle's headlight actuator unit, which controls the luminous intensity of the LED headlights by adjusting the on / off ratio of the drive current, thus achieving continuous brightness adjustment. Through the above command parsing and signal generation process, the headlight control command can be converted into a clear electrical drive signal, thereby completing on / off control or brightness adjustment control.

[0050] Preferably, when the headlight control command drives the vehicle headlight execution unit to perform switch control or brightness adjustment control, the method further includes: performing continuous sampling consistency detection on the ambient light illuminance parameter, determining whether the ambient light illuminance parameter is in a state of continuous over-range, constant value, or abnormal rate of change, and generating an anomaly judgment result based on the detection result; when the anomaly judgment result meets a preset anomaly condition, stopping the use of the headlight control command for control, and determining whether the vehicle is in a running state based on the vehicle operating state parameter; when the vehicle operating state parameter corresponds to a non-stationary state, generating a low beam control command with fixed brightness as a downgraded control command, and when the vehicle operating state parameter corresponds to a stationary state, generating a shutdown control command as a downgraded control command; and outputting the downgraded control command to the vehicle headlight execution unit instead of the headlight control command, and simultaneously generating an alarm signal to output to the vehicle alert module.

[0051] In this embodiment of the invention, to improve the system's operational stability under sensor malfunctions, anomaly detection and degradation control logic is added during the execution of headlight control commands. Continuous sampling consistency detection is performed on ambient light illuminance parameters. By comparing the ambient light illuminance parameters over multiple consecutive sampling periods, it is determined whether a persistent over-range state, a constant value state, or an abnormal rate of change state exists. A persistent over-range state is used to identify abnormal situations where the sensor output remains within its maximum or minimum range for an extended period; a constant value state is used to identify data inconsistency caused by sensor obstruction or signal stagnation; and an abnormal rate of change state is used to identify drastic fluctuations that do not conform to physical laws within a short period. Anomaly detection results are generated based on the above detection results.

[0052] Furthermore, when the anomaly determination result meets the preset anomaly conditions, the original headlight control commands are stopped, and degraded control logic is entered. The vehicle's operating status parameters determine whether the vehicle is in operation. When the vehicle's operating status parameters correspond to a non-stationary state, a fixed-brightness low-beam control command is generated as a degraded control command to ensure the vehicle has basic lighting capabilities while driving; when the vehicle's operating status parameters correspond to a stationary state, a shutdown control command is generated as a degraded control command.

[0053] The downgraded control command replaces the original headlight control command and is output to the vehicle's headlight actuator unit. Simultaneously, an alarm signal is generated and output to the vehicle's alert module to remind the driver that the system is in an abnormal operating state. Through this anomaly detection and downgrade process, the system maintains predictable control behavior even when ambient light sensing is abnormal.

[0054] In another possible implementation, a trend sequence of ambient illuminance parameters is calculated over multiple consecutive sampling periods, and slope analysis is performed on this trend sequence. When a rapid decrease in ambient illuminance parameters is detected within a preset time window, and the decrease reaches a preset gradient threshold, it is determined that the vehicle may be entering a short-term shading scenario such as a tunnel, culvert, or under an overpass. At this time, while maintaining the fuzzy inference results, a response advance correction coefficient is applied to the headlight control command, causing the headlights to switch to low beam or high beam mode before fully entering the low-light environment. When the ambient illuminance parameters show a rapid increase, delayed confirmation logic is applied to the headlight shut-off or downgrading process to prevent the vehicle from frequently switching at tunnel or underpass exits due to instantaneous light recovery.

[0055] This implementation method does not add extra hardware; it achieves adaptive recognition of special scenarios solely through dynamic analysis of illumination change gradients, making it suitable for complex road environments such as urban expressways, viaducts, and continuous tunnels. The aforementioned control methods that provide early response or delayed confirmation based on illumination change trends all fall within the extended protection scope of this application.

[0056] In another possible implementation, when the vehicle's operating status parameters are detected to be in a stationary range and remain at a preset time threshold, a secondary verification of the ambient light illuminance parameters is performed. If the ambient light illuminance parameters are in a low-light range, the normal low-beam brightness is not maintained directly; instead, a time-limited low-power lighting control command is generated to make the vehicle's headlights operate at a preset low duty cycle. If no change in the vehicle's operating status parameters is detected after a preset time, an automatic shutdown control command is generated. If the vehicle's operating status parameters are detected to re-enter the operating range during the low-power lighting phase, normal fuzzy control logic is immediately restored.

[0057] This implementation method is suitable for scenarios such as temporary parking and short nighttime stops. By coordinating the judgment of vehicle operating status parameters and ambient light parameters, it achieves a balance between lighting maintenance and power consumption. Without adding additional hardware, the control strategy is extended by determining the duration of the operating status, forming an additional control mode that works in conjunction with the basic fuzzy decision logic.

[0058] Figure 2 This is a system structure diagram of a vehicle automatic headlight control system provided in one embodiment of the present invention. Figure 2 As shown, this invention provides a vehicle automatic headlight control system, comprising: a data acquisition unit for acquiring illumination signals output by an ambient light sensor and operating status signals output by a vehicle status sensor, converting the illumination signals to obtain ambient light illuminance parameters, and parsing the operating status signals to obtain vehicle operating status parameters; a fuzzy processing unit for constructing an input fuzzy variable set based on the ambient light illuminance parameters and the vehicle operating status parameters, and performing fuzzification processing on the input fuzzy variable set according to a preset membership function to generate corresponding membership values; an instruction generation unit for inputting the membership values ​​into a preset fuzzy rule base to perform fuzzy inference and defuzzification processing to generate headlight control instructions; and an execution unit for driving the vehicle headlight execution unit to perform on / off control or brightness adjustment control based on the headlight control instructions.

[0059] The present invention also provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the above-described automatic headlight control method for vehicles.

[0060] Those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program instructing related hardware. This program is stored in a storage medium and includes several instructions to cause a microcontroller, chip, or processor to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0061] The optional embodiments of the present invention have been described in detail above with reference to the accompanying drawings. However, the embodiments of the present invention are not limited to the specific details described above. Within the scope of the technical concept of the embodiments of the present invention, various simple modifications can be made to the technical solutions of the embodiments of the present invention, and these simple modifications all fall within the protection scope of the embodiments of the present invention. It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. To avoid unnecessary repetition, the embodiments of the present invention will not further describe the various possible combinations.

[0062] Furthermore, various different embodiments of the present invention can be combined in any way, as long as they do not violate the spirit of the embodiments of the present invention, they should also be regarded as the content disclosed by the embodiments of the present invention.

Claims

1. A method for controlling automatic headlights in a vehicle, characterized in that, The method includes: The system acquires the illumination signal output by the ambient light sensor and the operating status signal output by the vehicle status sensor, converts the illumination signal to obtain the ambient light illuminance parameter, and analyzes the operating status signal to obtain the vehicle operating status parameter. Based on the ambient light illuminance parameters and the vehicle operating status parameters, an input fuzzy variable set is constructed, and the input fuzzy variable set is fuzzified according to a preset membership function to generate corresponding membership values; The membership value is input into a preset fuzzy rule base to perform fuzzy inference and defuzzification to generate headlight control commands. Based on the headlight control command, the vehicle headlight actuator is driven to perform switch control or brightness adjustment control.

2. The vehicle automatic headlight control method according to claim 1, characterized in that, The system acquires the illumination signal output by the ambient light sensor and the operating status signal output by the vehicle status sensor; converts the illumination signal to obtain ambient light intensity parameters; and analyzes the operating status signal to obtain vehicle operating status parameters, including: The illumination signal is periodically sampled to obtain the corresponding digital sampling value. The resistance value of the photoresistor is calculated based on the power supply voltage value and current limiting resistor parameter of the voltage divider circuit where the ambient light sensor is located. The ambient light intensity parameter is determined according to the monotonic correspondence between the resistance value of the photoresistor and the light intensity. Edge detection processing is performed on the operating status signal, the number of effective pulses within a unit time window is counted, the engine rotation frequency is determined according to the corresponding rule that each pulse corresponds to one change in the engine magnetic field, and the vehicle operating status parameters are determined according to the correspondence rule between the engine rotation frequency and the vehicle operating status.

3. The vehicle automatic headlight control method according to claim 1, characterized in that, Based on the ambient light intensity parameters and the vehicle operating status parameters, a set of input fuzzy variables is constructed, including: The ambient illuminance parameter is divided into multiple continuous illuminance level intervals according to a preset illuminance division interval, and a corresponding illuminance membership interval boundary is established for each illuminance level interval. The corresponding illuminance input fuzzy variable is determined according to the positional relationship of the ambient illuminance parameter in the illuminance membership interval boundary. The vehicle operating status parameters are divided into multiple continuous operating status level intervals according to a preset operating status division interval, and a corresponding operating status membership interval boundary is established for each operating status level interval. The corresponding operating status input fuzzy variable is determined according to the positional relationship of the vehicle operating status parameters in the operating status membership interval boundary. The fuzzy variable of illumination input is combined with the fuzzy variable of running status input to generate a set of fuzzy variables.

4. The vehicle automatic headlight control method according to claim 3, characterized in that, The input fuzzy variable set is fuzzified according to a preset membership function to generate corresponding membership values, including: For each input fuzzy variable in the set of input fuzzy variables, the corresponding membership function model is called. The membership function model includes an increasing interval, a stable interval, and a decreasing interval. The membership degree change rule is determined based on the interval position of each input fuzzy variable in the membership function model; where... When the input fuzzy variable is in the rising interval, the membership value is calculated according to the monotonically increasing rule; when it is in the stable interval, a fixed membership value is assigned; and when it is in the falling interval, the membership value is calculated according to the monotonically decreasing rule. For each input fuzzy variable, the membership value is calculated under multiple membership function models.

5. The vehicle automatic headlight control method according to claim 1, characterized in that, The membership values ​​are input into a preset fuzzy rule base to perform fuzzy inference and defuzzification to generate headlight control commands, including: The membership value set is input into the fuzzy rule base, and the illumination input fuzzy variable and the running status input fuzzy variable in the antecedent of each matching rule are matched one by one. The activation intensity of each rule is calculated based on the corresponding membership value, and the rule activation result is generated. Based on the activation results of each rule, the output fuzzy quantity corresponding to the rule consequent is truncated to generate the corresponding rule output fuzzy subset. Perform a synthesis operation on all rule-output fuzzy subsets to generate a comprehensive output fuzzy set; The comprehensive output fuzzy set is defuzzified, the target output quantity is determined according to the distribution position of the output fuzzy set in the output universe, and the headlight control command is generated based on the target output quantity.

6. The vehicle automatic headlight control method according to claim 5, characterized in that, Based on the activation results of each rule, the output fuzzy values ​​corresponding to the rule consequents are truncated to generate corresponding rule output fuzzy subsets, including: For each triggered fuzzy rule, its corresponding rule activation result is read as the activation strength of that rule; The original membership degree distribution of the output fuzzy quantity corresponding to the rule consequent in the output universe is used as the baseline distribution, and the activation intensity of the rule is used as the limiting threshold to limit the amplitude of the original membership degree distribution so that the membership degree value of any point in the output universe is not higher than the activation intensity of the rule. The membership distribution of the output universe after amplitude limitation is truncated to form a fuzzy subset of the rule output corresponding to the rule.

7. The automatic headlight control method for vehicles according to claim 1, characterized in that, Based on the headlight control command, the vehicle headlight actuator is driven to perform on / off control or brightness adjustment control, including: The headlight control command is parsed for command type. When the headlight control command is a switch control command, a corresponding high-level or low-level control signal is generated and the control signal is output to the vehicle headlight execution unit to control the on / off state of the vehicle headlights. When the headlight control command is a brightness adjustment command, the duty cycle parameter is determined according to the target output quantity corresponding to the headlight control command, and a pulse width modulation control signal with the corresponding duty cycle is generated. The pulse width modulation control signal is output to the vehicle headlight execution unit to control the brightness level of the vehicle headlights.

8. The automatic headlight control method for vehicles according to claim 1, characterized in that, When the headlight actuator of the vehicle is driven to perform switch control or brightness adjustment control based on the headlight control command, the method further includes: Perform continuous sampling consistency detection on the ambient light illuminance parameter to determine whether the ambient light illuminance parameter is in a state of continuous over-range, constant value, or abnormal rate of change, and generate an anomaly judgment result based on the detection result; When the anomaly determination result meets the preset anomaly conditions, the headlight control command is stopped, and the vehicle is determined to be in operation based on the vehicle operating status parameters. When the vehicle operating status parameters correspond to a non-stationary state, a low beam control command with fixed brightness is generated as a degraded control command; when the vehicle operating status parameters correspond to a stationary state, a shut-off control command is generated as a degraded control command. The downgrade control command replaces the headlight control command and is output to the vehicle headlight execution unit, and an alarm signal is generated and output to the vehicle alert module simultaneously.

9. A vehicle automatic headlight control system, characterized in that, The system includes: The acquisition unit is used to acquire the illumination signal output by the ambient light sensor and the operating status signal output by the vehicle status sensor, convert the illumination signal to obtain the ambient light intensity parameter, and parse the operating status signal to obtain the vehicle operating status parameter. The fuzzy processing unit is used to construct an input fuzzy variable set based on the ambient light illuminance parameters and the vehicle operating status parameters, and to perform fuzzification processing on the input fuzzy variable set according to a preset membership function to generate corresponding membership values; The instruction generation unit is used to input the membership value into a preset fuzzy rule base to perform fuzzy inference and defuzzification processing to generate headlight control instructions. An execution unit is used to drive the vehicle headlight execution unit to perform switch control or brightness adjustment control based on the headlight control command.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed on a computer, cause the computer to perform the vehicle automatic headlight control method as described in any one of claims 1-8.