Timing method, system and device of electric energy meter and storage medium
By setting response conditions and optimizing timestamp records in the calibration method of the power meter, the problem of insufficient calibration accuracy of the power meter in the existing technology is solved, and millisecond calibration accuracy and efficient communication are achieved, ensuring the time of the power meter Synchronous accuracy.
Patent Information
- Application Number
- CN202411095244.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-09
- Publication Date
- 2024-11-29
AI Technical Summary
The existing high-speed broadband power line carrier communication system cannot meet the high-precision calibration requirements of the power meter in some specific application scenarios, especially when clock synchronization at milliseconds or even higher accuracy is required, resulting in inaccurate timestamps and data. Inconsistency of analysis.
In the calibration method of the electricity meter, the difference between the calibration start time and the local perpetual calendar time is calculated. If the difference is less than or equal to the preset difference, the local perpetual calendar time is adjusted to the next full second moment to generate the calibration Time message is sent; if the difference value is greater than the preset difference value, the time calibration start message will not be responded to, ensuring that the time calibration operation will be performed only when the time deviation is small.
The millisecond calibration accuracy of the power meter is realized, which avoids errors caused by transmission delays and inaccurate timestamps, improves communication efficiency and real-time calibration, and ensures the accurate time measurement function of the power meter during long-term operation.
Smart Images

