Sensor clock calibration method, device, storage medium and electronic device

By using the TE signal of the display screen to calibrate the sensor, the problem of insufficient clock accuracy of the sensor is solved, the accuracy of clock frequency is improved, the cost is reduced, and the accuracy of signal acquisition and data processing is enhanced.

CN115202183BActive Publication Date: 2025-01-17GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210860444.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-21
Publication Date
2025-01-17
Estimated Expiration
2042-07-21

AI Technical Summary

Technical Problem

The sensor's clock accuracy is limited, resulting in errors in output, affecting the accuracy of signal acquisition and data processing.

Method used

By using the TE signal of the display screen to obtain the clock count value of the sensor within a certain time interval, and calibrate the clock of the sensor based on the time interval of the count value and the time interval, the accuracy of the clock frequency is improved.

Benefits of technology

Improve the clock accuracy of the sensor, reduce costs, avoid the need to set an external clock, and enhance the accuracy of signal acquisition and data processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115202183B_ABST
    Figure CN115202183B_ABST
Patent Text Reader

Abstract

The present disclosure provides a sensor clock calibration method, device, computer-readable storage medium and electronic device, and relates to the field of computer technology. The sensor clock calibration method comprises: obtaining a first clock count value of the sensor to be calibrated within a first reference time interval of a TE signal of a display screen; and calibrating the clock of the sensor to be calibrated according to the first clock count value and the duration of the first reference time interval. The present disclosure improves the clock accuracy of the sensor.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a clock calibration method for a sensor, a clock calibration device for a sensor, a computer-readable storage medium, and an electronic device. Background Art

[0002] With the development of electronic technology, most electronic devices are equipped with various types of sensors. For example, mobile phones are generally equipped with ambient light sensors, fingerprint sensors, inertial sensors, temperature sensors, etc. Sensors are usually equipped with a matching MCU (Micro-Controller Unit) to execute the program instructions of the sensor to achieve control of signal acquisition, data processing and other processes.

[0003] In order for the MCU to work properly, the sensor also needs to provide a clock signal through an oscillator. However, due to the limited clock accuracy of the sensor, it is easy to cause errors in the sensor output.

[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to those skilled in the art. Summary of the invention

[0005] The present disclosure provides a clock calibration method for a sensor, a clock calibration device for a sensor, a computer-readable storage medium and an electronic device, so as to improve the clock accuracy of the sensor at least to a certain extent.

[0006] According to a first aspect of the present disclosure, a method for calibrating a clock of a sensor is provided, comprising: obtaining a first clock count value of a sensor to be calibrated within a first reference time interval of a TE signal of a display screen; and calibrating the clock of the sensor to be calibrated according to the first clock count value and the length of the first reference time interval.

[0007] According to a second aspect of the present disclosure, a clock calibration device for a sensor is provided, comprising: a clock count value acquisition module, configured to acquire a first clock count value of a sensor to be calibrated within a first reference time interval of a TE signal of a display screen; and a clock calibration module, configured to calibrate the clock of the sensor to be calibrated according to the first clock count value and the length of the first reference time interval.

[0008] According to a third aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the clock calibration method of the sensor according to the first aspect and possible implementation methods thereof are implemented.

[0009] According to a fourth aspect of the present disclosure, an electronic device is provided, comprising: a processor; a memory for storing executable instructions of the processor; and a sensor to be calibrated; wherein the processor is configured to execute the clock calibration method of the sensor of the first aspect and its possible implementation method by executing the executable instructions.

[0010] The technical solution disclosed in this disclosure has the following beneficial effects:

[0011] On the one hand, the clock of the sensor to be calibrated is counted based on the first basic time interval of the TE signal of the display screen. The clock accuracy of the TE signal of the display screen is usually very high. The clock frequency of the sensor to be calibrated is calculated so that the accuracy of the clock frequency is close to the clock accuracy of the TE signal, thereby improving the clock accuracy of the sensor to be calibrated. On the other hand, this solution uses the TE signal of the display screen to calibrate the clock of the sensor to be calibrated, and there is no need to set an external clock, so the implementation cost is low.

[0012] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and are used together with the specification to explain the principles of the present disclosure. Obviously, the drawings described below are only some embodiments of the present disclosure, and for those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0014] Figure 1 A schematic diagram showing the structure of an electronic device in this exemplary embodiment is shown;

[0015] Figure 2 A schematic diagram showing an under-screen light sensor in this exemplary embodiment;

[0016] Figure 3 A flowchart showing a clock calibration method for a sensor in this exemplary embodiment is shown;

[0017] Figure 4 A schematic diagram showing the TE signal of the display screen and the clock signal of the sensor to be calibrated in this exemplary embodiment;

[0018] Figure 5 A flowchart showing the duration of the first reference time interval in this exemplary embodiment is shown;

[0019] Figure 6 A schematic flow chart showing a clock calibration method for a sensor in this exemplary embodiment;

[0020] Figure 7 A schematic diagram showing the sampling time of the light sensor in this exemplary embodiment;

[0021] Figure 8 A schematic structural diagram of a clock calibration device for a sensor in this exemplary embodiment is shown. DETAILED DESCRIPTION

[0022] Exemplary embodiments of the present disclosure will now be described with reference to the accompanying drawings. However, the exemplary embodiments can be implemented in various forms and should not be construed as being limited to the examples set forth herein. These embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concept of the exemplary embodiments will be fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, the known technical solutions are not shown or described in detail to avoid obscuring the various aspects of the present disclosure.

[0023] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.

[0024] The clock signal of the sensor is usually provided by an RC (resistance-capacitance) oscillator. The accuracy of the resistor and capacitor is limited, and the RC oscillator is easily affected by changes in temperature and humidity. These factors cause the frequency (or period) of the clock signal to have an error of more than 5%, which causes the accuracy of the sensor output to decrease.

[0025] In view of the above problems, an exemplary embodiment of the present disclosure provides a sensor clock calibration method for calibrating the clock of a sensor to be calibrated. The sensor to be calibrated can be set on an electronic device, so the sensor clock calibration method in this exemplary embodiment can be performed by the electronic device. The electronic device is described below.

