CN113589006A - Electric energy meter operation clock control method - Google Patents

Electric energy meter operation clock control method Download PDF

Info

Publication number
CN113589006A
CN113589006A CN202110870304.3A CN202110870304A CN113589006A CN 113589006 A CN113589006 A CN 113589006A CN 202110870304 A CN202110870304 A CN 202110870304A CN 113589006 A CN113589006 A CN 113589006A
Authority
CN
China
Prior art keywords
clock
hard
soft
power
executing
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.)
Granted
Application number
CN202110870304.3A
Other languages
Chinese (zh)
Other versions
CN113589006B (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.)
Ningbo Sanxing Medical and Electric Co Ltd
Original Assignee
Ningbo Sanxing Medical and Electric 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 Ningbo Sanxing Medical and Electric Co Ltd filed Critical Ningbo Sanxing Medical and Electric Co Ltd
Priority to CN202110870304.3A priority Critical patent/CN113589006B/en
Publication of CN113589006A publication Critical patent/CN113589006A/en
Application granted granted Critical
Publication of CN113589006B publication Critical patent/CN113589006B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R11/00Electromechanical arrangements for measuring time integral of electric power or current, e.g. of consumption
    • G01R11/02Constructional details
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Electric Clocks (AREA)

Abstract

The invention relates to a clock control method of electric energy meter operation, the method includes the calibration sub-method of the power-on clock and clock calibration sub-method in the course of operation, the calibration sub-method of the power-on clock includes, detect whether the hard clock is legal first, if yes, assign the hard clock to the soft clock, then judge whether soft clock and power down clock after assigning meet the particular condition, if meet, upgrade hard clock and soft clock with the power down clock; if the hard clock is detected illegally, and the number of times of the hard clock is larger than a certain number of times, setting a clock abnormity identifier, then detecting whether the hard clock is legal, and if so, assigning the hard clock to the soft clock. The method can be used for correcting the clock without a third-party tool, is accurate and reliable, can be used for identifying and recording the abnormal events of the clock, and is convenient to trace.

Description

