Anti-flickering sensor function test method, circuit and electronic device

By adding illumination amplitude detection and combining it with illumination frequency detection in the anti-flicker sensor test, the problem of misjudgment in sensor function testing was solved, ensuring the normal functioning of the sensor and improving the shooting quality of electronic devices.

CN120742611BActive Publication Date: 2026-05-01HONOR DEVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HONOR DEVICE CO LTD
Filing Date
2024-06-17
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Existing anti-flicker sensors cannot effectively identify abnormal or missing contact spring connections during testing, leading to misjudgments in functional test results and affecting the shooting quality of electronic devices.

Method used

By adding illumination amplitude detection and combining it with illumination frequency detection, the normal functioning of the anti-flicker sensor is determined. The sensor is considered to be functioning normally only when both the illumination frequency and amplitude are within the threshold range.

Benefits of technology

Effectively intercepting abnormal or disconnected anti-flicker sensors improves the shooting quality and performance of electronic devices, and avoids missed interceptions during functional testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120742611B_ABST
    Figure CN120742611B_ABST
Patent Text Reader

Abstract

The application discloses a kind of anti-flicker sensor function test method, circuit and electronic equipment, it is related to functional test technical field, the function test method of the anti-flicker sensor includes: control anti-flicker sensor obtains illumination intensity.According to illumination intensity, obtain illumination frequency and illumination amplitude.When illumination frequency meets illumination frequency threshold range, and illumination amplitude meets illumination amplitude threshold range, then determine that anti-flicker sensor can correctly detect illumination frequency.Based on the scheme of the application, on the basis of illumination frequency detection, increase illumination amplitude detection, when illumination frequency detection and illumination amplitude detection are normal, only then determine that the function of anti-flicker sensor is normal, connection is correct, to effectively intercept abnormal anti-flicker sensor, avoid bullet abnormal or not connected anti-flicker sensor is missed interception, to further improve mobile phone quality.
Need to check novelty before this filing date? Find Prior Art

Description

Functional testing methods, circuits, and electronic equipment for anti-flicker sensors Technical Field

[0001] This application relates to the field of functional testing technology, specifically to a functional testing method, circuit, and electronic device for an anti-flicker sensor. Background Technology

[0002] With the continuous advancement and development of electronic devices, smartphones, tablets, and other electronic devices have acquired increasingly more functions and have become an indispensable part of people's lives and work. Taking smartphones as an example, more and more smartphones support camera functions. During the shooting process of a smartphone, a flicker sensor is generally used to detect the flicker frequency of the light source in order to adjust the exposure time during the shooting process, thereby reducing or eliminating possible stripes or flickering phenomena during shooting and improving image quality.

[0003] The anti-flicker sensor connects to the smartphone's motherboard via a spring contact. Testing software typically determines the sensor's functionality by checking its ability to correctly detect light frequency. However, tests have revealed that the anti-flicker sensor can still correctly detect light frequency even when the spring contact is malfunctioning or disconnected. This causes the testing software to miss detecting faulty anti-flicker sensors, thus affecting the phone's quality.

[0004] Therefore, a new solution is urgently needed to address the aforementioned problems. Summary of the Invention

[0005] This application provides a functional testing method, circuit, and electronic device for an anti-flicker sensor. In addition to light frequency detection, light amplitude detection is added. Only when both light frequency detection and light amplitude detection are normal is the anti-flicker sensor considered to be functioning normally and connected correctly. This effectively intercepts anti-flicker sensors that malfunction, preventing faulty or disconnected anti-flicker sensors from being missed, thereby improving the quality of the mobile phone.

[0006] To achieve the above objectives, this application adopts the following technical solution:

[0007] Firstly, a functional testing method for an anti-flicker sensor is provided, comprising: controlling the anti-flicker sensor to acquire light intensity; obtaining light frequency and light amplitude based on the light intensity; and determining that the anti-flicker sensor can correctly detect the light frequency when both the light frequency and light amplitude meet a light amplitude threshold range.

[0008] In this embodiment, the anti-flicker sensor is first controlled to acquire light intensity. Then, the light frequency and light amplitude are obtained based on the light intensity. The light frequency is compared with a light frequency threshold range. If the light frequency meets the threshold range, the frequency detection of the anti-flicker sensor is determined to be normal. Otherwise, the frequency detection is determined to be abnormal. The light amplitude is compared with a light amplitude threshold range. If the light amplitude meets the threshold range, the amplitude detection of the anti-flicker sensor is determined to be normal. Otherwise, the amplitude detection is determined to be abnormal. Finally, when both the frequency and amplitude of the anti-flicker sensor are detected normally, the anti-flicker sensor is deemed to be functioning normally, thus effectively blocking anti-flicker sensors with malfunctioning or abnormal connections.

[0009] In conjunction with the first aspect, in certain implementations of the first aspect, obtaining the illumination frequency and illumination amplitude based on the illumination intensity includes: performing analog-to-digital conversion on the illumination intensity to obtain a digital illumination intensity signal; and performing a Fourier transform on the digital illumination intensity signal to obtain the illumination frequency.

[0010] In this implementation, the specific steps for obtaining the light frequency based on the light intensity are as follows: First, the analog signal of the light intensity is converted from analog to digital to obtain a digital signal of the light intensity. Then, the digital signal of the light intensity is subjected to Fourier transform to obtain the light frequency, so as to compare it with the light frequency threshold range and determine whether the anti-flicker sensor is functioning properly.

[0011] In conjunction with the first aspect, some implementations of the first aspect further include: dividing the illumination frequency to obtain multiple sub-interval frequencies; comparing each of the multiple sub-interval frequencies with an illumination frequency threshold range; and integrating the parallel detection results of the multiple sub-interval frequencies to determine whether the illumination frequency meets the illumination frequency threshold range.

[0012] In this implementation, the specific steps for comparing the illumination frequency with the illumination frequency threshold range are as follows: First, the illumination frequency is divided into multiple sub-interval frequencies. Then, each sub-interval frequency is compared with the illumination frequency threshold range. Finally, the parallel detection results of the multiple sub-interval frequencies are integrated to determine whether the illumination frequency meets the illumination frequency threshold range. Compared to the traditional method of sequential detection across the entire frequency band, the method of dividing the entire frequency band into multiple sub-interval frequencies in this application can reduce detection time and detection power consumption.

[0013] For example, the segmentation method of illumination frequency may include random segmentation, sequential segmentation, equidistant sampling segmentation, and fixed-point segmentation.

[0014] In conjunction with the first aspect, in certain implementations of the first aspect, obtaining the illumination frequency and illumination amplitude based on the illumination intensity includes: performing analog-to-digital conversion on the illumination intensity to obtain a digital illumination intensity signal; performing a Fourier transform on the time domain of the digital illumination intensity signal to obtain a complex array; and calculating the illumination amplitude by calculating the modulus of the complex array.

[0015] In this implementation, the specific steps for obtaining the illumination amplitude based on the illumination intensity are as follows: First, the illumination intensity is converted from analog to digital to obtain a digital illumination intensity signal. Then, the digital illumination intensity signal is subjected to a Fourier transform in the time domain to obtain a complex array. Finally, the modulus of the complex array is calculated to obtain the illumination amplitude, so as to compare it with the illumination amplitude threshold range and determine whether the anti-flicker sensor is functioning properly.

[0016] In conjunction with the first aspect, in some implementations of the first aspect, before performing a Fourier transform on the time domain of the light intensity digital signal to obtain a complex array, the method further includes: performing fixed-point conversion processing on the time domain of the light intensity digital signal. Fixed-point conversion processing refers to defining the decimal point position in the time domain of the light intensity digital signal.

[0017] In this implementation, before performing a Fourier transform on the time domain of the light intensity digital signal to obtain a complex array, the time domain of the light intensity digital signal can be first processed by floating-point to fixed-point conversion, thereby defining the decimal point position of the time domain of the light intensity digital signal and improving the accuracy of quantization analysis.

[0018] Optionally, the fixed-point width of the fixed-point processing is 32 bits.

[0019] In this implementation, to ensure the accuracy of fixed-point processing, the fixed-point bit width can be set to 32 bits.

[0020] Secondly, an anti-flicker sensing circuit is provided, including a photodiode and a first resistor. The negative terminal of the photodiode is connected to a reverse power supply, the positive terminal of the photodiode is connected to one end of the first resistor, and the other end of the first resistor is grounded.

[0021] In this implementation, the anti-flicker sensing circuit can be implemented using a photodiode and a first resistor. The photodiode collects the light intensity and generates a corresponding electrical signal. The first resistor collects the magnitude of the electrical signal and sends it to the controller, thereby enabling the controller to obtain an analog signal of mild light intensity.