[0026] An exemplary embodiment of the present disclosure provides an electronic device. Generally, the electronic device may include: a processor, a memory, and a sensor to be calibrated. The memory is used to store executable instructions of the processor; the processor is configured to execute a sensor clock calibration method by executing the executable instructions to calibrate the clock of the sensor to be calibrated.

[0027] In one embodiment, the electronic device may further include a display screen, and a connection line for transmitting a TE signal (Tearing Effect Signal, display refresh signal) is provided between the display screen and the sensor to be calibrated. Thus, the sensor to be calibrated can directly obtain the TE signal through the connection line to perform clock calibration, which can reduce the delay of the TE signal being transmitted from the display screen to the sensor to be calibrated, and improve the calibration accuracy.

[0028] In one implementation, the TE signal of the display screen may also be transmitted to the sensor to be calibrated via a processor or a bus.

[0029] Below Figure 1 Taking the mobile terminal 100 in FIG. 1 as an example, the structure of the electronic device is exemplarily described. It should be understood by those skilled in the art that, in addition to the components specifically used for mobile purposes, Figure 1 The construction in can also be applied to fixed type equipment.

[0030] like Figure 1 As shown, the mobile terminal 100 may specifically include: a main processor 101 , a memory 102 , a bus 103 , a display screen 104 and a sensor to be calibrated 105 .

[0031] The main processor 101 is used to perform the main logic processing of the mobile terminal 100, for example, it can run the operating system and application programs of the mobile terminal 100. The main processor 101 may include one or more processing units, for example: the main processor 101 may include a CPU (Central Processing Unit), an AP (Application Processor), a modem processor, a GPU (Graphics Processing Unit), an ISP (Image Signal Processor), a controller, an encoder, a decoder, a DSP (Digital Signal Processor), a baseband processor and / or an NPU (Neural-Network Processing Unit), etc.

[0032] The memory 102 may be used to store computer executable program codes, which may include instructions. The main processor 101 executes various functional applications and data processing of the mobile terminal 100 by running the instructions stored in the memory 102. The memory 102 may also store application data, such as images, audio, video and other files.

[0033] The display screen 104 is used to implement the display function of the mobile terminal 100, and can display corresponding screens, such as user interfaces, images, videos, etc., according to the display data output to the display screen 104 by the main processor 101. The display screen 104 may include a display panel 1041 and a display driver 1042. The display panel 1041 may be LCD (Liquid Crystal Display), OLED (Organic Light Emitting Diode), AMOLED (Active-Matrix Organic Light Emitting Diode), QLED (Quantum dot Light Emitting Diodes), etc. The display driver 1042 may include a driving circuit that controls the timing action of the display screen 104, and is used to drive the display panel 1041 to display a screen.

[0034] In this exemplary embodiment, the display screen 104 can refresh the display content based on the TE (Tearing Effect Signal, display refresh signal) signal. If the clock accuracy of the TE signal is low, it may cause abnormal display images and affect the user experience. Therefore, in order to ensure that the TE signal has a high clock accuracy, a high-precision crystal oscillator can be used inside the display screen 104 to generate a clock signal, and its error is usually on the order of 10ppm (i.e., 0.001%).

[0035] The sensor to be calibrated 105 may be any sensor of the mobile terminal 100, such as an ambient light sensor, a fingerprint sensor, an inertial sensor, a temperature sensor, etc. The sensor to be calibrated 105 may include a microcontroller unit 1051 for executing program instructions of the sensor to be calibrated 105 to control processes such as signal acquisition and data processing.

[0036] The components of the mobile terminal 100 may be connected to each other through the bus 103 and the I / O interface. For example, the main processor 101 and the display screen 104 may be connected through a DSI (Display Serial Interface), and the main processor 101 and the sensor to be calibrated 105 may be connected through an I2C (Inter-Integrated Circuit) bus interface or a GPIO (General-Purpose Input / Output) interface.

[0037] It should be understood that the mobile terminal 100 may also include Figure 1 Components not shown in the figure, such as a communication unit, a camera unit, a power management unit, an audio unit, etc. Any one or more of the main processor 101, the memory 102, the display screen 104, and the sensor to be calibrated 105 may also include Figure 1 For example, the display screen 104 may further include a display processor, which may be an MCU or a TCON (Timing Controller, also known as a logic board) built into the display screen 104; the sensor to be calibrated 105 may further include an oscillator for generating a clock signal, such as an RC oscillator, an LC oscillator, etc., which may also be built into the micro control unit 1051.

[0038] In one embodiment, a connection line for transmitting TE signals may be provided between the display screen 104 and the sensor to be calibrated 105. For example, the display driver 1042 may be connected to a sensing pin of the sensor to be calibrated 105, so that the microcontroller unit 1051 may obtain the TE signal output by the display driver 1042.

[0039] In one implementation, the mobile terminal 100 may not include the display screen 104 , and may be connected to an external display screen to obtain a TE signal of the external display screen for clock calibration of the sensor to be calibrated 105 .

[0040] In one implementation, the sensor to be calibrated 105 may be disposed under the display screen 104 , for example, the sensor to be calibrated 105 may be an under-screen light sensor, an under-screen fingerprint sensor, etc. This is beneficial to improving the screen-to-body ratio of the mobile terminal 100 .

[0041] Figure 2 The schematic diagram of the under-screen optical sensor is shown, which can be an under-screen optical sensor on a mobile phone, tablet computer and other devices. Setting the under-screen optical sensor under the display can save space on the front of the mobile phone, increase the screen-to-body ratio, and even realize a full-screen display. Figure 2As shown, the under-screen optical sensor can be installed on the main board of the mobile phone, and the frame, foam and display panel are arranged above it. The main board can be a PCB (Printed Circuit Board), which is usually equipped with a main processor, memory and other components. Figure 2 The frame shown may be the middle frame of a mobile phone, used to connect the front and back parts of the mobile phone. The foam can play a role in shock absorption and buffering, and is used to protect the display panel and other components. In the frame and the foam, an opening may be provided just above the under-screen light sensor, and the display panel is usually a transparent material, so that light can pass through the display panel and be incident on the under-screen light sensor, so that the under-screen light sensor senses the light signal. The accuracy of the under-screen light sensor may be improved by the clock calibration method of the sensor in this exemplary embodiment.

