CN109154796B - Time updating method, device and movable platform - Google Patents
Time updating method, device and movable platform Download PDFInfo
- Publication number
- CN109154796B CN109154796B CN201780026754.6A CN201780026754A CN109154796B CN 109154796 B CN109154796 B CN 109154796B CN 201780026754 A CN201780026754 A CN 201780026754A CN 109154796 B CN109154796 B CN 109154796B
- Authority
- CN
- China
- Prior art keywords
- time
- utc
- counter
- preset
- local
- 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.)
- Expired - Fee Related
Links
- 238000000034 method Methods 0.000 title claims abstract description 65
- 239000013078 crystal Substances 0.000 claims abstract description 57
- 238000012935 Averaging Methods 0.000 claims abstract description 40
- 238000012545 processing Methods 0.000 claims abstract description 16
- 238000004364 calculation method Methods 0.000 claims description 10
- 230000008859 change Effects 0.000 claims description 9
- 238000001914 filtration Methods 0.000 claims description 9
- 230000010355 oscillation Effects 0.000 claims description 9
- 230000007306 turnover Effects 0.000 claims description 8
- 230000000630 rising effect Effects 0.000 claims description 6
- 230000008569 process Effects 0.000 description 6
- 238000004891 communication Methods 0.000 description 4
- 238000010586 diagram Methods 0.000 description 4
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 2
- 238000012937 correction Methods 0.000 description 2
- 230000001186 cumulative effect Effects 0.000 description 2
- 230000002159 abnormal effect Effects 0.000 description 1
- 238000009825 accumulation Methods 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 230000008030 elimination Effects 0.000 description 1
- 238000003379 elimination reaction Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- NRNCYVBFPDDJNE-UHFFFAOYSA-N pemoline Chemical compound O1C(N)=NC(=O)C1C1=CC=CC=C1 NRNCYVBFPDDJNE-UHFFFAOYSA-N 0.000 description 1
- 230000006903 response to temperature Effects 0.000 description 1
- 238000005070 sampling Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G04—HOROLOGY
- G04R—RADIO-CONTROLLED TIME-PIECES
- G04R20/00—Setting the time according to the time information carried or implied by the radio signal
- G04R20/02—Setting the time according to the time information carried or implied by the radio signal the radio signal being sent by a satellite, e.g. GPS
- G04R20/04—Tuning or receiving; Circuits therefor
-
- G—PHYSICS
- G04—HOROLOGY
- G04R—RADIO-CONTROLLED TIME-PIECES
- G04R20/00—Setting the time according to the time information carried or implied by the radio signal
- G04R20/02—Setting the time according to the time information carried or implied by the radio signal the radio signal being sent by a satellite, e.g. GPS
- G04R20/06—Decoding time data; Circuits therefor
-
- G—PHYSICS
- G04—HOROLOGY
- G04R—RADIO-CONTROLLED TIME-PIECES
- G04R40/00—Correcting the clock frequency
- G04R40/06—Correcting the clock frequency by computing the time value implied by the radio signal
Abstract
The embodiment of the invention provides a time updating method, a device and a movable platform, wherein the method comprises the following steps: acquiring at least two variable quantities of a counter in a first preset time; averaging the at least two variations; determining the crystal oscillator frequency of the counter based on the result of the averaging processing and the first preset time; and updating the local time based on the crystal oscillator frequency. According to the embodiment of the invention, a special hardware circuit is not needed, the time updating accuracy is ensured, the time updating complexity is reduced, and the cost is reduced.
Description
Technical Field
The present application relates to the field of time calibration technologies, and in particular, to a time updating method, device and mobile platform.
Background
Global Navigation Satellite System (GNSS) has been widely used globally. When GNSS is given time to other devices, the other devices typically require proprietary hardware circuitry that is bulky, heavy, complex, and costly to calibrate and update for local time.
Disclosure of Invention
Embodiments of the present invention provide a time updating method, a time updating device, and a movable platform, so as to reduce the complexity of time updating and reduce the cost while ensuring the accuracy of time updating.
A first aspect of an embodiment of the present invention provides a time updating method, including:
acquiring at least two variable quantities of a counter in a first preset time;
averaging the at least two variations;
determining the crystal oscillator frequency of the counter based on the result of the averaging processing and the first preset time;
and updating the local time based on the crystal oscillator frequency.
A second aspect of an embodiment of the present invention provides a time updating method, including:
acquiring more than two unit time variation of a counter;
averaging the unit time variation of the counter to obtain the crystal oscillation frequency of the counter;
and updating the local time based on the crystal oscillator frequency.
A third aspect of the embodiments of the present invention provides a time updating apparatus, including:
one or more processors; the one or more processors operating alone or in concert;
the processor is configured to: acquiring at least two variable quantities of a counter in a first preset time; averaging the at least two variations; determining the crystal oscillator frequency of the counter based on the result of the averaging processing and the first preset time; and updating the local time based on the crystal oscillator frequency.
A fourth aspect of the embodiments of the present invention provides a time update apparatus, including:
one or more processors; the one or more processors operating alone or in concert;
the processor is configured to: acquiring more than two unit time variation of a counter; averaging the unit time variation of the counter to obtain the crystal oscillation frequency of the counter; and updating the local time based on the crystal oscillator frequency.
A fifth aspect of an embodiment of the present invention provides a movable platform, including: the time update apparatus according to the third or fourth aspect.
A sixth aspect of the embodiments of the present invention provides a computer-readable storage medium, which includes instructions, and when the instructions are executed, the method for updating time according to the first aspect or the second aspect is performed.
According to the time updating method, the processor and the movable platform provided by the embodiment of the invention, the crystal oscillator frequency of the counter is determined based on the averaging result and the first preset time by acquiring at least two variable quantities of the counter in the first preset time and averaging the acquired at least two variable quantities, so that the local time is updated according to the determined crystal oscillator frequency. According to the embodiment of the invention, the averaging processing is carried out on the obtained at least two variable quantities, and the crystal oscillator frequency of the counter is determined according to the averaging processing result and the first preset time, so that the difference of crystal oscillator individuals and the influence of temperature on the crystal oscillator frequency can be isolated, the accuracy and the real-time performance of the crystal oscillator frequency of the timer are ensured, the accurate local time can be obtained when the local time is updated according to the crystal oscillator frequency, a special hardware circuit is not needed, the space required by installing the hardware circuit is saved, and the cost is reduced.
Drawings
Fig. 1 is a schematic view of a scenario provided in an embodiment of the present invention;
FIG. 2 is a flow chart of a time update method according to an embodiment of the present invention;
FIG. 3 is a flowchart of a method for performing step 204 provided by an embodiment of the present invention;
FIG. 4 is a flow chart of a method for updating accumulated time error according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a time update apparatus according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a movable platform according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be described clearly below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It will be understood that when an element is referred to as being "secured to" another element, it can be directly on the other element or intervening elements may also be present. When a component is referred to as being "connected" to another component, it can be directly connected to the other component or intervening components may also be present. The embodiments described below and the features of the embodiments can be combined with each other without conflict.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items.
Some embodiments of the invention are described in detail below with reference to the accompanying drawings. The embodiments described below and the features of the embodiments can be combined with each other without conflict.
Fig. 1 is a schematic view of a scene provided by an embodiment of the present invention, and fig. 1 includes a satellite 10, a satellite receiver 11, and a device 12 for receiving time service, where in this embodiment, the satellite receiver 11 is installed on the device 12 for receiving time service, but is not limited to being installed on the device 12, and actually, the satellite receiver 11 and the device 12 may be respectively configured as two independent entities. The device 12 in this embodiment may be embodied as a drone, automobile, or other movable platform. When the satellite 10 is taught, the satellite 10 generates a Pulse Per Second (PPS) signal and transmits a universal time standard (UTC) signal corresponding to a rising edge or a falling edge of the PPS signal through a communication link (such as a serial port or a bus, but not limited to a serial port or a bus). After the satellite receiver 11 receives the PPS signal of the satellite 10 and the corresponding UTC, the PPS signal is introduced into an external terminal of the device 12, and the UTC corresponding to the PPS signal is transmitted to the device 12 through a communication link within a second preset time after the PPS signal is introduced, and the device 12 responds to an event that the satellite receiver 11 outputs the PPS signal in an interrupted form. Further, after receiving the UTC, the device 12 initializes the local time, updates the local time to the UTC, obtains variation amounts of the at least two counters in the first preset time, determines the crystal frequency of the counter based on an averaging result of the obtained at least two variation amounts and the first preset time, and updates the local time based on the crystal frequency, so that the accurate local time can be obtained, and a dedicated hardware circuit is not required, so that the space of the device 12 can be saved, the weight of the device 12 can be reduced, and the cost can be reduced.
In particular, fig. 2 is a flowchart of a time updating method provided by an embodiment of the present invention, which may be executed by a time updating apparatus, which may be embodied as a processor with computing and processing capabilities, or a movable platform such as a drone, an automobile, or the like. As shown in fig. 2, the method comprises the steps of:
In a possible implementation manner, three or more count values of the counter may be obtained first, so that a time interval between at least two sets of count values in the three or more count values is equal to a first preset time, and then, based on at least two sets of count values in the obtained three or more count values, variation amounts in at least two first preset times are obtained through calculation. For example, the obtained count values are a, b, and c, where time intervals between a and b and between b and c are equal to a first preset time, and the variation of the timer is calculated as | a-b | and | c-b |. It is understood that this is by way of illustration and not by way of limitation.
In another possible implementation manner, a start count value and an end count value of the counter in more than two first preset times may be obtained first, and then the variation in at least two first preset times is obtained through calculation based on the start count value and the end count value of the counter in the more than two first preset times. For example, assuming that the count value of the counter in the 1 st second is a, the count value in the 2 nd second is b, the count value in the 3 rd second is c, and the count value in the 4 th second is d, the following change amounts of the counter in the first preset time can be obtained: a-b, c-d. It is understood that this is by way of illustration and not by way of limitation.
Optionally, in order to ensure the accuracy of the obtained variation, in this embodiment, the variation of the counter in the first preset time may also be obtained by obtaining the number of turning cycles of the counter and combining the count value of the counter obtained by any one of the two possible implementation manners.
Taking the first preset time equal to 1 second as an example, assuming that the count value of the counter at the 1 st second is counter (n-1), the count value at the 2 nd second is counter (n), and the number of flip cycles of the counter is T _ counter, the variation delta (n) of the counter in 1 second can be calculated according to the following expression:
delta(n)=[counter(n)-counter(n-1)+T_counter]%T_counter
it is understood that this is by way of illustration and not by way of limitation.
Optionally, in this embodiment, the first preset time may refer to a uniform time value, such as 1 second, but is not limited to 1 second. For example, 1 second, 2 seconds, 3 seconds, etc. may be collectively referred to as a first preset time according to the setting. Of course, this is merely an example and is not intended to be the only limitation on the present invention.
The present embodiment also directly obtains the change amount of the counter in more than two units of time, for example, the change amount of the counter in the 1 st second, the change amount in the 2 nd second, the change amount in the 3 rd second, etc. is, of course, only illustrated here and not limited to the present invention.
In a first possible averaging process, all the obtained variation amounts may be directly averaged.
In a second possible implementation manner, when the number of the acquired variation amounts of the first preset time is greater than two, the maximum value and/or the minimum value of all the acquired variation amounts are removed, and then the remaining variation amounts with the maximum value and/or the minimum value removed are averaged.
In the following example, assuming that the number of acquired changes of the counter in the first preset time (1 second in the above example) is greater than the preset sampling number filter _ num, the acquired changes may be subjected to average filtering processing by the following filtering algorithm, and the average result is obtained
delta_min=Min{delta(n-filter_num+1)…delta(n)}
delta_max=Max{delta(n-filter_num+1)…delta(n)}
The filter _ num can take any value within a range of 6-8, but is not limited to 6-8, and actually, the value of the filter _ num can be set according to needs, and the embodiment is not limited. In this embodiment, set up the value range of getting of filter _ num to 6 ~ 8 and can avoid the excessive interference that leads to unable elimination that filter _ num set up, perhaps set up too big lead to the reaction slow, can't make quick response to temperature variation. It should be noted that, when the first preset time is 1 second, i.e. unit time,obtained as described aboveThat is, the calculated crystal oscillator frequency of the counter, if the first preset time is not the unit time, the first preset time is further determined according to the unit timeAnd the first preset time determines the crystal oscillation frequency of the counter.
Of course, the above examples are only illustrative of the second possible implementation and are not the only limitations of the present invention.
In a third possible implementation manner, a target variation having a numerical value within a first preset range may be extracted from the at least two acquired variations, so as to remove an abnormal value from all the acquired variations. Further, averaging is performed on all the extracted target variation quantities.
When the first preset time refers to a preset uniform time value, the average variation obtained by the averaging process may be divided by the first preset time to obtain the crystal oscillation frequency of the counter.
When the first preset time refers to a plurality of preset time lengths, the average time length can be obtained by averaging the first preset time corresponding to all the acquired variation amounts, and the crystal oscillator frequency of the counter is obtained by dividing the average variation amount obtained by the calculation by the average time length.
And step 204, updating the local time based on the crystal oscillator frequency.
Optionally, in this embodiment, the local time may be periodically updated according to a preset period, where the preset period may be any value, for example, in an actual scenario, the preset threshold may be set to be any value smaller than a ratio of the number of rollover cycles of the counter to the crystal frequency of the counter, so as to avoid time loss caused by overflow of the counter.
Optionally, fig. 3 is a flowchart of an execution method of step 204 provided in the embodiment of the present invention, and as shown in fig. 3, the method includes:
In a possible implementation manner, the variation of the counter from the local time initialization time to the current time may be obtained directly by subtracting the count value of the counter at the local time initialization time from the count value of the counter at the current time.
In another possible implementation manner, the amount of change of the counter from the local time initialization time to the current time may be obtained through calculation based on the number of the rollover cycles of the counter, and the count value of the counter at the local time initialization time and the count value of the counter at the current time. For a specific implementation method, see an example of solving the variation of the counter in 1 second in step 201, which is not described herein again.
And 302, determining deviation time based on the variation of the counter in the time and the crystal oscillator frequency of the counter.
For example, the deviation time delta _ s may be calculated by the following expression:
delta_s=delta_counter/freq
wherein, delta _ counter is the variation of the counter from the initialization time of the local time to the current time, and freq is the crystal oscillation frequency of the counter. Of course, the calculation of the deviation time in the actual scene is not limited to the above-described exemplary method, and other customized methods may be adopted according to the needs.
And step 303, correcting the local time based on the deviation time to obtain the time of the current time.
Optionally, in a possible implementation manner, the following expression may be directly used to correct the local time to obtain the time of the current time:
local_now=local_time+delta_s
here, local _ now is the time of the current time obtained after correction, and local _ time is the local time before correction. It is understood that this is by way of illustration and not by way of limitation.
In another possible implementation, the local time may be corrected based on the deviation time and a predetermined accumulated error of time to obtain an accurate time of the current time, for example, in this way, an expression for solving the time of the current time may be expressed as follows:
local_now=local_time+delta_s+T_error_filter
wherein, T _ error _ filter is a predetermined time accumulated error.
Optionally, in this embodiment, after the time updating apparatus receives the UTC, the time accumulated error involved in the above method may also be updated based on the received UTC and the local time when the UTC is received. The time accumulated error may be updated once the UTC is received, or the local time accumulated error may be updated once every preset number of UTCs are received according to a preset policy.
Taking the example of updating the time accumulated error once every time a preset number of UTCs are received, fig. 4 is a flowchart of a method for updating the time accumulated error according to an embodiment of the present invention, and as shown in fig. 4, the method for updating the time accumulated error includes:
For example, the local time accumulated error may be calculated according to the following expression:
T_error=UTC-local_time
where local _ time is the local time when UTC is received, and T _ error is the local accumulated error of time when UTC is received.
Optionally, if the absolute value of the time accumulated error obtained by calculation is smaller than the first preset threshold when the UTC is received, it is determined that the local time accumulated error corresponding to the UTC received this time is a preset value (for example, "0" but not limited to 0), and the local time accumulated error is updated to the preset value.
If the absolute value of the time accumulated error obtained by calculation is greater than or equal to a first preset threshold when the UTC is received, determining that the local time accumulated error corresponding to the time when the UTC is received is equal to the time accumulated error before the UTC is received.
If the absolute value of the calculated time accumulated error is larger than a second preset threshold when the UTC is received, determining the current local time accumulated error based on the incidence relation between the preset time accumulated error and the second preset threshold, and updating the local time accumulated error into the determined obtained time accumulated error. The correlation between the accumulated time error and the second preset threshold may be represented as:
T_error_now=sign(T_error)*limit
wherein T _ error _ now is the current local time accumulated error, T _ error is the local time accumulated error before UTC is received, limit is a second preset threshold (for example, 1 second, but not limited to 1 second), sign () is a sign, a positive number is 1, and a negative number is-1.
And if the absolute value of the time accumulated error obtained by calculation is smaller than or equal to a second preset threshold when the UTC is received, determining that the local time accumulated error corresponding to the time when the UTC is received is equal to the time accumulated error before the UTC is received.
For example, assume that the local accumulated time error is updated after 3 UTCs are received, where the calculated accumulated time error is T _ error when the first UTC is received1Upon receipt of the second UTC, the cumulative error over time is calculated as T _ error2Upon receipt of the third UTC, the cumulative error over time is calculated as T _ error3Then, the median of the accumulated error of time obtained after median filtering is: t _ error _ filter ═ Mid { T _ error ═ Mid {1T_error2T_error3}。
Of course, although the present embodiment adopts the median filtering method to obtain and update the local time accumulated error, in practice, the method is not limited to the median filtering method, and in practice, the local time accumulated error may also be determined according to an averaging method after a preset number of time accumulated errors are obtained.
And step 403, updating the local time accumulated error to the median.
In addition, the embodiment determines and updates the local time accumulated error after receiving the UTC, and takes the time accumulated error as a consideration factor of time updating, so that the error caused by time accumulation can be eliminated, and the accuracy of time updating is improved.
Optionally, in this embodiment, the more than two unit time variation amounts of the counter are directly obtained, and the more than two unit time variation amounts of the counter are averaged to obtain the crystal oscillator frequency of the counter; based on the crystal oscillator frequency, the local time is updated. The specific implementation process is similar to the method embodiment described above, and is not described herein again.
According to the time updating method, the processor and the movable platform provided by the embodiment, the variation of at least two counters in the first preset time is obtained, the obtained at least two variations are averaged, the crystal oscillator frequency of the counter is determined based on the averaging result and the first preset time, and therefore the local time is updated according to the crystal oscillator frequency obtained through determination. In the embodiment, at least two acquired variable quantities are subjected to averaging processing, and the crystal oscillator frequency of the counter is determined according to the averaging processing result and the first preset time, so that the individual difference of the crystal oscillators and the influence of temperature on the crystal oscillator frequency can be isolated, the accuracy and the real-time performance of the crystal oscillator frequency of the timer are ensured, accurate local time can be obtained when the local time is updated according to the crystal oscillator frequency, a special hardware circuit is not needed, the space required by installing the hardware circuit is saved, and the cost is reduced.
Fig. 5 is a schematic structural diagram of a time update apparatus according to an embodiment of the present invention, where the time update apparatus may be installed on any device having time counting and time update functions, and particularly may be installed on a movable platform such as an unmanned aerial vehicle. As shown in fig. 5, the time update apparatus 50 includes: one or more processors 51; the one or more processors operating alone or in concert; the processor is configured to: acquiring at least two variable quantities of a counter in a first preset time; averaging the at least two variations; determining the crystal oscillator frequency of the counter based on the result of the averaging processing and the first preset time; and updating the local time based on the crystal oscillator frequency.
Optionally, the processor 51 is configured to: the method comprises the steps of obtaining more than three count values of a counter, wherein the more than three count values comprise at least two groups of count values, the time interval between the at least two groups of count values is first preset time, and calculating and obtaining the variation in at least two first preset times based on the at least two groups of count values in the more than three count values.
Optionally, the processor is configured to: respectively acquiring an initial count value and a termination count value of a counter in more than two first preset times; and calculating and obtaining the variation of the counter in at least two first preset times based on the starting count value and the ending count value of the counter in the two or more first preset times.
Optionally, the processor 51 is configured to: and acquiring the turning cycle number of the counter, and calculating and obtaining the variation of the counter in at least two first preset times based on the starting count value and the ending count value of the counter in the more than two first preset times and the turning cycle number of the counter.
Optionally, the processor 51 is configured to: and when the number of the acquired variable quantities of the first preset time is more than two, removing the maximum value and/or the minimum value of all the acquired variable quantities of the first preset time, and averaging the variable quantities of the first preset time left after the maximum value and/or the minimum value are removed.
Optionally, the processor 51 is configured to: and averaging a target variable quantity in the acquired at least two variable quantities, wherein the target variable quantity is a variable quantity of which the value is within a first preset range.
Optionally, the processor 51 is configured to: and initializing the local time.
Optionally, the processor 51 is configured to: and receiving a universal standard time UTC (universal time coordinated) sent by a sending device within a second preset time after receiving the PPS signal, wherein the UTC updates the local time to the UTC corresponding to the time of the rising edge or the falling edge of the PPS signal.
Optionally, the processor 51 is configured to: the method comprises the steps of obtaining the variation of a counter from the initialization time of local time to the current time, determining deviation time based on the variation of the counter in the time and the crystal oscillator frequency of the counter, and correcting the local time based on the deviation time to obtain the current time.
Optionally, the processor 51 is configured to: and calculating to obtain the variation of the counter from the local time initialization time to the current time based on the turnover period number of the counter, the count value of the counter at the local time initialization time and the count value of the counter at the current time.
Optionally, the processor 51 is configured to: and correcting the local time based on the deviation time and a predetermined time accumulated error to obtain the time of the current time.
Optionally, the processor 51 is configured to: and after receiving the UTC, updating a local time accumulated error based on the UTC and the local time when the UTC is received.
Optionally, the processor 51 is configured to: the local time accumulated error is updated once every time a preset number of UTCs are received.
Optionally, the processor 51 is configured to: and calculating local time accumulated errors once every time a UTC is received, performing median filtering processing on the calculated preset number of time accumulated errors after a preset number of UTCs are received, obtaining a median of the preset number of time accumulated errors, and updating the local time accumulated errors into the median.
Optionally, the processor 51 is configured to: when receiving the UTC, if the absolute value of the difference between the UTC and the local time when receiving the UTC is smaller than a first preset threshold, determining that the time accumulated error corresponding to the UTC is equal to a preset value; and if the absolute value of the difference between the UTC and the local time when the UTC is received is greater than or equal to a first preset threshold, the time accumulated error corresponding to the UTC is equal to the time accumulated error before the UTC is received.
Optionally, the processor 51 is configured to: when receiving the UTC, if the absolute value of the difference between the UTC and the local time when receiving the UTC is larger than a second preset threshold, determining a time accumulated error corresponding to the UTC based on the association relationship between a preset time accumulated error and the second preset threshold; and if the absolute value of the difference between the UTC and the local time when the UTC is received is less than or equal to the second preset threshold, the time accumulated error corresponding to the UTC is equal to the time accumulated error before the UTC is received.
Optionally, the processor 51 is configured to: and updating the local time based on a preset period, wherein the preset period is less than the ratio of the turnover period number of the counter to the crystal oscillator frequency of the counter.
The time updating apparatus provided in this embodiment can be used to implement the technical solution of the above method embodiment, and the implementation manner and the beneficial effect are similar, which are not described herein again.
The invention also provides a time updating device, which comprises one or more processors; the one or more processors operating alone or in concert;
the processor is configured to: acquiring more than two unit time variation of a counter; averaging the unit time variation of the counter to obtain the crystal oscillation frequency of the counter; and updating the local time based on the crystal oscillator frequency.
The time updating apparatus provided in this embodiment can be used to implement the technical solution of the above method embodiment, and the implementation manner and the beneficial effect are similar, which are not described herein again.
Fig. 6 is a schematic structural diagram of a movable platform according to an embodiment of the present invention, and as shown in fig. 6, a movable platform 60 includes a time update apparatus 50 according to the embodiment.
The embodiment of the present invention further provides a computer-readable storage medium, which includes instructions, and when the instructions are executed, the time updating method of the above embodiment is performed.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute some steps of the methods according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
It is obvious to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be performed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to perform all or part of the above described functions. For the specific working process of the device described above, reference may be made to the corresponding process in the foregoing method embodiment, which is not described herein again.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.
Claims (32)
1. A method for time update, comprising:
acquiring at least two variable quantities of a counter in a first preset time;
averaging the at least two variations;
determining the crystal oscillator frequency of the counter based on the result of the averaging processing and the first preset time;
updating the local time based on the crystal oscillator frequency;
before obtaining the variation of at least two of the counters within the first preset time, the method further includes:
initializing the local time;
the initializing the local time includes:
receiving universal standard time UTC sent by transmitting equipment within a second preset time after receiving a PPS signal, wherein the UTC corresponds to the time of a rising edge or a falling edge of the PPS signal;
updating the local time to the UTC;
the method further comprises the following steps:
and after receiving the UTC, updating a local time accumulated error based on the UTC and the local time when the UTC is received.
2. The method of claim 1, wherein obtaining the variation of at least two of the counters in the first preset time comprises:
acquiring more than three count values of a counter, wherein the more than three count values comprise time intervals between at least two groups of count values as first preset time;
and calculating to obtain the variation in at least two first preset times based on the at least two groups of count values in the more than three count values.
3. The method of claim 1, wherein obtaining the variation of at least two of the counters in the first preset time comprises:
respectively acquiring an initial count value and a termination count value of a counter in more than two first preset times;
and calculating and obtaining the variation of the counter in at least two first preset times based on the starting count value and the ending count value of the counter in the two or more first preset times.
4. The method of claim 3, further comprising:
acquiring the turnover period number of the counter;
the calculating and obtaining the variation in at least two first preset times based on the starting count value and the ending count value of the counter in the two or more first preset times includes:
and calculating and obtaining the variation of the counter in at least two first preset times based on the starting count value and the ending count value of the counter in the two or more first preset times and the turnover period number of the counter.
5. The method according to any one of claims 1 to 4, wherein the averaging the variation amounts of the two or more first preset times comprises:
when the number of the acquired variable quantities of the first preset time is more than two, removing the maximum value and/or the minimum value in all the acquired variable quantities of the first preset time;
and averaging the variation of the first preset time left after the maximum value and/or the minimum value are removed.
6. The method according to any one of claims 1-4, wherein the averaging the at least two variations comprises:
and averaging a target variable quantity in the acquired at least two variable quantities, wherein the target variable quantity is a variable quantity of which the value is within a first preset range.
7. The method of claim 1, wherein updating the local time based on the crystal oscillator frequency comprises:
acquiring the variable quantity of the counter from the local time initialization time to the current time;
determining a deviation time based on the amount of change of the counter over the time and the crystal oscillator frequency of the counter;
and correcting the local time based on the deviation time to obtain the time of the current time.
8. The method of claim 7, wherein obtaining the amount of change of the counter from the local time initialization time to the current time comprises:
and calculating to obtain the variation of the counter from the local time initialization time to the current time based on the turnover period number of the counter, the count value of the counter at the local time initialization time and the count value of the counter at the current time.
9. The method according to claim 7 or 8, wherein the correcting the local time based on the deviation time to obtain the time of the current time comprises:
and correcting the local time based on the deviation time and a predetermined time accumulated error to obtain the time of the current time.
10. The method of claim 1, wherein updating a local time accumulated error based on the UTC and a local time at the time the UTC was received after receiving the UTC comprises:
the local time accumulated error is updated once every time a preset number of UTCs are received.
11. The method of claim 10, wherein updating the local accumulated error over time once per a predetermined number of UTCs received comprises:
calculating a local time accumulated error once every time a UTC is received;
after receiving a preset number of UTCs, performing median filtering processing on the time accumulated errors of the preset number obtained through calculation to obtain a median of the time accumulated errors of the preset number;
and updating the local time accumulated error to the median value.
12. The method of claim 11, wherein calculating a local accumulated error over time for each received UTC comprises:
when receiving the UTC, if the absolute value of the difference between the UTC and the local time when receiving the UTC is smaller than a first preset threshold, determining that the time accumulated error corresponding to the UTC is equal to a preset value;
and if the absolute value of the difference between the UTC and the local time when the UTC is received is greater than or equal to a first preset threshold, the time accumulated error corresponding to the UTC is equal to the time accumulated error before the UTC is received.
13. The method of claim 11, wherein calculating a local accumulated error over time for each received UTC comprises
When receiving the UTC, if the absolute value of the difference between the UTC and the local time when receiving the UTC is larger than a second preset threshold, determining a time accumulated error corresponding to the UTC based on the association relationship between a preset time accumulated error and the second preset threshold;
and if the absolute value of the difference between the UTC and the local time when the UTC is received is less than or equal to the second preset threshold, the time accumulated error corresponding to the UTC is equal to the time accumulated error before the UTC is received.
14. The method of claim 1, wherein updating the local time based on the crystal oscillator frequency comprises:
and updating the local time based on a preset period, wherein the preset period is less than the ratio of the turnover period number of the counter to the crystal oscillator frequency of the counter.
15. A method for time update, comprising:
acquiring more than two unit time variation of a counter;
averaging the unit time variation of the counter to obtain the crystal oscillation frequency of the counter;
updating the local time based on the crystal oscillator frequency;
before the obtaining of the two or more unit time change amounts of the counter, the method further includes:
initializing the local time;
the initializing the local time includes:
receiving universal standard time UTC sent by transmitting equipment within a second preset time after receiving a PPS signal, wherein the UTC corresponds to the time of a rising edge or a falling edge of the PPS signal;
updating the local time to the UTC;
the method further comprises the following steps:
and after receiving the UTC, updating a local time accumulated error based on the UTC and the local time when the UTC is received.
16. A time update apparatus, wherein the apparatus comprises a processor, the processor configured to: acquiring at least two variable quantities of a counter in a first preset time; averaging the at least two variations; determining the crystal oscillator frequency of the counter based on the result of the averaging processing and the first preset time; updating the local time based on the crystal oscillator frequency;
the processor is configured to: initializing the local time;
the processor is configured to: receiving and transmitting universal standard time UTC (universal time coordinated) transmitted by transmitting equipment within a second preset time after receiving a PPS (pulse per second) signal, wherein the UTC updates the local time to UTC corresponding to the time of a rising edge or a falling edge of the PPS signal;
the processor is configured to: and after receiving the UTC, updating a local time accumulated error based on the UTC and the local time when the UTC is received.
17. The time update apparatus of claim 16, wherein the processor is configured to: the method comprises the steps of obtaining more than three count values of a counter, wherein the more than three count values comprise at least two groups of count values, the time interval between the at least two groups of count values is first preset time, and calculating and obtaining the variation in at least two first preset times based on the at least two groups of count values in the more than three count values.
18. The time update apparatus of claim 16, wherein the processor is configured to: respectively acquiring an initial count value and a termination count value of a counter in more than two first preset times; and calculating and obtaining the variation of the counter in at least two first preset times based on the starting count value and the ending count value of the counter in the two or more first preset times.
19. The time update apparatus of claim 18, wherein the processor is configured to: and acquiring the turning cycle number of the counter, and calculating and obtaining the variation of the counter in at least two first preset times based on the starting count value and the ending count value of the counter in the more than two first preset times and the turning cycle number of the counter.
20. A time update apparatus as claimed in any one of claims 16 to 19, wherein the processor is configured to: and when the number of the acquired variable quantities of the first preset time is more than two, removing the maximum value and/or the minimum value of all the acquired variable quantities of the first preset time, and averaging the variable quantities of the first preset time left after the maximum value and/or the minimum value are removed.
21. A time update apparatus as claimed in any one of claims 16 to 19, wherein the processor is configured to: and averaging a target variable quantity in the acquired at least two variable quantities, wherein the target variable quantity is a variable quantity of which the value is within a first preset range.
22. The time update apparatus of claim 16, wherein the processor is configured to: the method comprises the steps of obtaining the variation of a counter from the initialization time of local time to the current time, determining deviation time based on the variation of the counter in the time and the crystal oscillator frequency of the counter, and correcting the local time based on the deviation time to obtain the current time.
23. The time update apparatus of claim 22, wherein the processor is configured to: and calculating to obtain the variation of the counter from the local time initialization time to the current time based on the turnover period number of the counter, the count value of the counter at the local time initialization time and the count value of the counter at the current time.
24. A time update apparatus as claimed in claim 22 or 23, wherein the processor is configured to: and correcting the local time based on the deviation time and a predetermined time accumulated error to obtain the time of the current time.
25. The time update apparatus of claim 16, wherein the processor is configured to: the local time accumulated error is updated once every time a preset number of UTCs are received.
26. The time update apparatus of claim 25, wherein the processor is configured to: and calculating local time accumulated errors once every time a UTC is received, performing median filtering processing on the calculated preset number of time accumulated errors after a preset number of UTCs are received, obtaining a median of the preset number of time accumulated errors, and updating the local time accumulated errors into the median.
27. The time update apparatus of claim 26, wherein the processor is configured to: when receiving the UTC, if the absolute value of the difference between the UTC and the local time when receiving the UTC is smaller than a first preset threshold, determining that the time accumulated error corresponding to the UTC is equal to a preset value; and if the absolute value of the difference between the UTC and the local time when the UTC is received is greater than or equal to a first preset threshold, the time accumulated error corresponding to the UTC is equal to the time accumulated error before the UTC is received.
28. The time update apparatus of claim 26, wherein the processor is configured to: when receiving the UTC, if the absolute value of the difference between the UTC and the local time when receiving the UTC is larger than a second preset threshold, determining a time accumulated error corresponding to the UTC based on the association relationship between a preset time accumulated error and the second preset threshold; and if the absolute value of the difference between the UTC and the local time when the UTC is received is less than or equal to the second preset threshold, the time accumulated error corresponding to the UTC is equal to the time accumulated error before the UTC is received.
29. The time update apparatus of claim 16, wherein the processor is configured to: and updating the local time based on a preset period, wherein the preset period is less than the ratio of the turnover period number of the counter to the crystal oscillator frequency of the counter.
30. A time update apparatus, comprising: one or more processors; the one or more processors operating alone or in concert;
the processor is configured to: acquiring more than two unit time variation of a counter; averaging the unit time variation of the counter to obtain the crystal oscillation frequency of the counter; updating the local time based on the crystal oscillator frequency;
the processor is configured to: initializing the local time;
the processor is configured to: receiving and transmitting universal standard time UTC (universal time coordinated) transmitted by transmitting equipment within a second preset time after receiving a PPS (pulse per second) signal, wherein the UTC updates the local time to UTC corresponding to the time of a rising edge or a falling edge of the PPS signal;
the processor is configured to: and after receiving the UTC, updating a local time accumulated error based on the UTC and the local time when the UTC is received.
31. A movable platform, comprising: a time update apparatus as claimed in any one of claims 16 to 30.
32. A computer-readable storage medium comprising instructions that, when executed, perform the time update method of any of claims 1-15.
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2017/117010 WO2019119228A1 (en) | 2017-12-18 | 2017-12-18 | Method and apparatus for updating time, and movable platform |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109154796A CN109154796A (en) | 2019-01-04 |
CN109154796B true CN109154796B (en) | 2021-04-06 |
Family
ID=64803839
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201780026754.6A Expired - Fee Related CN109154796B (en) | 2017-12-18 | 2017-12-18 | Time updating method, device and movable platform |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN109154796B (en) |
WO (1) | WO2019119228A1 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114545761B (en) * | 2020-11-27 | 2023-08-01 | 辰芯科技有限公司 | Local timing updating method, device, equipment and storage medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101546169A (en) * | 2009-04-15 | 2009-09-30 | 北京航空航天大学 | Method and device for calibrating time |
CN105158771A (en) * | 2015-08-25 | 2015-12-16 | 中国科学院国家授时中心 | Traceability model parameter generation method for satellite navigation system |
Family Cites Families (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6759910B2 (en) * | 2002-05-29 | 2004-07-06 | Xytrans, Inc. | Phase locked loop (PLL) frequency synthesizer and method |
JP2007057393A (en) * | 2005-08-24 | 2007-03-08 | Epson Toyocom Corp | Frequency stability measuring system |
CN101079687A (en) * | 2006-05-25 | 2007-11-28 | 上海欣泰通信技术有限公司 | A clock adjustment algorithm based on minimum two multiplexing model |
US7579919B1 (en) * | 2007-10-13 | 2009-08-25 | Weixun Cao | Method and apparatus for compensating temperature changes in an oscillator-based frequency synthesizer |
CN101430372B (en) * | 2007-11-07 | 2011-12-07 | 中国科学院微电子研究所 | Low-cost time service and synchronization method and equipment for global positioning system receiver |
CN101534003B (en) * | 2009-04-14 | 2011-03-16 | 国电南瑞科技股份有限公司 | Data synchronization method for digitized fiber differential protection device |
CN101895383B (en) * | 2010-07-07 | 2013-07-10 | 中国人民解放军国防科学技术大学 | External clock synchronization system and synchronization method thereof |
GB201100986D0 (en) * | 2011-01-20 | 2011-03-09 | Nordic Semiconductor Asa | Low power oscillator |
WO2012132089A1 (en) * | 2011-03-25 | 2012-10-04 | 日本電気株式会社 | Synchronization device and synchronization method |
CN102510320A (en) * | 2011-10-28 | 2012-06-20 | 桂林电子科技大学 | Clock source device based on GPS (global positioning system) and constant-temperature crystal oscillator and synchronous control method |
CN102932084B (en) * | 2012-10-17 | 2015-11-11 | 航天科工深圳(集团)有限公司 | The method and system that sampling clock is synchronous |
CN103427793B (en) * | 2013-07-29 | 2016-01-20 | 国电南瑞科技股份有限公司 | Based on temperature-compensating pair time Time keeping system and method |
CN104330966B (en) * | 2014-10-22 | 2017-02-08 | 中国人民解放军信息工程大学 | Multi-mode high-precision time and frequency standard equipment |
-
2017
- 2017-12-18 WO PCT/CN2017/117010 patent/WO2019119228A1/en active Application Filing
- 2017-12-18 CN CN201780026754.6A patent/CN109154796B/en not_active Expired - Fee Related
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101546169A (en) * | 2009-04-15 | 2009-09-30 | 北京航空航天大学 | Method and device for calibrating time |
CN105158771A (en) * | 2015-08-25 | 2015-12-16 | 中国科学院国家授时中心 | Traceability model parameter generation method for satellite navigation system |
Also Published As
Publication number | Publication date |
---|---|
WO2019119228A1 (en) | 2019-06-27 |
CN109154796A (en) | 2019-01-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104243129B (en) | Receiver, the method and computer readable storage medium for calculating the time difference | |
CN109283967B (en) | MCU clock calibration method and related equipment | |
EP2342850A1 (en) | A method for synchronizing clocks in a communication network | |
US10042383B2 (en) | Navigation system and mouse device | |
CN102023565B (en) | Device and method for outputting time information | |
US10274601B2 (en) | Communications system | |
CN111813638B (en) | Alarm information processing method and device and terminal equipment | |
CN107017959B (en) | A kind of method and device improving punctual precision using clock synchronization | |
CN109154796B (en) | Time updating method, device and movable platform | |
CN113630212B (en) | Downsampling method and downsampling device for digital signals | |
CN112835053B (en) | Laser radar synchronization method and device, electronic equipment and storage medium | |
CN113588132A (en) | Temperature processing method and device | |
CN109814835B (en) | FPGA-based interval uniform distribution device and IP core | |
CN111102689A (en) | Method and device for adjusting clock synchronization | |
CN108873669B (en) | UTC time calculation method of computer synchronous clock | |
CN116980065B (en) | Clock calibration method, clock calibration device, terminal equipment and storage medium | |
CN114499816A (en) | Clock synchronization method and device, terminal equipment and readable storage medium | |
CN109309637B (en) | Data storage method, device and storage medium for transmission signals | |
CN106940665A (en) | A kind of method of time correction control based on mobile terminal, system and mobile terminal | |
CN111426241B (en) | Operation parameter correction threshold determination method and device based on navigation system | |
CN111193652B (en) | CAN controller bit parameter setting method, device, equipment and storage medium | |
CN113030567B (en) | Frequency measurement method and device based on single chip microcomputer | |
CN111189471A (en) | Correction method, correction device and computer storage medium | |
CN112948105B (en) | Gradient transmission method, gradient transmission device and parameter server | |
CN112798860B (en) | Electric quantity calculation method and device and multi-split system |
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 | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20210406 |
|
CF01 | Termination of patent right due to non-payment of annual fee |