[0022] In conjunction with the second aspect, some implementations of the second aspect also include a first capacitor, one end of which is connected to the negative terminal of the photodiode, and the other end of which is grounded.

[0023] In this implementation, the anti-flicker sensing circuit may also include a first capacitor, thereby filtering out ripple in the DC power supply and making the DC voltage in the circuit more stable.

[0024] Thirdly, an anti-flicker sensor is provided, including a housing and the aforementioned anti-flicker sensing circuit, wherein the anti-flicker sensing circuit is disposed in the housing.

[0025] In this implementation, the anti-flicker sensing circuit detects the frequency of ambient light, and the housing protects the circuit and facilitates connection to other electronic devices. The anti-flicker sensor can typically be integrated with electronic devices that have imaging capabilities to collect the frequency of ambient light sources.

[0026] Fourthly, an electronic device is provided, including a camera and an anti-flicker sensor, the anti-flicker sensor being connected to the camera via a spring contact, for detecting the light frequency in the shooting environment in order to adjust the camera's exposure time.

[0027] In this implementation, the camera is used to photograph the subject in an environment with light source illumination, and the anti-flicker sensor is used to detect the light frequency in the shooting environment to adjust the camera's exposure time, thereby reducing or eliminating stripes or flickering phenomena that may occur during the shooting process and improving the shooting quality.

[0028] Fifthly, an electronic device is provided, comprising: one or more processors, and a memory. The memory is coupled to the one or more processors, the memory being used to store computer program code, the computer program code including computer instructions, wherein the one or more processors invoke the computer instructions to cause the electronic device to perform the method.

[0029] In a sixth aspect, a chip system is provided, the chip system being applied to an electronic device, the chip system including one or more processors, the one or more processors being configured to invoke computer instructions to cause the electronic device to perform the method.

[0030] In a seventh aspect, a computer-readable storage medium is provided, the computer-readable storage medium including instructions that, when executed on an electronic device, cause the electronic device to perform the method. Attached Figure Description

[0031] Figure 1 is a schematic diagram of an application scenario for a functional testing method for an anti-flicker sensor provided in an embodiment of this application;

[0032] Figure 2 is a schematic diagram of an application scenario for another functional testing method of the anti-flicker sensor provided in this application embodiment;

[0033] Figure 3 is a schematic diagram of the user interface of an electronic device provided in an embodiment of this application;

[0034] Figure 4 is a schematic diagram of the user interface of an electronic device provided in another embodiment of this application;

[0035] Figure 5 is a schematic diagram of the structure of a test tool for an anti-flicker sensor of an electronic device provided in an embodiment of this application;

[0036] Figure 6 is a schematic diagram of the functional test interface of an anti-flicker sensor of an electronic device provided in an embodiment of this application;

[0037] Figure 7 is a schematic diagram of the structure of an anti-flicker sensor for an electronic device provided in an embodiment of this application;

[0038] Figure 8 is a waveform diagram of the light frequency detection of an anti-flicker sensor of an electronic device provided in an embodiment of this application;

[0039] Figure 9 is a schematic diagram of the structure of an anti-flicker sensor provided in an embodiment of this application;

[0040] Figure 10 is a flowchart illustrating a functional testing method for an anti-flicker sensor provided in an embodiment of this application;

[0041] Figure 11 is a flowchart illustrating a functional testing method for an anti-flicker sensor provided in another embodiment of this application;

[0042] Figure 12 is a flowchart illustrating a functional testing method for an anti-flicker sensor provided in another embodiment of this application;

[0043] Figure 13 is a flowchart illustrating a functional testing method for an anti-flicker sensor provided in another embodiment of this application;

[0044] Figure 14 is a flowchart illustrating another functional testing method for an anti-flicker sensor provided in this application embodiment;

[0045] Figure 15 is a flowchart illustrating another functional testing method for an anti-flicker sensor provided in this application embodiment;

[0046] Figure 16 is an FFT waveform diagram of the illumination amplitude detection of an anti-flicker sensor of an electronic device provided in an embodiment of this application;

[0047] Figure 17 shows a hardware system of an electronic device provided in an embodiment of this application;

[0048] Figure 18 is a schematic diagram of the software system of an electronic device provided in an embodiment of this application;

[0049] Figure 19 is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0050] The technical solutions in the embodiments of this application will be clearly and thoroughly described below with reference to the accompanying drawings. In the description of the embodiments of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B; the word "and / or" in the text is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone.

[0051] The terms "first," "second," etc., are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.

[0052] To facilitate understanding of the embodiments of this application, the relevant concepts involved in the embodiments of this application will be briefly explained first.

[0053] 1. Anti-flicker sensor

[0054] In the field of electronics, an anti-flicker sensor is a sensor that reduces image flicker by detecting the flicker frequency of ambient light sources. During the shooting process of electronic devices, flickering stripes may occur when the camera's exposure time is out of sync with the flicker frequency of the light source. To suppress this flickering, an anti-flicker sensor can be used to accurately detect the flicker frequency of the ambient light source and adjust the exposure time accordingly, effectively reducing or eliminating potential stripes or flickering during shooting and significantly improving image quality.

[0055] 2. Photodiode

[0056] In the field of electronics, a photodiode is a diode used to detect light intensity. A regular diode is in a cutoff state under reverse voltage, allowing only a weak reverse current to flow. A photodiode, however, operates under reverse voltage; that is, its PN junction operates in a reverse-biased state during use. When there is no light, the reverse current is extremely weak, called dark current; when there is light, the reverse current rapidly increases to tens of microamps, called photocurrent. The greater the light intensity, the greater the reverse current. Changes in light intensity cause changes in the photodiode's current, thus converting the light signal into an electrical signal, becoming a photoelectric sensor. Like a regular diode, a photoelectric sensor exhibits unidirectional conductivity in the absence of light. It should be noted that photodiodes are designed and manufactured to have a relatively large PN junction area to maximize the reception of incident light.

[0057] 3. Fixed-point processing

[0058] In the field of electronics, fixed-point conversion refers to a method of converting floating-point numbers to fixed-point numbers. Floating-point numbers are those where the decimal point position is variable, while fixed-point numbers have a fixed decimal point position. Fixed-point conversion involves defining the required decimal point positions, specifically how many decimal places and integer places are needed to convert a floating-point number to a fixed-point number. If the quantization error is less than half the precision, it can be considered "lossless"; however, if the decimal is directly removed after quantization, and the quantization error is greater than half the precision, it cannot be considered "lossless."

[0059] 4. Fourier Transform (FT)

[0060] In the field of electronics, the Fourier transform is a method that can represent a function satisfying certain conditions as a linear combination of trigonometric functions (sine and / or cosine functions) or their integrals. In different research fields, the Fourier transform has various variants, such as the continuous Fourier transform and the discrete Fourier transform (DFT). The fast Fourier transform (FFT) is a fast algorithm for the discrete Fourier transform, obtained by improving the algorithm based on the odd, even, imaginary, and real properties of the discrete Fourier transform. The short-time Fourier transform (SFT) is a mathematical transform related to the Fourier transform, used to determine the frequency and phase of a local region of a time-varying signal's sine wave.

[0061] 5. Exposure time

[0062] Exposure time refers to the time during which light shines on the film or sensor from the moment the camera shutter opens until it closes.

[0063] 6. Flicker

[0064] The energy transmitted in an AC power grid is not constant, but varies with a fixed frequency, which is generally called the power frequency; this energy variation caused by the power frequency is called flicker.

[0065] 7. Image banding

[0066] In the shooting environment of a stroboscopic source, the phenomenon of image sensors in electronic devices forming stripes on the image due to capturing stroboscopic light is called image banding, which is also commonly referred to as banding.

[0067] For example, for a 50Hz AC power source, i.e., a charged light source that flashes on and off 100 times per second; if the exposure time of the electronic device is an integer multiple of 10ms, the exposure integration period can cancel out image banding; if the exposure time of the electronic device is not an integer multiple of 10ms, the amount of light entering the image during image acquisition will fluctuate according to the AC sine wave pattern, resulting in regular stripes in the image. This is illustrated by the stripes shown in the preview image of the electronic device in Figure 1, Figure 2, and Figure 3, as well as the stripes shown in the image captured by the electronic device.

[0068] The above is a brief introduction to the terms used in the embodiments of this application, and will not be repeated below.

[0069] Before providing a detailed explanation of the functional testing method for the anti-flicker sensor provided in the embodiments of this application, the application scenarios and related technologies of the functional testing method for the anti-flicker sensor will be explained first.

