CN109188335B - System and method for detecting clock deviation of electric energy meter - Google Patents

System and method for detecting clock deviation of electric energy meter Download PDF

Info

Publication number
CN109188335B
CN109188335B CN201810922809.8A CN201810922809A CN109188335B CN 109188335 B CN109188335 B CN 109188335B CN 201810922809 A CN201810922809 A CN 201810922809A CN 109188335 B CN109188335 B CN 109188335B
Authority
CN
China
Prior art keywords
count value
electric energy
energy meter
clock
reference signal
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
CN201810922809.8A
Other languages
Chinese (zh)
Other versions
CN109188335A (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.)
Sichuan Tongliyuan Electric Power Technology Co ltd
Original Assignee
Sichuan Tongliyuan Electric Power Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sichuan Tongliyuan Electric Power Technology Co ltd filed Critical Sichuan Tongliyuan Electric Power Technology Co ltd
Priority to CN201810922809.8A priority Critical patent/CN109188335B/en
Publication of CN109188335A publication Critical patent/CN109188335A/en
Application granted granted Critical
Publication of CN109188335B publication Critical patent/CN109188335B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R35/00Testing or calibrating of apparatus covered by the other groups of this subclass
    • G01R35/04Testing or calibrating of apparatus covered by the other groups of this subclass of instruments for measuring time integral of power or current

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Oscillators With Electromechanical Resonators (AREA)
  • Electric Clocks (AREA)

Abstract

The invention belongs to the technical field of electric energy meters, and provides a system and a method for detecting clock deviation of an electric energy meter. The system comprises: the GPS module is used for sending a PPS reference signal to the control module; the crystal oscillator module is used for sending an oscillation reference signal to the control module; and the control module is used for counting the PPS reference signal within a preset time period to obtain a first count value, counting a clock output signal of the electric energy meter according to the oscillation reference signal to obtain a second count value, and determining the clock deviation of the electric energy meter according to the first count value and the second count value. The invention can realize rapid detection of clock deviation of the electric energy meter, has high detection precision and reduces detection cost.

Description