[0042] The under-screen light sensor may include but is not limited to: an ambient light sensor, a color temperature sensor, a spectrum sensor, etc.

[0043] In this exemplary embodiment, the sensor clock calibration method may be executed by the main processor 101 or the micro control unit 1051 of the mobile terminal 100. Figure 3 The following describes a method for calibrating the sensor clock.

[0044] Figure 3 An exemplary process of a sensor clock calibration method is shown, which may include the following steps S310 to S320:

[0045] Step S310, obtaining a first clock count value of the sensor to be calibrated within a first reference time interval of the TE signal of the display screen;

[0046] Step S320: calibrate the clock of the sensor to be calibrated according to the first clock count value and the duration of the first reference time interval.

[0047] Based on the above method, on the one hand, the clock of the sensor to be calibrated is counted based on the first basic time interval of the TE signal of the display screen. The clock accuracy of the TE signal of the display screen is usually very high. The clock frequency of the sensor to be calibrated is calculated so that the accuracy of the clock frequency is close to the clock accuracy of the TE signal, thereby improving the clock accuracy of the sensor to be calibrated. On the other hand, this solution uses the TE signal of the display screen to calibrate the clock of the sensor to be calibrated, and there is no need to set an external clock, so the implementation cost is low.

[0048] Below Figure 3 Each step in the procedure is described in detail.

[0049] refer to Figure 3In step S310, a first clock count value of the sensor to be calibrated is obtained within a first reference time interval of the TE signal of the display screen.

[0050] The TE signal is a periodic signal. The first reference time interval is used to provide a reference duration for the clock count of the sensor to be calibrated. Since the clock accuracy of the TE signal is very high, a time interval is determined based on the TE signal, and the accuracy of the time interval is also very high, so it can be used as the first reference time interval. Any perceptible time interval of the TE signal can be used as the first reference time interval, that is, the starting time point and the ending time point of the first reference time interval can be any time point when the TE signal changes. Exemplarily, any integer number of cycles in the TE signal can be used as the first reference time interval, and a high-level time period or a low-level time period within a cycle of the TE signal can be used as the first reference time interval, and so on.

[0051] In the first reference time interval, the counter inside the sensor to be calibrated can count based on the clock signal of the sensor to be calibrated, and the count value is increased by one after each cycle. When the first reference time interval ends, a first clock count value is obtained.

[0052] In one embodiment, the first reference time interval may include: the time interval between two adjacent rising edges of the TE signal, or the time interval between two adjacent falling edges of the TE signal. The time interval between two adjacent rising edges or falling edges is a complete cycle. By determining the start and end of the first reference time interval by the rising edge or falling edge, the sensor to be calibrated can start counting or stop counting when the rising edge or falling edge is detected, which is conducive to accurate counting.

[0053] Figure 4 The schematic diagram of the TE signal of the display screen and the clock signal of the sensor to be calibrated is shown. Assuming that the frequency fte of the TE signal is 60Hz, the time interval between two adjacent rising edges or two adjacent falling edges is a first reference time interval t1, and its duration is 16.667ms. Taking the falling edge as an example, when the sensor to be calibrated detects the falling edge of the TE signal, or more specifically, when the microcontroller unit in the sensor to be calibrated detects the falling edge of the TE signal, the counter starts counting. The frequency of the counter is equal to the clock frequency f0 of the sensor to be calibrated. If the sensor to be calibrated uses an RC oscillator, the RC clock frequency is generally 500KHz to 2MHz. When the sensor to be calibrated detects the next falling edge of the TE signal, or more specifically, when the microcontroller unit in the sensor to be calibrated detects the next falling edge of the TE signal, the counter stops counting, and the data of the counter at this time is recorded as the first clock count value C1.

[0054] Continue to refer Figure 3In step S320, the clock of the sensor to be calibrated is calibrated according to the first clock count value and the duration of the first reference time interval.

[0055] According to the first clock count value and the length of the first reference time interval, the clock parameter of the sensor to be calibrated can be calculated. In this exemplary embodiment, the clock parameter of the sensor to be calibrated may include a clock frequency or a clock period, both of which are essentially the interval of the clock signal, and it is easy to calculate the other when one of them is obtained. The clock frequency is used as an example for explanation in this article.

[0056] In one implementation, the clock frequency of the sensor to be calibrated may be calculated with reference to the following formula:

[0057] f0=C1 / t1 (1)

[0058] Among them, f0 represents the clock frequency of the sensor to be calibrated, which is the actual clock frequency of the sensor to be calibrated, C1 represents the first clock count value, and t1 represents the duration of the first reference time interval. Therefore, the clock frequency of the sensor to be calibrated is calculated based on the duration of the first reference time interval of the TE signal. The accuracy of this clock frequency is close to the clock accuracy of the TE signal. Compared with the clock frequency set by the sensor to be calibrated, it can more accurately reflect the actual situation of the clock signal of the sensor to be calibrated.

[0059] In one implementation, the calculated clock frequency of the sensor to be calibrated may be used as a clock calibration result, and there is no need to perform clock adjustment on the sensor to be calibrated.

[0060] In one embodiment, the clock of the sensor to be calibrated may be adjusted according to the calculated clock frequency of the sensor to be calibrated. For example, when the clock frequency deviates from the expected frequency value or frequency range, the oscillator inside the sensor to be calibrated may be adjusted accordingly, such as adjusting the resistance or capacitance value of the RC oscillator to change the clock frequency, and after the adjustment, the clock frequency of the sensor to be calibrated is determined again through steps S310 and S320 until it is equal to the expected frequency value or is within the expected frequency range.

[0061] Thus, the clock of the sensor to be calibrated is calibrated, so that the clock accuracy of the sensor to be calibrated is close to the clock accuracy of the TE signal of the display screen, thereby improving the clock accuracy of the sensor to be calibrated.