[0070] For example, in this embodiment of the application, the functional testing method for the anti-flicker sensor can be applied to various shooting scenarios. For instance, an electronic device takes a picture of a subject in an environment with a stroboscopic light source. The subject can refer to a user, object, image, or video, etc. For example, it can be an electronic device such as a computer or smartphone that has the function of emitting a stroboscopic light source.

[0071] Figure 1 is a schematic diagram of an application scenario for a functional testing method for an anti-flicker sensor provided in an embodiment of this application.

[0072] As shown in Figure 1, exemplarily, in this embodiment of the application, the shooting scene may include an electronic device 10 and a shooting object 30. The shooting object 30 may be an electronic device with a display screen. During the process of shooting the shooting object 30 using the electronic device 10, if the exposure time of the camera of the electronic device 10 is not synchronized with the light source flicker of the shooting object 30, it may cause stripes to appear in the preview image of the electronic device 10, and / or cause stripes to appear in the image acquired by the electronic device 10.

[0073] Figure 2 is a schematic diagram of an application scenario for another functional testing method of the anti-flicker sensor provided in this application embodiment.

[0074] As shown in Figure 2, exemplarily, in this embodiment of the application, the shooting scene may include an electronic device 10, a lighting device 20, and a subject 30. With the lighting device 20 (e.g., a lamp) providing the light source, the camera function of the electronic device 10 (e.g., a smartphone) is used to take a picture of the subject 30 (e.g., a person). During the process of acquiring an image including the subject 30, the electronic device 10 can display a preview image of the subject 30 in real time on its screen. The user can view the preview image on the screen of the electronic device 10 in real time, and when the user needs to capture an image including the subject 30 at a certain moment, they can click the shooting control on the shooting interface. When the shooting control of the electronic device 10 is triggered, the electronic device 10 can obtain an image including the subject 30.

[0075] In addition, indoor spaces generally require lighting equipment 20 to provide illumination. Lighting equipment 20 can operate under the drive of alternating current (AC). Taking a fluorescent lamp as an example, the working principle of a fluorescent lamp is that under the action of high-voltage current, the inert gas inside the lamp tube discharges, and the electrons generated by the discharge reach the lamp tube, causing the fluorescent lamp to emit light. Taking a fluorescent lamp operating at 50Hz AC as an example, when the fluorescent lamp operates under AC drive, 50Hz AC can cause the fluorescent lamp to flicker 100 times per second. Optionally, taking a fluorescent lamp operating at 60Hz AC as an example, when the fluorescent lamp operates under AC drive, 60Hz AC can cause the fluorescent lamp to flicker 120 times per second.

[0076] Furthermore, as shown in Figure 2, when the exposure time of the camera in electronic device 10 is out of sync with the flicker frequency of the lighting device 20, it may cause stripes or flickering phenomena to appear in the camera during shooting. For example, stripes may appear in the preview image of electronic device 10. To solve this problem, a flicker sensor can generally be used to detect the flicker frequency of the light source to adjust the camera's exposure time during shooting, thereby reducing or eliminating possible stripes or flickering phenomena during shooting and improving image quality.

[0077] Figure 3 is a schematic diagram of the user interface of an electronic device provided in an embodiment of this application.

[0078] As shown in Figure 3, exemplarily, in an embodiment of this application, when the electronic device 10 is in camera mode, its display screen can show a preview image. When the exposure time of the camera of the electronic device 10 is out of sync with the flicker frequency of the light source, it may affect the image captured by the electronic device 10. For example, it may cause stripes to appear in the preview image of the electronic device 10, as shown in Figure 3(a). When the camera control of the electronic device 10 is triggered, the electronic device 10 can capture the image. For example, when the electronic device 10 captures the object in a well-lit environment, it may cause stripes to appear in the image captured by the electronic device 10, as shown in Figure 3(b).

[0079] Figure 4 is a schematic diagram of the user interface of an electronic device provided in another embodiment of this application.

[0080] As shown in Figure 4, exemplarily, in an embodiment of this application, to reduce the stripes or flickering that may occur during the shooting process of the electronic device 10, a flicker sensor can be used to detect the flicker frequency of the light source, so as to adjust the exposure time of the camera accordingly, thereby improving the shooting quality of the camera of the electronic device 10. For example, if the electronic device 10 is equipped with and uses an anti-flicker sensor, when the camera of the electronic device 10 is in shooting mode, no stripes will appear in the preview image of the electronic device 10, as shown in Figure 4(a). When the shooting control of the electronic device 10 is triggered, the electronic device 10 can capture the image. Since the electronic device 10 is equipped with a flicker sensor to detect the flicker frequency of the light source in real time, the exposure time of the camera can be adjusted according to the flicker frequency of the light source, so that no stripes appear in the image captured by the electronic device 10, as shown in Figure 4(b).

[0081] Figure 5 is a schematic diagram of the structure of a test tool for an anti-flicker sensor of an electronic device provided in an embodiment of this application. Figure 6 is a schematic diagram of the functional test interface of an anti-flicker sensor of an electronic device provided in an embodiment of this application.

[0082] As shown in Figure 5, exemplarily, in an embodiment of this application, a testing tool 40 can be used to perform functional testing on the anti-flicker sensor of the electronic device 10. The testing tool 40 may include a testing cavity 401, a light source 403, and a light-transmitting glass 404. A testing groove 402 may be provided on the testing cavity 401 for placing or fixing the electronic device 10, such as a smartphone. A light source 403 may be provided at the bottom of the testing cavity 401 for emitting light of a fixed frequency to the electronic device 10. A light-transmitting glass 404 may be provided on one side of the testing groove 402 for allowing the light emitted by the light source 403 to pass through the light-transmitting glass 404 to the electronic device 10.

[0083] For example, in this embodiment of the application, the light source 403 can emit light at 80±2Hz to complete the functional test of the anti-flicker sensor.

[0084] For example, during the testing of the anti-flicker sensor of electronic device 10, light source 403 emits light outward, which passes through the light-transmitting glass 404 and is transmitted to the anti-flicker sensor of electronic device 10. This allows the testing software to determine the function of the anti-flicker sensor based on the light frequency collected by the anti-flicker sensor. When the light frequency meets the light frequency threshold range, it indicates that the anti-flicker sensor is functioning normally, and the test software's light frequency detection result is "pass," as shown in Figure 6(a). When the light frequency does not meet the light frequency threshold range, it indicates that the anti-flicker sensor is malfunctioning, and the test software's light frequency detection result is the current frequency value, as shown in Figure 6(b).

[0085] It should be understood that this application does not limit the specific structure of the testing tool. Those skilled in the art can also use testing tools with other structures to fix the electronic device 10 and test the function of the anti-flicker sensor of the electronic device 10. Alternatively, the testing tool for the anti-flicker sensor can be combined with other functional testing structures of the electronic device 10.

[0086] It should be understood that the test tool 40 can also be a test fixture used to fix the electronic device 10. The test software can be either externally and temporarily imported into the electronic device 10 for functional testing of the anti-flicker sensor, or it can be test software directly set inside the electronic device 10.

[0087] Figure 7 is a schematic diagram of the structure of an anti-flicker sensor for an electronic device provided in an embodiment of this application.

[0088] As shown in Figure 7, exemplarily in an embodiment of this application, the anti-flicker sensor 102 includes a photodiode for collecting the ambient light frequency. The anti-flicker sensor 102 is connected to the motherboard 101 via a spring contact, and the testing software can be set within the motherboard 101. To intercept malfunctioning anti-flicker sensors, the testing software typically determines whether the anti-flicker sensor is functioning correctly by checking whether the photodiode can correctly detect the light frequency.

[0089] Figure 8 is a waveform diagram of the light frequency detection of an anti-flicker sensor for an electronic device provided in an embodiment of this application.

[0090] As shown in Figure 8, exemplarily, in the embodiments of this application, the anti-flicker sensor can still correctly detect the light frequency even when the spring contact is abnormal or not connected. This is mainly because the anti-flicker sensor provided in this application uses a photodiode to detect the light frequency. The detection frequency can reach over 2000Hz. For example, the light frequency waveform sampled by a smartphone with a normally functioning anti-flicker sensor is a square wave, as shown in Figure 8(a). In a phone with an abnormal anti-flicker sensor (e.g., a broken spring contact, rust, dirt, or poor contact), the majority carriers generated in the PN junction region of the photodiode increase to a certain concentration and then stop increasing under light, meaning the current is unsustainable. This manifests as an oscillating current with both positive and negative sides on the sampling resistor, with oscillations occurring on both the rising and falling edges. Therefore, it can still detect the frequency normally, exhibiting an impulse response at the edge of the original square wave, as shown in Figure 8(b). This causes the testing software to miss the abnormal anti-flicker sensor, thus affecting the quality of the phone.

