A machine learning based clock calibration method, system and device

CN115549645BActive Publication Date: 2026-09-04CHENGDU AICH TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211262589.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-14
Publication Date
2026-09-04
Estimated Expiration
2042-10-14

AI Technical Summary

Technical Problem

[0005]本发明的目的在于提供一种基于机器学习的时钟校准方法、系统及设备,用于解决现有技术中随环境温度变化,弛张振荡器输出频率变化较大的问题

Benefits of technology

[0020] Compared with existing technologies, this invention provides a clock calibration method, system, and device based on machine learning. The method includes: acquiring multiple capacitor tuning array values ​​of a relaxation oscillator and multiple temperature data collected by a temperature sensor; training a machine learning model based on the multiple capacitor tuning array values ​​and the multiple temperature data to obtain a target model; the target model outputs corresponding target capacitor tuning array values ​​based on the input temperature data; and adjusting the input capacitor tuning array values ​​of the relaxation oscillator to the target capacitor tuning array values ​​to ensure that the frequency accuracy of the relaxation oscillator meets preset conditions. Based on the machine learning model, the corresponding capacitor tuning array values ​​are automatically input according to the changing temperature values, thereby adjusting the input frequency of the relaxation oscillator. This eliminates the need for additional frequency calibration using a crystal oscillator and baseband frequency synthesizer for each input frequency of the relaxation oscillator. Furthermore, automatically determining the capacitor tuning array values ​​based on temperature changes ensures that the frequency of the relaxation oscillator does not experience significant errors with temperature changes, achieving a high-precision relaxation oscillator at all times through machine learning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115549645B_ABST
    Figure CN115549645B_ABST
Patent Text Reader

Abstract

The application discloses a clock calibration method, system and device based on machine learning, and relates to the technical field of clocks, and is used for solving the problem that the output frequency of a relaxation oscillator changes greatly with the change of ambient temperature in the prior art. The method comprises the following steps: acquiring a plurality of capacitance tuning array values of the relaxation oscillator and a plurality of temperature data collected by a temperature sensor; training a machine learning model based on the plurality of capacitance tuning array values and the plurality of temperature data to obtain a target model; and automatically inputting corresponding capacitance tuning array values according to the change of temperature values based on the machine learning model to adjust the input frequency of the relaxation oscillator, so that the frequency of the relaxation oscillator is calibrated by a crystal oscillator and a baseband frequency synthesizer without the need of additionally using the crystal oscillator and the baseband frequency synthesizer for each input frequency of the relaxation oscillator. The frequency of the relaxation oscillator can be ensured not to change greatly with the change of temperature, and the machine self-learning is used to realize the relaxation oscillator with high precision at any time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of clock technology, and in particular to a clock calibration method, system, and device based on machine learning. Background Technology

[0002] A relaxation oscillator (ROSC) is primarily used to generate non-sinusoidal output signals, such as square or triangular waves. It contains non-linear components like transistors that periodically release energy stored in capacitors or inductors, causing the output signal waveform to change instantaneously. A relaxation oscillator that generates a square wave can be used as a clock signal in sequential logic circuits (such as counters). A relaxation oscillator is an on-chip RC oscillator with no input signal and a positive feedback amplifier with a frequency-selective network. The frequency-selective network, composed of resistors and capacitors, offers advantages such as ease of implementation, high portability, high frequency stability, and low power consumption, making it widely used in microcontrollers.

[0003] In the IoT field, the pursuit of low power consumption and low cost necessitates the replacement of high-precision but expensive off-chip 32.768kHz crystals with low-cost on-chip RC oscillators. In practical applications, ordinary relaxation oscillators cannot maintain a stable output frequency with temperature changes.

[0004] Therefore, there is an urgent need to provide a more reliable clock calibration solution. Summary of the Invention

[0005] The purpose of this invention is to provide a clock calibration method, system, and device based on machine learning, which solves the problem in the prior art that the output frequency of a relaxation oscillator changes significantly with changes in ambient temperature.

[0006] To achieve the above objectives, the present invention provides the following technical solution:

[0007] In a first aspect, the present invention provides a clock calibration method based on machine learning, the method comprising:

[0008] Multiple capacitor tuning array values ​​of a relaxation oscillator and multiple temperature data collected by a temperature sensor are obtained; the multiple capacitor tuning array values ​​and the multiple temperature data are recorded when the frequency error of the relaxation oscillator is less than a preset error threshold.

[0009] Based on multiple capacitor tuning array values ​​and multiple temperature data, a machine learning model is trained to obtain a target model; the target model is used to output the corresponding target capacitor tuning array value according to the input temperature data.

