CN112462847A - Method for improving power-off time keeping precision of distribution automation equipment - Google Patents

Method for improving power-off time keeping precision of distribution automation equipment Download PDF

Info

Publication number
CN112462847A
CN112462847A CN202011184837.8A CN202011184837A CN112462847A CN 112462847 A CN112462847 A CN 112462847A CN 202011184837 A CN202011184837 A CN 202011184837A CN 112462847 A CN112462847 A CN 112462847A
Authority
CN
China
Prior art keywords
clock
time
rtc chip
writing
error
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.)
Withdrawn
Application number
CN202011184837.8A
Other languages
Chinese (zh)
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.)
Nanjing Intelligent Software Technology Co ltd
Nanjing Intelligent Apparatus Co ltd
Original Assignee
Nanjing Intelligent Software Technology Co ltd
Nanjing Intelligent Apparatus 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 Nanjing Intelligent Software Technology Co ltd, Nanjing Intelligent Apparatus Co ltd filed Critical Nanjing Intelligent Software Technology Co ltd
Priority to CN202011184837.8A priority Critical patent/CN112462847A/en
Publication of CN112462847A publication Critical patent/CN112462847A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/04Generating or distributing clock signals or signals derived directly therefrom
    • G06F1/14Time supervision arrangements, e.g. real time clock

Abstract

The invention provides a method for improving power-off time keeping accuracy of distribution automation equipment, which comprises the steps of writing a real-time clock after receiving a time keeping command, triggering and updating a low-priority task of an RTC (real time clock), recording the current clock firstly in the task, writing the current clock into an RTC chip through an SPI (serial peripheral interface) or an I2C bus when the clock has sudden change in seconds and the time consumption does not exceed 5mS, judging that the total time consumption does not exceed 10mS after writing the RTC chip, and re-executing if the time consumption exceeds 5 mS. When the equipment is powered on, the time is read from the RTC chip when the clock of the RTC chip jumps, the equipment only allows the clock to be interrupted after being started, and the execution time is less than 0.1 mS. After the method is adopted, the error of writing the RTC chip in normal operation of the device is less than 10mS, the clock error read from the RTC chip after electrification is less than 5mS, and the error of writing and reading is not more than 15 mS. The time keeping error will depend only on the error of the RTC chip.

Description

Method for improving power-off time keeping precision of distribution automation equipment
Technical Field
The invention relates to the field of power distribution equipment, in particular to a method for improving the power-off time keeping precision of power distribution automation equipment.
Background
The accuracy requirement of the distribution automation equipment on power failure punctuality is higher and higher, and the requirement of some application scenes is less than 0.5S.
To meet the requirement of high precision time keeping, in addition to requiring higher precision for the clock of the RTC chip, the delay of the received time keeping command written into the RTC chip needs to be strictly controlled, and in addition, the delay and the time of reading the clock from the RTC chip need to be strictly controlled.
The minimum resolution of the RTC clock is typically seconds or 0.1 seconds, which results in an inherent error on the order of seconds or 0.1 seconds when a write or power up read of a tick command is received, resulting in a time keeping out of tolerance.
Disclosure of Invention
The invention provides a method for improving the power-off time keeping precision of distribution automation equipment to solve the problems in the prior art, wherein the error of writing into an RTC chip is less than 10mS when the equipment is in normal operation, the clock error read from the RTC chip after the equipment is powered on is less than 5mS, and the error of writing and reading is not more than 15 mS. The time keeping error will depend only on the error of the RTC chip.
After receiving a time tick command (the minimum resolution of the command is 1 mS), the invention firstly writes a real-time clock (the resolution is 1 mS). Triggering a low priority task that updates the RTC. In the task, firstly, a current clock (resolution mS) is recorded, when the second of the clock has sudden change and the time of use does not exceed 5mS (ensuring that the clock cannot be interrupted by a task with high priority and long time of use), the current clock is written into an RTC chip through an SPI or an I2C bus, the total time of use is judged to not exceed 10mS after the current clock is written into the RTC chip, and if the total time of use exceeds 10mS, the current clock is executed again, so that the time of writing into the RTC chip and the error of the real-time clock can be ensured. In the whole process, no high priority or off-interrupt is used to complete, since writing to the RTC chip is about 1-2mS (according to SPI or CLOCK frequency of I2C), and the off-interrupt affects the execution of high priority tasks such as sampling, protection, etc.
When the device is powered on, time is also read from the RTC chip, and the time needs to be read when the clock of the RTC chip jumps in consideration of inherent errors. The device only allows the clock to be interrupted after being started, and the execution time is less than 0.1mS, so that the influence of the interruption on the time for updating the system clock by the clock mutation is extremely small, and the time required by the device to execute is about 2mS, and the clock error read by the whole RTC chip is not more than 5 mS.
In summary, after the invention is adopted, the error of writing into the RTC chip by the device during normal operation is less than 10mS, the clock error read from the RTC chip after power-on is less than 5mS, and the error of writing and reading is not more than 15 mS. The time keeping error will depend only on the error of the RTC chip.
Drawings
Fig. 1 is a flowchart of a time tick command after being received.
Fig. 2 is a flow chart of the device when it is powered on.
Detailed Description
The invention will be further explained with reference to the drawings.
After receiving the time tick command (the minimum resolution of the command is 1 mS), the present invention writes the real time clock (resolution 1 mS) first as shown in fig. 1. Triggering a low priority task that updates the RTC. In the task, firstly, a current clock (resolution mS) is recorded, when the second of the clock has sudden change and the time of use does not exceed 5mS (ensuring that the clock cannot be interrupted by a task with high priority and long time of use), the current clock is written into an RTC chip through an SPI or an I2C bus, the total time of use is judged to not exceed 10mS after the current clock is written into the RTC chip, and if the total time of use exceeds 10mS, the current clock is executed again, so that the time of writing into the RTC chip and the error of the real-time clock can be ensured. In the whole process, no high priority or off-interrupt is used to complete, since writing to the RTC chip is about 1-2mS (according to SPI or CLOCK frequency of I2C), and the off-interrupt affects the execution of high priority tasks such as sampling, protection, etc.
When the device is powered on, as shown in fig. 2, time is also read from the RTC chip, and the time needs to be read when the clock of the RTC chip jumps in consideration of inherent errors. The device only allows the clock to be interrupted after being started, and the execution time is less than 0.1mS, so that the influence of the interruption on the time for updating the system clock by the clock mutation is extremely small, and the time required by the device to execute is about 2mS, and the clock error read by the whole RTC chip is not more than 5 mS.
In summary, after the invention is adopted, the error of writing into the RTC chip by the device during normal operation is less than 10mS, the clock error read from the RTC chip after power-on is less than 5mS, and the error of writing and reading is not more than 15 mS. The time keeping error will depend only on the error of the RTC chip.
While the invention has been described in terms of its preferred embodiments, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention.