[0091] It is understandable that traditional anti-flicker sensors are generally implemented using complementary metal-oxide semiconductor (CMOS). The CMOS is integrated into the color temperature sensor and can theoretically detect light frequencies of 1-500Hz. Compared with the anti-flicker sensor provided in this application, the detection frequency is lower.

[0092] In view of this, the present application provides a functional testing method for an anti-flicker sensor. In addition to light frequency detection, light amplitude detection is added. Only when both light frequency detection and light amplitude detection are normal is the anti-flicker sensor determined to be functional and connected correctly. This effectively intercepts anti-flicker sensors that malfunction, preventing anti-flicker sensors with faulty springs or that are not connected from being missed, thereby improving the quality of the mobile phone.

[0093] Referring to Figures 9 to 19, the following section details a scheme for effectively intercepting malfunctioning anti-flicker sensors by adding amplitude detection to the functional testing method of the anti-flicker sensor. In the embodiments of this application, the connection between two electrical modules / electronic devices includes communication connections and electrical connections. A communication connection here refers to a connection capable of transmitting communication signals. The communication signal can be an electrical signal or an optical signal, and is not limited here. An electrical connection refers to a connection capable of transmitting electrical signals. Electrical connections include direct connections and indirect connections. For example, a direct connection between device A and device B means that device A and device B are connected by a wire to transmit electrical signals. An indirect connection between device A and device B means that the first end of device A is connected to device C by a wire, and the second end of device C is connected to device B by a wire, so that device A and device B can transmit electrical signals through device C. For ease of understanding, in the following description, "electrical connection" will be simply referred to as a connection.

[0094] Figure 9 is a schematic diagram of the structure of an anti-flicker sensor provided in an embodiment of this application.

[0095] As shown in Figure 9, an exemplary embodiment of this application provides an anti-flicker sensing circuit 100, including a photodiode D1 and a first resistor R1. The negative terminal of the photodiode D1 is connected to a reverse power supply. Exemplarily, the negative terminal of the photodiode D1 is connected to the reverse bias power supply via a WCD_MIC_BIAS3 interface through a first spring contact. The positive terminal of the photodiode D1 is connected to one end of the first resistor R1 and is connected to a board-to-board (BTB) connector via an A_MIC4_P_BTB interface through a second spring contact. The other end of the first resistor R1 is grounded and is connected to the BTB connector via an A_MIC4_N_BTB interface through a third spring contact.

[0096] In this embodiment, photodiode D1 is used to detect the ambient light intensity. When there is light, the reverse current increases rapidly; the greater the light intensity, the greater the reverse current. Changes in light intensity cause changes in the current of photodiode D1, thereby converting the light signal into an electrical signal. As the light frequency changes, the electrical signal also changes accordingly. A first resistor R1 is used to sample this electrical signal and send it to the controller. The controller processes this signal to obtain the light frequency and adjusts the camera's exposure time accordingly, thereby reducing or eliminating possible stripes or flickering during shooting and improving image quality.

[0097] As shown in Figure 9, by way of example, this application embodiment also provides an anti-flicker sensing circuit, including a photodiode D1, a first resistor R1 and a first capacitor C1, one end of the first capacitor C1 is connected to the negative terminal of the photodiode D1, and the other end of the first capacitor C1 is grounded.

[0098] In this embodiment, the first capacitor C1 is used to filter the ripple in the DC power supply, making the DC voltage in the circuit more stable, thereby protecting the anti-flicker sensor circuit.

[0099] It should be noted that, by way of example, this application embodiment also provides an anti-flicker sensor, including the above-described anti-flicker sensing circuit, for detecting the flicker frequency of light sources in the environment.

[0100] For example, this application also provides an electronic device, such as a smartphone, including a camera and an anti-flicker sensing circuit. The anti-flicker sensing circuit is connected to the camera and is used to detect the light frequency in the shooting environment to adjust the camera's exposure time, thereby reducing or eliminating stripes or flickering phenomena that may occur during shooting and improving image quality.

[0101] For example, an embodiment of this application provides an anti-flicker sensor, including a housing and an anti-flicker sensing circuit disposed in the housing.

[0102] In this implementation, the anti-flicker sensing circuit detects the frequency of ambient light, and the housing protects the circuit and facilitates connection to other electronic devices. The anti-flicker sensor can typically be integrated with electronic devices that have imaging capabilities to collect the frequency of ambient light sources.

[0103] Figure 10 is a flowchart illustrating a functional testing method for an anti-flicker sensor provided in an embodiment of this application.

[0104] As shown in Figure 10, by way of example, this application provides a functional testing method 200 for an anti-flicker sensor, which can be applied to electronic devices (e.g., smartphones) equipped with an anti-flicker sensor. Specifically, the functional testing method 200 for the anti-flicker sensor may include the following steps:

[0105] S201, Control the anti-flicker sensor to obtain light intensity.

[0106] For example, in the embodiments of this application, when there is light in the environment, the light intensity can be obtained through the anti-flicker controller to calculate the light frequency and light amplitude, etc.

[0107] It should be understood that light intensity can also be a sequence of data collected by the anti-flicker sensor. For example, the anti-flicker sensor continuously collects light intensity data, and when the light intensity data reaches a discrimination detection threshold, a sequence of light intensity data can be obtained.

[0108] Optionally, the anti-flicker controller can use the photodiode D1 and the first resistor R1 in the anti-flicker control circuit described above to realize the light intensity acquisition process.

[0109] It should be noted that, exemplaryly, in this application embodiment, when performing functional testing on an anti-flicker sensor installed on a smartphone, the smartphone can first be configured to run the anti-flicker sensor's test software interface, and then the smartphone can be placed in a dedicated test fixture for the anti-flicker sensor. For example, a fixture equipped with a full-function mobile phone test (man-machine interface, MMI) installation package (Android package, APK).

[0110] For example, a dedicated test fixture for an anti-flicker sensor can typically provide a light source of 80±2Hz. By placing the anti-flicker sensor of a smartphone in front of the light source, the anti-flicker sensor can obtain the light intensity.

[0111] It should be understood that the testing software for the anti-flicker sensor can be either externally imported into the smartphone for functional testing of the anti-flicker sensor, or it can be testing software directly installed inside the smartphone.

[0112] S202. Obtain the light frequency and light amplitude based on the light intensity.

[0113] For example, in the embodiments of this application, the light intensity can be processed to obtain the light frequency. For instance, the sequence data of light intensity can be processed sequentially by differential processing, analog-to-digital conversion, etc., to obtain 256 light intensity digital signals. The light frequency can be obtained by performing a fast Fourier transform on the light intensity digital signals.

[0114] For example, in the embodiments of this application, the light intensity can be processed to obtain the light amplitude. For instance, the sequence data of light intensity can be processed sequentially by differential processing, fast Fourier transform, etc., to obtain the light amplitude.

[0115] It should be understood that, in the embodiments of this application, the algorithm for obtaining the light frequency based on the light intensity and the algorithm for obtaining the light amplitude based on the light intensity can be performed simultaneously without affecting each other, thereby improving testing efficiency.

[0116] S203. When the light frequency meets the light frequency threshold range and the light amplitude meets the light amplitude threshold range, it is determined that the anti-flicker sensor can correctly detect the light frequency.

[0117] For example, in this application embodiment, not only is the light frequency detected to meet the light frequency threshold range, but the light amplitude is also detected to meet the light amplitude threshold range. Only when both the light frequency and the light amplitude meet the light amplitude threshold range will it be determined that the anti-flicker sensor can correctly detect the light frequency, thereby effectively intercepting the anti-flicker sensor that is abnormal, avoiding the failure to intercept anti-flicker sensors with abnormal springs or those that are not connected, and thus improving the quality of the mobile phone.

[0118] Figure 11 is a flowchart illustrating another functional testing method for an anti-flicker sensor provided in this application embodiment.

[0119] As shown in Figure 11, by way of example, this application embodiment provides a functional testing method 200 for an anti-flicker sensor, which can be applied to electronic devices (such as smartphones) equipped with an anti-flicker sensor. The difference between this application embodiment and the anti-flicker sensor functional testing method shown in Figure 10 is as follows:

[0120] S203. When the light frequency meets the light frequency threshold range and the light amplitude meets the light amplitude threshold range, it is determined that the anti-flicker sensor can correctly detect the light frequency. Specifically, this may include the following steps:

