High-precision time keeping method and system based on Beidou module and RTC chip

By setting up a punctual system in the photovoltaic grid-connected system, receiving the Beidou timing signal and calculating the RTC punctual error, the problem of difficult to meet high-precision time synchronization when the Beidou timing abnormality is solved, and high-precision time synchronization is achieved when the Beidou signal is lost, and the cost advantage is significant.

CN119805906APending Publication Date: 2025-04-11海南电力产业发展有限责任公司
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411910834.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-24
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

It is difficult to meet the high-precision time synchronization requirements under abnormal Beidou timing during photovoltaic grid-connected operation.

Method used

By setting up a punctual system, receiving Beidou timing signals, recording time messages, and writing and reading RTC time based on the time messages, calculating read and write delays and RTC punctual errors. When the Beidou timing is normal, perform the first operation; when the Beidou timing is abnormal, perform the second operation to calculate the current time using the RTC's punctual ability and error compensation mechanism.

Benefits of technology

In the case of Beidou module signal loss, by compensating the punctual error of the RTC chip, the accuracy of time is obtained, and the requirements of high-precision time synchronization are met. Compared with other high-precision punctual solutions, the cost is more advantageous.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119805906A_ABST
    Figure CN119805906A_ABST
Patent Text Reader

Abstract

The invention discloses a high-precision time keeping method and system based on a Beidou module and an RTC chip, and relates to the technical field of high-precision time synchronization, and the method comprises the steps: setting and initializing a time keeping system; receiving a Beidou time service signal, and recording a time message; writing and reading RTC time based on the time message, and calculating read-write delay; calculating an RTC punctuality error based on the read-write delay; based on the RTC punctuality error, first operation is carried out when Beidou time service is normal, and second operation is carried out when Beidou time service is abnormal; according to the invention, under the condition that signal loss of the Beidou module occurs on site, the time precision is obtained from the RTC by compensating the punctuality error of the RTC chip, so that the demand of on-site high-precision time synchronization is met; and compared with other high-precision time-keeping complex schemes, the cost is more advantageous.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of high-precision time synchronization, and in particular to a high-precision timekeeping method and system based on a Beidou module and an RTC chip. Background Art

[0002] As photovoltaic power generation is intermittent and volatile, the grid-connected operation of photovoltaic energy has brought new challenges to the reliability of distribution network operation. In order to solve the problems of seasonal heavy overload, voltage limit exceeding, photovoltaic reverse transmission, etc. of the distribution network, it is necessary to focus on the power flow direction of the power grid at the same time point. Accurate time synchronization technology is crucial to solve the problems of grid operation status evaluation and safe operation of the power grid after distributed photovoltaic grid connection.

[0003] At present, distribution network devices generally use RTC chips to provide time, and the time accuracy is usually in seconds, which is difficult to meet the requirements of transparent distribution network algorithms for precise time synchronization under high penetration of distributed photovoltaics. If an abnormality occurs in Beidou timing, the time obtained from RTC will be even more difficult to meet the accuracy requirements. Summary of the invention

[0004] In view of the above-mentioned problems, the present invention is proposed.

[0005] Therefore, the technical problem solved by the present invention is that it is difficult to meet the high-precision time synchronization requirements under abnormal Beidou timing conditions during photovoltaic grid-connected operation.

[0006] In order to solve the above technical problems, the present invention provides the following technical solutions:

[0007] In a first aspect, an embodiment of the present invention provides a high-precision timekeeping method based on a Beidou module and an RTC chip, comprising:

[0008] Set up the timekeeping system and initialize it;

[0009] Receive Beidou timing signals and record time messages;

[0010] Based on the time message, write and read the RTC time and calculate the read and write delay;

[0011] Calculate RTC timing error based on read and write delays;

[0012] Based on the RTC timing error, the first operation is performed when the Beidou timing is normal, and the second operation is performed when the Beidou timing is abnormal.

[0013] As a preferred solution for high-precision timekeeping method based on Beidou module and RTC chip,

[0014] The receiving of Beidou timing signal and recording of time message comprises:

[0015] The Beidou timing module outputs a pulse signal at each preset time interval node;

[0016] The processor captures the pulse signal as a trigger signal for time synchronization.

[0017] As a preferred solution for high-precision timekeeping method based on Beidou module and RTC chip,

[0018] The receiving of Beidou timing signal and recording of time message also includes:

[0019] When receiving the pulse signal, receive the time message sent by the Beidou timing module and record the receiving timestamp;

[0020] Start the timer and begin counting.

[0021] As a preferred solution for high-precision timekeeping method based on Beidou module and RTC chip,

[0022] The writing and reading of RTC time based on the time message and calculating the read-write delay include:

