Crystal oscillator temperature compensation method and device, storage medium and electronic equipment

By fusing the temperature frequency data of the crystal oscillator with the process factor, fitting the three-dimensional surface equation and reducing the dimension to the two-dimensional curve, the problem of low temperature compensation efficiency in the prior art is solved, and efficient frequency stability processing is achieved.

CN119171839AActive Publication Date: 2024-12-20RUIXING MICROELECTRONICS TECHNOLOGY (YANGZHOU) CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411183383.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-27
Publication Date
2024-12-20
Estimated Expiration
2044-08-27

AI Technical Summary

Technical Problem

The existing crystal oscillator temperature compensation method requires measuring the output frequency data of multiple sets of temperature points, resulting in high time cost and poor efficiency.

Method used

By obtaining the temperature frequency data of the target crystal oscillator, fusing the process factor dimension, expanding it to three-dimensional data to fit the three-dimensional surface equation, and reducing the dimension to the two-dimensional curve equation of the temperature frequency, you only need to measure less temperature frequency data to determine the output The frequency with temperature change curve is subject to targeted temperature compensation.

Benefits of technology

Improves the efficiency of temperature compensation of crystal oscillator, reduces the measurement data requirement, and ensures the stability of output frequency at different temperatures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119171839A_ABST
    Figure CN119171839A_ABST
Patent Text Reader

Abstract

The invention relates to a crystal oscillator temperature compensation method and device, a storage medium and electronic equipment, and relates to the technical field of crystal oscillators, and the method comprises the steps: obtaining first temperature frequency data corresponding to at least one target crystal oscillator in the same batch of crystal oscillators; obtaining corresponding three-dimensional data based on the first temperature frequency data of each target crystal oscillator, and fitting to obtain a three-dimensional curved surface equation based on each three-dimensional data; obtaining at least one group of second temperature frequency data of the crystal oscillator to be compensated, and obtaining a temperature frequency two-dimensional curve equation corresponding to the crystal oscillator to be compensated based on the second temperature frequency data and the three-dimensional curved surface equation; and performing temperature compensation on the crystal oscillator to be compensated based on the temperature frequency two-dimensional curve equation. The crystal oscillator has the effect of improving the temperature compensation efficiency of the crystal oscillator.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of crystal oscillators, and in particular to a crystal oscillator temperature compensation method, device, storage medium and electronic equipment. Background Art

[0002] A crystal oscillator is an electronic oscillator circuit that uses the inverse piezoelectric effect. It uses the mechanical resonance of a quartz crystal to generate an electrical signal with a very precise frequency. Crystal oscillators are an indispensable component in many electronic devices. Their main function is to provide a stable clock signal. Due to their high stability and precision, crystal oscillators are widely used in various electronic devices, such as communication equipment, computer systems, and other precision instruments. These devices have very high requirements for frequency accuracy and stability, so the importance of crystal oscillators is self-evident.

[0003] In the actual production process, the crystal oscillator will be affected by factors such as temperature and process deviation, which will cause the output frequency to shift and the output frequency to be unstable. In order to solve this problem, the method usually adopted is: based on the data of the crystal oscillator output frequency change with temperature obtained by fitting the two-dimensional curve equation, reasonable temperature compensation is performed on each crystal oscillator produced to maintain high stability at all temperatures. Among them, temperature compensation refers to compensating for the frequency drift caused by the crystal oscillator under temperature changes. However, when this method is actually applied, it is necessary to measure the output frequency data of more groups of temperature points in order to fit the corresponding two-dimensional curve equation of the crystal oscillator, which increases the time cost of crystal oscillator production and leads to poor efficiency of crystal oscillator temperature compensation. Summary of the invention

[0004] In order to improve the efficiency of temperature compensation of a crystal oscillator, the present application provides a crystal oscillator temperature compensation method, device, storage medium and electronic device.

[0005] In a first aspect of the present application, a crystal oscillator temperature compensation method is provided, which specifically includes: Acquire first temperature-frequency data corresponding to at least one target crystal oscillator in the same batch of crystal oscillators, wherein the first temperature-frequency data includes different temperatures in a preset temperature range and the output frequencies of the corresponding target crystal oscillators at the different temperatures; Based on the first temperature-frequency data of each of the target crystal oscillators, corresponding three-dimensional data are obtained, and based on each of the three-dimensional data, a three-dimensional surface equation is fitted, wherein the three-dimensional data includes data of the corresponding target crystal oscillator in three dimensions: temperature, corresponding output frequency, and process factor, wherein the process factor represents the degree of influence of process deviation on the deviation of the temperature-frequency characteristic of the target crystal oscillator; Acquire at least one set of second temperature-frequency data of the crystal oscillator to be compensated, and obtain a temperature-frequency two-dimensional curve equation corresponding to the crystal oscillator to be compensated based on each of the second temperature-frequency data and the three-dimensional surface equation, wherein the second temperature-frequency data includes a single temperature in the preset temperature range and the output frequency of the crystal oscillator to be compensated corresponding to the single temperature, and the independent variable of the temperature-frequency two-dimensional curve equation is the temperature, and the dependent variable is the output frequency corresponding to the crystal oscillator to be compensated; Based on the temperature-frequency two-dimensional curve equation, temperature compensation is performed on the crystal oscillator to be compensated.

[0006] By adopting the above technical solution, the first temperature frequency data corresponding to at least one target crystal oscillator is obtained, the data of the corresponding process factor dimension is integrated into the first temperature frequency data of each target crystal oscillator, the two-dimensional data of the output frequency and temperature is expanded to three-dimensional data, and then the three-dimensional data is fitted to obtain a three-dimensional surface equation, so as to better take into account the influence of process deviation on output frequency offset. Further, the second temperature frequency data of the crystal oscillator to be compensated is substituted into the three-dimensional surface equation, and its dimension is reduced to the temperature-frequency two-dimensional curve equation. By reducing the dimension to the two-dimensional curve equation based on the three-dimensional surface equation, only a small amount of temperature frequency data of the crystal oscillator to be compensated needs to be measured, and no more temperature frequency data needs to be measured, so as to determine the curve of the output frequency of the crystal oscillator to be compensated with temperature, so that the output frequency of the crystal oscillator to be compensated at different temperatures can be accurately determined according to the temperature-frequency two-dimensional curve equation, and then targeted temperature compensation processing can be performed, thereby improving the efficiency of crystal oscillator temperature compensation.

[0007] Optionally, obtaining corresponding three-dimensional data based on the first temperature-frequency data of each target crystal oscillator specifically includes: Determine a corresponding first variation curve according to the first temperature frequency data of each target crystal oscillator, wherein the first variation curve is a variation curve of the output frequency of the corresponding target crystal oscillator with temperature; Selecting a first target temperature interval from the preset temperature interval, and extracting the slope of a portion of each first change curve corresponding to the first target temperature interval, wherein each first change curve has the highest linearity in the first target temperature interval; Normalizing each of the slopes to obtain a first process factor of a corresponding target crystal oscillator; Different temperatures in the preset temperature range and the first process factor of each target crystal oscillator are determined as independent variables, and the output frequency of the corresponding target crystal oscillator at different temperatures is determined as a dependent variable to obtain corresponding three-dimensional data.