[0121] S20301. Determine whether the light frequency meets the light frequency threshold range. If the light frequency meets the light frequency threshold range, then the frequency detection of the anti-flicker sensor is normal.

[0122] For example, in this embodiment of the application, after obtaining the illumination frequency, the illumination frequency can be compared with an illumination frequency threshold range. When the illumination frequency meets the illumination frequency threshold range, it is determined that the frequency detection of the anti-flicker sensor is normal. Otherwise, the current illumination frequency is output. For example, the frequency threshold can be set to 80±4Hz.

[0123] S20302. Determine whether the illumination amplitude meets the illumination amplitude threshold range. If the illumination amplitude meets the illumination amplitude threshold range, then the amplitude detection of the anti-flicker sensor is normal.

[0124] For example, in this embodiment of the application, after obtaining the illumination amplitude, the illumination amplitude can be compared with an illumination amplitude threshold range. If the illumination amplitude meets the illumination amplitude threshold range, it is determined that the amplitude detection of the anti-flicker sensor is normal. Otherwise, the current illumination amplitude is output.

[0125] It should be noted that if the light frequency does not meet the light frequency threshold range, or the light amplitude does not meet the light amplitude threshold range, the test will be restarted after the test time has elapsed.

[0126] It should be noted that the steps of determining whether the illumination frequency meets the illumination frequency threshold range and whether the illumination amplitude meets the illumination amplitude threshold range can be performed simultaneously, or the step of determining whether the illumination frequency meets the illumination frequency threshold range can be performed first, followed by the step of determining whether the illumination amplitude meets the illumination amplitude threshold range. Alternatively, the step of determining whether the illumination amplitude meets the illumination amplitude threshold range can be performed first, followed by the step of determining whether the illumination frequency meets the illumination frequency threshold range.

[0127] S20303. When the frequency detection and amplitude detection of the anti-flicker sensor are normal, it is determined that the anti-flicker sensor is functioning normally.

[0128] For example, in this embodiment of the application, when both the frequency detection and amplitude detection of the anti-flicker sensor are normal, it can be determined that the anti-flicker sensor is functioning normally and there is no abnormal or disconnected spring connection. Simultaneously, "Pass" can be displayed on the test page to indicate that the anti-flicker sensor is detecting normally. At this point, the testing process for the anti-flicker sensor is complete.

[0129] Therefore, in this embodiment, compared to the traditional functional testing method for anti-flicker sensors, in addition to light frequency detection, light amplitude detection is also added. Only when both light frequency detection and light amplitude detection are normal can the anti-flicker sensor be determined to be functional and the contact spring connection to be normal. This effectively intercepts anti-flicker sensors that malfunction, preventing anti-flicker sensors in high-resistance scenarios with abnormal or disconnected contact springs from being missed, thereby improving the quality of the mobile phone.

[0130] It should be understood that, in the embodiments of this application, other specific implementations of the functional testing method 200 for the anti-flicker sensor can be referred to the above description of FIG10, and will not be repeated here.

[0131] Figure 12 is a flowchart illustrating another functional testing method for an anti-flicker sensor provided in this application embodiment.

[0132] As shown in Figure 12, by way of example, this application embodiment provides a functional testing method 200 for an anti-flicker sensor, which can be applied to electronic devices (such as smartphones) equipped with an anti-flicker sensor. The difference between this application embodiment and the anti-flicker sensor functional testing method shown in Figure 10 is as follows:

[0133] S202. Obtaining the light frequency and light amplitude based on the light intensity may include the following steps:

[0134] S2021. Perform analog-to-digital conversion on the light intensity to obtain a digital signal of light intensity.

[0135] For example, in the embodiments of this application, the collected analog light intensity signal can be converted from analog to digital to obtain a digital light intensity signal for subsequent data processing.

[0136] It should be noted that before performing analog-to-digital conversion on the light intensity, differential processing can be performed on the light intensity to reduce irregular fluctuations between light intensity data, making its fluctuation curve smoother and more conducive to subsequent data processing.

[0137] S2022. Perform a Fourier transform on the digital signal of light intensity to obtain the light frequency.

[0138] For example, in the embodiments of this application, a fast Fourier transform can be performed on the digital signal of light intensity to obtain the light frequency, so as to facilitate the subsequent comparison of light frequencies.

[0139] It should be understood that, in the embodiments of this application, other specific implementations of the functional testing method 200 for the anti-flicker sensor can be referred to the above description of FIG10, and will not be repeated here.

[0140] Figure 13 is a flowchart illustrating another functional testing method for an anti-flicker sensor provided in this application embodiment.

[0141] As shown in Figure 13, by way of example, this application embodiment provides a functional testing method 200 for an anti-flicker sensor, which can be applied to electronic devices (such as smartphones) equipped with an anti-flicker sensor. The difference between this application embodiment and the anti-flicker sensor functional testing method shown in Figure 10 is as follows:

[0142] The functional test method 200 for the anti-flicker sensor may also include the following steps:

[0143] S2031. Divide the illumination frequency to obtain multiple sub-interval frequencies.

[0144] For example, in this embodiment of the application, in order to reduce power consumption during data processing, the illumination frequency can be divided into frequency bands for detection, and the detection time can be optimized to solve the problem that the detection time is too long at certain special frequencies in the algorithm, and the time consumed per frame exceeds the data cycle (e.g., 10ms), which causes the data buffer to overflow and frames to be dropped, resulting in abnormal data detection.

[0145] It should be noted that fixed-point segmentation refers to dividing the entire frequency range into frequency sub-intervals with equal intervals of 200Hz, and performing frequency detection independently and in parallel within each frequency sub-interval.

[0146] For example, the segmentation method of illumination frequency may include random segmentation, sequential segmentation, equidistant sampling segmentation, and fixed-point segmentation.

[0147] Understandably, traditional anti-flicker sensor functional testing methods typically involve detecting and comparing the entire frequency band of illumination, resulting in long algorithm processing times and high power consumption. Therefore, this application's embodiments divide the illumination frequency into multiple sub-frequency intervals for separate detection, thereby reducing the power consumption and detection time for illumination frequency.

[0148] S2032. Compare the frequencies of multiple sub-intervals with the light frequency threshold range respectively.

[0149] For example, in the embodiments of this application, the frequencies of multiple sub-intervals after fixed-point segmentation can be compared with the light frequency threshold range to obtain multiple comparison results, so as to determine whether the detected anti-flicker sensor can perform the correct light frequency.

[0150] S2033. Integrate the parallel detection results of multiple sub-interval frequencies to determine whether the illumination frequency meets the illumination frequency threshold range.

[0151] For example, in the embodiments of this application, after the frequency detection of multiple sub-intervals is completed, the parallel detection results of the multiple sub-interval frequencies can be integrated to make a comprehensive judgment on whether the anti-flicker sensor can correctly detect the light frequency in the environment.

[0152] It should be noted that the embodiment of this application can be set before S203, when the light frequency meets the light frequency threshold range and the light amplitude meets the light amplitude threshold range. Therefore, compared with the traditional method of sequential detection across the entire frequency band, the embodiment of this application divides the frequency of the entire frequency band into multiple sub-interval frequencies for parallel detection, which can reduce detection time and reduce detection power consumption.

[0153] It should be understood that, in the embodiments of this application, other specific implementations of the functional testing method 200 for the anti-flicker sensor can be referred to the above description of FIG10, and will not be repeated here.

[0154] Figure 14 is a flowchart illustrating another functional testing method for an anti-flicker sensor provided in this application embodiment.

[0155] As shown in Figure 14, by way of example, this application embodiment provides a functional testing method 200 for an anti-flicker sensor, which can be applied to electronic devices (such as smartphones) equipped with an anti-flicker sensor. The difference between this application embodiment and the anti-flicker sensor functional testing method shown in Figure 10 is as follows:

[0156] S203. Obtaining the light frequency and light amplitude based on the light intensity may include the following steps:

[0157] S2034. Perform analog-to-digital conversion on the light intensity to obtain a digital signal of light intensity.

[0158] For example, in the embodiments of this application, the collected analog light intensity signal can be converted from analog to digital to obtain a digital light intensity signal for subsequent data processing.

[0159] It should be noted that before performing analog-to-digital conversion on the light intensity, differential processing can be performed on the light intensity to reduce irregular fluctuations between light intensity data, making its fluctuation curve smoother and more conducive to subsequent data processing.

[0160] S2035. Perform a Fourier transform on the time domain of the digital light intensity signal to obtain a complex array.