[0062] Based on step S320, it can be known that in order to calculate the clock frequency of the sensor to be calibrated for clock calibration, two parameters need to be obtained: the first clock count value and the duration of the first reference time interval. The following is a further description of these two parameters:

[0063] (I) First clock count value

[0064] In step S310, the clock signal of the sensor to be calibrated can be timed within the first reference time interval to obtain a first clock count value. However, the first clock count value may have an error. For example, there is jitter when the sensor to be calibrated detects the rising edge or falling edge of the TE signal, resulting in the interval of the actual count of the sensor to be calibrated not being completely equal to the first reference time interval, resulting in an error in the first clock count value. Taking this into account, in one embodiment, obtaining the first clock count value of the sensor to be calibrated within the first reference time interval of the TE signal of the display screen may include the following steps:

[0065] The first clock count values ​​of the sensor to be calibrated within a plurality of first reference time intervals are respectively obtained.

[0066] For example, the clock count of the sensor to be calibrated may be performed in m consecutive first reference time intervals respectively to obtain m first clock count values, where m is a positive integer not less than 2.

[0067] Accordingly, the calibrating the clock of the sensor to be calibrated according to the first clock count value and the duration of the first reference time interval may include the following steps:

[0068] The clock of the sensor to be calibrated is calibrated according to the first clock count values ​​in the plurality of first reference time intervals and the duration of the first reference time intervals.

[0069] Specifically, based on the above-mentioned m first clock count values, their average value, median value, mode and other statistical indicators can be used to calculate the clock frequency of the sensor to be calibrated, or outliers or abnormal fluctuation values ​​can be eliminated from the m first clock count values, and the average value, median value, mode and the like of the retained first clock count values ​​are statistically analyzed to calculate the clock frequency of the sensor to be calibrated.

[0070] In one embodiment, the clock of the sensor to be calibrated may be calibrated according to the average value of the first clock count values ​​in the multiple first reference time intervals and the duration of the first reference time intervals. For example, in formula (1), C1 may be replaced by the average value C1_mean of the first clock count values ​​in the multiple first reference time intervals, that is, the clock frequency f0 of the sensor to be calibrated = C1_mean / t1.

[0071] Therefore, by calculating the clock frequency according to the first clock count values ​​in multiple first reference time intervals, the influence of the error of the first clock count value in a single first reference time interval on the clock calibration can be reduced, thereby improving the accuracy of the clock calibration result.

[0072] In one implementation, when first clock count values ​​of the sensor to be calibrated are respectively obtained within a plurality of first reference time intervals, the sensor clock calibration method may further include the following steps:

[0073] If the first clock count values ​​within the plurality of first reference time intervals meet the stability condition, retaining the first clock count values ​​within the plurality of first reference time intervals;

[0074] If the first clock count values ​​within a plurality of first reference time intervals do not satisfy the stability condition, the first clock count values ​​within the plurality of first reference time intervals are discarded.

[0075] The stability condition is used to measure whether the first clock count values ​​within a plurality of first reference time intervals are stable, and can be specifically set according to actual needs.

[0076] In one implementation, whether the first clock count value satisfies the stability condition may be determined in the following manner:

[0077] The numerical stability interval is calculated according to the first clock count values ​​in multiple first reference time intervals. For example, the numerical stability interval can be C0_mean±E, where C0_mean represents the average value of the first clock count values ​​in multiple first reference time intervals, and can of course be replaced by the median, mode, etc. E represents the allowable error rate, such as 1%, 0.5%, etc. If the proportion of the first clock count values ​​in multiple first reference time intervals that are within the numerical stability interval reaches a preset proportion, it is determined that the first clock count value meets the stability condition. The preset proportion can be set according to actual conditions, such as 100%, 90%, etc. Exemplarily, E is 1%. If the preset proportion is 100%, then when the first clock count values ​​in multiple first reference time intervals are all within C0_mean±1%, it is determined that the first clock count value meets the stability condition.

[0078] If the first clock count values ​​within the above-mentioned multiple first reference time intervals meet the stability condition, the multiple first clock count values ​​can be retained, and then, according to the average value of the multiple first clock count values ​​and the duration of the first reference time interval, the clock of the sensor to be calibrated is calibrated, so as to ensure the accuracy of the clock calibration. If the first clock count values ​​within the above-mentioned multiple first reference time intervals do not meet the stability condition, it can be considered that the first clock count value has detection fluctuations and is not reliable, so it can be discarded and the first clock count value can be re-collected. Therefore, the first clock count values ​​are screened using the stability condition to retain the first clock count values ​​that are relatively stable within multiple first reference time intervals, which can reduce the impact of fluctuations and errors in the detection process on the clock calibration.

[0079] In one implementation, after obtaining the first clock count value in each first reference time interval, it is also possible to determine whether the first clock count value meets the stability condition. If so, the first clock count value is retained for subsequent calculations. If not, the first clock count value is discarded and the first clock count value in the next first reference time interval is collected. The stability condition for the first clock count value in a single first reference time interval may include: the first clock count value is within a numerical stability interval, and the numerical stability interval may be, for example, the average value, median value, mode, etc. ± error rate of the first clock count values ​​in the previous multiple first reference time intervals.

[0080] (II) Duration of the first benchmark time interval

[0081] In one embodiment, the duration of the first reference time interval may be a known parameter. For example, the frequency of the TE signal is fixed to a reference frequency, such as 60 Hz, and the duration of the first reference time interval may be determined according to the reference frequency, such as t1 = 1 s / 60 Hz = 16.667 ms.

[0082] In one embodiment, reference Figure 5 As shown, the duration of the first reference time interval may be determined by following the steps S510 and S520:

[0083] Step S510: determining the actual frequency of the TE signal according to the first clock count value and the reference clock parameter of the sensor to be calibrated.

[0084] The reference clock parameters of the sensor to be calibrated may be set clock parameters, theoretical clock parameters or pre-calibrated clock parameters, and may include reference clock frequency and reference clock period. As the use environment of the sensor to be calibrated changes and the internal signal fluctuates, the actual clock parameters may easily deviate from the reference clock parameters. Therefore, the reference clock parameters may only be used as a theoretical reference to calculate the actual clock parameters. The actual clock parameters are the clock parameters determined by step S320.