System and method for detecting clock deviation of electric energy meter
Technical Field
The invention belongs to the technical field of electric energy meters, and particularly relates to a system and a method for detecting clock deviation of an electric energy meter.
Background
In recent years, with the increasing of the construction strength of the smart grid by the nation, the number of the smart electric energy meters increases explosively, so that manufacturers face great production and delivery pressure, and the detection of clock signal deviation of the electric energy meters is a key link for factory detection of the electric energy meters.
At present, each electric energy meter manufacturer mainly detects the deviation of a clock output signal of an electric energy meter through a frequency meter, the requirement of a national power grid on the clock error of the electric energy meter is less than 0.5S every day, the precision of the frequency meter is required to be in the level of 0.1PPM (Pulse Per minute), but the existing low-end frequency meter cannot meet the requirement of signal precision, so that the detection precision is reduced; and most frequency meters need longer preheating time during detection, so that the detection time of the electric energy meter is long, and the detection efficiency is reduced.
Disclosure of Invention
In view of this, the invention provides a system and a method for detecting clock skew of an electric energy meter, which aim to solve the problems of low skew detection precision and long detection time of the electric energy meter in the prior art.
A first aspect of an embodiment of the present invention provides a system for detecting clock skew of an electric energy meter, including: a GPS (Global Positioning System) module, a crystal oscillator module, and a control module;
the GPS module is used for sending a Pulse Per Second (PPS) reference signal to the control module;
the crystal oscillator module is used for sending an oscillation reference signal to the control module;
the control module is used for counting the PPS reference signal within a preset time period to obtain a first count value, counting a clock output signal of the electric energy meter according to the oscillation reference signal to obtain a second count value, and determining the clock deviation of the electric energy meter according to the first count value and the second count value.
Optionally, the control module is specifically configured to:
calibrating the frequency of the oscillation reference signal according to the PPS reference signal to obtain a first reference signal;
counting the PPS reference signal within a preset time period to obtain a first count value, and counting a clock output signal of the electric energy meter according to the first reference signal to obtain a second count value;
and determining the clock deviation of the electric energy meter according to the first counting value and the second counting value.
Optionally, the control module includes a control unit, a counting unit and a judging unit;
the control unit is used for controlling the counting unit to count within the preset time period;
the counting unit is used for counting the PPS reference signal to obtain a first counting value, and counting a clock output signal of the electric energy meter according to the oscillation reference signal to obtain a second counting value;
the judging unit is used for determining the clock deviation of the electric energy meter according to the first counting value and the second counting value.
Optionally, the determining unit is specifically configured to:
obtaining a clock error of the electric energy meter according to the first counting value and the second counting value;
judging whether the clock error exceeds a standard error range;
and if the clock error exceeds the standard error range, determining that the clock of the electric energy meter has deviation.
Optionally, the obtaining of the clock error of the electric energy meter according to the first count value and the second count value specifically includes:
Figure BDA0001764669960000021
wherein E is the clock error, M is the first count value, and N is the second count value.
Optionally, the control module is further configured to:
acquiring a preset count value obtained by counting the PPS reference signal within the preset time period;
judging whether the difference value of the preset count value and the standard count value is within an allowable difference value range;
and if the difference value between the preset count value and the standard count value is within the allowable difference value range, determining the preset count value as the first count value.
A second aspect of the embodiments of the present invention provides a method for detecting clock skew of an electric energy meter, which is applicable to an electric energy meter clock skew detection system including a GPS module, a crystal oscillator module, and a control module, and the method includes:
the GPS module sends a PPS reference signal to the control module;
the crystal oscillator module sends an oscillation reference signal to the control module;
in a preset time period, the control module counts the PPS reference signal to obtain a first count value, and counts a clock output signal of the electric energy meter according to the oscillation reference signal to obtain a second count value;
the control module determines the clock deviation of the electric energy meter according to the first counting value and the second counting value.
Optionally, the counting the clock output signal of the electric energy meter according to the oscillation reference signal to obtain a second count value specifically includes:
calibrating the frequency of the oscillation reference signal according to the PPS reference signal to obtain a first reference signal;
and counting the clock output signal of the electric energy meter according to the first reference signal within a preset time period to obtain the second count value.
Optionally, the determining the clock deviation of the electric energy meter according to the first count value and the second count value specifically includes:
obtaining a clock error of the electric energy meter according to the first counting value and the second counting value;
judging whether the clock error exceeds a standard error range;
and if the clock error exceeds the standard error range, determining that the clock of the electric energy meter has deviation.
Optionally, the method further includes:
the control module acquires a preset count value obtained by counting the PPS reference signal within the preset time period;
judging whether the difference value of the preset count value and the standard count value is within an allowable difference value range;
and if the difference value between the preset count value and the standard count value is within the allowable difference value range, determining the preset count value as the first count value.
Compared with the prior art, the system and the method for detecting the clock deviation of the electric energy meter in the embodiment of the invention have the beneficial effects that: the PPS reference signal of the GPS module provides a high-precision check signal for the detection of the electric energy meter, so that the detection precision is high; the crystal oscillator module does not need to be preheated in advance, can directly provide an oscillation reference signal, saves the time for detecting the clock deviation of the electric energy meter, and reduces the cost; and finally, the control module determines the clock deviation of the electric energy meter according to the first count value of the PPS reference signal and the second count value of the clock output signal of the electric energy meter, so that the clock deviation of the electric energy meter can be quickly detected, and the detection efficiency is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a schematic structural diagram of a clock deviation detecting system of an electric energy meter according to an embodiment of the present invention;
fig. 2 is a schematic flow chart illustrating an implementation of a clock deviation detecting method for an electric energy meter according to a second embodiment of the present invention;
fig. 3 is a schematic flowchart of an implementation of step 203 in fig. 2 according to a second embodiment of the present invention;
fig. 4 is a flowchart illustrating an implementation of step 204 in fig. 2 according to a second embodiment of the present invention;
fig. 5 is a schematic flow chart illustrating an implementation of another electric energy meter clock deviation detecting method according to a second embodiment of the present invention.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.
In order to explain the technical means of the present invention, the following description will be given by way of specific examples.
Example one
Referring to fig. 1, the system for detecting clock skew of an electric energy meter according to an embodiment of the present invention includes a GPS module 100, a crystal oscillator module 200, and a control module 300.
The GPS module 100 is connected to the control module 300, the crystal oscillator module 200 is connected to the control module 300, and the control module 300 is connected to the electric energy meter through a connecting clamp.
The GPS module 100 is configured to send a pulse-per-second PPS reference signal to the control module 300.
The crystal oscillator module 200 is configured to send an oscillation reference signal to the control module 300.
The control module 300 is configured to count the PPS reference signal within a preset time period to obtain a first count value, count a clock output signal of the electric energy meter according to the oscillation reference signal to obtain a second count value, and determine a clock offset of the electric energy meter according to the first count value and the second count value.
Alternatively, the PPS reference signal may be a 1PPS signal. Here, 1PPS is 1 Hz/sec, that is, 1PPS signal is once per second, and the period of the 1PPS signal is once per second, but the width of the 1PPS signal is not limited in this embodiment, and the width of the 1PPS signal may be a millisecond or nanosecond pulse width.
In specific application, after the control module 300 is connected with the electric energy meter through the connecting clamp, the GPS module 100, the crystal oscillator module 200 and the control module 300 are started according to user input. The GPS module 100 sends a pulse per second PPS reference signal to the control module 300, the crystal oscillator module 200 sends an oscillation reference signal to the control module 300, and the electric energy meter sends a clock output signal to the control module 300. Then, the control module 300 counts the PPS reference signal within a preset time period to obtain a first count value, and the control module 300 counts a clock output signal of the electric energy meter according to the oscillation reference signal within the preset time period to obtain a second count value; finally, the control module 300 determines the clock offset of the electric energy meter according to the first count value and the second count value.
The control module 300 may count the PPS reference signal and count the clock output signal of the electric energy meter asynchronously, and the time period for counting the PPS reference signal and the time period for counting the clock output signal of the electric energy meter are both the preset time periods, so that the clock skew of the electric energy meter is not limited by signal synchronization, and the detection time is faster.
The GPS module 100 is an integrated circuit formed by integrating a radio frequency chip, a baseband chip, and a CPU (Central Processing Unit), and associated peripheral circuits, and is used for satellite positioning and calibration. The PPS reference signal sent by the GPS module 100 can easily achieve a pulse width of 20nS level, namely 0.02PPM, which is much higher than 0.1PPM required by clock detection of the electric energy meter, and can be used as a standard signal source; in addition, the GPS module 100 has good long-term frequency stability and almost no accumulated error when the signal is good, and can provide a high-precision PPS reference signal to improve the precision of detecting the clock skew of the electric energy meter.
The crystal oscillator module in the embodiment is a common active oscillator and does not need constant temperature treatment. The starting speed of the common active oscillator is higher than that of a constant-temperature crystal oscillator, and the common active oscillator has good short-term frequency stability, so that the speed of detecting the deviation of the electric energy meter is increased, and the detection efficiency is improved.
The electric energy meter clock deviation detection system provides a high-precision check signal for the detection of the electric energy meter through the PPS reference signal of the GPS module 100, so that the detection precision is high; the crystal oscillator module 200 can directly provide an oscillation reference signal without preheating in advance, so that the time for detecting the clock deviation of the electric energy meter is saved, and the cost is reduced; and finally, the control module 300 determines the clock deviation of the electric energy meter according to the first count value of the PPS reference signal and the second count value of the clock output signal of the electric energy meter, so that the clock deviation of the electric energy meter can be quickly detected, and the detection efficiency is improved.
In another embodiment, the GPS module 100 may be a specific GPS chip, such as a SYN100mhz GPS phase lock board, which has the advantages of optimal performance, high sensitivity, reduced start time, and fast entering into an application state. The SYN100mhz gps phase-locked board is connected to the control module 300 through a first serial interface.
In this embodiment, a specific chip structure of the GPS module 100 is not limited, and other GPS chips, such as a GPS time service card, which can transmit the PPS reference signal to the control module 100 may also be used.
In another embodiment, the control module 300 is an MCU.
The MCU is also called a Single Chip Microcomputer (MCU) or a Single Chip Microcomputer (MCU), which properly reduces the frequency and specification of a Central Processing Unit (CPU), and integrates a Memory (Memory), a counter (Timer), a USB (Universal Serial Bus), an Analog/Digital (a/D) converter, a UART (Universal Asynchronous Receiver/Transmitter), a programmable logic controller (plc), a Direct Memory Access (DMA), and other peripheral interfaces, and even an LCD (Liquid Crystal Display) driving circuit on a Single Chip to form a hierarchical computer, thereby performing different combination control for different application occasions.
Alternatively, the control module 300 may be a STM32F series chip. The STM32F series chip has the characteristics of high performance, low cost and low power consumption, reduces the cost of the electric energy meter clock detection equipment and improves the performance of the electric energy meter clock detection equipment.
In another embodiment, the control module 300 is specifically configured to:
and calibrating the frequency of the oscillation reference signal according to the PPS reference signal to obtain a first reference signal.
In practical applications, the oscillation reference signal sent by the crystal oscillator module 200 to the control module 300 cannot directly count the clock output signal of the electric energy meter, but needs to be calibrated to a certain extent and then count the clock output signal of the electric energy meter by using the calibrated reference signal after meeting the calibration frequency. For example, the frequency of the oscillation reference signal transmitted by the crystal oscillator module 200 may be too low, the accuracy of counting the clock output signal of the electric energy meter may be insufficient, and the control module 300 may possibly lack the count.
Therefore, in this embodiment, the PPS reference signal sent by the GPS module 100 is firstly used to calibrate the oscillation reference signal, and the control module 300 calibrates the frequency of the oscillation reference signal to obtain the first reference signal, so as to increase the frequency of the oscillation reference signal, improve the precision of the oscillation reference signal, and further increase the accuracy of counting the clock output signal of the electric energy meter.
And counting the PPS reference signal within a preset time period to obtain a first count value, and counting a clock output signal of the electric energy meter according to the first reference signal to obtain a second count value.
Illustratively, the PPS reference signal is a 1PPS signal, the preset time period is 10 minutes, the control module 300 counts the 1PPS signal for 10 minutes to obtain a first count value, at this time, the 1PPS signal calibrates the oscillation reference signal sent by the crystal oscillator module 200 to obtain a first reference signal, and then the control module 300 counts the clock output signal of the electric energy meter for 10 minutes according to the first reference signal to obtain a second count value.
Illustratively, the PPS reference signal is a 1PPS signal, the preset time period is 5 minutes, the control module 300 counts the 1PPS signal for 5 minutes to obtain a first count value, then the control module 300 calibrates the oscillation reference signal sent by the crystal oscillator module 200 according to the 1PPS signal to obtain a first reference signal, and finally the control module 300 counts the clock output signal of the electric energy meter for ten minutes according to the first reference signal to obtain a second count value.
Illustratively, the PPS reference signal is a 1PPS signal, the preset time period is 3 minutes, the control module 300 firstly calibrates the oscillation reference signal sent by the crystal oscillator module 200 through the 1PPS signal of the GPS module 100 to obtain a first reference signal, and then the control module 300 may simultaneously count the 1PPS signal for 3 minutes to obtain a first count value, and count the clock output signal of the electric energy meter for 3 minutes according to the first reference signal to obtain a second count value.
Optionally, the control module 300 is further configured to store the first count value and the second count value.
Illustratively, after the control module 300 counts the PPS reference signal for a preset time period to obtain a first count value, the first count value is stored, after a period of time, the electric energy meter can send a clock output signal, the control module 300 calibrates the oscillation reference signal sent by the crystal oscillator module 200 through the PPS reference signal to obtain the first reference signal, then counts the clock output signal of the electric energy meter for the preset time period according to the first reference signal to obtain a second count value, and stores the second count value.
And storing the first count value and the second count value to realize asynchronous counting of the PPS reference signal and the clock output signal of the electric energy meter. For example, after counting the clock output signal of the electric energy meter according to the first reference signal, the stored first count value may be obtained again, and the clock deviation of the electric energy meter may be determined according to the first count value and the second count value.
And determining the clock deviation of the electric energy meter according to the first counting value and the second counting value.
For example, the first count value and the second count value are compared, when the first count value is greater than or less than the second count value, it is determined that the clock skew exists in the electric energy meter, and when the first count value is equal to the second count value, the clock skew does not exist in the electric energy meter. For example, within 5 minutes, the first counting value is 300 times, the second counting value is 290 times, the first counting value is larger than the second counting value, and it is determined that the clock deviation exists in the electric energy meter; for example, within 3 minutes, the first count value is 180 times, the second count value is 200 times, and the first count value is smaller than the second count value, so that the clock deviation of the electric energy meter is determined; for example, within 10 minutes, the first count value is 600 times, the second count value is 600 times, and the first count value is equal to the second count value, then there is no clock skew in the electric energy meter.
For example, a difference value between the first count value and the second count value is calculated, whether the difference value is within an allowable difference value range is determined, if the difference value is within the allowable difference value range, the clock deviation does not exist in the electric energy meter, and if the difference value is not within the allowable difference value range, the clock deviation exists in the electric energy meter. For example, within 5 minutes, if the first counting value is 300 times, the second counting value is 290 times, the difference value between the first counting value and the second counting value is 10, and the allowable difference value range is (-5, 5), it is determined that the clock deviation exists in the electric energy meter; for example, within 3 minutes, the first count value is 181 times, the second count value is 185 times, the difference value between the first count value and the second count value is-4, and the allowable difference value range is (-5, 5), it is determined that there is no clock skew in the electric energy meter.
In another embodiment, the control module 300 includes a control unit 310, a counting unit 320, and a judging unit 330.
The control unit 310 is configured to control the counting unit 320 to count within the preset time period.
The counting unit 320 is configured to count the PPS reference signal to obtain a first count value, and count a clock output signal of the electric energy meter according to the oscillation reference signal to obtain a second count value.
The determining unit 330 is configured to determine a clock offset of the electric energy meter according to the first count value and the second count value.
The counting unit 320 includes at least two signal input terminals, which respectively receive the PPS reference signal and the clock output signal of the power meter. The control unit 310 receives the oscillation reference signal of the crystal module 200 and transmits the oscillation reference signal to the counting unit 320.
Optionally, the control module 300 further receives a driving signal sent by the crystal module 200, and the control module 300 controls the control unit 310, the counting unit 320, and the determining unit 330 to operate according to the driving signal, that is, the crystal module 200 is also used as a driving signal source of the control module 300.
In another embodiment, the counting unit 320 is specifically configured to:
and calibrating the frequency of the oscillation reference signal according to the PPS reference signal to obtain a first reference signal.
And counting the PPS reference signal within a preset time period to obtain a first count value, and counting a clock output signal of the electric energy meter according to the first reference signal to obtain a second count value.
In another example, the determining unit 330 is specifically configured to:
and obtaining the clock error of the electric energy meter according to the first counting value and the second counting value.
In practical application, most of first count values obtained by counting the PPS reference signals and second count values obtained by counting clock output signals of the electric energy meter are not completely equal, if the first count values and the second count values are simply compared, the clock deviation of the electric energy meter is judged according to the comparison result, so that a large batch of electric energy meters are possibly unqualified, and the false detection rate is increased. Moreover, the electric energy meter in practical application has certain error, and the electric energy meter is qualified as long as the error is within the allowable error range. Therefore, the false detection rate can be reduced by using the allowable error range of the electric energy meter as the judgment condition.
Illustratively, the first count value and the second count value are subtracted to obtain a difference value, and an absolute value of the difference value is used as the clock error. For example, in 5 minutes, the first count value is 300 times, the second count value is 290 times, the difference between the first count value and the second count value is 10, and the absolute value of the difference is 10, then 10 is taken as the clock error; for example, within 3 minutes, the first count value is 181 times, the second count value is 185 times, the difference between the first count value and the second count value is-4, and the absolute value of the difference is 4, then 4 is taken as the clock error.
Illustratively, calculating a clock error rate of the electric energy meter according to the first counting value and the second counting value, and taking the clock error rate as the clock error; namely, it is
Figure BDA0001764669960000111
Wherein M is the first count value and N is the second count value. For example, within 3 minutes, the first count value is 180 times, the second count value is 200 times, and the
Figure BDA0001764669960000112
Figure BDA0001764669960000113
I.e. 10% as the clock error; for example, the first count value is 610 times in 10 minutes, and the number of times is countedThe second count value is 600 times, the
Figure BDA0001764669960000114
Figure BDA0001764669960000115
I.e. 1.33% as the clock error.
And judging whether the clock error exceeds a standard error range.
For example, the first count value and the second count value are subtracted to obtain a difference value, and the absolute value of the difference value is taken as the clock error, so that the standard error range may be < 8.
For example, if the clock error rate of the power meter is calculated according to the first count value and the second count value, and the clock error rate is taken as the clock error, the standard error range may be < 5%.
And if the clock error exceeds the standard error range, determining that the clock of the electric energy meter has deviation.
For example, the first count value and the second count value are subtracted to obtain a difference value, an absolute value of the difference value is taken as the clock error, a standard error range may be <8, and if the clock error exceeds the standard error range, it is determined that there is a clock deviation of the electric energy meter. For example, within 5 minutes, the first count value is 300 times, the second count value is 290 times, and the absolute value of the difference between the first count value and the second count value is 10, then 10 is taken as the clock error, and the standard error range is <8, it can be known that the clock error exceeds the standard error range, then it is determined that the clock of the electric energy meter has a deviation; for example, within 3 minutes, the first count value is 181 times, the second count value is 185 times, and the absolute value of the difference between the first count value and the second count value is 4, it is known that the clock error does not exceed the standard error range, and it is determined that there is no deviation in the clock of the electric energy meter.
Illustratively, the clock error rate of the electric energy meter is calculated according to the first counting value and the second counting value, and the clock error rate is taken as the clock error rateThe clock error, then the standard error range may be<And 5%, if the clock error exceeds the standard error range, determining that the clock of the electric energy meter has deviation. For example, within 3 minutes, the first count value is 180 times, the second count value is 200 times, and the
Figure BDA0001764669960000121
Figure BDA0001764669960000122
Due to the standard error range<5%, determining that the clock of the electric energy meter has deviation if the clock error exceeds a standard error range; for example, within 10 minutes, if the first count value is 610 times, the second count value is 600 times, and the clock error is 1.33%, it is known that the clock error does not exceed the standard error range, it is determined that there is no deviation in the clock of the electric energy meter.
In another example, the obtaining of the clock error of the electric energy meter according to the first count value and the second count value specifically includes:
Figure BDA0001764669960000123
wherein E is the clock error, M is the first count value, and N is the second count value.
Illustratively, the first count value is 180 times, the second count value is 200 times, and the clock error is less than or equal to a predetermined value within 3 minutes
Figure BDA0001764669960000124
For example, the first count value is 610 times, the second count value is 600 times, and the clock error is measured in 10 minutes
Figure BDA0001764669960000125
Illustratively, the standard error range is set to < 0.05. For example, within 3 minutes, the first count value is 180 times, the second count value is 200 times, the clock error E is 0.1, and since the standard error range is set to be <0.05, it is known that the clock error exceeds the standard error range, it is determined that there is a deviation in the clock of the electric energy meter; for example, in 10 minutes, if the first count value is 610 times, the second count value is 600 times, and the clock error is 0.013, it is known that the clock error does not exceed the standard error range, it is determined that there is no deviation in the clock of the electric energy meter.
The clock error of the electric energy meter is determined by the first counting value and the second counting value, the absolute value of the difference value between the first counting value and the second counting value can be used as the clock error, the error rate can be calculated according to the first counting value and the second counting value and can be used as the clock error, and a formula can be used for calculating the error rate according to the formula
Figure BDA0001764669960000126
The clock errors are obtained, and compared with the method for judging whether the clock of the electric energy meter has the deviation or not by simply comparing the first counting value with the second counting value, the clock errors are more accurate, the error rate of detecting the electric energy meter is reduced, and the detection precision of the clock deviation of the electric energy meter is improved.
In another example, the control module 300 is further configured to:
and acquiring a preset count value obtained by counting the PPS reference signal within the preset time period.
In practical applications, the PPS reference signal sent by the GPS module 100 may be unstable for a short time, so that the control module 300 may not count the PPS reference signal normally, and the obtained first count value is too large or too small, which is not practical. In order to improve the detection precision and accuracy of the clock deviation of the electric energy meter, the control module 300 of this embodiment first performs rationality screening on the count obtained through the PPS reference signal, and eliminates the false count caused by the GPS short-term instability, that is, first obtains a preset count value obtained by counting the PPS reference signal within a preset time period, and then determines the preset count value.
And judging whether the difference value of the preset count value and the standard count value is within an allowable difference value range.
And if the difference value between the preset count value and the standard count value is within the allowable difference value range, determining the preset count value as the first count value.
Illustratively, the PPS reference signal may be a 1PPS signal, the preset time period may be 3 minutes, and the allowable difference range may be (-8, 8). Specifically, a preset count value obtained by counting 1PPS signal for 3 minutes is obtained, for example, the preset count value is 175, the standard count value is 180, and the difference between the preset count value and the standard count value is-5, it can be known that-5 is within the allowable difference range, that is, the current preset count value is the first count value.
Illustratively, the PPS reference signal is a 1PPS signal, the preset time period may be 2 minutes, and the allowable difference range may be (-5, 5). Specifically, a preset count value obtained by counting 1PPS signal for 2 minutes is obtained, for example, the preset count value is 128, the standard count value is 120, and the difference between the preset count value and the standard count value is 8, it can be known that 8 is not within the allowable difference range, that is, the current preset count value is not in compliance with the condition, and is excluded.
If the difference between the preset count value and the standard count value is not within the allowable difference range, the control module 300 continues to obtain a second preset count value obtained by counting the PPS reference signal within the preset time period.
And judging whether the difference value of the second preset count value and the standard count value is within an allowable difference value range.
And if the difference value between the second preset count value and the standard count value is within the allowable difference value range, determining the second preset count value as the first count value. That is, if the preset count value obtained by counting the PPS reference signal is not qualified, the control module 300 may obtain the preset count value in the preset time period, and perform the determination, knowing that the difference between the preset count value and the standard count value is within the allowable difference range, so as to improve the precision and accuracy of detecting the clock deviation of the electric energy meter.
In the above embodiment, the PPS reference signal of the GPS module 100 provides a high-precision calibration signal for the detection of the electric energy meter, so that the detection precision is high; the crystal oscillator module 200 can directly provide an oscillation reference signal without preheating in advance, so that the time for detecting the clock deviation of the electric energy meter is saved, and the cost is reduced; and finally, the control module 300 determines the clock deviation of the electric energy meter according to the first count value of the PPS reference signal and the second count value of the clock output signal of the electric energy meter, so that the clock deviation of the electric energy meter can be quickly detected, and the detection efficiency is improved.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Example two
Corresponding to the system for detecting clock skew of an electric energy meter in the first embodiment, the present embodiment provides a method for detecting clock skew of an electric energy meter. Referring to fig. 2, a schematic flow chart of an implementation of the method for detecting clock skew of an electric energy meter is provided, which is detailed as follows:
s201, the GPS module sends a Pulse Per Second (PPS) reference signal to the control module.
And S202, the crystal oscillator module sends an oscillation reference signal to the control module.
S203, in a preset time period, the control module counts the PPS reference signal to obtain a first count value, and counts a clock output signal of the electric energy meter according to the oscillation reference signal to obtain a second count value.
The control module can count the PPS reference signal and the clock output signal of the electric energy meter asynchronously, and the time period for counting the PPS reference signal and the time period for counting the clock output signal of the electric energy meter are both the preset time periods, so that the clock deviation for detecting the electric energy meter is not limited by signal synchronization, and the detection time is faster.
In another embodiment, referring to fig. 3, the specific implementation process of counting the clock output signal of the electric energy meter according to the oscillation reference signal to obtain the second count value in step S203 includes:
s301, calibrating the frequency of the oscillation reference signal according to the PPS reference signal to obtain a first reference signal.
In practical application, the oscillation reference signal sent by the crystal oscillator module to the control module cannot directly count the clock output signal of the electric energy meter, but needs to be calibrated to a certain extent, and then counts the clock output signal of the electric energy meter by using the calibrated reference signal after the calibration frequency is met. For example, the frequency of the oscillation reference signal transmitted by the crystal oscillator module may be too low, the accuracy of counting the clock output signal of the electric energy meter is not sufficient, and the control module may not count the number of the clock output signals. Therefore, in this embodiment, the PPS reference signal sent by the GPS module is first used to calibrate the oscillation reference signal, and the control module calibrates the frequency of the oscillation reference signal to obtain the first reference signal.
And S302, counting the clock output signal of the electric energy meter according to the first reference signal within a preset time period to obtain the second count value.
The PPS reference signal sent by the GPS module is firstly utilized to calibrate the oscillation reference signal, so that the frequency of the oscillation reference signal can be increased, the precision of the oscillation reference signal is improved, and the accuracy of counting the clock output signal of the electric energy meter is further improved.
Optionally, the control module is further configured to store the first count value and the second count value.
Illustratively, after the control module counts a PPS reference signal for a preset time period to obtain a first count value, the first count value is stored, after a period of time, the electric energy meter can send a clock output signal, the control module calibrates an oscillation reference signal sent by a crystal oscillator module through the PPS reference signal to obtain the first reference signal, then counts the clock output signal of the electric energy meter for the preset time period according to the first reference signal to obtain a second count value, and the second count value is stored.
And storing the first count value and the second count value to realize asynchronous counting of the PPS reference signal and the clock output signal of the electric energy meter. For example, after counting the clock output signal of the electric energy meter according to the first reference signal, the stored first count value may be obtained again, and the clock deviation of the electric energy meter may be determined according to the first count value and the second count value.
S204, the control module determines the clock deviation of the electric energy meter according to the first counting value and the second counting value.
Referring to fig. 4, in another embodiment, the specific implementation process of determining the clock offset of the electric energy meter according to the first count value and the second count value in step S204 includes:
s401, obtaining the clock error of the electric energy meter according to the first counting value and the second counting value.
In practical application, most of first count values obtained by counting the PPS reference signals and second count values obtained by counting clock output signals of the electric energy meter are not completely equal, if the first count values and the second count values are simply compared, the clock deviation of the electric energy meter is judged according to the comparison result, so that a large batch of electric energy meters are possibly unqualified, and the false detection rate is increased. Moreover, the electric energy meter in practical application has certain error, and the electric energy meter is qualified as long as the error is within the allowable error range. Therefore, the false detection rate can be reduced by using the allowable error range of the electric energy meter as the judgment condition.
Illustratively, the first count value and the second count value are subtracted to obtain a difference value, and an absolute value of the difference value is used as the clock error.
Illustratively, calculating a clock error rate of the electric energy meter according to the first counting value and the second counting value, and taking the clock error rate as the clock error; namely, it is
Figure BDA0001764669960000161
Wherein M is the first count value and N is the second count value.
S402, judging whether the clock error exceeds a standard error range.
And S403, if the clock error exceeds the standard error range, determining that the clock of the electric energy meter has deviation.
In another embodiment, the obtaining the clock error of the electric energy meter according to the first count value and the second count value specifically includes:
Figure BDA0001764669960000162
wherein E is the clock error, M is the first count value, and N is the second count value.
The clock error of the electric energy meter is determined by the first counting value and the second counting value, the absolute value of the difference value between the first counting value and the second counting value can be used as the clock error, the error rate can be calculated according to the first counting value and the second counting value and can be used as the clock error, and a formula can be used for calculating the error rate according to the formula
Figure BDA0001764669960000171
The clock errors are obtained, and compared with the method for judging whether the clock of the electric energy meter has the deviation or not by simply comparing the first counting value with the second counting value, the clock errors are more accurate, the error rate of detecting the electric energy meter is reduced, and the detection precision of the clock deviation of the electric energy meter is improved.
In another example, referring to fig. 5, the method further comprises:
s501, the control module obtains a preset count value obtained by counting the PPS reference signal within the preset time period.
In practical application, the PPS reference signal sent by the GPS module may be unstable for a short time, so that the control module counts the PPS reference signal abnormally, and the obtained first count value is too large or too small, which is not practical. In order to improve the detection precision and accuracy of the clock deviation of the electric energy meter, the control module of the embodiment firstly performs rationality screening on the count obtained through the PPS reference signal, eliminates the false count caused by GPS short-time instability, namely firstly acquires the preset count value obtained by counting the PPS reference signal in the preset time period, and judges the preset count value.
And S502, judging whether the difference value between the preset count value and the standard count value is within an allowable difference value range.
S503, if the difference between the preset count value and the standard count value is within the allowable difference range, determining that the preset count value is the first count value.
And if the difference value between the preset count value and the standard count value is not within the allowable difference value range, the control module continues to acquire a second preset count value obtained by counting the PPS reference signal within the preset time period.
And judging whether the difference value of the second preset count value and the standard count value is within an allowable difference value range.
And if the difference value between the second preset count value and the standard count value is within the allowable difference value range, determining the second preset count value as the first count value. Namely, if the preset count value obtained by counting the PPS reference signal is not qualified all the time, the control module can obtain the preset count value in the preset time period all the time and judge the preset count value, and the difference value between the preset count value and the standard count value is within the allowable difference range, so that the precision and the accuracy of detecting the clock deviation of the electric energy meter are improved.
In the embodiment, the PPS reference signal of the GPS module provides a high-precision check signal for the detection of the electric energy meter, so that the detection precision is high; the crystal oscillator module does not need to be preheated in advance, can directly provide an oscillation reference signal, saves the time for detecting the clock deviation of the electric energy meter, and reduces the cost; and finally, the control module determines the clock deviation of the electric energy meter according to the first count value of the PPS reference signal and the second count value of the clock output signal of the electric energy meter, so that the clock deviation of the electric energy meter can be quickly detected, and the detection efficiency is improved.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided by the present invention, it should be understood that the disclosed system and method can be implemented in other ways. For example, the above-described system embodiments are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