[0010] The input capacitor tuning array value of the relaxation oscillator is adjusted to the target capacitor tuning array value to ensure that the frequency accuracy of the relaxation oscillator meets the preset conditions.

[0011] Secondly, the present invention provides a clock calibration system based on machine learning, the system comprising at least:

[0012] Machine self-learning control module, temperature sensor, relaxation oscillator and digital computing control circuit;

[0013] The temperature sensor collects temperature data from the chip. When the temperature change corresponding to the temperature data exceeds a preset temperature threshold, it acquires multiple capacitor tuning array values ​​of the relaxation oscillator and multiple temperature data collected by the temperature sensor. The multiple capacitor tuning array values ​​and multiple temperature data are recorded when the frequency error of the relaxation oscillator is less than a preset error threshold. The chip integrates various structural modules of the clock calibration system.

[0014] Multiple capacitor tuning array values ​​and multiple temperature data are transmitted to the machine learning control module. Based on the multiple capacitor tuning array values ​​and multiple temperature data, the machine learning model is trained to obtain a target model. The target model is used to output the corresponding target capacitor tuning array value according to the input temperature data. The digital operation control circuit adjusts the input capacitor tuning array value of the relaxation oscillator to the target capacitor tuning array value to ensure that the frequency accuracy of the relaxation oscillator meets the preset conditions.

[0015] Thirdly, the present invention provides a clock calibration device based on machine learning, the device comprising:

[0016] A communication unit / communication interface is used to acquire multiple capacitor tuning array values ​​of a relaxation oscillator and multiple temperature data collected by a temperature sensor; the multiple capacitor tuning array values ​​and the multiple temperature data are recorded when the frequency error of the relaxation oscillator is less than a preset error threshold.

[0017] A processing unit / processor is configured to train a machine learning model based on multiple capacitor tuning array values ​​and multiple temperature data to obtain a target model; the target model is configured to output a corresponding target capacitor tuning array value based on the input temperature data.

[0018] The input capacitor tuning array value of the relaxation oscillator is adjusted to the target capacitor tuning array value to ensure that the frequency accuracy of the relaxation oscillator meets the preset conditions.

[0019] Fourthly, the present invention provides a computer storage medium storing instructions that, when executed, implement the aforementioned machine learning-based clock calibration method.

[0020] Compared with existing technologies, this invention provides a clock calibration method, system, and device based on machine learning. The method includes: acquiring multiple capacitor tuning array values ​​of a relaxation oscillator and multiple temperature data collected by a temperature sensor; training a machine learning model based on the multiple capacitor tuning array values ​​and the multiple temperature data to obtain a target model; the target model outputs corresponding target capacitor tuning array values ​​based on the input temperature data; and adjusting the input capacitor tuning array values ​​of the relaxation oscillator to the target capacitor tuning array values ​​to ensure that the frequency accuracy of the relaxation oscillator meets preset conditions. Based on the machine learning model, the corresponding capacitor tuning array values ​​are automatically input according to the changing temperature values, thereby adjusting the input frequency of the relaxation oscillator. This eliminates the need for additional frequency calibration using a crystal oscillator and baseband frequency synthesizer for each input frequency of the relaxation oscillator. Furthermore, automatically determining the capacitor tuning array values ​​based on temperature changes ensures that the frequency of the relaxation oscillator does not experience significant errors with temperature changes, achieving a high-precision relaxation oscillator at all times through machine learning. Attached Figure Description

[0021] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this invention, illustrate exemplary embodiments of the invention and are used to explain the invention, but do not constitute an undue limitation of the invention. In the drawings:

[0022] Figure 1 This is a schematic diagram of the clock calibration method based on machine learning provided by the present invention;

[0023] Figure 2 A schematic diagram of the clock calibration system based on machine learning provided by the present invention;

[0024] Figure 3 This is a schematic diagram of the data recording method in the machine learning-based clock calibration method provided by the present invention;

[0025] Figure 4 This is a schematic diagram of the frequency versus temperature curves before and after calibration provided by the present invention.

[0026] Figure 5 A schematic diagram of the relaxation oscillator structure connection in the machine learning-based clock calibration system provided by the present invention;

[0027] Figure 6 A schematic diagram of the capacitor switch array in the relaxation oscillator structure provided by the present invention;

[0028] Figure 7 This is a schematic diagram of the structure of the machine learning-based clock calibration device provided by the present invention.

[0029] Figure label:

[0030] Storage system-201, machine self-learning control module-202, MCU-203, SOC-204, digital operation control circuit-205, relaxation oscillator-206, crystal oscillator-207, frequency measurement module-208 (counter 1, counter 2), temperature sensor-209, baseband frequency synthesizer-210, RF frequency synthesizer-211, RF system-212, capacitor switch array-510, comparator-520, resistor-530. Detailed Implementation