[0085] According to the first clock count value and the reference clock parameter of the sensor to be calibrated, the actual frequency of the TE signal can be calculated, referring to the following formula:

[0086] fte≈fref / C1 (2)

[0087] Wherein, fte represents the actual frequency of the TE signal of the display screen, fref represents the reference clock frequency of the sensor to be calibrated, and C1 represents the first clock count value. Since the probability of deviation between the reference clock frequency and the actual frequency is high, the value in formula (2) is "≈".

[0088] In one embodiment, the actual frequency of the TE signal may be an integer multiple of a certain base frequency (such as 30 Hz, 24 Hz, etc.). Therefore, after calculating fref / C1, the calculated value is mapped to the nearest integer multiple of the base frequency to obtain the actual frequency of the TE signal.

[0089] In one embodiment, the clock accuracy of the TE signal of the display screen is relatively high, and the frequency of the TE signal will not fluctuate significantly. If it changes, it usually changes dynamically among multiple preset frequencies. For example, the refresh rates of current mobile phone displays are 60Hz, 90Hz, 120Hz, etc. The mobile phone can dynamically adjust the refresh rate among 60Hz, 90Hz, and 120Hz according to the current usage scenario, which means that the frequency of the TE signal will change dynamically among the preset frequencies of 60Hz, 90Hz, and 120Hz. Taking into account the dynamic changes in the frequency of the TE signal, in step S310, when the frequency of the TE signal can change dynamically among multiple preset frequencies, the first clock count value of the sensor to be calibrated within the first reference time interval of the TE signal is obtained. Accordingly, step S510 may further include the following steps:

[0090] Determine a current frequency reference value of the TE signal according to the first clock count value and a reference clock parameter of the sensor to be calibrated;

[0091] The actual frequency of the TE signal is determined by comparing the current frequency reference value of the TE signal with a plurality of preset frequencies.

[0092] The current frequency reference value of the TE signal is the result of direct calculation of the first clock count value and the reference clock parameter of the sensor to be calibrated, such as fref / C1. The current frequency reference value of the TE signal is compared with multiple preset frequencies, such as fref / C1 with 60Hz, 90Hz, and 120Hz, to determine the actual frequency of the TE signal.

[0093] In one implementation, the preset frequency that is closest to the current frequency reference value of the TE signal may be used as the actual frequency of the TE signal.

[0094] In one embodiment, the current frequency reference value of the TE signal can be compared to see whether it falls within a preset frequency error interval. For example, the error interval can be ±5% of the preset frequency (or other error rate values). If it falls within the error interval, the preset frequency is determined to be the actual frequency of the TE signal.

[0095] Therefore, when the frequency of the TE signal changes dynamically among multiple preset frequencies, the actual frequency of the TE signal can be calculated based on the first clock count value and the reference clock parameter of the sensor to be calibrated, and then the relevant underlying code (such as the code of the driver layer) of the sensor to be calibrated is updated in real time, without obtaining the setting information of the display screen from the upper layer of the system to determine the actual frequency of the TE signal. For example, when the MCU inside the sensor to be calibrated obtains the first clock count value, it can quickly determine the actual frequency of the TE signal by executing step S510, and perform subsequent calculations and calibrations, without communicating with the main processor to obtain the actual frequency of the TE signal, thereby reducing communication delay and load consumption.

[0096] Step S520: Determine the duration of the first reference time interval according to the actual frequency of the TE signal.

[0097] The actual frequency of the TE signal can be converted into the duration of the first reference time interval. For example, if the first reference time interval is a complete cycle of the TE signal, the actual cycle duration can be calculated according to the actual frequency of the TE signal, which is the duration of the first reference time interval.

[0098] The above describes how to obtain the first clock count value and the duration of the first reference time interval. When these two parameters are obtained, the clock calibration of the sensor to be calibrated can be completed in step S320.

[0099] In one implementation, steps S310 and S320 may be a process of pre-calibrating the clock of the sensor to be calibrated, or may be a process of dynamically calibrating the clock of the sensor to be calibrated.

[0100] Among them, pre-calibration can be calibration before actual use, for example, it can be calibration performed before the electronic device or the sensor to be calibrated leaves the factory. Dynamic calibration can be calibration in actual use. During actual use, with the change of the use environment and the fluctuation of the internal signal of the sensor to be calibrated, the clock frequency of the sensor to be calibrated will usually change or fluctuate. For example, when the mobile phone is used for a long time and the internal temperature rises, the clock signal output by the RC oscillator will fluctuate. And the frequency of the TE signal can also change dynamically among multiple preset frequencies. Therefore, by performing real-time or periodic clock calibration on the sensor to be calibrated through steps S310 and S320, the error of the clock signal of the sensor to be calibrated can be prevented from increasing continuously with the accumulation of use time, and at the same time, the clock of the sensor to be calibrated can be adapted to the dynamic changes of other components such as the display screen to determine the appropriate clock frequency.

[0101] In one implementation, if steps S310 and S320 are a dynamic calibration process, the sensor clock calibration method may further include a pre-calibration process, and the pre-calibration process may include the following steps:

[0102] When the frequency of the TE signal is fixed to the reference frequency, obtaining a second clock count value of the sensor to be calibrated within a second reference time interval of the TE signal;

[0103] The clock of the sensor to be calibrated is calibrated according to the second clock count value and the duration of the second reference time interval to obtain a reference clock parameter of the sensor to be calibrated.