Electric energy meter operation clock control method
Technical Field
The invention relates to the technical field of electric energy meters, in particular to a method for controlling an operation clock of an electric energy meter.
Background
The intelligent electric meter and the electricity utilization information acquisition system are rapidly popularized and applied due to the fact that the market capacity of the intelligent electric meter is suddenly increased due to the rapid development of the intelligent power grid. The intelligent electric meter needs to measure the electric quantity in multiple time intervals and record the related data of the user and the electricity consumption, and the wrong time can cause the problems of wrong rate switching, wrong time of transferring the frozen electric quantity and the like, so that the measurement dispute is generated, the customer complaint is caused, and the intelligent electric meter has strict requirements on the clock accuracy.
In order to improve the accuracy of the clock of the smart meter, the clock of the smart meter needs to be periodically calibrated. In the prior art, a clock calibration method of a smart electric meter includes a method of performing automatic calibration of a meter end by using an RTC or performing calibration by using a third-party tool. Due to the complexity of the service environment of the intelligent electric meter, if the condition of adopting a third-party tool for calibration is not met and the RTC of the meter end is illegal, the calibration mode cannot really play a calibration role, so that the accuracy of the clock of the intelligent electric meter is low, and customer complaints are easily caused.
Disclosure of Invention
In view of the above problems, an object of the present invention is to provide a method for controlling an operation clock of an electric energy meter, which can improve accuracy of a clock of a smart meter and record clock abnormality to improve measurement reliability.
In order to achieve the purpose, the technical scheme of the invention is as follows: a method for controlling an operation clock of an electric energy meter is characterized by comprising the following steps:
the method includes a power-on clock calibration sub-method and an in-flight clock calibration sub-method, the power-on clock calibration sub-method including,
s11, reading a power down clock;
s12, reading a hard clock;
s13, detecting whether the hard clock is legal, if yes, executing S14, and if no, executing S17;
s14, assigning the hard clock to the soft clock;
s15, judging whether the power-down clock is legal, if not, ending, if yes, executing S16;
s16, judging whether the soft clock and the power-down clock meet specific conditions, if so, updating the power-down clock to a hard clock and a soft clock and ending, and if not, ending;
s17, judging whether the error frequency of the hard clock is more than n times, if not, returning to execute S12 after delaying time T, if yes, setting a clock abnormal identifier, and then executing S18;
s18, judging whether the soft clock CRC check is correct, if so, executing S19, otherwise, executing S110;
s19, judging whether the soft clock is legal, if so, executing S15, otherwise, executing S110;
and S110, reading the power-down clock and judging whether the power-down clock is legal or not, if not, assigning specific time and date to the soft clock and ending, and if so, assigning the power-down clock to the soft clock and ending.
Further, the in-process clock calibration sub-method comprises,
s21, judging whether the soft clock reaches the tth second per minute, if not, ending, if yes, executing S22;
s22, reading the hard clock and judging whether the hard clock is legal, if so, assigning the hard clock to the soft clock and ending, otherwise, executing S23;
and S23, judging whether the illegal times of the hard clock are more than N times, if so, setting a clock abnormity identifier, assigning the soft clock to the hard clock, and then ending, otherwise, ending.
Further, the step of determining whether the clock is legal in S13, S15, S19 and S22 includes,
step a, detecting whether a hard clock format is legal or not by adopting a BCD code, if so, executing the step b, and if not, judging that the hard clock format is illegal;
and b, judging whether the time and the date of the hard clock are both legal, if so, judging that the hard clock is legal, and if not, judging that the hard clock is illegal.
Further, the manner of determining whether the soft clock and the power-down clock satisfy the specific condition in S16 is to determine whether the power-down time is greater than the soft clock plus d days, if yes, then the soft clock is satisfied, if not, then the power-down clock plus Y years is continuously determined whether the soft clock is less than the soft clock, if yes, then the soft clock is satisfied, and if not, then the soft clock is not satisfied.
Further, the value of t is 33.
Further, the value of n is 5.
Further, the value of T is 50 ms.
Further, d has a value of 1 and Y has a value of 5.
Further, the specific time and date is 2000, 1, 0, minute and 0 second.
Further, the value of N is 5.
Compared with the prior art, the invention has the advantages that:
when the electric energy meter is powered on, the hard clock is assigned to the soft clock preferentially under the condition that the hard clock is legal, and if the assigned soft clock and the power failure clock meet specific conditions, the power failure time is updated to the hard clock and the soft clock; in the operation process of the electric energy meter, if the hard clock is legal at a specific moment every minute, the hard clock is assigned to the soft clock, and if the illegal times of the hard clock exceed a certain value, the value of the soft clock is assigned to the hard clock, so that the electric energy meter clock calibration can be realized without a third-party tool in the power-on and operation processes, systematic errors are avoided, and the clock accuracy is improved; and when the error of the hard clock exceeds a certain number of times, the conditions such as the time of the error occurrence are recorded, so that the metering reliability is improved, and the tracking analysis is facilitated when the metering divergence occurs, so that the customer complaint problem is conveniently processed.
Drawings
FIG. 1 is a flow chart of an electronic method for powering up a clock according to the present application.
FIG. 2 is a flow chart of a clock sub-method in the process of operation in the present application.
Fig. 3 is a flowchart of clock validity detection in the present application.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the accompanying drawings are illustrative only for the purpose of explaining the present invention, and are not to be construed as limiting the present invention.
Fig. 1 to 3 are flowcharts of a preferred embodiment of the present invention, and as shown in the drawings, the method for controlling a running clock of an electric energy meter includes a power-on clock calibration sub-method and a clock calibration sub-method during running, where the power-on clock calibration sub-method includes the following steps:
s11, reading a power down clock;
s12, reading a hard clock;
s13, detecting whether the hard clock is legal, if yes, executing S14, and if no, executing S17;
s14, assigning the hard clock to the soft clock;
s15, judging whether the power-down clock is legal, if not, ending, if yes, executing S16;
s16, judging whether the soft clock and the power-down clock meet specific conditions, if so, updating the power-down clock to a hard clock and a soft clock and ending, and if not, ending;
s17, judging whether the error frequency of the hard clock is more than n times, if not, returning to execute S12 after delaying time T, if yes, setting a clock abnormal identifier, and then executing S18;
s18, judging whether the soft clock CRC check is correct, if so, executing S19, otherwise, executing S110;
s19, judging whether the soft clock is legal, if so, executing S15, otherwise, executing S110;
and S110, reading the power-down clock and judging whether the power-down clock is legal or not, if not, assigning specific time and date to the soft clock and ending, and if so, assigning the power-down clock to the soft clock and ending.
The clock calibration method in the operation process comprises the following steps:
s21, judging whether the soft clock reaches the tth second per minute, if not, ending, if yes, executing S22;
s22, reading the hard clock and judging whether the hard clock is legal, if so, assigning the hard clock to the soft clock and ending, otherwise, executing S23;
and S23, judging whether the illegal times of the hard clock are more than N times, if so, setting a clock abnormity identifier, assigning the soft clock to the hard clock, and then ending, otherwise, ending.
In this embodiment, the step of determining whether the clock is legal in S13, S15, S19 and S22 includes:
step a, detecting whether a hard clock format is legal or not by adopting a BCD (binary coded decimal) legality detection mode, if so, executing the step b, and if not, judging that the hard clock format is illegal;
and b, judging whether the time and the date of the hard clock are both legal, if so, judging that the hard clock is legal, and if not, judging that the hard clock is illegal.
Specifically, the BCD validity detection mode is that the time, month, day, hour, minute and second field of the clock is internally stored according to a BCD format, and whether each digit is between 0 and 9 is checked; judging whether the time is legal or not by judging whether the time of the clock is in the range of [0,24 ], whether the minute is in the range of [0,60) or not and whether the second is in the range of [0,60) or not; the date is judged to be legal by judging whether the date of the clock is within the following range, namely, the date of the clock is within the following range, wherein the date of the clock is within the following range, the date of the clock is within the range of [2000,2099], the month is within the range of [1,12], the date of a big month is within the range of 31 days, the date of a small month is within the range of 30 days, the date of 2 months leap year is within the range of 29 days, and the date of the same year is within the range of 28 days.
As a preferred embodiment, the manner of determining whether the soft clock and the power-down clock satisfy the specific condition in S16 is to determine whether the power-down time is greater than the soft clock plus d days, if so, then it is satisfied, if not, then it is continuously determined whether the power-down clock plus Y years is less than the soft clock, if so, then it is satisfied, and if not, then it is not satisfied.
In the present embodiment, the value of t is 33. It should be noted that the value of t may be other values, but since the system needs to perform tasks such as copying and reading in the whole time, and in order to avoid overload of the system, it is usually selected to perform clock detection and synchronization when the system is idle, and therefore, the range of t is generally selected to be between 10 and 55 seconds.
In the present embodiment, the value of n is 5. Namely, when the power is on, the clock exception identifier is set when the error frequency of the hard clock is more than 5 times, and the exception event is stored in the nonvolatile memory, and the communication can be copied. Of course, n may be other values, but the value of n is not suitable for being too large, otherwise, it may cause clock abnormality and not be marked, which is unfavorable for tracing when metering dispute occurs.
In the present embodiment, the value of T is 50 ms. That is, after the hard clock is detected illegally, the hard clock is read for legality detection after the delay time is 50ms, and by setting the delay time, some transient errors can be prevented from being marked, and the workload of tracing back and identifying is reduced.
In the present embodiment, the value of d may be set to 1 and the value of Y may be set to 5 according to practical experience. Through setting the parameters d and Y, the soft clock after assignment and the power-down clock are logically judged, so that whether the soft clock assigned by the hard clock lags or leads too much or is reasonable or not is judged, and if the soft clock is unreasonable, the power-down clock is used for updating the hard clock and the soft clock, so that on one hand, the soft clock is more accurate and reliable, on the other hand, the hard clock can be updated, and the defect that the soft clock cannot be accurately calibrated due to the fact that the hard clock at the meter end is illegal is overcome.
In the present embodiment, the specific time and date is 2000, 1, 0, minute, and 0 second.
In this embodiment, the value of N is 5. In general, N may be other values between 3-10, and the user may select it according to the accuracy requirement.
It should be noted that the hard clock in the present application has a backup battery, runs independently of meter software, and the working state is not affected by power off, and the soft clock is driven by a built-in RTC second timer and stored in a meter RAM, and the power down clock is stored in a meter nonvolatile memory and records the time before the meter is powered down.
While embodiments of the invention have been shown and described, it will be understood by those skilled in the art that: various changes, modifications, substitutions and alterations can be made to the embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.