[0031] To facilitate a clear description of the technical solutions in the embodiments of the present invention, the terms "first" and "second" are used to distinguish identical or similar items with essentially the same function and effect. For example, the first threshold and the second threshold are merely used to distinguish different thresholds and do not limit their order. Those skilled in the art will understand that the terms "first" and "second" do not limit the quantity or execution order, and that the terms "first" and "second" are not necessarily different.

[0032] It should be noted that in this invention, the terms "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in this invention should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.

[0033] In this invention, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, a combination of a and b, a combination of a and c, a combination of b and c, or a, b, and c, where a, b, and c can be single or multiple.

[0034] The following is an explanation of the terminology used in this plan:

[0035] A relaxation oscillator (ROSC) is primarily used to generate non-sinusoidal output signals, such as square or triangular waves. A relaxation oscillator contains non-linear components, such as transistors, that periodically release energy stored in capacitors or inductors, causing the output signal waveform to change instantaneously.

[0036] Relaxation oscillators that generate square waves can be used for clock signals in sequential logic circuits (such as counters), although a relatively stable crystal oscillator is usually chosen. Oscillators that output triangular waves (or sawtooth waves) are commonly used to generate horizontally reflected signals in the cathode ray tubes of oscilloscopes or televisions, based on a time reference. In frequency generators, triangular waves are also often used to shape the output signal to approximate a sine wave. A relaxation oscillator is a type of complex oscillator.

[0037] A crystal oscillator is a thin slice (or wafer) cut from a quartz crystal at a specific azimuth angle. A quartz crystal resonator is also simply called a quartz crystal or crystal oscillator. A crystal element with an integrated circuit (IC) inside a package to form an oscillation circuit is called a crystal oscillator. These products are generally packaged in metal casings, but glass, ceramic, or plastic casings are also available. They can be used in various applications, such as: general-purpose crystal oscillators, used in various circuits to generate oscillation frequencies; quartz crystal resonators for clock pulses, used in conjunction with other components to generate standard pulse signals, widely used in digital circuits; quartz crystal resonators for microprocessors; and quartz crystal oscillators for clocks, etc.

[0038] Frequency synthesizers: Frequency synthesizers are an important component of modern electronic systems and key devices in modern communication systems, radar, and testing equipment, providing high-precision and high-stability frequencies. There are three basic frequency synthesis methods: ① Direct frequency synthesis; ② Phase-locked loop (PLL) frequency synthesis; ③ Direct digital frequency synthesis (DDS).

[0039] Counter: Counting is one of the simplest and most basic operations. A counter is a logic circuit that implements this operation. In digital systems, counters mainly count the number of pulses to achieve measurement, counting, and control functions, and also have frequency division functions. A counter consists of a basic counting unit and some control gates. The counting unit is composed of a series of flip-flops with information storage functions, such as RS flip-flops, T flip-flops, D flip-flops, and JK flip-flops.

[0040] In the IoT field, the pursuit of low power consumption and low cost necessitates the replacement of high-precision but expensive off-chip 32.768kHz crystals with low-cost on-chip RC oscillators. In practical applications, ordinary relaxation oscillators cannot maintain a stable output frequency with temperature changes.

[0041] In response, this invention provides a clock calibration scheme based on machine learning.

[0042] Next, the solutions provided in the embodiments of this specification will be described in conjunction with the accompanying drawings:

[0043] Figure 1 This is a schematic diagram of the clock calibration method based on machine learning provided by the present invention, as shown below. Figure 1 As shown, the process may include the following steps:

[0044] Step 110: Obtain multiple capacitor tuning array values ​​of the relaxation oscillator and multiple temperature data collected by the temperature sensor; the multiple capacitor tuning array values ​​and the multiple temperature data are recorded when the frequency error of the relaxation oscillator is less than a preset error threshold.

[0045] The capacitor tuning array value can be represented by the c_trim_code value, and the temperature data can be the chip's temperature data. The chip integrates multiple structures in a clock calibration system based on learning. The capacitor tuning array value in the data acquired in step 110 is "valid data," meaning data where the frequency error has reached a preset error threshold. If the frequency error is greater than or equal to the preset error threshold, it needs to be calibrated to be less than the preset error threshold before it can be collected. When recording data, multiple varying temperature data points and capacitor tuning array values ​​need to be recorded as the basis for model training.

[0046] Step 120: Based on multiple capacitor tuning array values ​​and multiple temperature data, train the machine learning model to obtain a target model; the target model is used to output the corresponding target capacitor tuning array value according to the input temperature data.