[0008] By adopting the above technical solution, the linearity of the first change curve corresponding to each target crystal oscillator in the first target temperature range is the highest, and the slope of the partial curve corresponding to the first target temperature range in each first change curve can more intuitively reflect the impact of process deviation on the temperature-frequency characteristics of each target crystal oscillator, and then determine the first process factor of each target crystal oscillator according to the slope. Finally, the first process factor of each target crystal oscillator is integrated into the corresponding two-dimensional data of temperature frequency and expanded into three-dimensional data, so as to facilitate the subsequent determination of the three-dimensional surface equation.

[0009] Optionally, obtaining the temperature-frequency two-dimensional curve equation corresponding to the crystal oscillator to be compensated based on each of the second temperature-frequency data and the three-dimensional surface equation specifically includes: Based on the least squares method, each of the second temperature frequency data is substituted into the three-dimensional surface equation to determine the target process factor corresponding to the crystal oscillator to be compensated; Substituting the target process factor into the three-dimensional surface equation, a two-dimensional temperature-frequency curve equation corresponding to the crystal oscillator to be compensated is obtained.

[0010] By adopting the above technical solution, the second temperature-frequency data is substituted into the three-dimensional surface equation, and based on the least squares method, the target process factor corresponding to the crystal oscillator to be compensated is determined, and then the target process factor is substituted into the three-dimensional surface equation to obtain the temperature-frequency two-dimensional curve equation after dimensionality reduction. Therefore, by only measuring the output frequency data of a few temperature points, the temperature-frequency two-dimensional curve equation of the crystal oscillator to be compensated can be quickly determined, which facilitates more efficient temperature compensation based on the temperature-frequency two-dimensional curve equation.

[0011] Optionally, the method further includes: Acquire at least one set of third temperature frequency data after temperature compensation of the crystal oscillator to be compensated; Based on each of the third temperature-frequency data, a corresponding second variation curve is obtained, and the second variation curve is fitted with a preset reference variation curve to obtain a first overall fitting rate, wherein the reference variation curve is a curve of output frequency variation with temperature that meets the requirements of temperature compensation; If the first overall fitting rate does not exceed a preset fitting rate threshold, a second target temperature interval and a third target temperature interval are selected from the preset temperature interval, the temperature in the second target temperature interval is lower than the temperature in the first target temperature interval, and the temperature in the third target temperature interval is higher than the first target temperature interval; Calculate a first fitting rate of the reference change curve and the second change curve in the first target temperature range, calculate a second fitting rate of the reference change curve and the second change curve in the second target temperature range, calculate a third fitting rate of the reference change curve and the second change curve in the third target temperature range, and adjust the three-dimensional surface equation according to the first fitting rate, the second fitting rate and the third fitting rate to re-temperature compensate the crystal oscillator to be compensated.

[0012] By adopting the above technical solution, if the first overall fitting rate does not exceed the fitting rate threshold, it indicates that according to the temperature-frequency two-dimensional curve equation, the effect of temperature compensation on the crystal oscillator to be compensated is poor, and the output frequency offset is still large. Further, the fitting rates of the reference change curve and the second change curve in the first target temperature interval, the second target temperature interval, and the third target temperature interval are determined to reflect the temperature compensation effect of this temperature compensation in different temperature intervals. Finally, based on the first fitting rate, the second fitting rate, and the third fitting rate, the three-dimensional surface equation is adjusted to ensure that the compensation effect of the re-temperature compensation in each temperature interval is as good as possible.

[0013] Optionally, adjusting the three-dimensional surface equation according to the first fitting rate, the second fitting rate, and the third fitting rate to re-temperature compensate the crystal oscillator to be compensated specifically includes: When neither the second fitting rate nor the third fitting rate exceeds the fitting rate threshold and the first fitting rate exceeds the fitting rate threshold, determining a first weight and a second weight according to a proportional relationship between the second fitting rate and the third fitting rate, wherein the sum of the first weight and the second weight is 1, and the greater the second fitting rate, the smaller the corresponding first weight; For the same first variation curve, determining a corresponding second process factor according to a corresponding portion of the curve in the second target temperature interval, and determining a corresponding third process factor according to a corresponding portion of the curve in the third target temperature interval; Summing the product of the first weight and the second process factor and the product of the second weight and the third process factor to obtain a weighted summation result, and performing weighted summation on the weighted summation result and the first process factor of the same first change curve to obtain a new process factor of the corresponding target crystal oscillator; The three-dimensional surface equation is adjusted according to the new process factors of each target crystal oscillator.

[0014] By adopting the above technical solution, when the second fitting rate and the third fitting rate do not exceed the fitting rate threshold and the first fitting rate exceeds the fitting rate threshold, it means that the accuracy and rationality of the first process factor determined by the partial curve of the first target temperature range are poor, and the first process factor needs to be adjusted. Then, the proportional relationship between the second fitting rate and the third fitting rate is determined, so as to reflect the effect of output frequency compensation of the crystal oscillator to be compensated in the second target temperature range and the third target temperature range when temperature compensation is performed based on the three-dimensional surface equation. Further, the second process factor and the third process factor are weighted and summed by the first weight and the second weight to obtain the weighted summation result. Finally, the first process factor and the weighted summation result of the same first change curve are weighted and summed to obtain a new process factor for each target crystal oscillator, and the three-dimensional surface equation is adjusted, so as to ultimately improve the effect of re-temperature compensation.

[0015] Optionally, the method further includes: Acquire at least one set of fourth temperature frequency data after temperature compensation of the crystal oscillator to be compensated; Based on each of the fourth temperature-frequency data, a corresponding third variation curve is obtained, and the third variation curve is fitted with a preset reference variation curve to obtain a second overall fitting rate, wherein the reference variation curve is a curve of the output frequency varying with temperature with the temperature compensation meeting the requirements; If the second overall fitting rate does not exceed a preset fitting rate threshold, determining at least one target output frequency based on a target partial curve in the third variation curve, wherein a fitting rate between the target partial curve and a corresponding partial curve in the reference variation curve exceeds a preset fitting rate threshold; Based on each of the target output frequencies and the three-dimensional surface equation, the crystal oscillator to be compensated is temperature compensated again.

[0016] By adopting the above technical solution, if the second overall fitting rate does not exceed the preset fitting rate threshold, it means that the similarity between the third change curve and the reference change curve is poor, which further indicates that according to the temperature-frequency two-dimensional curve equation, the effect of temperature compensation for the crystal oscillator to be compensated is poor, and the output frequency offset is still large. Then, based on the target partial curve in the third change curve, at least one target output frequency is determined, that is, the output frequency with a smaller offset. Finally, according to the target output frequency and the three-dimensional surface equation, the change of the output frequency of the crystal oscillator to be compensated with temperature is accurately re-determined, thereby achieving better temperature compensation.