[0023] Write the received Beidou time time1 into the RTC chip;

[0024] Send a time read instruction to read time time1 from the RTC chip;

[0025] Calculate the time interval from the writing time to the reading time.

[0026] As a preferred solution for high-precision timekeeping method based on Beidou module and RTC chip,

[0027] The calculation of the RTC timing error based on the read and write delays includes:

[0028] Calculate the RTC internal time running time deviation. After the processor receives the Beidou time, write the RTC time, record the running time and read the RTC time again.

[0029] As a preferred solution for high-precision timekeeping method based on Beidou module and RTC chip,

[0030] The first operation includes:

[0031] Under normal Beidou timing conditions, the accuracy deviation of the RTC timing error is calculated n times, and the standard error of the RTC timing accuracy is calculated by the processor.

[0032] As a preferred solution for high-precision timekeeping method based on Beidou module and RTC chip,

[0033] The second operation includes:

[0034] Calculate the RTC timekeeping time. When the Beidou signal is abnormal or other abnormal conditions make it impossible to obtain satellite timing, use the RTC timekeeping capability and error compensation mechanism to calculate the current time.

[0035] In a second aspect, an embodiment of the present invention provides a high-precision timekeeping system based on a Beidou module and an RTC chip, including:

[0036] Initialization and configuration module, used to set up the timekeeping system and initialize it;

[0037] Beidou timing receiving module, used to receive Beidou timing signals and record time messages;

[0038] RTC operation and delay calculation module, used to write and read RTC time based on time message, and calculate read and write delay;

[0039] A timing error calculation module is used to calculate the RTC timing error based on the read and write delays;

[0040] The high-precision timing control module is used to perform a first operation based on the RTC timing error when the Beidou timing is normal, and to perform a second operation when the Beidou timing is abnormal.

[0041] In a third aspect, an embodiment of the present invention provides a computing device, including:

[0042] Memory and processor;

[0043] The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the one or more programs are executed by the one or more processors, the one or more processors implement the high-precision timekeeping method based on the Beidou module and the RTC chip as described in any embodiment of the present invention.

[0044] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, can implement the high-precision timekeeping method based on the Beidou module and the RTC chip.

[0045] The beneficial effects of the present invention are as follows: when the Beidou module signal is lost on site, the present invention obtains the time accuracy from the RTC by compensating for the timing error of the RTC chip, thereby meeting the demand for high-precision time synchronization on site; compared with other complex high-precision timing solutions, the cost is more advantageous. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.

[0047] Figure 1 It is an overall flow chart of the high-precision timekeeping method based on Beidou module and RTC chip described in the present invention. DETAILED DESCRIPTION

[0048] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in the art without creative work should fall within the scope of protection of the present invention.

[0049] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.

[0050] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The term "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor does it refer to a separate or selective embodiment that is mutually exclusive with other embodiments.

[0051] Example 1

[0052] Reference Figure 1 , which is the first embodiment of the present invention, provides a high-precision timekeeping method based on a Beidou module and an RTC chip, including:

[0053] S1: Set up the timekeeping system and initialize it;

[0054] S2: Receive Beidou timing signals and record time messages;

[0055] S3: Based on the time message, write and read the RTC time and calculate the read and write delay;

[0056] S4: Calculate RTC timing error based on read and write delays;

[0057] S5: Based on the RTC timing error, the first operation is performed when the Beidou timing is normal, and the second operation is performed when the Beidou timing is abnormal.

[0058] It should be noted that, through steps S1-S5, the Beidou timing module regularly outputs the PPS second pulse signal to trigger the processor to receive the time message, and the processor receives the message through the UART serial port and records the current time, and starts the timer timer at the same time, using the timer as a short-time tick count, and the processor writes the time to the RTC chip through the IIC bus, and realizes time synchronization through the RTC and timer collaboration. It is possible to achieve high-precision time synchronization when Beidou timing is normal, and use the RTC chip and error compensation mechanism to maintain relatively accurate time when Beidou timing is abnormal.

[0059] Example 2

[0060] Reference Figure 1 , which is an embodiment of the present invention, provides a high-precision timekeeping method based on a Beidou module and an RTC chip based on the previous embodiment, including:

[0061] In the embodiment of the present application, setting up the timekeeping system and initializing it in the above step S1 includes:

[0062] Connect the Beidou timing module to the processor through the UART serial port to transmit time messages;

[0063] Connect the RTC chip to the processor via the IIC bus for reading and writing time and date;

[0064] Initialize the UART serial port and set parameters including the baud rate for communication with the Beidou timing module;

[0065] Initialize the IIC bus and configure the parameters for communicating with the RTC chip;

[0066] Initialize the timer and set periodic interrupts for tick counting.

