Intelligent display screen brightness self-adaptive control system based on ambient light sensor
The intelligent display screen brightness adaptive control system solves the problems of asynchronous sampling and inconsistent dimensions in multi-sensor brightness control, achieving smooth brightness adjustment and system stability, and improving the visual experience of the display screen.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- JIANGXI UNITED ELECTRONIC TECH CO LTD
- Filing Date
- 2026-04-10
- Publication Date
- 2026-06-12
AI Technical Summary
Existing multi-sensor brightness control solutions suffer from several problems when faced with uneven lighting conditions, such as localized strong direct sunlight or localized dynamic occlusion. These problems include brightness jumps caused by asynchronous data, system crashes caused by sensor physical saturation, and backlight adjustment step issues caused by fixed filtering parameters. These issues lead to unstable display brightness adjustment and visual discomfort.
An intelligent display brightness adaptive control system based on an ambient light sensor is adopted. The system sets the absolute time axis and sliding time window queue through the initialization module, performs linear extrapolation algorithm and normalization calculation through the data alignment module, generates spatiotemporal cross-correlation matrix through the matrix construction module, classifies events through the state classification module, performs asynchronous parameter adjustment and filtering reconstruction through the hardware reconstruction module, and dynamically adjusts the backlight response through the backlight control module. This solves the problems of asynchronous sampling by multiple sensors and inconsistent dimensions.
It achieves dimensional unification of multi-sensor data, accurately distinguishes between changes in ambient light and local interference, avoids brightness jumps and system crashes, realizes smooth adjustment of display brightness, and improves visual comfort and system stability.
Smart Images