[0017] Optionally, re-performing temperature compensation on the crystal oscillator to be compensated based on each of the target output frequencies and the three-dimensional surface equation specifically includes: Averaging the target output frequencies to obtain a suitable output frequency, and substituting the suitable output frequency into the three-dimensional surface equation to obtain a target two-dimensional curve equation, wherein the target two-dimensional curve equation is a curve showing a change in the process factor of the crystal oscillator to be compensated with temperature; Performing linear fitting on the target two-dimensional curve to obtain a constant function parallel to the x-axis, and determining a final process factor corresponding to the crystal oscillator to be compensated according to the constant function; Substituting the final process factor into the three-dimensional surface equation to obtain a final temperature-frequency two-dimensional curve equation corresponding to the crystal oscillator to be compensated; Based on the final temperature-frequency two-dimensional curve equation, the crystal oscillator to be compensated is temperature compensated again.

[0018] By adopting the above technical solution, the appropriate output frequency is substituted into the three-dimensional surface equation to obtain the target two-dimensional curve equation, that is, the curve of the process factor of the crystal oscillator to be compensated with temperature. Thus, when the temperature compensation effect is good and the output frequency offset is small, the change of the process factor of the crystal oscillator to be compensated with temperature is determined. Further, the target two-dimensional curve equation is linearly fitted to obtain a constant function parallel to the x-axis, which is finally determined as the final process factor, which helps to make the output frequency offset of the crystal oscillator to be compensated smaller at more temperatures. Finally, this final process factor is substituted into the three-dimensional surface equation, and the dimension is reduced to obtain the final temperature-frequency two-dimensional curve equation corresponding to the crystal oscillator to be compensated, that is, the curve of the output frequency of the crystal oscillator to be compensated with temperature. Furthermore, based on this final temperature-frequency two-dimensional curve equation, the crystal oscillator to be compensated is re-temperature compensated to improve the effect of temperature compensation.

[0019] In a second aspect of the present application, a crystal oscillator temperature compensation device is provided, specifically comprising: A data acquisition module, used to acquire first temperature-frequency data corresponding to at least one target crystal oscillator in the same batch of crystal oscillators, wherein the first temperature-frequency data includes different temperatures in a preset temperature range and the output frequencies of the corresponding target crystal oscillators at different temperatures; A surface fitting module, for obtaining corresponding three-dimensional data based on the first temperature-frequency data of each target crystal oscillator, and fitting a three-dimensional surface equation based on each of the three-dimensional data, wherein the three-dimensional data includes data of the corresponding target crystal oscillator in three dimensions: temperature, corresponding output frequency and process factor, wherein the process factor represents the influence of process deviation on the deviation of the temperature-frequency characteristic of the target crystal oscillator; A curve determination module, used to obtain at least one set of second temperature-frequency data of the crystal oscillator to be compensated, and obtain a temperature-frequency two-dimensional curve equation corresponding to the crystal oscillator to be compensated based on each of the second temperature-frequency data and the three-dimensional surface equation, wherein the second temperature-frequency data includes a single temperature in the preset temperature range and the output frequency of the crystal oscillator to be compensated corresponding to the single temperature, and the independent variable of the temperature-frequency two-dimensional curve equation is the temperature, and the dependent variable is the output frequency corresponding to the crystal oscillator to be compensated; The temperature compensation module is used to perform temperature compensation on the crystal oscillator to be compensated based on the temperature-frequency two-dimensional curve equation.

[0020] By adopting the above technical solution, the data acquisition module obtains the first temperature-frequency data of the target crystal oscillator, and the surface fitting module fits the three-dimensional surface equation based on each three-dimensional data. Then, the curve determination module obtains the two-dimensional temperature-frequency curve equation corresponding to the crystal oscillator to be compensated according to each second temperature-frequency data and the three-dimensional surface equation. Finally, the temperature compensation module performs temperature compensation on the crystal oscillator to be compensated based on the two-dimensional temperature-frequency curve equation.

[0021] In a third aspect of the present application, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is loaded and executed by a processor, the method steps described in any one of the first aspects are performed.

[0022] In a fourth aspect of the present application, an electronic device is provided, specifically comprising: A processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the processor is used to load and execute the computer program stored in the memory so that the electronic device performs the method as described in any one of the first aspects.

[0023] In summary, the present application includes at least one of the following beneficial technical effects: integrating the data of the corresponding process factor dimension into the first temperature frequency data of each target crystal oscillator, expanding the two-dimensional data of the output frequency and temperature to three-dimensional data, and then fitting the three-dimensional data to obtain a three-dimensional surface equation, so as to better take into account the influence of process deviation on the output frequency offset. Furthermore, the second temperature frequency data of the crystal oscillator to be compensated is substituted into the three-dimensional surface equation, and its dimension is reduced to a temperature-frequency two-dimensional curve equation. By reducing the dimension to the two-dimensional curve equation based on the three-dimensional surface equation, only a small amount of temperature frequency data of the crystal oscillator to be compensated needs to be measured, and no more temperature frequency data needs to be measured, so as to determine the curve of the output frequency of the crystal oscillator to be compensated with temperature, so that the output frequency of the crystal oscillator to be compensated at different temperatures can be accurately determined according to the temperature-frequency two-dimensional curve equation, and then targeted temperature compensation processing can be performed, thereby improving the efficiency of temperature compensation of the crystal oscillator. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 It is a flow chart of a crystal oscillator temperature compensation method provided in an embodiment of the present application; Figure 2 It is a flow chart of another crystal oscillator temperature compensation method provided in an embodiment of the present application; Figure 3 It is a structural schematic diagram of a crystal oscillator temperature compensation device provided in an embodiment of the present application; Figure 4 It is a structural schematic diagram of another crystal oscillator temperature compensation device provided in an embodiment of the present application.

[0025] Explanation of the accompanying drawings: 11. Data acquisition module; 12. Surface fitting module; 13. Curve determination module; 14. Temperature compensation module; 15. First compensation module; 16. Second compensation module. DETAILED DESCRIPTION

[0026] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments.

[0027] In the description of the embodiments of the present application, words such as "illustrative", "for example" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "illustrative", "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "illustrative", "for example" or "for example" is intended to present related concepts in a concrete way.

[0028] In the description of the embodiments of the present application, the term "and / or" is only a kind of association relationship describing the associated objects, indicating that there may be three kinds of relationships, for example, A and / or B, which can represent: A exists alone, B exists alone, and A and B exist at the same time. In addition, unless otherwise specified, the meaning of the term "multiple" refers to two or more. For example, multiple systems refer to two or more systems, and multiple screen terminals refer to two or more screen terminals. In addition, the terms "first" and "second" are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the indicated technical features. Thus, the features defined as "first" and "second" can explicitly or implicitly include one or more of the features. The terms "include", "comprise", "have" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.

[0029] See also Figure 1 The present application discloses a flow chart of a crystal oscillator temperature compensation method, which can be implemented by a computer program or run on a crystal oscillator temperature compensation device based on the von Neumann system. The computer program can be integrated into an application or run as an independent tool application, specifically including: S101: Acquire first temperature frequency data corresponding to at least one target crystal oscillator in the same batch of crystal oscillators.