[0104] Among them, the reference frequency can be a known fixed frequency, such as one of the above-mentioned multiple preset frequencies, and of course it can also be a frequency other than the preset frequency. For example, the reference frequency can be 60Hz. Before the mobile phone leaves the factory, the manufacturer can use a reference frequency of 60Hz to pre-calibrate the clock of the sensor to be calibrated. The second reference time interval is used to provide a reference duration for the clock count of the sensor to be calibrated in the pre-calibration, which can be any perceptible time interval of the TE signal at the reference frequency, such as any integer number of cycles in the TE signal, or a high level time period or a low level time period within a cycle, and so on. The second reference time interval can be the same as the first reference time interval, or it can be different. For example, both are the time interval between two adjacent rising edges or the time interval between two adjacent falling edges in the TE signal. According to the reference frequency of the TE signal, the duration of the second reference time interval can be determined. The second clock count value is the clock count value of the sensor to be calibrated in the second reference time interval.

[0105] According to the second clock count value and the duration of the second reference time interval, the clock parameters of the sensor to be calibrated in the pre-calibration stage can be calculated. In one embodiment, the clock parameters of the pre-calibration stage can be used as reference clock parameters of the sensor to be calibrated. In one embodiment, the clock of the sensor to be calibrated can also be adjusted according to the clock parameters of the pre-calibration stage, and the clock adjustment in step S320 can be specifically referred to. The adjusted clock parameters are reference clock parameters. In the subsequent dynamic calibration stage, the actual frequency of the TE signal can be calculated with reference to the reference clock parameters.

[0106] It should be understood that in this exemplary embodiment, the difference between the first reference time interval, the first clock count value and the second reference time interval, the second clock count value is mainly that the former is used for the dynamic calibration process and the latter is used for the pre-calibration process. The parameters themselves have the same meaning and the parameter values ​​may also be the same.

[0107] The dual calibration process based on pre-calibration plus dynamic calibration can ensure that the sensor to be calibrated has high clock accuracy before actual use (such as when leaving the factory) and maintains high clock accuracy during actual use.

[0108] Figure 6 The schematic flow of the sensor clock calibration method in this exemplary embodiment is shown, and the flow includes two parts: pre-calibration and dynamic calibration. The pre-calibration flow includes:

[0109] Step S601, fixing the frequency of the TE signal to a reference frequency, such as 60 Hz, and determining the duration t2 of the second reference time interval;

[0110] Step S602, the sensor to be calibrated detects the first falling edge of the TE signal and starts counting;

[0111] Step S603, the sensor to be calibrated detects the next falling edge, stops counting, records the second clock count value C2, and restarts counting;

[0112] Step S604, determining whether the count reaches n times, that is, whether n second clock count values ​​C2 are recorded in n consecutive second reference time intervals, if yes, executing step S605, if no, jumping to step S603; n is a positive integer not less than 2, such as 10;

[0113] Step S605, calculating an average value C2_mean for n second clock count values ​​C2;

[0114] Step S606, calculating the reference clock frequency of the sensor to be calibrated according to the average value of the second clock count value and the duration of the second reference time interval, the calculation formula is fref=C2_mean / t2;

[0115] Step S607 , configuring clock signal-related parameters such as integration time and delay time of the sensor to be calibrated according to the reference clock frequency.

[0116] The dynamic calibration process includes:

[0117] Step S608, when the frequency of the TE signal changes dynamically, monitor the falling edge of the TE signal in real time to count within the first reference time interval and read the first clock count value C1. The TE signal generally changes dynamically among a plurality of preset frequencies, such as 60 Hz, 90 Hz, and 120 Hz.

[0118] Step S609, calculating the current frequency reference value fte' of the TE signal according to the first clock count value and the reference clock frequency, the calculation formula is fte'=C1 / fref, where C1 can also be replaced by a statistical indicator of the first clock count values ​​in multiple first reference time intervals, such as an average value, a median value, a mode, etc.;

[0119] Step S610, comparing the current frequency reference value of the TE signal with the preset frequency of the TE signal to determine the actual frequency fte of the TE signal;

[0120] Step S611, judging whether C1 is stable, the judgment may be made one by one for C1 in a single first reference time interval, or a unified judgment may be made for C1 in multiple first reference time intervals. If yes, step S612 is executed, if not, step S613 is executed;

[0121] Step S612, after accumulating m C1s, calculate the average value C1_mean of the m C1s; m is a positive integer not less than 2, such as 100;

[0122] Step S613, discard the data of C1 and re-collect;

[0123] Step S614, performing clock calibration according to C1_mean and fte, for example, the clock frequency of the sensor to be calibrated can be calculated according to the formula f0=C1_mean / t1=C1_mean·fte, and the clock frequency represents the actual current clock frequency of the sensor to be calibrated. Alternatively, when the actual current frequency of the sensor to be calibrated deviates from the expected frequency value or frequency range, the clock of the sensor to be calibrated can be adjusted to obtain the adjusted clock frequency f1_cal;

[0124] Step S615, combining f1_cal and fte, dynamically switching different frequency algorithms, and performing corresponding underlying configurations.

[0125] In one embodiment, the sensor to be calibrated may be a light sensor disposed under a display screen, such as an ambient light sensor, a color temperature sensor, a spectrum sensor, etc. In one embodiment, the sensor clock calibration method may further include the following steps:

[0126] After the clock of the optical sensor is calibrated, the sampling time of the optical sensor is configured according to the calibration result of the clock of the optical sensor.

[0127] The light sensor is set under the display screen, which not only receives light from the external environment, but also receives light leakage from the display screen. In order to eliminate the influence of light leakage from the display screen on the light sensor sensing ambient light, the light sensor can be set to sample the ambient light during the "black frame" period of the display screen.

[0128] In one embodiment, reference Figure 7 As shown, the display screen can adopt PWM (Pulse Width Modulation) dimming mode. PWM dimming mode refers to a method of changing the brightness of the display screen by alternating the on and off of the display screen. In PWM dimming mode, the display screen switches between the on and off states according to the change of the PWM signal. When the PWM signal is at a high level, the display screen is on, and when the PWM signal is at a low level, the display screen is off. The longer the off state lasts, the lower the visual brightness of the display screen is, and the shorter the off state lasts, the higher the visual brightness of the display screen is. Therefore, during the time period when the display screen is off, the light sensor samples the light signal, and the collected information is completely ambient light information. The sampling unit time of the light sensor is usually an integer multiple of the light sensor clock period. The integral sampling time of the light sensor can be divided into ALS1 (ALS is the abbreviation of Ambient Light Sensor) and ALS2. It can be seen that ALS1 is synchronized with the PWM signal, which completely falls within the low-level time period of the PWM signal, which is the time period when the display screen is off. Therefore, the sampling signal in ALS1 does not include the light leakage of the display screen, and only the sampling signal in ALS1 can be obtained.