Claims (8)

1. An electric energy meter clock skew detection system, comprising: the system comprises a Global Positioning System (GPS) module, a crystal oscillator module and a control module;
the GPS module is used for sending a PPS reference signal to the control module;
the crystal oscillator module is used for sending an oscillation reference signal to the control module;
the control module comprises a control unit, a counting unit and a judging unit;
the control unit is used for controlling the counting unit to count within a preset time period;
the counting unit is used for respectively obtaining the PPS reference signal in the preset time period to count so as to obtain a first counting value, counting the clock output signal of the electric energy meter according to the oscillation reference signal so as to obtain a second counting value, and asynchronously counting the PPS reference signal and the clock output signal of the electric energy meter;
the judging unit is used for determining the clock deviation of the electric energy meter according to the first counting value and the second counting value.
2. The system of claim 1, wherein the control module is specifically configured to:
calibrating the frequency of the oscillation reference signal according to the PPS reference signal to obtain a first reference signal;
counting the PPS reference signal within a preset time period to obtain a first count value, and counting a clock output signal of the electric energy meter according to the first reference signal to obtain a second count value;
and determining the clock deviation of the electric energy meter according to the first counting value and the second counting value.
3. The system of claim 1, wherein the determining unit is specifically configured to:
obtaining a clock error of the electric energy meter according to the first counting value and the second counting value;
judging whether the clock error exceeds a standard error range;
and if the clock error exceeds the standard error range, determining that the clock of the electric energy meter has deviation.
4. The system according to claim 3, wherein the obtaining the clock error of the electric energy meter according to the first count value and the second count value specifically comprises:
Figure 318432DEST_PATH_IMAGE001
wherein E is the clock error, M is the first count value, and N is the second count value.
5. The power meter clock deviation detection system of any of claims 1 to 4, wherein said control module is further configured to:
acquiring a preset count value obtained by counting the PPS reference signal within the preset time period;
judging whether the difference value of the preset count value and the standard count value is within an allowable difference value range;
and if the difference value between the preset count value and the standard count value is within the allowable difference value range, determining the preset count value as the first count value.
6. A clock deviation detection method of an electric energy meter is suitable for an electric energy meter clock deviation detection system comprising a GPS module, a crystal oscillator module and a control module, wherein the control module comprises a control unit, a counting unit and a judging unit, and is characterized by comprising the following steps:
the GPS module sends a PPS reference signal to the control module;
the crystal oscillator module sends an oscillation reference signal to the control module;
in a preset time period, the control unit controls the counting unit to count;
the counting unit respectively obtains the PPS reference signal within the preset time period to count so as to obtain a first count value, counts the clock output signal of the electric energy meter according to the oscillation reference signal so as to obtain a second count value, and asynchronously counts the PPS reference signal and the clock output signal of the electric energy meter;
the judging unit determines the clock deviation of the electric energy meter according to the first counting value and the second counting value.
7. The method for detecting clock skew of an electric energy meter according to claim 6, wherein the determining the clock skew of the electric energy meter according to the first count value and the second count value specifically comprises:
obtaining a clock error of the electric energy meter according to the first counting value and the second counting value;
judging whether the clock error exceeds a standard error range;
and if the clock error exceeds the standard error range, determining that the clock of the electric energy meter has deviation.
8. The method of detecting clock skew of an electric energy meter according to any of claims 6 or 7, wherein the method further comprises:
the control module is used for acquiring a preset count value obtained by counting the PPS reference signal within the preset time period;
judging whether the difference value of the preset count value and the standard count value is within an allowable difference value range;
and if the difference value between the preset count value and the standard count value is within the allowable difference value range, determining the preset count value as the first count value.
CN201810922809.8A 2018-08-14 2018-08-14 System and method for detecting clock deviation of electric energy meter Active CN109188335B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810922809.8A CN109188335B (en) 2018-08-14 2018-08-14 System and method for detecting clock deviation of electric energy meter

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810922809.8A CN109188335B (en) 2018-08-14 2018-08-14 System and method for detecting clock deviation of electric energy meter