[0030] Specifically, in an embodiment of the present application, the first temperature frequency data refers to the output frequency of a single target crystal oscillator at different temperatures in a preset temperature range and at different temperatures. The output frequency of the target crystal oscillator refers to the frequency of the periodic clock signal it generates. Once the output frequency is offset, it will have many effects on the clock signal, so that when the crystal oscillator is used as the main clock source, the system timing accuracy of the electronic system using the crystal oscillator is poor. The target crystal oscillator is a crystal oscillator randomly sampled from crystal oscillators produced in the same production batch to measure the output frequency at different temperatures. Among them, the preset temperature range is -50℃~100℃, and the different temperatures corresponding to the different output frequencies of the target crystal oscillator can be -50℃, 24℃, 26℃, 50℃ and 100℃. In other embodiments, it can also be other more temperatures.

[0031] A feasible way to obtain the first temperature frequency data is to place the target crystal oscillator in a constant temperature box, adjust the temperature of the constant temperature box to different temperatures in a preset range, and then obtain the output frequency of each target crystal oscillator at different temperatures in the preset temperature range through a frequency meter or oscilloscope connected to the target crystal oscillator. This is a prior art and will not be described in detail here.

[0032] S102: Based on the first temperature-frequency data of each target crystal oscillator, corresponding three-dimensional data is obtained, and based on each three-dimensional data, a three-dimensional surface equation is fitted, wherein the three-dimensional data includes data of the corresponding target crystal oscillator in three dimensions: temperature, corresponding output frequency and process factor.

[0033] Specifically, in an embodiment of the present application, the process factor characterizes the degree of influence of the process deviation on the deviation of the temperature-frequency characteristic of the target crystal oscillator. The process deviation refers to the AT cutting angle deviation of the target crystal oscillator, that is, during the cutting process of the quartz crystal, the angle between the cutting surface and the main axis of the crystal deviates from the ideal standard angle of 35°15'. This deviation will have a significant impact on the performance of the target crystal oscillator, including the stability of the output frequency. In addition, the temperature-frequency characteristic refers to the characteristic that the output frequency of the crystal oscillator changes with the ambient temperature. The larger the process factor, the greater the deviation of the output frequency of the crystal oscillator when the temperature remains unchanged. After the first temperature-frequency data is determined, for a single target crystal oscillator, a corresponding first change curve is drawn through a preset MATLAB tool and based on the corresponding first temperature-frequency data. The first change curve is a curve of the output frequency of the corresponding target crystal oscillator changing with temperature. Further, a first target temperature interval is selected from the preset temperature interval, and the first target temperature interval is 0~50℃, which represents the medium temperature interval of the target crystal oscillator. In this first target temperature interval, the linearity of the first change curve corresponding to each target crystal oscillator is the highest, that is, the partial curve of the first change curve corresponding to each target crystal oscillator in this first target temperature interval is closest to a straight line. Further, the first temperature frequency data of each target crystal oscillator in this first target temperature interval is selected, and the data is fitted through the two Python libraries NumPy and SciPy to obtain a first-order function of the output frequency of each target crystal oscillator in this first target temperature interval as the temperature changes, and the k value in the first-order function is determined as the corresponding slope, that is, the slope of the partial curve corresponding to the first target temperature interval in each first change curve, thereby more intuitively reflecting the impact of process deviation on the temperature-frequency characteristics of each target crystal oscillator.

[0034] Furthermore, the slopes of some curves in the first target temperature range in the first change curve of each target crystal oscillator are normalized to obtain the first process factor corresponding to each target crystal oscillator, thereby reducing the error of the process factor of each target crystal oscillator. A feasible normalization method is: normalize each slope through the preset OmicShareTools tool to finally obtain the corresponding first process factor. Finally, the different temperatures in the preset temperature range (different temperatures in the first temperature frequency data) and the first process factor of each target crystal oscillator are determined as independent variables, and the output frequency of the corresponding target crystal oscillator at different temperatures is used as the dependent variable. The data of these three dimensions (temperature, corresponding output frequency and process factor) are determined as three-dimensional data of each target crystal oscillator, thereby realizing the expansion of the first temperature frequency data (two-dimensional data) of each target crystal oscillator into three-dimensional data.

[0035] Furthermore, based on the three-dimensional data of each target crystal oscillator, the corresponding three-dimensional surface equation is fitted through the curve fitting toolbox (cftool) in the MATLAB tool, so as to better describe the corresponding changes in the output frequency of the crystal oscillator when the temperature and process factors change.

[0036] S103: Acquire at least one set of second temperature-frequency data of the crystal oscillator to be compensated, and obtain a temperature-frequency two-dimensional curve equation corresponding to the crystal oscillator to be compensated based on each set of second temperature-frequency data and the three-dimensional surface equation.

[0037] Specifically, after the three-dimensional surface equation corresponding to the crystal oscillator is determined, at least one set of second temperature-frequency data of the crystal oscillator to be compensated is obtained. The acquisition method can be referred to step S101, which will not be repeated here. Among them, the crystal oscillator to be compensated refers to the crystal oscillator that currently needs to be temperature compensated, and the second temperature-frequency data includes a single temperature in a preset temperature range and the output frequency of the crystal oscillator to be compensated at a single temperature. Further, the second temperature-frequency data is substituted into the three-dimensional surface equation, and at the same time, based on the least squares method, the target process factor corresponding to the crystal oscillator to be compensated is determined, and then the target process factor is substituted into the three-dimensional surface equation to obtain the temperature-frequency two-dimensional curve equation after dimensionality reduction, so that the temperature-frequency two-dimensional curve equation of the crystal oscillator to be compensated can be quickly determined by measuring the output frequency data of fewer temperature points. Among them, the independent variable of the temperature-frequency two-dimensional curve equation is temperature, and the dependent variable is the output frequency corresponding to the crystal oscillator to be compensated. In addition, the surface equation describing the three-dimensional space can be converted into a two-dimensional curve equation involving only two variables by the least squares method.

[0038] S104: Performing temperature compensation on the crystal oscillator to be compensated based on the temperature-frequency two-dimensional curve equation.

[0039] Specifically, after the temperature-frequency two-dimensional curve equation of the crystal oscillator to be compensated is obtained, the current ambient temperature is obtained through a preset temperature sensor, and then the current ambient temperature is substituted into the temperature-frequency two-dimensional curve equation to obtain the actual uncompensated output frequency of the crystal oscillator to be compensated, and then the actual output frequency is subtracted from the nominal frequency to obtain the frequency compensation value, and finally the frequency compensation value is written into the preset compensation register, thereby achieving the effect of temperature compensation for the crystal oscillator to be compensated. Among them, the compensation register is a storage unit built into the control circuit of the crystal oscillator to be compensated, which is used to store the frequency compensation value and adjust the output frequency to offset the impact of temperature changes. This is a prior art and will not be repeated here.

[0040] In other embodiments, at least one set of third temperature-frequency data after temperature compensation of the crystal oscillator to be compensated is obtained, and the third temperature-frequency data includes a single temperature of the crystal oscillator to be compensated after temperature compensation in a preset temperature range and the corresponding output frequency. Through the MATLAB tool, based on each third temperature-frequency data, the corresponding second change curve is drawn, that is, the change curve of the output frequency of the crystal oscillator to be compensated after temperature compensation with temperature. And the second change curve is fitted with the preset reference change curve to obtain the first overall fitting rate, and the reference change curve is the curve of the output frequency with temperature that meets the requirements of temperature compensation. If the first overall fitting rate does not exceed the fitting rate threshold, it indicates that according to the temperature-frequency two-dimensional curve equation, the effect of temperature compensation for the crystal oscillator to be compensated is poor, and the offset of the output frequency is still large, then the second target temperature range and the third target temperature range are selected from the preset temperature range, the temperature in the second target temperature range is lower than the temperature in the first target temperature range, and the temperature in the third target temperature range is higher than the first target temperature range. The second target temperature range is -50℃~-30℃, which can be understood as the low temperature range of the crystal oscillator; the second target temperature range is 80℃~100℃, which can be understood as the high temperature range of the crystal oscillator.