[0129] In order to accurately configure the sampling time of the light sensor, such as configuring the above-mentioned ALS1 and ALS2, it is necessary to obtain the clock frequency of the light sensor. If the clock frequency set by the light sensor itself is used, its accuracy is limited, which can easily lead to inaccurate configured sampling time, such as being out of sync with the PWM signal of the display screen, causing the light sensor to collect ambient light and light leakage from the display screen at the same time, affecting the accuracy of the light sensor output result. After the clock calibration method in this exemplary embodiment is used to calibrate the clock of the light sensor, its clock frequency can be accurately obtained, and the sampling time can be accurately configured, which is conducive to improving the accuracy of the sampled light sensor output result.

[0130] It should be noted that, in this exemplary embodiment, the method of configuring the sampling time of the optical sensor is not limited to Figure 7 For example, ALS1 can be configured to exceed the low level period of the PWM signal, and the pure ambient light information can be calculated based on the sampled signals in ALS1 and ALS2. This method also requires the clock frequency of the light sensor to be accurately obtained.

[0131] The exemplary embodiment of the present disclosure also provides a clock calibration device for a sensor. Figure 8 As shown, the clock calibration device 800 of the sensor may include:

[0132] The clock count value acquisition module 810 is configured to acquire a first clock count value of the sensor to be calibrated within a first reference time interval of the TE signal of the display screen;

[0133] The clock calibration module 820 is configured to calibrate the clock of the sensor to be calibrated according to the first clock count value and the duration of the first reference time interval.

[0134] In one implementation, the apparatus 800 may further include a TE signal parameter calculation module configured to:

[0135] Determine the actual frequency of the TE signal according to the first clock count value and a reference clock parameter of the sensor to be calibrated;

[0136] The duration of the first reference time interval is determined according to the actual frequency of the TE signal.

[0137] In one embodiment, the step of obtaining a first clock count value of the sensor to be calibrated within a first reference time interval of a TE signal of a display screen includes:

[0138] In a case where the frequency of the TE signal can dynamically change among a plurality of preset frequencies, obtaining a first clock count value of the sensor to be calibrated within a first reference time interval of the TE signal;

[0139] The above-mentioned determining the actual frequency of the TE signal according to the first clock count value and the reference clock parameter of the sensor to be calibrated includes:

[0140] Determine a current frequency reference value of the TE signal according to the first clock count value and a reference clock parameter of the sensor to be calibrated;

[0141] The actual frequency of the TE signal is determined by comparing the current frequency reference value of the TE signal with a plurality of preset frequencies.

[0142] In one embodiment, the clock count value acquisition module 810 is further configured to: acquire a second clock count value of the sensor to be calibrated within a second reference time interval of the TE signal when the frequency of the TE signal is fixed to the reference frequency;

[0143] The clock calibration module 820 is further configured to: calibrate the clock of the sensor to be calibrated according to the second clock count value and the duration of the second reference time interval to obtain a reference clock parameter of the sensor to be calibrated.

[0144] In one embodiment, the step of obtaining a first clock count value of the sensor to be calibrated within a first reference time interval of a TE signal of a display screen includes:

[0145] Respectively obtaining first clock count values ​​of sensors to be calibrated within a plurality of first reference time intervals;

[0146] The clock calibration module 820 is further configured to:

[0147] Before calibrating the clock of the sensor to be calibrated based on the first clock count value and the length of the first reference time interval, if the first clock count values ​​in multiple first reference time intervals meet the stability condition, the first clock count values ​​in the multiple first reference time intervals are retained; if the first clock count values ​​in the multiple first reference time intervals do not meet the stability condition, the first clock count values ​​in the multiple first reference time intervals are discarded.

[0148] In one implementation, calibrating the clock of the sensor to be calibrated according to the first clock count value and the duration of the first reference time interval includes:

[0149] The clock of the sensor to be calibrated is calibrated according to an average value of first clock count values ​​in a plurality of first reference time intervals and a duration of the first reference time interval.

[0150] In one implementation, the first reference time interval includes: a time interval between two adjacent rising edges of the TE signal, or a time interval between two adjacent falling edges of the TE signal.

[0151] In one embodiment, the sensor to be calibrated includes a light sensor disposed below the display screen.

[0152] In one implementation, the apparatus 800 may further include a sampling time configuration module configured to: after the clock of the sensor to be calibrated is calibrated, configure the sampling time of the optical sensor according to the clock calibration result of the optical sensor.

[0153] The specific details of each part of the above-mentioned device have been described in detail in the implementation method of the method part. The undisclosed details can be found in the implementation method of the method part, so they will not be repeated here.

[0154] The exemplary embodiments of the present disclosure also provide a computer-readable storage medium, which can be implemented in the form of a program product, which includes a program code, and when the program product is run on an electronic device, the program code is used to cause the electronic device to perform the steps described in the above "Exemplary Method" section of this specification according to various exemplary embodiments of the present disclosure. In an optional embodiment, the program product can be implemented as a portable compact disk read-only memory (CD-ROM) and includes program code, and can be run on an electronic device, such as a personal computer. However, the program product of the present disclosure is not limited to this, and in this document, the readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, device or device.

[0155] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0156] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0157] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.

[0158] Program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).

[0159] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the exemplary embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.

[0160] It will be appreciated by those skilled in the art that various aspects of the present disclosure may be implemented as a system, method or program product. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or an implementation combining hardware and software aspects, which may be collectively referred to herein as a "circuit", "module" or "system". Those skilled in the art will readily think of other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any variations, uses or adaptive changes of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and implementation are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.