Claims (10)

1. A method for controlling an operation clock of an electric energy meter is characterized by comprising the following steps:
the method includes a power-on clock calibration sub-method and an in-flight clock calibration sub-method, the power-on clock calibration sub-method including,
s11, reading a power down clock;
s12, reading a hard clock;
s13, detecting whether the hard clock is legal, if yes, executing S14, and if no, executing S17;
s14, assigning the hard clock to the soft clock;
s15, judging whether the power-down clock is legal, if not, ending, if yes, executing S16;
s16, judging whether the soft clock and the power-down clock meet specific conditions, if so, updating the power-down clock to a hard clock and a soft clock and ending, and if not, ending;
s17, judging whether the error frequency of the hard clock is more than n times, if not, returning to execute S12 after delaying time T, if yes, setting a clock abnormal identifier, and then executing S18;
s18, judging whether the soft clock CRC check is correct, if so, executing S19, otherwise, executing S110;
s19, judging whether the soft clock is legal, if so, executing S15, otherwise, executing S110;
and S110, reading the power-down clock and judging whether the power-down clock is legal or not, if not, assigning specific time and date to the soft clock and ending, and if so, assigning the power-down clock to the soft clock and ending.
2. The method for controlling the operation clock of the electric energy meter according to claim 1, wherein:
the in-flight clock calibration sub-method includes,
s21, judging whether the soft clock reaches the tth second per minute, if not, ending, if yes, executing S22;
s22, reading the hard clock and judging whether the hard clock is legal, if so, assigning the hard clock to the soft clock and ending, otherwise, executing S23;
and S23, judging whether the illegal times of the hard clock are more than N times, if so, setting a clock abnormity identifier, assigning the soft clock to the hard clock, and then ending, otherwise, ending.
3. The method for clock operation of an electric energy meter according to claim 2, wherein:
the steps of determining whether the clock is legal in S13, S15, S19 and S22 include,
step a, detecting whether a hard clock format is legal or not by adopting a BCD code, if so, executing the step b, and if not, judging that the hard clock format is illegal;
and b, judging whether the time and the date of the hard clock are both legal, if so, judging that the hard clock is legal, and if not, judging that the hard clock is illegal.
4. The method for controlling the operation clock of the electric energy meter according to claim 1, wherein:
the manner of determining whether the soft clock and the power-down clock satisfy the specific condition in S16 is to determine whether the power-down time is greater than the soft clock plus d days, if yes, then the soft clock is satisfied, if no, then the power-down clock plus Y years is continuously determined whether the soft clock is less than the soft clock, if yes, then the soft clock is satisfied, and if no, then the soft clock is not satisfied.
5. The method for clock operation of an electric energy meter according to claim 2, wherein:
the value of t is 33.
6. The method for controlling the operation clock of the electric energy meter according to claim 1, wherein:
the value of n is 5.
7. The method for controlling the operation clock of the electric energy meter according to claim 1, wherein:
the value of T is 50 ms.
8. The method for clock operation of an electric energy meter according to claim 4, wherein:
the value of d is 1 and the value of Y is 5.
9. The method for controlling the operation clock of the electric energy meter according to claim 1, wherein:
the specific time and date is 2000 years, 1 month, 1 day, 0 hour, 0 minute, 0 second.
10. The method for clock operation of an electric energy meter according to claim 2, wherein:
the value of N is 5.
CN202110870304.3A 2021-07-30 2021-07-30 Electric energy meter operation clock control method Active CN113589006B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110870304.3A CN113589006B (en) 2021-07-30 2021-07-30 Electric energy meter operation clock control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110870304.3A CN113589006B (en) 2021-07-30 2021-07-30 Electric energy meter operation clock control method