[0041] Further, the first fitting rate of the reference change curve and the second change curve in the first target temperature interval, the second fitting rate of the reference change curve and the second change curve in the second target temperature interval, and the third fitting rate of the reference change curve and the second change curve in the third target temperature interval are determined by the MATLAB tool. Then, according to the first fitting rate, the second fitting rate and the third fitting rate, the three-dimensional surface equation is adjusted to re-temperature compensate the crystal oscillator to be compensated. An achievable implementation method is: the first fitting rate, the second fitting rate and the third fitting rate are respectively compared with the fitting rate threshold. When the second fitting rate and the third fitting rate do not exceed the fitting rate threshold and the first fitting rate exceeds the fitting rate threshold, it means that the accuracy and rationality of the first process factor determined by the partial curve of the first target temperature interval are poor, and the first process factor needs to be adjusted. Then the proportional relationship between the second fitting rate and the third fitting rate is determined, thereby reflecting the effect of output frequency compensation of the crystal oscillator to be compensated in the second target temperature interval and the third target temperature interval when temperature compensation is performed based on the three-dimensional surface equation. According to the proportional relationship, the first weight and the second weight are determined. The larger the second fitting rate, the smaller the corresponding first weight; the larger the weight, the worse the corresponding output frequency compensation effect. The sum of the first weight and the second weight is 1. Exemplarily, the ratio is 3:2, then the first weight is 0.4 and the second weight is 0.6, indicating that the output frequency compensation effect for the second target temperature range is better than the output frequency compensation effect for the third target temperature range.

[0042] Further, for the same first change curve, according to its partial curve in the second target temperature range, extract the corresponding slope, and determine the corresponding second process factor; according to its partial curve in the third target temperature range, extract the corresponding slope, and determine the corresponding third process factor, specifically refer to step S102, which will not be repeated here. Further, the product of the first weight and the second process factor, and the product of the second weight and the third process factor are summed to obtain a weighted summation result. Further, the first process factor and the weighted summation result of the same first change curve are weighted summed. Among them, the total first temperature difference between the second target temperature range and the third target temperature range is calculated, and the weight corresponding to the weighted summation result and the first process factor is determined according to the ratio of the first temperature difference and the second temperature difference of the first target temperature range. The larger the first temperature difference, the larger the weight corresponding to the weighted summation result; the larger the second temperature difference, the larger the weight of the first process factor. Thereby, the new process factor of the corresponding target crystal oscillator is determined more accurately.

[0043] Furthermore, different temperatures in the preset temperature range, the new process factors of each target crystal oscillator, and the output frequencies of the corresponding target crystal oscillators at different temperatures are determined as three-dimensional data, and a new three-dimensional surface equation is refitted to adjust the three-dimensional surface equation. Finally, based on the new three-dimensional surface equation, a new temperature-frequency two-dimensional curve equation is obtained, and the crystal oscillator to be compensated is re-temperature compensated. For details, please refer to steps S103-S104, which will not be repeated here.

[0044] See also Figure 2 The present application embodiment discloses a flow chart of another crystal oscillator temperature compensation method, which can be implemented by a computer program or run on a crystal oscillator temperature compensation device based on the von Neumann system. The computer program can be integrated into an application or run as an independent tool application, specifically including: S201: Acquire first temperature frequency data corresponding to at least one target crystal oscillator in the same batch of crystal oscillators.

[0045] S202: Based on the first temperature-frequency data of each target crystal oscillator, corresponding three-dimensional data is obtained, and based on each three-dimensional data, a three-dimensional surface equation is fitted, wherein the three-dimensional data includes data of the corresponding target crystal oscillator in three dimensions: temperature, corresponding output frequency and process factor.

[0046] S203: Acquire at least one set of second temperature-frequency data of the crystal oscillator to be compensated, and obtain a temperature-frequency two-dimensional curve equation corresponding to the crystal oscillator to be compensated based on each set of second temperature-frequency data and the three-dimensional surface equation.

[0047] S204: Performing temperature compensation on the crystal oscillator to be compensated based on the temperature-frequency two-dimensional curve equation.

[0048] For details, please refer to steps S101-S104, which will not be described in detail here.

[0049] S205: Obtain at least one set of fourth temperature frequency data after temperature compensation of the crystal oscillator to be compensated.

[0050] S206: Based on each fourth temperature-frequency data, a corresponding third change curve is obtained, and the third change curve is fitted with a preset reference change curve to obtain a second overall fitting rate, where the reference change curve is a curve of output frequency changing with temperature that meets the temperature compensation requirements.

[0051] S207: If the second overall fitting rate does not exceed the preset fitting rate threshold, at least one target output frequency is determined based on the target partial curve in the third change curve, and the fitting rate of the target partial curve and the corresponding partial curve in the reference change curve exceeds the preset fitting rate threshold.

[0052] S208: Based on each target output frequency and the three-dimensional surface equation, re-temperature compensate the crystal oscillator to be compensated.

[0053] Specifically, at least one set of fourth temperature frequency data after temperature compensation of the crystal oscillator to be compensated is obtained. The acquisition method can be referred to step S101 and will not be repeated here. The fourth temperature frequency data includes a single temperature of the crystal oscillator to be compensated in a preset temperature range after temperature compensation and the corresponding output frequency. Based on each fourth temperature frequency data, curve fitting is performed through the curve fitting toolbox (cftool) in the MATLAB tool to obtain a corresponding third change curve, and the third change curve is a curve of the output frequency of the crystal oscillator to be compensated after temperature compensation with temperature. Further, the third change curve is fitted with a preset reference change curve through the MATLAB tool to obtain a second overall fitting rate, wherein the reference change curve is a curve of the output frequency with temperature that meets the requirements of temperature compensation, wherein the temperature compensation meets the requirements means that the output frequencies at each temperature in the preset temperature range after temperature compensation are within a reasonable frequency range.

[0054] Furthermore, if the second overall fitting rate does not exceed the preset fitting rate threshold, it means that the similarity between the third change curve and the reference change curve is poor, which further indicates that according to the temperature-frequency two-dimensional curve equation, the effect of temperature compensation for the crystal oscillator to be compensated is poor, and the output frequency offset is still large. Then, based on the target partial curve in the third change curve, at least one target output frequency is determined. A feasible determination method is: divide the preset temperature interval into a preset number of sub-temperature intervals, and then fit the third change curve and the reference change curve in the same sub-temperature interval. If the fitting rate exceeds the preset fitting rate threshold, it means that the output frequency offset of the crystal oscillator to be compensated in the corresponding sub-temperature interval is small, then the third change curve in the corresponding sub-temperature interval is determined as the target partial curve. Finally, at least one temperature point in the sub-temperature interval corresponding to the target partial curve is input to the third change curve to obtain at least one target output frequency, that is, an output frequency with a small temperature offset.