Figure CN122201201A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of display device technology, specifically to an intelligent display screen brightness adaptive control system based on an ambient light sensor. Background Technology
[0002] With the development of smart terminals and large-size display devices, using ambient light sensors to detect surrounding illuminance and adjust the backlight brightness of the display screen accordingly has become a common technique for improving visual experience and reducing device power consumption. To more comprehensively perceive the light field distribution around the device, current display systems typically deploy multiple ambient light sensor nodes at different locations in space. However, in complex lighting scenarios during actual operation, existing multi-sensor brightness control schemes still have significant limitations.
[0003] When faced with uneven lighting conditions such as localized direct strong light or localized dynamic shading, multiple sensor nodes automatically adjust the underlying integration time and analog gain based on the light intensity they receive. This results in the raw data output by different nodes having different hardware sampling frequencies and amplification factors, exhibiting asynchronous characteristics in time and inconsistent dimensions. Most existing data fusion processing methods directly perform arithmetic calculations on the raw signals, making it difficult to handle the waveform step phenomenon caused by this asynchronous data, which can easily lead to misjudgments and abnormal jumps in display brightness.
[0004] Meanwhile, the existing control logic is insufficiently accurate in distinguishing between overall changes in ambient light and local disturbances. When the local ambient light is extremely poor, the analog-to-digital converters at the bottom layer of some sensors will reach their physical output limits and enter a saturation state. At this time, the variance of the data sequence output by the sensor approaches zero. Conventional correlation calculation formulas will encounter a situation where the denominator is zero when processing such data, thus triggering a system division-by-zero anomaly and causing the control program to crash.
[0005] Furthermore, when sensors encounter prolonged partial obstruction or continuous strong light, existing systems lack effective underlying hardware intervention methods, easily falling into prolonged data deadlock and unable to recover normal sensing capabilities on their own. In the final backlight adjustment stage, conventional solutions generally employ filtering algorithms with a fixed time constant. This type of fixed-parameter filter cannot simultaneously meet the requirements for rapid tracking during sudden changes in ambient light and smooth noise reduction during local interference. Especially when the system attempts to isolate abnormal sensors and reallocate calculation weights, the filter cannot effectively smooth out weight abrupt changes, resulting in a noticeable brightness step waveform on the display screen, reducing the comfort of human eye viewing. Summary of the Invention
[0006] To address the shortcomings of existing technologies, this invention provides an intelligent display screen brightness adaptive control system based on an ambient light sensor. This system solves the problems of brightness jumps caused by asynchronous sampling from multiple sensors and inconsistent dimensions, system computational crashes caused by sensor physical saturation under extreme lighting conditions, hardware deadlock under local abnormal operating conditions, and backlight adjustment step changes caused by fixed filter parameters.
[0007] To achieve the above objectives, the first aspect of the present invention provides an intelligent display screen brightness adaptive control system based on an ambient light sensor, comprising: a microcontroller, an ambient light sensor node set, and a display screen control motherboard;
[0008] The microcontroller is internally configured with:
[0009] The initialization module is used to establish the absolute time axis, set the virtual sampling period and sliding time window queue, and initialize the cold start flag.
[0010] The data alignment module is used to read the raw analog-to-digital conversion count value output by the ambient light sensor node, and calculate the normalized physical illuminance scalar by using a linear extrapolation algorithm and combining the integration time parameter and the analog gain parameter.
[0011] The matrix construction module is used to receive the normalized physical illuminance scalar, calculate the first-order discrete-time derivative, and calculate the Pearson correlation coefficient of the output time series of the ambient light sensor node within the sliding time window queue, generating a spatiotemporal cross-correlation matrix.
[0012] The state classification module is used to analyze the spatiotemporal cross-correlation matrix and the first-order discrete-time derivative, classify the changes in the ambient light field into globally consistent events, local transient strong light events, or local dynamic occlusion events, and update the lock state timeout timer based on the classification results.
[0013] The hardware reconfiguration module is used to asynchronously adjust the integral time or analog gain parameters inside the corresponding node based on the event classification results. When the lockout timeout timer reaches the allowed lockout time threshold, it sends a hardware reset command to all ambient light sensor nodes and clears the sliding time window queue.
[0014] The backlight control module is used to allocate dynamic masking calculation weights based on event classification results, adjust the time constant of the low-pass filter, calculate the global equivalent ambient illuminance, map the global equivalent ambient illuminance into a backlight pulse width modulation duty cycle signal, and output it to the display control motherboard.
[0015] As a further preferred technical solution, the ambient light sensor node is internally configured with independent integration time registers and analog gain registers. The microcontroller receives the level transition signal output by the node after completing a single integration cycle via a hardware interrupt control line. The data alignment module employs a linear extrapolation algorithm based on a first-order hold circuit, using the slopes of the two most recent actual physical samplings to calculate the alignment count value. When calculating the normalized physical illuminance scalar, the alignment count value is divided by the inherent photoelectric conversion sensitivity constant of the sensor's underlying hardware, the product of the currently effective integration time parameter and the analog gain parameter.
[0016] The above mechanism reduces the zero-order hold trapezoidal wave step caused by asynchronous sampling, preventing pulse interference in subsequent time derivative calculations. By combining hardware parameters for division restoration, digital signals with different underlying hardware amplification factors are converted into dimensionlessly uniform physical illuminance data, providing a consistent mathematical benchmark for subsequent matrix operations.
[0017] As a further preferred technical solution, the matrix construction module executes a pre-correlation saturation trap determination mechanism when generating the spatiotemporal cross-correlation matrix: when the original analog-to-digital conversion count value of a certain node reaches the physical limit output value of the analog-to-digital converter, the Pearson correlation coefficient between the abnormal node and all other nodes is forcibly assigned to the boundary minimum value. For normal nodes that have not triggered the determination mechanism, a preset minimum constant compensation term is introduced into the denominator of the formula for calculating the Pearson correlation coefficient.
[0018] This operational logic monitors the physical state of the underlying hardware. When the sensor reaches physical saturation, causing the output sequence variance to return to zero, it avoids the risk of division by zero and isolates nodes with abnormal data in the spatial correlation dimension by forcibly assigning a minimum value. A compensation term is introduced to further prevent underflow anomalies in static, extremely dark environments.
[0019] As a further preferred technical solution, the state classification module evaluates the relationship between the minimum Pearson correlation coefficient between nodes and a preset threshold, and determines globally consistent events by combining the product of the first-order discrete-time derivatives; it determines isolated abnormal nodes by extracting the maximum Pearson correlation coefficient of the target node, and further subdivides local transient strong light events or local dynamic occlusion events based on the positive or negative sign of the first-order discrete-time derivative of the node.
[0020] By combining spatial correlation and temporal derivative characteristics, the system can distinguish between changes in overall environmental illuminance and local disturbances, avoiding misjudgments of the state caused by simply relying on data extreme value thresholds.
[0021] As a further preferred technical solution, when a local transient strong light event or a local dynamic occlusion event is determined, the state classification module drives the locked state timeout timer to perform a step-increment operation. The hardware reconfiguration module issues independent register rewrite instructions for local transient strong light events to reduce the analog gain and integration time parameters, and for local dynamic occlusion events to lengthen the integration time.
[0022] Local asynchronous adjustment commands allow abnormal nodes to exit the physical saturation zone or suppress electrical noise in dark areas by increasing the integral time. A lockout timer records the physical dwell time of abnormal conditions, and in conjunction with the timeout-triggered forced reset logic, it releases system deadlocks caused by prolonged obstruction by foreign objects or continuous direct sunlight.
[0023] As a further preferred technical solution, when a local event is determined to be triggered, the backlight control module forcibly assigns the dynamic masking calculation weight corresponding to the abnormal node to zero, and normalizes and redistributes the weights of the remaining normal nodes. During the switching cycle, the time constant of the infinite impulse response low-pass filter is temporarily set to a maximum physical limit value that tends towards infinity. When a global consistency event is determined to be triggered, the time constant is dynamically calculated based on the maximum element among the absolute values of the first-order discrete-time derivatives of all normal nodes at the current moment.
[0024] By shielding the computational weights of abnormal nodes, the interference of local optical noise on the fusion link is reduced; the temporary increase of the time constant eliminates the brightness step waveform generated during the weight redistribution; and the dynamic scaling of the filtering time constant according to the illuminance change rate achieves dynamic adjustment, thereby improving the visual dimming lag caused by the traditional fixed filtering scheme.
[0025] As a further preferred technical solution, the backlight control module uses a pre-fixed one-dimensional discrete data array as a nonlinear mapping lookup table to locate the indexes of two adjacent discrete anchor points, and performs fixed-point first-order linear interpolation to obtain the final duty cycle signal.
[0026] By combining offline calibration data with linear interpolation, the display smoothness is achieved while maintaining low-level operating efficiency, without relying on the floating-point logarithmic operation resources of complex microcontrollers.
[0027] The second aspect of this invention provides a method for adaptive brightness control of an intelligent display screen based on an ambient light sensor. The method utilizes the aforementioned adaptive control system and includes: initializing the absolute time axis and setting underlying parameters; mapping asynchronous data to their source and aligning their dimensions; constructing a spatiotemporal cross-correlation feature matrix; jointly determining the system state based on the type of light field disturbance; asynchronously downgrading or filtering and reconstructing the underlying hardware photosensitive parameters; and a smoothing mapping process for the terminal backlight based on dynamic masking weights and variable time constant low-pass filtering. This method shares the same technical principles as the system provided in the first aspect, and its specific implementation details and technical effects are consistent with the description of the aforementioned control system.
[0028] This invention provides an intelligent display screen brightness adaptive control system based on an ambient light sensor. It has the following beneficial effects:
[0029] 1. This invention uses a linear extrapolation algorithm in the data alignment module to calculate a normalized physical illuminance scalar by combining integration time and analog gain parameters. This can convert the original output signals of multiple sensor nodes with different hardware sampling frequencies and amplification ratios into physical illuminance data with unified dimensions, thereby eliminating the data step phenomenon caused by asynchronous sampling of multiple sensors. This provides a unified calculation benchmark for subsequent state classification operations and reduces the brightness jump that may occur when fusing data from multiple sensors.
[0030] 2. This invention generates a spatiotemporal cross-correlation matrix through a matrix construction module, and combines the first-order discrete-time derivative to classify ambient light changes into global consistency, local transient strong light, or local dynamic occlusion events. In this process, a pre-correlation saturation trap judgment mechanism is introduced, which forces the correlation coefficient to be assigned a boundary minimum value when the sensor reaches physical saturation. This enables accurate differentiation between overall ambient light changes and local interference. Furthermore, when the variance of the underlying hardware data abnormally returns to zero, the risk of division by zero during the correlation formula calculation process is avoided, thus improving the system's operational stability.
[0031] 3. This invention performs asynchronous parameter adjustments on abnormal nodes through a hardware reconstruction module, and uses a timeout reset mechanism to handle prolonged abnormal occlusion or direct strong light. At the same time, the backlight control module dynamically allocates masking weights and adjusts the time constant of the low-pass filter based on the event classification results. This allows the system to automatically adjust the backlight response speed according to the illuminance change rate while isolating local illumination interference, avoiding the brightness step waveform generated by the instantaneous weight redistribution, and achieving smooth adjustment of the display brightness. Attached Figure Description
[0032] Figure 1 This is a system architecture diagram of the present invention;
[0033] Figure 2This is a flowchart of the intelligent display screen brightness adaptive control method based on an ambient light sensor according to the present invention.
[0034] Figure 3 The above diagram shows a comparison of the physical input signal of the ambient light sensor and the output brightness control response of the display screen in an embodiment of the present invention. (a) is a schematic diagram of the input signal sequence of the physical coordinate node of the ambient light sensor, and (b) is a schematic diagram of the comparison of the output brightness control response curve of the display screen.
[0035] Among them, 100 is the microcontroller; 200 is the ambient light sensor node set; 210 is the integration time register; 220 is the analog gain register; 300 is the communication bus; 400 is the hardware interrupt control line; 500 is the display control motherboard; 601 is the initialization module; 602 is the data alignment module; 603 is the matrix construction module; 604 is the state classification module; 605 is the hardware reconstruction module; and 606 is the backlight control module. Detailed Implementation
[0036] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0037] See attached document Figure 1 , Figure 1 This is an architecture diagram of an intelligent display screen brightness adaptive control system based on an ambient light sensor, according to an embodiment of the present invention. The present invention provides an intelligent display screen brightness adaptive control system based on an ambient light sensor, including a microcontroller 100, an ambient light sensor node set 200, and a display screen control motherboard 500.
[0038] Ambient light sensor node set 200 is arranged at the edge of the display screen, including One ambient light sensor node The value is a positive integer greater than or equal to 3. Each ambient light sensor node is located at different spatial physical coordinates at the edge of the display screen. Each ambient light sensor node is internally configured with an independent integration time register 210 and an analog gain register 220.
[0039] The microcontroller 100 establishes a data connection with all ambient light sensor nodes via the communication bus 300. The communication bus 300 uses an integrated circuit communication line or a serial peripheral interface bus. Each ambient light sensor node is equipped with an independent hardware interrupt pin, which is connected to the external interrupt input of the microcontroller 100 via an independent hardware interrupt control line 400. The microcontroller 100 receives the level transition signal output by each ambient light sensor node after completing a single integration cycle via the hardware interrupt control line 400.
[0040] The microcontroller 100 is internally configured with multiple control modules, including an initialization module 601, a data alignment module 602, a matrix construction module 603, a state classification module 604, a hardware reconfiguration module 605, and a backlight control module 606.
[0041] See attached document Figure 2 , Figure 2 This is a flowchart of a method for adaptive brightness control of a smart display screen based on an ambient light sensor, according to an embodiment of the present invention. The present invention provides a method for adaptive brightness control of a smart display screen based on an ambient light sensor, comprising the following steps:
[0042] S10, the initialization module 601 establishes an absolute time axis, sets the virtual sampling period and sliding time window queue, writes the default integration time parameters and analog gain parameters to the ambient light sensor node set 200 through the communication bus 300, and initializes the cold start flag.
[0043] S20, the data alignment module 602 responds to the trigger signal input by the hardware interrupt control line 400, reads the original analog-to-digital conversion count value output by the corresponding ambient light sensor node through the communication bus 300, records the absolute timestamp, and uses a linear extrapolation algorithm to map the asynchronously acquired original analog-to-digital conversion count value to the virtual sampling period, and calculates the normalized physical illuminance scalar by combining the integral time parameter and the analog gain parameter.
[0044] S30, the matrix construction module 603 receives the normalized physical illuminance scalar and calculates the first-order discrete-time derivative. When the original analog-to-digital conversion count value reaches the physical limit output value of the analog-to-digital converter, the corresponding spatial correlation coefficient is assigned as the boundary minimum value. Within the sliding time window, the Pearson correlation coefficient of the output time series of each ambient light sensor node is calculated to generate a spatiotemporal cross-correlation matrix.
[0045] S40, the state classification module 604 analyzes the spatiotemporal cross-correlation matrix and the first-order discrete-time derivative, classifies the changes in the ambient light field into globally consistent events, local transient strong light events, or local dynamic occlusion events, and updates the lock state timeout timer according to the classification results;
[0046] S50, the hardware reconfiguration module 605 sends a register rewrite instruction to a specific ambient light sensor node through the communication bus 300 based on the event classification result, and asynchronously adjusts the parameters of the integral time register 210 or analog gain register 220 inside the corresponding node. When the lockout timeout timer reaches the allowed lockout time threshold, it sends a hardware reset instruction to all ambient light sensor nodes and clears the sliding time window queue.
[0047] S60, the backlight control module 606 allocates the dynamic masking calculation weights of each ambient light sensor node according to the event classification results, adjusts the time constant of the low-pass filter, calculates the global equivalent ambient illuminance, maps the global equivalent ambient illuminance to the backlight pulse width modulation duty cycle signal and outputs it to the display control motherboard 500.
[0048] In one embodiment, after a system power-on reset or an external hardware malfunction reset, the initialization module 601 inside the microcontroller 100 performs the initial setting of the system hardware physical parameters and the establishment of a global time base. The specific working process of the initialization module 601 includes the following steps:
[0049] S101, the initialization module 601 writes default physical parameters to each node in the ambient light sensor node set 200 via the communication bus 300. To establish an initial reference state for stable system operation, each ambient light sensor node contains an independently programmable integration time register 210 and an analog gain register 220. The microcontroller 100, acting as the master device, addresses each ambient light sensor node via the integrated circuit communication line or the serial peripheral interface bus. Default integration time parameters are set. With default analog gain parameters As a preferred method, the default integration time parameter... The specific value range is usually determined based on the middle setting recommended in the sensor hardware manual, such as 50 milliseconds to 100 milliseconds, to balance the physical sensitivity of ambient light sampling with the system response speed; default analog gain parameter. Set a medium gain factor, such as a hardware gain level between 4x and 16x, to avoid overloading the underlying hardware directly due to extremely strong or dark lighting conditions at the initial stage. The microcontroller 100 will use the default integration time parameter. Write the integration time register 210 of each ambient light sensor node, and set the default analog gain parameter. Write to the analog gain register 220 of each ambient light sensor node. For the data frame encapsulation and addressing read / write operations at the bottom layer of the communication bus 300, those skilled in the art can use standard communication protocol specifications for configuration. Its underlying timing control is a well-known technology in the art and will not be described in detail here.
[0050] S102, based on the configuration of the aforementioned underlying hardware registers, the initialization module 601 establishes the absolute time axis within the microcontroller 100 and allocates memory space for the global virtual sampling period and the sliding time window queue. When processing continuous ambient light disturbances, constructing a fixed-length time observation window is fundamental for extracting reliable change characteristics. In this embodiment, the microcontroller 100 configures its internal hardware timer as the driving source, enables an upward counting mode, and constructs a monotonically increasing absolute time axis. The system defines a global virtual sampling period. This serves as a time reference for aligning discrete data. The initialization module 601 allocates contiguous memory space in the random access memory of the microcontroller 100 to construct a sliding time window queue. The sliding time window contains... The total time length of the sliding time window for each discrete sampling point. Configured as follows:
[0051] ;
[0052] In the formula, This represents the total duration of the sliding time window; This represents the total number of discrete data points contained within the sliding time window. It is a positive integer, and its value depends on the low-pass filtering strength and the ability to resist sudden environmental disturbances required by the system. It usually ranges from 10 to 50. The global virtual sampling period is determined based on the display backlight refresh rate, for example, 20 milliseconds. The sliding time window queue, in its underlying data structure, is a circular buffer or a first-in-first-out queue used to store historical illuminance data within the synchronous computation domain. To prevent singularity or division-by-zero errors in subsequent matrix operations due to residual random dirty data in memory, the initialization module 601, after allocating memory space, forces a memory clearing operation on all storage units of the circular buffer.
[0053] S103, to ensure that the sliding time window does not trigger an erroneous state determination when not enough data points have been collected, the initialization module 601 sets a cold start bypass flag based on the time step index, completing the initialization state assignment. Then, the time step index is defined. Set to a positive integer. Time step index. With global virtual sampling period Increment by one unit. Redefine the cold start bypass flag. This is used to indicate whether the sliding time window queue is full of valid data. Finally, the initialization module 601 performs a status check: when the time step index... satisfy When the sliding time window queue is not full, the decision logic outputs the cold start bypass flag. When the time step index satisfy At that time, the sliding time window queue was full. Data from discrete sampling points is used to determine the cold start bypass flag bit of the logic output. The time step index is set upon initial power-on or during a hardware deadlock reset. Zeroing out, initialization module 601 forced write Upon entering the cold start phase, a bypass mechanism is triggered to effectively prevent subsequent matrix calculation data overflow or abnormal fluctuations caused by insufficient historical data from the underlying logic.
[0054] Because the ambient light sensor nodes distributed around the edge of the display screen are affected by the external local light field, the underlying hardware photosensitive parameters of each node are dynamically updated, resulting in the output data not arriving at the microcontroller 100 at the same time. To solve the system integration problem of multi-rate asynchronous sampling, the data alignment module 602 accurately maps the discrete asynchronous physical signals to the synchronous computing domain. The specific working process of the data alignment module 602 includes the following steps:
[0055] S201, the data alignment module 602 performs asynchronous reading of the raw analog-to-digital conversion count value and recording of the absolute timestamp based on the hardware external interrupt mechanism. To accurately capture changes in the physical light field, the hardware pins of each ambient light sensor node undergo a level transition after completing a single photosensitivity integration cycle. The external interrupt input of the microcontroller 100 responds to the trigger signal input on the hardware interrupt control line 400 and then enters the corresponding interrupt service routine. Within the interrupt service routine, the data alignment module 602 reads the specific ambient light sensor node (denoted as node) that triggered this interrupt via the communication bus 300. The raw analog-to-digital converter count value output by the internal register. Simultaneously, the microcontroller 100 reads the current count value of its internal hardware timer and records the absolute timestamp corresponding to this read action. To support subsequent timeline feature derivation, the internal memory of the microcontroller 100 is configured to always maintain the two most recent valid interrupt data pairs for this node, i.e., the data pairs at the current trigger time. and historical data from the last triggering time .
[0056] S202, the data alignment module 602 employs a linear extrapolation algorithm based on a first-order hold to map the asynchronously acquired raw data to a unified virtual sampling period. In conventional ambient light processing logic, a zero-order hold is commonly used to directly reuse the latest valid sampled value. However, in extremely low light conditions, the photosensitivity integration time of the ambient light sensor is significantly prolonged, resulting in an interval between two physical samples that is much larger than the system's virtual sampling period. If the zero-order hold is continued to be used, the sampled data will exhibit a step-like trapezoidal wave on the time axis, leading to false, abrupt pulse artifacts in subsequent time derivative calculations, which can easily cause the system to misjudge sudden environmental changes. To eliminate the derivative pulse artifacts caused by the zero-order hold, this embodiment performs a first-order hold extrapolation. Specifically: at each virtual sampling moment... The data alignment module 602 utilizes nodes The slopes of the two most recent real physical samplings are used to estimate the virtual sampling time. The alignment count value. The specific calculation formula is as follows:
[0057] ;
[0058] In the formula, Representative node In virtual time The aligned modulus conversion count value obtained after first-order hold-through calculation; Represents the current time step index; Represents the global virtual sampling period; This is the current absolute virtual sampling moment; Represents the conditions met on the timeline The absolute timestamp of the most recent hardware interrupt trigger; Representative node In timestamp The absolute timestamp of the last hardware interrupt trigger; Represents timestamp The corresponding original analog-to-digital conversion count value read; Represents timestamp This corresponds to the original analog-to-digital converter count value read. However, in the underlying logic implementation of the microcontroller 100, to prevent abnormal high-frequency interrupts from affecting the denominator... The data alignment module 602 has a verification mechanism in place before performing division, which prevents the data from approaching zero and causing a division-by-zero exception crash. This mechanism is used when determining the time difference. When the data is less than the preset minimum safe resolution threshold of the timer, the data alignment module 602 directly discards the triggered data and maintains the calculation slope of the previous cycle. As a preferred method, the setting of the minimum safe resolution threshold of the timer is determined based on the clock division coefficient of the internal timer of the microcontroller 100 and the communication time of the underlying bus. For example, it can be configured to be 1 millisecond to 5 milliseconds to effectively filter out false continuous interruptions caused by bus electrical noise.
[0059] S203, the data alignment module 602, based on the current hardware operating parameters, calculates a normalized physical illuminance scalar that eliminates the influence of underlying hardware settings. During adaptive control, the integration time register 210 or analog gain register 220 of specific nodes can be asynchronously rewritten according to local occlusion or localized strong light conditions. This means that the integration time and analog gain corresponding to different ambient light sensor nodes at the same moment may be completely different. If uncalibrated count values are directly used for spatial correlation feature extraction, the dimensional differences among multiple nodes will directly undermine the mathematical foundation of matrix operations. Based on the above physical causal relationship, the data alignment module 602 restores it to a unified absolute physical dimension according to the hardware amplification of the corresponding ambient light sensor. The specific normalization calculation formula is as follows:
[0060] ;
[0061] In the formula, Representative node At any moment The normalized absolute physical illuminance scalar; This represents the first-order hold-up calculation result for the corresponding time point at that node; This represents the photoelectric conversion sensitivity constant inherent in the underlying hardware of the sensor, and its specific value is determined based on the factory wafer calibration datasheet of the selected ambient light sensor. Representative node The currently effective integration time parameter; Representative node The currently effective analog gain parameters. To ensure the integrity of the underlying calculations, due to the physical limitations of the sensor's underlying hardware, and The lower limits of register write values are all hard-clamped to a safe baseline value greater than zero (e.g., minimum integration time is limited to 2.7 milliseconds, minimum analog gain is limited to 1x), thus avoiding the risk of the formula denominator approaching zero from the physical layer source. Therefore, through the above mapping transformation, the discrete, asynchronous underlying digital signals output by each ambient light sensor node with different amplification factors are ultimately reconstructed into a smooth physical illuminance data stream that is strictly time-aligned and has absolutely uniform dimensions.
[0062] To extract the spatial physical characteristics of the ambient light field and establish a low-level mathematical anti-collapse mechanism, the matrix construction module 603 receives a normalized physical illuminance scalar and generates a spatiotemporal cross-correlation matrix characterizing the system state. The specific working process of the matrix construction module 603 includes the following steps:
[0063] S301, to determine the dynamic trend of light intensity change under specific spatial coordinates, it is also necessary to evaluate the data increment within two adjacent virtual sampling periods. In this embodiment, the matrix construction module 603 calculates the first-order discrete-time derivative based on the normalized physical illuminance scalar input from the previous stage. Specifically, the matrix construction module 603 obtains the illuminance difference between the current time and the previous time for each ambient light sensor node, and the specific calculation formula is as follows:
[0064] ;
[0065] In the formula, Representative node Step index at current time The first discrete-time derivative corresponding to the virtual moment; The physical number index representing the ambient light sensor node; Represents the current time step index; This represents the normalized physical illuminance scalar of the node at the current moment; This represents the normalized physical illuminance scalar of the node at the previous virtual sampling time. This represents the global virtual sampling period. The sign of the first-order discrete-time derivative directly reflects whether the local ambient light field is undergoing a brightening or darkening process, thus providing a temporal dimension feature for subsequent state classification.
[0066] S302, after extracting the temporal derivative features of a single node, it is necessary to further evaluate the spatial coordination between multiple nodes. However, under extreme conditions of local interference from strong light sources, the analog-to-digital converter (ADC) inside the ambient light sensor node is prone to reaching its physical limit output value. Once the ADC enters physical saturation, its original ADC count value will remain at a fixed hardware maximum constant. For example, for a 16-bit ADC, this physical limit output value is rigidly clamped at 65535. At this time, since the effective data sequence within the sliding time window presents a flat horizontal line, the mathematical variance of the sequence approaches zero. If this zero-variance data is directly substituted into the subsequent Pearson correlation coefficient calculation formula, it will inevitably cause a division-by-zero crash exception in the underlying logic of the microcontroller 100. Based on this underlying physical limitation, this embodiment introduces a pre-correlation saturation trap determination mechanism. The matrix construction module 603 monitors the raw analog-to-digital conversion (ADC) counts of each node. When it determines that the raw ADC count of a node has reached the set physical limit output value, it immediately interrupts the normal statistical operation of that node and forces the Pearson correlation coefficient between the abnormal node and all other nodes to be assigned a boundary minimum. As a preferred method, this boundary minimum is set to -1. The forced assignment operation completely avoids the risk of division by zero caused by saturation from a mathematical perspective. At the same time, by artificially assigning a weight to the minimum value with a completely negative correlation, the abnormal node is isolated in the spatial feature dimension.
[0067] S303, after avoiding extreme hardware saturation conditions, for normal ambient light sensor nodes that have not triggered the pre-correlation saturation trap judgment mechanism, the matrix construction module 603 solves for the mathematical expectation and Pearson correlation coefficient of the output time series within the sliding time window. To quantify the degree of synchronous change in illumination among different spatial nodes within the same time window, the system utilizes a matrix of length... Statistical analysis is performed on the historical data queue. The matrix construction module 603 calculates the expected value of each node sequence; the specific expected value formula is as follows:
[0068] ;
[0069] In the formula, Representative node The expected value within the current sliding time window; This represents the total number of discrete data points contained within the sliding time window; This represents the reverse offset index of historical data points within the sliding time window, and its value ranges from 0 to... Integers; This represents the historical normalized physical illuminance scalar corresponding to the queue. Based on the above expected value, the matrix construction module 603 calculates the different nodes. With nodes The Pearson correlation coefficient between them is calculated using the following formula:
[0070] ;
[0071] In the formula, Representative node With nodes The Pearson correlation coefficient, calculated between them, has a theoretical range of -1 to 1. Representative node The corresponding historical normalized physical illuminance scalar in the queue; Representative node The corresponding historical normalized physical illuminance scalar in the queue; Representative node The mathematical expectation; Representative node The mathematical expectation; This is a minimum constant compensation term pre-defined for the system. In practical engineering implementations, even if the sensor is not fully saturated, an extremely dark static environment can still lead to a very small variance in the sampling sequence. This minimum constant compensation term is introduced. As a preferred method, its value is 10. -6 This can further improve the robustness of algorithm operation and prevent underflow or singularity crashes caused by small floating-point number operations.
[0072] S304, Based on the calculation results of the Pearson correlation coefficient mentioned above, the matrix construction module 603 generates and updates the system dimension in memory as follows: The symmetric spatiotemporal cross-correlation matrix is used to intuitively reflect the collaborative topology of all sensor nodes within a specific time window. In this embodiment, the matrix construction module 603 allocates a specific two-dimensional array region in the random access memory of the microcontroller 100 to store the spatial correlation mapping relationship between nodes. To optimize the processor computational load and memory overhead of the embedded system, since the Pearson correlation coefficient satisfies diagonal symmetry (i.e., ... And the Pearson correlation coefficient of its own node is always at its maximum value (i.e. The matrix construction module 603 only needs to calculate and write the upper or lower triangular elements of the matrix. The remaining diagonal elements are directly filled with 1, and the symmetrical elements are updated through pointer mirroring. For the memory allocation and pointer addressing mechanism of the two-dimensional array inside the microcontroller 100, those skilled in the art can use standard C language data structures to write the code; its underlying memory management is a well-known technology in the field and will not be elaborated here. After the above process, the original analog quantities of the physical light field in the time and space dimensions have been completely reconstructed into a discrete feature matrix that can be directly analyzed by the state machine.
[0073] Based on the spatial physical features and temporal variation trends extracted from the previous stage, the state classification module 604 is responsible for analyzing the classification and determination logic of the type of physical disturbance in the ambient light field, and executing the corresponding system state timeout monitoring mechanism. The specific working process of the state classification module 604 includes the following steps:
[0074] S401, in a multi-sensor collaborative architecture, to accurately distinguish between overall environmental changes and localized abnormal interference, a joint evaluation of spatial coordination and temporal monotonicity is also required. Specifically, to accurately identify overall lighting changes in the environment (e.g., the entire device entering a tunnel or the main indoor lighting being turned on), the state classification module 604 executes the classification logic for globally consistent events. The state classification module 604 traverses the system dimensions as follows: The symmetric spatiotemporal cross-correlation matrix, for the current set of valid nodes. The nodes in the system (including all nodes during system initialization or reset) (In the local isolation defense state, this includes the remaining nodes after removing abnormal nodes). The minimum Pearson correlation coefficient is extracted after removing the diagonal elements. Simultaneously, the state classification module 604 extracts the first-order discrete-time derivative of each ambient light sensor node in the above effective node set. The global consistency event joint determination logic of the state classification module 604 must simultaneously satisfy the following two mathematical conditions, expressed by the formula:
[0075] ;
[0076] ;
[0077] In the formula, Representative node With nodes The Pearson correlation coefficient between them; This represents the minimum value of all currently valid off-diagonal elements in the symmetric spatiotemporal cross-correlation matrix; This represents the system's preset correlation determination threshold; and Represent the step index of any two different valid nodes at the current time. The first discrete-time derivative corresponding to the virtual moment; Represents the global virtual sampling period; and The physical number index representing the ambient light sensor node; The total number of ambient light sensor nodes in the system is represented by a positive integer greater than or equal to 3. As a preferred approach, the correlation determination threshold... The specific value range is set from 0.75 to 0.90. This value is chosen to ensure a high degree of positive coordination in illumination changes across all spatial physical coordinates, while tolerating the inherent discrete quantization noise of the underlying hardware analog-to-digital converter. The physical meaning of the condition that the derivative product is greater than zero is that it strictly requires all nodes to maintain a monotonically consistent trend in illumination change. When the environment is in a perfectly static, unperturbed state, the derivative approaches zero, and this condition is not met, thus avoiding false triggering caused by static background noise. Only when both of the above conditions are met simultaneously does it indicate that all physical nodes not only maintain a consistent trend in time but also exhibit high synchronization in spatial waveform characteristics. Based on this, the system determines that the current ambient light field triggers a global consistency event.
[0078] S402, to eliminate interference from complex local conditions, the state classification module 604 further analyzes the classification logic of local transient strong light events and local dynamic occlusion events to address local light field variations in complex usage scenarios. In practical engineering applications, user finger occlusion or direct external spotlight illumination typically only affects specific physical coordinate areas, causing the output data of nodes in that area to deviate significantly from that of other nodes. Based on this physical phenomenon, the state classification module 604 scans the symmetric spatiotemporal cross-correlation matrix row by row to extract the target node (denoted as node). The maximum Pearson correlation coefficient after removing diagonal elements from the corresponding row. The spatial isolation criteria for local events are as follows:
[0079] ;
[0080] In the formula, Representative node The maximum value of the Pearson correlation coefficient with all other nodes. When this maximum value is less than or equal to zero, it indicates that the node... The illuminance change waveform of the isolated node is negatively correlated or completely uncorrelated with any other node in the system, thus marking its physical state as an isolated variable node. After completing the spatial isolation and locking, the state classification module 604 detects the first-order discrete-time derivative of the isolated variable node. The sign of the variant is used to further distinguish its type. When determining... When this occurs, it indicates an abnormal surge in light intensity in the local area, triggering a local transient intense light event; when this is determined... When this occurs, it indicates an abnormal and sharp decrease in the light intensity of the local area, triggering a local dynamic occlusion event. This multi-dimensional joint judgment logic completely eliminates one-sided misjudgments caused by relying solely on the extreme value of a single node or a single variable threshold, thereby improving the fault tolerance of the underlying logic. When the absolute value of the first-order discrete-time derivative of all normal ambient light sensor nodes is less than the preset static noise floor threshold, the system is determined to be in a steady-state environment with no significant changes in the light field.
[0081] S403, to prevent the system from deadlocking due to the sensor being covered by foreign objects for a long time or being continuously exposed to strong direct light, the state classification module 604 sets an independent lockout timeout timer and executes a reset or incremental update mechanism based on the output of the state machine. A lockout timeout timer variable is defined in the random access memory of the microcontroller 100. When the state classification module 604 determines that the current system is experiencing a local transient strong light event or a local dynamic occlusion event, the system is placed in a local lockout defense state. At this time, the state classification module 604 drives the lockout state timeout timer variable. A step-increment operation is performed within each global virtual sampling period. The specific update logic is as follows: Since the stepping frequency is bound to the global virtual sampling period, this incrementing operation achieves precise integration of the dwell time of local abnormal states at the physical level. Correspondingly, when the state classification module 604 determines that the current system is in a globally consistent event or a steady-state environment with no significant changes in the light field, it indicates that the local physical disturbance has been resolved or covered by the new global environment. Based on this transition, the state classification module 604 immediately locks the state timeout timer variable. Forced reset (i.e.) Therefore, this mechanism continuously tracks the dwell time of abnormal states through a logical closed loop, providing a time measurement benchmark for the forced triggering of subsequent hardware-level refactoring.
[0082] Based on the physical disturbance type and timeout monitoring status output by the state classification module 604, the hardware reconfiguration module 605 is responsible for executing the logic of reverse control of the underlying hardware registers to dynamically match the ambient light field and break extreme deadlock conditions. The specific working process of the hardware reconfiguration module 605 includes the following steps:
[0083] S501, to ensure the system maintains optimal signal-to-noise ratio and dynamic range when facing changes in overall lighting environment, the system needs to coordinately intervene in the underlying hardware. Based on the global consistency results determined by the previous stage, under a global consistency event, the hardware reconfiguration module 605 synchronously adjusts the integration time parameters and analog gain parameters of all ambient light sensor nodes. Specifically, the hardware reconfiguration module 605 extracts the normalized physical illuminance scalar mean of the current global ambient light sensor nodes and compares it with the center value of the optimal linear operating interval of the analog-to-digital converter preset by the system. Based on the deviation ratio between the two, the hardware reconfiguration module 605 generates a global adjustment scaling factor. As a preferred approach, to maximize the suppression of underlying thermal noise, the system is configured with multi-dimensional parameter weighting logic: the global adjustment scaling factor is preferentially applied to the rewriting of the integration time parameter; only when the integration time parameter reaches the underlying hardware physical limit threshold is the remaining coefficient compensation amount converted into the adjustment command of the analog gain parameter. The microcontroller 100, acting as the master device, uses the broadcast mechanism or circular addressing mechanism of the communication bus 300 to synchronously write the calculated target parameters into the registers corresponding to each ambient light sensor node. For the specific addressing, reading, writing, and synchronous broadcast command issuance of the underlying registers, those skilled in the art can configure them using standard bus communication protocols. The underlying electrical timing control is well-known in the field and will not be elaborated upon here.
[0084] S502. In extreme interference scenarios where a localized area is directly exposed to a strong light source, forcibly lowering the photosensitivity parameters of all nodes would cause nodes in normal areas to lose detail in dark areas due to excessive attenuation. To resolve this physical contradiction, the hardware reconstruction module 605 executes an asynchronous degradation reconstruction mechanism for localized transient strong light events. In this scenario, the hardware reconstruction module 605 only refactors the nodes marked as isolated anomalies by the preceding state machine (denoted as the target node). The system issues an independent register rewrite instruction to reduce its analog gain and integration time parameters. The specific downgrade and reconstruction formula is as follows:
[0085] ;
[0086] In the formula, Represents the target node The newly written integration time parameters after downgrading and reconstruction; This parameter represents the historical integration time that is currently in effect for this node. This represents the system's preset degradation attenuation coefficient; This represents the minimum safe integration time allowed by the sensor hardware. This is a clamping function to maximize the value. As a preferred approach, the degradation attenuation coefficient... Set between 0.5 and 0.7 to ensure the parameter falls back exponentially; minimum integration time safety baseline value. Typically, this is limited by the underlying hardware firmware. Through independent downscaling commands, this asynchronous degradation and reconstruction, combined with the aforementioned pre-correlation saturation trap mechanism, allows anomalous nodes to quickly escape the physical saturation zone of the analog-to-digital converter and regain their dynamic capture capability of strong light changes. After the local anomalous node completes asynchronous degradation at the physical layer, its updated hardware parameter values are immediately synchronized to the preceding data alignment module 602, thereby ensuring the dimensional consistency of the normalized physical illuminance scalar in the subsequent computational domain.
[0087] S503: When a local area is obscured by a foreign object, that area enters an extremely dark state, and the underlying thermal noise and shot noise are significantly amplified. Based on the physical principle that increasing the photosensitive integration time is equivalent to reducing the hardware sampling bandwidth, the hardware reconstruction module 605 executes an asynchronous filtering reconstruction mechanism for local dynamic occlusion events. The hardware reconstruction module 605 only issues independent register rewrite instructions to abnormal nodes to lengthen the integration time. The specific filtering reconstruction formula is as follows:
[0088] ;
[0089] In the formula, Represents the target node The newly written integral time parameter after filtering and reconstruction; This represents the system's preset upshift amplification factor; This represents the maximum integration time limit allowed by the sensor hardware. This is a clamping function to minimize the value. As a preferred method, the upsizing factor... The maximum integration time limit is typically set between 1.5 and 2.0. The value is determined based on the minimum refresh rate requirement of the display system's backlight adjustment to avoid visual dimming lag. Lengthening the integration time creates a natural physical low-pass filter, thereby suppressing high-frequency electrical noise in local dark areas.
[0090] S504, during prolonged device interaction, localized, persistent shading or strong light often transforms into a new normal environment. If the system remains in an isolated defense state, it will lose its ability to perceive subsequent changes in illumination in that area. To break this deadlock, the hardware reconfiguration module 605 executes a forced probe reset mechanism. The hardware reconfiguration module 605 continuously monitors the locked state timeout timer variable. When judged At that time, a reset operation is triggered. This represents the system's preset allowed locking time threshold. As a preferred method, the allowed locking time threshold... The corresponding actual physical time is typically set to 3 to 5 seconds. This duration effectively filters out high-frequency transient disturbances such as brief hand gestures or shadows passing by, while ensuring responsiveness during long-term operational transitions. Once this mechanism is triggered, the hardware reconfiguration module 605 forcibly issues a hardware reset command to all nodes, restoring the default physical parameters and forcibly clearing the sliding time window queue in the microcontroller 100's memory to completely remove failed historical state mappings. This mechanism breaks the system's physical deadlock caused by continuous strong light or continuous occlusion from the bottom layer, prompting the entire system to establish a new steady-state observation benchmark based on the latest light field.
[0091] The backlight control module 606 is responsible for the smooth mapping mechanism between the masking logic of the system output terminal and the backlight drive signal. The specific working process of the backlight control module 606 includes the following steps:
[0092] S601, when the device is first powered on or wakes up from deep sleep, the underlying processor has not yet accumulated enough historical data within its sliding time window to support the matrix operation of the Pearson correlation coefficient. To avoid a visual blackout period on the display screen due to waiting for the data queue to fill up, the backlight control module 606 executes the control logic of the cold start bypass stage. In this stage, the system temporarily bypasses the abnormal masking logic of the previous state machine and forces all ambient light sensor nodes to be configured to evenly distribute the calculation weights. Specifically, when the backlight control module 606 detects that the historical data queue filling degree inside the microcontroller 100 is less than the preset sliding window length... At this point, it is determined that the system is in the cold start phase, and this applies to any node. Its initial masking calculation weights are forcibly set to ,in This represents the total number of nodes in the system. Based on this average calculation weight and the currently read initial normalized physical illuminance scalar, the system quickly calculates and outputs the initial backlight signal. This bypass mechanism ensures the availability of the display terminal within a very short startup time from a physical causal perspective, thereby filling the control blind spot during the matrix initialization phase. Once the data queue is filled, it automatically exits the cold start bypass and enters the normal filtering cycle.
[0093] S602, as the system enters normal operation, to isolate the interference of local physical anomalies on the overall display, the backlight control module 606 activates the spatial masking weight allocation and dynamic low-pass filtering mechanism. When the state classification module 604 determines that the system is in a local transient strong light event or a local dynamic occlusion event, the output data of the nodes locked as abnormal no longer accurately reflects the overall ambient light field. Based on the above causal relationship, the backlight control module 606 forcibly assigns the spatial calculation weight corresponding to the abnormal node to zero and normalizes and redistributes the weights of the remaining normal nodes. In the specific calculation, the backlight control module 606 sets the effective node set... The remaining normal nodes in the array are weighted equally, i.e., the allocation formula is: ,in This represents the real-time number of currently normal nodes. Through this isolation algorithm, optical noise in abnormal areas is completely removed from the fusion link. To prevent brightness jumps caused by node removal or state switching, the backlight control module 606 performs transient isolation adjustment on the time constant of the infinite impulse response low-pass filter. During this weight redistribution switching cycle (e.g., 1 to 2 global virtual sampling cycles), the backlight control module 606 temporarily sets this time constant to a maximum physical limit value approaching infinity. To adapt to the underlying digital logic of the embedded microprocessor, this approaching-infinity physical limit quantization is equivalent to directly forcing the discrete filter coefficients to zero, thereby ensuring that the display panel maintains the smooth backlight output of the moment before the anomaly occurred when an abnormal node was removed. After this brief switching cycle, the backlight control module 606 immediately resumes the normal dynamic low-pass filter logic, using the remaining normal nodes after weight redistribution to continue calculating and updating the global equivalent ambient illuminance. This mechanism not only blocks the output step caused by weight mutation at the mathematical level, but also fully releases the physical advantages of the multi-sensor redundancy architecture, so that when the device encounters continuous occlusion or strong light interference in a local area, it can still rely on the remaining normal sensor nodes to smoothly and accurately follow the changes in the real environment light field.
[0094] S603, when the state classification module determines that a global consistency event has been triggered, it indicates that the local physical disturbance has been resolved, and all ambient light sensor nodes are immediately reinstated into the set of valid nodes. In the process, the masking calculation weights of all nodes are restored to an evenly distributed state (i.e., In normal usage scenarios, when the state classification module 604 determines that a global consistency event has been triggered, it indicates that the ambient light field surrounding the entire device has undergone a significant and consistent change. To ensure that the display brightness follows the ambient light field dynamically, the backlight control module 606 dynamically calculates the time constant of the infinite impulse response low-pass filter based on the first-order discrete-time derivative vector. The backlight control module 606 extracts the maximum element among the absolute values of the first-order discrete-time derivatives of all normal nodes at the current moment and maps the time constant accordingly. The specific formula for calculating the dynamic time constant is as follows:
[0095] ;
[0096] In the formula, Represents the current time step index The dynamic time constant is calculated corresponding to the virtual sampling time. This represents the preset base smoothing time constant; This represents the dynamic response adjustment coefficient, used to control the sensitivity of the derivative extrema to the scaling of the time constant; This represents the set of valid, normal ambient light sensor nodes that are not currently masked by the preceding logic. The physical number index representing the valid node; It represents the absolute value of the first-order discrete-time derivative of the effective node; To maximize the function. As a preferred approach, the base smoothing time constant. The determination is based on the comfortable transition time of human vision to changes in brightness, which is usually set to 1.5 to 2.5 seconds; dynamic response adjustment coefficient The value of is set to be between 10 and 50, and its magnitude determines the system's ability to absorb transient high-frequency disturbances. The physical purpose of this formula is that the more drastic the change in the external light field (i.e., the larger the absolute value of the derivative), the higher the value of the denominator, and the smaller the calculated dynamic time constant, thereby giving the backlight adjustment a higher physical following bandwidth and eliminating the visual brightness lag.
[0097] S604, after completing the dynamic parameter configuration, the backlight control module 606 combines the dynamic masking calculation weights with the normalized physical illuminance scalar of each node to solve for the global equivalent ambient illuminance at the current moment. The specific equivalent illuminance and smoothing filter formulas are as follows:
[0098] ;
[0099] ;
[0100] ;
[0101] In the formula, Represents the global equivalent ambient illuminance at the current moment in the fusion calculation; Representative node The dynamic masking calculation weights are obtained after spatial masking redistribution, and the sum of the weights of all valid nodes is subject to the identity constraint of 1. Representative node The normalized physical illuminance scalar; This represents the smoothed ambient illuminance after an infinite impulse response low-pass filter. Represents the smoothed historical value of ambient illuminance at the previous virtual sampling time; Represents dynamic time constant With global virtual sampling period The resulting discrete filter coefficients. When performing this conversion mechanism, the denominator of the underlying filter coefficient formula is forced to include a non-zero global virtual sampling period. This completely avoids the problem of dynamic time constant in mathematical form. The potential for division-by-zero singularity crashes when the light approaches zero ensures the absolute safety of the embedded system's operation. After extracting a stable and reliable smoothed ambient illuminance, the backlight control module 606 uses a built-in nonlinear mapping lookup table mechanism to smooth the ambient illuminance... This is mapped to a specific backlight pulse width modulation duty cycle signal. The use of a nonlinear lookup table instead of linear direct scaling is based on the logarithmic response characteristic of the human eye's perception of light intensity, which follows the Weber-Fechner law. For the specific process of outputting the backlight pulse width modulation duty cycle internally by interpolating through a lookup table within the microcontroller 100, those skilled in the art can configure it using a standard logarithmic mapping curve. Its underlying pulse width modulation driving mechanism is a well-known technology in the field and will not be elaborated upon here.
[0102] In one embodiment, to avoid the microcontroller 100 frequently executing computationally expensive floating-point logarithmic algorithms during operation, the nonlinear mapping lookup table built into the backlight control module 606 is implemented using a one-dimensional discrete data array pre-installed in non-volatile memory (e.g., flash memory). The data creation and execution calling process for this lookup table specifically includes two stages: offline calibration and online addressing interpolation.
[0103] During the offline calibration phase, researchers can pre-define the physical boundaries of the lookup table's input and output. The system extracts the effective range of ambient illuminance as the input domain and the pulse-width modulation duty cycle range supported by the display panel driver chip as the output domain. Based on the human eye's sensitivity to low-illuminance changes and insensitivity to high-illuminance changes, and combined with the inherent photoelectric conversion gamma curve of the display panel, a nonlinear mapping reference curve is constructed. Based on this reference curve, the continuous input domain is divided into multiple discrete illuminance anchor points at equal or non-equal intervals, and the target duty cycle value corresponding to each anchor point is calculated sequentially. Boundary constraints are introduced when generating these discrete values, strictly limiting the duty cycle values between the minimum illumination threshold and the maximum output extreme value to prevent drive overshooting during subsequent operation. As a preferred approach, the total number of discrete anchor points is typically set to 256 or 1024, aiming to balance the subtlety of visual dimming with the memory footprint of the microcontroller's 100 read-only memory. After data generation, this one-dimensional discrete data array is burned into the underlying hardware for runtime use.
[0104] During the addressing phase of actual device operation, the backlight control module 606 obtains the current filtered and smoothed global equivalent ambient illuminance and prioritizes the execution of out-of-bounds judgment logic. If the equivalent ambient illuminance exceeds the preset maximum input boundary of the lookup table, it directly outputs the maximum duty cycle to block illegal pointer offsets that may cause memory access exceptions. When the illuminance is within the legal range, the underlying addressing instructions can be used to quickly locate the two adjacent discrete anchor indexes in the data array where the ambient illuminance falls.
[0105] Since the fixed memory capacity inevitably limits the resolution of the discrete table, even minor disturbances in ambient light that happen to cross adjacent storage nodes can easily cause abrupt flickering of screen brightness. To eliminate this physical jump, the backlight control module 606, after extracting the fixed duty cycle data corresponding to the two adjacent indices, further performs a fixed-point first-order linear interpolation operation within the microcontroller 100. Specifically, the system uses the physical offset ratio of the current actual illuminance value relative to the illuminance values of adjacent anchor points to perform a weighted calculation on the two extracted discrete duty cycles, thus obtaining the final real-time pulse width modulation duty cycle signal. Therefore, through this interpolation mechanism, with minimal multiplication and addition overhead, continuous and smooth dimming output can be achieved on the physical basis of a low-resolution discrete data table, thereby balancing the operating efficiency of the underlying hardware and the visual smoothness of the terminal display.
[0106] In one specific embodiment, the intelligent display brightness adaptive control system based on an ambient light sensor of the present invention is applied to a 15.6-inch in-vehicle central control display screen. Due to the extremely complex lighting environment inside the vehicle (such as dappled shadows from tree-lined roads, entering and exiting tunnels, obstruction by the front passenger's hand, direct sunlight from side windows, etc.), traditional solutions are prone to abnormal fluctuations in screen brightness.
[0107] Hardware physical layout: System selection An ambient light sensor node is positioned at four physical coordinate angles on the edge of the central control screen: upper left (S1), upper right (S2), lower left (S3), and lower right (S4). Global virtual sampling period. Set to 20 milliseconds, sliding time window length Set to 25 (i.e., a historical data observation window of 0.5 seconds).
[0108] Local dynamic occlusion event (passenger's hand operation occlusion): When the passenger in the front seat reaches out to operate the screen, their hand occludes the lower right corner sensor S4. The physical illuminance scalar corresponding to S4 drops sharply, and its first discrete-time derivative D4 < 0.
[0109] State classification: Matrix construction module 603 calculates the Pearson correlation coefficient R between S4 and S1, S2, and S3. 4,1 ,R 4,2 ,R 4,3 All values are less than or equal to 0. The state classification module 604 determines that a local dynamic occlusion event has been triggered.
[0110] Hardware Reconstruction: The hardware reconstruction module 605 sends an asynchronous filter reconstruction command to S4, extending its integration time to 1.5 times the original time to suppress dark noise.
[0111] Backlight control: The backlight control module 606 forcibly sets the masking calculation weight of S4 to 0, that is... The remaining normal nodes S1, S2, and S3 are weighted equally (each accounting for 1 / 3). At the instant of this weight switching, the time constant of the infinite impulse response low-pass filter is temporarily set to infinity (i.e., the discrete filter coefficients). The screen brightness is maintained smoothly, filtering out the screen dimming caused by hand obstruction.
[0112] Global Consistency Event (Vehicle Entering Tunnel): The vehicle enters the tunnel at a speed of 60 km / h, and the overall light inside the vehicle dims instantly. The illuminance scalars of the four sensors S1-S4 decrease synchronously.
[0113] State classification: minimum correlation coefficient Furthermore, the product of the time derivatives of all sensors is greater than 0 and is also negative. The system determines that a global consistency event has been triggered.
[0114] Backlight control: The system restores the equal weighting of all sensors (each accounting for 1 / 4). Due to sudden changes in ambient light (extremely large absolute value of the derivative), the system dynamically and significantly reduces the time constant of the low-pass filter according to the formula. The screen backlight not only did not lag, but also dimmed in response to the environment at an extremely fast speed, preventing the driver from experiencing glare due to an overly bright screen.
[0115] Experimental verification and effect comparison:
[0116] To verify the effectiveness of the present invention, a 10-second segment of real illumination change data under complex vehicle conditions was extracted, and the existing traditional average value plus fixed filtering scheme was introduced as a control group for comparative testing.
[0117] Test condition settings:
[0118] 0-2 seconds: Steady-state normal ambient light (illuminance approximately 1000 Lux).
[0119] 2-3.5 seconds (local strong light interference): Sunlight shines through the gaps in the leaves, creating dappled light and shadow, and only shines directly on the S1 sensor.
[0120] 5-7 seconds (Global Consistency Abrupt Change): The vehicle enters the tunnel, and the global ambient light drops instantly from 1000 Lux to 50 Lux.
[0121] 8-9.5 seconds (partial obstruction interference): The driver's hands are operating the screen, obstructing the S3 sensor.
[0122] Comparison metrics:
[0123] Traditional approach (dashed line): Directly calculate the arithmetic mean of the four sensors and use a low-pass filter with a fixed time constant (2.0 seconds) to map the PWM duty cycle.
[0124] The present invention (solid line) uses a spatiotemporal cross-correlation matrix to mask abnormal nodes and dynamically and adaptively adjusts the filtering time constant.
[0125] Test results are as follows Figure 3 As shown, and according to Figure 3 It is known that during the 2-3.5 seconds of localized strong light and the 8-9.5 seconds of localized occlusion, the traditional solution's backlight output produced approximately 15%-20% of incorrect brightness fluctuations (i.e., visual flicker). In contrast, the solution of this invention precisely cuts off the weight of abnormal nodes, maintaining the backlight duty cycle in a smooth and steady state, reducing the false trigger rate by 100%. Furthermore, when entering the tunnel at 5 seconds, the traditional solution, affected by a fixed long-term low-pass filter, requires up to 2.5 seconds to dim the screen to the target brightness. The solution of this invention dynamically compresses the time constant through derivative extrema, smoothly and quickly reaching the target duty cycle in only 0.8 seconds, improving the response speed by approximately 68%.
[0126] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A smart display screen brightness adaptive control system based on an ambient light sensor, characterized in that, include: Microcontroller, ambient light sensor node set, and display control motherboard; The microcontroller is internally configured with: The initialization module is used to establish the absolute timeline, set the sliding time window queue, and initialize the cold start flag. The data alignment module is used to read the raw analog-to-digital conversion count value output by the ambient light sensor node, and calculate the normalized physical illuminance scalar by using a linear extrapolation algorithm and combining the integration time parameter and the analog gain parameter. The matrix construction module is used to receive the normalized physical illuminance scalar, calculate the first-order discrete-time derivative, and calculate the Pearson correlation coefficient of the output time series of the ambient light sensor node within the sliding time window queue, thereby generating a spatiotemporal cross-correlation matrix. The state classification module is used to analyze the spatiotemporal cross-correlation matrix and the first-order discrete-time derivative, classify the changes in the ambient light field into globally consistent events, local transient strong light events, or local dynamic occlusion events, and update the lock state timeout timer according to the classification results. The hardware reconfiguration module is used to asynchronously adjust the integral time or analog gain parameters inside the corresponding node according to the event classification results. When the lock state timeout timer reaches the allowed lock time threshold, it sends a hardware reset command to all ambient light sensor nodes and clears the sliding time window queue. The backlight control module is used to allocate dynamic masking calculation weights according to the event classification results, adjust the time constant of the low-pass filter, calculate the global equivalent ambient illuminance, map the global equivalent ambient illuminance into a backlight pulse width modulation duty cycle signal and output it to the display control motherboard.
2. The control system according to claim 1, characterized in that, The ambient light sensor node set includes an ambient light sensor node, and the ambient light sensor node is internally configured with an independent integration time register and an analog gain register. The microcontroller establishes a data connection with all the ambient light sensor nodes through a communication bus; the microcontroller receives the level transition signal output by each ambient light sensor node after completing a single integration cycle through a hardware interrupt control line. The linear extrapolation algorithm used in the data alignment module is a linear extrapolation algorithm based on a first-order hold, which uses the slope of the two most recent real physical samplings to calculate the alignment count value. When calculating the normalized physical illuminance scalar, the alignment count value is divided by the product of the inherent photoelectric conversion sensitivity constant of the sensor's underlying hardware, the currently effective integration time parameter, and the analog gain parameter.
3. The control system according to claim 1, characterized in that, When generating the spatiotemporal cross-correlation matrix, the matrix construction module executes a pre-correlation saturation trap determination mechanism: when it is determined that the original analog-to-digital conversion count value of a certain node reaches the physical limit output value of the analog-to-digital converter, the Pearson correlation coefficient between the abnormal node and all other nodes is forcibly assigned to the boundary minimum value.
4. The control system according to claim 3, characterized in that, For normal nodes that have not triggered the pre-correlation saturation trap determination mechanism, the matrix construction module solves the mathematical expectation of the output time series in the sliding time window queue, and introduces a preset minimal constant compensation term in the denominator of the formula for calculating the Pearson correlation coefficient.
5. The control system according to claim 1, characterized in that, The state classification module traverses the spatiotemporal cross-correlation matrix. When the minimum Pearson correlation coefficient between any two nodes in the current set of valid nodes after removing their own diagonal elements is greater than the system's preset correlation judgment threshold, and the product of the first-order discrete-time derivatives of any two different ambient light sensor nodes in the set of valid nodes is greater than zero, the global consistency event is determined to be triggered.
6. The control system according to claim 1, characterized in that, The state classification module scans the spatiotemporal cross-correlation matrix row by row, extracts the maximum Pearson correlation coefficient after removing the diagonal elements in the row corresponding to the target node, and marks the physical state of the target node as an isolated mutated node when the maximum Pearson correlation coefficient is less than or equal to zero. When the first-order discrete-time derivative of the isolated variable node is determined to be greater than zero, the local transient strong light event is triggered; when the first-order discrete-time derivative of the isolated variable node is determined to be less than zero, the local dynamic occlusion event is triggered.
7. The control system according to claim 1, characterized in that, When a local transient strong light event or a local dynamic occlusion event is determined, the state classification module drives the locked state timeout timer to perform a step-increment operation in each virtual sampling period; when a global consistency event or a steady-state environment with no obvious light field changes is determined, the locked state timeout timer is forcibly cleared to zero.
8. The control system according to claim 1, characterized in that, The hardware reconstruction module performs an asynchronous degradation reconstruction mechanism for the local transient strong light event, issuing independent register rewriting instructions to isolated abnormal nodes to reduce the analog gain and integration time parameters; and performs an asynchronous filtering reconstruction mechanism for the local dynamic occlusion event, issuing independent register rewriting instructions to abnormal nodes to lengthen the integration time.
9. The control system according to claim 1, characterized in that, When the local transient strong light event or local dynamic occlusion event is triggered, the backlight control module forces the dynamic masking calculation weight corresponding to the abnormal node to be set to zero, and normalizes and redistributes the weights of the remaining normal nodes. During the switching cycle, the time constant of the infinite impulse response low-pass filter is temporarily set to a maximum physical limit value that tends to infinity. When a global consistency event is triggered, the backlight control module restores the equal distribution state of all ambient light sensor nodes and dynamically calculates the time constant of the infinite impulse response low-pass filter based on the largest element among the absolute values of the first-order discrete-time derivatives of all normal nodes at the current moment.
10. The control system according to claim 1, characterized in that, The backlight control module has a built-in nonlinear mapping lookup table, which is implemented using a one-dimensional discrete data array pre-installed in non-volatile memory. The backlight control module locates the indices of two adjacent discrete anchor points in the one-dimensional discrete data array where the global equivalent ambient illuminance falls, and performs a fixed-point first-order linear interpolation operation using the physical offset ratio of the current actual illuminance value relative to the illuminance values of the adjacent anchor points to obtain the backlight pulse width modulation duty cycle signal.