Claims (3)

1. A method for improving the power-off time keeping precision of distribution automation equipment is characterized by comprising the following steps:
1) after receiving a time tick command, writing a real-time clock firstly, triggering and updating a low-priority task of the RTC, in the task, firstly recording the current clock, when the clock has sudden change in seconds and the time consumption does not exceed 5mS, writing the current clock into an RTC chip through an SPI or an I2C bus, judging that the total time consumption does not exceed 10mS after writing the current clock into the RTC chip, and if the total time consumption does not exceed 10mS, re-executing;
2) when the equipment is powered on, the time is read from the RTC chip when the clock of the RTC chip jumps, the equipment only allows the clock to be interrupted after being started, and the execution time is less than 0.1 mS.
2. The method of improving power distribution automation equipment power outage timekeeping accuracy of claim 1, wherein: the minimum resolution of the time tick command in the step 1) is 1 mS.
3. The method of improving power distribution automation equipment power outage timekeeping accuracy of claim 1, wherein: the resolution ratio of the real-time clock and the current clock is 1 mS.
CN202011184837.8A 2020-10-29 2020-10-29 Method for improving power-off time keeping precision of distribution automation equipment Withdrawn CN112462847A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011184837.8A CN112462847A (en) 2020-10-29 2020-10-29 Method for improving power-off time keeping precision of distribution automation equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011184837.8A CN112462847A (en) 2020-10-29 2020-10-29 Method for improving power-off time keeping precision of distribution automation equipment

Publications (1)

Publication Number Publication Date
CN112462847A true CN112462847A (en) 2021-03-09

Family

ID=74835143

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011184837.8A Withdrawn CN112462847A (en) 2020-10-29 2020-10-29 Method for improving power-off time keeping precision of distribution automation equipment

Country Status (1)

Country Link
CN (1) CN112462847A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114063705A (en) * 2021-11-23 2022-02-18 四川九洲电器集团有限责任公司 Read-write system and method of real-time clock chip

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114063705A (en) * 2021-11-23 2022-02-18 四川九洲电器集团有限责任公司 Read-write system and method of real-time clock chip
CN114063705B (en) * 2021-11-23 2023-05-26 四川九洲电器集团有限责任公司 Read-write system and method for real-time clock chip

Similar Documents

Publication Publication Date Title
US8713333B1 (en) Apparatus and method to simulate a power trip to a disk drive
EP2168042B1 (en) Execution of point-in-time copy operations in continuous mirroring environments
CN101271396A (en) Electronic device and method for on-line updating firmware
JPS60164848A (en) Modeling method and apparatus
WO2002069146A3 (en) Data processing system having an on-chip background debug system and method therefor
CN112462847A (en) Method for improving power-off time keeping precision of distribution automation equipment
CN101072124A (en) Log obtaining method
CN111291022B (en) Data storage system based on block chain
CN114327651A (en) Chip wake-up method, system, electronic device and readable storage medium
US20050060690A1 (en) Microprocessor system with software emulation processed by auxiliary hardware
CN115827332A (en) MCU processor core circuit structure and MCU flight nearby recovery field method
CN111143145B (en) Method for manufacturing errors in SATA error processing debugging and electronic equipment
CN112269725A (en) Recording device and method for storing power-on and power-off time of controller
CN110058933B (en) Method and system for realizing hundred microsecond-level remote signaling SOE (system of event) under Linux system
CN101464822B (en) Test method for CPU timer accuracy
CN113407175A (en) Timed task management system
US6839857B2 (en) Interrupt controller in an interface device or information processing system
CN105573924A (en) Simulation system
CN106873901B (en) Memory management method, memory control circuit unit and memory storage device
US5293572A (en) Testing system of computer by generation of an asynchronous pseudo-fault
CN115862698B (en) Training triggering method, ONFI PHY, chip and electronic equipment
CN114326931B (en) Industrial-grade clock controller, industrial-grade control system, method and electronic device
CN102637140A (en) Novel uncorrected data tape backup system
JP4383494B1 (en) Data processing system and debugging method
US20080104439A1 (en) Real time clock having a register

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
WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20210309