Publications (2)

Publication Number Publication Date
CN109188335A CN109188335A (en) 2019-01-11
CN109188335B true CN109188335B (en) 2022-03-15

Family

ID=64921476

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810922809.8A Active CN109188335B (en) 2018-08-14 2018-08-14 System and method for detecting clock deviation of electric energy meter

Country Status (1)

Country Link
CN (1) CN109188335B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109709394A (en) * 2018-12-21 2019-05-03 深圳市航天泰瑞捷电子有限公司 A kind of system of detection clock of power meter output
CN111580379B (en) * 2020-05-11 2021-10-08 威胜集团有限公司 Time correction method, device and computer readable storage medium
CN112462591B (en) * 2020-12-07 2022-04-12 武汉中原电子信息有限公司 Object-oriented communication protocol-based time synchronization method for electricity utilization acquisition terminal

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102566410A (en) * 2012-02-16 2012-07-11 北京华力创通科技股份有限公司 Method and device for calibrating local clock based on satellite time service
CN103605138A (en) * 2013-07-26 2014-02-26 成都海亨利科技有限公司 Clock correction method and device for satellite navigation receiver

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102291169B (en) * 2011-09-09 2014-04-02 航天东方红卫星有限公司 Onboard high-accuracy time synchronization method for satellite
CN102510320A (en) * 2011-10-28 2012-06-20 桂林电子科技大学 Clock source device based on GPS (global positioning system) and constant-temperature crystal oscillator and synchronous control method
KR101333815B1 (en) * 2012-04-05 2013-11-29 (주) 시스메이트 Apparatus and method for generating stable UTC time data
JP6175775B2 (en) * 2013-01-18 2017-08-09 セイコーエプソン株式会社 Timing signal generating device, electronic device and moving body
EP2770340A1 (en) * 2013-02-21 2014-08-27 Astrium GmbH Positioning by using encrypted GNSS navigation signals
CN105446122B (en) * 2016-01-13 2017-08-11 国家电网公司 Clock of power meter calibration method
CN106130547A (en) * 2016-06-20 2016-11-16 大唐微电子技术有限公司 A kind of clock frequency calibration steps and device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102566410A (en) * 2012-02-16 2012-07-11 北京华力创通科技股份有限公司 Method and device for calibrating local clock based on satellite time service
CN103605138A (en) * 2013-07-26 2014-02-26 成都海亨利科技有限公司 Clock correction method and device for satellite navigation receiver