[0161] For example, in the embodiments of this application, a complex array can be obtained by performing a fast Fourier transform on the time domain of the light intensity digital signal for subsequent data processing.

[0162] S2036. Calculate the illumination amplitude by calculating the modulus of the complex array.

[0163] For example, in the embodiments of this application, the illumination amplitude can be obtained by calculating the modulus of the complex array, so as to determine whether the anti-flicker sensor can detect the illumination amplitude in the environment normally.

[0164] It should be understood that, in the embodiments of this application, other specific implementations of the functional testing method 200 for the anti-flicker sensor can be referred to the above description of FIG10, and will not be repeated here.

[0165] Figure 15 is a flowchart illustrating another functional testing method for an anti-flicker sensor provided in this application embodiment.

[0166] As shown in Figure 15, by way of example, this application embodiment provides a functional testing method 200 for an anti-flicker sensor, which can be applied to electronic devices (such as smartphones) equipped with an anti-flicker sensor. The difference between this application embodiment and the anti-flicker sensor functional testing method shown in Figure 10 is as follows:

[0167] S203. Obtain the illumination frequency and illumination amplitude based on the illumination intensity, which may specifically include the following steps:

[0168] S2034. Perform analog-to-digital conversion on the light intensity to obtain a digital signal of light intensity.

[0169] For example, in the embodiments of this application, the collected analog light intensity signal can be converted from analog to digital to obtain a digital light intensity signal for subsequent data processing.

[0170] It should be noted that before performing analog-to-digital conversion on the light intensity, differential processing can be performed on the light intensity to reduce irregular fluctuations between light intensity data, making its fluctuation curve smoother and more conducive to subsequent data processing.

[0171] S2037. Perform fixed-point processing on the time domain of the digital light intensity signal. Fixed-point processing refers to determining the decimal point position in the time domain of the digital light intensity signal.

[0172] For example, in the embodiments of this application, the time domain of the light intensity digital signal can be processed by floating-point to fixed-point conversion, and the decimal point position of the time domain of the light intensity digital signal can be determined, thereby improving the accuracy of quantization analysis and reducing or eliminating analysis errors caused by frame drops in the time domain signal.

[0173] It should be noted that, for example, in the embodiments of this application, the fixed-point bit width of the fixed-point processing can be 32 bits.

[0174] S2035. Perform a Fourier transform on the time domain of the digital light intensity signal to obtain a complex array.

[0175] For example, in the embodiments of this application, a complex array can be obtained by performing a fast Fourier transform on the time domain of the light intensity digital signal for subsequent data processing.

[0176] S2036. Calculate the illumination amplitude by calculating the modulus of the complex array.

[0177] For example, in the embodiments of this application, the illumination amplitude can be obtained by calculating the modulus of the complex array, so as to determine whether the anti-flicker sensor can detect the illumination amplitude in the environment normally.

[0178] It should be understood that, in the embodiments of this application, other specific implementations of the functional testing method 200 for the anti-flicker sensor can be referred to the above description of FIG10, and will not be repeated here.

[0179] The effectiveness of the anti-flicker sensor functional testing method provided in the embodiments of this application will be described below.

[0180] Figure 16 is an FFT waveform diagram of illumination amplitude detection for a functional test method of an anti-flicker sensor provided in an embodiment of this application.

[0181] As shown in Figure 16, by way of example, in this embodiment of the application, amplitude detection is added to the anti-flicker sensor in the electronic device 10 (e.g., a smartphone). The detection found that the illumination amplitude sampled by a smartphone with a normally functioning anti-flicker sensor is in the tens of thousands, as shown in Figure 16(a), while the illumination amplitude sampled by a smartphone with an abnormal anti-flicker sensor is in the tens of thousands, as shown in Figure 16(b). The amplitude of the normal anti-flicker sensor differs from that of the abnormal anti-flicker sensor by more than 50 times.

[0182] Therefore, compared to traditional anti-flicker sensor functional testing methods, the anti-flicker sensor functional testing method provided in this application adds light amplitude detection to the light frequency detection. When the amplitude detection of the anti-flicker sensor is abnormal, the light source amplitude in the current environment will be displayed on the test interface of the electronic device (e.g., a smartphone). When the amplitude detection of the anti-flicker sensor is normal, "Pass" will be displayed on the test interface of the electronic device. The amplitude of a normal anti-flicker sensor differs from that of an abnormal anti-flicker sensor by more than 50 times, and the amplitude process capability index (CP) data is relatively concentrated. Therefore, the anti-flicker sensor functional testing method provided in this application, by adding a threshold judgment of light source amplitude, can more accurately determine whether the anti-flicker sensor is working effectively and correctly connected, thereby effectively intercepting abnormal anti-flicker sensors, avoiding the failure to intercept anti-flicker sensors with abnormal spring contacts or those that are not connected, and thus improving the quality of the mobile phone.

[0183] The electronic devices to which the functional testing method for the anti-flicker sensor provided in the embodiments of this application is applicable are described below.

[0184] For example, this application provides an electronic device 10, including a camera and an anti-flicker sensor. The anti-flicker sensor is connected to both the camera and the motherboard via a spring contact and is used to detect the light frequency in the shooting environment in order to adjust the camera's exposure time.

[0185] In this implementation, the camera is used to photograph the subject in an environment with light source illumination, and the anti-flicker sensor is used to detect the light frequency in the shooting environment to adjust the camera's exposure time, thereby reducing or eliminating stripes or flickering phenomena that may occur during the shooting process and improving the shooting quality.

[0186] Figure 17 shows a hardware system of an electronic device provided in an embodiment of this application.

[0187] As shown in Figure 17, by way of example, the type of electronic device 10 is not specifically limited in this embodiment of the application. In some embodiments, electronic device 10 may be a smartphone, wearable device (e.g., smart bracelet, smartwatch, earphone, etc.), tablet computer, laptop computer, handheld computer, ultra-mobile personal computer (UMPC), cellular phone, personal digital assistant (PDA), augmented reality (AR) / virtual reality (VR) device, or other IoT (Internet of Things) devices, and may also be a television, large screen, printer, projector, etc. For ease of understanding, the following embodiments use a smartphone as an example for illustrative purposes.

[0188] For example, in the embodiments of this application, the electronic device 10 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power manager 141, a battery 142, a first antenna 1, a second antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, an anti-flicker sensor 180M, etc.

[0189] It should be noted that the structure shown in FIG17 does not constitute a specific limitation on the electronic device 10. In other embodiments of this application, the electronic device 10 may include more or fewer components than those shown in FIG17, or the electronic device 10 may include a combination of some of the components shown in FIG17, or the electronic device 10 may include sub-components of some of the components shown in FIG17. The components shown in FIG17 may be implemented in hardware, software, or a combination of software and hardware.

[0190] Processor 110 may include one or more processing units. For example, processor 110 may include at least one of the following processing units: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, video codec, digital signal processor (DSP), baseband processor, and neural network processing unit (NPU). These different processing units may be independent devices or integrated devices. The controller may be the central nervous system and command center of electronic device 10. The controller can generate operation control signals based on instruction opcodes and timing signals to control instruction fetching and execution. For example, processor 110 may be used to execute the functional testing method for the anti-flicker sensor in the embodiments of this application.

[0191] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0192] In some embodiments, processor 110 may include one or more interfaces. For example, processor 110 may include at least one of the following interfaces: an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a SIM interface, and a USB interface.

[0193] The connection relationships between the modules shown in Figure 17 are merely illustrative and do not constitute a limitation on the connection relationships between the modules of the electronic device 10. Optionally, the modules of the electronic device 10 may also adopt a combination of various connection methods described in the above embodiments.

[0194] The wireless communication function of electronic device 10 can be implemented through devices such as a first antenna 1, a second antenna 2, a mobile communication module 150, a wireless communication module 160, a modem processor, and a baseband processor. The first antenna 1 and the second antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 10 can be used to cover one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. In some other embodiments, the antennas can be used in conjunction with a tuning switch.

[0195] The mobile communication module 150 can provide a wireless communication solution applied to the electronic device 10, such as at least one of the following: a second-generation (2G) mobile communication solution, a third-generation (3G) mobile communication solution, a fourth-generation (5G) mobile communication solution, and a fifth-generation (5G) mobile communication solution.

[0196] The modem processor may include a modulator and a demodulator. The modulator modulates a low-frequency baseband signal to be transmitted into a mid-to-high frequency signal. The demodulator demodulates a received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After processing by the baseband processor, the low-frequency baseband signal is transmitted to the application processor. The application processor outputs sound signals through audio devices (e.g., speaker 170A, receiver 170B) or displays images or videos through the display screen 194. In some embodiments, the modem processor may be a separate device. In other embodiments, the modem processor may be independent of the processor 110 and may be housed in the same device as the mobile communication module 150 or other functional modules.