[0067] In another possible implementation, an automated configuration script may be used to automatically complete the initialization settings of the UART serial port, IIC bus, and timer through the script, thereby reducing manual configuration errors and improving efficiency.

[0068] In another possible implementation, a self-check function may be added to check the connection status and working status of the Beidou timing module and the RTC chip during the initialization process to ensure that the system can work normally.

[0069] In the embodiment of the present application, the Beidou timing signal is received in the above step S2, and the time message recorded includes:

[0070] The Beidou timing module outputs a PPS second pulse signal at each preset time interval node;

[0071] The processor captures the PPS pulse-per-second signal as a trigger signal for time synchronization;

[0072] When receiving the PPS second pulse signal, the processor receives the time message sent by the Beidou timing module through the UART serial port and records the receiving timestamp;

[0073] Start the timer and start tick counting. The ticks come from the periodic interrupts of the timer, and each interrupt represents a tick.

[0074] In another possible implementation, the PPS pulse-per-second signal can be received in an interrupt mode to reduce CPU occupancy and improve the real-time response capability of the system; the received Beidou time message can be verified to ensure the accuracy and integrity of the time.

[0075] In the embodiment of the present application, in the above step S3, writing and reading the RTC time based on the time message and calculating the read-write delay include:

[0076] Write the received Beidou time time1 into the RTC chip through the IIC bus;

[0077] Send a time read instruction to read time time1 from the RTC chip;

[0078] Use the tick count of the timer to calculate the time from the writing time T 1 To read out time T 3 The time interval Δt tick :

[0079] Δt tick =T 3 -T 1 =n tick

[0080] Where n represents the number of interrupts generated by the timer from the beginning of writing the RTC time to the complete reading of the time from the RTC.

[0081] In another possible implementation, a high-precision timer may be used to measure the writing and reading delays of the RTC time to improve the measurement accuracy.

[0082] In the embodiment of the present application, the calculation of the RTC timing error based on the read and write delay in the above step S4 includes:

[0083] Calculate the RTC internal time running punctuality deviation, and write the RTC time T after the processor receives the Beidou time. 4, and then record the running time T using Beidou timing 5 Read the RTC time T again 6 .

[0084] The unit time running accuracy deviation of RTC is:

[0085]

[0086] Among them, Δt rtc It is the running deviation of RTC timekeeping unit time.

[0087] In another possible implementation, a sliding average algorithm may be used to smooth the RTC timing errors measured multiple times to reduce the impact of random errors.

[0088] In another possible implementation, the influence of environmental factors such as temperature and voltage on the RTC accuracy may also be considered, and a corresponding compensation model may be established to improve the calculation accuracy of the RTC timing error.

[0089] In the embodiment of the present application, in the above step S5, when the Beidou timing is normal, performing the first operation includes:

[0090] Under the normal timing of Beidou, the accuracy deviation of RTC timing error is calculated n times, and the accuracy deviation is Δtrtc 1 , Δtrtc 2 , Δtrtc 3 ···Δtrtc n , the processor calculates the standard error of RTC timing accuracy, expressed as:

[0091]

[0092] When Beidou timing is abnormal, the second operation includes:

[0093] The RTC timekeeping time is calculated by the processor. When the Beidou signal is abnormal or other abnormal conditions make it impossible to obtain satellite timekeeping, the relatively accurate time is obtained through RTC timekeeping and error compensation, which is expressed as:

[0094] Time = T 8 +n·tick-m·(T 8 -T 7 )

[0095] Among them, Time is the current accurate time, T 8 is the time read from the RTC, n is the number of interrupts generated by the timer from the beginning of writing the RTC time to the complete reading of the time from the RTC, m is the standard error per unit time of the RTC, T 7 The last read RTC time.

[0096] In another possible implementation, the first operation may further include: regularly calibrating the RTC to ensure the accuracy of the RTC time. Meanwhile, historical calibration data may be recorded for analyzing the long-term stability of the RTC.

[0097] In another possible implementation, the second operation may also include: introducing other auxiliary time sources (such as a network time protocol NTP server) to perform time synchronization to improve time accuracy. At the same time, an alarm mechanism may be set to promptly notify management personnel to handle the abnormality of Beidou timing.

[0098] Example 3

[0099] The above is a schematic scheme of the high-precision timekeeping method based on the Beidou module and the RTC chip of this embodiment. It should be noted that the technical solution of the high-precision timekeeping system based on the Beidou module and the RTC chip and the technical solution of the high-precision timekeeping method based on the Beidou module and the RTC chip belong to the same concept. The details of the technical solution of the high-precision timekeeping system based on the Beidou module and the RTC chip in this embodiment that are not described in detail can all be referred to the description of the technical solution of the high-precision timekeeping method based on the Beidou module and the RTC chip.