Publications (2)

Publication Number Publication Date
CN113589006A true CN113589006A (en) 2021-11-02
CN113589006B CN113589006B (en) 2023-07-04

Family

ID=78252447

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110870304.3A Active CN113589006B (en) 2021-07-30 2021-07-30 Electric energy meter operation clock control method

Country Status (1)

Country Link
CN (1) CN113589006B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0718747A2 (en) * 1994-12-22 1996-06-26 Texas Instruments Incorporated Clock control circuits, systems and methods
US20030036864A1 (en) * 2001-07-12 2003-02-20 Randall Bruce Everett Redundant precision time keeping for utility meters
CN101119192A (en) * 2007-09-11 2008-02-06 杭州华三通信技术有限公司 Clock synchronization method and system
GB201217046D0 (en) * 2012-09-25 2012-11-07 Landis & Gyr Oy Device, arrangement and method for verifying the operation of electrity meter
CN106226724A (en) * 2016-08-03 2016-12-14 宁波三星医疗电气股份有限公司 A kind of clock of power meter method for detecting abnormality
CN108318851A (en) * 2018-01-18 2018-07-24 宁波三星医疗电气股份有限公司 A kind of twin-core clock of power meter method for managing security
CN112947678A (en) * 2021-02-09 2021-06-11 南方电网科学研究院有限责任公司 SoC dual-core system clock synchronization method and device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0718747A2 (en) * 1994-12-22 1996-06-26 Texas Instruments Incorporated Clock control circuits, systems and methods
US20030036864A1 (en) * 2001-07-12 2003-02-20 Randall Bruce Everett Redundant precision time keeping for utility meters
CN101119192A (en) * 2007-09-11 2008-02-06 杭州华三通信技术有限公司 Clock synchronization method and system
GB201217046D0 (en) * 2012-09-25 2012-11-07 Landis & Gyr Oy Device, arrangement and method for verifying the operation of electrity meter
CN106226724A (en) * 2016-08-03 2016-12-14 宁波三星医疗电气股份有限公司 A kind of clock of power meter method for detecting abnormality
CN108318851A (en) * 2018-01-18 2018-07-24 宁波三星医疗电气股份有限公司 A kind of twin-core clock of power meter method for managing security
CN112947678A (en) * 2021-02-09 2021-06-11 南方电网科学研究院有限责任公司 SoC dual-core system clock synchronization method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
徐健 等: "电能表中二元互制的实时时钟同步纠错处理" *