[0197] Similar to the mobile communication module 150, the wireless communication module 160 can also provide a wireless communication solution for use on the electronic device 10, such as at least one of the following: wireless local area networks (WLAN), Bluetooth (BT), Bluetooth Low Energy (BLE), ultra-wideband (UWB), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR) technology, etc.

[0198] In some embodiments, the first antenna 1 of the electronic device 10 is coupled to the mobile communication module 150, and the second antenna 2 of the electronic device 10 is coupled to the wireless communication module 160, so that the electronic device 10 can communicate with the network and other electronic devices through wireless communication technology.

[0199] The external storage interface 120 can be used to connect an external memory card, such as a secure digital (SD) card, to expand the storage capacity of the electronic device. The external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage functions. For example, music, video, and other files can be saved on the external memory card.

[0200] Internal memory 121, also known as "RAM," is used to store executable program code for the computer, including instructions. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a given function (such as sound playback, image playback, etc.).

[0201] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a mini light-emitting diode (Mini LED), a micro light-emitting diode (Micro LED), a micro OLED, or a quantum dot light-emitting diode (QLED). In some embodiments, electronic device 10 may include one or N displays 194, where N is a positive integer greater than 1.

[0202] For example, in some embodiments, the ISP is used to process data fed back by the camera 193. For instance, when taking a picture, the shutter is opened, and light is transmitted through the camera 193 to the camera's photosensitive element. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing, transforming it into an image visible to the naked eye. The ISP can perform algorithmic optimization on image noise, brightness, and color. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be integrated into the camera 193.

[0203] For example, camera 193 (also referred to as a lens) is used to capture still images or videos. It can be activated via application commands to achieve a photo-taking function, such as capturing images of any scene. Camera 193 may include components such as an imaging lens, a filter, and an image sensor. Light emitted or reflected by an object enters the imaging lens, passes through the filter, and finally converges onto the image sensor. The imaging lens is mainly used to converge and image the light emitted or reflected by all objects in the shooting field (also referred to as the scene to be captured, the target scene, or the scene image the user expects to capture); the filter is mainly used to filter out excess light waves (such as infrared light waves other than visible light); the image sensor can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The image sensor is mainly used to perform photoelectric conversion on the received light signal, converting it into an electrical signal, and then transmitting the electrical signal to an image signal processor to convert it into a digital image signal. The image signal processor outputs the digital image signal to a digital signal processor for further processing. Digital signal processors convert digital image signals into image signals in standard formats such as RGB and YUV.

[0204] For example, a digital signal processor is used to process digital signals, including digital image signals and other digital signals. For instance, when the electronic device 10 selects a frequency point, the digital signal processor is used to perform a Fourier transform on the frequency point energy, etc.

[0205] For example, a video codec is used to compress or decompress digital video. Electronic device 10 may support one or more video codecs. Thus, electronic device 10 can play or record video in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG 2, MPEG 3, and MPEG 4.

[0206] For example, the gyroscope sensor 180B can be used to determine the motion attitude of the electronic device 10. In some embodiments, the gyroscope sensor 180B can determine the angular velocity of the electronic device 10 around three axes (i.e., the x-axis, y-axis, and z-axis). The gyroscope sensor 180B can be used for image stabilization. For example, when the shutter is pressed, the gyroscope sensor 180B detects the angle of the shake of the electronic device 10, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to counteract the shake of the electronic device 10 by moving in the opposite direction, thus achieving image stabilization. The gyroscope sensor 180B can also be used in scenarios such as navigation and motion-sensing games.

[0207] For example, the accelerometer 180E can detect the magnitude of the acceleration of the electronic device 10 in various directions (typically the x-axis, y-axis, and z-axis). When the electronic device 10 is stationary, the magnitude and direction of gravity can be detected. The accelerometer 180E can also be used to identify the attitude of the electronic device 10 as input parameters for applications such as screen orientation switching and pedometers.

[0208] For example, distance sensor 180F is used to measure distance. Electronic device 10 can measure distance via infrared or laser. In some embodiments, such as in a shooting scenario, electronic device 10 can utilize distance sensor 180F for distance measurement to achieve fast focusing.

[0209] For example, the ambient light sensor 180L is used to sense the ambient light intensity. The electronic device 10 can adaptively adjust the brightness of the display screen 194 according to the sensed ambient light intensity. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also work with the proximity sensor 180G to detect whether the electronic device 10 is in a pocket to prevent accidental touches.

[0210] For example, the fingerprint sensor 180H is used to collect fingerprints. The electronic device 10 can utilize the collected fingerprint characteristics to perform functions such as unlocking, accessing app locks, taking photos, and answering calls.

[0211] For example, a touch sensor 180K, also known as a touch device, may be disposed on a display screen 194. The touch sensor 180K and the display screen 194 together form a touchscreen, also known as a touch screen. The touch sensor 180K is used to detect touch operations performed on or near it. The touch sensor 180K can transmit the detected touch operation to an application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K may also be disposed on the surface of the electronic device and in a different location from the display screen 194.

[0212] For example, button 190 includes a power button and volume buttons. Button 190 can be a mechanical button or a touch button. Electronic device 10 can receive button input signals and implement functions related to the button input signals.

[0213] For example, the anti-flicker sensor 180M, also known as a flicker sensor, can detect the light frequency in the shooting environment when the electronic device 10 is running a camera application, so that the exposure time of the camera lens 193 is synchronized with the flicker frequency of the light source, thereby reducing flicker or stripe phenomena during the shooting process.

[0214] The above is a detailed description of the embodiments of this application using electronic device 10 as an example. It should be understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on electronic device 10. Electronic device 10 may have more or fewer components than shown in the figures, may combine two or more components, or may have different component configurations. The various components shown in the figures can be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application-specific integrated circuits.

[0215] It should be understood that the above is only an example of the structure of electronic device 10. Electronic device 10 may also include other subsystems or devices, which can be set and modified as needed. This application embodiment does not impose any restrictions on this.

[0216] The hardware system of electronic device 10 has been described in detail above. The software system of electronic device 10 will be introduced below.

[0217] Figure 18 is a schematic diagram of the software system of an electronic device provided in an embodiment of this application.

[0218] As shown in Figure 18, the software system may include an application layer, an application framework layer (FWK), a system runtime layer, a hardware abstraction layer (HAL), and a hardware layer. These will be described in detail below.

[0219] The application layer can include a series of application packages, such as desktop applications, contact applications, calling applications, SMS, gallery, video applications, calendar, camera applications, navigation applications, map applications, Bluetooth, WLAN, email clients, and other applications.

[0220] The application framework layer provides application programming interfaces (APIs) and programming frameworks for applications in the application layer. The application framework layer may include predefined functions, such as functions for receiving events sent by the application framework layer.

[0221] Specifically, the application framework layer may include Views, ContentProviders, Resource Manager, Notification Manager, Activity Manager, Windows Manager, etc.

[0222] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon could include views for displaying text and views for displaying images.

[0223] Content providers enable applications to access data from other applications (such as a contacts database) or share their own data. Content providers store and retrieve data, making that data accessible to applications. This data can include videos, images, audio, made and received phone calls, browsing history and bookmarks, phone books, etc.

[0224] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.

[0225] The notification manager allows applications to display notifications in the status bar. These notifications can be used to deliver informational messages and can disappear automatically after a short pause, requiring no user interaction. For example, the notification manager can be used to notify users of download completion or message alerts. The notification manager can also display notifications as icons or scrolling text in the top status bar, such as notifications from background applications, or as dialog boxes on the screen. Examples include displaying text messages in the status bar, emitting sounds, vibrating electronic devices, and flashing indicator lights.

[0226] The Activity Manager is used to manage the application lifecycle and provides commonly used navigation and back functions.

[0227] The window manager is used to manage windowed applications. It can retrieve screen size, determine the presence of a status bar, lock the screen, and capture screenshots, among other things.

[0228] The system runtime library layer includes program libraries and runtime libraries. For example, in the Android system, program libraries contain C / C++ libraries that can be used by different components within the Android system. They provide services to developers through the Android application framework. The runtime library includes a core library that provides most of the functionality of the Java programming language core library. For example, the system runtime library may include image processing algorithms for images captured by the camera, and anti-flicker algorithms for light source detection using anti-flicker sensors.