[0047] Machine learning can be understood as: extracting relevant data features from input training data and then outputting results. Machine learning uses machine learning algorithms to build models, which can then be used to make predictions when new data arrives. In this solution, machine learning is used to train a target model based on multiple capacitor tuning array values ​​and multiple temperature data. The resulting target model can output corresponding target capacitor tuning array values ​​based on changing temperature data to meet the requirements.

[0048] Step 130: Adjust the input capacitor tuning array value of the relaxation oscillator to the target capacitor tuning array value to ensure that the frequency accuracy of the relaxation oscillator meets the preset conditions.

[0049] The input to the relaxation oscillator is determined under different temperature variations to ensure that the relaxation oscillator maintains high accuracy under different temperature changes.

[0050] Figure 1The method described above acquires multiple capacitor tuning array values ​​for a relaxation oscillator and multiple temperature data points collected by a temperature sensor. Based on these values, a machine learning model is trained to obtain a target model. This target model outputs the corresponding target capacitor tuning array values ​​based on the input temperature data. The input capacitor tuning array values ​​of the relaxation oscillator are then adjusted to match the target values ​​to ensure the frequency accuracy of the relaxation oscillator meets preset conditions. The machine learning model automatically adjusts the input frequency of the relaxation oscillator based on changing temperature values, eliminating the need for additional frequency calibration using a crystal oscillator and baseband frequency synthesizer for each input frequency. Furthermore, automatically determining the capacitor tuning array values ​​based on temperature changes ensures that the frequency of the relaxation oscillator does not experience significant errors with temperature variations, achieving a consistently high-precision relaxation oscillator through machine learning.

[0051] based on Figure 1 In addition to the method described herein, this specification also provides some specific implementation methods of this method, which will be described below.

[0052] Optionally, before acquiring the multiple capacitor tuning array values ​​of the relaxation oscillator and the multiple temperature data collected by the temperature sensor, the process may further include:

[0053] The temperature sensor collects temperature data from the chip.

[0054] When the temperature sensor detects a temperature change greater than a preset temperature threshold, it detects the frequency error of the relaxation oscillator.

[0055] Determine whether the frequency error is greater than or equal to the preset error threshold;

[0056] If the frequency error is greater than or equal to the preset error threshold, the frequency of the relaxation oscillator is calibrated based on the frequency error.

[0057] If the frequency error is less than the preset error threshold, then record the temperature data detected by the current temperature sensor and the capacitor tuning array value corresponding to the relaxation oscillator.

[0058] In the actual data acquisition process, not all temperature data and capacitor tuning array values ​​are recorded. Data is only collected when there is a significant temperature change to detect the frequency error of the relaxation oscillator. A significant change indicates that the temperature change exceeds a preset threshold. The preset threshold can be 1℃, or other temperature thresholds set according to the actual application scenario. For example, when the temperature changes from 20℃ to 25℃, the relaxation oscillator frequency drops from 32kHz to 30kHz; at this point, the frequency error of the relaxation oscillator can be detected.

[0059] When the frequency error is too large, it indicates that the frequency error of the relaxation oscillator is too affected by temperature changes, and the frequency of the relaxation oscillator needs to be calibrated. If the error is less than the preset error threshold, the corresponding temperature data and capacitor tuning array values ​​can be recorded for training the machine learning model.

[0060] The above methods can be used to select effective data for training machine learning models, thereby improving the performance of machine learning models.

[0061] Furthermore, training the machine learning model based on multiple capacitor tuning array values ​​and multiple temperature data points can specifically include:

[0062] The target model is obtained by performing linear regression on multiple capacitor tuning array values ​​and multiple temperature data, and the target model is a linear model.

[0063] During training, linear regression can be performed on the capacitor tuning array values ​​and multiple temperature data to establish the correspondence between the capacitor tuning array values ​​and multiple temperature data, so that the corresponding capacitor tuning array values ​​can be output when temperature data is received.

[0064] Optionally, calibrating the frequency of the relaxation oscillator based on the frequency error may specifically include:

[0065] Obtain the first frequency output by the crystal oscillator, and use the first frequency as the reference frequency. Use a counter to count the clock of the relaxation oscillator to obtain the first clock count.

[0066] The frequency of the relaxation oscillator is initially calibrated by a digital operation control circuit so that the first clock number meets the initial preset conditions.

[0067] Obtain the second frequency generated by the frequency synthesizer; use the second frequency as the reference frequency, and use a counter to count the clock cycles of the relaxation oscillator to obtain the second clock count;

[0068] The frequency of the relaxation oscillator is calibrated a second time through the digital operation control circuit so that the second clock number meets the target preset condition, and the calibration is completed.

