Intelligent electric energy meter clock time service method and system based on Beidou GNSS
By using a smart energy meter clock synchronization method based on BeiDou GNSS, satellite time signals are directly received and time synchronization is performed at the energy meter end. This solves the problems of timing link error and communication uncertainty, achieves high-precision and autonomous clock synchronization, and improves the accuracy of energy metering and the reliability of meter reading.
Patent Information
- Application Number
- CN202511524528.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-24
- Publication Date
- 2026-01-23
AI Technical Summary
Existing smart energy meter time synchronization methods suffer from problems such as long time synchronization links leading to error accumulation, communication delay fluctuations causing inaccurate time synchronization, concentrator failures causing systemic time drift, and the lack of autonomous, accurate, and highly reliable clock synchronization capabilities in energy meters.
The smart energy meter clock synchronization method based on BeiDou GNSS is adopted. By receiving broadcast messages containing timestamps and positioning status, parsing them into standard time, and directly issuing time synchronization commands at the energy meter, autonomous and accurate clock synchronization is achieved, eliminating dependence on upper-level nodes.
It achieves terminal autonomy, high precision, and low latency clock synchronization, avoiding error accumulation and communication uncertainty, and improving the accuracy of electricity metering and the reliability of meter reading.
Smart Images

Figure CN121386332A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of time synchronization of electric energy metering equipment, in particular to a clock time service method and system for intelligent electric energy meter based on Beidou GNSS. BACKGROUND
[0002] With the continuous promotion of smart grid and ubiquitous power Internet of Things, the electric energy meter as the front-end node of power data acquisition, the accuracy of its time synchronization is directly related to the accuracy of electric energy metering, the reliability of load management and the execution efficiency of time-of-use pricing strategy. In the traditional electric energy meter system, the master station transmits time commands to the concentrator through wireless public network (such as 4G / 5G) step by step, and then the concentrator issues the time to the electric energy meter to complete the time correction. However, this mode has multiple uncertainties in communication link, processing flow and device clock reliability. Therefore, in recent years, Beidou GNSS time service technology has been widely studied and gradually applied to various time-sensitive terminal devices due to its advantages of global coverage, high precision and high reliability. Its high stability time signal based on atomic clock enables terminal devices to achieve nanosecond-level clock synchronization, providing a technical basis for precise time service of the new generation of intelligent electric energy meter.
[0003] The current mainstream electric energy meter time service system adopts a hierarchical structure of "master station-concentrator-electric energy meter" for time correction, the communication path is complex, the error sources are accumulated layer by layer, and the overall time service accuracy of the system is reduced. For example, the drift of the crystal oscillator of the concentrator or the fluctuation of the battery voltage can cause a clock offset of more than 5 minutes, and this deviation will be transmitted to all subordinate electric energy meters, forming a systematic time drift. At the same time, multiple forwarding commands need to pass through public network communication network, the communication delay fluctuation is large and unpredictable, causing the time service process to be non-real-time, which is difficult to meet the demand for synchronization of seconds or even higher accuracy. In addition, the time correction mechanism of the concentrator depends on the control of the master station, and lacks the ability of independent time correction of the terminal. If the master station fails or the communication link is interrupted, the electric energy meter cannot be calibrated in time, which seriously affects the accuracy of meter reading and the fairness of billing. SUMMARY
[0004] In view of the above problems, the present application is proposed.
[0005] Therefore, the technical problem solved by the present application is that the existing intelligent electric energy meter time service method has the problems of error accumulation caused by long time service link, time correction inaccuracy caused by communication delay fluctuation, systematic time drift caused by concentrator failure, and how to enable the electric energy meter to have the ability of independent, accurate and reliable clock synchronization.
[0006] To solve the above technical problems, the application provides the following technical scheme: a clock time service method of an intelligent electric energy meter based on a Beidou GNSS, comprising receiving a broadcast message containing a time stamp and a positioning state and analyzing the same into a standard time; reading a current time of the electric energy meter and comparing the satellite time to determine whether a synchronization condition is met; issuing a time correction command to the electric energy meter through serial communication to complete local clock calibration.
[0007] As a preferred scheme of the clock time service method of the intelligent electric energy meter based on the Beidou GNSS, the receiving of the broadcast message containing the time stamp and the positioning state comprises receiving an NMEA-0183 format message broadcast by the Beidou or compatible navigation system through a GNSS receiving device, the message containing an UTC time, a date and a positioning state field; the system communicates with a GNSS chip in a serial port protocol, acquires message data in real time, analyzes the time in the format of hhmmss.ss and the date in the format of ddmmyy, and only in the valid positioning state, splices the time information into a complete UTC time stamp as a standard reference time source; if the state is failed to be analyzed, the current time service process is aborted, and the next cycle is retried.
[0008] As a preferred scheme of the clock time service method of the intelligent electric energy meter based on the Beidou GNSS, the analyzing into a standard time comprises combining the analyzed UTC time field and the date field into a standard format time stamp, and converting the string into a second-level time value; in the embedded system, a unified time stamp structure body is used to cache the time value, and is set as a global reference variable for comparison and calling; the analysis logic judges the data integrity through a state machine, and each frame of data analysis needs to meet the conditions of complete sentence structure and passed check code; the analysis module refreshes the time value once per second, and all failed messages are automatically discarded and re-waited for the next frame.
[0009] As a preferred scheme of the clock time service method of the intelligent electric energy meter based on the Beidou GNSS, the reading of the current time of the electric energy meter comprises sequentially trying to set the baud rate for communication initialization through an RS-485 serial port, scanning the electric energy meter address, and reading the current time field if the electric meter responds; the communication process uses a DL / T645-2007 or DL / T698.45 protocol to construct an instruction frame for reading the time, analyzes the time field in the returned data, and uniformly converts the same into a format consistent with the standard time stamp; the comparison logic calls a system function to calculate the error difference value between the electric meter time and the GNSS time, and the error difference value is expressed as: wherein, is the GNSS time, is the electric energy meter time.
[0010] As a preferred scheme of the clock time service method of the smart electric energy meter based on the Beidou GNSS, the judgment of whether the synchronization condition is met comprises: if the error is less than or equal to 300 seconds, the state is marked as a calibratable state, otherwise, the state is recorded as an over-limit state to be reduced and calibrated; if the state is the calibratable state, the direct time service is allowed to be performed; if the state is the over-limit state to be reduced and calibrated, the system records the error direction and absolute value, and triggers a delayed time calibration mode, in which the time error is reduced by not more than 300 seconds per day; the system records a progressive adjustment state, and the error value is continuously reduced for multiple times until the direct time service is allowed; and error state control logic is written into a local flag bit, and all judgment logics and time calculation are performed in a periodic task. As a preferred scheme of the clock time service method of the smart electric energy meter based on the Beidou GNSS, the judgment of whether the synchronization condition is met comprises: if the error is less than or equal to 300 seconds, the state is marked as a calibratable state, otherwise, the state is recorded as an over-limit state to be reduced and calibrated; if the state is the calibratable state, the direct time service is allowed to be performed; if the state is the over-limit state to be reduced and calibrated, the system records the error direction and absolute value, and triggers a delayed time calibration mode, in which the time error is reduced by not more than 300 seconds per day; the system records a progressive adjustment state, and the error value is continuously reduced for multiple times until the direct time service is allowed; and error state control logic is written into a local flag bit, and all judgment logics and time calculation are performed in a periodic task.
[0011] As a preferred scheme of the clock time service method of the smart electric energy meter based on the Beidou GNSS, the judgment of whether the synchronization condition is met comprises: if the error is less than or equal to 300 seconds, the state is marked as a calibratable state, otherwise, the state is recorded as an over-limit state to be reduced and calibrated; if the state is the calibratable state, the direct time service is allowed to be performed; if the state is the over-limit state to be reduced and calibrated, the system records the error direction and absolute value, and triggers a delayed time calibration mode, in which the time error is reduced by not more than 300 seconds per day; the system records a progressive adjustment state, and the error value is continuously reduced for multiple times until the direct time service is allowed; and error state control logic is written into a local flag bit, and all judgment logics and time calculation are performed in a periodic task.
[0012] As a preferred scheme of the clock time service method of the smart electric energy meter based on the Beidou GNSS, the judgment of whether the synchronization condition is met comprises: if the error is less than or equal to 300 seconds, the state is marked as a calibratable state, otherwise, the state is recorded as an over-limit state to be reduced and calibrated; if the state is the calibratable state, the direct time service is allowed to be performed; if the state is the over-limit state to be reduced and calibrated, the system records the error direction and absolute value, and triggers a delayed time calibration mode, in which the time error is reduced by not more than 300 seconds per day; the system records a progressive adjustment state, and the error value is continuously reduced for multiple times until the direct time service is allowed; and error state control logic is written into a local flag bit, and all judgment logics and time calculation are performed in a periodic task.
[0013] Another object of the present application is to provide a clock time service system of a smart electric energy meter based on the Beidou GNSS.
[0014] As a preferred scheme of the clock time service system of the smart electric energy meter based on the Beidou GNSS, the system comprises a time analysis module, a synchronization judgment module and a clock calibration module; the time analysis module is used for receiving a broadcast message containing a time stamp and a positioning state and analyzing the broadcast message into a standard time; the synchronization judgment module is used for reading a current time of the electric energy meter and comparing the current time with a satellite time to judge whether a synchronization condition is met; and the clock calibration module is used for sending a time calibration command to the electric energy meter through serial communication to complete local clock calibration.
[0015] A computer device comprises a memory and a processor, the memory stores a computer program, and the processor executes the computer program to implement steps of a clock time service method of a smart electric energy meter based on a Beidou GNSS.
[0016] A computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement steps of a clock time service method of a smart electric energy meter based on a Beidou GNSS.
[0017] The clock time service method of the smart electric energy meter based on the Beidou GNSS provided by the application directly receives a Beidou GNSS satellite time signal at an electric energy meter end, and autonomously performs time service processing based on protocol error judgment, completely avoids uncertain factors of intermediate nodes, and realizes terminal autonomy, high-precision, and low-delay clock synchronization control. BRIEF DESCRIPTION OF DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the application, the following will briefly introduce the drawings needed to be used in the embodiment description. Obviously, the drawings in the following description are only some embodiments of the application, and for those skilled in the art, other drawings can also be obtained without creative labor on the basis of these drawings.
[0019] Figure 1 A clock time service method of a smart electric energy meter based on a Beidou GNSS provided for the embodiment 1 of the application. DETAILED DESCRIPTION
[0020] In order to make the above-mentioned purposes, features and advantages of the application more obvious and easy to understand, the specific embodiments of the application will be described in detail below with reference to the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the application, rather than all the embodiments. Based on the embodiments in the application, all other embodiments obtained by those skilled in the art without creative labor should belong to the protection scope of the application.
[0021] Embodiment 1, refer to Figure 1 For an embodiment of the application, a clock time service method of a smart electric energy meter based on a Beidou GNSS is provided, comprising: S1: receiving a broadcast message containing a timestamp and a positioning state and parsing it into a standard time.
[0022] Further, the receiving the broadcast message containing the timestamp and the positioning state comprises receiving, by a GNSS receiving device, a NMEA-0183 format message broadcast by a Beidou or compatible navigation system, the message containing a UTC time, a date and a positioning state field; the system communicates with the GNSS chip in a serial protocol to obtain the message data in real time, parses the time in the format of hhmmss.ss and the date in the format of ddmmyy, and only in the valid positioning state, the time information is spliced into a complete UTC timestamp as a standard reference time source; if the state is parsing failure, the current time service process is terminated, and the next cycle is retried.
[0023] It should be noted that the parsing into the standard time comprises combining the parsed UTC time field and the date field into a standard format timestamp, and converting the string into a second-level time value; in the embedded system, a unified timestamp structure is used to cache the time value, and is set as a global reference variable for comparison and calling; the parsing logic judges the data integrity through a state machine, and each frame of data parsing needs to meet the conditions of complete sentence structure and passed check code; the parsing module refreshes the time value once per second, and all parsing failed messages are automatically discarded and re-waited for the next frame.
[0024] It should be further noted that the terminal device (i.e. the electric energy meter system) is given the ability to directly receive the standard time source, which breaks the dependence on the upper nodes such as the master station and the concentrator, thereby forming an independent and autonomous time perception mechanism. In addition, the message integrity is checked and parsed based on the state machine, and refreshed once per second, which ensures the real-time and reliability of the time source and effectively avoids the risk of time error caused by bit error and frame loss. The stable, accurate and verifiable time service reference is established from the source of the entire system, which provides a high-quality data basis for the subsequent time service process.
[0025] S2: reading the current time of the electric energy meter and comparing with the satellite time to determine whether the synchronization condition is met.
[0026] Further, the reading the current time of the electric energy meter comprises: initializing communication by trying the set baud rate in sequence through the RS-485 serial port, scanning the electric energy meter address, and reading the current time field if the electric meter responds; the communication process uses the DL / T645-2007 or DL / T698.45 protocol to construct an instruction frame for reading the time, parses the time field in the returned data, and uniformly converts it into the same format as the standard timestamp; the comparison logic calls a system function to calculate the error difference between the electric meter time and the GNSS time , which is expressed as: , wherein, is the GNSS time, is the electric energy meter time.
[0027] It should be noted that the judgment of whether the synchronization condition is met includes that if the error is less than or equal to 300 seconds, it is marked as a calibratable state, otherwise it is recorded as an over-limit to be reduced calibration state; if it is a calibratable state, direct time service is allowed to be performed; if it is an over-limit to be reduced calibration state, the system records the error direction and absolute value, and triggers a delayed time calibration mode, which reduces the time error by no more than 300 seconds per day; the system records a progressive adjustment state, and continuously reduces the error value for multiple times until direct time service is allowed; the error state control logic is written into a local flag bit, and all judgment logics and time calculation are performed in a periodic task.
[0028] It should also be noted that a difference awareness mechanism between the electric energy meter and the GNSS standard time is constructed, and dynamic determination of the feasibility and necessity of time calibration is realized. After error calculation, the system adopts different time calibration strategies based on the judgment result: if the error is less than the threshold, direct time service is performed; if it is over-limit, it enters a "daily progressive time calibration" mode, which adjusts by no more than 300 seconds each time until the error is reduced to an acceptable range. Through this difference control and adaptive approximation mechanism, the reliability of the electric energy meter accepting time calibration is ensured (to avoid being rejected by the electric energy meter due to too large error), and the sudden impact of error on electric energy metering or data consistency is reduced. From the perspective of system operation, this judgment process builds a double guarantee of stability and time calibration accuracy.
[0029] S3: issuing a time calibration command to the electric energy meter through serial communication to complete local clock calibration.
[0030] Further, issuing the time calibration command includes constructing a data frame in accordance with the electric meter protocol format, sending a set time command using the baud rate and electric meter address parameters, embedding the UTC time obtained by the current GNSS analysis in the command in the form of BCD encoding; sending the command to the electric energy meter through the serial port, listening to the returned response frame, judging whether the time calibration is successful, if the returned state is normal, recording it as a completed state; if it fails, retrying three times, recording an error flag if the number of times exceeds, and waiting for the next periodic time calibration.
[0031] It should be noted that completing the local clock calibration includes that after the time service command is successfully written to the electric meter, the electric energy meter is marked as having been time-served, and the time of successful time service is recorded; the controller enters a time service cooling time period; if the next period error is over-limit again, it reenters the time service judgment process; the system records the error change trend during time service; if time service fails for three consecutive times or the electric meter does not respond, the system marks the device as an abnormal device and enters a manual intervention process.
[0032] It should be noted that the system realizes closed-loop control from clock error identification to execution of correction operation, and introduces communication feedback and retry mechanism in operation, further enhancing the robustness and communication safety of the system. At the same time, in order to prevent frequent time correction from causing waste of communication resources or increase of response load of the electric meter, the system introduces a "cooling time period" control strategy to ensure that the time service rhythm is controllable. If time correction fails continuously for multiple times or the device is out of connection, the system automatically marks the electric meter as "abnormal", thereby triggering the manual operation response mechanism. This process not only improves the executability of time service and the robustness of communication, but also establishes a life cycle operation strategy and an abnormal monitoring mechanism for electric meter management, which is conducive to the centralized maintenance and remote monitoring of electric meter clusters in large-scale deployment.
[0033] Embodiment 2 provides a Beidou GNSS-based intelligent electric energy meter clock time service system as an embodiment of the application, comprising a time analysis module, a synchronization judgment module, and a clock calibration module.
[0034] The time analysis module is configured to receive a broadcast message containing a timestamp and a positioning state and analyze the broadcast message into a standard time; the synchronization judgment module is configured to read the current time of the electric energy meter and compare the current time with the satellite time to determine whether the synchronization condition is met; and the clock calibration module is configured to issue a time correction command to the electric energy meter through serial communication to complete local clock calibration.
Claims
1. A clock time service method for a smart electric energy meter based on Beidou GNSS, characterized in that, include: Receive broadcast messages containing timestamps and location status and parse them into standard time; Read the current time of the electricity meter and compare it with the satellite time to determine whether the synchronization conditions are met; Local clock calibration is completed by sending a time synchronization command to the electricity meter via serial communication.
2. The Beidou GNSS-based smart power meter clock time service method of claim 1, characterized in that: The receiving of the broadcast message containing the timestamp and location status includes, Receive NMEA-0183 format messages broadcast by BeiDou or compatible navigation systems through GNSS receiving equipment. The messages contain UTC time, date and positioning status fields. The system communicates with the GNSS chip via serial port protocol, acquires message data in real time, parses out the time in hhmmss.ss format and the date in ddmmyy format, and only concatenates the time information into a complete UTC timestamp when the positioning is valid, which serves as the standard reference time source; If the status is "resolution failed", the current time synchronization process will be terminated and retried in the next cycle.
3. The Beidou GNSS-based smart power meter clock time service method of claim 2, characterized in that: The standard time defined in the analysis includes, The parsed UTC time field and date field are combined into a standard format timestamp, and then the string is converted into a second-level time value. In embedded systems, a unified timestamp structure is used to cache time values and set as a global reference variable for comparison and retrieval. The parsing logic uses a state machine to determine data integrity. Each frame of data parsing must meet the conditions of a complete statement structure and passing the checksum. The parsing module refreshes the time value every second, and all packets that fail to be parsed are automatically discarded and wait for the next frame.
4. The Beidou GNSS-based smart power meter clock time service method of claim 3, characterized in that: The reading of the current time of the electricity meter includes, Communication initialization is performed by sequentially trying the set baud rate through the RS-485 serial port, scanning the electricity meter address, and reading the current time field if the electricity meter responds. The communication process uses the DL / T645-2007 or DL / T698.45 protocol to construct the instruction frame for reading the time, parses the time field in the returned data, and converts it into a format consistent with the standard timestamp. The comparison logic calls a system function to error difference the electric meter time with the GNSS time The calculation is expressed as: wherein, is the GNSS time, is the electric energy meter time.
5. The Beidou GNSS-based smart power meter clock time service method of claim 4, characterized in that: The determination of whether the synchronization condition is met includes, If the error is less than or equal to 300 seconds, it is marked as a correctable state, otherwise it is recorded as an over limit pending decremental calibration state; If the time is in a time-synchronization-enabled state, direct time synchronization is allowed. If the system is in a state of exceeding the limit and waiting to be calibrated, it records the error direction and absolute value and triggers the delayed time calibration mode, reducing the time error by no more than 300 seconds per day. The system records the progressive adjustment status and continuously reduces the error value multiple times until direct time synchronization is allowed; Error status control logic is written to a local flag, and all judgment logic and time calculation are executed in a periodic task.
6. The Beidou GNSS-based smart power meter clock time service method of claim 5, characterized in that: The time synchronization command includes, Construct a data frame that conforms to the electricity meter protocol format, and send a time setting command using baud rate and electricity meter address parameters. The command embeds the UTC time obtained from the current GNSS parsing and uses BCD encoding. Send commands to the energy meter via serial port, listen for the return response frame, determine whether the time synchronization is successful, and record the status as complete if the return status is normal. If it fails, it will try three times. If the number of attempts is exceeded, an error flag will be recorded and the system will wait for the next time cycle to synchronize.
7. The Beidou GNSS-based smart power meter clock time service method of claim 6, characterized in that: The process of completing local clock calibration includes, After the system successfully writes the time synchronization command to the electricity meter, it marks the electricity meter as having been synchronized and records the time of successful time synchronization. The controller enters the timing cooling period; If the error exceeds the limit again in the next cycle, the system will re-enter the time synchronization judgment process; the system records the error change trend during the time synchronization process. If the time service fails for three times in succession or the electric meter does not respond, the system marks the device as an abnormal device and enters an artificial intervention process.
8. A clock time service system for smart electric energy meter based on Beidou GNSS, which adopts the clock time service method for smart electric energy meter based on Beidou GNSS as claimed in any one of claims 1 to 7, characterized in that: The time resolution module, the synchronization judgment module and the clock calibration module are included. The time resolution module is used for receiving broadcast messages containing time stamps and positioning states and resolving them into standard time. The synchronization judgment module is used for reading the current time of the electric meter and comparing it with the satellite time to judge whether the synchronization condition is met. The clock calibration module is used for issuing a time calibration command to the electric meter through serial communication to complete the local clock calibration. 9.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-8 when the computer program is executed by the processor. The processor executes the computer program to realize the steps of the Beidou GNSS-based intelligent electric meter clock time service method in any one of claims 1 to 7.
10. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to realize the steps of the Beidou GNSS-based intelligent electric meter clock time service method in any one of claims 1 to 7.