[0100] This embodiment also provides a system for a high-precision timekeeping method based on a Beidou module and an RTC chip, including:

[0101] Initialization and configuration module, used to set up the timekeeping system and initialize it;

[0102] Beidou timing receiving module, used to receive Beidou timing signals and record time messages;

[0103] RTC operation and delay calculation module, used to write and read RTC time based on time message, and calculate read and write delay;

[0104] A timing error calculation module is used to calculate the RTC timing error based on the read and write delays;

[0105] The high-precision timing control module is used to perform a first operation based on the RTC timing error when the Beidou timing is normal, and to perform a second operation when the Beidou timing is abnormal.

[0106] This embodiment further provides a computing device, which is applicable to the case of a high-precision timekeeping method based on a Beidou module and an RTC chip, including:

[0107] Memory and processor; the memory is used to store computer-executable instructions, and the processor is used to execute computer-executable instructions to implement the high-precision timekeeping method based on the Beidou module and the RTC chip proposed in the above embodiment.

[0108] This embodiment also provides a storage medium on which a computer program is stored. When the program is executed by a processor, the high-precision timekeeping method based on the Beidou module and the RTC chip proposed in the above embodiment is implemented.

[0109] The storage medium proposed in this embodiment and the high-precision timekeeping method based on the Beidou module and the RTC chip proposed in the above embodiment belong to the same inventive concept. The technical details not described in detail in this embodiment can be referred to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.

[0110] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.

Claims

1. A high-precision timekeeping method based on Beidou module and RTC chip, characterized in that: include: Set up the timekeeping system and initialize it; Receive Beidou timing signals and record time messages; Based on the time message, write and read the RTC time and calculate the read and write delay; Calculate RTC timing error based on read and write delays; Based on the RTC timing error, the first operation is performed when the Beidou timing is normal, and the second operation is performed when the Beidou timing is abnormal.

2. The high-precision timekeeping method based on Beidou module and RTC chip as claimed in claim 1, characterized in that: The receiving of Beidou timing signal and recording of time message comprises: The Beidou timing module outputs a pulse signal at each preset time interval node; The processor captures the pulse signal as a trigger signal for time synchronization.

3. The high-precision timekeeping method based on Beidou module and RTC chip as claimed in claim 2, characterized in that: The receiving of Beidou timing signal and recording of time message also includes: When receiving the pulse signal, receive the time message sent by the Beidou timing module and record the receiving timestamp; Start the timer and begin counting.

4. The high-precision timekeeping method based on Beidou module and RTC chip as claimed in claim 3, characterized in that: The writing and reading of RTC time based on the time message and calculating the read-write delay include: Write the received Beidou time time1 into the RTC chip; Send a time read instruction to read time time1 from the RTC chip; Calculate the time interval from the writing time to the reading time.

5. The high-precision timekeeping method based on Beidou module and RTC chip as claimed in claim 4, characterized in that: The calculation of the RTC timing error based on the read and write delays includes: Calculate the RTC internal time running time deviation. After the processor receives the Beidou time, write the RTC time, record the running time and read the RTC time again.

6. The high-precision timekeeping method based on Beidou module and RTC chip as claimed in claim 5, characterized in that: The first operation includes: Under normal Beidou timing conditions, the accuracy deviation of the RTC timing error is calculated n times, and the standard error of the RTC timing accuracy is calculated by the processor.

7. The high-precision timekeeping method based on Beidou module and RTC chip as claimed in claim 6, characterized in that: The second operation includes: Calculate the RTC timekeeping time. When the Beidou signal is abnormal or other abnormal conditions make it impossible to obtain satellite timing, use the RTC timekeeping capability and error compensation mechanism to calculate the current time.

8. A system using the high-precision timekeeping method based on Beidou module and RTC chip as described in any one of claims 1 to 7, characterized in that: include: Initialization and configuration module, used to set up the timekeeping system and initialize it; Beidou timing receiving module, used to receive Beidou timing signals and record time messages; RTC operation and delay calculation module, used to write and read RTC time based on time message, and calculate read and write delay; A timing error calculation module is used to calculate the RTC timing error based on the read and write delays; The high-precision timing control module is used to perform a first operation based on the RTC timing error when the Beidou timing is normal, and to perform a second operation when the Beidou timing is abnormal.

9. A computing device comprising: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the high-precision timekeeping method based on the Beidou module and the RTC chip as described in any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the steps of the high-precision timekeeping method based on a Beidou module and an RTC chip as described in any one of claims 1 to 7.

Citation Information

Cited By

  • Beidou receiver RTC punctuality precision test system

    CN120891514A