[0069] The calibration mentioned above is only required when selecting training data. Since the training data needs to meet an error threshold, data that does not meet the frequency error threshold requires calibration. If the scheme of this application is adopted, after the machine learning model is trained, the frequency of the relaxation oscillator can be directly output from the machine learning model. That is, by receiving different temperature data and adjusting the capacitor tuning array value input to the relaxation oscillator based on the temperature data, the frequency accuracy of the relaxation oscillator meets the preset conditions, and the frequency of the relaxation oscillator does not need to be calibrated based on the crystal oscillator and frequency synthesizer.

[0070] During calibration, a crystal oscillator is used for initial calibration of the relaxation oscillator frequency, and a frequency synthesizer is used for secondary calibration of the relaxation oscillator frequency. This solves the problem that the existing technology of ordinary relaxation oscillators, which are implemented by resistors, capacitors and comparators, has low accuracy and cannot meet the precise counting requirements of chips. By calibrating the relaxation oscillator frequency through a crystal oscillator and a frequency synthesizer, the validity of the training data input to the target model can be guaranteed.

[0071] Following the same approach, this invention also provides a machine learning-based clock calibration system, such as... Figure 2 As shown, the system may include:

[0072] It includes a storage system 201, a machine self-learning control module 202, an MCU 203, a SOC 204, a digital arithmetic control circuit 205, a relaxation oscillator 206, a crystal oscillator 207, a frequency measurement module 208 (counter 1, counter 2), a temperature sensor 209, a baseband frequency synthesizer 210, an RF frequency synthesizer 211, an RF system 212, a counter TIMER, and a system bus. The storage system includes EEPROM, EFUSE, EFLASH, SRAM, etc.

[0073] The temperature sensor 209 collects temperature data from the chip. When the temperature change corresponding to the temperature data exceeds a preset temperature threshold, it acquires multiple capacitor tuning array values ​​of the relaxation oscillator 206 and multiple temperature data collected by the temperature sensor 209. The multiple capacitor tuning array values ​​and the temperature data are recorded when the frequency error of the relaxation oscillator 206 is less than a preset error threshold. The chip integrates various structural modules of the clock calibration system. The multiple capacitor tuning array values ​​and multiple temperature data are transmitted to the machine learning control module. Based on the multiple capacitor tuning array values ​​and multiple temperature data, the machine learning model is trained to obtain the target model. The target model is used to output the corresponding target capacitor tuning array value according to the input temperature data. The digital operation control circuit 205 adjusts the input capacitor tuning array value of the relaxation oscillator 206 to the target capacitor tuning array value to ensure that the frequency accuracy of the relaxation oscillator 206 meets the preset conditions.

[0074] Figure 2 The system in this paper automatically adjusts the input frequency of the relaxation oscillator based on the changing temperature value, using a machine learning model to input the corresponding capacitor tuning array value. This eliminates the need for additional frequency calibration using a crystal oscillator and baseband frequency synthesizer for each input frequency. Furthermore, automatically determining the capacitor tuning array value based on temperature changes ensures that the relaxation oscillator frequency does not experience significant errors with temperature variations, achieving a consistently high-precision relaxation oscillator through machine learning.

[0075] based on Figure 7 The system may also include some specific implementation structures:

[0076] Optionally, the system may further include:

[0077] The frequency measurement module 208, crystal oscillator 207, and baseband frequency synthesizer 210 are included; the frequency measurement module 208 includes counter 1 and counter 2.

[0078] When the temperature sensor 209 detects a temperature change greater than a preset temperature threshold, the frequency measurement module 208 detects the frequency error of the relaxation oscillator 206.

[0079] If the frequency error is greater than or equal to the preset error threshold, the crystal oscillator 207 and the baseband frequency synthesizer 210 calibrate the frequency of the relaxation oscillator 206 based on the frequency error.

[0080] If the frequency error is less than the preset error threshold, the temperature data detected by the current temperature sensor 209 and the capacitor tuning array value corresponding to the relaxation oscillator 206 are recorded.

[0081] Specific data recording methods and procedures can be combined with Figure 3 Please provide an explanation, such as Figure 3 As shown, the data recording method process may include:

[0082] Start the relaxation oscillator, start the crystal oscillator, start the machine self-learning control module, and start the temperature sensor; start the baseband frequency synthesizer, digital operation control circuit, and frequency measurement module to perform frequency detection on the relaxation oscillator; if the temperature sensor detects a temperature change greater than 3 degrees Celsius, perform frequency error detection; if the frequency error is greater than 100 ppm, perform calibration; if the frequency error is less than 100 ppm, record the temperature detected by the temperature sensor and the c_trim_code value of the relaxation oscillator, and record it in efalsh.