[0055] Further, the target output frequencies are averaged to obtain the appropriate output frequency, and then the appropriate output frequency is substituted into the three-dimensional surface equation to obtain the target two-dimensional curve equation with only two variables, process factor and temperature, that is, the curve of the process factor of the crystal oscillator to be compensated with temperature. Thus, when the temperature compensation effect is good and the output frequency offset is small, the change of the process factor of the crystal oscillator to be compensated with temperature is determined. Further, the target two-dimensional curve equation is linearly fitted by the curve fitting toolbox (cftool) in MATLAB to obtain a constant function f(x)= c parallel to the x-axis, where c represents a constant. For example, the constant function can be f(x)=20. Further, the constant in the constant function is determined as the final process factor of the crystal oscillator to be compensated, that is, the value around which the corresponding process factor fluctuates when the output frequency offset is small. Determining it as the final process factor helps to make the output frequency offset of the crystal oscillator to be compensated smaller at more temperatures. Finally, the final process factor is substituted into the three-dimensional surface equation, and based on the least squares method, the dimension is reduced to obtain the final temperature-frequency two-dimensional curve equation corresponding to the crystal oscillator to be compensated, that is, the output frequency of the crystal oscillator to be compensated changes with temperature. Further, based on this final temperature-frequency two-dimensional curve equation, the crystal oscillator to be compensated is re-temperature compensated, and the details can be seen in step S104, which will not be repeated here.

[0056] The implementation principle of the crystal oscillator temperature compensation method of the embodiment of the present application is: the first temperature frequency data of each target crystal oscillator is integrated with the data of the corresponding process factor dimension, the two-dimensional data of the output frequency and temperature is expanded to three-dimensional data, and then the three-dimensional data is fitted to obtain a three-dimensional surface equation, so as to better take into account the influence of the process deviation on the output frequency offset. Further, the second temperature frequency data of the crystal oscillator to be compensated is substituted into the three-dimensional surface equation, and its dimension is reduced to a temperature-frequency two-dimensional curve equation. By reducing the dimension to the two-dimensional curve equation based on the three-dimensional surface equation, only a small amount of temperature frequency data of the crystal oscillator to be compensated needs to be measured, and no more temperature frequency data needs to be measured, so as to determine the curve of the output frequency of the crystal oscillator to be compensated with temperature, so that the output frequency of the crystal oscillator to be compensated at different temperatures can be accurately determined according to the temperature-frequency two-dimensional curve equation, and then targeted temperature compensation processing can be performed, thereby improving the efficiency of crystal oscillator temperature compensation.

[0057] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.

[0058] See also Figure 3, is a schematic diagram of the structure of the crystal oscillator temperature compensation device provided in the embodiment of the present application. The device applied to the crystal oscillator temperature compensation device can be implemented as all or part of the device through software, hardware or a combination of both. The device includes a data acquisition module 11, a surface fitting module 12, a curve determination module 13 and a temperature compensation module 14.

[0059] The data acquisition module 11 is used to acquire first temperature-frequency data corresponding to at least one target crystal oscillator in the same batch of crystal oscillators, wherein the first temperature-frequency data includes different temperatures in a preset temperature range and the output frequencies of the corresponding target crystal oscillators at different temperatures; The surface fitting module 12 is used to obtain corresponding three-dimensional data based on the first temperature-frequency data of each target crystal oscillator, and to obtain a three-dimensional surface equation by fitting based on each three-dimensional data, wherein the three-dimensional data includes data of the corresponding target crystal oscillator in three dimensions: temperature, corresponding output frequency and process factor, wherein the process factor represents the influence of process deviation on the deviation of the temperature-frequency characteristic of the target crystal oscillator; The curve determination module 13 is used to obtain at least one set of second temperature-frequency data of the crystal oscillator to be compensated, and obtain a temperature-frequency two-dimensional curve equation corresponding to the crystal oscillator to be compensated based on each second temperature-frequency data and the three-dimensional surface equation, wherein the second temperature-frequency data includes a single temperature in a preset temperature range and the output frequency of the crystal oscillator to be compensated corresponding to the single temperature, and the independent variable of the temperature-frequency two-dimensional curve equation is the temperature, and the dependent variable is the output frequency corresponding to the crystal oscillator to be compensated; The temperature compensation module 14 is used to perform temperature compensation on the crystal oscillator to be compensated based on a temperature-frequency two-dimensional curve equation.

[0060] Optionally, the surface fitting module 12 is specifically used for: Determine a corresponding first variation curve according to the first temperature frequency data of each target crystal oscillator, where the first variation curve is a variation curve of the output frequency of the corresponding target crystal oscillator with temperature; Selecting a first target temperature interval from the preset temperature intervals, and extracting the slope of a portion of each first change curve corresponding to the first target temperature interval, wherein each first change curve has the highest linearity in the first target temperature interval; Normalizing each slope to obtain a first process factor of a corresponding target crystal oscillator; Different temperatures in a preset temperature range and a first process factor of each target crystal oscillator are determined as independent variables, and the output frequency of the corresponding target crystal oscillator at different temperatures is determined as a dependent variable to obtain corresponding three-dimensional data.

[0061] Optionally, the curve determination module 13 is specifically used for: Based on the least squares method, each second temperature frequency data is substituted into the three-dimensional surface equation to determine the target process factor corresponding to the crystal oscillator to be compensated; Substituting the target process factor into the three-dimensional surface equation, the temperature-frequency two-dimensional curve equation corresponding to the crystal oscillator to be compensated is obtained.

[0062] Optional, such as Figure 4 As shown, the device further includes a first compensation module 15, which is specifically used for: Acquire at least one set of third temperature frequency data after temperature compensation of the crystal oscillator to be compensated; Based on each third temperature-frequency data, a corresponding second variation curve is obtained, and the second variation curve is fitted with a preset reference variation curve to obtain a first overall fitting rate, wherein the reference variation curve is a curve of an output frequency variation with temperature that meets the requirements of temperature compensation; If the first overall fitting rate does not exceed the preset fitting rate threshold, a second target temperature interval and a third target temperature interval are selected from the preset temperature interval, the temperature in the second target temperature interval is lower than the temperature in the first target temperature interval, and the temperature in the third target temperature interval is higher than the first target temperature interval; A first fitting rate of the reference change curve and the second change curve in the first target temperature interval is calculated, a second fitting rate of the reference change curve and the second change curve in the second target temperature interval is calculated, and a third fitting rate of the reference change curve and the second change curve in the third target temperature interval is calculated. According to the first fitting rate, the second fitting rate and the third fitting rate, the three-dimensional surface equation is adjusted to re-temperature compensate the crystal oscillator to be compensated.

