CN116388913B - RTC clock self-calibration method, electronic equipment and storage medium - Google Patents

RTC clock self-calibration method, electronic equipment and storage medium Download PDF

Info

Publication number
CN116388913B
CN116388913B CN202211723077.2A CN202211723077A CN116388913B CN 116388913 B CN116388913 B CN 116388913B CN 202211723077 A CN202211723077 A CN 202211723077A CN 116388913 B CN116388913 B CN 116388913B
Authority
CN
China
Prior art keywords
rtc
rtc clock
clock
time
self
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202211723077.2A
Other languages
Chinese (zh)
Other versions
CN116388913A (en
Inventor
王继红
徐昶
高秀文
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Mobiletek Telecommunication Ltd
Original Assignee
Shanghai Mobiletek Telecommunication Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Mobiletek Telecommunication Ltd filed Critical Shanghai Mobiletek Telecommunication Ltd
Priority to CN202211723077.2A priority Critical patent/CN116388913B/en
Publication of CN116388913A publication Critical patent/CN116388913A/en
Application granted granted Critical
Publication of CN116388913B publication Critical patent/CN116388913B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network
    • H04J3/0685Clock or time synchronisation in a node; Intranode synchronisation
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T90/00Enabling technologies or technologies with a potential or indirect contribution to GHG emissions mitigation

Abstract

The embodiment of the application relates to the technical field of automatic driving and discloses an RTC clock self-calibration method, electronic equipment and a storage medium. The method comprises the following steps: periodically acquiring time offsets of a plurality of RTC clocks from a first moment to a second moment and environment parameters of the environment where each RTC clock is located; based on the time offset and the environmental parameters, constructing an RTC clock self-calibration model; if the target RTC clock and the standard clock are detected to be changed from synchronous to asynchronous, acquiring environmental parameters of the environment where the target RTC clock is located within a preset time period from the changed time; the environmental parameters of the target RTC clock are input into the RTC clock self-calibration model, the target time offset of the target RTC clock in the preset time length is obtained, and the target RTC clock in the preset time length is calibrated by adopting the target time offset, so that the calibration of the RTC clock in various scenes is realized, the precision of the system clock is ensured, and the cost is lower.

Description

RTC clock self-calibration method, electronic equipment and storage medium
Technical Field
The embodiment of the application relates to the technical field of automatic driving, in particular to an RTC clock self-calibration method, electronic equipment and a storage medium.
Background
In the Clock synchronization application scenario of the on-board ethernet based on the accurate Time protocol (General Precise Time Protocol, GPTP), if the GPTP synchronization Clock source of the vehicle adopts the Clock source of the system itself, that is, the real_time Clock (RTC) as the base Clock, the GPTP synchronization Clock source (that is, the RTC Clock) of the vehicle automatically synchronizes the GPS Clock or the network Clock. After the vehicle starts, the TBOX of the vehicle synchronizes the time of the RTC clock to each domain controller of the vehicle through GPTP, but if the vehicle is in a GPS-free and network-free environment for a long time, such as an underground parking lot, the RTC clock automatically shifts due to its own characteristics, resulting in inaccurate system time and thus inaccurate time synchronization to each domain controller of the vehicle.
To solve the above problem, the RTC clock is usually calibrated in two ways to ensure accuracy of the system time: one way is that the RTC clock adopts GPTP to synchronize other clock sources to realize self calibration of the RTC clock, but in some situations, the GPTP synchronized clock sources may have a certain time deviation, so that the accuracy of the system time cannot be completely ensured, and if the GPTP synchronized clock sources adopt high-precision clock sources to reduce the deviation, the corresponding cost is increased; the other mode is to calibrate the RTC by adopting a scheme of fixed time offset calibration, but the calibration cannot be adjusted according to the actual scene, so that the application range is small.
Disclosure of Invention
The embodiment of the application aims to provide a self-calibration method of an RTC clock, electronic equipment and a storage medium, which can realize the calibration of the RTC clock under various scenes, thereby ensuring the precision of a system clock and having lower cost.
In order to solve the technical problems, an embodiment of the present application provides a method for self-calibrating an RTC clock, including the following steps: periodically acquiring time offsets generated in a time period from a first moment to a second moment of a plurality of RTC clocks and environment parameters of the environment where each RTC clock is located in the time period; the first time is a time when each RTC clock and the standard clock change from synchronization to non-synchronization, and the second time is a time when each RTC clock and the standard clock change from the non-synchronization to re-synchronization; constructing an RTC clock self-calibration model based on the time offset and the environmental parameter; if the target RTC clock and the standard clock are detected to be changed from synchronous to asynchronous, acquiring environmental parameters of the environment where the target RTC clock is located within a preset duration from the moment of the change; inputting the environmental parameters of the target RTC clock into the RTC clock self-calibration model, obtaining a target time offset of the target RTC clock within the preset duration, and calibrating the target RTC clock within the preset duration by adopting the target time offset.
The embodiment of the application also provides electronic equipment, which comprises: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the RTC clock self calibration method described above.
Embodiments of the present application also provide a computer readable storage medium storing a computer program that when executed by a processor implements the RTC clock self-calibration method described above.
According to the RTC clock self-calibration method, time offsets of a plurality of RTC clocks in a time period from first time to second time and environment parameters of environments where the RTC clocks are located between the first time and the second time are obtained periodically, wherein the first time is the time when the RTC clocks are changed from synchronization to non-synchronization with the standard clock, the second time is the time when the RTC clocks are changed from non-synchronization to re-synchronization with the standard clock, namely, the time offsets of the RTC clocks which cannot occur in the period of being synchronous with the standard clock are obtained, based on the obtained time offsets of the RTC clocks and the environment parameters, an RTC clock self-calibration model can be built, when the fact that the RTC clocks are changed from synchronization to non-synchronization is detected, the environment parameters of the RTC clocks which are located in the preset time from the changed time can be obtained, the RTC clocks are input into the RTC clock self-calibration model, the target time offsets of the RTC clocks in the preset time are obtained, and the target time offsets of the RTC clocks in the preset time are finally adopted to calibrate the RTC clocks in the preset time. Because the environmental parameters of the environment where the RTC clock is located can influence the time offset, the time offset and the environmental parameters of a plurality of RTC clocks which are obtained regularly in the application are richer in samples, the mode of calibrating the target RTC clock by the self-calibration model obtained through training is applicable to various scenes, the result is more accurate, a high-precision clock source is not needed, and the cost is greatly reduced.
In addition, before the self-calibration model of the RTC clock is built based on the time offset and the environmental parameter, the method further includes: if the change amount of the environmental parameter of the first RTC clock from the first moment to the second moment is larger than a first preset threshold value in the environmental parameters of the RTC clocks, eliminating the environmental parameter of the first RTC clock from the environmental parameters of the RTC clocks, eliminating the time offset of the first RTC clock from the time offset of the RTC clocks, and obtaining the first environmental parameters of the RTC clocks after elimination and the first time offset of the RTC clocks after elimination; the building an RTC clock self-calibration model based on the time offset and the environmental parameter includes: and constructing the RTC clock self-calibration model based on the first time offset and the first environment parameter. In the method, the RTC clock with the environment parameter changing amount larger than the first preset threshold value between the first moment and the second moment is removed, so that the precision of the built RTC clock self-calibration model is guaranteed.
In addition, before the self-calibration model of the RTC clock is built based on the time offset and the environmental parameter, the method further includes: if the change amount of the environmental parameter of the second RTC clock from the first time to the second time is smaller than a second preset threshold value in the environmental parameters of the RTC clocks, eliminating the environmental parameter of the second RTC clock from the environmental parameters of the RTC clocks, eliminating the time offset of the second RTC clock from the time offset of the RTC clocks, and obtaining the second environmental parameters of the RTC clocks after elimination and the second time offset of the RTC clocks after elimination; the building an RTC clock self-calibration model based on the time offset and the environmental parameter includes: and constructing the RTC clock self-calibration model based on the second time offset and the second environment parameter. In the method, the RTC clock with the environment parameter of which the variation is smaller than the second preset threshold value between the first moment and the second moment is eliminated, so that the precision of the built RTC clock self-calibration model is ensured.
In addition, the RTC clock self-calibration model is constructed based on a multivariable linear regression algorithm, wherein the multivariable linear regression algorithm is a gradient descent method or a standard equation method, so that the precision of the constructed RTC clock self-calibration model is improved.
In addition, the RTC clock is applied to a vehicle, and the environmental parameters include: temperature, humidity, vibration intensity of the vehicle and pressure of the vehicle to improve accuracy of the built RTC clock self-calibration model.
In addition, the calculation formula of the target time offset is as follows: y=α1x1+α2x2+α3x3+α4x4+α5x5; wherein x1 represents the temperature, α1 represents the weight of the temperature, x2 represents the humidity, α2 represents the weight of the humidity, x3 represents the vibration intensity of the vehicle, α3 represents the weight of the vibration intensity, x4 represents the pressure of the vehicle, α4 represents the weight of the pressure, x5 represents the preset duration, and α5 represents the weight of the preset duration, so as to ensure the precision of the built RTC clock self-calibration model.
In addition, the calculation formulas of α1, α2, α3, α4, and α5 are as follows: alpha= (X T X) -1 X T Y; wherein alpha is a matrix formed by the alpha 1, the alpha 2, the alpha 3, the alpha 4 and the alpha 5, X is a matrix formed by n X1, n X2, n X3, n X4 and n X5 T And the transposed matrix of X and the matrix formed by n Y are used for guaranteeing the precision of the constructed RTC clock self-calibration model.
In addition, constraint conditions adopted in the process of constructing the RTC clock self-calibration model are as follows: the difference value between the predicted time offset and the standard time offset output by the RTC clock self-calibration model is smaller than a third preset threshold value; the standard time offset is calculated based on the calibration time generated by calibrating each RTC clock by the standard clock and the first time, so that the precision of the constructed RTC clock self-calibration model is further ensured.
Drawings
One or more embodiments are illustrated by way of example and not limitation in the figures of the accompanying drawings, in which like references indicate similar elements, and in which the figures of the drawings are not to be taken in a limiting sense, unless otherwise indicated.
FIG. 1 is a flow chart of a method of RTC clock self-calibration provided in accordance with one embodiment of the present application;
fig. 2 is a schematic structural diagram of an electronic device according to another embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the embodiments of the present application will be described in detail below with reference to the accompanying drawings. However, as will be appreciated by those of ordinary skill in the art, in the various embodiments of the present application, numerous technical details have been set forth in order to provide a better understanding of the present application. However, the technical solutions claimed in the present application can be implemented without these technical details and with various changes and modifications based on the following embodiments. The following embodiments are divided for convenience of description, and should not be construed as limiting the specific implementation of the present application, and the embodiments may be mutually combined and referred to without contradiction.
Because the TBOX of the vehicle synchronizes the system clock (i.e., RTC clock) to each domain controller of the vehicle after the vehicle is started, if the vehicle is in a specific environment and the clock cannot be synchronized with the network clock, and clock offset occurs, the time for synchronizing to each domain controller will be inaccurate, and thus the normal operation of the vehicle cannot be ensured. If the vehicle leaves the specific environment, the RTC clock is automatically synchronized with the network clock, but since the time of the domain controller is shifted before that, if the TBOX synchronizes the RTC clock synchronized with the network clock again to the domain controller, the time of the domain controller jumps. For some domain controllers, such as advanced driving assistance system (Advanced Driving Assistance System, ADAS) domain controllers, the running safety of the vehicle cannot be guaranteed because of the time jump, so that the calibration of the RTC clock is particularly important.
The calibration method of the RTC clock in the related art has the problems that the cost is high and the precision of the calibrated RTC clock cannot be guaranteed, and the calibration cost can be reduced on the premise of guaranteeing the precision of the calibrated RTC clock.
An embodiment of the present application relates to an RTC clock self-calibration method, and a specific flow of the RTC clock self-calibration method of the present embodiment may be as shown in fig. 1, including:
step 101, periodically acquiring time offsets generated in a time period from a first time to a second time of a plurality of RTC clocks, and environment parameters of environments where the RTC clocks are located in the time period; the first time is a time when each RTC clock and the standard clock change from synchronization to non-synchronization, and the second time is a time when each RTC clock and the standard clock change from non-synchronization to re-synchronization.
Step 102, building an RTC clock self-calibration model based on the time offset and the environmental parameters.
Step 103, if it is detected that the target RTC clock and the standard clock are changed from synchronous to asynchronous, acquiring an environmental parameter of an environment in which the target RTC clock is located within a preset duration from the changed time.
Step 104, inputting the environmental parameters of the target RTC clock into the RTC clock self-calibration model, obtaining the target time offset of the target RTC clock within the preset duration, and calibrating the target RTC clock within the preset duration by adopting the target time offset.
In this embodiment, by periodically acquiring time offsets of a plurality of RTC clocks occurring in a time period from a first time to a second time and environmental parameters of environments where the RTC clocks are located between the first time and the second time, where the first time is a time when the RTC clocks are changed from synchronization to non-synchronization with the standard clock, the second time is a time when the RTC clocks are changed from non-synchronization to re-synchronization with the standard clock, that is, acquiring time offsets of the RTC clocks occurring during a period when the RTC clocks cannot be synchronized with the standard clock, based on the acquired time offsets of the RTC clocks and the environmental parameters, an RTC clock self-calibration model may be constructed, so that when the RTC clocks are detected to be changed from synchronization to non-synchronization with the standard clock, the environmental parameters of the environments where the RTC clocks are located within a preset time period from the changed time can be acquired, and the environmental parameters are input into the RTC clock self-calibration model, so as to obtain a target time offset of the RTC clocks within the preset time period, and finally calibrate the target RTC clocks within the preset time period by using the target time offset. Because the environmental parameters of the environment where the RTC clock is located can influence the time offset, the time offset and the environmental parameters of a plurality of RTC clocks which are obtained regularly in the application are richer in samples, the mode of calibrating the target RTC clock by the self-calibration model obtained through training is applicable to various scenes, the result is more accurate, a high-precision clock source is not needed, and the cost is greatly reduced.
The implementation details of the RTC clock self calibration method of the present embodiment are specifically described below, and the following is merely provided for convenience of understanding, and is not necessary to implement the present embodiment.
In step 101, since the RTC clock cannot be synchronized with the standard clock and thus time offset occurs when the vehicle is in the specific environment, the time offset occurring in the time period from the first time to the second time of the different vehicles is periodically acquired, where the first time refers to the time when the vehicle enters the specific environment and the RTC clock cannot be synchronized with the standard clock, i.e. changes from synchronization to non-synchronization, and the second time refers to the time when the vehicle leaves the specific environment and the RTC clock can be synchronized with the standard clock, i.e. changes from non-synchronization to re-synchronization, i.e. the time offset occurring during the time when each RTC clock cannot be synchronized with the standard clock is acquired. Since the environmental parameter of the specific environment is an important factor affecting the time offset, the environmental parameters of the environments where the RTC clocks are located in the time period from the first time to the second time are acquired simultaneously. Wherein, the specific environment refers to a network-free and GPS-free environment, and the standard clock can be a network clock or a GPS clock.
In a specific implementation, since the TBOX of the automobile uses the network clock or the GPS clock as the reference clock for timing the vehicle and communicating with other devices, the vehicle can obtain the time offset occurring in the time period from the first time to the second time by acquiring the time before the RTC clock is synchronized with the network clock or the GPS clock and the time after the RTC clock is synchronized with the network clock or the GPS clock. The RTC clock is applied to the vehicle, so the environmental parameters of the environment in which the RTC clock is located include, in particular, temperature, humidity, vibration intensity of the vehicle, and pressure of the vehicle, and it is understood that the factors affecting the time offset may also include other parameters, which are not limited in this embodiment.
In step 102, the acquired time offset of the RTC clocks of each vehicle in the time period from the first time to the second time and the environmental parameters of the environment where the RTC clocks are located in the time period are used as training sets, and a machine learning algorithm is used to train the training sets, so as to construct a corresponding RTC clock self-calibration model. The machine learning algorithm may adopt a multi-variable linear regression algorithm, and the multi-variable linear regression algorithm may select a gradient descent method or a standard equation method.
Setting the temperature, the humidity, the vibration intensity of the vehicle and the pressure of the vehicle in the environmental parameters as x1, x2, x3 and x4 respectively, and setting the duration from the first moment to the second moment as x5, and constructing the relationship between the environmental parameters and the time offset by adopting a multivariable linear regression algorithm as follows:
y=α1x1+α2x2+α3x3+α4x4+α5x5
where α1 represents a weight of temperature, α2 represents a weight of humidity, α3 represents a weight of vibration intensity of the vehicle, α4 represents a weight of pressure of the vehicle, and α5 represents a weight of a period from a first time to a second time.
Assuming that there are n sets of acquired data (time offset and environmental parameters occurring in a time period from a first time to a second time), which may be data for different time periods of a plurality of vehicles, the following matrix may be constructed:
wherein X is a matrix formed by n groups of environment parameters, Y is a matrix formed by n groups of time offsets, and alpha is a matrix formed by each environment parameter.
Then α= (X T X) -1 X T Y,X T Is the transposed matrix of X. It can be understood that α1, α2, α3, α4 and α5 in the α matrix can be continuously and iteratively optimized in the training process, so as to find an optimal α matrix and improve the precision of the RTC clock self-calibration model.
In addition, constraint conditions adopted in the process of constructing the RTC clock self-calibration model are as follows: the difference value between the predicted time offset and the standard time offset output by the RTC clock self-calibration model is smaller than a third preset threshold value; the standard time offset is calculated based on the calibration time generated by calibrating each RTC clock by the standard clock and the first time. If the difference value between the predicted time offset and the standard time offset output by the RTC clock self-calibration model is smaller than the third preset threshold value, the time offsets generated in the time period from the first moment to the second moment of the RTC clocks are continuously and periodically obtained, and the environmental parameters of the environment where the RTC clocks are located in the time period are continuously expanded to gradually increase the accuracy of the RTC clock self-calibration model until the difference value between the predicted time offset and the standard time offset is smaller than the third preset threshold value, i.e., the accuracy of the RTC clock self-calibration model approaches to the accuracy of the standard clock.
The RTC clock self-calibration model can be generated through the training process, and the precision of the RTC clock self-calibration model gradually approaches to the precision of the standard clock in the continuous iterative optimization process, so that the RTC clock can calibrate the time of the RTC clock to the normal time through the RTC clock self-calibration model even if the vehicle is in a network-free and GPS-free environment.
In some embodiments, before building the RTC clock self-calibration model based on the time offset and the environmental parameter, the acquired environmental parameter is first processed, and the time offset and the processed environmental parameter are used as a training set of the RTC clock self-calibration model, so as to improve the calibration accuracy of the RTC clock self-calibration model.
In a specific implementation, firstly, an acquired environmental parameter is identified, for example, a vehicle type to which the environmental parameter belongs, an acquired time period and the like, then, the environmental parameter is subjected to quantization processing, for example, the temperature of the environment in the time period is continuously changed, and then, an average value of the temperature in the time period is taken as the environmental parameter, and other environmental parameters do the same operation.
In one example, the environmental parameters are also required to be screened, and abnormal or useless data in the environmental parameters are removed, which specifically includes the following steps:
if the change amount of the environmental parameter of the first RTC clock from the first moment to the second moment is larger than a first preset threshold value in the environmental parameters of each RTC clock, the environmental parameter of the first RTC clock is removed from the environmental parameters of each RTC clock, the time offset of the first RTC clock is removed from the time offset of each RTC clock, the removed first environmental parameter of each RTC clock and the removed first time offset of each RTC clock are obtained, and an RTC clock self-calibration model is built based on the first time offset and the first environmental parameters. If the variation of the environmental parameter of the RTC clock in a period of time is larger than a first preset threshold value, the environmental parameter of the RTC clock is abnormal and needs to be removed, so that the calibration accuracy of the RTC clock self-calibration model is prevented from being influenced.
If the change amount of the environmental parameter of the second RTC clock from the first time to the second time is smaller than a second preset threshold value in the environmental parameters of each RTC clock, eliminating the environmental parameter of the second RTC clock from the environmental parameters of each RTC clock, eliminating the time offset of the second RTC clock from the time offset of each RTC clock, obtaining the second environmental parameter of each RTC clock after elimination and the second time offset of each RTC clock after elimination, and constructing an RTC clock self-calibration model based on the second time offset and the environmental parameters. If the variation of the environmental parameter of the RTC clock in a period of time is smaller than a second preset threshold value, the environmental parameter of the RTC clock is not obviously changed, the data is removed if the richness of the sample is insufficient, and the calibration precision of the built RTC clock self-calibration model is ensured.
In step 103, if it is detected that the target vehicle enters a specific environment without network and GPS, that is, the target RTC clock and the standard clock change from synchronous to asynchronous, and the target RTC clock will have a time offset, the environmental parameters of the environment where the target RTC clock is located within a preset time period from the time of the change (that is, the time of the change from synchronous to asynchronous) are obtained. The preset duration is a duration in a time period in which the target RTC clock is not synchronous with the standard clock.
In step 104, the obtained environmental parameters of the target RTC clock within the preset duration are input into the trained RTC clock self-calibration model, that is, the target time offset of the target RTC clock within the preset duration can be output, and the target RTC clock within the preset duration is calibrated by using the target time offset, so that the time accuracy of the target RTC clock can be ensured, the time synchronized to each domain controller of the vehicle is always accurate, the time jump of the domain controller is avoided, and the normal operation of the vehicle is ensured.
It should be noted that, the foregoing examples in the present embodiment are all examples for understanding and are not limited to the technical solution of the present invention.
The above steps of the methods are divided, for clarity of description, and may be combined into one step or split into multiple steps when implemented, so long as they include the same logic relationship, and they are all within the protection scope of this patent; it is within the scope of this patent to add insignificant modifications to the algorithm or flow or introduce insignificant designs, but not to alter the core design of its algorithm and flow.
Another embodiment of the present application relates to an electronic device, as shown in fig. 2, comprising: at least one processor 201; and a memory 202 communicatively coupled to the at least one processor 201; wherein the memory 202 stores instructions executable by the at least one processor 201 to enable the at least one processor 201 to perform the RTC clock self calibration method of the above embodiments.
Where the memory and the processor are connected by a bus, the bus may comprise any number of interconnected buses and bridges, the buses connecting the various circuits of the one or more processors and the memory together. The bus may also connect various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art, and therefore, will not be described any further herein. The bus interface provides an interface between the bus and the transceiver. The transceiver may be one element or may be a plurality of elements, such as a plurality of receivers and transmitters, providing a means for communicating with various other apparatus over a transmission medium. The data processed by the processor is transmitted over the wireless medium via the antenna, which further receives the data and transmits the data to the processor.
The processor is responsible for managing the bus and general processing and may also provide various functions including timing, peripheral interfaces, voltage regulation, power management, and other control functions. And memory may be used to store data used by the processor in performing operations.
Another embodiment of the present application relates to a computer-readable storage medium storing a computer program. The computer program implements the above-described method embodiments when executed by a processor.
That is, it will be understood by those skilled in the art that all or part of the steps in implementing the methods of the embodiments described above may be implemented by a program stored in a storage medium, where the program includes several instructions for causing a device (which may be a single-chip microcomputer, a chip or the like) or a processor (processor) to perform all or part of the steps in the methods of the embodiments described herein. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, etc., which can store program codes.
It will be understood by those of ordinary skill in the art that the foregoing embodiments are specific embodiments in which the present application is implemented and that various changes in form and details may be made therein without departing from the spirit and scope of the present application.

Claims (10)

1. A method for RTC clock self calibration, comprising:
periodically acquiring time offsets generated in a time period from a first moment to a second moment of a plurality of RTC clocks and environment parameters of the environment where each RTC clock is located in the time period; the first time is a time when each RTC clock and the standard clock change from synchronization to non-synchronization, and the second time is a time when each RTC clock and the standard clock change from the non-synchronization to re-synchronization;
constructing an RTC clock self-calibration model based on the time offset and the environmental parameter;
if the target RTC clock and the standard clock are detected to be changed from synchronous to asynchronous, acquiring environmental parameters of the environment where the target RTC clock is located within a preset duration from the moment of the change;
inputting the environmental parameters of the target RTC clock into the RTC clock self-calibration model to obtain a target time offset of the target RTC clock in the preset duration, and calibrating the target RTC clock in the preset duration by adopting the target time offset;
the RTC clock is applied to a vehicle; the environmental parameters include: the vibration intensity of the vehicle and the pressure of the vehicle.
2. The RTC clock self-calibration method of claim 1, further comprising, prior to said building an RTC clock self-calibration model based on said time offset and said environmental parameter:
if the change amount of the environmental parameter of the first RTC clock from the first moment to the second moment is larger than a first preset threshold value in the environmental parameters of the RTC clocks, eliminating the environmental parameter of the first RTC clock from the environmental parameters of the RTC clocks, eliminating the time offset of the first RTC clock from the time offset of the RTC clocks, and obtaining the first environmental parameters of the RTC clocks after elimination and the first time offset of the RTC clocks after elimination;
the building an RTC clock self-calibration model based on the time offset and the environmental parameter includes:
and constructing the RTC clock self-calibration model based on the first time offset and the first environment parameter.
3. The RTC clock self-calibration method according to claim 2, characterized by further comprising, before said building an RTC clock self-calibration model based on said time offset and said environmental parameter:
if the change amount of the environmental parameter of the second RTC clock from the first time to the second time is smaller than a second preset threshold value in the environmental parameters of the RTC clocks, eliminating the environmental parameter of the second RTC clock from the environmental parameters of the RTC clocks, eliminating the time offset of the second RTC clock from the time offset of the RTC clocks, and obtaining the second environmental parameters of the RTC clocks after elimination and the second time offset of the RTC clocks after elimination;
the building an RTC clock self-calibration model based on the time offset and the environmental parameter includes:
and constructing the RTC clock self-calibration model based on the second time offset and the second environment parameter.
4. A RTC clock self-calibration method according to any one of claims 1 to 3, characterized in that the RTC clock self-calibration model is built on the basis of a multivariate linear regression algorithm, which is a gradient descent method or a standard equation method.
5. A RTC clock self calibration method according to any one of claims 1 to 3, characterized in that the environmental parameters further comprise: temperature, humidity.
6. The RTC clock self-calibration method of claim 5, wherein the target time offset is calculated as:
y=α1x1+α2x2+α3x3+α4x4+α5x5
wherein x1 represents the temperature, α1 represents the weight of the temperature, x2 represents the humidity, α2 represents the weight of the humidity, x3 represents the vibration intensity of the vehicle, α3 represents the weight of the vibration intensity, x4 represents the pressure of the vehicle, α4 represents the weight of the pressure, x5 represents the preset duration, and α5 represents the weight of the preset duration.
7. The RTC clock self-calibration method according to claim 6, characterized in that the calculation formulas of α1, α2, α3, α4 and α5 are as follows:
α=(X T X) -1 X T Y
wherein alpha is a matrix formed by the alpha 1, the alpha 2, the alpha 3, the alpha 4 and the alpha 5, X is a matrix formed by n X1, n X2, n X3, n X4 and n X5 T The transposed matrix of X, Y is a matrix of n Y.
8. The RTC clock self-calibration method according to claim 1, wherein the constraint conditions adopted in the process of building the RTC clock self-calibration model are:
the difference value between the predicted time offset and the standard time offset output by the RTC clock self-calibration model is smaller than a third preset threshold value; the standard time offset is calculated based on the calibration time generated by calibrating each RTC clock by the standard clock and the first time.
9. An electronic device, comprising:
at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the RTC clock self calibration method of any one of claims 1 to 8.
10. A computer readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the RTC clock self calibration method of any one of claims 1 to 8.
CN202211723077.2A 2022-12-30 2022-12-30 RTC clock self-calibration method, electronic equipment and storage medium Active CN116388913B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211723077.2A CN116388913B (en) 2022-12-30 2022-12-30 RTC clock self-calibration method, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211723077.2A CN116388913B (en) 2022-12-30 2022-12-30 RTC clock self-calibration method, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN116388913A CN116388913A (en) 2023-07-04
CN116388913B true CN116388913B (en) 2024-02-02

Family

ID=86962213

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211723077.2A Active CN116388913B (en) 2022-12-30 2022-12-30 RTC clock self-calibration method, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116388913B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112737507A (en) * 2021-02-01 2021-04-30 山东新港电子科技有限公司 Method for realizing RTC high precision based on temperature sensor
CN113972893A (en) * 2021-10-28 2022-01-25 锐捷网络股份有限公司 Clock synchronization method and device, electronic equipment and storage medium
CN114362140A (en) * 2021-12-01 2022-04-15 国网内蒙古东部电力有限公司通辽供电公司 High-precision time keeping method and device suitable for power distribution network measuring device
CN114374462A (en) * 2022-01-17 2022-04-19 上海交通大学 Clock synchronization system and method of industrial wireless network

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112737507A (en) * 2021-02-01 2021-04-30 山东新港电子科技有限公司 Method for realizing RTC high precision based on temperature sensor
CN113972893A (en) * 2021-10-28 2022-01-25 锐捷网络股份有限公司 Clock synchronization method and device, electronic equipment and storage medium
CN114362140A (en) * 2021-12-01 2022-04-15 国网内蒙古东部电力有限公司通辽供电公司 High-precision time keeping method and device suitable for power distribution network measuring device
CN114374462A (en) * 2022-01-17 2022-04-19 上海交通大学 Clock synchronization system and method of industrial wireless network

Also Published As

Publication number Publication date
CN116388913A (en) 2023-07-04

Similar Documents

Publication Publication Date Title
CN103116322B (en) Fine setting tunable oscillator is to mate method and the CAN communication controler of CAN
US11166250B2 (en) Time synchronization of distributed devices
US20110222561A1 (en) Systems and methods for providing time synchronization
US10594424B2 (en) Time synchronization slave apparatus capable of adjusting time synchronization period, and method of determining time synchronization period
CN113037531A (en) Flow prediction method, device and storage medium
US7596711B2 (en) Method and network for synchronistic processing and providing data using an extrapolation data set including at least one update time point
CN104702214A (en) Crystal oscillator frequency compensation method
US20160026209A1 (en) Calibration Unit for Calibrating an Oscillator, Oscillator Arrangement and Method for Calibrating an Oscillator
CN116388913B (en) RTC clock self-calibration method, electronic equipment and storage medium
CN103532693A (en) Time synchronizing device and method
CN103078697A (en) Distributed clock synchronization method
CN113711511A (en) Industrial equipment supporting multi-time synchronization protocol
CN110752890A (en) Time synchronization method, time synchronization system and vehicle
CN109100927B (en) Time autonomous synchronization method of time unified system under traceless reference condition
CN102916654A (en) Crystal oscillator ageing compensation method
CN107423236B (en) Processing method, reading method and device for monitoring parameters in optical module and optical module
KR20170125405A (en) Time synchronization device and time synchronization system
CN110098885B (en) Clock synchronization circuit, device and method
DE102013222471B4 (en) GENERATION AND DISTRIBUTION OF A SYNCHRONIZED TIME SOURCE
CN110618604B (en) Method and device for improving time keeping precision by using NTP auxiliary source
CN102843764A (en) Method for outputting synchronization signals accurately to solve problem on synchronization of multi-stations
CN114006672A (en) Vehicle-mounted multi-sensor data synchronous acquisition method and system
CN202759413U (en) An on-line time error correcting system based on a satellite and a constant temperature crystal oscillator
CN115080495A (en) Time synchronization method and system for standard peripheral extension interface equipment
CN100405863C (en) Method for regulating sleeping processor in mobile terminal machine process

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant