CN113992296B - Clock taming method, time code monitoring device and time synchronization system - Google Patents

Clock taming method, time code monitoring device and time synchronization system Download PDF

Info

Publication number
CN113992296B
CN113992296B CN202111337307.7A CN202111337307A CN113992296B CN 113992296 B CN113992296 B CN 113992296B CN 202111337307 A CN202111337307 A CN 202111337307A CN 113992296 B CN113992296 B CN 113992296B
Authority
CN
China
Prior art keywords
clock
clock difference
frequency reference
frequency
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.)
Active
Application number
CN202111337307.7A
Other languages
Chinese (zh)
Other versions
CN113992296A (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.)
China Electric Power Research Institute Co Ltd CEPRI
Original Assignee
China Electric Power Research Institute Co Ltd CEPRI
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 China Electric Power Research Institute Co Ltd CEPRI filed Critical China Electric Power Research Institute Co Ltd CEPRI
Priority to CN202111337307.7A priority Critical patent/CN113992296B/en
Publication of CN113992296A publication Critical patent/CN113992296A/en
Application granted granted Critical
Publication of CN113992296B publication Critical patent/CN113992296B/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
    • H04J3/0635Clock or time synchronisation in a network
    • H04J3/0638Clock or time synchronisation among nodes; Internode synchronisation
    • GPHYSICS
    • G04HOROLOGY
    • G04RRADIO-CONTROLLED TIME-PIECES
    • G04R20/00Setting the time according to the time information carried or implied by the radio signal
    • G04R20/02Setting 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/04Tuning or receiving; Circuits therefor
    • GPHYSICS
    • G04HOROLOGY
    • G04RRADIO-CONTROLLED TIME-PIECES
    • G04R20/00Setting the time according to the time information carried or implied by the radio signal
    • G04R20/02Setting 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/06Decoding time data; Circuits therefor
    • GPHYSICS
    • G04HOROLOGY
    • G04RRADIO-CONTROLLED TIME-PIECES
    • G04R40/00Correcting the clock frequency
    • G04R40/04Correcting the clock frequency by detecting the radio signal frequency

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Radar, Positioning & Navigation (AREA)
  • Remote Sensing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Electric Clocks (AREA)
  • Position Fixing By Use Of Radio Waves (AREA)

Abstract

A clock taming method, a time code monitoring device and a time synchronization system are provided, and the clock taming method comprises the following steps: acquiring a third clock difference sequence of each sampling moment in a preset time period; removing abnormal values and filtering the third clock difference sequence of each sampling time within a preset time period to obtain clock difference adjustment information; obtaining the frequency deviation amount between the local frequency reference source and the frequency reference center based on the clock difference adjustment information; obtaining the frequency adjustment quantity of the local frequency reference source according to the frequency deviation quantity; the frequency adjustment amount is sent to the local frequency reference source for controlling the local frequency reference source to effect an adjustment of the local reference signal. The clock taming method provided by the embodiment of the invention can weaken the influence of a satellite system and an environmental multipath, realize the taming of low-jitter and long-interval data to the clock, and improve the stability and the accuracy.

Description

Clock taming method, time code monitoring device and time synchronization system
Technical Field
The invention relates to the technical field of time service, in particular to a clock taming method, a time code monitoring device and a time synchronization system.
Background
Along with popularization of power grid informatization, each service node of the power grid and a service system with time requirements have higher requirements on a clock system, and clock errors of each node in the distributed network need to keep certain accuracy and synchronism. At present, the power utilization system generally adopts Beidou or GPS tame clocks to provide standard frequency, and has the following problems:
1. The existing Beidou or GPS tame clock generally adopts the interval of 1 second of Beidou or GPS data, the interval time is too short, and the stability is low;
2. The existing Beidou or GPS tame clock is imperfect in model construction due to influences on atmosphere transmission, satellite orbit and the like, large in data jitter and low in accuracy.
Disclosure of Invention
In view of the above, the invention provides a clock taming method, a time code monitoring device and a time synchronization system, which aim to solve the problems of short data interval and large jitter of the existing clock taming.
In a first aspect, an embodiment of the present invention provides a clock taming method, including: acquiring a third clock difference sequence of each sampling time in a preset time period, wherein the third clock difference sequence is a time deviation sequence obtained by comparing a local frequency reference source with a frequency reference center by adopting a satellite common-view comparison method; removing and filtering abnormal values of a third clock difference sequence of each sampling time in the preset time period to obtain clock difference adjustment information; obtaining a frequency deviation amount between the local frequency reference source and the frequency reference center based on the clock difference adjustment information; obtaining the frequency adjustment quantity of the local frequency reference source according to the frequency deviation quantity; the frequency adjustment amount is sent to the local frequency reference source for controlling the local frequency reference source to effect adjustment of a local reference signal.
Further, the performing outlier rejection and filtering on the third clock difference sequence of each sampling time within the preset time period to obtain clock difference adjustment information includes: adopting an outlier rejection algorithm to reject outliers of the third clock difference sequence at each sampling moment in the preset time period; calculating a weighted average value of a third clock difference sequence after the abnormal value of each sampling moment is removed in the preset time period, and obtaining a clock difference result of each sampling moment in the preset time period; and carrying out Kalman filtering on the clock difference result of each sampling time in the preset time period, and calculating the average value of the clock difference result of each sampling time in the preset time period after Kalman filtering to obtain clock difference adjustment information.
Further, the performing outlier rejection on the third clock difference sequence at each sampling time in the preset time period by using an outlier rejection algorithm includes: and performing the following rejection operation on the third clock difference sequence of each sampling time in the preset time period: selecting a third clock difference sequence { DeltaT 1,…ΔTi,…ΔTn } at the same sampling moment, wherein i=1, 2, …, n, n is the number of common-view satellites, n is more than or equal to 4, and the third clock difference DeltaT i is a time deviation obtained by comparing a local frequency reference source with a frequency reference center by adopting a satellite common-view comparison method relative to an ith common-view satellite; sequentially taking j as an integer from 1 to n, eliminating the j-th common-view satellite, and calculating the average value and standard deviation of the third clock difference sequences of the remaining n-1 common-view satellites to obtain n average values AVG i and n first standard deviations STD i, wherein j is more than or equal to 1 and less than or equal to n; respectively calculating the standard deviations of n first standard deviations STD i to obtain n second standard deviations STD (STD i); and respectively judging whether each second standard deviation STD (STD i) is larger than a first preset threshold value, if the second standard deviation STD (STD i) larger than the first preset threshold value exists, selecting the second standard deviation STD (STD i) with the largest value as an abnormal value, and eliminating the common view satellite corresponding to the abnormal value to form a third clock difference sequence { delta T 1,…ΔTp,…ΔTn-1 }, p=1, 2, …, n-1 after the abnormal value elimination.
Further, the obtaining, based on the clock difference adjustment information, a frequency deviation amount between the local frequency reference source and the frequency reference center includes: obtaining clock error fitting information based on the clock error adjustment information; and obtaining the frequency deviation amount between the local frequency reference source and the frequency reference center based on the clock difference fitting information.
Further, the obtaining the clock difference fitting information based on the clock difference adjustment information includes: and based on the clock correction information, adopting a historical data fitting algorithm to obtain clock correction fitting information.
Further, the obtaining the clock correction fitting information by adopting a historical data fitting algorithm based on the clock correction adjusting information includes: the clock difference fitting information Δt Km is calculated using the following formula:
Wherein m is the total amount of observed values; Δt Ki is a variable that affects clock synchronization, including: the clock drift clock difference adjusting information and the temperature change clock difference adjusting information are obtained through fitting historical data, wherein the historical data comprise design indexes and actual verification results.
Further, the phase adjustment amount of the local frequency reference source is obtained by an average value Δt Kt of the third clock difference sequence at the current sampling time, including: judging whether the average value delta T Kt of the third clock difference sequence at the current sampling moment is larger than a second preset threshold value, if so, calculating the average value delta T Kt of the third clock difference sequence at the current sampling moment by adopting a rounding function to obtain the phase adjustment quantity of the local frequency reference source; otherwise, the phase adjustment amount of the local frequency reference source is zero.
Further, the obtaining, based on the clock difference fitting information, a frequency deviation amount between the local frequency reference source and the frequency reference center includes: based on the clock difference fitting information, a frequency offset between the local frequency reference source and the frequency reference center is calculated using an incremental PID algorithm.
Further, the calculating, based on the clock difference fitting information, a frequency deviation amount between the local frequency reference source and the frequency reference center using an incremental PID algorithm includes: the frequency deviation delta f (n) between the local frequency reference source and the frequency reference center is calculated by adopting the following formula:
Δf(n)=KPΔTKt-ΔTKm/KI+KD [ΔTKt-ΔTK(t-1)];
Wherein K P、KI、KD is PID adjusting parameter; delta T Kt is the average value of the third sequence of clock differences at the current sampling instant and delta T K(t-1) is the average value of the third sequence of clock differences at the last sampling instant adjacent to the current sampling instant; ΔT Km is the clock difference fitting information.
Further, the obtaining the frequency adjustment amount of the local frequency reference source according to the frequency deviation amount includes: and according to the frequency deviation amount, calculating the frequency adjustment amount of the local frequency reference source by adopting a linear function.
Further, the calculating, according to the frequency deviation, the frequency adjustment amount of the local frequency reference source by using a linear function includes: the frequency adjustment quantity u (n) of the local frequency reference source is calculated by adopting the following formula:
u(n)= f(Δf(n))= KAΔf(n)+KB
Wherein K A、KB is a frequency reference source parameter; Δf (n) is the frequency deviation amount.
In a second aspect, an embodiment of the present invention further provides a time code monitoring apparatus, including: the satellite common view unit is used for receiving the local reference signal sent by the clock taming unit, the satellite signal sent by each common view satellite and the second clock difference sequence sent by the frequency reference center in real time, calculating to obtain a first clock difference sequence according to the local reference signal and each satellite signal, and sending the third clock difference sequence to the clock taming unit in real time and sending the first clock difference sequence to the frequency reference center in real time according to the third clock difference sequence obtained by calculation of the first clock difference sequence and the second clock difference sequence, wherein the second clock difference sequence is a time deviation sequence between the frequency reference center and each common view satellite; the clock taming unit is used for acquiring a third clock difference sequence of each sampling moment in a preset time period, executing the clock taming method provided by any embodiment, receiving a local reference signal sent by a frequency reference source, and respectively sending the local reference signal to the satellite common view unit, the clock output interface and the time signal measuring unit; the frequency reference source is used for receiving the frequency adjustment quantity sent by the clock taming unit, adjusting the local reference signal according to the frequency adjustment quantity and sending the local reference signal to the clock taming unit; the clock output interface is used for receiving the local reference signal sent by the clock taming unit, converting the local reference signal into a time code signal matched with a master station of the local power consumption information acquisition system and outputting the converted time code signal; and the time signal measuring unit is used for receiving the local reference signal sent by the clock taming unit and the master station time signal sent by the master station of the local power consumption information acquisition system, converting the master station time signal into a signal consistent with the local reference signal, calculating the time deviation between the local reference signal and the converted master station time signal, and outputting the time deviation.
Further, the apparatus further comprises: the data transmission unit is used for receiving the first clock difference sequence sent by the satellite common view unit, encrypting the first clock difference sequence and then sending the encrypted first clock difference sequence to the frequency reference center, receiving the second clock difference sequence sent by the frequency reference center, decrypting the second clock difference sequence and then sending the decrypted second clock difference sequence to the satellite common view unit.
Further, the data transmission unit is further configured to: sending a connection request to the frequency reference center, and establishing TCP connection; acquiring first information and sending the first information to the frequency reference center, wherein the first information comprises: decrypting at least one of a chip serial number, time code monitoring device authentication information and reference center authentication information; acquiring a first random number and first signature information provided by an encryption and decryption chip, and sending the first random number and the first signature information to the frequency reference center, wherein the first random number and the first signature information are obtained by updating an application session negotiation calculator through the encryption and decryption chip; acquiring a second random number and second signature information returned by the frequency reference center, and writing the second random number and the second signature information into the encryption and decryption chip; receiving a first clock difference sequence sent by the satellite common view unit or a second clock difference sequence sent by the frequency reference center; the first clock difference sequence or the second clock difference sequence is sent to an encryption and decryption chip written with the second random number and the second signature information to be encrypted or decrypted, and the encrypted first clock difference sequence or the decrypted second clock difference sequence is obtained; and sending the encrypted first clock difference sequence or the decrypted second clock difference sequence to the frequency reference center or the satellite common view unit.
Further, the third clock difference calculated according to the first clock difference sequence and the second clock difference sequence includes: calculating a third clock difference relative to each common-view satellite to obtain a third clock difference sequence { DeltaT 1, ΔT2,…,ΔTn }, wherein n is the number of the common-view satellites, and n is more than or equal to 4; the third clock difference Δt i with respect to the ith common view satellite is calculated by the following formula: ΔT i=TUi−TRi; where TU i is the first clock difference with respect to the ith co-view satellite and TR i is the second clock difference with respect to the ith co-view satellite.
Further, the frequency reference source is a rubidium clock or crystal oscillator.
Further, the encryption and decryption chip is an ESAM chip.
In a third aspect, an embodiment of the present invention further provides a time synchronization system, including: a common view satellite for transmitting satellite signals to the frequency reference center and the frequency application center; the frequency reference center is used for receiving satellite signals sent by the common-view satellite and a first clock difference sequence sent by the frequency application center, calculating to obtain a second clock difference sequence according to the satellite signals and a reference signal of the frequency reference center, and sending the second clock difference sequence to the frequency application center; the frequency application center comprises the time code monitoring device provided by any one of the embodiments, and is used for carrying out data interaction with the common-view satellite, the frequency reference center and the electricity consumption information acquisition system main station; the power consumption information acquisition system master station is used for transmitting a master station time signal to the frequency application center, receiving a time code signal transmitted by the frequency application center and calibrating the master station time signal based on the time code signal.
Further, the system further comprises: the acquisition terminal is used for receiving a master station time signal sent by a master station of the electricity consumption information acquisition system, calibrating the acquisition terminal time signal based on the master station time signal and sending the acquisition terminal time signal to the electric energy meter; and the electric energy meter is used for receiving the acquisition terminal time signal sent by the acquisition terminal and calibrating the time of the electric energy meter based on the acquisition terminal time signal.
In a fourth aspect, an embodiment of the present invention further provides a clock taming device, including: the third clock difference sequence acquisition unit is used for acquiring a third clock difference sequence of each sampling moment in a preset time period, wherein the third clock difference sequence is a time deviation sequence obtained by comparing a local frequency reference source with a frequency reference center by adopting a satellite common-view comparison method; the abnormal value removing and filtering unit is used for removing and filtering the abnormal value of the third clock difference sequence of each sampling moment in the preset time period to obtain clock difference adjustment information; a first unit configured to obtain a frequency deviation amount between the local frequency reference source and the frequency reference center based on the clock difference adjustment information; a second unit for obtaining a frequency adjustment amount of the local frequency reference source according to the frequency deviation amount; and the frequency adjustment quantity sending unit is used for sending the frequency adjustment quantity to the local frequency reference source so as to control the local frequency reference source to realize adjustment of a local reference signal.
In a fifth aspect, embodiments of the present invention further provide a computer readable storage medium having a computer program stored thereon, where the program when executed by a processor implements the clock taming method provided by the embodiments of the present invention.
According to the clock discipline method, the time code monitoring device and the time synchronization system, the satellite common-view comparison method is adopted to obtain the third clock difference sequence, and outlier rejection and filtering are carried out on the third clock difference sequence, so that the problems of low stability caused by short data interval of the existing Beidou or GPS and large data jitter and low accuracy caused by imperfect model construction due to influences on atmospheric transmission, satellite orbit and the like are solved, clock discipline of low-jitter and long-interval data can be realized, higher stability can be brought, influence caused by multipath of a satellite system and environment can be effectively weakened, and accuracy is improved.
According to the time code monitoring device and the time synchronization system provided by some embodiments of the invention, the problem of real-time tracing of the power system on line monitoring is solved by combining satellite common view with clock taming, and meanwhile, the problems of timeliness and accuracy of time service and measurement are solved, so that time misalignment and synchronization deviation can be timely identified, and trade settlement fairness and fault analysis and judgment are ensured; in addition, the multi-place deployment can realize the unification and synchronization of the whole network time.
According to the time code monitoring device and the time synchronization system provided by the embodiments of the invention, the integrity, the safety and the usability of data transmission are ensured by encrypting and decrypting data interaction, and the requirements of information security of a power grid are met.
Drawings
FIG. 1 illustrates an exemplary flow chart of a method of clock taming in accordance with an embodiment of the invention;
FIG. 2 shows a schematic diagram of a time code monitoring apparatus according to an embodiment of the present invention;
FIG. 3 shows a schematic diagram of a time synchronization system according to an embodiment of the invention;
Fig. 4 shows an exemplary flow chart of a clock taming device according to an embodiment of the invention.
Detailed Description
The exemplary embodiments of the present invention will now be described with reference to the accompanying drawings, however, the present invention may be embodied in many different forms and is not limited to the examples described herein, which are provided to fully and completely disclose the present invention and fully convey the scope of the invention to those skilled in the art. The terminology used in the exemplary embodiments illustrated in the accompanying drawings is not intended to be limiting of the invention. In the drawings, like elements/components are referred to by like reference numerals.
Unless otherwise indicated, terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art. In addition, it will be understood that terms defined in commonly used dictionaries should be interpreted as having a meaning that is consistent with their meaning in the context of the relevant art and will not be interpreted in an idealized or overly formal sense.
Fig. 1 shows an exemplary flowchart of a clock taming method according to an embodiment of the invention.
As shown in fig. 1, the method includes:
Step S101: and obtaining a third clock difference sequence of each sampling time in a preset time period, wherein the third clock difference sequence is a time deviation sequence obtained by comparing a local frequency reference source with a frequency reference center by adopting a satellite common-view comparison method.
In the embodiment of the invention, the preset time period can be the current sampling time and a period before the current sampling time, the specific time period length can be set according to the requirement, and the problem of inaccuracy caused by data deviation at a certain time is avoided by acquiring the data in the preset time period, so that the overall accuracy of the data is ensured. It should be appreciated that the longer the preset time period, the higher the final clock tame stability and accuracy. And in the preset time period, the third clock difference of each sampling moment can be obtained according to the preset sampling time interval. Specifically, the preset sampling time interval may be in accordance with the common view data CGGTTS format standard. Preferably, the preset sampling time interval is 16 minutes. The local frequency reference source may be a rubidium clock or crystal oscillator. The common view satellite can comprise a satellite system such as Beidou satellite, GPS, GLONASS, galileo satellite system and the like.
The third clock difference ΔT i with respect to the common view satellite i can be calculated using the following formula:
ΔTi=TUi−TRi
where TU i is the time offset between the local frequency reference source and satellites i and TR i is the time offset between the frequency reference center and satellites i. The third clock difference relative to each common view satellite can form a third clock difference sequence, namely { DeltaT 1, ΔT2,…,ΔTn }, n is the number of common view satellites, and n is more than or equal to 4.
According to the embodiment, the problem that the interval time of the existing Beidou or GPS tame clock is short and the data jitter is large is solved by adopting a satellite common view comparison method. On one hand, the satellite common-view comparison method has long sampling time interval, and improves the stability of clock taming; on the other hand, by comparing the local frequency reference source time with the frequency reference center time, errors of atmosphere transmission, satellite orbit and the like can be effectively eliminated (or weakened), small data jitter is realized, and the accuracy of clock taming is improved.
Step S102: and carrying out outlier rejection and filtering on the third clock difference sequence of each sampling time within a preset time period to obtain clock difference adjustment information.
Further, step S102 includes:
And adopting an outlier removing algorithm to remove outliers from the third clock difference sequence at each sampling moment in the preset time period.
Further, performing outlier rejection on the third clock difference sequence at each sampling time within a preset time period by adopting an outlier rejection algorithm, including:
and performing the following rejection operation on the third clock difference sequence of each sampling time within a preset time period:
Selecting a third clock difference sequence { DeltaT 1,…ΔTi,…ΔTn } at the same sampling moment, wherein i=1, 2, …, n, n is the number of common-view satellites, n is more than or equal to 4, and the third clock difference DeltaT i is a time deviation obtained by comparing a local frequency reference source with a frequency reference center by adopting a satellite common-view comparison method relative to an ith common-view satellite;
Sequentially taking j as an integer from 1 to n, eliminating the j-th common-view satellite, and calculating the average value and standard deviation of the third clock difference sequences of the remaining n-1 common-view satellites to obtain n average values AVG i and n first standard deviations STD i, wherein j is more than or equal to 1 and less than or equal to n;
Respectively calculating standard deviations of n first standard deviations STD i to obtain n second standard deviations STD (STD i);
And respectively judging whether each second standard deviation STD (STD i) is larger than a first preset threshold value, if the second standard deviation STD (STD i) larger than the first preset threshold value exists, selecting the second standard deviation STD (STD i) with the largest value as an abnormal value, and eliminating the common view satellite corresponding to the abnormal value to form a third clock difference sequence { delta T 1,…ΔTp,…ΔTn-1 }, p=1, 2, … and n-1 after the abnormal value is eliminated.
In the embodiment of the invention, any one common-view satellite (j-th common-view satellite) is removed from the dimension of the common-view satellite, namely, the 1 st, the 2 nd and the … th common-view satellites are removed respectively, and after the n-th common-view satellite is reached, the rest common-view satellites respectively form n common-view satellite combinations; for each combination of satellites in common view, calculating the mean and standard deviation of the time deviation between the local frequency reference source and the frequency reference center relative to the combination, i.e. calculating the mean and standard deviation of the third sequence of clock differences relative to the combination, resulting in n mean values and n first standard deviations; and then calculating standard deviations of the n first standard deviations to obtain n second standard deviations. Comparing each second standard deviation with the first preset threshold value: if the data consistency is smaller than or equal to the first preset threshold value, the data consistency is better, and abnormal values are not required to be removed; if the difference is larger than the first preset threshold, the poor data consistency is indicated, all second standard deviations larger than the first preset threshold are subjected to statistical sorting, the maximum value is selected as an abnormal value of the time, the common-view satellites removed in the combination corresponding to the maximum value are removed, and n-1 third clock differences after the abnormal value is removed are formed. It should be understood that if the second standard deviation greater than the first preset threshold is 2 or more, the above steps are required to be executed in a circulating manner, and all the outliers are removed in sequence. In the embodiment of the invention, the outlier in the satellite common view data, namely the third clock difference sequence, of each sampling time within the preset time period is needed to be removed.
And calculating a weighted average value of the third clock difference sequence after the abnormal value of each sampling time is removed in a preset time period, and obtaining a clock difference result of each sampling time in the preset time period.
In the embodiment of the invention, for each sampling time in a preset time period, a weighted average value of a third clock difference sequence { DeltaT 1,…ΔTp,…ΔTn-1 } after abnormal values are removed is calculated, and is used as a clock difference result. If the abnormal value is not removed in the previous step, the weighted average calculation is directly carried out on the third clock difference sequence.
And carrying out Kalman filtering on the clock difference result of each sampling time in a preset time period, and calculating the average value of the clock difference result of each sampling time in the preset time period after Kalman filtering to obtain clock difference adjustment information.
In the embodiment of the invention, from the time dimension, the optimal estimated value (the clock difference result of the Kalman filtering) of each sampling time in the preset time period is obtained by Kalman filtering the clock difference result of each sampling time in the preset time period, and the average value of the optimal estimated values of each sampling time is calculated as the current clock difference adjustment information.
On the one hand, the embodiment realizes the elimination of the abnormal value data by comparing the standard deviation for the satellite clock difference data at the same moment, so that the influence of individual satellite data on the clock difference mean value can be reduced; on the other hand, kalman filtering is adopted for clock difference sequence data at different moments, so that the influence caused by a satellite system and environmental multipath is effectively reduced, and the data jitter is lower.
Step S103: based on the clock difference adjustment information, a frequency offset between the local frequency reference source and the frequency reference center is obtained.
Further, step S103 includes:
Obtaining clock error fitting information based on the clock error adjustment information;
and obtaining the frequency deviation amount between the local frequency reference source and the frequency reference center based on the clock difference fitting information.
Further, based on the clock correction information, obtaining clock correction fitting information includes:
based on the clock correction information, a history data fitting algorithm is adopted to obtain clock correction fitting information.
Further, based on the clock correction information, a history data fitting algorithm is adopted to obtain clock correction fitting information, including:
The clock difference fitting information Δt Km is calculated using the following formula:
Wherein m is the total amount of observed values; Δt Ki is a variable that affects clock synchronization, including: the clock difference adjusting information, the phase adjusting amount of the local frequency reference source, the clock drift clock difference adjusting information and the temperature change clock difference adjusting information are obtained through average value delta T Kt of a third clock difference sequence at the current sampling moment, the clock drift clock difference adjusting information and the temperature change clock difference adjusting information are obtained through historical data fitting, and the historical data comprise design indexes and actual verification results.
In the embodiment of the invention, the total observation value, the clock drift clock difference adjusting information and the temperature change clock difference adjusting information can be obtained through historical data fitting. The historical data includes design indexes and actual verification results, wherein the design indexes can include various design values inherent to the local frequency reference source, and the actual verification results can include factory debugging data of the local frequency reference source and verification data generated in an actual use process. The embodiment of the invention only enumerates four variables which affect clock synchronization, namely clock difference adjustment information, phase adjustment quantity of a local frequency reference source, clock drift clock difference adjustment information and temperature change clock difference adjustment information, and can actually also comprise other variables, such as clock difference adjustment quantity caused by ephemeris error, clock difference adjustment quantity caused by ionospheric delay and the like. By taking a plurality of variables affecting clock synchronization into consideration, the clock error adjustment information, the phase adjustment amount of the local frequency reference source and the fitted variables are summed to obtain clock error fitting information, so that errors caused by various variables can be eliminated or greatly reduced, and time accuracy is improved.
Further, the phase adjustment amount of the local frequency reference source is obtained by an average value Δt Kt of the third clock difference sequence at the current sampling time, including:
Judging whether the average value delta T Kt of the third clock difference sequence at the current sampling moment is larger than a second preset threshold value, if so, calculating the average value delta T Kt of the third clock difference sequence at the current sampling moment by adopting a rounding function to obtain the phase adjustment quantity of the local frequency reference source; otherwise, the phase adjustment amount of the local frequency reference source is zero.
In the embodiment of the present invention, the average value Δt Kt of the third clock difference sequence at the current sampling time T is calculated by adopting the following formula:
TU it is the time deviation between the local frequency reference source at the current sampling time and the ith common-view satellite, TR it is the time deviation between the frequency reference center at the current sampling time and the ith common-view satellite, n is the number of common-view satellites, and n is more than or equal to 4.
Further, obtaining a frequency deviation amount between the local frequency reference source and the frequency reference center based on the clock difference fitting information includes:
Based on the clock difference fitting information, the frequency deviation amount between the local frequency reference source and the frequency reference center is calculated by using an incremental PID algorithm.
Further, based on the clock difference fitting information, calculating a frequency deviation amount between the local frequency reference source and the frequency reference center by using an incremental PID algorithm, including:
the frequency deviation Δf (n) between the local frequency reference source and the frequency reference center is calculated using the following formula:
Δf(n)=KPΔTKt-ΔTKm/KI+KD [ΔTKt-ΔTK(t-1)];
Wherein K P、KI、KD is PID adjusting parameter; delta T Kt is the average value of the third sequence of clock differences at the current sampling instant and delta T K(t-1) is the average value of the third sequence of clock differences at the last sampling instant adjacent to the current sampling instant; ΔT Km is the clock difference fit information.
In the embodiment of the invention, K P、KI、KD is a PID regulation parameter, is determined by different types of frequency reference sources, is related to the stability, drift, temperature system and other parameters of the frequency reference sources, and can be obtained through test history data. By means of the construction algorithm, variables such as satellite common view, frequency reference source and environment are considered, the influence of various variables on time is effectively weakened, and clock taming accuracy is improved.
Step S104: and obtaining the frequency adjustment quantity of the local frequency reference source according to the frequency deviation quantity.
Further, step S104 includes:
And according to the frequency deviation amount, calculating the frequency adjustment amount of the local frequency reference source by adopting a linear function.
Further, according to the frequency deviation amount, calculating the frequency adjustment amount of the local frequency reference source by adopting a linear function comprises the following steps:
the frequency adjustment u (n) of the local frequency reference source is calculated by adopting the following formula:
u(n)= f(Δf(n))= KAΔf(n)+KB
Where K A、KB is the frequency reference source parameter and Δf (n) is the frequency offset.
K A、KB is determined by different types of frequency reference sources.
Step S105: the frequency adjustment amount is sent to the local frequency reference source for controlling the local frequency reference source to effect an adjustment of the local reference signal.
According to the embodiment, the third clock difference sequence is obtained by adopting the satellite common view comparison method, and the clock difference sequence is subjected to outlier rejection and filtering, so that the problems of low stability caused by short data interval of the existing Beidou or GPS and large data jitter and low accuracy caused by imperfect model constructed due to influences on atmospheric transmission, satellite orbit and the like are solved, the clock taming of low-jitter and long-interval data can be realized, higher stability can be brought, the influence caused by multipath of a satellite system and the environment can be effectively weakened, and the accuracy is improved.
The existing Beidou or GPS tame clock generally adopts the interval of 1 second of Beidou or GPS data to carry out clock tame, and the method provided by the invention can adopt the data interval of 16 minutes (according to the common view data CGGTTS format standard) to carry out clock tame; and experiments prove that the stability of the output frequency can reach 5x10 < -14 > (day stability), and the accuracy of the output time can reach 5ns (95%).
Fig. 2 shows a schematic structural diagram of a time code monitoring apparatus according to an embodiment of the present invention.
As shown in fig. 2, the apparatus includes:
The satellite common view unit 201 is configured to receive, in real time, the local reference signal sent by the clock taming unit, the satellite signal sent by each common view satellite, and the second clock difference sequence sent by the frequency reference center, calculate a first clock difference sequence according to the local reference signal and each satellite signal, and calculate a third clock difference sequence according to the first clock difference sequence and the second clock difference sequence, send the third clock difference sequence to the clock taming unit in real time, and send the first clock difference sequence to the frequency reference center in real time, where the second clock difference sequence is a time deviation sequence between the frequency reference center and each common view satellite;
The clock taming unit 202 is configured to obtain a third clock difference sequence of each sampling time within a preset time period, execute the clock taming method provided in any of the foregoing embodiments, receive a local reference signal sent by a frequency reference source, and send the local reference signal to the satellite common view unit, the clock output interface, and the time signal measurement unit, respectively;
A frequency reference source 203, configured to receive the frequency adjustment amount sent by the clock taming unit, adjust the local reference signal according to the frequency adjustment amount, and send the local reference signal to the clock taming unit;
The clock output interface 204 is configured to receive the local reference signal sent by the clock taming unit, convert the local reference signal into a time code signal matched with the local power consumption information acquisition system master station, and output the converted time code signal;
The time signal measuring unit 205 is configured to receive the local reference signal sent by the clock taming unit and the master station time signal sent by the master station of the local power consumption information acquisition system, convert the master station time signal into a signal consistent with the local reference signal, calculate a time deviation between the local reference signal and the converted master station time signal, and output the time deviation.
In the embodiment of the invention, the time of each common-view satellite can be obtained according to each satellite signal. The first clock difference is the time deviation between the local frequency reference source and the common-view satellite i, and can be obtained by making a difference between the local reference signal t 1 and the time t si of the common-view satellite i, namely, the first clock difference TU i=t1-tsi; because the number of the common-view satellites is multiple, the time deviation of the local frequency reference source relative to each common-view satellite forms a first clock difference sequence { TU 1,TU2,…,TUn }, n is the number of the common-view satellites, and n is more than or equal to 4. Similarly, the second clock difference is the time deviation between the frequency reference center and the satellites i, and can be obtained by making a difference between the reference signal t 2 of the frequency reference center and the time t si of the satellites i, that is, the second clock difference TR i=t2-tsi; because the number of the common-view satellites is multiple, the time deviation of the frequency reference center relative to each common-view satellite forms a second clock difference sequence { TR 1,TR2,…,TRn }, n is the number of the common-view satellites, and n is more than or equal to 4. The third clock difference is the time deviation between the local frequency reference source and the frequency reference center, and can be obtained by the difference between the first clock difference and the second clock difference, namely delta T i=TUi−TRi= (t1-tsi)-(t2-tsi), and as the number of the common-view satellites is multiple, the time deviation between the local frequency reference source and the frequency reference center forms a third clock difference sequence { delta T 1,ΔT2,…,ΔTn } relative to each common-view satellite, n is the number of the common-view satellites, and n is more than or equal to 4. The common view satellite can comprise a satellite system such as Beidou satellite, GPS, GLONASS, galileo satellite system and the like.
And the frequency reference source is used for sending the local reference signal to the clock taming unit in real time, wherein the local reference signal comprises a local reference signal before adjustment and a local reference signal after adjustment. Similarly, in the embodiment of the invention, the clock output interface and the time signal measuring unit are local reference signals sent by the real-time receiving clock disciplining unit, and the local reference signals comprise a local reference signal before adjustment and a local reference signal after adjustment.
The clock output interface is used for providing a local reference signal for a master station of the local power consumption information acquisition system, the local power consumption information acquisition system has various equipment types and different forms, and the output time code signals comprise IRIG-B (DC), IRIG-B (AC), TOD, NTP/PTP and other time code signals besides 1PPS pulse signals, and the conversion and the output of the different time code signals are performed in parallel.
The time signal measuring unit can receive different types of master station time signals provided by a master station of a local power consumption information acquisition system, including 1PPS, IRIG-B (DC), IRIG-B (AC), TOD, NTP/PTP and the like, convert the master station time signals into signals consistent with the local reference signals, calculate time deviation between the local reference signals and the converted master station time signals by taking the local reference signals as references, and can realize precision measurement and evaluation of the master station time signals, wherein the conversion and measurement processes of the different master station time signals are also performed in parallel.
Through clock output interface and time signal measurement unit, can provide required time code and measurement function for electric power user, have stronger suitability to electric power system user, can satisfy many specialty and many application scenario demands, realize that single device can accomplish time service and time code measurement promptly, resources are saved, simplify the measurement process.
According to the embodiment, the clock taming technology is combined with the time code measuring function, so that the problem of real-time tracing of on-line monitoring is solved, the problems of timeliness and accuracy of time service and measurement of a power system are solved, time misalignment and synchronous deviation can be timely identified, and trade settlement fairness and fault analysis judgment are guaranteed; in addition, the multi-place deployment can realize the unification and synchronization of the whole network time.
Further, with continued reference to fig. 2, the apparatus further includes:
the data transmission unit 206 is configured to receive the first clock difference sequence sent by the satellite common view unit, encrypt the first clock difference sequence, send the encrypted first clock difference sequence to the frequency reference center, receive the second clock difference sequence sent by the frequency reference center, decrypt the second clock difference sequence, and send the decrypted second clock difference sequence to the satellite common view unit.
The data generated by the device and the downloaded reference data are encrypted and decrypted through the data transmission unit, so that the integrity, the safety and the usability of data transmission are ensured, and the requirements of information security of a power grid are met.
Further, the data transmission unit 206 is further configured to:
Sending a connection request to a frequency reference center, and establishing TCP connection;
Acquiring first information and sending the first information to a frequency reference center, wherein the first information comprises: decrypting at least one of a chip serial number, time code monitoring device authentication information and reference center authentication information;
Acquiring a first random number and first signature information provided by an encryption and decryption chip, and sending the first random number and the first signature information to a frequency reference center, wherein the first random number and the first signature information are obtained by updating an application session negotiation calculator through the encryption and decryption chip;
acquiring a second random number and second signature information returned by the frequency reference center, and writing the second random number and the second signature information into the encryption and decryption chip;
receiving a first clock difference sequence sent by a satellite common view receiving unit or a second clock difference sequence sent by a frequency reference center;
The first clock difference sequence or the second clock difference sequence is sent to an encryption and decryption chip written with a second random number and second signature information to be encrypted or decrypted, and the encrypted first clock difference sequence or the decrypted second clock difference sequence is obtained;
and sending the encrypted first clock difference sequence or the decrypted second clock difference sequence to a frequency reference center or a satellite common view unit.
In the above embodiment, the TCP connection, the port may be 61201. Preferably, the encryption and decryption chip is an ESAM chip. When large data volume data interaction is carried out with the reference center, the data segments can be subjected to cyclic interaction until the data transmission unit is closed to be connected with the reference center after the data segmentation is completed.
The data is encrypted through the TCP connection and the encryption and decryption chip, and the data interaction between the reference center and the device can be realized more safely and reliably by adopting an electric power system encryption network.
Further, a third clock difference sequence calculated according to the first clock difference sequence and the second clock difference sequence comprises:
calculating a third clock difference relative to each common-view satellite to obtain a third clock difference sequence { DeltaT 1, ΔT2,…,ΔTn }, wherein n is the number of the common-view satellites, and n is more than or equal to 4;
The third clock difference Δt i with respect to the ith common view satellite is calculated by the following formula:
ΔTi=TUi−TRi
Where TU i is the first clock difference with respect to the ith co-view satellite and TR i is the second clock difference with respect to the ith co-view satellite.
Further, the frequency reference source is a rubidium clock or crystal oscillator.
Fig. 3 shows a schematic diagram of the structure of a time synchronization system according to an embodiment of the present invention.
As shown in fig. 3, the system includes:
A common view satellite 301 for transmitting satellite signals to a frequency reference center 302 and a frequency application center 303;
The frequency reference center 302 is configured to receive the satellite signal sent by the common-view satellite 301 and the first clock difference sequence sent by the frequency application center 303, calculate a second clock difference sequence according to the satellite signal and a reference signal of the frequency reference center, and send the second clock difference sequence to the frequency application center 303;
the frequency application center 303 comprises the time code monitoring device provided by any one of the embodiments, and is used for performing data interaction with the satellites 301, the frequency reference center 302 and the electricity consumption information acquisition system master station 304;
The electricity consumption information acquisition system master station 304 is configured to send a master station time signal to the frequency application center 303, receive a time code signal sent by the frequency application center 303, and calibrate the master station time signal based on the time code signal.
In the above embodiment, the number of the common view satellites may be plural, and preferably, the number of the common view satellites is at least 4. The frequency reference center is typically 1. The number of the frequency application centers can be 1 or 2 or more, and each frequency application center is used for carrying out data interaction with the frequency reference center, each common view satellite and each electricity consumption information acquisition system main station independently. The electricity consumption information acquisition system main station corresponds to the frequency application center, and can be 1 or 2 or more.
According to the embodiment, the satellite common view and the clock discipline are combined, so that the problem of real-time tracing of the online monitoring of the power system is solved, the problems of timeliness and accuracy of time service and measurement are solved, time misalignment and synchronous deviation can be timely identified, and trade settlement fairness and fault analysis judgment are guaranteed; in addition, the multi-place deployment can realize the unification and synchronization of the whole network time.
Further, with continued reference to fig. 3, the system further includes:
The acquisition terminal 305 is configured to receive a master station time signal sent by the master station 304 of the electricity information acquisition system, calibrate the acquisition terminal time signal based on the master station time signal, and send the acquisition terminal time signal to the electric energy meter 306;
The electric energy meter 306 is configured to receive the acquisition terminal time signal sent by the acquisition terminal 305, and calibrate the time of the electric energy meter based on the acquisition terminal time signal.
Fig. 4 shows an exemplary flow chart of a clock taming device according to an embodiment of the invention.
As shown in fig. 4, the apparatus includes:
The third clock difference sequence obtaining unit 401 is configured to obtain a third clock difference sequence of each sampling time within a preset time period, where the third clock difference sequence is a time deviation sequence obtained by comparing the local frequency reference source with the frequency reference center by using a satellite common-view comparison method.
In the embodiment of the invention, the preset time period can be the current sampling time and a period before the current sampling time, the specific time period length can be set according to the requirement, and the problem of inaccuracy caused by data deviation at a certain time is avoided by acquiring the data in the preset time period, so that the overall accuracy of the data is ensured. It should be appreciated that the longer the preset time period, the higher the final clock tame stability and accuracy. And in the preset time period, the third clock difference of each sampling moment can be obtained according to the preset sampling time interval. Specifically, the preset sampling time interval may be in accordance with the common view data CGGTTS format standard. Preferably, the preset sampling time interval is 16 minutes. The local frequency reference source may be a rubidium clock or crystal oscillator. The common view satellite can comprise a satellite system such as Beidou satellite, GPS, GLONASS, galileo satellite system and the like.
The third clock difference ΔT i with respect to the common view satellite i can be calculated using the following formula:
ΔTi=TUi−TRi
where TU i is the time offset between the local frequency reference source and satellites i and TR i is the time offset between the frequency reference center and satellites i. The third clock difference relative to each common view satellite can form a third clock difference sequence, namely { DeltaT 1, ΔT2,…,ΔTn }, n is the number of common view satellites, and n is more than or equal to 4.
According to the embodiment, the problem that the interval time of the existing Beidou or GPS tame clock is short and the data jitter is large is solved by adopting a satellite common view comparison method. On one hand, the satellite common-view comparison method has long sampling time interval, and improves the stability of clock taming; on the other hand, by comparing the local frequency reference source time with the frequency reference center time, errors of atmosphere transmission, satellite orbit and the like can be effectively eliminated (or weakened), small data jitter is realized, and the accuracy of clock taming is improved.
The outlier removing and filtering unit 402 is configured to perform outlier removing and filtering on the third clock difference sequence at each sampling time within the preset time period, so as to obtain clock difference adjustment information.
Further, the outlier rejection and filtering unit 402 is further configured to:
And adopting an outlier removing algorithm to remove outliers from the third clock difference sequence at each sampling moment in the preset time period.
Further, performing outlier rejection on the third clock difference sequence at each sampling time within a preset time period by adopting an outlier rejection algorithm, including:
and performing the following rejection operation on the third clock difference sequence of each sampling time within a preset time period:
Selecting a third clock difference sequence { DeltaT 1,…ΔTi,…ΔTn } at the same sampling moment, wherein i=1, 2, …, n, n is the number of common-view satellites, n is more than or equal to 4, and the third clock difference DeltaT i is a time deviation obtained by comparing a local frequency reference source with a frequency reference center by adopting a satellite common-view comparison method relative to an ith common-view satellite;
Sequentially taking j as an integer from 1 to n, eliminating the j-th common-view satellite, and calculating the average value and standard deviation of the third clock difference sequences of the remaining n-1 common-view satellites to obtain n average values AVG i and n first standard deviations STD i, wherein j is more than or equal to 1 and less than or equal to n;
Respectively calculating standard deviations of n first standard deviations STD i to obtain n second standard deviations STD (STD i);
And respectively judging whether each second standard deviation STD (STD i) is larger than a first preset threshold value, if the second standard deviation STD (STD i) larger than the first preset threshold value exists, selecting the second standard deviation STD (STD i) with the largest value as an abnormal value, and eliminating the common view satellite corresponding to the abnormal value to form a third clock difference sequence { delta T 1,…ΔTp,…ΔTn-1 }, p=1, 2, … and n-1 after the abnormal value is eliminated.
In the embodiment of the invention, any one common-view satellite (j-th common-view satellite) is removed from the dimension of the common-view satellite, namely, the 1 st, the 2 nd and the … th common-view satellites are removed respectively, and after the n-th common-view satellite is reached, the rest common-view satellites respectively form n common-view satellite combinations; for each combination of satellites in common view, calculating the mean and standard deviation of the time deviation between the local frequency reference source and the frequency reference center relative to the combination, i.e. calculating the mean and standard deviation of the third sequence of clock differences relative to the combination, resulting in n mean values and n first standard deviations; and then calculating standard deviations of the n first standard deviations to obtain n second standard deviations. Comparing each second standard deviation with the first preset threshold value: if the data consistency is smaller than or equal to the first preset threshold value, the data consistency is better, and abnormal values are not required to be removed; if the difference is larger than the first preset threshold, the poor data consistency is indicated, all second standard deviations larger than the first preset threshold are subjected to statistical sorting, the maximum value is selected as an abnormal value of the time, the common-view satellites removed in the combination corresponding to the maximum value are removed, and n-1 third clock differences after the abnormal value is removed are formed. It should be understood that if the second standard deviation greater than the first preset threshold is 2 or more, the above steps are required to be executed in a circulating manner, and all the outliers are removed in sequence. In the embodiment of the invention, the outlier in the satellite common view data, namely the third clock difference sequence, of each sampling time within the preset time period is needed to be removed.
And calculating a weighted average value of the third clock difference sequence after the abnormal value of each sampling time is removed in a preset time period, and obtaining a clock difference result of each sampling time in the preset time period.
In the embodiment of the invention, for each sampling time in a preset time period, a weighted average value of a third clock difference sequence { DeltaT 1,…ΔTp,…ΔTn-1 } after abnormal values are removed is calculated, and is used as a clock difference result. If the abnormal value is not removed in the previous step, the weighted average calculation is directly carried out on the third clock difference sequence.
And carrying out Kalman filtering on the clock difference result of each sampling time in a preset time period, and calculating the average value of the clock difference result of each sampling time in the preset time period after Kalman filtering to obtain clock difference adjustment information.
In the embodiment of the invention, from the time dimension, the optimal estimated value (the clock difference result of the Kalman filtering) of each sampling time in the preset time period is obtained by Kalman filtering the clock difference result of each sampling time in the preset time period, and the average value of the optimal estimated values of each sampling time is calculated as the current clock difference adjustment information.
On the one hand, the embodiment realizes the elimination of the abnormal value data by comparing the standard deviation for the satellite clock difference data at the same moment, so that the influence of individual satellite data on the clock difference mean value can be reduced; on the other hand, kalman filtering is adopted for clock difference sequence data at different moments, so that the influence caused by a satellite system and environmental multipath is effectively reduced, and the data jitter is lower.
A first unit 403, configured to obtain a frequency deviation amount between the local frequency reference source and the frequency reference center based on the clock difference adjustment information.
Further, the first unit 403 is further configured to:
Obtaining clock error fitting information based on the clock error adjustment information;
and obtaining the frequency deviation amount between the local frequency reference source and the frequency reference center based on the clock difference fitting information.
Further, based on the clock correction information, obtaining clock correction fitting information includes:
based on the clock correction information, a history data fitting algorithm is adopted to obtain clock correction fitting information.
Further, based on the clock correction information, a history data fitting algorithm is adopted to obtain clock correction fitting information, including:
The clock difference fitting information Δt Km is calculated using the following formula:
Wherein m is the total amount of observed values; Δt Ki is a variable that affects clock synchronization, including: the clock difference adjusting information, the phase adjusting amount of the local frequency reference source, the clock drift clock difference adjusting information and the temperature change clock difference adjusting information are obtained through average value delta T Kt of a third clock difference sequence at the current sampling moment, the clock drift clock difference adjusting information and the temperature change clock difference adjusting information are obtained through historical data fitting, and the historical data comprise design indexes and actual verification results.
In the embodiment of the invention, the total observation value, the clock drift clock difference adjusting information and the temperature change clock difference adjusting information can be obtained through historical data fitting. The historical data includes design indexes and actual verification results, wherein the design indexes can include various design values inherent to the local frequency reference source, and the actual verification results can include factory debugging data of the local frequency reference source and verification data generated in an actual use process. The embodiment of the invention only enumerates four variables which affect clock synchronization, namely clock difference adjustment information, phase adjustment quantity of a local frequency reference source, clock drift clock difference adjustment information and temperature change clock difference adjustment information, and can actually also comprise other variables, such as clock difference adjustment quantity caused by ephemeris error, clock difference adjustment quantity caused by ionospheric delay and the like. By taking a plurality of variables affecting clock synchronization into consideration, the clock error adjustment information, the phase adjustment amount of the local frequency reference source and the fitted variables are summed to obtain clock error fitting information, so that errors caused by various variables can be eliminated or greatly reduced, and time accuracy is improved.
Further, the phase adjustment amount of the local frequency reference source is obtained by an average value Δt Kt of the third clock difference sequence at the current sampling time, including:
Judging whether the average value delta T Kt of the third clock difference sequence at the current sampling moment is larger than a second preset threshold value, if so, calculating the average value delta T Kt of the third clock difference sequence at the current sampling moment by adopting a rounding function to obtain the phase adjustment quantity of the local frequency reference source; otherwise, the phase adjustment amount of the local frequency reference source is zero.
In the embodiment of the present invention, the average value Δt Kt of the third clock difference sequence at the current sampling time T is calculated by adopting the following formula:
TU it is the time deviation between the local frequency reference source at the current sampling time and the ith common-view satellite, TR it is the time deviation between the frequency reference center at the current sampling time and the ith common-view satellite, n is the number of common-view satellites, and n is more than or equal to 4.
Further, obtaining a frequency deviation amount between the local frequency reference source and the frequency reference center based on the clock difference fitting information includes:
Based on the clock difference fitting information, the frequency deviation amount between the local frequency reference source and the frequency reference center is calculated by using an incremental PID algorithm.
Further, based on the clock difference fitting information, calculating a frequency deviation amount between the local frequency reference source and the frequency reference center by using an incremental PID algorithm, including:
the frequency deviation Δf (n) between the local frequency reference source and the frequency reference center is calculated using the following formula:
Δf(n)=KPΔTKt-ΔTKm/KI+KD [ΔTKt-ΔTK(t-1)];
Wherein K P、KI、KD is PID adjusting parameter; delta T Kt is the average value of the third sequence of clock differences at the current sampling instant and delta T K(t-1) is the average value of the third sequence of clock differences at the last sampling instant adjacent to the current sampling instant; ΔT Km is the clock difference fit information.
In the embodiment of the invention, K P、KI、KD is a PID regulation parameter, is determined by different types of frequency reference sources, is related to the stability, drift, temperature system and other parameters of the frequency reference sources, and can be obtained through test history data. By means of the construction algorithm, variables such as satellite common view, frequency reference source and environment are considered, the influence of various variables on time is effectively weakened, and clock taming accuracy is improved.
A second unit 404, configured to obtain a frequency adjustment amount of the local frequency reference source according to the frequency deviation amount.
Further, the second unit 404 is further configured to:
And according to the frequency deviation amount, calculating the frequency adjustment amount of the local frequency reference source by adopting a linear function.
Further, according to the frequency deviation amount, calculating the frequency adjustment amount of the local frequency reference source by adopting a linear function comprises the following steps:
the frequency adjustment u (n) of the local frequency reference source is calculated by adopting the following formula:
u(n)= f(Δf(n))= KAΔf(n)+KB
Where K A、KB is the frequency reference source parameter and Δf (n) is the frequency offset.
K A、KB is determined by different types of frequency reference sources.
A frequency adjustment amount transmitting unit 405, configured to transmit a frequency adjustment amount to the local frequency reference source, for controlling the local frequency reference source to implement adjustment of the local reference signal.
According to the embodiment, the third clock difference sequence is obtained by adopting the satellite common view comparison method, and the clock difference sequence is subjected to outlier rejection and filtering, so that the problems of low stability caused by short data interval of the existing Beidou or GPS and large data jitter and low accuracy caused by imperfect model constructed due to influences on atmospheric transmission, satellite orbit and the like are solved, the clock taming of low-jitter and long-interval data can be realized, higher stability can be brought, the influence caused by multipath of a satellite system and the environment can be effectively weakened, and the accuracy is improved.
The existing Beidou or GPS tame clock generally adopts the interval of 1 second of Beidou or GPS data to carry out clock tame, and the method provided by the invention can adopt the data interval of 16 minutes (according to the common view data CGGTTS format standard) to carry out clock tame; and experiments prove that the stability of the output frequency can reach 5x10 < -14 > (day stability), and the accuracy of the output time can reach 5ns (95%).
The present invention also provides a computer-readable storage medium storing one or more programs which when executed by one or more processors implement any of the methods of clock taming described above.
The invention has been described with reference to a few embodiments. However, as is well known to those skilled in the art, other embodiments than the above disclosed invention are equally possible within the scope of the invention, as defined by the appended patent claims.
Generally, all terms used in the claims are to be interpreted according to their ordinary meaning in the technical field, unless explicitly defined otherwise therein. All references to "a/an/the [ means, component, etc. ]" are to be interpreted openly as referring to at least one instance of said means, component, etc., unless explicitly stated otherwise. The steps of any method disclosed herein do not have to be performed in the exact order disclosed, unless explicitly stated.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Finally, it should be noted that: the above embodiments are only for illustrating the technical aspects of the present invention and not for limiting the same, and although the present invention has been described in detail with reference to the above embodiments, it should be understood by those of ordinary skill in the art that: modifications and equivalents may be made to the specific embodiments of the invention without departing from the spirit and scope of the invention, which is intended to be covered by the claims.

Claims (16)

1. A method of clock taming, the method comprising:
acquiring a third clock difference sequence of each sampling time in a preset time period, wherein the third clock difference sequence is a time deviation sequence obtained by comparing a local frequency reference source with a frequency reference center by adopting a satellite common-view comparison method;
Removing and filtering abnormal values of a third clock difference sequence of each sampling time in the preset time period to obtain clock difference adjustment information;
Obtaining a frequency deviation amount between the local frequency reference source and the frequency reference center based on the clock difference adjustment information;
obtaining the frequency adjustment quantity of the local frequency reference source according to the frequency deviation quantity;
transmitting the frequency adjustment amount to the local frequency reference source for controlling the local frequency reference source to adjust a local reference signal;
The step of removing and filtering the outlier of the third clock difference sequence of each sampling time within the preset time period to obtain clock difference adjustment information includes:
adopting an outlier rejection algorithm to reject outliers of the third clock difference sequence at each sampling moment in the preset time period;
Calculating a weighted average value of a third clock difference sequence after the abnormal value of each sampling moment is removed in the preset time period, and obtaining a clock difference result of each sampling moment in the preset time period;
carrying out Kalman filtering on the clock difference result of each sampling time in the preset time period, and calculating the average value of the clock difference result of each sampling time in the preset time period after Kalman filtering to obtain clock difference adjustment information;
the abnormal value removing algorithm is used for removing abnormal values from the third clock difference sequence at each sampling time in the preset time period, and the abnormal value removing algorithm comprises the following steps:
And performing the following rejection operation on the third clock difference sequence of each sampling time in the preset time period:
Selecting a third clock difference sequence { DeltaT 1,…ΔTi,…ΔTn } at the same sampling moment, wherein i=1, 2, …, n, n is the number of common-view satellites, n is more than or equal to 4, and the third clock difference DeltaT i is a time deviation obtained by comparing a local frequency reference source with a frequency reference center by adopting a satellite common-view comparison method relative to an ith common-view satellite;
Sequentially taking j as an integer from 1 to n, eliminating the j-th common-view satellite, and calculating the average value and standard deviation of the third clock difference sequences of the remaining n-1 common-view satellites to obtain n average values AVG i and n first standard deviations STD i, wherein j is more than or equal to 1 and less than or equal to n;
Respectively calculating the standard deviations of n first standard deviations STD i to obtain n second standard deviations STD (STD i);
Judging whether each second standard deviation STD (STD i) is larger than a first preset threshold value or not respectively, if the second standard deviation STD (STD i) which is larger than the first preset threshold value exists, selecting the second standard deviation STD (STD i) with the largest value as an abnormal value, and eliminating the common view satellite corresponding to the abnormal value to form a third clock difference sequence { delta T 1,…ΔTp,…ΔTn-1 }, p=1, 2, …, n-1 after the abnormal value elimination;
Wherein the obtaining the frequency deviation amount between the local frequency reference source and the frequency reference center based on the clock difference adjustment information includes:
based on the clock error adjustment information, a history data fitting algorithm is adopted to obtain clock error fitting information;
based on the clock difference fitting information, a frequency offset between the local frequency reference source and the frequency reference center is calculated using an incremental PID algorithm.
2. The method of claim 1, wherein the obtaining the clock correction fitting information using a historical data fitting algorithm based on the clock correction adjustment information comprises:
The clock difference fitting information Δt Km is calculated using the following formula:
Wherein m is the total amount of observed values; Δt Ki is a variable that affects clock synchronization, including: the clock drift clock difference adjusting information and the temperature change clock difference adjusting information are obtained through fitting historical data, wherein the historical data comprise design indexes and actual verification results.
3. The method according to claim 2, wherein the phase adjustment of the local frequency reference source is obtained by an average Δt Kt of a third sequence of clock differences at the current sampling instant, comprising:
Judging whether the average value delta T Kt of the third clock difference sequence at the current sampling moment is larger than a second preset threshold value, if so, calculating the average value delta T Kt of the third clock difference sequence at the current sampling moment by adopting a rounding function to obtain the phase adjustment quantity of the local frequency reference source; otherwise, the phase adjustment amount of the local frequency reference source is zero.
4. The method of claim 1, wherein the calculating the amount of frequency offset between the local frequency reference source and the frequency reference center using an incremental PID algorithm based on the clock difference fit information comprises:
The frequency deviation delta f (n) between the local frequency reference source and the frequency reference center is calculated by adopting the following formula:
Δf(n)=KPΔTKt-ΔTKm/KI+KD[ΔTKt-ΔTK(t-1)];
Wherein K P、KI、KD is PID adjusting parameter; delta T Kt is the average value of the third sequence of clock differences at the current sampling instant and delta T K(t-1) is the average value of the third sequence of clock differences at the last sampling instant adjacent to the current sampling instant; ΔT Km is the clock difference fitting information.
5. The method of claim 1, wherein said deriving a frequency adjustment of said local frequency reference source from said frequency offset comprises:
and according to the frequency deviation amount, calculating the frequency adjustment amount of the local frequency reference source by adopting a linear function.
6. The method of claim 5, wherein calculating the frequency adjustment of the local frequency reference source using a linear function based on the frequency deviation amount comprises:
The frequency adjustment quantity u (n) of the local frequency reference source is calculated by adopting the following formula:
u(n)=f(Δf(n))=KAΔf(n)+KB
Wherein K A、KB is a frequency reference source parameter; Δf (n) is the frequency deviation amount.
7. A time code monitoring device, the device comprising:
The satellite common view unit is used for receiving the local reference signal sent by the clock taming unit, the satellite signal sent by each common view satellite and the second clock difference sequence sent by the frequency reference center in real time, calculating to obtain a first clock difference sequence according to the local reference signal and each satellite signal, and sending the third clock difference sequence to the clock taming unit in real time and sending the first clock difference sequence to the frequency reference center in real time according to the third clock difference sequence obtained by calculation of the first clock difference sequence and the second clock difference sequence, wherein the second clock difference sequence is a time deviation sequence between the frequency reference center and each common view satellite;
The clock taming unit is used for obtaining a third clock difference sequence of each sampling moment in a preset time period, executing the method as set forth in any one of claims 1-6, receiving a local reference signal sent by a frequency reference source, and respectively sending the local reference signal to the satellite common view unit, the clock output interface and the time signal measuring unit;
The frequency reference source is used for receiving the frequency adjustment quantity sent by the clock taming unit, adjusting the local reference signal according to the frequency adjustment quantity and sending the local reference signal to the clock taming unit;
The clock output interface is used for receiving the local reference signal sent by the clock taming unit, converting the local reference signal into a time code signal matched with a master station of the local power consumption information acquisition system and outputting the converted time code signal;
And the time signal measuring unit is used for receiving the local reference signal sent by the clock taming unit and the master station time signal sent by the master station of the local power consumption information acquisition system, converting the master station time signal into a signal consistent with the local reference signal, calculating the time deviation between the local reference signal and the converted master station time signal, and outputting the time deviation.
8. The apparatus of claim 7, wherein the apparatus further comprises:
the data transmission unit is used for receiving the first clock difference sequence sent by the satellite common view unit, encrypting the first clock difference sequence and then sending the encrypted first clock difference sequence to the frequency reference center, receiving the second clock difference sequence sent by the frequency reference center, decrypting the second clock difference sequence and then sending the decrypted second clock difference sequence to the satellite common view unit.
9. The apparatus of claim 8, wherein the data transmission unit is further configured to:
Sending a connection request to the frequency reference center, and establishing TCP connection;
Acquiring first information and sending the first information to the frequency reference center, wherein the first information comprises: decrypting at least one of a chip serial number, time code monitoring device authentication information and reference center authentication information;
Acquiring a first random number and first signature information provided by an encryption and decryption chip, and sending the first random number and the first signature information to the frequency reference center, wherein the first random number and the first signature information are obtained by updating an application session negotiation calculator through the encryption and decryption chip;
acquiring a second random number and second signature information returned by the frequency reference center, and writing the second random number and the second signature information into the encryption and decryption chip;
Receiving a first clock difference sequence sent by the satellite common view unit or a second clock difference sequence sent by the frequency reference center;
The first clock difference sequence or the second clock difference sequence is sent to an encryption and decryption chip written with the second random number and the second signature information to be encrypted or decrypted, and the encrypted first clock difference sequence or the decrypted second clock difference sequence is obtained;
and sending the encrypted first clock difference sequence or the decrypted second clock difference sequence to the frequency reference center or the satellite common view unit.
10. The apparatus of claim 7, wherein the third sequence of clock differences calculated from the first sequence of clock differences and the second sequence of clock differences comprises:
calculating a third clock difference relative to each common-view satellite to obtain a third clock difference sequence { DeltaT 1,ΔT2,…,ΔTn }, wherein n is the number of the common-view satellites, and n is more than or equal to 4;
The third clock difference Δt i with respect to the ith common view satellite is calculated by the following formula:
ΔTi=TUi-TRi
Where TU i is the first clock difference with respect to the ith co-view satellite and TR i is the second clock difference with respect to the ith co-view satellite.
11. The apparatus of claim 7, wherein the frequency reference source is a rubidium clock or crystal oscillator.
12. The apparatus of claim 9, wherein the encryption and decryption chip is an ESAM chip.
13. A time synchronization system, the system comprising:
a common view satellite for transmitting satellite signals to the frequency reference center and the frequency application center;
The frequency reference center is used for receiving satellite signals sent by the common-view satellite and a first clock difference sequence sent by the frequency application center, calculating to obtain a second clock difference sequence according to the satellite signals and a reference signal of the frequency reference center, and sending the second clock difference sequence to the frequency application center;
The frequency application center comprises a time code monitoring device as claimed in any one of claims 7-12, and is used for carrying out data interaction with the co-vision satellite, the frequency reference center and a power consumption information acquisition system main station;
The power consumption information acquisition system master station is used for transmitting a master station time signal to the frequency application center, receiving a time code signal transmitted by the frequency application center and calibrating the master station time signal based on the time code signal.
14. The system of claim 13, wherein the system further comprises:
the acquisition terminal is used for receiving a master station time signal sent by a master station of the electricity consumption information acquisition system, calibrating the acquisition terminal time signal based on the master station time signal and sending the acquisition terminal time signal to the electric energy meter;
And the electric energy meter is used for receiving the acquisition terminal time signal sent by the acquisition terminal and calibrating the time of the electric energy meter based on the acquisition terminal time signal.
15. A clock taming device, the device comprising:
the third clock difference sequence acquisition unit is used for acquiring a third clock difference sequence of each sampling moment in a preset time period, wherein the third clock difference sequence is a time deviation sequence obtained by comparing a local frequency reference source with a frequency reference center by adopting a satellite common-view comparison method;
The abnormal value removing and filtering unit is used for removing and filtering the abnormal value of the third clock difference sequence of each sampling moment in the preset time period to obtain clock difference adjustment information;
A first unit configured to obtain a frequency deviation amount between the local frequency reference source and the frequency reference center based on the clock difference adjustment information;
a second unit for obtaining a frequency adjustment amount of the local frequency reference source according to the frequency deviation amount;
a frequency adjustment amount transmitting unit for transmitting the frequency adjustment amount to the local frequency reference source for controlling the local frequency reference source to adjust the local reference signal
The outlier rejection and filtering unit is further configured to:
adopting an outlier rejection algorithm to reject outliers of the third clock difference sequence at each sampling moment in the preset time period;
Calculating a weighted average value of a third clock difference sequence after the abnormal value of each sampling moment is removed in the preset time period, and obtaining a clock difference result of each sampling moment in the preset time period;
carrying out Kalman filtering on the clock difference result of each sampling time in the preset time period, and calculating the average value of the clock difference result of each sampling time in the preset time period after Kalman filtering to obtain clock difference adjustment information;
the abnormal value removing algorithm is used for removing abnormal values from the third clock difference sequence at each sampling time in the preset time period, and the abnormal value removing algorithm comprises the following steps:
And performing the following rejection operation on the third clock difference sequence of each sampling time in the preset time period:
Selecting a third clock difference sequence { DeltaT 1,…ΔTi,…ΔTn } at the same sampling moment, wherein i=1, 2, …, n, n is the number of common-view satellites, n is more than or equal to 4, and the third clock difference DeltaT i is a time deviation obtained by comparing a local frequency reference source with a frequency reference center by adopting a satellite common-view comparison method relative to an ith common-view satellite;
Sequentially taking j as an integer from 1 to n, eliminating the j-th common-view satellite, and calculating the average value and standard deviation of the third clock difference sequences of the remaining n-1 common-view satellites to obtain n average values AVG i and n first standard deviations STD i, wherein j is more than or equal to 1 and less than or equal to n;
Respectively calculating the standard deviations of n first standard deviations STD i to obtain n second standard deviations STD (STD i);
Judging whether each second standard deviation STD (STD i) is larger than a first preset threshold value or not respectively, if the second standard deviation STD (STD i) which is larger than the first preset threshold value exists, selecting the second standard deviation STD (STD i) with the largest value as an abnormal value, and eliminating the common view satellite corresponding to the abnormal value to form a third clock difference sequence { delta T 1,…ΔTp,…ΔTn-1 }, p=1, 2, …, n-1 after the abnormal value elimination;
wherein the first unit is further configured to:
based on the clock error adjustment information, a history data fitting algorithm is adopted to obtain clock error fitting information;
based on the clock difference fitting information, a frequency offset between the local frequency reference source and the frequency reference center is calculated using an incremental PID algorithm.
16. A computer readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any of claims 1-6.
CN202111337307.7A 2021-11-12 2021-11-12 Clock taming method, time code monitoring device and time synchronization system Active CN113992296B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111337307.7A CN113992296B (en) 2021-11-12 2021-11-12 Clock taming method, time code monitoring device and time synchronization system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111337307.7A CN113992296B (en) 2021-11-12 2021-11-12 Clock taming method, time code monitoring device and time synchronization system

Publications (2)

Publication Number Publication Date
CN113992296A CN113992296A (en) 2022-01-28
CN113992296B true CN113992296B (en) 2024-05-28

Family

ID=79748137

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111337307.7A Active CN113992296B (en) 2021-11-12 2021-11-12 Clock taming method, time code monitoring device and time synchronization system

Country Status (1)

Country Link
CN (1) CN113992296B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115733489B (en) * 2022-11-25 2024-01-05 中科启迪光电子科技(广州)有限公司 Chip atomic clock taming method, device and system
CN115657448B (en) * 2022-12-09 2023-03-28 电信科学技术第五研究所有限公司 Frequency offset analysis method for clock discipline

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012062207A1 (en) * 2010-11-11 2012-05-18 国网电力科学研究院 Standard frequency and time adjusting method based on rubidium oscillator
CN103226324A (en) * 2013-03-06 2013-07-31 中国计量科学研究院 High-precision time-frequency source capable of being tamed to time-frequency standard in real time
CN113514858A (en) * 2021-04-14 2021-10-19 星汉时空科技(长沙)有限公司 Common-view time synchronization method and device based on satellite navigation

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012062207A1 (en) * 2010-11-11 2012-05-18 国网电力科学研究院 Standard frequency and time adjusting method based on rubidium oscillator
CN103226324A (en) * 2013-03-06 2013-07-31 中国计量科学研究院 High-precision time-frequency source capable of being tamed to time-frequency standard in real time
CN113514858A (en) * 2021-04-14 2021-10-19 星汉时空科技(长沙)有限公司 Common-view time synchronization method and device based on satellite navigation