Figure CN119051791A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of time calibration, and in particular to a time calibration method, system, device and storage medium for an electric energy meter. Background Art
[0002] High-speed broadband power line communication (HPLC) technology plays a key role in power systems, especially in ensuring accurate time calibration of power meters. Accurate time calibration of power meters is achieved through clock synchronization, which is crucial for the operation and management of power systems.
[0003] At present, existing HPLC communication systems can usually achieve second-level clock synchronization accuracy, which is sufficient for many common applications. However, in some specific application scenarios, such as more accurate time calibration of electric energy meters, second-level accuracy may not be sufficient to meet the requirements. For example, for applications that require high-precision event recording or have strict requirements on time series data, such as real-time data acquisition and analysis in smart grids, millisecond-level or even higher-precision clock synchronization becomes necessary.
[0004] This higher-precision clock synchronization ensures the accuracy and consistency of timestamps during high-frequency data collection and event recording, thereby improving the credibility of data and the accuracy of analysis. For example, in power system fault analysis or grid load balancing control, accurate timestamps can help identify and respond to real-time problems, thereby improving system reliability and operating efficiency.
[0005] Therefore, how to improve the time calibration accuracy of electric energy meters is a technical problem that technical personnel in this field urgently need to solve. Summary of the invention
[0006] Based on the above problems, the present application provides a time calibration method, system, device and storage medium for an electric energy meter, which can improve the time calibration accuracy of the electric energy meter.
[0007] The embodiments of the present application disclose the following technical solutions:
[0008] A time calibration method for an electric energy meter, applied to a station STA, the method comprising:
[0009] In response to a time calibration start message sent by a central coordinator CCO, a difference between a time calibration start time and a local perpetual calendar time of the STA is calculated; the time calibration start message is used to respond to an electric energy meter time calibration request sent by a terminal; the time calibration start time is the time when the terminal sends the electric energy meter time calibration request, and the time calibration start time is recorded in the time calibration start message;
[0010] If the difference is less than or equal to the preset difference, the local perpetual calendar time of the STA is adjusted to the time of the next full second to obtain the calibration time of the STA, a calibration message is generated based on the calibration time, and the calibration message is sent to the electric energy meter at the next full second, so that the electric energy meter performs time calibration based on the calibration message; the local perpetual calendar time of the STA is the time for time compensation based on the standard difference value;
[0011] If the difference is greater than the preset difference, the time calibration start message is not responded to.
[0012] In a possible implementation, the method for calculating the local perpetual calendar time of the STA includes:
[0013] In response to the beacon entry sent by the CCO through high-speed broadband power line carrier communication HPLC, the sending network reference time NTB of the CCO is subtracted from the receiving network reference time NTB of the STA and the absolute value is taken to obtain the NTB difference; the sending NTB of the CCO is the local NTB of the CCO when sending the beacon entry; the receiving NTB of the STA is the local NTB of the STA corresponding to the moment when the STA receives the beacon entry sent by the CCO; the sending NTB of the CCO is recorded in the beacon entry of the beacon frame; the sending NTB and the receiving NTB are both millisecond-level time;
[0014] Perform clock frequency conversion on the NTB difference to obtain a standard deviation value;
[0015] The standard deviation value is added to the CCO local perpetual calendar time in the beacon entry to obtain the local perpetual calendar time of the STA.
[0016] In a possible implementation, the CCO local perpetual calendar time is a real-time corrected time; the corrected time is the sum of the downlink message sending time and the first clock difference; the downlink message sending time is the time when the terminal sends the downlink message, and the downlink message is used to respond to the clock synchronization request sent by the CCO; the first clock difference is half of the difference between the second clock difference and the third clock difference; the second clock difference is the difference between the request receiving time and the request sending time; the third clock difference is the difference between the downlink message receiving time and the downlink message sending time; the request receiving time is the time when the terminal receives the clock synchronization request; the request sending time is the time when the CCO sends the clock synchronization request;
[0017] The downlink message sending time and the request receiving time are both recorded in the downlink message; the correction time is updated in real time based on the local perpetual calendar clock of the CCO as time accumulates.
[0018] In a possible implementation, the correction time reacquires a new downlink message at every preset time interval to perform clock synchronization.
[0019] A time calibration system for an electric energy meter, the time calibration system comprising a terminal, a CCO and a STA;
[0020] In response to the electric energy meter time calibration request sent by the terminal, the CCO generates a time calibration start message and sends the time calibration message to the STA;
[0021] The STA calculates the difference between the time calibration start time and the local perpetual calendar time of the STA; the time calibration start time is the time when the terminal sends the time calibration request for the electric energy meter, and the time calibration start time is recorded in the time calibration start message;
[0022] If the difference is less than or equal to the preset difference, the STA adjusts the local perpetual calendar time of the STA to the time of the next full second to obtain the calibration time of the STA, generates a calibration message based on the calibration time, and sends the calibration message to the electric energy meter at the next full second, so that the electric energy meter performs time calibration based on the calibration message; the local perpetual calendar time of the STA is the time for time compensation based on the standard difference value;
[0023] If the difference is greater than a preset difference, the STA does not respond to the timing start message.
[0024] In a possible implementation, in response to the beacon entry sent by the CCO through the HPLC, the STA subtracts the sending NTB of the CCO from the receiving NTB of the STA and takes the absolute value to obtain the NTB difference; the sending NTB of the CCO is the local NTB of the CCO when sending the beacon entry; the receiving NTB of the STA is the local NTB of the STA corresponding to the moment when the STA receives the beacon entry sent by the CCO; the sending NTB of the CCO is recorded in the beacon entry; the sending NTB and the receiving NTB are both millisecond-level time;
[0025] The STA performs clock frequency conversion on the NTB difference to obtain a standard deviation value;
[0026] The STA adds the standard deviation value to the CCO local perpetual calendar time in the beacon entry to obtain the local perpetual calendar time of the STA.
[0027] In a possible implementation, the CCO local perpetual calendar time is a real-time corrected time; the corrected time is the sum of the downlink message sending time and the first clock difference; the downlink message sending time is the time when the terminal sends the downlink message, and the downlink message is used to respond to the clock synchronization request sent by the CCO; the first clock difference is half of the difference between the second clock difference and the third clock difference; the second clock difference is the difference between the request receiving time and the request sending time; the third clock difference is the difference between the downlink message receiving time and the downlink message sending time; the request receiving time is the time when the terminal receives the clock synchronization request; the request sending time is the time when the CCO sends the clock synchronization request;
[0028] The downlink message sending time and the request receiving time are both recorded in the downlink message; the correction time is recorded in the CCO local perpetual calendar clock and is updated in real time as time accumulates.
[0029] In a possible implementation, the correction time reacquires a new downlink message at every preset time interval to perform clock synchronization.
[0030] A time calibration device for an electric energy meter comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the time calibration method for the electric energy meter as described above is implemented.
[0031] A computer-readable storage medium stores instructions. When the instructions are executed on a time calibration system of an electric energy meter, the time calibration system of the electric energy meter executes the time calibration method of the electric energy meter as described above.
[0032] Compared with the prior art, this application has the following beneficial effects:
[0033] The present application provides a time calibration method, system, device and storage medium for an electric energy meter. Specifically, when executing the time calibration method for an electric energy meter provided in an embodiment of the present application, the station (Station, STA) first calculates the difference between the time calibration start time and the STA local perpetual calendar time, and the time calibration start time is recorded in the time calibration start message, which is generated by the CCO when processing the electric energy meter time calibration request sent by the terminal. When the difference is less than or equal to the preset value, the STA adjusts the local perpetual calendar time to the time of the next full second to obtain the STA calibration time, generates a calibration message based on the calibration time, and sends it to the electric energy meter for time calibration in the next full second; if it is greater than the preset value, the STA has no response. The present application specifies the conditions for the response of the time calibration start message, that is, the difference between the time calibration start time and the local perpetual calendar time of the STA needs to be less than or equal to the preset difference. This ensures that the generation and sending of the calibration message will be triggered only when the deviation between the local perpetual calendar time of the STA and the time of the central coordinator (Cental Coordinator, CCO) is small. Therefore, a calibration message is generated based on the STA local perpetual calendar time that is time-compensated by the standard deviation value, which ensures that the electric energy meter can calibrate the time based on the accurate timestamp after receiving the calibration message. At the same time, the time compensation of the STA local perpetual calendar time can avoid transmission delays or inaccurate timestamps, thereby avoiding the calibration error of the electric energy meter. In addition, the generation and transmission of the calibration message are performed at the next full second, which ensures that the calibration operation is performed within a fixed time interval, thereby improving the communication efficiency and the real-time performance of the calibration. The electric energy meter can be quickly adjusted according to the accurate time information received to achieve millisecond-level calibration accuracy. It can be seen that the present application effectively realizes the millisecond-level calibration of the electric energy meter by optimizing the response conditions, timestamp recording and communication timing. This precise calibration mechanism is particularly important for application scenarios that require high-precision time synchronization, and can ensure that the electric energy meter maintains accurate time measurement function during long-term operation. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the technical solutions in this embodiment or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0035] Figure 1 A method flow chart of a time calibration method for an electric energy meter provided in an embodiment of the present application;
[0036] Figure 2 A method flow chart of a method for calculating the local perpetual calendar time of a STA provided in an embodiment of the present application;
[0037] Figure 3 An interactive schematic diagram of a time calibration system for an electric energy meter provided in an embodiment of the present application. DETAILED DESCRIPTION
[0038] To facilitate understanding of the technical solutions provided by the embodiments of the present application, the background technology involved in the embodiments of the present application will be described below.
[0039] HPLC communication technology plays a key role in power systems, especially in the time calibration of electric energy meters. Accurate time calibration of electric energy meters is essential for accurately recording and calculating energy consumption, and this process is mainly achieved through clock synchronization.
[0040] Currently, existing HPLC communication systems can usually provide second-level clock synchronization accuracy, which is sufficient for many applications. However, in some specific situations, such as when higher accuracy is required during the calibration of electric energy meters, second-level accuracy alone may not meet the requirements. For example, for applications that require extremely accurate event recording or have higher requirements for time series data, millisecond-level or higher clock synchronization becomes a necessary factor.
[0041] Therefore, in this case, it is crucial to improve the clock synchronization accuracy to millisecond level or higher. This will ensure the precise synchronization of time information between devices such as energy meters, enabling the system to more accurately record and process power consumption data, thereby improving the accuracy and efficiency of monitoring and controlling the power system.
[0042] In order to solve this problem, a time calibration method, system, device and storage medium for an electric energy meter are provided in an embodiment of the present application. The STA first calculates the difference between the time calibration start time and the local perpetual calendar time of the STA according to the time calibration start message sent by the CCO. The time calibration start message is used to respond to the time calibration request sent by the terminal. In addition, the time calibration start time is the time when the terminal sends the time calibration request, and is recorded in the time calibration start message. If the difference between the time calibration start time and the local perpetual calendar time of the STA is less than or equal to the preset difference, the STA adjusts the local perpetual calendar time of the STA to the time of the next full second to obtain the calibration time of the STA, so as to generate a calibration message based on the calibration time, and send it to the electric energy meter for time calibration in the next second; otherwise, the STA does not respond. The present application realizes the millisecond-level time calibration of the electric energy meter by setting the time calibration start condition, recording the accurate time calibration start time and optimizing the communication timing. This precise time calibration mechanism ensures the high precision of time synchronization, avoids errors caused by transmission delays or inaccurate timestamps, and improves the communication efficiency and real-time time calibration, ensuring that the electric energy meter maintains accurate time measurement function in long-term operation.
[0043] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0044] See also Figure 1 , which is a flow chart of a method for calibrating a time of an electric energy meter provided in an embodiment of the present application, such as Figure 1 As shown, the time calibration method of the electric energy meter may include steps S101-S103:
[0045] S101: In response to a time calibration start message sent by a CCO, a difference between a time calibration start time and a local perpetual calendar time of the STA is calculated.
[0046] When CCO sends a time calibration start message, STA calculates the difference between the time calibration start time and the local perpetual calendar time of STA. The time calibration start message is usually used to respond to the time calibration request of the electric energy meter sent by the terminal. In this process, the time calibration start time refers to the exact time when the terminal sends the time calibration request, and this time will be recorded in the time calibration start message. This method can ensure that accurate time information is used when performing time calibration operations to ensure the accuracy and reliability of the time calibration process.
[0047] See also Figure 2 , Figure 2 A method flow chart of a method for calculating the local perpetual calendar time of a STA provided in an embodiment of the present application can be implemented through steps A1-A3:
[0048] A1: In response to the beacon entry sent by the CCO through the HPLC, the transmission NTB of the CCO is subtracted from the reception NTB of the STA and the absolute value is taken to obtain the NTB difference.
[0049] When STA receives the network time synchronization beacon from CCO through HPLC, STA will compare the difference between the network reference time (Network Time Base, NTB) (i.e. NTB1) sent by CCO and the local NTB (i.e. NTB2) received by STA, and take the absolute value to obtain the difference △NTB of NTB, i.e. △NTB = |NTB1-NTB2|. The NTB sent by CCO refers to the local network reference time used by CCO when sending beacon entries. The NTB received by STA refers to the local network reference time recorded by STA when receiving the beacon entry. In addition, the NTB sent by CCO will be recorded in the beacon entry. As shown in Table 1, Table 1 is a table of beacon entries, and the "local network reference time corresponding to the millisecond perpetual calendar clock" in Table 1 is the NTB sent by CCO.
[0050] Table 1 Beacon entry table
[0051]
[0052] The purpose of this process is to help adjust and synchronize the time between CCO and STA by calculating the difference between NTB. By recording and processing these differences, STA can effectively manage and maintain the time accuracy and synchronization between devices, thereby ensuring that each device in the network can operate and communicate based on accurate time information.
[0053] Among them, the sending NTB and receiving NTB are both in milliseconds.
[0054] A2: Perform clock frequency conversion on the NTB difference to obtain a standard deviation value.
[0055] The calculated NTB difference △NTB will be subjected to clock frequency conversion operation to obtain a standardized difference △NTB b In this process, STA will perform appropriate conversion processing on the difference of NTB according to the different clock frequencies and standardization methods between devices to ensure the consistency and accuracy of time data between different devices. In this way, the time information between devices in the network can be synchronized, and data exchange and communication can be carried out more effectively.
[0056] In a possible implementation, the NTB difference value may be multiplied by 1 / 25000 MHz (MHZ) to achieve clock frequency conversion of the NTB difference value and obtain a standard deviation value, that is,
[0057] A3: Add the standard deviation value to the CCO local calendar time in the beacon entry to obtain the local calendar time of the STA.
[0058] The standardized difference obtained by clock frequency conversion will be compared with the CCO local calendar time t recorded in the beacon entry. s Perform the addition operation to calculate the local calendar time t of STA, that is, t = t s +△NTB b . By combining the standardized difference with the local calendar time of the CCO, the STA can obtain the accurate local calendar time of the STA, ensuring the time synchronization and consistency between the STA and the CCO. This process helps to ensure that the time information within the system is accurate, allowing devices to coordinate operations and communications on time. The "millisecond calendar clock" in Table 1 is the CCO local calendar time. The CCO local calendar time is also recorded in the beacon entry.
[0059] In one possible implementation, the CCO local perpetual calendar time in the beacon entry is a real-time modification time, that is, the calculated modification time is used as the CCO local perpetual calendar time, but as time goes by, the CCO local perpetual calendar time will be accumulated based on the modification time, and the real-time modification time when the beacon entry is last sent by CCO through HPLC is used as the final CCO local perpetual calendar time recorded in the beacon entry.
[0060] Specifically, the local calendar time of CCO is the real-time correction time, and the correction time t s is the sum of the downlink message sending time t3 and the first clock difference △t1, that is, t s =t3+△t1. Downlink message sending time t3 is the time when the terminal sends downlink messages, which are used to respond to the clock synchronization request sent by the CCO. That is, when the CCO sends a clock synchronization request to the terminal, the terminal will send a downlink message to respond to the clock synchronization request sent by the CCO. Table 2 is a table of downlink messages:
[0061] Table 2 is the downlink message table
[0062]
[0063] The first clock difference △t1 is half of the difference between the second clock difference △t2 and the third clock difference △t3, that is, The second clock difference is the difference between the request receiving time t2 (i.e., the "terminal receiving request time" in Table 2) and the request sending time t1, that is, △t2=t2-t1. The third clock difference is the difference between the downlink message receiving time t4 and the downlink message sending time t3 (i.e., the "terminal sending response time" in Table 2), that is, △t3=t4-t3. Therefore, it can be known that the first clock difference The request receiving time t2 is the time when the terminal receives the clock synchronization request. The request sending time t1 is the time when the CCO sends the clock synchronization request.
[0064] The time when the downlink message is sent and the time when the request is received are both recorded in the downlink message.
[0065] Correction time is accumulated over time to obtain the local perpetual calendar time of CCO. CCO uses a perpetual calendar clock as the time reference, and correction time is accumulated and updated over time to ensure that the local perpetual calendar time of CCO can be adjusted and maintained accurately in real time. This mechanism helps to keep the local perpetual calendar time of CCO synchronized with the time of other devices in the network and ensure the accuracy and consistency of time information.
[0066] The time when the CCO sends the request and the time when the downlink message is received are both recorded locally by the CCO.
[0067] Through this complex process, the local perpetual calendar time of the CCO can be corrected in real time, and the time information can be synchronized and updated based on the downlink message sending time, clock synchronization request and calculation of different clock differences.
[0068] In a possible implementation, the time is corrected to re-acquire a new downlink message at every preset time interval to perform clock synchronization.
[0069] Specifically, the CCO module will periodically initiate a millisecond-level perpetual calendar clock request command to the terminal (the period can be but is not limited to 15 minutes-60 minutes) so that the terminal can send a new downlink message to the CCO. The CCO will recalculate the correction time based on the new downlink message for clock synchronization.
[0070] In a possible implementation, when the CCO responds to the electric energy meter time calibration request sent by the terminal, it not only generates a time calibration start message to send to the STA, but also generates a reply message to inform the terminal that the time calibration process of the electric energy meter has been started.
[0071] S102: If the difference is less than or equal to the preset difference, the local perpetual calendar time of the STA is adjusted to the time of the next full second to obtain the calibration time of the STA, a calibration message is generated based on the calibration time, and the calibration message is sent to the electric energy meter at the next full second, so that the electric energy meter performs time calibration based on the calibration message.
[0072] If the difference between the calculated time calibration start time and the STA's local calendar time is less than or equal to the preset threshold, the STA adjusts the STA's local calendar time to the next full second to obtain the STA's calibration time, and generates a calibration message based on the calibration time. Subsequently, at the next full second, the calibration message will be sent to the corresponding energy meter so that the energy meter can perform accurate time calibration based on this calibration message. This process ensures that when the conditions are met, the calibration message is generated using the calibration time and sent to the energy meter to achieve accurate time calibration.
[0073] Among them, the local perpetual calendar time of STA is recorded by the local perpetual calendar clock of STA, that is, the local perpetual calendar time of STA is determined and displayed based on the information provided by the local perpetual calendar clock. The local perpetual calendar clock refers to the clock system inside the device, which is used to record, track and maintain time information. The local perpetual calendar clock can provide long-term stability and accuracy so that the device can accurately represent the date and time and is used in various application scenarios, such as data logging, timestamps, etc.
[0074] In a possible implementation, the calibration message may be a 645 calibration message or a 698 calibration message.
[0075] 645 calibration message: Based on the DL / T 645-2007 standard, it is an international standard protocol used for energy meter communication. The 645 calibration message follows the DLMS / COSEM (Data Link Layer Message Specification / CommonObject Services for Energy Metering) standard and is used to transmit data, commands, and calibration information. According to the protocol, the 645 calibration message contains specific data structures and fields to implement the calibration operation of the energy meter.
[0076] 698 calibration message: Based on DL / T 698 standard, it is also a standard used in the field of electric energy meter communication. 698 calibration message is usually used for remote meter reading and control operations, and also includes time calibration function. Similar to 645 calibration message, 698 calibration message defines a specific format and content to perform time calibration operations between electric energy meters and other systems.
[0077] In a possible implementation, the preset difference may be but is not limited to 5 seconds. The user may adjust the preset difference according to actual needs, and this application does not impose any specific restrictions on the preset difference.
[0078] S103: If the difference is greater than a preset difference, then the time calibration start message is not responded to.
[0079] If the difference between the calculated time synchronization start time and the STA's local calendar time is greater than the preset threshold, the STA will not respond to the received time synchronization start message. In other words, when the difference exceeds the set threshold, the STA will not perform the time synchronization operation, nor will it generate or send a time synchronization message to the energy meter for time synchronization.
[0080] Based on the contents of S101-S103, it can be known that STA first calculates the deviation between the time calibration start time and the local perpetual calendar time through the time calibration start message sent by CCO. When CCO processes the time calibration request of the electric energy meter sent by the terminal, it will simultaneously generate a reply message and a time calibration start message, and the time calibration start message will be sent by CCO to STA, where the time calibration start time is recorded in the time calibration start message. If the deviation is less than or equal to the preset value, STA will adjust the local perpetual calendar time of STA to the time of the next full second to obtain the calibration time of STA to generate a calibration message, and send it to the electric energy meter at the next full second to perform millisecond-level time calibration. If the deviation is greater than the preset value, STA does not respond to the calibration message. This application specifies the response condition of the time calibration start message, that is, to ensure that the difference between the time calibration start time and the local perpetual calendar time of STA does not exceed the preset value. This ensures that the calibration message will only be generated and sent when the deviation between the local perpetual calendar time and the CCO time is small. STA generates a calibration message based on the local perpetual calendar time after time compensation by the standard deviation value. This ensures that when the energy meter receives the calibration message, it can be calibrated according to the accurate timestamp. By performing time compensation on the STA local perpetual calendar time, it helps to avoid errors caused by transmission delays or inaccurate timestamps. The message is generated and sent at the next full second, improving communication efficiency and time calibration real-time within a fixed time interval, allowing the energy meter to quickly adjust to achieve millisecond-level accuracy, ensuring the accuracy of the time measurement function in long-term operation.
[0081] See also Figure 3 , Figure 3 This is a schematic diagram of an interaction of a time calibration system of an electric energy meter provided in an embodiment of the present application. Figure 3 As shown, the time calibration system of the electric energy meter includes: a terminal, a CCO and a STA;
[0082] In response to the electric energy meter time calibration request sent by the terminal, the CCO generates a time calibration start message and sends the time calibration message to the STA;
[0083] The STA calculates the difference between the time calibration start time and the local perpetual calendar time of the STA; the time calibration start time is the time when the terminal sends the time calibration request for the electric energy meter, and the time calibration start time is recorded in the time calibration start message;
[0084] If the difference is less than or equal to the preset difference, the STA adjusts the local perpetual calendar time of the STA to the time of the next full second to obtain the calibration time of the STA, generates a calibration message based on the calibration time, and sends the calibration message to the electric energy meter at the next full second, so that the electric energy meter performs time calibration based on the calibration message; the local perpetual calendar time of the STA is the time for time compensation based on the standard difference value;
[0085] If the difference is greater than a preset difference, the STA does not respond to the timing start message.
[0086] In a possible implementation, when the CCO responds to the electric energy meter time calibration request sent by the terminal, it not only generates a time calibration start message to send to the STA, but also generates a reply message to inform the terminal that the time calibration process of the electric energy meter has been started. The CCO will first send the reply message to the terminal, and then immediately send the time calibration start message to the STA.
[0087] In a possible implementation, in response to the beacon entry sent by the CCO through the HPLC, the STA subtracts the sending NTB of the CCO from the receiving NTB of the STA and takes the absolute value to obtain the NTB difference; the sending NTB of the CCO is the local NTB of the CCO when sending the beacon entry; the receiving NTB of the STA is the local NTB of the STA corresponding to the moment when the STA receives the beacon entry sent by the CCO; the sending NTB of the CCO is recorded in the beacon entry; the sending NTB and the receiving NTB are both millisecond-level time;
[0088] The STA performs clock frequency conversion on the NTB difference to obtain a standard deviation value;
[0089] The STA adds the standard deviation value to the CCO local perpetual calendar time in the beacon entry to obtain the local perpetual calendar time of the STA.
[0090] In a possible implementation, the CCO local perpetual calendar time is a real-time corrected time; the corrected time is the sum of the downlink message sending time and the first clock difference; the downlink message sending time is the time when the terminal sends the downlink message, and the downlink message is used to respond to the clock synchronization request sent by the CCO; the first clock difference is half of the difference between the second clock difference and the third clock difference; the second clock difference is the difference between the request receiving time and the request sending time; the third clock difference is the difference between the downlink message receiving time and the downlink message sending time; the request receiving time is the time when the terminal receives the clock synchronization request; the request sending time is the time when the CCO sends the clock synchronization request;
[0091] The downlink message sending time and the request receiving time are both recorded in the downlink message; the correction time is recorded in the CCO local perpetual calendar clock and is updated in real time as time accumulates.
[0092] In a possible implementation, the correction time reacquires a new downlink message at every preset time interval to perform clock synchronization.
[0093] In addition, an embodiment of the present application also provides a time calibration device for an electric energy meter, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the time calibration method for the electric energy meter as described above is implemented.
[0094] In addition, an embodiment of the present application also provides a computer-readable storage medium, which stores instructions. When the instructions are executed on the time calibration system of the electric energy meter, the time calibration system of the electric energy meter executes the time calibration method of the electric energy meter as described above.
[0095] This application sets the time calibration start message response conditions to ensure that the deviation between the time calibration start time and the STA local perpetual calendar time is less than or equal to the preset difference, and triggers the generation and sending of the calibration message only when the deviation between the local perpetual calendar time and the CCO time is small. By applying time compensation processed by standard deviation on the STA to generate calibration messages, it can be ensured that the electric energy meter can use accurate timestamps for time calibration after receiving these calibration messages. Time compensation of the STA local perpetual calendar time is to avoid the time calibration error of the electric energy meter that may be caused by transmission delays or inaccurate timestamps. The overall optimization of communication efficiency and time calibration real-time is suitable for high-precision time synchronization requirements, ensuring the long-term stable time measurement function of the electric energy meter.
[0096] The above is a detailed introduction to the time calibration method, system, device and storage medium of an electric energy meter provided by the present application. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the embodiments can be referenced to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.
[0097] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0098] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
Claims
1. A time calibration method for an electric energy meter, characterized in that: Applied to a station STA, the method includes: In response to a time calibration start message sent by a central coordinator CCO, a difference between a time calibration start time and a local perpetual calendar time of the STA is calculated; the time calibration start message is used to respond to an electric energy meter time calibration request sent by a terminal; the time calibration start time is the time when the terminal sends the electric energy meter time calibration request, and the time calibration start time is recorded in the time calibration start message; If the difference is less than or equal to the preset difference, the local perpetual calendar time of the STA is adjusted to the time of the next full second to obtain the calibration time of the STA, a calibration message is generated based on the calibration time, and the calibration message is sent to the electric energy meter at the next full second, so that the electric energy meter performs time calibration based on the calibration message; the local perpetual calendar time of the STA is the time for time compensation based on the standard difference value; If the difference is greater than the preset difference, the time calibration start message is not responded to.
2. The method according to claim 1, characterized in that: The method for calculating the local perpetual calendar time of the STA includes: In response to the beacon entry sent by the CCO through high-speed broadband power line carrier communication HPLC, the sending network reference time NTB of the CCO is subtracted from the receiving network reference time NTB of the STA and the absolute value is taken to obtain the NTB difference; the sending NTB of the CCO is the local NTB of the CCO when sending the beacon entry; the receiving NTB of the STA is the local NTB of the STA corresponding to the moment when the STA receives the beacon entry sent by the CCO; the sending NTB of the CCO is recorded in the beacon entry of the beacon frame; the sending NTB and the receiving NTB are both millisecond-level time; Perform clock frequency conversion on the NTB difference to obtain a standard deviation value; The standard deviation value is added to the CCO local perpetual calendar time in the beacon entry to obtain the local perpetual calendar time of the STA.
3. The method according to claim 2, characterized in that The CCO local perpetual calendar time is the real-time correction time; the correction time is the sum of the downlink message sending time and the first clock difference; the downlink message sending time is the time when the terminal sends the downlink message, and the downlink message is used to respond to the clock synchronization request sent by the CCO; The first clock difference is half of the difference between the second clock difference and the third clock difference; the second clock difference is the difference between the request receiving time and the request sending time; the third clock difference is the difference between the downlink message receiving time and the downlink message sending time; the request receiving time is the time when the terminal receives the clock synchronization request; the request sending time is the time when the CCO sends the clock synchronization request; The downlink message sending time and the request receiving time are both recorded in the downlink message; the correction time is updated in real time based on the local perpetual calendar clock of the CCO as time accumulates.
4. The method according to claim 3, characterized in that The correction time re-acquires a new downlink message at every preset time interval to perform clock synchronization.
5. A time calibration system for an electric energy meter, characterized in that: The time calibration system includes a terminal, a CCO and a STA; In response to the electric energy meter time calibration request sent by the terminal, the CCO generates a time calibration start message and sends the time calibration message to the STA; The STA calculates the difference between the time calibration start time and the local perpetual calendar time of the STA; the time calibration start time is the time when the terminal sends the time calibration request for the electric energy meter, and the time calibration start time is recorded in the time calibration start message; If the difference is less than or equal to the preset difference, the STA adjusts the local perpetual calendar time of the STA to the time of the next full second to obtain the calibration time of the STA, generates a calibration message based on the calibration time, and sends the calibration message to the electric energy meter at the next full second, so that the electric energy meter performs time calibration based on the calibration message; the local perpetual calendar time of the STA is the time for time compensation based on the standard difference value; If the difference is greater than a preset difference, the STA does not respond to the timing start message.
6. The system according to claim 5, characterized in that In response to the beacon entry sent by the CCO through the HPLC, the STA subtracts the sending NTB of the CCO from the receiving NTB of the STA and takes the absolute value to obtain the NTB difference; the sending NTB of the CCO is the local NTB of the CCO when sending the beacon entry; the receiving NTB of the STA is the local NTB of the STA corresponding to the moment when the STA receives the beacon entry sent by the CCO; the sending NTB of the CCO is recorded in the beacon entry; The sending NTB and the receiving NTB are both in milliseconds; The STA performs clock frequency conversion on the NTB difference to obtain a standard deviation value; The STA adds the standard deviation value to the CCO local perpetual calendar time in the beacon entry to obtain the local perpetual calendar time of the STA.
7. The system according to claim 6, characterized in that The CCO local perpetual calendar time is the real-time correction time; the correction time is the sum of the downlink message sending time and the first clock difference; the downlink message sending time is the time when the terminal sends the downlink message, and the downlink message is used to respond to the clock synchronization request sent by the CCO; The first clock difference is half of the difference between the second clock difference and the third clock difference; the second clock difference is the difference between the request receiving time and the request sending time; the third clock difference is the difference between the downlink message receiving time and the downlink message sending time; the request receiving time is the time when the terminal receives the clock synchronization request; the request sending time is the time when the CCO sends the clock synchronization request; The downlink message sending time and the request receiving time are both recorded in the downlink message; the correction time is recorded in the CCO local perpetual calendar clock and is updated in real time as time accumulates.
8. The system according to claim 7, characterized in that The correction time re-acquires a new downlink message at every preset time interval to perform clock synchronization.
9. A time calibration device for an electric energy meter, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the time calibration method for an electric energy meter as described in any one of claims 1 to 4 is implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed on the time calibration system of the electric energy meter, the time calibration system of the electric energy meter executes the time calibration method of the electric energy meter as described in any one of claims 1-4.
