An electronic clock running accuracy regulation system
By using periodic data acquisition and dynamic compensation mechanisms, the frequency deviation problem of electronic clocks under the influence of environment and aging has been solved, achieving high-precision and stable timekeeping control.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- FUJIAN REIDA PRECISION
- Filing Date
- 2026-04-08
- Publication Date
- 2026-06-09
AI Technical Summary
Existing electronic clocks suffer from frequency deviations due to environmental temperature, voltage fluctuations, and aging effects, leading to accumulated timekeeping errors and a lack of effective real-time accuracy control methods.
By periodically collecting temperature, voltage, and running time data, the number of crystal oscillator pulses is counted, the frequency offset sequence and trend are calculated, and dynamic compensation is performed in combination with the state response coefficient to generate pulse compensation data and correct timing pulses.
It enables real-time detection and dynamic compensation of crystal oscillator frequency changes, improving the timekeeping accuracy and stability of electronic clocks and avoiding the accumulation and sudden changes of errors.
Smart Images

Figure CN121995726B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to an electronic clock timekeeping accuracy control system. Background Technology
[0002] Electronic clocks typically generate a high-frequency time base signal using a quartz crystal oscillator. After processing by a frequency divider, a standard frequency pulse is output to drive internal circuitry or a pointer system to display the time. Most products rely on factory pre-calibration of the crystal frequency and a default temperature compensation factor to operate independently without external time signal input, achieving basic timekeeping functionality. To improve timekeeping accuracy, some products employ temperature-compensated crystal oscillators or integrate temperature and voltage detection modules into the hardware, using a static lookup table for frequency correction. However, this approach may not be widely applicable in ordinary household electronic clocks due to cost, size, and power supply constraints.
[0003] For example, household wall clocks run continuously when powered on, and users rarely manually calibrate the time. They use standard crystal oscillators, whose frequencies are affected by ambient temperature, aging effects, and battery voltage fluctuations, which may cause slight deviations in the output frequency. These small deviations will accumulate into significant timekeeping errors over weeks or months. If the daily error reaches 2 seconds, the cumulative error may exceed one minute after a month. Summary of the Invention
[0004] The purpose of this invention is to provide an electronic watch and clock timekeeping accuracy control system, which aims to solve the problems mentioned in the background art.
[0005] To solve the above-mentioned technical problems, the technical solution of the present invention is as follows:
[0006] An electronic watch and clock timekeeping accuracy adjustment system, the system comprising:
[0007] The data module is used to periodically collect temperature values, voltage values, and cumulative running time, and to count the number of pulses output by the crystal oscillator per unit time, thereby obtaining status data and fundamental frequency data.
[0008] The offset module is used to calculate the frequency offset value within different periods based on the base frequency data and frequency calibration value, and obtain the frequency offset sequence.
[0009] The analysis module is used to slide the frequency shift sequence through a window and calculate the drift trend value within different windows to obtain the frequency drift trend sequence.
[0010] The response module is used to calculate the difference between different states between adjacent periods based on the state data, obtain the state change, and combine it with the frequency drift trend sequence for analysis to obtain a set of state response coefficients.
[0011] The driving module is used to identify the effective disturbance components in the state change vectors of different periods based on the state response coefficient set, and obtain the state driving quantity.
[0012] The compensation module is used to calculate the pulse compensation amount in different periods based on the frequency drift trend sequence and state driving quantity, and obtain pulse compensation data.
[0013] The calibration module is used to calibrate the timing pulses based on the pulse compensation data, obtain the pulse output sequence, and update the electronic clock time accordingly.
[0014] Furthermore, the analysis module includes:
[0015] The window extraction unit is used to set a sliding window of fixed length in the frequency offset sequence, extract the frequency offset value within the sliding window in each period, and obtain the frequency window data.
[0016] The trend difference unit is used to calculate the difference between the start and end frequency offset values in the frequency window data to obtain the total change in the window frequency.
[0017] The normalization calculation unit is used to calculate the rate of frequency change per unit time based on the total frequency change and the length of the sliding window, and to obtain the drift trend value.
[0018] The trend recording unit is used to sort the drift trend values of all sliding windows in different periods according to time order to obtain the frequency drift trend sequence.
[0019] Furthermore, the response module includes:
[0020] The state difference unit is used to calculate the component-level difference between the state data of the current period and the previous period to obtain the state change.
[0021] The trend extraction unit is used to extract the drift trend value corresponding to the current period from the frequency drift trend sequence, and normalize it to obtain the scalar reference value.
[0022] The response value unit is used to normalize the state change quantity to obtain the normalized state change quantity, and determine the response value of different state dimensions based on it and the scalar reference quantity to obtain the state response value set.
[0023] The response coefficient unit is used to normalize the ratio of each response value in the state response value set to the sum of all response values, thus obtaining the state response coefficient set.
[0024] Furthermore, the response value unit includes:
[0025] The state characteristic factor calculation unit is used to determine the normalized temperature change, normalized voltage change, and normalized cumulative operating time change based on the normalized state change; calculate the temperature state characteristic factor based on the normalized temperature change and normalized voltage change; calculate the voltage state characteristic factor based on the normalized voltage change and normalized cumulative operating time; and calculate the time state characteristic factor based on the normalized cumulative operating time and normalized temperature change.
[0026] The response value calculation unit is used to nonlinearly amplify the scalar reference quantity to determine the main influence on the frequency drift trend and obtain the power exponent term; to square the state characteristic factor to enhance the influence of state disturbance and obtain the square amplification term; and to fuse the power exponent term and the square amplification term to obtain the main driving term.
[0027] The perturbation term is obtained by multiplying the state characteristic factor by its logarithmic value, and then fused with the main driving term to obtain the overall driving term; the exponential function of the state characteristic factor is calculated to control the upper limit of the response value, thus obtaining the normalized term; the overall driving term and the normalized term are fused to obtain the response value.
[0028] Furthermore, the driving module includes:
[0029] The response direction unit is used to identify the trend direction of frequency shift within a period based on the set of state response coefficients, and obtain the response direction vector.
[0030] The perturbation projection unit is used to project the state change vector onto the response direction vector, identify the component in the state change that is consistent with the frequency drift trend, and obtain the effective perturbation component.
[0031] The directional amplification unit is used to multiply the effective disturbance component with the response direction vector component by component to obtain the driving disturbance value;
[0032] The drive combination unit is used to combine the drive disturbance values of each state dimension according to the periodic identifier to obtain the state drive quantity.
[0033] Furthermore, the disturbance projection unit includes:
[0034] The state normalization unit is used to normalize the state change vector by unit magnitude to obtain a normalized state change vector.
[0035] Angle calculation unit is used to calculate the cosine of the angle between the normalized state change vector and the response direction vector based on the inner product value between the two vectors, and obtain the projection direction coefficient.
[0036] The amplitude mapping unit is used to calculate the magnitude of the state change vector, multiply it with the projection direction coefficient, and obtain the state projection amplitude.
[0037] The disturbance construction unit is used to expand the state projection magnitude along the response direction vector proportionally to obtain the projected disturbance vector.
[0038] The effective filtering unit is used to determine whether the projected disturbance vector is consistent with the direction of the frequency drift trend. When the result is negative or the state projection amplitude is negative, the projected disturbance vector is set to zero to obtain the effective disturbance component.
[0039] Furthermore, the compensation module includes:
[0040] The trend-driven fusion unit is used to determine the direction of the drift trend value and the corresponding state driving quantity in each period. When the directions are consistent, the magnitude is weighted to obtain the composite offset influence quantity.
[0041] The compensation response factor unit is used to calculate the degree of influence of the composite offset on the pulse compensation amplitude per unit time, and obtain the time response factor.
[0042] The compensation period adjustment unit is used to obtain the trend fluctuation amplitude based on the difference between the composite offset influence of the current period and the previous period, and to obtain the period modulation value by dynamically weighting the time response factor based on it.
[0043] The pulse adjustment calculation unit is used to convert and map the periodic modulation value and the frequency calibration value, and calculate the pulse adjustment value for each period.
[0044] The boundary control unit is used to limit the amplitude and constrain the sign of the pulse adjustment value, eliminate invalid pulse adjustment values, output the pulse compensation amount, and obtain the pulse compensation data.
[0045] Furthermore, the trend-driven fusion unit includes:
[0046] The direction determination unit is used to extract the vector direction of the drift trend value and the state driving quantity in the current cycle, and to determine whether the two directions are consistent by calculating the cosine value of their included angle.
[0047] The amplitude extraction unit is used to extract the absolute amplitude of the drift trend value and the state driving quantity as calculation factors when the directions are consistent.
[0048] The driving unit is used to construct an amplitude weighting function based on the slope of the drift trend value, and to fuse the amplitude of the drift trend value and the amplitude of the state driving value according to the amplitude weighting function to obtain the composite offset influence.
[0049] Furthermore, the compensation period adjustment unit includes:
[0050] The trend difference calculation unit is used to calculate the difference between the combined offset influence of the current period and the previous period to obtain the trend fluctuation amplitude.
[0051] The amplitude normalization unit is used to normalize the amplitude of trend fluctuations, eliminate the discrete effects of periodic amplitude oscillations, and obtain the normalized trend fluctuation amplitude.
[0052] The dynamic weighting unit is used to construct an adjustment curve based on the normalized trend fluctuation amplitude, and to obtain the dynamic weighting coefficient based on the impact of the frequency change trend on frequency compensation.
[0053] The modulation value unit is used to fuse the dynamic weighting coefficients with the time response factor of the current period to obtain the periodic modulation value.
[0054] Furthermore, the correction module includes:
[0055] The periodic mapping unit is used to perform periodic matching between the pulse compensation data and the original timing pulse signal of the current period to establish a pulse compensation mapping relationship.
[0056] The pulse correction unit is used to insert or delete timing pulses according to the positive or negative sign and magnitude of the pulse compensation amount, and in combination with the pulse compensation mapping relationship, to obtain a compensation pulse sequence.
[0057] The timing smoothing unit is used to perform boundary transition processing on the compensation pulse sequence to prevent timing jumps or instantaneous changes caused by pulse adjustment, thereby obtaining a smooth compensation sequence.
[0058] The output generation unit is used to convert the smoothing compensation sequence into a logic clock signal to obtain a pulse output sequence, and update the time displayed on the electronic clock accordingly.
[0059] The above-described solution of the present invention has at least the following beneficial effects:
[0060] This invention, through periodic acquisition of three key operating states—temperature, voltage, and cumulative operating time—possesses high real-time performance and systematicity, providing a panoramic view of the crystal oscillator's operating conditions. Compared to traditional electronic clocks that use fixed temperature compensation coefficients or initial calibration methods, this invention can not only detect the impact of external temperature changes on crystal frequency in real time, but also improve the ability to identify the root causes of frequency changes by combining factors such as voltage fluctuations and equipment aging. By synchronously acquiring pulse quantity and status data, the system establishes a time-bound relationship between basic frequency data and status data, providing foundational data for subsequent frequency correction.
[0061] This invention calculates the frequency offset value within each cycle by comparing the base frequency data with the frequency calibration value, and forms a frequency offset sequence with a time series structure. It breaks through the static processing method of existing technologies that only calibrates the frequency at a specific moment. It can continuously and dynamically depict the subtle change trajectory of the crystal oscillation frequency. This mechanism significantly improves the system's accuracy in identifying frequency change trends and its response speed. Especially under conditions where the user does not calibrate the equipment for a long time or under repeated changes in environmental influences, it can still maintain the continuity of frequency error records. This refined offset extraction mechanism provides high-quality, high-resolution quantitative support for subsequent analysis and compensation, thereby enabling more accurate and targeted time-of-flight correction.
[0062] This invention extracts the frequency offset trend within each cycle by using a sliding time window, thereby constructing a frequency drift trend sequence. This avoids oversensitivity to occasional errors and effectively extracts periodic or slowly accumulating frequency drift trends, enhancing the system's ability to understand the formation process of long-term errors. When the frequency offset amplitude is small, the existence of the trend sequence can help the system determine whether the small error has an increasing trend. This not only improves the sensitivity of drift judgment but also provides time foresight and judgment basis for accurate correction, which is a key foundation for achieving high-precision timekeeping control.
[0063] This invention calculates the pulse compensation amount in each cycle through joint analysis of frequency drift trend sequence and state driving quantity. Compared with the existing technology that relies on single-factor offset value to calculate the compensation amount, this invention can identify whether the state change has really caused frequency drift through the trend direction consistency judgment mechanism. When the two directions are consistent, amplitude weighted compensation is performed, which effectively prevents reverse correction errors. This direction sensitivity processing avoids frequency overcorrection or compensation oscillation caused by accidental factors, and improves the stability, consistency and accuracy of the time correction process of electronic clocks.
[0064] This invention utilizes pulse compensation data to adjust the original timing pulse signal, thereby generating a new pulse output sequence and updating the displayed time accordingly. The compensated pulse signal undergoes rhythm control and smoothing to prevent time jumps or abrupt changes caused by inserting or deleting too many pulses at once. Its smooth transition mechanism ensures that the time update process has buffering and physical continuity, effectively avoiding phenomena such as fast jumps or rewinds that occur in traditional electronic clocks after calibration. This ensures that the system can maintain visual time consistency and device stability even under frequent corrections. Attached Figure Description
[0065] Figure 1 This is a flowchart of an electronic watch and clock timekeeping accuracy control system provided by an embodiment of the present invention. Detailed Implementation
[0066] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
[0067] like Figure 1 As shown, an embodiment of the present invention proposes an electronic clock timekeeping accuracy adjustment system, the system comprising:
[0068] The data module is used to periodically collect temperature values, voltage values, and cumulative running time, and to count the number of pulses output by the crystal oscillator per unit time, thereby obtaining status data and fundamental frequency data.
[0069] The offset module is used to calculate the frequency offset value within different periods based on the base frequency data and frequency calibration value, and obtain the frequency offset sequence.
[0070] The analysis module is used to slide the frequency shift sequence through a window and calculate the drift trend value within different windows to obtain the frequency drift trend sequence.
[0071] The response module is used to calculate the difference between different states between adjacent periods based on the state data, obtain the state change, and combine it with the frequency drift trend sequence for analysis to obtain a set of state response coefficients.
[0072] The driving module is used to identify the effective disturbance components in the state change vectors of different periods based on the state response coefficient set, and obtain the state driving quantity.
[0073] The compensation module is used to calculate the pulse compensation amount in different periods based on the frequency drift trend sequence and state driving quantity, and obtain pulse compensation data.
[0074] The calibration module is used to calibrate the timing pulses based on the pulse compensation data, obtain the pulse output sequence, and update the electronic clock time accordingly.
[0075] In this embodiment of the invention, the data module is used to periodically collect temperature values, voltage values, and cumulative running time, and count the number of pulses output by the crystal oscillator per unit time to obtain state data and fundamental frequency data. This enables continuous monitoring of key variables affecting frequency accuracy and provides multi-dimensional real-time data for subsequent frequency offset calculation and dynamic compensation. The offset module is used to calculate the frequency offset value within different periods based on the fundamental frequency data and frequency calibration value, obtaining a frequency offset sequence. This quantifies the difference between the fundamental frequency and the standard frequency, capturing the crystal frequency change trajectory on a periodic basis, and achieving high-precision detection of minute offsets. The analysis module is used to slide the frequency offset sequence through a window and calculate the drift trend value within different windows to obtain a frequency drift trend sequence. This enables time series modeling of frequency change trends, which can not only identify cumulative deviations but also filter short-term disturbances, enhancing the system's sensitivity and judgment of long-term offsets.
[0076] The response module calculates the difference between different states in adjacent cycles based on state data, obtains the state change, and combines it with the frequency drift trend sequence to obtain a set of state response coefficients. This constructs a multi-dimensional mapping relationship between state variable disturbances and frequency changes, enabling the system to identify the contribution of different factors to the offset and achieve more targeted compensation direction and amplitude adjustment. The drive module identifies the effective disturbance components in the state change vectors of different cycles based on the state response coefficient set, obtains the state drive quantity, filters out irrelevant state change information, and ensures that the compensation action is driven only by effective variables. The compensation module calculates the pulse compensation quantity in different cycles based on the frequency drift trend sequence and the state drive quantity, obtains pulse compensation data, and realizes adaptive compensation value calculation jointly determined by trend and disturbance, avoiding erroneous compensation behavior due to a single variable anomaly. The correction module corrects the timing pulse based on the pulse compensation data, obtains the pulse output sequence, and updates the electronic clock time accordingly, achieving continuous, gradual, and smooth timekeeping accuracy correction, effectively delaying or avoiding the explosive manifestation of accumulated errors.
[0077] The data module is used to periodically acquire temperature, voltage, and cumulative running time, and to count the number of pulses output by the crystal oscillator per unit time, obtaining status data and fundamental frequency data. Specifically, it includes:
[0078] First, a periodic data acquisition mechanism is established through the internally configured temperature sensor, voltage monitoring module, and timing circuit. Taking one hour as a sampling cycle as an example, within each complete sampling cycle, the system reads the current ambient temperature value, using a thermistor or integrated temperature sensor to obtain the real-time temperature reading inside the clock. The voltage value is obtained by a voltage divider circuit connected to the microcontroller port and the battery output terminal. During reading, the analog voltage value is converted into a digital signal by an ADC analog-to-digital converter module, thus forming the current voltage data. For the cumulative running time, the main control chip initializes a running time counter when the device starts up, which increments once after each sampling cycle, thereby calculating the total running time since the device started operating. The above three data points—temperature, voltage, and cumulative running time—together constitute the status data, used to describe the current external environmental state and the device's own operating state.
[0079] Within the same sampling period, the data module also needs to count the total number of pulses output by the crystal oscillator per unit time. Typically, electronic clocks are equipped with a standard crystal oscillator with a frequency of 32768Hz. The system uses a counter module to count the pulse signals output by the crystal. This counter is reset at the beginning of each sampling period and continuously records the number of rising edges of the pulse signal throughout the entire sampling period until the end of the current period, forming the number of pulses per unit time as the basic frequency data.
[0080] The offset module is used to calculate the frequency offset value within different periods based on the base frequency data and frequency calibration value, thereby obtaining the frequency offset sequence, specifically including:
[0081] First, the system retrieves a preset frequency calibration value. This value is typically obtained by the factory before shipment by calibrating the crystal using a high-precision frequency meter, representing the standard frequency that the crystal should ideally possess. For example, for a standard 32768Hz crystal, this calibration value can be recorded as follows: ,in This indicates the amount of fine-tuning correction made at the factory. Subsequently, through difference calculation, the offset value calculation formula is set as follows: ,in This is the base frequency for actual data collection in the current cycle. For calibration values, This is the frequency offset value for the current period. To establish a foundation for continuous trend analysis over time, the values calculated for each period are... The values are arranged in chronological order to form a frequency offset sequence.
[0082] In a preferred embodiment of the present invention, the analysis module includes:
[0083] The window extraction unit is used to set a sliding window of fixed length in the frequency offset sequence, extract the frequency offset value within the sliding window in each period, and obtain the frequency window data.
[0084] The trend difference unit is used to calculate the difference between the start and end frequency offset values in the frequency window data to obtain the total change in the window frequency.
[0085] The normalization calculation unit is used to calculate the rate of frequency change per unit time based on the total frequency change and the length of the sliding window, and to obtain the drift trend value.
[0086] The trend recording unit is used to sort the drift trend values of all sliding windows in different periods according to time order to obtain the frequency drift trend sequence.
[0087] In this embodiment of the invention, the window extraction unit is used to set a sliding window of fixed length in the frequency offset sequence, extract the frequency offset value within the sliding window in each period, and obtain frequency window data. This can divide the global data in the original sequence into multiple local segments, which can capture short-term offset change trends and avoid the impact of occasional interference on the overall judgment. The trend difference unit is used to calculate the difference between the starting and ending frequency offset values in the frequency window data to obtain the total frequency change in the window. This provides directional and amplitude information of frequency change, avoids dependence on the mean of intermediate data, and more intuitively reflects the polarity and intensity of frequency change in a short period of time. The normalization calculation unit is used to calculate the frequency change rate per unit time based on the total frequency change and the length of the sliding window to obtain the drift trend value. This converts the original total change into the change rate within a unit period, realizing a standardized representation of the frequency drift trend in different time windows. The trend recording unit is used to sort the drift trend values of all sliding windows in different periods according to the time order to obtain the frequency drift trend sequence. This retains the direction and intensity information of frequency change in each time period, providing reliable trend basis data for frequency offset prediction and compensation adjustment.
[0088] The window extraction unit is used to set a sliding window of fixed length in the frequency offset sequence, extract the frequency offset value within the sliding window in each period, and obtain the frequency window data. Specifically, it includes:
[0089] First, a fixed-length sliding window is defined. The window length can be set to an integer value greater than 1, such as 5, indicating that each sliding window covers 5 consecutive periods of data. After setting, the system extracts the frequency offset values of the first 5 periods covered by the window, starting from the beginning of the frequency offset sequence, forming the frequency subsequence within the current sliding window, denoted as the frequency window data. Then, the system shifts the sliding window one period to the right, discarding the leftmost frequency offset value in the current window and adding the frequency offset value of the next period to the end of the window, forming a new window data. The system continues to slide the window in this manner until the entire frequency offset sequence is covered and all valid frequency window data is extracted. Through these operations, the system can divide the original frequency offset sequence into multiple equal-length, continuous frequency window data sequences, with each frequency window data corresponding to a window time period.
[0090] The normalization calculation unit is used to calculate the rate of frequency change per unit time based on the total frequency change and the length of the sliding window, and to obtain the drift trend value. Specifically, it includes:
[0091] In each frequency window of data, the total frequency change calculated by the system's trend difference unit, i.e., the difference between the frequency offset values at the start and end positions of that window, is set as follows: The normalization calculation unit divides the total frequency change by the period length of the sliding window. The rate of change of frequency per unit period is obtained. The calculation formula is as follows: ,in, This represents the drift trend value within the window, i.e., the average rate of change of frequency per unit time (unit period). To ensure physical consistency of the results, the system ensures the length of the sliding window. The sampling period is strictly matched to that of the frequency offset data, meaning each unit is a fixed sampling period. The system performs the above calculations sequentially on all sliding windows, ultimately obtaining a set of drift trend values arranged in chronological order, used to characterize the local rate of frequency change in the entire frequency offset sequence.
[0092] In a preferred embodiment of the present invention, the response module includes:
[0093] The state difference unit is used to calculate the component-level difference between the state data of the current period and the previous period to obtain the state change.
[0094] The trend extraction unit is used to extract the drift trend value corresponding to the current period from the frequency drift trend sequence, and normalize it to obtain the scalar reference value.
[0095] The response value unit is used to normalize the state change quantity to obtain the normalized state change quantity, and determine the response value of different state dimensions based on it and the scalar reference quantity to obtain the state response value set.
[0096] The response coefficient unit is used to normalize the ratio of each response value in the state response value set to the sum of all response values, thus obtaining the state response coefficient set.
[0097] In this embodiment of the invention, the state difference unit is used to calculate the component-level difference between the state data of the current period and the previous period to obtain the state change quantity, identify the fluctuation trend of the environment and operating conditions in two consecutive periods, effectively eliminate the misleading effect of static magnitude, and provide data support with directional and incremental characteristics for subsequent state response modeling; the trend quantity extraction unit is used to extract the drift trend quantity value corresponding to the current period from the frequency drift trend sequence, and normalize it to obtain a scalar reference quantity, which is an important reference scale driving the state response from the frequency behavior level. The normalized quantity value ensures the subsequent state response value The calculation is not unbalanced due to different dimensional scales; the response value unit is used to normalize the state change to obtain the normalized state change, and based on it and the scalar reference, the response value of different state dimensions is determined to obtain the state response value set, realizing the nonlinear fusion between frequency drift trend and state disturbance amplitude, quantifying the influence intensity of each state dimension on frequency change, and laying the foundation for building a control mechanism; the response coefficient unit is used to normalize the ratio of each response value in the state response value set to the sum of all response values to obtain the state response coefficient set, and realizes the assessment of the relative importance between state dimensions through the normalization mechanism.
[0098] The state difference unit is used to calculate the component-level difference between the state data of the current period and the previous period to obtain the state change, specifically including:
[0099] The system collects status data periodically during each cycle, and this status data includes at least three dimensions: temperature value. Voltage value and cumulative running time value The system records the current period (denoted as the [number]th period). (period) and the previous period (denoted as the 1st period) The state data corresponding to the period () forms two state vectors: and Subsequently, the system performs component-wise interpolation calculations on the two state vectors along their corresponding dimensions to obtain the state change vector. ,Right now ,in , , If the collected data is a digital sensor output value, it can be directly used in the difference calculation; if the data fluctuates or jitters, the system will use the moving average method to smooth the state values of several consecutive cycles before performing the difference calculation, in order to reduce misleading changes caused by instantaneous disturbances.
[0100] The response coefficient unit is used to normalize the ratio of each response value in the state response value set to the sum of all response values, thereby obtaining the state response coefficient set, which specifically includes:
[0101] The state response value set represents the response magnitude corresponding to different state changes, and is usually represented by a three-dimensional vector: These correspond to the temperature response value, voltage response value, and cumulative running time response value, respectively. To convert these response values into standardized coefficients with relative weights, a summation operation is first performed to calculate the sum of all response values. Subsequently, the system normalizes each response value, calculates its proportion in the total response, and forms a normalization coefficient: , , , This is the temperature normalization coefficient. This is the voltage normalization coefficient. This is the time normalization coefficient. To prevent the abnormal case where the denominator is zero, when... When the response is less than a set threshold (e.g., 1e-6), the system will trigger a fault-tolerance strategy, such as setting the three response coefficients to the average value (each 1 / 3) or maintaining the state response coefficient set of the previous cycle, in order to prevent the system from experiencing numerical collapse when the response is extremely weak.
[0102] In a preferred embodiment of the present invention, the response value unit includes:
[0103] The state characteristic factor calculation unit is used to determine the normalized temperature change, normalized voltage change, and normalized cumulative operating time change based on the normalized state change; calculate the temperature state characteristic factor based on the normalized temperature change and normalized voltage change; calculate the voltage state characteristic factor based on the normalized voltage change and normalized cumulative operating time; and calculate the time state characteristic factor based on the normalized cumulative operating time and normalized temperature change.
[0104] The response value calculation unit is used to nonlinearly amplify the scalar reference quantity to determine the main influence on the frequency drift trend and obtain the power exponent term; to square the state characteristic factor to enhance the influence of state disturbance and obtain the square amplification term; and to fuse the power exponent term and the square amplification term to obtain the main driving term.
[0105] The perturbation term is obtained by multiplying the state characteristic factor by its logarithmic value, and then fused with the main driving term to obtain the overall driving term; the exponential function of the state characteristic factor is calculated to control the upper limit of the response value, thus obtaining the normalized term; the overall driving term and the normalized term are fused to obtain the response value.
[0106] In this embodiment of the invention, the state characteristic factor calculation unit is used to determine the normalized temperature change, normalized voltage change, and normalized cumulative running time change based on the normalized state change; calculate the temperature state characteristic factor based on the normalized temperature change and normalized voltage change; calculate the voltage state characteristic factor based on the normalized voltage change and normalized cumulative running time; and calculate the time state characteristic factor based on the normalized cumulative running time and normalized temperature change. This establishes the interaction relationship between state changes, captures the cross-influence between system state changes, and provides scientific, reasonable, and more sensitive factor inputs for subsequent response value calculation. The response value calculation unit is used to perform nonlinear power amplification on the scalar reference quantity to determine the main influence on the frequency drift trend and obtain the power exponent term; and to process the state characteristic factors... Square the terms to enhance the impact of state disturbances, resulting in a squared amplification term. Fusing the power exponent term and the squared amplification term yields the main driving term, enabling more targeted and accurate estimation of the frequency response. Multiplying the logarithm of the state characteristic factor yields a perturbation term, which is then fused with the main driving term to obtain the overall driving term. This enhances sensitivity to minute disturbances and prevents overreaction of the compensation system when state changes drastically. Calculating the exponential function of the state characteristic factor controls the upper limit of the response value, resulting in a normalized term. This ensures the continuity and smoothness of the response value across multiple cycles, providing a stable control basis for the pulse compensation system. Fusing the overall driving term and the normalized term yields the response value, enabling a comprehensive assessment of the impact of multi-dimensional state information on frequency drift trends, providing a foundation for precise compensation control.
[0107] The formula for calculating the state characteristic factor is as follows:
[0108] ,
[0109] Among them, when hour As a temperature characteristic factor, when hour As the voltage characteristic factor, when hour As a time characteristic factor, This is the normalized temperature change. This is the normalized voltage change. This represents the change in total running time.
[0110] The formula for calculating the response value is as follows:
[0111] ,
[0112] in, For state The response value, For the index of the state, As a scalar reference quantity, For state State characteristic factors, is a coefficient.
[0113] in, As the overall driving force, it integrates explicit perturbations (main driving force) and implicit perturbations (micro-perturbation term), taking into account both abrupt and gradual change scenarios. It can respond quickly when the state changes significantly, and can also adjust gradually when there are subtle fluctuations. Main driving term, reflecting state factor The main driving effect on system frequency offset The exponent term is a power term, which determines the overall sensitivity of the state disturbance to the frequency response. This is a squared amplification term, which enhances the weight of high-amplitude state perturbations by squaring, reflecting a nonlinear amplification mechanism; This is a perturbation term, reflecting the edge effect of weak perturbation factors on frequency shift. When it approaches 0, this term approaches 0, suppressing weak disturbances. When it is slightly greater than 0, it can reflect the micro-trend response to frequency shift; To reduce to a term, a nonlinear suppression mechanism for the numerator term is established, when When smaller, When the value approaches 1, the overall denominator is large, and the output response value is small. When it is large, Approaching 0, the denominator approaches 1, which does not affect the amplification, effectively suppressing the over-response caused by small perturbations, while retaining the sensitive response to large perturbations.
[0114] Among them, the exponential coefficient The magnitude of this value directly determines the system's sensitivity to the frequency drift trend and the strength of its compensation response. When selecting... When determining the value of , it is necessary to fully consider the actual impact of state variables (such as temperature, voltage, and cumulative running time) on the frequency stability of the crystal oscillator, as well as the operating environment characteristics and expected accuracy requirements of the electronic clock. Specifically, if the electronic clock is used in an environment with drastic temperature differences and for a long period of time, frequency fluctuations due to crystal aging and thermal drift are likely to occur, in which case the value should be increased. The value (e.g., within the range of 3.5 to 5.0) is used to enhance the response to frequency shift trends and achieve a stronger dynamic correction effect; conversely, if the system is in a temperature-controlled environment or the frequency disturbance amplitude is small, and system stability and suppression of overcompensation risk are emphasized, then it is advisable to set the value (e.g., within the range of 3.5 to 5.0) to enhance the responsiveness to frequency shift trends and achieve a stronger dynamic correction effect; The value is set between 1.5 and 3.0 to maintain the ability to suppress abnormal disturbances. In actual deployment, multiple sets of test samples under typical operating conditions can be preset, the fitting error between the frequency drift amplitude and the corresponding state change can be statistically analyzed, and the optimal value can be selected using the minimum mean square error criterion. The value ensures that the system has both responsiveness and avoids jumps or oscillations caused by overcompensation.
[0115] In a preferred embodiment of the present invention, the driving module includes:
[0116] The response direction unit is used to identify the trend direction of frequency shift within a period based on the set of state response coefficients, and obtain the response direction vector.
[0117] The perturbation projection unit is used to project the state change vector onto the response direction vector, identify the component in the state change that is consistent with the frequency drift trend, and obtain the effective perturbation component.
[0118] The directional amplification unit is used to multiply the effective disturbance component with the response direction vector component by component to obtain the driving disturbance value;
[0119] The drive combination unit is used to combine the drive disturbance values of each state dimension according to the periodic identifier to obtain the state drive quantity.
[0120] In this embodiment of the invention, the response direction unit is used to identify the trend direction of frequency shift within a period based on the state response coefficient set, obtain the response direction vector, and extract the combination direction that contributes most to the frequency drift trend from multiple state dimensions, avoiding miscompensation caused by incorrect dimensional weight estimation; the disturbance projection unit is used to project the state change vector onto the response direction vector, identify the component in the state change that is consistent with the frequency drift trend direction, obtain the effective disturbance component, ensure that the compensation direction is correct and the amplitude is reasonable each time, and effectively avoid frequent overcompensation and oscillating compensation phenomena; the direction amplification unit is used to multiply the effective disturbance component with the response direction vector component by component to obtain the driving disturbance value, clarify the specific contribution of each state disturbance component to the frequency drift trend, and avoid the misjudgment problem caused by the imbalance of dimensional differences in the traditional linear weighted model; the driving combination unit is used to combine the driving disturbance values of each state dimension according to the periodic identifier to obtain the state driving quantity, realize the aggregation transformation from multi-dimensional disturbance contribution to a single compensation command, retain the dynamic influence of each state variable on the frequency, and form a unified compensation decision basis.
[0121] The response direction unit is used to identify the trend direction of frequency shift within a period based on the set of state response coefficients, and obtain the response direction vector, specifically including:
[0122] First, the system receives a set of state response coefficients output from the response module within each cycle. This set is a three-dimensional vector, with each component corresponding to the temperature response coefficient, voltage response coefficient, and cumulative running time response coefficient, respectively. This set describes the normalized response strength of each state change to the frequency drift trend within the current cycle. The system first calculates the magnitude of this response coefficient vector by summing the squares of the three response coefficients and taking the square root to obtain the vector magnitude. Then, the system divides each component by this magnitude to obtain a response direction vector with a unit magnitude. The direction of this vector represents the contribution trend of perturbations in each state dimension to the frequency shift direction and is an important reference benchmark for the system to subsequently identify the consistency and effectiveness of the state perturbation direction.
[0123] The directional amplification unit is used to multiply the effective disturbance component with the response direction vector component by component to obtain the driving disturbance value, specifically including:
[0124] The system represents the effective disturbance components as three-dimensional vectors, corresponding to the effective disturbance amplitudes in the dimensions of temperature, voltage, and operating time. The system then retrieves the calculated unit-magnitude response direction vector from the response direction unit, where each component represents the directional projection weight in each of the three dimensions. In the component-by-component multiplication operation, the system multiplies each component of the effective disturbance component with a corresponding component of the response direction vector, obtaining the amplified driving disturbance value. This operation essentially enhances the distribution weight of the effective disturbance in the response direction, giving a larger proportion to disturbance components with higher directional contributions in the final output, while suppressing components with low contributions or opposite directions.
[0125] In a preferred embodiment of the present invention, the disturbance projection unit includes:
[0126] The state normalization unit is used to normalize the state change vector by unit magnitude to obtain a normalized state change vector.
[0127] Angle calculation unit is used to calculate the cosine of the angle between the normalized state change vector and the response direction vector based on the inner product value between the two vectors, and obtain the projection direction coefficient.
[0128] The amplitude mapping unit is used to calculate the magnitude of the state change vector, multiply it with the projection direction coefficient, and obtain the state projection amplitude.
[0129] The disturbance construction unit is used to expand the state projection magnitude along the response direction vector proportionally to obtain the projected disturbance vector.
[0130] The effective filtering unit is used to determine whether the projected disturbance vector is consistent with the direction of the frequency drift trend. When the result is negative or the state projection amplitude is negative, the projected disturbance vector is set to zero to obtain the effective disturbance component.
[0131] In this embodiment of the invention, a state standardization unit is used to normalize the state change vector by unit magnitude to obtain a normalized state change vector. This normalizes the state change vector to a unit vector with a magnitude of 1, retaining only the characteristics of the change direction and eliminating the influence of the change amplitude, thus providing a unified vector scale for subsequent angle calculations. Angle calculation unit is used to calculate the cosine of the angle between the normalized state change vector and the response direction vector based on the inner product of the two vectors, obtaining the projection direction coefficient. This quantitatively assesses the directional consistency of the two vectors and reveals whether the disturbance has an effective driving effect on the frequency shift. Amplitude mapping unit is used to calculate the magnitude of the state change vector and multiply it by the projection direction coefficient to obtain the state change vector. The projection amplitude extracts the actual amplitude of the state disturbance in the response direction, accurately quantifying the effective disturbance contribution. The disturbance construction unit expands the state projection amplitude proportionally along the response direction vector to obtain the projection disturbance vector, converting the scalar projection amplitude into vector form. This provides a basis for subsequent direction identification and periodic aggregation of compensation quantities, maintaining the integrity of disturbance processing at both the magnitude and direction levels. The effective filtering unit determines whether the projection disturbance vector is consistent with the frequency drift trend direction. If the result is negative or the state projection amplitude is negative, the projection disturbance vector is set to zero to obtain the effective disturbance component. Reverse disturbances or spurious signal inputs are eliminated to prevent the system from mistakenly using invalid disturbances as compensation basis, thus causing compensation oscillations or over-adjustment.
[0132] The perturbation construction unit is used to proportionally expand the state projection magnitude along the response direction vector to obtain the projected perturbation vector, specifically including:
[0133] First, the state projection magnitude calculated in the current cycle is used as the basic input. This magnitude has already been obtained through the preceding steps; it is the projection magnitude of the state change vector onto the response direction vector, denoted as... After obtaining this scalar value, it is necessary to construct the complete projected perturbation vector by combining it with the response direction vector. To ensure directional consistency and preservation of physical meaning, the response direction vector needs to be normalized by normalizing its magnitude to 1. This unit vector is denoted as... The normalization process is performed as follows: Let the original response direction vector be... , Let be the vectors of the original response direction vector in the horizontal, vertical, and longitudinal directions, respectively. Then, the formula for calculating their magnitude is: The normalized unit response direction vector is After completing the above preprocessing, the perturbation construction unit projects the state magnitude. With unit response direction vector Perform component-wise scaling multiplication to obtain the final projected perturbation vector. The calculation formula is as follows: ,Right now This projection perturbation vector It is a vector collinear with the response direction, whose magnitude is equal to the magnitude of the original state perturbation in that direction, and whose direction is completely consistent with the response vector. This vector not only retains the effective component of the perturbation in the frequency drift direction, but also possesses the spatial structure characteristics of combining with subsequent state driving vectors, which facilitates periodic aggregation and further driving modeling.
[0134] In a preferred embodiment of the present invention, the compensation module includes:
[0135] The trend-driven fusion unit is used to determine the direction of the drift trend value and the corresponding state driving quantity in each period. When the directions are consistent, the magnitude is weighted to obtain the composite offset influence quantity.
[0136] The compensation response factor unit is used to calculate the degree of influence of the composite offset on the pulse compensation amplitude per unit time, and obtain the time response factor.
[0137] The compensation period adjustment unit is used to obtain the trend fluctuation amplitude based on the difference between the composite offset influence of the current period and the previous period, and to obtain the period modulation value by dynamically weighting the time response factor based on it.
[0138] The pulse adjustment calculation unit is used to convert and map the periodic modulation value and the frequency calibration value, and calculate the pulse adjustment value for each period.
[0139] The boundary control unit is used to limit the amplitude and constrain the sign of the pulse adjustment value, eliminate invalid pulse adjustment values, output the pulse compensation amount, and obtain the pulse compensation data.
[0140] In this embodiment of the invention, a trend-driven fusion unit is used to determine the direction of the drift trend value and the corresponding state driving quantity in each cycle. When the directions are consistent, the values are weighted by amplitude to obtain the composite offset influence. The frequency drift trend is aligned with the direction of the state disturbance driving force to effectively screen out erroneous compensation cases and avoid reverse correction operations when the direction of state change is opposite to the direction of frequency offset trend. A compensation response factor unit is used to calculate the degree of influence of the composite offset influence on the pulse compensation amplitude per unit time based on the composite offset influence, obtain the time response factor, and map the influence quantity to a standardized response factor to realize the functional relationship model between error and compensation ratio. A compensation period adjustment unit is used to obtain the trend fluctuation amplitude based on the difference between the composite offset influence of the current cycle and the previous cycle, and adjust the time response factor accordingly. The system dynamically weights the inter-response factors to obtain the periodic modulation value. By detecting the change in the trend fluctuation, it achieves adaptive adjustment of the compensation period, avoiding over-adjustment caused by rapid changes. The pulse adjustment calculation unit is used to convert and map the periodic modulation value and the frequency calibration value, and calculate the pulse adjustment value for each period. It transforms the frequency offset estimation from the high-level layer into a specific executable digital compensation operation, supports high-precision control of small deviations in crystal frequency, and achieves nanosecond-level time correction capability. The boundary control unit is used to limit the amplitude and constrain the sign of the pulse adjustment value, eliminate invalid pulse adjustment values, output the pulse compensation amount, and obtain pulse compensation data. This avoids time jumps or logic errors caused by excessive compensation amount. By limiting the amplitude and controlling the direction, it suppresses unreasonable adjustment amount and ensures the smoothness and continuity of the compensation process.
[0141] The compensation response factor unit is used to calculate the degree of influence of the composite offset on the pulse compensation amplitude per unit time, and obtain the time response factor, specifically including:
[0142] First, the composite offset influence of the current cycle is obtained through a trend-driven fusion unit and used as the main input to this unit for processing. The system first determines the directionality and absolute amplitude of the composite offset influence, records its sign, and extracts its magnitude. Then, a set of nonlinear mapping functions is constructed to simulate the relationship between the composite offset influence and the pulse compensation response intensity. These mapping functions can be constructed using hyperbolic tangent functions or S-curve functions to achieve amplification, suppression, or saturation control of the offset influence. During the mapping calculation, the system sets a threshold region to control the compensation response sensitivity: increasing the compensation response sensitivity when the influence change is in the low-amplitude range, and imposing an upper limit limit in the high-amplitude range to prevent over-adjustment due to high-frequency fluctuations. Finally, the normalized and smoothed response output value is set as the time response factor, whose value reflects the relative intensity of compensation required per unit time, providing a basis for subsequent cycle modulation and pulse adjustment calculations.
[0143] The pulse adjustment calculation unit is used to convert and map the periodic modulation value and the frequency calibration value, and calculate the pulse adjustment value for each period. Specifically, it includes:
[0144] The system first receives the periodic modulation value as input, which combines the processing result of a time response factor and a dynamic weighted average of trend fluctuations. Simultaneously, the system uses the frequency calibration value of the crystal oscillator as a standard conversion reference, such as the common 32768Hz frequency calibration. When calculating the pulse adjustment value, the system introduces the following conversion formula: ,in, This indicates the number of pulses to be adjusted (i.e., the pulse adjustment value). The calibrated frequency of the crystal (in Hz). The duration of the current cycle (in seconds). This is the periodic modulation value (a dimensionless normalized number). The system calculates the number of pulses to be compensated within the current period by substituting the values of each parameter in this formula. To ensure numerical accuracy, the system uses a fixed-point decimal calculation method for the conversion process. If the value is a decimal, it is rounded or a floating-point value is retained for boundary control processing. The calculated pulse adjustment value (including its positive or negative sign) is temporarily cached and passed to the boundary control unit as the object to be calibrated.
[0145] The boundary control unit is used to limit the amplitude and constrain the sign of the pulse adjustment value, eliminate invalid pulse adjustment values, output the pulse compensation amount, and obtain the pulse compensation data, specifically including:
[0146] The system first receives the pulse adjustment value for the current period from the previous calculation unit and determines whether its value exceeds a preset compensation boundary threshold. For example, the system can set ±5 as the maximum allowable pulse compensation limit for a single period to prevent time jumps caused by excessive compensation step size due to sudden environmental interference. If the pulse adjustment value exceeds this threshold, the system will use a limiting strategy to compress it, such as proportionally reducing it or directly truncating it to the maximum allowable value. Next, the system parses the sign of the pulse adjustment value: a positive value indicates that the number of pulses needs to be increased, and a negative value indicates that the number of pulses needs to be deleted. The system encapsulates this sign information into a compensation operation instruction to drive the pulse generation mechanism. If the adjustment value is zero or less than the minimum effective adjustment threshold (e.g., ±0.5 pulses), the system considers it an invalid adjustment and discards it to avoid redundant responses caused by small offsets in the compensation operation. Finally, the system outputs the pulse compensation amount after limiting and constraining, obtaining the pulse compensation data.
[0147] In a preferred embodiment of the present invention, the trend-driven fusion unit includes:
[0148] The direction determination unit is used to extract the vector direction of the drift trend value and the state driving quantity in the current cycle, and to determine whether the two directions are consistent by calculating the cosine value of their included angle.
[0149] The amplitude extraction unit is used to extract the absolute amplitude of the drift trend value and the state driving quantity as calculation factors when the directions are consistent.
[0150] The driving unit is used to construct an amplitude weighting function based on the slope of the drift trend value, and to fuse the amplitude of the drift trend value and the amplitude of the state driving value according to the amplitude weighting function to obtain the composite offset influence.
[0151] In this embodiment of the invention, the direction determination unit is used to extract the vector direction of the drift trend value and the state driving quantity in the current period, and to determine whether the two directions are consistent by calculating the cosine of their included angle. This realizes the directional analysis of the relationship between the two key quantities, effectively avoiding erroneous compensation caused by the state driving quantity and the actual drift trend direction being opposite. The amplitude extraction unit is used to extract the absolute amplitude of the drift trend value and the state driving quantity as a calculation factor when the directions are consistent, quantitatively assessing the influence of the drift trend and driving factors, and then making differentiated responses to the correction strategy under different conditions. The driving conformity unit is used to construct an amplitude weighting function based on the slope of the drift trend value, and fuse the amplitude of the drift trend value and the amplitude of the state driving quantity according to the amplitude weighting function to obtain the composite offset influence quantity. This fully considers the synergistic enhancement effect of the two factors on the compensation effect when they are in the same direction, avoiding error correction dominated by a single indicator.
[0152] The driving unit is used to construct an amplitude weighting function based on the slope of the drift trend value, and to fuse the amplitude of the drift trend value and the amplitude of the state driving value according to the amplitude weighting function to obtain the composite offset influence, specifically including:
[0153] Within each working cycle, the frequency drift trend value of the current cycle and the frequency drift trend value of the previous cycle are first extracted and denoted as follows: and Based on the relationship between the two, calculate the slope of the current frequency drift trend. The calculation formula is as follows: ,in, This represents the period interval, and its value can be a fixed period length set in the system. The slope value mentioned above... This reflects the speed and direction of change in the frequency drift trend. This indicates that the drift trend is intensifying. This indicates that the drift is slowing down or is changing in the opposite direction.
[0154] The system constructs an amplitude weighting function based on the sign and absolute value of the slope. This function controls the dominant weights when merging drift trends and state-driven factors. One implementation of the magnitude weighting function is an exponential weight mapping function. ,in, To adjust the proportional parameter of sensitivity, when Values 0.5-1: Weighting function With a relatively gentle slope change, it is suitable for home environments where temperature and voltage variations are small or clock accuracy requirements are not high, exhibiting strong stability and avoiding frequent adjustments; when Values of 1.5-3 indicate medium sensitivity, suitable for most embedded applications and ordinary quartz crystals. The system can respond at a moderate pace to either accelerating or suppressing a trend, balancing responsiveness and robustness. A value of 3.5-5 indicates a high-sensitivity response, suitable for high-precision applications (such as environments with drastic temperature differences), enabling the system to switch weights more quickly in response to trend changes. However, this may introduce high-frequency oscillations and requires coordination with a compensation period adjustment module. For home electronic wall clock systems based on a daily cycle, assuming a standard 32.768kHz crystal oscillator is used, a value of 3.5-5 is recommended. The value of 2.5 balances response speed and system stability. Experiments show that under common temperature changes of ±5°C and voltage fluctuations of ±0.3V, the system can effectively compensate for frequency drift trends without introducing frequent jitter or misadjustment.
[0155] After obtaining the amplitude weighting coefficient Then, extract the magnitude of the drift trend value from the current period. With the magnitude of the state driving quantity Subsequently, the composite offset influence was obtained by fusing the components as follows. : The core of this fusion method lies in dynamically adjusting the proportions of drift trend values and state-driven quantities in the weighted fusion process using weights constructed from slopes, thus avoiding problems such as miscompensation or system hysteresis caused by a single-source signal dominating the process. When the drift trend rapidly intensifies, the weights become more biased towards... This enhances the system's ability to respond quickly to drift phenomena; when the drift trend changes slowly or is erratic, more weight will be allocated to state-driven variables, emphasizing the system's sensitive tracking of current state disturbances.
[0156] In a preferred embodiment of the present invention, the compensation period adjustment unit includes:
[0157] The trend difference calculation unit is used to calculate the difference between the combined offset influence of the current period and the previous period to obtain the trend fluctuation amplitude.
[0158] The amplitude normalization unit is used to normalize the amplitude of trend fluctuations, eliminate the discrete effects of periodic amplitude oscillations, and obtain the normalized trend fluctuation amplitude.
[0159] The dynamic weighting unit is used to construct an adjustment curve based on the normalized trend fluctuation amplitude, and to obtain the dynamic weighting coefficient based on the impact of the frequency change trend on frequency compensation.
[0160] The modulation value unit is used to fuse the dynamic weighting coefficients with the time response factor of the current period to obtain the periodic modulation value.
[0161] In this embodiment of the invention, the trend difference calculation unit is used to calculate the difference between the composite offset influence of the current period and the previous period to obtain the trend fluctuation amplitude, accurately depicting the dynamic trend of frequency offset change, and reflecting whether the current system timekeeping error tends to accelerate, stabilize, or weaken; the amplitude normalization unit is used to normalize the trend fluctuation amplitude, eliminate the discrete influence of periodic amplitude oscillation, and obtain the normalized trend fluctuation amplitude, which helps to smoothly generate the subsequent adjustment curve and avoids the system from violent oscillation caused by local large error disturbances; the dynamic weighting unit is used to construct the adjustment curve based on the normalized trend fluctuation amplitude, and obtain the dynamic weighting coefficient based on the influence of the frequency change trend on frequency compensation, giving the system the ability to respond to the error growth rate and improving dynamic stability and control accuracy; the modulation value unit is used to fuse the dynamic weighting coefficient with the time response factor of the current period to obtain the periodic modulation value, which effectively suppresses the occurrence of over-adjustment or under-adjustment of timekeeping error control in traditional systems.
[0162] The amplitude normalization unit is used to normalize the trend fluctuation amplitude, eliminate the discrete effects of periodic amplitude oscillations, and obtain the normalized trend fluctuation amplitude. Specifically, it includes:
[0163] Obtain the difference in the combined offset influence between the current period and the previous period as the original trend fluctuation amplitude; within a set historical period window, such as continuous... For each period, the mean and standard deviation of all trend fluctuations within that period are calculated. The mean is subtracted from the current trend fluctuation and divided by the standard deviation to obtain the normalized trend fluctuation. If the standard deviation is zero or close to zero, a preset positive value is used to replace it to avoid division by zero anomalies. This normalization process eliminates the periodic jitter and extreme outliers of data fluctuations, making subsequent processing more sensitive to actual trend changes and providing a uniform scale.
[0164] The dynamic weighting unit is used to construct an adjustment curve based on the normalized trend fluctuation amplitude, and to obtain dynamic weighting coefficients based on the impact of the frequency change trend on frequency compensation. Specifically, it includes:
[0165] The normalized trend fluctuation amplitude output from the amplitude normalization unit is used as the input variable for the adjustment curve. A monotonically increasing function is constructed to map the normalized trend fluctuation amplitude to the adjustment intensity value. Commonly used functions include exponential, hyperbolic tangent, sigmoid curve, or piecewise linear functions. Taking the exponential function as an example, the calculation formula is: ,in The normalized trend fluctuation range, To adjust the sensitivity parameter, a value of 0.8 is set to ensure a more conservative and gradual compensation adjustment; the function value increases significantly with the increase in the amplitude of trend fluctuations, reflecting the system's rapid response capability to drastic frequency changes; the output dynamic weighting coefficients The adjustment factor characterizing the current cycle will be used to control the adjustment rate and weight allocation of the actual compensation strategy, thereby achieving flexible control and fine adjustment of the compensation rhythm.
[0166] The modulation value unit is used to fuse the dynamic weighting coefficients with the time response factor of the current period to obtain the periodic modulation value, specifically including:
[0167] First, receive the dynamic weighting coefficients output by the dynamic weighting unit. And the time response factor derived from the combined influence of the frequency-driven direction and drift trend in the compensation module. The system performs a fusion operation on the two, typically using a direct product form, i.e., the modulation value. If necessary, upper and lower limits for fusion can be set to prevent the output modulation value from being too large or negative. Furthermore, to improve control accuracy, the fusion result can be exponentially smoothed, causing the modulation value to show a gradual adjustment trend over multiple cycles. The final modulation value... The dynamic control weights used for pulse compensation adjustment in the current cycle are used to determine whether to perform compensation operation in this cycle, the magnitude of compensation, and the sign direction of the compensation pulse value, ensuring the accuracy and stability of time correction.
[0168] In a preferred embodiment of the present invention, the correction module includes:
[0169] The periodic mapping unit is used to perform periodic-level matching between the pulse compensation data and the original timing pulse signal of the current period to establish a pulse compensation mapping relationship.
[0170] The pulse correction unit is used to insert or delete timing pulses according to the positive or negative sign and magnitude of the pulse compensation amount, and in combination with the pulse compensation mapping relationship, to obtain a compensation pulse sequence.
[0171] The timing smoothing unit is used to perform boundary transition processing on the compensation pulse sequence to prevent timing jumps or instantaneous changes caused by pulse adjustment, thereby obtaining a smooth compensation sequence.
[0172] The output generation unit is used to convert the smoothing compensation sequence into a logic clock signal to obtain a pulse output sequence, and update the time displayed on the electronic clock accordingly.
[0173] In this embodiment of the invention, the period mapping unit is used to perform periodic matching between the pulse compensation data and the original timing pulse signal of the current period, establish a pulse compensation mapping relationship, ensure a clear matching relationship between the compensation data and the original pulse signal, and avoid the problem of misalignment between compensation instructions and timing data; the pulse correction unit is used to insert or delete timing pulses according to the positive or negative sign and magnitude of the pulse compensation amount, combined with the pulse compensation mapping relationship, to obtain a compensation pulse sequence, effectively compensating for the cumulative time error caused by the crystal oscillator offset, while avoiding abrupt time jumps; the timing smoothing unit is used to perform boundary transition processing on the compensation pulse sequence to prevent timing jumps or instantaneous changes caused by pulse adjustment, to obtain a smooth compensation sequence, ensuring that a large-scale error correction is performed, and also avoiding the user's perception of abrupt changes or second jumps; the output generation unit is used to convert the smooth compensation sequence into a logic clock signal to obtain a pulse output sequence, and update the electronic clock display time according to it, realizing the bridging from micro-frequency compensation to macro-time update, ensuring that the cumulative effect of the small corrections in multiple periods can be ultimately fed back to the display time that the user can perceive.
[0174] The periodic mapping unit is used to perform periodic-level matching between the pulse compensation data and the original timing pulse signal of the current period to establish a pulse compensation mapping relationship, specifically including:
[0175] First, the system receives pulse compensation data for the current period. This data includes the sign and magnitude of the pulse compensation amount, and an identifier field indicates the period number corresponding to that compensation amount. The system extracts the original pulse sequence for the current period, typically stored as a logical pulse arrangement within a unit of time. To achieve precise matching between the compensation operation and the original pulse structure, a period index table is constructed, aligning the time range, number of pulses, pulse interval, and other information for each period with the compensation data. During the matching process, if multiple compensation amounts act simultaneously on the same period, the system accumulates them and records them as a composite compensation item; if the compensation amount is 0, it is recorded as a no-operation tag. Finally, a period-level compensation mapping table is output. Each period's mapping item includes: period number, original pulse structure, target compensation amount, and subsequent operation flag.
[0176] The pulse correction unit is used to insert or delete timing pulses based on the sign and magnitude of the pulse compensation amount, and in conjunction with the pulse compensation mapping relationship, to obtain a compensation pulse sequence. Specifically, it includes:
[0177] The system adjusts the original pulse sequence within each cycle according to the cycle compensation mapping table. When the compensation amount is positive, the system indicates that a specified number of pulses need to be added to the current cycle. This is done by inserting pulse signals at equal intervals in the pulse sequence. For example, if the original pulse sequence contains 100 pulses and the compensation amount is +2, a new pulse will be inserted between the 33rd and 66th pulses, expanding the entire sequence to 102 pulses. Simultaneously, the positions of subsequent pulses are adjusted to maintain timing continuity. The inserted pulses will use a standard logic format, with amplitude and duration completely identical to the original pulses to avoid clock drive anomalies due to signal differences. If the compensation amount is negative, it indicates that the number of pulses in the current cycle needs to be reduced. The system will delete pulses at equal intervals from the original pulses according to a preset strategy, such as deleting pulses 33 and 66. To ensure timing rationality, the deletion operation prioritizes non-critical pulses or logically redundant pulses. If necessary, sequence reconstruction is performed to maintain the maximum uniformity of the remaining pulse distribution, ultimately generating a compensated pulse sequence.
[0178] The timing smoothing unit is used to perform boundary transition processing on the compensation pulse sequence to prevent timing jumps or instantaneous changes caused by pulse adjustment, resulting in a smooth compensation sequence. Specifically, it includes:
[0179] First, the boundary segments at the beginning and end of the compensated pulse sequence are detected to identify whether there is pulse density or sparseness, specifically by checking whether the interval between two consecutive pulses is significantly less than or greater than the average value. If abnormal pulse distribution is detected due to insertion or deletion operations at the boundary segments, a transitional pulse filling strategy is used for adjustment. For example, if two consecutive pulses at the beginning have an excessively short interval, a half-amplitude pulse can be inserted in the middle, or the positions of the preceding and following pulses can be finely delayed to increase the interval, making the signal frequency physically present a gradual transition state. For the density fluctuation region in the middle, the system will also call the sliding window module to evaluate the average rate of change between several consecutive pulses. If it exceeds a threshold, an adjacent period coordination mechanism is triggered, introducing a portion of the pulse from the previous or following period to offset the current difference, thereby smoothing the pulse density of the entire time interval. After smoothing all positions, a smoothed compensated sequence is generated.
[0180] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A timekeeping accuracy adjustment system for an electronic clock, characterized in that, The system includes: The data module is used to periodically collect temperature values, voltage values, and cumulative running time, and to count the number of pulses output by the crystal oscillator per unit time, thereby obtaining status data and fundamental frequency data. The offset module is used to calculate the frequency offset value within different periods based on the base frequency data and frequency calibration value, and obtain the frequency offset sequence. The analysis module is used to slide the frequency shift sequence through a window and calculate the drift trend value within different windows to obtain the frequency drift trend sequence. The response module is used to calculate the difference between different states between adjacent periods based on the state data, obtain the state change, and combine it with the frequency drift trend sequence for analysis to obtain a set of state response coefficients. The driving module is used to identify the effective disturbance components in the state change vectors of different periods based on the state response coefficient set, and obtain the state driving quantity. The compensation module is used to calculate the pulse compensation amount in different periods based on the frequency drift trend sequence and state driving quantity, and obtain pulse compensation data. The calibration module is used to calibrate the timing pulses based on the pulse compensation data, obtain the pulse output sequence, and update the electronic clock time accordingly.
2. The electronic clock timekeeping accuracy adjustment system according to claim 1, characterized in that, The analysis module includes: The window extraction unit is used to set a sliding window of fixed length in the frequency offset sequence, extract the frequency offset value within the sliding window in each period, and obtain the frequency window data. The trend difference unit is used to calculate the difference between the start and end frequency offset values in the frequency window data to obtain the total change in the window frequency. The normalization calculation unit is used to calculate the rate of frequency change per unit time based on the total frequency change and the length of the sliding window, and to obtain the drift trend value. The trend recording unit is used to sort the drift trend values of all sliding windows in different periods according to time order to obtain the frequency drift trend sequence.
3. The electronic clock timekeeping accuracy adjustment system according to claim 2, characterized in that, The response module includes: The state difference unit is used to calculate the component-level difference between the state data of the current period and the previous period to obtain the state change. The trend extraction unit is used to extract the drift trend value corresponding to the current period from the frequency drift trend sequence, and normalize it to obtain the scalar reference value. The response value unit is used to normalize the state change quantity to obtain the normalized state change quantity, and determine the response value of different state dimensions based on it and the scalar reference quantity to obtain the state response value set. The response coefficient unit is used to normalize the ratio of each response value in the state response value set to the sum of all response values, thus obtaining the state response coefficient set.
4. The electronic clock timekeeping accuracy adjustment system according to claim 3, characterized in that, The response value unit includes: The state characteristic factor calculation unit is used to determine the normalized temperature change, normalized voltage change, and normalized cumulative operating time change based on the normalized state change; calculate the temperature state characteristic factor based on the normalized temperature change and normalized voltage change; calculate the voltage state characteristic factor based on the normalized voltage change and normalized cumulative operating time; and calculate the time state characteristic factor based on the normalized cumulative operating time and normalized temperature change. The response value calculation unit is used to nonlinearly amplify the scalar reference quantity to determine the main influence on the frequency drift trend and obtain the power exponent term; to square the state characteristic factor to enhance the influence of state disturbance and obtain the square amplification term; and to fuse the power exponent term and the square amplification term to obtain the main driving term. The perturbation term is obtained by multiplying the state characteristic factor by its logarithmic value, and then fused with the main driving term to obtain the overall driving term; the exponential function of the state characteristic factor is calculated to control the upper limit of the response value, thus obtaining the normalized term; the overall driving term and the normalized term are fused to obtain the response value.
5. The electronic clock timekeeping accuracy adjustment system according to claim 4, characterized in that, The driving module includes: The response direction unit is used to identify the trend direction of frequency shift within a period based on the set of state response coefficients, and obtain the response direction vector. The perturbation projection unit is used to project the state change vector onto the response direction vector, identify the component in the state change that is consistent with the frequency drift trend, and obtain the effective perturbation component. The directional amplification unit is used to multiply the effective disturbance component with the response direction vector component by component to obtain the driving disturbance value; The drive combination unit is used to combine the drive disturbance values of each state dimension according to the periodic identifier to obtain the state drive quantity.
6. The electronic clock timekeeping accuracy adjustment system according to claim 5, characterized in that, The disturbance projection unit includes: The state normalization unit is used to normalize the state change vector by unit magnitude to obtain a normalized state change vector. Angle calculation unit is used to calculate the cosine of the angle between the normalized state change vector and the response direction vector based on the inner product value between the two vectors, and obtain the projection direction coefficient. The amplitude mapping unit is used to calculate the magnitude of the state change vector, multiply it with the projection direction coefficient, and obtain the state projection amplitude. The disturbance construction unit is used to expand the state projection magnitude along the response direction vector proportionally to obtain the projected disturbance vector. The effective filtering unit is used to determine whether the projected disturbance vector is consistent with the direction of the frequency drift trend. When the result is negative or the state projection amplitude is negative, the projected disturbance vector is set to zero to obtain the effective disturbance component.
7. The electronic clock timekeeping accuracy adjustment system according to claim 6, characterized in that, The compensation module includes: The trend-driven fusion unit is used to determine the direction of the drift trend value and the corresponding state driving quantity in each period. When the directions are consistent, the magnitude is weighted to obtain the composite offset influence quantity. The compensation response factor unit is used to calculate the degree of influence of the composite offset on the pulse compensation amplitude per unit time, and obtain the time response factor. The compensation period adjustment unit is used to obtain the trend fluctuation amplitude based on the difference between the composite offset influence of the current period and the previous period, and to obtain the period modulation value by dynamically weighting the time response factor based on it. The pulse adjustment calculation unit is used to convert and map the periodic modulation value and the frequency calibration value, and calculate the pulse adjustment value for each period. The boundary control unit is used to limit the amplitude and constrain the sign of the pulse adjustment value, eliminate invalid pulse adjustment values, output the pulse compensation amount, and obtain the pulse compensation data.
8. The electronic watch and clock timekeeping accuracy adjustment system according to claim 7, characterized in that, The trend-driven fusion unit includes: The direction determination unit is used to extract the vector direction of the drift trend value and the state driving quantity in the current cycle, and to determine whether the two directions are consistent by calculating the cosine value of their included angle. The amplitude extraction unit is used to extract the absolute amplitude of the drift trend value and the state driving quantity as calculation factors when the directions are consistent. The driving unit is used to construct an amplitude weighting function based on the slope of the drift trend value, and to fuse the amplitude of the drift trend value and the amplitude of the state driving value according to the amplitude weighting function to obtain the composite offset influence.
9. The electronic clock timekeeping accuracy adjustment system according to claim 8, characterized in that, The compensation period adjustment unit includes: The trend difference calculation unit is used to calculate the difference between the combined offset influence of the current period and the previous period to obtain the trend fluctuation amplitude. The amplitude normalization unit is used to normalize the amplitude of trend fluctuations, eliminate the discrete effects of periodic amplitude oscillations, and obtain the normalized trend fluctuation amplitude. The dynamic weighting unit is used to construct an adjustment curve based on the normalized trend fluctuation amplitude, and to obtain the dynamic weighting coefficient based on the impact of the frequency change trend on frequency compensation. The modulation value unit is used to fuse the dynamic weighting coefficients with the time response factor of the current period to obtain the periodic modulation value.
10. The electronic clock timekeeping accuracy adjustment system according to claim 9, characterized in that, The correction module includes: The periodic mapping unit is used to perform periodic matching between the pulse compensation data and the original timing pulse signal of the current period to establish a pulse compensation mapping relationship. The pulse correction unit is used to insert or delete timing pulses according to the positive or negative sign and magnitude of the pulse compensation amount, and in combination with the pulse compensation mapping relationship, to obtain a compensation pulse sequence. The timing smoothing unit is used to perform boundary transition processing on the compensation pulse sequence to prevent timing jumps or instantaneous changes caused by pulse adjustment, thereby obtaining a smooth compensation sequence. The output generation unit is used to convert the smoothing compensation sequence into a logic clock signal to obtain a pulse output sequence, and update the time displayed on the electronic clock accordingly.