[0083] Repeat the above process until the temperature sensor's detection range remains essentially unchanged. For example, the temperature sensor detects an ambient temperature range of -30 to 85 degrees Celsius, or 0 to 60 degrees Celsius.

[0084] Linear regression is performed on the recorded c_trim_code and temperature T to obtain a linear model, which is used to predict the c_trim_code value at different temperatures within the error range.

[0085] c_trim_code(T) = T*a + b; a and b are values ​​calculated by the machine learning program based on the calibration results. For example, for a straight line with a fixed slope, a is the slope and b is a fixed value. When the temperature sensor detects different temperatures T(i), it outputs the corresponding c_trim_code(i). The machine learning control module can specifically be used to: perform linear regression on multiple capacitor tuning array values ​​and multiple temperature data to obtain a target model, where the target model is a linear model. Figure 4 As shown, before calibration, the frequency value changed significantly with temperature, resulting in low accuracy. After calibration, the frequency-temperature curve tended to stabilize, and the frequency accuracy increased with temperature.

[0086] Optionally, the relaxation oscillator circuit corresponding to the relaxation oscillator can be combined with... Figure 5 Explanation: such as Figure 5 As shown, the relaxation oscillator circuit corresponding to the relaxation oscillator may include at least a capacitor switch array 510, a comparator 520, and a resistor 530. The input terminal of the comparator 520 is connected to a different power supply, and the output terminal of the comparator 520 is connected to the capacitor switch array 510. The resistor 530 is connected to ground in parallel with the capacitor switch array 510.

[0087] The comparator 520 compares the input first voltage and the second voltage to obtain a voltage result, and then transmits the voltage result to the capacitor switch array 510.

[0088] like Figure 5 As shown, voltages V1 and V2 are input to a comparator. Comparator 520 compares voltages V1 and V2, resets the voltage result logic, and then inputs it to the capacitor switch array 510. One end of resistor 530 is grounded, and one end of capacitor switch array 510 is also grounded.

[0089] In specific adjustments, the digital operation control circuit regulates the frequency of the relaxation oscillator by adjusting the capacitor code value in the capacitor switch array. The equivalent capacitance of the capacitor switch array increases as the capacitor code value increases.

[0090] Furthermore, the specific structure of the capacitor switch array can be combined with... Figure 6 Please provide an explanation. For example... Figure 6 As shown, the capacitor switch array can include at least N switches and capacitors. A switch and a capacitor are connected in series to form a capacitor switch branch. N switches and capacitors form N capacitor switch branches. The N capacitor switch branches are connected in parallel to the relaxation oscillator circuit.

[0091] Following the same approach, embodiments of this specification also provide a clock calibration device based on machine learning. For example... Figure 7 As shown. It can include:

[0092] A communication unit / communication interface is used to acquire multiple capacitor tuning array values ​​of a relaxation oscillator and multiple temperature data collected by a temperature sensor; the multiple capacitor tuning array values ​​and the multiple temperature data are recorded when the frequency error of the relaxation oscillator is less than a preset error threshold.

[0093] A processing unit / processor is used to train a machine learning model based on multiple capacitor tuning array values ​​and multiple temperature data to obtain a target model; the target model is used to output the corresponding target capacitor tuning array value according to the input temperature data.

[0094] The input capacitor tuning array value of the relaxation oscillator is adjusted to the target capacitor tuning array value to ensure that the frequency accuracy of the relaxation oscillator meets the preset conditions.

[0095] like Figure 7 As shown, the terminal device described above may also include a communication line. The communication line may include a path for transmitting information between the components described above.

[0096] Optional, such as Figure 7 As shown, the terminal device may further include a memory. The memory stores computer execution instructions for implementing the present invention, and the execution is controlled by a processor. The processor executes the computer execution instructions stored in the memory, thereby implementing the machine learning-based clock calibration method provided in the embodiments of the present invention.

[0097] like Figure 7As shown, the memory can be read-only memory (ROM) or other types of static storage devices capable of storing static information and instructions, random access memory (RAM) or other types of dynamic storage devices capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed discs, laser discs, optical discs, universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited to these. The memory can exist independently and be connected to the processor via communication lines. The memory can also be integrated with the processor.

[0098] Optionally, the computer execution instructions in the embodiments of the present invention may also be referred to as application code, and the embodiments of the present invention do not specifically limit this.

[0099] In a specific implementation, as one example, such as Figure 7 As shown, a processor may include one or more CPUs, such as Figure 7 CPU0 and CPU1 in the CPU.