[0161] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A sensor clock calibration method, characterized in that: include: Acquire a first clock count value of the sensor to be calibrated within a first reference time interval of the TE signal of the display screen; TE signal indicates display refresh signal; The starting time point and the ending time point of the first reference time interval are two time points at which the TE signal changes; calibrating the clock of the sensor to be calibrated according to the first clock count value and the duration of the first reference time interval; After obtaining the first clock count value of the sensor to be calibrated, the method further includes: Determine the actual frequency of the TE signal according to the first clock count value and the reference clock parameter of the sensor to be calibrated; the reference clock parameter is used to provide a reference for calculating the actual clock parameter; Determining the duration of the first reference time interval according to the actual frequency of the TE signal; Wherein, obtaining the first clock count value of the sensor to be calibrated within the first reference time interval of the TE signal of the display screen includes: obtaining the first clock count value of the sensor to be calibrated within the first reference time interval of the TE signal when the frequency of the TE signal can dynamically change among a plurality of preset frequencies; The determining the actual frequency of the TE signal according to the first clock count value and the reference clock parameters of the sensor to be calibrated includes: determining the current frequency reference value of the TE signal according to the first clock count value and the reference clock parameters of the sensor to be calibrated; and determining the actual frequency of the TE signal by comparing the current frequency reference value of the TE signal with the multiple preset frequencies.

2. The method according to claim 1, characterized in that The method further comprises: When the frequency of the TE signal is fixed to the reference frequency, a second clock count value of the sensor to be calibrated is obtained within a second reference time interval of the TE signal; the start time point and the end time point of the second reference time interval are two time points at which the TE signal at the reference frequency changes; The clock of the sensor to be calibrated is calibrated according to the second clock count value and the duration of the second reference time interval to obtain a reference clock parameter of the sensor to be calibrated.

3. The method according to claim 1, characterized in that The step of obtaining a first clock count value of the sensor to be calibrated within a first reference time interval of the TE signal of the display screen includes: Respectively obtaining first clock count values ​​of the sensor to be calibrated within a plurality of first reference time intervals; Before calibrating the clock of the sensor to be calibrated according to the first clock count value and the duration of the first reference time interval, the method further includes: If the first clock count values ​​within the plurality of first reference time intervals meet a stability condition, retaining the first clock count values ​​within the plurality of first reference time intervals; the stability condition is used to measure whether the first clock count values ​​within the plurality of first reference time intervals are stable; If the first clock count values ​​in the plurality of first reference time intervals do not meet the stability condition, the first clock count values ​​in the plurality of first reference time intervals are discarded.

4. The method according to claim 1, characterized in that: The step of calibrating the clock of the sensor to be calibrated according to the first clock count value and the duration of the first reference time interval includes: The clock of the sensor to be calibrated is calibrated according to an average value of the first clock count values ​​in the plurality of first reference time intervals and a duration of the first reference time interval.

5. The method according to claim 1, characterized in that The first reference time interval includes: a time interval between two adjacent rising edges of the TE signal, or a time interval between two adjacent falling edges of the TE signal.

6. The method according to claim 1, characterized in that The sensor to be calibrated includes a light sensor arranged under the display screen.

7. The method according to claim 6, characterized in that After calibrating the clock of the sensor to be calibrated, the method further includes: The sampling time of the optical sensor is configured according to the clock calibration result of the optical sensor.

8. A sensor clock calibration method, characterized in that: include: Acquire a first clock count value of the sensor to be calibrated within a first reference time interval of the TE signal of the display screen; TE signal indicates display refresh signal; The starting time point and the ending time point of the first reference time interval are two time points at which the TE signal changes; calibrating the clock of the sensor to be calibrated according to the first clock count value and the duration of the first reference time interval; The step of obtaining a first clock count value of the sensor to be calibrated within a first reference time interval of the TE signal of the display screen includes: Respectively obtaining first clock count values ​​of the sensor to be calibrated within a plurality of first reference time intervals; Before calibrating the clock of the sensor to be calibrated according to the first clock count value and the duration of the first reference time interval, the method further includes: If the first clock count values ​​within the plurality of first reference time intervals meet a stability condition, retaining the first clock count values ​​within the plurality of first reference time intervals; the stability condition is used to measure whether the first clock count values ​​within the plurality of first reference time intervals are stable; If the first clock count values ​​in the plurality of first reference time intervals do not meet the stability condition, the first clock count values ​​in the plurality of first reference time intervals are discarded.

9. A sensor clock calibration device, characterized in that: include: A clock count value acquisition module is configured to acquire a first clock count value of the sensor to be calibrated within a first reference time interval of a TE signal of the display screen; TE signal indicates display refresh signal; The starting time point and the ending time point of the first reference time interval are two time points at which the TE signal changes; a clock calibration module, configured to calibrate the clock of the sensor to be calibrated according to the first clock count value and the duration of the first reference time interval; A TE signal parameter calculation module is configured to: determine the actual frequency of the TE signal according to the first clock count value and the reference clock parameter of the sensor to be calibrated; The reference clock parameters are used to provide a reference for calculating the actual clock parameters; Determining the duration of the first reference time interval according to the actual frequency of the TE signal; Wherein, obtaining the first clock count value of the sensor to be calibrated within the first reference time interval of the TE signal of the display screen includes: obtaining the first clock count value of the sensor to be calibrated within the first reference time interval of the TE signal when the frequency of the TE signal can dynamically change among a plurality of preset frequencies; The determining the actual frequency of the TE signal according to the first clock count value and the reference clock parameters of the sensor to be calibrated includes: determining the current frequency reference value of the TE signal according to the first clock count value and the reference clock parameters of the sensor to be calibrated; and determining the actual frequency of the TE signal by comparing the current frequency reference value of the TE signal with the multiple preset frequencies.

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

11. An electronic device, characterized in that: include: processor; A memory, configured to store executable instructions of the processor; Sensor to be calibrated; The processor is configured to perform the method of any one of claims 1 to 8 by executing the executable instructions.

12. The electronic device according to claim 11, characterized in that: Also includes: Display screen; A connection line for transmitting TE signals is provided between the display screen and the sensor to be calibrated.

Citation Information

Patent Citations

  • External clock calibration method and system

    CN111443587A