[0063] Optionally, the first compensation module 15 is specifically used for: When the second fitting rate and the third fitting rate both do not exceed the fitting rate threshold and the first fitting rate exceeds the fitting rate threshold, the first weight and the second weight are determined according to the proportional relationship between the second fitting rate and the third fitting rate, the sum of the first weight and the second weight is 1, and the larger the second fitting rate is, the smaller the corresponding first weight is; For the same first variation curve, a corresponding second process factor is determined according to a corresponding portion of the curve in the second target temperature interval, and a corresponding third process factor is determined according to a corresponding portion of the curve in the third target temperature interval; The product of the first weight and the second process factor and the product of the second weight and the third process factor are summed to obtain a weighted summation result, and the weighted summation result and the first process factor of the same first variation curve are weighted summed to obtain a new process factor of the corresponding target crystal oscillator; The three-dimensional surface equation is adjusted according to the new process factors of each target crystal oscillator.

[0064] Optionally, the device further includes a second compensation module 16, which is specifically used to: Acquire at least one set of fourth temperature frequency data after temperature compensation of the crystal oscillator to be compensated; Based on each fourth temperature-frequency data, a corresponding third variation curve is obtained, and the third variation curve is fitted with a preset reference variation curve to obtain a second overall fitting rate, where the reference variation curve is a curve of the output frequency varying with temperature with the temperature compensation meeting the requirements; If the second overall fitting rate does not exceed a preset fitting rate threshold, determining at least one target output frequency based on a target partial curve in the third variation curve, wherein a fitting rate between the target partial curve and a corresponding partial curve in the reference variation curve exceeds a preset fitting rate threshold; Based on each target output frequency and the three-dimensional surface equation, the crystal oscillator to be compensated is re-temperature compensated.

[0065] Optionally, the second compensation module 16 is specifically used for: The target output frequencies are averaged to obtain a suitable output frequency, and the suitable output frequency is substituted into the three-dimensional surface equation to obtain a target two-dimensional curve equation, which is a curve of the process factor of the crystal oscillator to be compensated varying with temperature; Performing linear fitting on the target two-dimensional curve to obtain a constant function parallel to the x-axis, and determining the final process factor corresponding to the crystal oscillator to be compensated according to the constant function; Substituting the final process factor into the three-dimensional surface equation, the final temperature-frequency two-dimensional curve equation corresponding to the crystal oscillator to be compensated is obtained; Based on the final temperature-frequency two-dimensional curve equation, the crystal oscillator to be compensated is temperature compensated again.

[0066] It should be noted that the crystal oscillator temperature compensation device provided in the above embodiment only uses the division of the above functional modules as an example when executing the crystal oscillator temperature compensation method. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the crystal oscillator temperature compensation device provided in the above embodiment and the crystal oscillator temperature compensation method embodiment belong to the same concept, and the implementation process thereof is detailed in the method embodiment, which will not be repeated here.

[0067] An embodiment of the present application further discloses a computer-readable storage medium, and the computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, a crystal oscillator temperature compensation method of the above embodiment is adopted.

[0068] Among them, the computer program can be stored in a computer-readable medium, the computer program includes computer program code, the computer program code can be in the form of source code, object code, executable file or certain middleware, etc. The computer-readable medium includes any entity or device that can carry the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the computer-readable medium includes but is not limited to the above-mentioned components.

[0069] Among them, through this computer-readable storage medium, a crystal oscillator temperature compensation method of the above embodiment is stored in a computer-readable storage medium, and is loaded and executed on a processor to facilitate the storage and application of the above method.

[0070] An embodiment of the present application further discloses an electronic device, wherein a computer program is stored in a computer-readable storage medium, and when the computer program is loaded and executed by a processor, the above-mentioned crystal oscillator temperature compensation method is adopted.

[0071] The electronic device may be a desktop computer, a laptop computer, a cloud server or other electronic device, and the electronic device includes but is not limited to a processor and a memory. For example, the electronic device may also include input and output devices, a network access device, and a bus.

[0072] Among them, the processor can adopt a central processing unit (CPU). Of course, according to actual usage, other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. can also be adopted. The general-purpose processor can adopt a microprocessor or any conventional processor, etc., and this application does not impose any restrictions on this.

[0073] Among them, the memory can be an internal storage unit of the electronic device, such as a hard disk or memory of the electronic device, or it can be an external storage device of the electronic device, such as a plug-in hard disk, a smart memory card (SMC), a secure digital card (SD) or a flash memory card (FC) equipped on the electronic device. Moreover, the memory can also be a combination of an internal storage unit and an external storage device of the electronic device. The memory is used to store computer programs and other programs and data required by the electronic device. The memory can also be used to temporarily store data that has been output or is to be output, and this application does not impose any restrictions on this.

[0074] Among them, through this electronic device, a crystal oscillator temperature compensation method of the above embodiment is stored in the memory of the electronic device, and is loaded and executed on the processor of the electronic device, which is convenient for use.

[0075] The above is only an exemplary embodiment of the present disclosure, and the scope of the present disclosure cannot be limited thereto. That is, any equivalent changes and modifications made according to the teachings of the present disclosure are still within the scope of the present disclosure. After considering the specification and practicing the disclosure here, those skilled in the art will easily think of other embodiments of the present disclosure. This application is intended to cover any modification, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary technical means in the technical field not recorded in the present disclosure. The description and examples are only regarded as exemplary, and the scope and spirit of the present disclosure are defined by the claims.

Claims

1. A crystal oscillator temperature compensation method, characterized in that: The method comprises: Acquire first temperature-frequency data corresponding to at least one target crystal oscillator in the same batch of crystal oscillators, wherein the first temperature-frequency data includes different temperatures in a preset temperature range and the output frequencies of the corresponding target crystal oscillators at the different temperatures; Based on the first temperature-frequency data of each of the target crystal oscillators, corresponding three-dimensional data are obtained, and based on each of the three-dimensional data, a three-dimensional surface equation is fitted, wherein the three-dimensional data includes data of the corresponding target crystal oscillator in three dimensions: temperature, corresponding output frequency, and process factor, wherein the process factor represents the degree of influence of process deviation on the deviation of the temperature-frequency characteristic of the target crystal oscillator; Acquire at least one set of second temperature-frequency data of the crystal oscillator to be compensated, and obtain a temperature-frequency two-dimensional curve equation corresponding to the crystal oscillator to be compensated based on each of the second temperature-frequency data and the three-dimensional surface equation, wherein the second temperature-frequency data includes a single temperature in the preset temperature range and the output frequency of the crystal oscillator to be compensated corresponding to the single temperature, and the independent variable of the temperature-frequency two-dimensional curve equation is the temperature, and the dependent variable is the output frequency corresponding to the crystal oscillator to be compensated; Based on the temperature-frequency two-dimensional curve equation, temperature compensation is performed on the crystal oscillator to be compensated.

2. The crystal oscillator temperature compensation method according to claim 1, characterized in that: The obtaining corresponding three-dimensional data based on the first temperature-frequency data of each target crystal oscillator specifically includes: Determine a corresponding first variation curve according to the first temperature frequency data of each target crystal oscillator, wherein the first variation curve is a variation curve of the output frequency of the corresponding target crystal oscillator with temperature; Selecting a first target temperature interval from the preset temperature interval, and extracting the slope of a portion of each first change curve corresponding to the first target temperature interval, wherein each first change curve has the highest linearity in the first target temperature interval; Normalizing each of the slopes to obtain a first process factor of a corresponding target crystal oscillator; Different temperatures in the preset temperature range and the first process factor of each target crystal oscillator are determined as independent variables, and the output frequency of the corresponding target crystal oscillator at different temperatures is determined as a dependent variable to obtain corresponding three-dimensional data.

