Vehicle lamp control method and device and storage medium
By obtaining and analyzing the characteristics of the vehicle's environment and automatically controlling the headlights, the existing headlight control methods are solved and driving safety is improved.
Patent Information
- Application Number
- CN202411779796.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-03-11
AI Technical Summary
The existing headlight control method is cumbersome to operate, making it difficult to turn on or off the headlights in time and accurately in bad weather, affecting driving safety.
By acquiring at least one environmental feature of the current environment in which the vehicle is located, the vehicle light control parameters are determined according to the importance of each environmental feature, and automatic control of the vehicle light is realized.
It realizes accurate control of the headlights in bad weather, improves the driver's vision clarity, and ensures driving safety.
Smart Images

Figure CN119603838A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of lamp control, and in particular to a method, device and storage medium for controlling a vehicle lamp. Background Art
[0002] Headlights are an important part of a car, not only providing lighting, but also serving as warnings and signal transmission. For example, in bad weather, the driver's vision will be affected, and fog lights can provide additional light support for the driver to help them better judge the road conditions ahead and the surrounding environment.
[0003] At present, the lights are generally turned on and off by the light control lever under the steering wheel or the knob on the center console. This method is not only cumbersome to operate, but also in some cases, the driver may not be able to accurately judge the environmental conditions in time, and thus cannot effectively turn on or off the lights, affecting driving safety. Summary of the invention
[0004] The purpose of the present application is to provide a method, device and storage medium for controlling vehicle lights, so as to automatically and accurately control the turning off and on of vehicle lights.
[0005] In order to achieve the above objectives, this application adopts the following technical solutions:
[0006] In a first aspect, the present application provides a method for controlling a vehicle lamp, comprising:
[0007] Acquire at least one environmental feature of the current environment of the vehicle; the environmental feature is a feature that affects the driver's line of sight clarity;
[0008] According to the importance of each environmental feature in at least one environmental feature, a vehicle light control parameter is obtained;
[0009] Controlling the headlights according to the headlight control parameters;
[0010] The importance of each feature is determined according to the characterization capability of each environmental feature on the current weather.
[0011] In a second aspect, the present application provides an electronic device, including:
[0012] at least one processor, and a memory communicatively coupled to at least one of the processors;
[0013] The memory stores instructions that can be executed by at least one of the processors, and the instructions are executed by at least one of the processors so that at least one of the processors can execute any of the vehicle light control methods.
[0014] In a third aspect, the present application provides a computer-readable storage medium, on which computer instructions are stored, and the computer instructions are used to enable the computer to execute any of the vehicle light control methods described above.
[0015] Compared with the prior art, the beneficial effects of this application are:
[0016] The embodiment of the present application obtains at least one environmental feature of the current environment of the vehicle that affects the driver's line of sight, and obtains the headlight control parameter based on the importance of each environmental feature, and determines the importance of each environmental feature according to the characterization capability of the current weather, so that environmental features with strong characterization capabilities have higher importance. Environmental features with higher importance will make a greater contribution to the headlight control parameter, thus playing a more important role in the decision-making process of headlight control. Based on this, the embodiment can obtain the influence of each environmental feature on the final decision based on the characterization capability of each environmental feature on the weather, so that the headlights can be automatically controlled accurately based on the current weather, thereby improving the driver's line of sight and ensuring driving safety. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the specific implementation methods of the present application or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0018] Figure 1 is a flow chart of a method for controlling a vehicle light provided in an embodiment of the present application;
[0019] Figure 2 is a flow chart of another vehicle light control method provided in an embodiment of the present application;
[0020] Figure 3 is a flow chart of another vehicle light control method provided in an embodiment of the present application;
[0021] Figure 4 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0022] The following is a description of exemplary embodiments of the present application in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present application. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0023] Figure 1 This is a flow chart of a method for controlling a headlight provided in this embodiment. This embodiment is applicable to a scenario in which the headlights mounted on a vehicle are automatically controlled. The method can be executed by an electronic device. The electronic device can be integrated into the vehicle computer or can be independent of the vehicle computer. The electronic device can directly send a control signal to the headlight controller or send a control signal via the steering headlight controller in the vehicle controller to control the turning on and off of the headlights.
[0024] like Figure 1 As shown, this embodiment provides a method for controlling a vehicle lamp, comprising the following steps:
[0025] S110: Obtain at least one environmental feature of the current environment in which the vehicle is located.
[0026] This embodiment does not limit the type of vehicle, and may be various types of vehicles, such as fuel vehicles, new energy vehicles, sedans, SUVs, etc. The vehicle is equipped with various types of lights, such as fog lights, clearance lights, low beam lights, high beam lights, and hazard warning flashers.
[0027] This embodiment does not limit the state of the vehicle, which may be a driving state or a temporarily parked state, but requires that the vehicle is powered on and the headlight controller is kept started and can receive the headlight control signal sent by the electronic device.
[0028] As the vehicle travels, it will be in different environments. Obtain at least one environmental feature of the current environment. Environmental features are features that affect the clarity of the driver's vision and can characterize the current environmental conditions, such as at least one of image features, light intensity, raindrop volume, precipitation, snowfall, and humidity. In one embodiment, images of the current environment in which the vehicle is located are collected by a vehicle-mounted camera, including front images, rear images, left images, and right images. The information in these images (including pedestrians, obstacles, brightness, raindrops, etc.) is used as image features. The light intensity of the current environment is collected by a light intensity sensor. The humidity of the current environment is collected by a humidity sensor. The precipitation and snowfall of the current environment are collected by a raindrop volume sensor. In another embodiment, the weather forecast for the current geographical location is obtained through the network, so that at least one environmental feature is obtained in the weather forecast, such as it is raining in a certain place with a precipitation of 1cm.
[0029] S120. Obtain a vehicle light control parameter according to the importance of each environmental feature in at least one environmental feature; the importance of each feature is determined according to the characterization capability of each environmental feature for the current weather.
[0030] S130: Control the vehicle lights according to the vehicle light control parameters.
[0031] Different types of lights need to be turned on in different weather conditions. For example, fog lights need to be turned on in foggy weather, and clearance lights need to be turned on in rainy or dark weather. Therefore, the current weather needs to be identified first.
[0032] At least one environmental feature has different characterization capabilities for the current weather. For example, precipitation has a stronger characterization capability for rainy days than light intensity; humidity has a stronger characterization capability for foggy days than precipitation. In this embodiment, the characterization capability is quantified as the importance of each environmental feature. The stronger the characterization capability for the current weather, the more important the environmental feature is.
[0033] The more important the environmental feature is, the greater the role it plays in the headlight control. Based on this, the present embodiment obtains the headlight control parameter according to the importance of each environmental feature. The headlight control parameter is a variable used to determine the headlight control instruction (on or off). If the value of the environmental feature is larger and the importance is higher, the headlight control parameter is larger, and the control of the headlight can be triggered. For example, the higher the humidity is, and the more important the humidity is to the current foggy day, the higher the headlight control parameter will be, which will trigger the turning on of the fog lights.
[0034] This embodiment obtains at least one environmental feature of the current environment of the vehicle that affects the driver's line of sight, and obtains the headlight control parameter based on the importance of each environmental feature. The importance of each environmental feature is determined according to the characterization capability of the current weather, so that environmental features with strong characterization capabilities have higher importance. Environmental features with higher importance will make greater contributions to the headlight control parameters, thus playing a more important role in the decision-making process of headlight control. Based on this, this embodiment can obtain the influence of each environmental feature on the final decision based on the characterization capability of each environmental feature on the weather, so that the headlights can be automatically controlled accurately based on the current weather, improving the driver's line of sight and ensuring driving safety.
[0035] This embodiment combines the image data collected by the high-definition camera with the sensor data such as light intensity, humidity, and raindrop volume to achieve a comprehensive perception of the vehicle's surrounding environment. The image data collected by the camera can identify weather conditions (such as sunny, cloudy, rainy, foggy, etc.), providing an intuitive basis for the control of the rear fog lights. The sensor data provides real-time environmental parameters such as light intensity, humidity, and raindrop volume, providing quantitative indicators for environmental judgment.
[0036] Figure 2 is a flow chart of another vehicle light control method provided by an embodiment of the present application. This embodiment focuses on the process of obtaining the importance of each environmental feature. Figure 2 , the method provided in this embodiment includes the following operations:
[0037] S210: Train at least one decision tree according to the training samples.
[0038] The training samples include at least one environmental feature and the weather type label required for turning on the headlights. The weather type labels include foggy days, rainy days, snowy days, etc. Multiple training samples are constructed into a dataset. The dataset is divided into 70% training set and 30% test set.
[0039] A decision tree is trained using all or part of the data set, or different decision trees are trained by selecting training samples from the data set in a replacement / random manner. The decision tree makes decisions through a tree structure and can be used for the classification of weather types in this embodiment. Each weather type corresponds to at least one control instruction for vehicle lights. For example, foggy days correspond to control instructions for turning on fog lights, and rainy days correspond to control instructions for turning on clearance lights and low beam lights.
[0040] This embodiment can train only one decision tree, or train a random forest model consisting of at least two decision trees. When constructing a random forest model, firstly, multiple sample subsets are randomly extracted from the data set with replacement (i.e., Bootstrap sampling is used), and then a decision tree is constructed for each sample subset. When constructing each decision tree, the random forest will also randomly select a part of the environmental features for division, instead of using all the features. This can increase the diversity between decision trees and reduce the risk of overfitting. Finally, voting is performed based on the classification results of each decision tree to determine the final classification result.
[0041] S220: During the training process, the importance of each environmental feature is determined according to the segmentation points of at least one decision tree.
[0042] Feature selection is the first step in decision tree training, which determines which environmental features will be used to divide the data set. When selecting environmental features, it is necessary to evaluate the importance of each environmental feature to the classification task. In this embodiment, the evaluation indicators include Gini impurity reduction and / or information gain. When determining the importance of each environmental feature, the following three steps are included:
[0043] Step 1: During the training process, calculate the Gini impurity reduction and / or information gain for each environmental feature as a segmentation point. The greater the information gain, the greater the contribution of the environmental feature to the weather type classification, and the better the segmentation effect. The Gini impurity reduction indicates that the dataset is divided into purer subsets, so the greater the Gini impurity reduction, the better the segmentation effect.
[0044] For example, the calculation process of the information gain when the environmental feature A is used as the segmentation point is as follows, and the information gain when each environmental feature is used as the segmentation point can be calculated in turn.
[0045] 1) The entropy H(D) of the data set D is calculated using the following formula.
[0046]
[0047] Among them, p i is the proportion of training samples of the ith weather category in the dataset D, and k is the total number of weather categories.
[0048] 2) The conditional entropy H(D|A) is calculated using the following formula.
[0049]
[0050] Among them, D j The environmental characteristic A takes the value of a j The data subset when H(D j ) is the data subset D j The entropy of |D j | is the number of training samples in the data subset, |D| is the total number of training samples in the data set D, m is the number of values of the environmental feature A, and j is the variable of the environmental feature.
[0051] 3) The information gain G(D,A) is calculated using the following formula.
[0052] G(D,A)=H(D)-H(D|A);
[0053] For example, the calculation process of the reduction amount of the Gini impurity when the environmental feature F is used as the segmentation point is as follows, and the reduction amount of the Gini impurity when each environmental feature is used as the segmentation point can be calculated in turn.
[0054] 1) Use the following formula to calculate the Gini impurity Gini of the data set D before segmentation parent .
[0055]
[0056] Among them, p i is the proportion of training samples of the ith weather category in the dataset D, and k is the total number of weather categories.
[0057] 2) Assume that the dataset D is segmented using the environmental feature F to generate several sub-datasets. For each sub-dataset c, calculate its Gini impurity G inic Then, according to the proportion w of training samples in sub-dataset c to the total number of training samples c , calculate the weighted average impurity Gini children .
[0058]
[0059] Where C is the number of sub-datasets.
[0060] 3) The following formula is used to calculate the Gini impurity reduction ΔGini(F,T) when the environmental feature F is used as the split point on the Tth decision tree, that is, the Gini impurity reduction before and after the data set D is split.
[0061] ΔGini(F,T)=Gini parent -Gini children ;
[0062] Step 2: Determine the target environmental feature as the best segmentation point from a variety of environmental features based on the reduction in Gini impurity and / or information gain.
[0063] A decision tree includes a root node, a decision node and a leaf node. The root node / parent node is segmented to form a child node / leaf node. This step aims to find the most suitable environmental feature as the best segmentation point. In one embodiment, based on the information gain when each environmental feature obtained above is used as a segmentation point, the target environmental feature with the largest information gain is used as the best segmentation point of the decision tree. In another embodiment, based on the reduction in Gini impurity when each environmental feature obtained above is used as a segmentation point, the target environmental feature with the largest reduction in Gini impurity is used as the best segmentation point of the decision tree. In yet another embodiment, the best segmentation point is determined by combining the information gain and the reduction in Gini impurity. For example, the target environmental feature with the largest information gain is used as the root node, and the target environmental feature with the largest reduction in Gini impurity is used as the decision node.
[0064] After the first and second steps, the segmentation of the entire decision tree is completed, that is, the training process of at least one decision tree is completed.
[0065] The third step is to calculate the importance of each environmental feature in at least one decision tree according to the segmentation effect of each environmental feature on the training samples.
[0066] After the decision tree is trained, the feature importance is obtained. The importance is calculated based on the contribution of each environmental feature to the segmentation effect in the decision tree. At each tree node split, the segmentation effect of each environmental feature is evaluated. The segmentation effect can be characterized by the information gain before and after the data set is split or the reduction in Gini impurity.
[0067] The calculation method of importance is illustrated by taking the reduction of Gini impurity as an example. Optionally, when training a single decision tree, the reduction of Gini impurity for each environmental feature is accumulated. When training a random forest consisting of at least two decision trees, the reduction of Gini impurity for each environmental feature is accumulated on each decision tree, and then the reduction of Gini impurity for all decision trees is averaged to obtain the average reduction of Gini impurity for each environmental feature.
[0068] Assuming that the Gini impurity reduction of environmental feature F in a single decision tree T is ΔGini(F,T), then the importance of F I(F) can be expressed as:
[0069]
[0070] Where N is the total number of decision trees.
[0071] S230: Obtain at least one environmental feature of the current environment in which the vehicle is located.
[0072] S240: Obtain a vehicle light control parameter according to the importance of each of the at least one environmental feature.
[0073] S250: Control the vehicle lights according to the vehicle light control parameters.
[0074] This embodiment takes into account that weather type is an important factor that can determine whether the headlights are turned on. By training a decision tree that can predict weather types, the importance of each environmental feature for predicting weather types can be obtained. This importance can accurately reflect the current weather type, thereby improving the accuracy of headlight control.
[0075] Figure 3 FIG. 1 is a flow chart of another method for controlling a vehicle light provided by an embodiment of the present application. This embodiment focuses on describing the process of controlling the vehicle light according to the vehicle light control parameters. Figure 3 , the method provided in this embodiment includes the following operations:
[0076] S310: Obtain at least one environmental feature of the current environment in which the vehicle is located.
[0077] S320: Standardize at least one environmental feature.
[0078] For the convenience of calculation, each environmental feature is standardized using the baseline value or maximum value of the environmental feature. For example, the humidity value collected by the humidity sensor is divided by the maximum humidity value to obtain the standardized humidity value. For another example, the image feature: average brightness is divided by the maximum brightness value to obtain the standardized image feature.
[0079] S330: Perform weighted calculation on each standardized environmental feature according to its importance to obtain a vehicle light control parameter.
[0080] If only one environmental feature is used, it is assumed that the environmental feature has full characterization capability for the current weather, and the importance / weight is the maximum value, for example, 1. The environmental feature is multiplied by the importance to obtain the headlight control index.
[0081] If more than two environmental characteristics are used, the importance of each environmental characteristic is used as a weight, and each environmental characteristic after standardization is weighted and summed to obtain the vehicle light control parameter.
[0082] Exemplarily, the importance I(F) of the environmental feature F is calculated using the above embodiment. For the convenience of calculation, the importance of each environmental feature is normalized using the following formula to ensure that the sum of all importances is 1.
[0083]
[0084] Among them, S is the sum of the importance of all environmental features, I(F t ) is the importance of the t-th environmental feature, and n is the total number of environmental features.
[0085] After obtaining the sum of the importance S of all environmental features, the following formula is used to calculate the weight of each environmental feature.
[0086]
[0087] Among them, W(F i ) is the environmental characteristic F i The weight of .
[0088] Assume that the weights of light intensity, humidity and raindrop volume are W(F1), W(F2), W(F3) respectively; and the characteristic values of light intensity, humidity and raindrop volume are A1, B1, C1 respectively. Then the car light control parameter O is:
[0089]
[0090] Among them, A is the maximum light intensity, B is the maximum humidity, and C is the maximum raindrop amount.
[0091] S340: Determine whether the vehicle light control parameter is greater than a set threshold value, if so, execute S350, if not, execute S360.
[0092] The set threshold value can be a fixed preset value, or can be obtained by learning the driver's headlight control behavior. For example, the driver's behavior of turning on a certain headlight is monitored. When the turning-on behavior is monitored, at least one environmental feature of the current environment is collected, and the headlight control parameter is obtained according to the importance of each environmental feature. In this way, multiple headlight control parameters when the headlight is turned on multiple times can be obtained, and the multiple headlight control parameters are averaged to obtain the set threshold value.
[0093] S350, turn on the car lights.
[0094] In one embodiment, the importance of each environmental feature under various weather types is stored in advance. At least one environmental feature of the current environment of the vehicle is obtained. Since the current weather type is unknown, the headlight control parameter under each weather type is calculated according to the pre-stored importance. Then, the headlight control parameter is compared with a set threshold under the same weather type. If the headlight control parameter of the foggy weather type is greater than the set threshold of the foggy weather type, it means that the current weather is foggy and the fog lights need to be turned on.
[0095] S360: Determine whether the vehicle lights are on. If yes, execute S370; if not, execute S310.
[0096] S370. Turn off the car lights.
[0097] If the light control parameter is less than or equal to the set threshold and the light is on, the light can be turned off directly. In some cases, weather changes in a short period of time or sensor errors may cause the light control parameter to fluctuate at the set threshold, resulting in frequent turning the light on and off. To solve this problem, if the light control parameter is less than or equal to the set threshold and the light is on, multiple environmental features are input into at least one pre-trained decision tree to obtain the current weather type; if the current weather type meets the conditions for turning off the light, the light is turned off.
[0098] At least one decision tree is pre-trained using the process provided in S210. The decision tree or random forest model outputs the current weather type, such as foggy, rainy, sunny, etc. If the current weather type is not foggy, such as rainy or sunny, and the fog lamp turning-off condition is met, the fog lamp is turned off.
[0099] This embodiment calculates the importance of each feature (such as light intensity, humidity, and raindrop amount), which is based on the contribution of environmental features to the segmentation effect during the model training process. Weights are assigned to each environmental feature according to its importance, and these weights reflect the relative influence of each environmental feature on the final decision (i.e., whether to turn on the headlights). Moreover, this embodiment combines the sensor readings (after normalization) and the assigned weights to calculate a headlight control parameter. The headlight control parameter is a comprehensive indicator that integrates the influence of multiple environmental features (such as light intensity, humidity, and raindrop amount) on the demand for turning on the headlights, which is conducive to improving the accuracy and timeliness of headlight control.
[0100] This embodiment can turn on the required lights in time by accurately identifying the weather type (such as rainy days, foggy days, etc.), enhance the visibility of the vehicle in bad weather, and reduce the risk of traffic accidents. Moreover, this embodiment reduces the possibility of human error through automated control, allowing the driver to focus more on driving and improve the driving experience. This embodiment avoids unnecessary energy waste by intelligently controlling the opening and closing of the lights, which helps to save energy and reduce emissions. This embodiment combines advanced image processing and machine learning technologies to improve the intelligence level of the vehicle, so that the vehicle can better adapt to different driving environments and weather conditions. In the increasingly fierce competition in the automobile market, vehicles with advanced safety and intelligent functions are more likely to be favored by consumers. This embodiment can provide automobile manufacturers with unique selling points and enhance market competitiveness. In some areas, regulations require that some lights must be turned on under certain weather conditions. This embodiment can ensure that the vehicle always complies with these regulatory requirements and avoid possible legal disputes.
[0101] The present application also provides an electronic device, see Figure 4 , comprising at least one processor 301, and a memory 302 communicatively connected to at least one of the processors 301;
[0102] The memory 302 stores instructions that can be executed by at least one of the processors 301. The instructions are executed by at least one of the processors 301 so that at least one of the processors 301 can execute the above-mentioned vehicle light control method, thereby having at least the same advantages as the above-mentioned method.
[0103] Optionally, the electronic device also includes an interface for connecting various components, including a high-speed interface and a low-speed interface. Various components are interconnected using different buses and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the electronic device, including instructions stored in or on a memory to display graphical information of a GUI (Graphical User Interface) on an external input / output device (such as a display device coupled to an interface). In other embodiments, if necessary, multiple processors can be used together with multiple memories, and / or multiple buses can be used together with multiple memories. Similarly, multiple electronic devices can be connected (for example, as a server array, a group of blade servers, or a multi-processor system), and each device provides some necessary operations.
[0104] The memory 302 is a computer-readable storage medium that can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the vehicle light control method in the embodiment of the present application. The processor 301 executes various functional applications and data processing of the device by running the software programs, instructions and modules stored in the memory 301, that is, realizing the above-mentioned vehicle light control method.
[0105] The memory 301 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 302 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 302 may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0106] The electronic device may further include: an input device 303 and an output device 304. The processor 301, the memory 301, the input device 303 and the output device 304 may be connected via a bus or other means.
[0107] The input device 303 can receive input digital or character information, and the output device 304 can include a display device, an auxiliary lighting device (e.g., LED), and a tactile feedback device (e.g., a vibration motor), etc. The display device can include, but is not limited to, a liquid crystal display (LCD), a light emitting diode (LED) display, and a plasma display. In some embodiments, the display device can be a touch screen.
[0108] This embodiment provides a computer-readable storage medium, on which computer instructions are stored, and the computer instructions are used to enable the computer to execute the above method. The computer instructions on the computer-readable storage medium are used to enable the computer to execute the above method, and thus have at least the same advantages as the above method.
[0109] The medium in this application can adopt any combination of one or more computer-readable media. The medium can be a computer-readable signal medium or a computer-readable storage medium. The medium can be, for example, but not limited to, a system, device or component of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples of the medium (a non-exhaustive list) include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, the medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, a device or a device or used in combination with it.
[0110] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0111] The program code contained on the computer-readable medium can be transmitted using any appropriate medium, including but not limited to wireless, wire, optical cable, RF (Radio Frequency), etc., or any suitable combination of the above.
[0112] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0113] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this application can be executed in parallel, sequentially or in different orders, as long as the expected results of the technical solution disclosed in this application can be achieved, and this document is not limited here.
[0114] The above specific implementations do not constitute a limitation on the protection scope of this application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this application should be included in the protection scope of this application.
Claims
1. A method for controlling a vehicle lamp, characterized in that: include: Acquire at least one environmental feature of the current environment of the vehicle; the environmental feature is a feature that affects the driver's line of sight clarity; According to the importance of each environmental feature in at least one environmental feature, a vehicle light control parameter is obtained; Controlling the headlights according to the headlight control parameters; The importance of each feature is determined according to the characterization capability of each environmental feature on the current weather.
2. The method according to claim 1, characterized in that Before obtaining at least one environmental feature of the current environment of the vehicle, the method further includes: training at least one decision tree according to a training sample, wherein the training sample includes at least one environmental feature and a weather type label required for turning on the vehicle lights; During training, the importance of each environmental feature is determined based on the split point of at least one decision tree.
3. The method according to claim 2, characterized in that During training, the importance of each environmental feature is determined based on the split point of at least one decision tree, including: During training, the Gini impurity reduction and / or information gain are calculated for each environmental feature as a split point; Determining a target environmental feature as an optimal segmentation point from a plurality of environmental features according to the Gini impurity reduction amount and / or information gain; In the at least one decision tree, the importance of each environmental feature is calculated according to the segmentation effect of each environmental feature on the training samples.
4. The method according to claim 1, characterized in that: According to the importance of each environmental feature in at least one environmental feature, a vehicle light control parameter is obtained, including: normalizing the at least one environmental characteristic; According to the importance, a weighted operation is performed on each of the standardized environmental features to obtain a vehicle light control parameter.
5. The method according to claim 1, characterized in that Controlling the headlight according to the headlight control parameter includes: If the vehicle light control parameter is greater than a set threshold, turning on the vehicle light; The set threshold is obtained by learning the driver's headlight control behavior.
6. The method according to claim 5, characterized in that Controlling the headlight according to the headlight control parameter includes: If the vehicle light control parameter is less than or equal to a set threshold and the vehicle light is in an on state, the vehicle light is turned off.
7. The method according to claim 6, characterized in that If the vehicle light control parameter is less than or equal to a set threshold value and the vehicle light is in an on state, turning off the vehicle light includes: If the headlight control parameter is less than or equal to a set threshold and the headlight is in an on state, input the plurality of environmental features into at least one pre-trained decision tree to obtain a current weather type; If the current weather type meets the condition for turning off the vehicle lights, the vehicle lights are turned off.
8. The method according to any one of claims 1 to 7, characterized in that: The environmental characteristics include at least one of image characteristics, light intensity, raindrop amount, precipitation amount, snowfall amount and humidity; The vehicle lights include at least one of fog lights, position lights, low beam lights, high beam lights and hazard warning flashers.
9. An electronic device, characterized in that: include: at least one processor, and a memory communicatively coupled to at least one of the processors; The memory stores instructions executable by at least one of the processors, and the instructions are executed by at least one of the processors so that the at least one processor can execute the vehicle light control method according to any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that: The medium stores computer instructions, and the computer instructions are used to enable the computer to execute the vehicle light control method according to any one of claims 1 to 8.