[0100] In a specific implementation, as one example, such as Figure 7 As shown, the terminal device may include multiple processors, such as Figure 7 The processors in the system. Each of these processors can be a single-core processor or a multi-core processor.

[0101] Based on the same idea, this specification also provides a computer storage medium corresponding to the above embodiments. The computer storage medium stores instructions that, when executed, implement the methods in the above embodiments.

[0102] The foregoing mainly describes the solutions provided by the embodiments of the present invention from the perspective of the interaction between various modules. It is understood that each module, in order to achieve the above functions, includes corresponding hardware structures and / or software units for executing each function. Those skilled in the art should readily recognize that, in conjunction with the units and algorithm steps of the various examples described in the embodiments disclosed herein, the present invention can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed by hardware or by computer software driving hardware 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 the present invention.

[0103] The embodiments of the present invention can divide functional modules according to the above method examples. For example, each function can be divided into its own functional module, or two or more functions can be integrated into one processing module. The integrated module can be implemented in hardware or as a software functional module. It should be noted that the module division in the embodiments of the present invention is illustrative and only represents one logical functional division; other division methods may be used in actual implementation.

[0104] The processor described in this specification may also function as a memory. The memory stores computer execution instructions for carrying out the present invention, and its execution is controlled by the processor. The processor executes the computer execution instructions stored in the memory, thereby implementing the method provided in the embodiments of the present invention.

[0105] The memory can be read-only memory (ROM) or other types of static storage devices capable of storing static information and instructions, random access memory (RAM) or other types of dynamic storage devices capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed discs, laser discs, optical discs, universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited to these. The memory can exist independently and be connected to the processor via communication lines. The memory can also be integrated with the processor.

[0106] Optionally, the computer execution instructions in the embodiments of the present invention may also be referred to as application code, and the embodiments of the present invention do not specifically limit this.

[0107] The methods disclosed in the above embodiments of the present invention can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above methods can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, a digital signal processor (DSP), an ASIC, a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present invention. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of the present invention can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory; the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above methods.

[0108] In one possible implementation, a computer-readable storage medium is provided, which stores instructions that, when executed, are used to implement the methods described in the above embodiments.

[0109] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present invention are performed entirely or partially. The computer can be a general-purpose computer, a special-purpose computer, a computer network, a terminal, a user equipment, or other programmable device. The computer program or instructions can be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another. For example, the computer program or instructions can be transferred from one website, computer, server, or data center to another website, computer, server, or data center via wired or wireless means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium, such as a floppy disk, hard disk, or magnetic tape; it can also be an optical medium, such as a digital video disc (DVD); or it can be a semiconductor medium, such as a solid-state drive (SSD).

[0110] Although the invention has been described herein in conjunction with various embodiments, those skilled in the art will understand and implement other variations of the disclosed embodiments by reviewing the accompanying drawings, the disclosure, and the appended claims in carrying out the claimed invention. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude a plurality. A single processor or other unit can implement several functions listed in the claims. While different dependent claims may recite certain measures, this does not mean that these measures cannot be combined to produce good results.

[0111] Although the invention has been described in conjunction with specific features and embodiments, it is obvious that various modifications and combinations can be made therein without departing from the spirit and scope of the invention. Accordingly, this specification and drawings are merely exemplary descriptions of the invention as defined by the appended claims, and are considered to cover any and all modifications, variations, combinations, or equivalents within the scope of the invention. Clearly, those skilled in the art can make various alterations and modifications to the invention without departing from its spirit and scope. Thus, if such modifications and modifications of the invention fall within the scope of the claims and their equivalents, the invention is also intended to include such modifications and modifications.

Claims

1. A clock calibration method based on machine learning, characterized in that, The methods include: Acquire multiple capacitor tuning array values ​​of the relaxation oscillator and multiple temperature data collected by the temperature sensor; The multiple capacitor tuning array values ​​and the multiple temperature data are recorded when the frequency error of the relaxation oscillator is less than a preset error threshold; Based on multiple values ​​of the capacitor tuning array and multiple temperature data, a machine learning model is trained to obtain a target model; The target model is used to output the corresponding target capacitor tuning array value based on the input temperature data; The input capacitor tuning array value of the relaxation oscillator is adjusted to the target capacitor tuning array value to ensure that the frequency accuracy of the relaxation oscillator meets the preset conditions.

2. The method according to claim 1, characterized in that, Before acquiring the multiple capacitor tuning array values ​​of the relaxation oscillator and the multiple temperature data collected by the temperature sensor, the method further includes: The temperature sensor collects temperature data from the chip. When the temperature sensor detects a temperature change greater than a preset temperature threshold, it detects the frequency error of the relaxation oscillator. Determine whether the frequency error is greater than or equal to the preset error threshold; If the frequency error is greater than or equal to the preset error threshold, the frequency of the relaxation oscillator is calibrated based on the frequency error. If the frequency error is less than the preset error threshold, then record the temperature data detected by the current temperature sensor and the capacitor tuning array value corresponding to the relaxation oscillator.