Also Published As

Publication number Publication date
CN113992296A (en) 2022-01-28

Similar Documents

Publication Publication Date Title
CN113992296B (en) Clock taming method, time code monitoring device and time synchronization system
CN1918940B (en) System and method for maintaining a common sense of time on a network segment
Johannessen Time synchronization in a local area network
US9425652B2 (en) Adaptive holdover timing error estimation and correction
Cena et al. Synchronize your watches: Part I: General-purpose solutions for distributed real-time control
Ingram et al. Performance analysis of PTP components for IEC 61850 process bus applications
CN102004441B (en) Adaptive crystal oscillator frequency timekeeping method
EP2365651A2 (en) System and method for providing time synchronization
CN109302255B (en) Time synchronization control method, device and system and computer readable storage medium
CN106773635A (en) A kind of time service precision detecting system and implementation method
US20150098492A1 (en) Method and Master Clock for Generating Fail-Silent Synchronization Messages
CN116125512A (en) PPP self-adaptive clock difference model estimation method considering clock frequency time-varying characteristics
CN109100927B (en) Time autonomous synchronization method of time unified system under traceless reference condition
Idehen et al. An emulation environment for prototyping PMU data errors
CN202759413U (en) An on-line time error correcting system based on a satellite and a constant temperature crystal oscillator
CN110958071B (en) Electronic transformer clock error self-calibration system and method based on 4G module
CN115639743A (en) Space-based time reference establishing method and system based on whole network time comparison
JP6196765B2 (en) Communication device, time control method, and program
CN113514858A (en) Common-view time synchronization method and device based on satellite navigation
CN112213541A (en) Time keeping method applied to transient recording type fault indicator
CN104092509A (en) Time data processing method, device and system
CN111917503A (en) Method and apparatus for providing a clock signal
Peng et al. Maximum allowable equivalent delay bound of networked control systems
Castello et al. Low-cost implementation and characterization of an active phasor data concentrator
US20240210899A1 (en) Synchronization with multiple time sources

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