3. The crystal oscillator temperature compensation method according to claim 1, characterized in that: The step of obtaining the temperature-frequency two-dimensional curve equation corresponding to the crystal oscillator to be compensated based on each of the second temperature-frequency data and the three-dimensional surface equation specifically includes: Based on the least squares method, each of the second temperature frequency data is substituted into the three-dimensional surface equation to determine the target process factor corresponding to the crystal oscillator to be compensated; Substituting the target process factor into the three-dimensional surface equation, a two-dimensional temperature-frequency curve equation corresponding to the crystal oscillator to be compensated is obtained.

4. The crystal oscillator temperature compensation method according to claim 2, characterized in that: The method further comprises: Acquire at least one set of third temperature frequency data after temperature compensation of the crystal oscillator to be compensated; Based on each of the third temperature-frequency data, a corresponding second variation curve is obtained, and the second variation curve is fitted with a preset reference variation curve to obtain a first overall fitting rate, wherein the reference variation curve is a curve of output frequency variation with temperature that meets the requirements of temperature compensation; If the first overall fitting rate does not exceed a preset fitting rate threshold, a second target temperature interval and a third target temperature interval are selected from the preset temperature interval, the temperature in the second target temperature interval is lower than the temperature in the first target temperature interval, and the temperature in the third target temperature interval is higher than the first target temperature interval; Calculate a first fitting rate of the reference change curve and the second change curve in the first target temperature range, calculate a second fitting rate of the reference change curve and the second change curve in the second target temperature range, calculate a third fitting rate of the reference change curve and the second change curve in the third target temperature range, and adjust the three-dimensional surface equation according to the first fitting rate, the second fitting rate and the third fitting rate to re-temperature compensate the crystal oscillator to be compensated.

5. The crystal oscillator temperature compensation method according to claim 4, characterized in that: The adjusting the three-dimensional surface equation according to the first fitting rate, the second fitting rate and the third fitting rate to re-temperature compensate the crystal oscillator to be compensated specifically includes: When neither the second fitting rate nor the third fitting rate exceeds the fitting rate threshold and the first fitting rate exceeds the fitting rate threshold, determining a first weight and a second weight according to a proportional relationship between the second fitting rate and the third fitting rate, wherein the sum of the first weight and the second weight is 1, and the greater the second fitting rate, the smaller the corresponding first weight; For the same first variation curve, determining a corresponding second process factor according to a corresponding portion of the curve in the second target temperature interval, and determining a corresponding third process factor according to a corresponding portion of the curve in the third target temperature interval; Summing the product of the first weight and the second process factor and the product of the second weight and the third process factor to obtain a weighted summation result, and performing weighted summation on the weighted summation result and the first process factor of the same first change curve to obtain a new process factor of the corresponding target crystal oscillator; The three-dimensional surface equation is adjusted according to the new process factors of each target crystal oscillator.

6. The crystal oscillator temperature compensation method according to claim 1, characterized in that: The method further comprises: Acquire at least one set of fourth temperature frequency data after temperature compensation of the crystal oscillator to be compensated; Based on each of the fourth temperature-frequency data, a corresponding third variation curve is obtained, and the third variation curve is fitted with a preset reference variation curve to obtain a second overall fitting rate, wherein the reference variation curve is a curve of the output frequency varying with temperature with the temperature compensation meeting the requirements; If the second overall fitting rate does not exceed a preset fitting rate threshold, determining at least one target output frequency based on a target partial curve in the third variation curve, wherein a fitting rate between the target partial curve and a corresponding partial curve in the reference variation curve exceeds a preset fitting rate threshold; Based on each of the target output frequencies and the three-dimensional surface equation, the crystal oscillator to be compensated is temperature compensated again.

7. The crystal oscillator temperature compensation method according to claim 6, characterized in that: The re-performing temperature compensation on the crystal oscillator to be compensated based on each of the target output frequencies and the three-dimensional surface equation specifically includes: Averaging the target output frequencies to obtain a suitable output frequency, and substituting the suitable output frequency into the three-dimensional surface equation to obtain a target two-dimensional curve equation, wherein the target two-dimensional curve equation is a curve showing a change in the process factor of the crystal oscillator to be compensated with temperature; Performing linear fitting on the target two-dimensional curve to obtain a constant function parallel to the x-axis, and determining a final process factor corresponding to the crystal oscillator to be compensated according to the constant function; Substituting the final process factor into the three-dimensional surface equation to obtain a final temperature-frequency two-dimensional curve equation corresponding to the crystal oscillator to be compensated; Based on the final temperature-frequency two-dimensional curve equation, the crystal oscillator to be compensated is temperature compensated again.

8. A crystal oscillator temperature compensation device, characterized in that: include: A data acquisition module (11) is used to acquire first temperature-frequency data corresponding to at least one target crystal oscillator in the same batch of crystal oscillators, wherein the first temperature-frequency data includes different temperatures in a preset temperature range and the output frequencies of the corresponding target crystal oscillators at the different temperatures; A surface fitting module (12) is used to obtain corresponding three-dimensional data based on the first temperature-frequency data of each target crystal oscillator, and to fit a three-dimensional surface equation based on each three-dimensional data, wherein the three-dimensional data includes data of the corresponding target crystal oscillator in three dimensions: temperature, corresponding output frequency and process factor, wherein the process factor represents the influence of process deviation on the deviation of the temperature-frequency characteristic of the target crystal oscillator; A curve determination module (13) is used to obtain at least one set of second temperature-frequency data of the crystal oscillator to be compensated, and based on each set of the second temperature-frequency data and the three-dimensional surface equation, obtain a temperature-frequency two-dimensional curve equation corresponding to the crystal oscillator to be compensated, wherein the second temperature-frequency data includes a single temperature in the preset temperature range and the output frequency of the crystal oscillator to be compensated corresponding to the single temperature, and the independent variable of the temperature-frequency two-dimensional curve equation is the temperature, and the dependent variable is the output frequency corresponding to the crystal oscillator to be compensated; A temperature compensation module (14) is used to perform temperature compensation on the crystal oscillator to be compensated based on the temperature-frequency two-dimensional curve equation.

9. A computer-readable storage medium having a computer program stored therein, characterized in that: When the computer program is loaded and executed by a processor, the method according to any one of claims 1 to 7 is adopted.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, characterized in that: When the processor loads and executes the computer program, the method according to any one of claims 1 to 7 is adopted.

Citation Information

Patent Citations

  • Closed-loop temperature compensation method and device for clock crystal oscillator

    CN102545778A

  • System and method for reducing temperature-dependent and process-dependent frequency variation of a crystal oscillator circuit

    CN102868363A

  • Temperature compensation method, device and equipment based on crystal oscillator and storage medium

    CN115085721A

  • Frequency compensation method, device and equipment based on crystal oscillator and storage medium

    CN115133924A

  • Temperature compensation method of temperature compensated crystal oscillator and crystal oscillator

    CN116232229A