Real time clock (RTC) chip frequency drift accurate modeling method and device based on global navigation satellite system (GNSS) clock difference data
By using GNSS clock difference data and neural network model to model and predict the frequency difference sequence of the RTC clock chip, the frequency drift problem of the RTC clock chip is solved, and the independent timing capability and the accuracy of time measurement are improved.
Patent Information
- Application Number
- CN202510480360.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-17
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2045-04-17
AI Technical Summary
The frequency drift problem of existing RTC clock chips is difficult to effectively solve, and traditional calibration methods cannot cope with complex influencing factors, resulting in poor independent timing capabilities.
By receiving GNSS clock difference data and reading RTC clock chip data, the neural network model is used to model and predict the frequency difference sequence to achieve accurate modeling and calibration of frequency drifts.
It improves the independent timing capability of the RTC clock chip, realizes accurate prediction and calibration of frequency drifts, and significantly improves the accuracy of time measurement.
Smart Images

Figure CN119987487A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of positioning technology, and in particular to a method and device for accurately modeling the frequency drift of an RTC clock chip based on GNSS clock difference data. Background Art
[0002] Real-time clock (RTC) chips play a key role in many electronic devices, but there is a frequency drift problem that affects the accuracy of time measurement. Existing calibration methods have limitations. Traditional manual calibration or simple temperature compensation models cannot cope with complex influencing factors. In addition, existing modeling methods are insufficient in data accuracy and model adaptability, resulting in poor autonomous timing capabilities of RTC clock chips. With the widespread application of GNSS, its high-precision timing service provides a new way to solve the frequency drift problem of RTC clock chips. Using GNSS signals to accurately model the frequency drift of RTC clock chips can effectively improve the autonomous timing capabilities of RTC clock chips. Summary of the invention
[0003] Based on this, it is necessary to provide a method and device for accurately modeling the frequency drift of an RTC clock chip based on GNSS clock difference data in response to the above technical problems.
[0004] A method for accurately modeling frequency drift of an RTC clock chip based on GNSS clock difference data, the method comprising: Receive GNSS clock difference data and read RTC clock chip data at preset intervals, and use the GNSS clock difference data to synchronize the RTC clock chip data; Calculate the frequency difference sequence according to the GNSS clock difference data and the RTC clock chip data within a preset time window; The GNSS clock difference data and the RTC clock chip data are used as input samples of a pre-built neural network model, the frequency difference sequence is used as an output label, and the neural network model is trained to obtain a trained neural network model; The real-time RTC clock chip data is input into the trained neural network model, and the current RTC clock chip frequency drift prediction value is output.
[0005] In one of the embodiments, it also includes: receiving GNSS satellite signals through a GNSS receiver, and obtaining GNSS clock error data by parsing the GNSS satellite signals, or receiving GNSS satellite signals through a GNSS receiving module built into a user terminal, and obtaining GNSS clock error data by parsing the GNSS satellite signals; on the user terminal, reading the count value and timestamp of the RTC clock chip at a preset interval through a pre-installed data acquisition program to obtain the RTC clock chip data.
[0006] In one of the embodiments, it also includes: synchronizing the timestamp of the RTC clock chip data based on the GNSS time of the GNSS clock difference data.
[0007] In one embodiment, the neural network model is a multi-layer perceptron structure.
[0008] In one of the embodiments, it also includes: using the GNSS clock error data, RTC clock chip data and environmental data as input samples of a pre-built neural network model.
[0009] In one of the embodiments, the method further includes associating the environmental data with the frequency difference sequence and using the result as a feature of the input sample.
[0010] In one of the embodiments, the method further includes: adjusting the RTC clock chip according to the current RTC clock chip frequency drift prediction value.
[0011] A device for accurately modeling frequency drift of an RTC clock chip based on GNSS clock difference data, the device comprising: A data acquisition module, used to receive GNSS clock difference data and read RTC clock chip data at preset intervals, and use the GNSS clock difference data to synchronize the RTC clock chip data; The frequency difference sequence calculation module is used to calculate the frequency difference sequence according to the GNSS clock difference data and the RTC clock chip data within a preset time window. A model training module, used to use the GNSS clock error data and the RTC clock chip data as input samples of a pre-built neural network model, and the frequency difference sequence as an output label, to train the neural network model to obtain a trained neural network model; The prediction module is used to input the real-time RTC clock chip data into the trained neural network model and output the current RTC clock chip frequency drift prediction value.
[0012] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented: Receive GNSS clock difference data and read RTC clock chip data at preset intervals, and use the GNSS clock difference data to synchronize the RTC clock chip data; Calculate the frequency difference sequence according to the GNSS clock difference data and the RTC clock chip data within a preset time window; The GNSS clock difference data and the RTC clock chip data are used as input samples of a pre-built neural network model, the frequency difference sequence is used as an output label, and the neural network model is trained to obtain a trained neural network model; The real-time RTC clock chip data is input into the trained neural network model, and the current RTC clock chip frequency drift prediction value is output.
[0013] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps: Receive GNSS clock difference data and read RTC clock chip data at preset intervals, and use the GNSS clock difference data to synchronize the RTC clock chip data; Calculate the frequency difference sequence according to the GNSS clock difference data and the RTC clock chip data within a preset time window; The GNSS clock difference data and the RTC clock chip data are used as input samples of a pre-built neural network model, the frequency difference sequence is used as an output label, and the neural network model is trained to obtain a trained neural network model; The real-time RTC clock chip data is input into the trained neural network model, and the current RTC clock chip frequency drift prediction value is output.
[0014] The above-mentioned RTC clock chip frequency drift accurate modeling method and device based on GNSS clock difference data, in the model training stage, receives GNSS clock difference data and reads RTC clock chip data at preset intervals, uses GNSS clock difference data to synchronize RTC clock chip data, and calculates frequency difference sequence according to GNSS clock difference data and RTC clock chip data within the preset time window. The GNSS clock difference data and RTC clock chip data are used as input samples of the pre-built neural network model, and the frequency difference sequence is used as the output label to train the neural network model to obtain a trained neural network model. Then, in the real-time prediction stage, the real-time RTC clock chip data is input into the trained neural network model, and the current RTC clock chip frequency drift prediction value is output. Accurate prediction of RTC clock chip frequency drift can be achieved in the absence of GNSS navigation signals. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 A schematic diagram of a flow chart of a method for accurately modeling frequency drift of an RTC clock chip based on GNSS clock error data in one embodiment; Figure 2 A structural block diagram of a device for accurately modeling frequency drift of an RTC clock chip based on GNSS clock difference data in one embodiment; Figure 3 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0016] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0017] In one embodiment, Figure 1 As shown, a method for accurately modeling the frequency drift of an RTC clock chip based on GNSS clock difference data is provided, comprising the following steps: Step 102, receiving GNSS clock difference data and reading RTC clock chip data at preset intervals, and using the GNSS clock difference data to synchronize the RTC clock chip data.
[0018] Step 104: Calculate a frequency difference sequence according to the GNSS clock difference data and the RTC clock chip data within a preset time window.
[0019] Step 106, using the GNSS clock error data and the RTC clock chip data as input samples of the pre-built neural network model, and the frequency difference sequence as the output label, to train the neural network model and obtain a trained neural network model.
[0020] Step 108, input the real-time RTC clock chip data into the trained neural network model, and output the current RTC clock chip frequency drift prediction value.
[0021] In the above-mentioned RTC clock chip frequency drift accurate modeling method based on GNSS clock difference data, in the model training stage, GNSS clock difference data is received and RTC clock chip data is read at preset intervals, and the RTC clock chip data is synchronized with the GNSS clock difference data. Within the preset time window, the frequency difference sequence is calculated according to the GNSS clock difference data and the RTC clock chip data, and the GNSS clock difference data and the RTC clock chip data are used as input samples of the pre-built neural network model, and the frequency difference sequence is used as the output label to train the neural network model to obtain a trained neural network model. Then, in the real-time prediction stage, the real-time RTC clock chip data is input into the trained neural network model, and the current RTC clock chip frequency drift prediction value is output. Accurate prediction of the RTC clock chip frequency drift can be achieved without GNSS navigation signals.
[0022] In one of the embodiments, GNSS satellite signals are received by a GNSS receiver, and GNSS clock error data is obtained by parsing the GNSS satellite signals, or GNSS satellite signals are received by a GNSS receiving module built into a user terminal, and GNSS clock error data is obtained by parsing the GNSS satellite signals; on the user terminal, the count value and timestamp of the RTC clock chip are read at preset intervals through a pre-installed data acquisition program to obtain the RTC clock chip data.
[0023] Specifically, the preset interval can be flexibly adjusted within 1-10 minutes according to chip characteristics.
[0024] In one of the embodiments, the acquired GNSS clock error data and RTC clock chip data need to be cleaned and screened. Specifically, an intelligent algorithm is used to remove abnormal values and erroneous data caused by signal interference, equipment failure, etc. according to the set data threshold and anomaly detection rules. For example, records that obviously deviate from the normal data range or have data jumps are removed.
[0025] In addition, a high-precision time synchronization algorithm can be used to synchronize the timestamp of the RTC clock chip data based on the GNSS time of the GNSS clock difference data, ensuring a high degree of consistency between the two on the time axis.
[0026] In one of the embodiments, environmental data may be introduced as a feature of the input sample to analyze the frequency drift caused by environmental factors. Specifically, multiple regression analysis and other methods may be used to associate the frequency difference sequence and extract the frequency drift features.
[0027] In another embodiment, the neural network model is a multi-layer perceptron structure.
[0028] Specifically, the number of input layer nodes of the neural network model is determined according to the input features. For example, if the GNSS clock error data, RTC clock chip data, and environmental factor data (if any) are used as input features, and if there are n features in total, the number of input layer nodes is n. The hidden layer is set to 2-3 layers, and the number of nodes is determined according to the empirical formula (for example, according to the number of input layer nodes m and the number of output layer nodes p, the number of nodes in the middle hidden layer can be set to The number of nodes in the output layer is 1, which is used to output the predicted frequency drift value of the RTC clock chip.
[0029] In addition, the input data needs to be preprocessed before it is input into the model. First, a normalization method (such as minimum-maximum normalization or z-score normalization) is used to map the data to a specific interval (such as [-1, 1] or [0, 1]) to improve the training efficiency and stability of the neural network. If there is environmental factor data (such as temperature, humidity, etc.), it is combined with data such as frequency difference sequences to generate new feature vectors, such as by multiplying temperature and frequency difference, to enrich the information content of the input data.
[0030] Then, the preprocessed data set is divided into training set, validation set and test set according to a certain ratio (such as 70% for training, 15% for validation, and 15% for testing). The mean square error (MSE) function is selected as the loss function, and the stochastic gradient descent method and its variants (such as Adagrad, Adadelta, Adam, etc.) optimization algorithm are used to adjust the model weights and biases. Set a suitable learning rate (the initial learning rate can be between 0.001 and 0.1, and the learning rate decay strategy such as exponential decay or step decay is adopted according to the training situation), and use L2 regularization (regularization parameters are adjusted according to the complexity of the model) and Dropout technology (Dropout probability is between 0.2 and 0.5) to prevent overfitting and perform deep training on the model. During the training process, distributed computing and parallel processing are supported to improve training efficiency.
[0031] During the training process, after a certain number of rounds (such as every 5-10 rounds), use the validation set to evaluate the model. Calculate the loss value, accuracy, F1 value, recall rate and other indicators on the validation set to observe whether the model is overfitting or underfitting. If the validation set loss value no longer decreases or starts to increase, it indicates that the model may be overfitting. At this time, you can terminate the training early or take further tuning measures, such as adjusting the regularization parameters, reducing the number of hidden layer nodes or layers, etc.
[0032] The model prediction results are compared and verified in detail with the actual measured RTC clock chip frequency drift data. Error indicators such as mean square error (MSE), mean absolute error (MAE), and root mean square error (RMSE) are calculated, and intuitive graphics such as error distribution histograms and scatter plots are drawn to deeply analyze the distribution law and characteristics of the prediction error. Based on the evaluation and verification results, the model is fine-tuned and optimized to ensure that the model performance meets the high-precision requirements of practical applications.
[0033] Finally, on the user terminal device, the current data of the RTC clock chip is obtained in real time and input into the strictly trained and verified model. The powerful prediction ability of the model is used to quickly and accurately predict the frequency drift value of the RTC clock chip at the current moment. According to the predicted frequency drift value, the key parameters such as the clock frequency and count value of the RTC clock chip are adjusted in real time to achieve accurate compensation and calibration of the frequency drift, significantly improving the time measurement accuracy of the RTC clock chip, so that it can maintain stable and reliable performance in various complex environments.
[0034] It should be understood that although Figure 1The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0035] In one embodiment, Figure 2 As shown, a device for accurately modeling the frequency drift of an RTC clock chip based on GNSS clock difference data is provided, comprising: a data acquisition module 202, a frequency difference sequence calculation module 204, a model training module 206 and a prediction module 208, wherein: The data acquisition module 202 is used to receive GNSS clock difference data and read RTC clock chip data at preset intervals, and use the GNSS clock difference data to synchronize the RTC clock chip data; A frequency difference sequence calculation module 204 is used to calculate a frequency difference sequence according to the GNSS clock difference data and the RTC clock chip data within a preset time window; A model training module 206 is used to use the GNSS clock error data and the RTC clock chip data as input samples of a pre-built neural network model, and the frequency difference sequence as an output label, to train the neural network model to obtain a trained neural network model; The prediction module 208 is used to input the real-time RTC clock chip data into the trained neural network model and output the current RTC clock chip frequency drift prediction value.
[0036] For the specific definition of the RTC clock chip frequency drift accurate modeling device based on GNSS clock difference data, please refer to the definition of the RTC clock chip frequency drift accurate modeling method based on GNSS clock difference data in the above text, which will not be repeated here. Each module in the above-mentioned RTC clock chip frequency drift accurate modeling device based on GNSS clock difference data can be fully or partially implemented by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0037] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 3As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for accurately modeling the frequency drift of an RTC clock chip based on GNSS clock difference data is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.
[0038] Those skilled in the art will understand that Figure 3 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0039] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method in the above embodiment when executing the computer program.
[0040] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method in the above embodiment are implemented.
[0041] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0042] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0043] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention. It should be pointed out that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for accurately modeling the frequency drift of an RTC clock chip based on GNSS clock error data, characterized in that: The method comprises: Receive GNSS clock difference data and read RTC clock chip data at preset intervals, and use the GNSS clock difference data to synchronize the RTC clock chip data; Calculate the frequency difference sequence according to the GNSS clock difference data and the RTC clock chip data within a preset time window; The GNSS clock difference data and the RTC clock chip data are used as input samples of a pre-built neural network model, the frequency difference sequence is used as an output label, and the neural network model is trained to obtain a trained neural network model; The real-time RTC clock chip data is input into the trained neural network model, and the current RTC clock chip frequency drift prediction value is output.
2. The method according to claim 1, characterized in that: Receive GNSS clock difference data and read RTC clock chip data at preset intervals, including: Receiving GNSS satellite signals through a GNSS receiver, and obtaining GNSS clock error data by parsing the GNSS satellite signals, or receiving GNSS satellite signals through a GNSS receiving module built into a user terminal, and obtaining GNSS clock error data by parsing the GNSS satellite signals; On the user terminal, the count value and time stamp of the RTC clock chip are read at preset intervals through a pre-installed data acquisition program to obtain the RTC clock chip data.
3. The method according to claim 2, characterized in that The RTC clock chip data is time synchronized using the GNSS clock difference data, including: The timestamp of the RTC clock chip data is synchronized based on the GNSS time of the GNSS clock difference data.
4. The method according to claim 1, characterized in that The neural network model is a multi-layer perceptron structure.
5. The method according to any one of claims 1 to 4, characterized in that: The GNSS clock error data and the RTC clock chip data are used as input samples of a pre-built neural network model, including: The GNSS clock error data, RTC clock chip data and environmental data are used as input samples of the pre-built neural network model.
6. The method according to claim 5, characterized in that The method further comprises: After associating the environmental data with the frequency difference sequence, the data is used as the feature of the input sample.
7. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: Adjust the RTC clock chip according to the current RTC clock chip frequency drift prediction value.
8. A device for accurately modeling frequency drift of RTC clock chip based on GNSS clock difference data, characterized in that: The device comprises: A data acquisition module, used to receive GNSS clock difference data and read RTC clock chip data at preset intervals, and use the GNSS clock difference data to synchronize the RTC clock chip data; The frequency difference sequence calculation module is used to calculate the frequency difference sequence according to the GNSS clock difference data and the RTC clock chip data within a preset time window. A model training module, used to use the GNSS clock error data and the RTC clock chip data as input samples of a pre-built neural network model, and the frequency difference sequence as an output label, to train the neural network model to obtain a trained neural network model; The prediction module is used to input the real-time RTC clock chip data into the trained neural network model and output the current RTC clock chip frequency drift prediction value.
Citation Information
Patent Citations
Mobile advanced master clock, method of establishing advanced master clock and autonomous vehicle
CN110967967A
RTC clock self-calibration method, electronic equipment and storage medium
CN116388913A
Anti-cheating method and device based on time synchronization and medium
CN116774251A
Electric power data processing method and system based on satellite time synchronization, and medium
CN118605116A
Time synchronization and conversion for safety validation in autonomous systems and applications
US20240085942A1
Cited By
Clock error drift modeling method and system based on statistical likelihood optimization
CN121598812A
Clock error drift modeling method and system based on statistical likelihood optimization
CN121598812B