3. The method according to claim 1, characterized in that, The machine learning model is trained based on multiple capacitor tuning array values ​​and multiple temperature data, specifically including: The target model is obtained by performing linear regression on multiple capacitor tuning array values ​​and multiple temperature data, and the target model is a linear model.

4. The method according to claim 2, characterized in that, The frequency of the relaxation oscillator is calibrated based on the frequency error, specifically including: Obtain the first frequency output by the crystal oscillator, and use the first frequency as the reference frequency. Use a counter to count the clock of the relaxation oscillator to obtain the first clock count. The frequency of the relaxation oscillator is initially calibrated by a digital operation control circuit so that the first clock number meets the initial preset conditions. Obtain the second frequency generated by the frequency synthesizer; use the second frequency as the reference frequency, and use a counter to count the clock cycles of the relaxation oscillator to obtain the second clock count; The frequency of the relaxation oscillator is calibrated a second time through the digital operation control circuit so that the second clock number meets the target preset condition, and the calibration is completed.

5. The method according to claim 4, characterized in that, After adjusting the input capacitance tuning array value of the relaxation oscillator to the target capacitance tuning array value, the method further includes: The system receives different temperature data and adjusts the capacitor tuning array value of the relaxation oscillator based on the temperature data. The frequency accuracy of the relaxation oscillator meets the preset conditions, and the frequency of the relaxation oscillator does not need to be calibrated based on the crystal oscillator and the frequency synthesizer.

6. A clock calibration system based on machine learning, characterized in that, The system includes at least: Machine self-learning control module, temperature sensor, relaxation oscillator and digital computing control circuit; The temperature sensor collects temperature data from the chip. When the temperature change corresponding to the temperature data exceeds a preset temperature threshold, it acquires multiple capacitor tuning array values ​​of the relaxation oscillator and multiple temperature data collected by the temperature sensor. The multiple capacitor tuning array values ​​and multiple temperature data are recorded when the frequency error of the relaxation oscillator is less than a preset error threshold. The chip integrates various structural modules of the clock calibration system. Multiple capacitor tuning array values ​​and multiple temperature data are transmitted to the machine learning control module. Based on the multiple capacitor tuning array values ​​and multiple temperature data, the machine learning model is trained to obtain a target model. The target model is used to output the corresponding target capacitor tuning array value according to the input temperature data. The digital operation control circuit adjusts the input capacitor tuning array value of the relaxation oscillator to the target capacitor tuning array value to ensure that the frequency accuracy of the relaxation oscillator meets the preset conditions.

7. The system according to claim 6, characterized in that, The system also includes: Frequency measurement module, crystal oscillator, and baseband frequency synthesizer; When the temperature sensor detects a temperature change greater than a preset temperature threshold, the frequency measurement module detects the frequency error of the relaxation oscillator. If the frequency error is greater than or equal to the preset error threshold, the crystal oscillator and the baseband frequency synthesizer calibrate the frequency of the relaxation oscillator based on the frequency error. If the frequency error is less than the preset error threshold, then record the temperature data detected by the current temperature sensor and the capacitor tuning array value corresponding to the relaxation oscillator.

8. The system according to claim 6, characterized in that, The machine self-learning control module is specifically used to: perform linear regression on multiple capacitor tuning array values ​​and multiple temperature data to obtain a target model, wherein the target model is a linear model.

9. A clock calibration device based on machine learning, characterized in that the device... include: The communication unit / communication interface is used to acquire multiple capacitor tuning array values ​​of the relaxation oscillator and multiple temperature data collected by the temperature sensor. The multiple capacitor tuning array values ​​and the multiple temperature data are recorded when the frequency error of the relaxation oscillator is less than a preset error threshold; A processing unit / processor is used to train a machine learning model based on multiple capacitor tuning array values ​​and multiple temperature data to obtain a target model; the target model is used to output the corresponding target capacitor tuning array value according to the input temperature data. The input capacitor tuning array value of the relaxation oscillator is adjusted to the target capacitor tuning array value to ensure that the frequency accuracy of the relaxation oscillator meets the preset conditions.

10. A computer storage medium, characterized in that, The computer storage medium stores instructions that, when executed, implement the machine learning-based clock calibration method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Filter bandwidth automatic calibration circuit and method

    CN114499412A

  • Precision, temperature stable clock using a frequency-control circuit and dual oscillators

    US7764131B1