Also Published As

Publication number Publication date
CN109188335A (en) 2019-01-11

Similar Documents

Publication Publication Date Title
CN109188335B (en) System and method for detecting clock deviation of electric energy meter
EP1585223B1 (en) Method and circuit for determining a slow clock calibration factor
US10042383B2 (en) Navigation system and mouse device
CN107229218A (en) The multiple clock sources correction device and method of a kind of vehicle-mounted TBOX systems
CN105790756B (en) A kind of method and device communicating calibration clock using UART
CN105142210A (en) Synchronous calibration method for real-time clocks of wireless sensor network and sensors
CN101626587A (en) Crystal auto-calibration method and apparatus
CN103955257A (en) Method and device for calibrating system clocks of single chip microcomputers, and air conditioner control system
US11422585B2 (en) Clock calibration
CN108206707B (en) Frequency offset test system and method for power line carrier communication unit
CN113552794A (en) Automatic calibration device and method for clock signal in power chip
CN112511257A (en) Processing method of time service state
CN208984962U (en) Clock of power meter detection device and electric energy meter
CN112099568A (en) Clock frequency calibration and frequency measurement method for UART serial port master-slave communication
CN111510129A (en) Fractional frequency division system and frequency division method for pure digital circuit
CN103024778A (en) Method for improving real-time clock precision on wireless communication terminal
CN110928172B (en) Satellite watch crystal oscillator precision detection method, satellite watch crystal oscillator time keeping method and satellite watch
CN103513698B (en) A kind of clock signal calibration, device and electronic equipment
CN111756462A (en) Time calibration method and device for clock
CN101738930B (en) Method, device and system for setting clock
CN113014372B (en) Baud rate correction hardware device for serial data transmission and design method
CN210895036U (en) Satellite watch with high precision timekeeping function
CN110109342B (en) Crystal oscillator frequency time keeping method and time keeping equipment
US8630386B2 (en) Clock recovery in a battery powered device
CN110113045B (en) High-precision crystal-free self-correction clock system applied to USB slave equipment

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