[0229] The hardware abstraction layer (HAL) is the interface layer between the hardware layer and the software layer, used to abstract the hardware. For example, a hardware abstraction module (HAB) can include, for instance, audio / video interfaces, voice communication interfaces, and wireless fidelity (WiFi) interfaces.

[0230] For example, in the embodiments of this application, the hardware abstraction module may include an anti-flicker algorithm, namely the functional testing method of the anti-flicker sensor provided in the embodiments of this application.

[0231] The hardware layer can include displays, cameras, sensors, etc., and can also include display drivers, camera drivers, sensor drivers, etc., used to drive the relevant hardware in the hardware layer, such as displays, cameras, sensors, etc.

[0232] It should be noted that the aforementioned electronic device 10 is embodied in the form of a functional module. The term "module" here can be implemented in software and / or hardware, without any specific limitation.

[0233] For example, a "module" can be a software program, a hardware circuit, or a combination of both that implements the above functions. The hardware circuit may include an application-specific integrated circuit (ASIC), electronic circuitry, a processor (e.g., a shared processor, a proprietary processor, or a group processor) and memory for executing one or more software or firmware programs, integrated logic circuitry, and / or other suitable components that support the described functions.

[0234] Therefore, the units of the various examples described in the embodiments of this application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0235] Figure 19 is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. The dashed lines in Figure 19 indicate that the unit or module is optional; the electronic device 10 can be used to implement the functional testing method of the anti-flicker sensor described in the above method embodiments. Exemplarily, the electronic device 10 can be an electronic device with photo and video recording functions that integrates an anti-flicker sensor. For example, smartphones, smart tablets, smart computers, smart security devices, etc.

[0236] The electronic device 10 includes one or more processors 110, which can support the implementation of the control methods in the method embodiments of the electronic device 10. The processor 110 can be a general-purpose processor or a special-purpose processor. For example, the processor 110 can be a central processing unit (CPU), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, such as discrete gates, transistor logic devices, or discrete hardware components.

[0237] Optionally, the processor 110 can be used to control the electronic device 10, execute software programs, and process data from the software programs. The electronic device 10 may also include a communication unit 905 for inputting (receiving) and outputting (transmitting) signals.

[0238] For example, electronic device 10 may be a chip, communication unit 905 may be the input and / or output circuit of the chip, or communication unit 905 may be the communication interface of the chip, and the chip may be a component of electronic device or other electronic device.

[0239] For example, electronic device 10 can be an electronic device, and communication unit 905 can be a transceiver of electronic device 10. Alternatively, communication unit 905 can include one or more memories 902, which store program 904. Program 904 can be executed by processor 110 to generate instructions 903, causing processor 110 to execute the anti-flicker sensor functional test method described in the above method embodiment according to instructions 903.

[0240] Optionally, the memory 902 may also store data.

[0241] Optionally, the processor 110 can also read data stored in the memory 902, which may be stored at the same memory address as the program 904, or the data may be stored at a different memory address than the program 904.

[0242] Alternatively, the processor 110 and memory 902 can be configured separately or integrated together, for example, integrated on a system-on-chip (SOC) of an electronic device.

[0243] For example, the memory 902 can be used to store the relevant program 904 of the anti-flicker sensor functional test method provided in the embodiments of this application, and the processor 110 can be used to call the relevant program 904 of the anti-flicker sensor functional test method stored in the memory 902 when executing the anti-flicker sensor functional test method, and execute the anti-flicker sensor functional test method of the embodiments of this application.

[0244] Optionally, this application also provides a computer program product that, when executed by processor 110, implements the functional testing method for the anti-flicker sensor in any method embodiment of this application.

[0245] For example, the computer program product can be stored in memory 902, such as program 904. Program 904 is eventually converted into an executable object file that can be executed by processor 110 after processing such as preprocessing, compilation, assembly and linking.

[0246] Optionally, this application also provides a chip system applied to an electronic device 10. The chip system includes one or more processors, which are used to invoke computer instructions to cause the electronic device 10 to perform a functional test method for an anti-flicker sensor.

[0247] Optionally, this application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a computer, implements the functional testing method for the anti-flicker sensor described in any of the method embodiments of this application. The computer program may be a high-level language program or an executable object program.

[0248] For example, the computer-readable storage medium is, for instance, memory 902. Memory 902 can be volatile memory or non-volatile memory, or memory 902 can include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).

[0249] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0250] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0251] The beneficial effects that the electronic device provided in the above-described embodiments of this application can achieve can be referred to the beneficial effects corresponding to the modules provided above, and will not be repeated here.

[0252] It should be understood that the above description is merely to help those skilled in the art better understand the embodiments of this application, and is not intended to limit the scope of the embodiments of this application. Based on the examples given above, those skilled in the art can obviously make various equivalent modifications or changes. For example, some steps in the various embodiments of the above detection method may be unnecessary, or new steps may be added. Alternatively, any combination of two or more of the above embodiments may be used. Such modifications, changes, or combinations also fall within the scope of the embodiments of this application. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.

[0253] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0254] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0255] It should also be understood that the above description of the embodiments of this application focuses on highlighting the differences between the various embodiments. Any similarities or differences not mentioned can be referred to each other. For the sake of brevity, they will not be repeated here.

[0256] It should also be understood that, in the various embodiments of this application, the sequence number of each process does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0257] It should also be understood that in the embodiments of this application, "pre-setting" or "pre-defining" can be achieved by pre-saving the corresponding code, table or other means that can be used to indicate relevant information in the device (e.g., including electronic devices), and this application does not limit the specific implementation method.

[0258] It should also be understood that the methods, situations, categories, and classifications of embodiments in this application are for the convenience of description only and should not constitute a special limitation. Various methods, categories, situations, and features in embodiments can be combined without contradiction.

[0259] It should also be understood that, in the various embodiments of this application, unless otherwise specified or in case of logical conflict, the terms and / or descriptions between different embodiments are consistent and can be referenced by each other, and the technical features in different embodiments can be combined to form new embodiments according to their inherent logical relationships.

[0260] Finally, it should be noted that the above descriptions are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of protection of the claims. In conclusion, the above descriptions are merely preferred embodiments of the technical solutions of this application and are not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. A functional testing method for an anti-flicker sensor, characterized in that, include: Control the anti-flicker sensor to acquire light intensity; The illumination frequency and illumination amplitude are obtained based on the illumination intensity; When the light frequency meets the light frequency threshold range and the light amplitude meets the light amplitude threshold range, it is determined that the anti-flicker sensor can correctly detect the light frequency.

2. The functional testing method for the anti-flicker sensor as described in claim 1, characterized in that, The step of obtaining the illumination frequency and illumination amplitude based on the illumination intensity includes: performing analog-to-digital conversion on the illumination intensity to obtain a digital illumination intensity signal; and performing Fourier transform on the digital illumination intensity signal to obtain the illumination frequency.

3. The functional testing method for the anti-flicker sensor as described in claim 1 or 2, characterized in that, Also includes: The illumination frequency is divided into multiple sub-interval frequencies; The frequencies of the multiple sub-intervals are compared with the light frequency threshold range respectively; the parallel detection results of the multiple sub-interval frequencies are integrated to determine whether the light frequency meets the light frequency threshold range.

4. The functional testing method for the anti-flicker sensor as described in any one of claims 1-3, characterized in that, The step of obtaining the illumination frequency and illumination amplitude based on the illumination intensity includes: performing analog-to-digital conversion on the illumination intensity to obtain a digital illumination intensity signal; performing a Fourier transform on the time domain of the digital illumination intensity signal to obtain a complex array; and calculating the modulus of the complex array to obtain the illumination amplitude.

5. The functional testing method for the anti-flicker sensor as described in claim 4, characterized in that, Before performing a Fourier transform on the time domain of the digital light intensity signal to obtain a complex array, the method further includes: performing fixed-point processing on the time domain of the digital light intensity signal; the fixed-point processing refers to defining the decimal point position of the digital light intensity signal in the time domain.

6. The functional testing method for the anti-flicker sensor as described in claim 5, characterized in that, The fixed-point bit width of the fixed-point processing is 32 bits.

7. An electronic device, characterized in that, The electronic device includes: one or more processors, and a memory; the memory is coupled to the one or more processors, the memory being used to store computer program code, the computer program code including computer instructions, and the one or more processors invoking the computer instructions to cause the electronic device to perform the method as described in any one of claims 1-6.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes instructions that, when executed on an electronic device, cause the electronic device to perform the method as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Semiconductor device and electronic device provided with same

    CN101919077A

  • Detection circuit, detection device and method for stroboflash of light source, and photoelectric detection equipment

    CN109540479A