Also Published As

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

Similar Documents

Publication Publication Date Title
CN110320791B (en) Clock management method and device for electricity consumption information acquisition system
US9081964B2 (en) Firmware upgrade error detection and automatic rollback
US20100122109A1 (en) Mips recovery technique
CN104749947A (en) Electronic Device And Date And Time Information Obtaining Method
CN108318851A (en) A kind of twin-core clock of power meter method for managing security
CN100570389C (en) A kind of device for testing functions and method that is used for small electric quantity extra battery
CN109490618A (en) A kind of amended record method of load curves of electric energy meter
CN101127590A (en) A method and device for backing up data of single board operation status
CN115658408A (en) Sensor state detection method and device and readable storage medium
CN114384787B (en) Method and device for calibrating clock of electric energy meter
CN113590444A (en) Method and system for recording first use time of electronic equipment
CN111323626A (en) Uncovering detection circuit integrated in MCU and uncovering detection method based on MCU
CN113589006A (en) Electric energy meter operation clock control method
CN108020716B (en) Method for accurately timing time of terminal based on distributed clock source
CN212159910U (en) MCU integrated uncapping detection circuit and electric energy meter control chip
CN111398675A (en) Electric energy meter reading method, device and system
CN110333387B (en) Electric energy metering method of electric energy meter
CN106528311A (en) Embedded system and control method thereof
CN114488915A (en) Processing method for abnormal reset of MCU and electric energy meter for realizing method
CN113064803A (en) Power failure event recording method and device for double-core intelligent electric meter and computer equipment
CN116430300B (en) Method, device and system for identifying clock faults of electric energy meter
CN110519001B (en) Clock synchronization method and device and ammeter communication module
WO2016206191A1 (en) Data processing method and device
CN112114193B (en) Method for metering single chip microcomputer power loss prevention through upgrading module terminal
CN112269725A (en) Recording device and method for storing power-on and power-off time of controller

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