Electric energy meter communication method, special transformer acquisition terminal and electric energy meter
By deploying TSN communication modules and clock synchronization modules in electricity meters and dedicated transformer data acquisition terminals, and using the TSN protocol stack for nanosecond-level clock synchronization, the problems of low clock synchronization accuracy and poor stability in communication between dedicated transformer data acquisition terminals and electricity meters are solved, and deterministic communication and data transmission are realized.
Patent Information
- Application Number
- CN202511445864.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-11
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2045-10-11
AI Technical Summary
In existing technologies, the communication between the dedicated transformer data acquisition terminal and the energy meter suffers from low clock synchronization accuracy and poor stability, making deterministic communication impossible.
A first TSN communication module is deployed in the energy meter, and a second TSN communication module and a clock synchronization module are deployed in the dedicated transformer data acquisition terminal. The TSN protocol stack is used for nanosecond-level clock synchronization, and deterministic communication between the energy meter and the dedicated transformer data acquisition terminal is realized through the TSN communication module.
It achieves nanosecond-level clock synchronization between the electricity meter and the dedicated transformer data acquisition terminal, ensuring no timestamp deviation, improving communication efficiency and quality, and realizing deterministic data transmission.
Smart Images

Figure CN120956376A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and more specifically, to a communication method for an electricity meter, a dedicated transformer data acquisition terminal, and an electricity meter. Background Technology
[0002] In the power distribution network system, the dedicated transformer data acquisition terminal communicates with the main station and the electricity meter respectively. The clock synchronization accuracy and time delay determinism of the dedicated transformer data acquisition terminal are important parameters that restrict the operating efficiency of the power grid.
[0003] Currently, dedicated transformer data acquisition terminals mainly use Network Time Protocol (NTP) for clock synchronization. The clock synchronization accuracy of the NTP protocol can only reach the millisecond level, which has the disadvantages of low clock synchronization accuracy and poor stability. Consequently, it is impossible to achieve deterministic communication between the dedicated transformer data acquisition terminal and the master station and the energy meter.
[0004] Therefore, the communication between the dedicated transformer data acquisition terminal and the electricity meter in the existing technology has certain limitations. Summary of the Invention
[0005] The purpose of this application is to address the shortcomings of the prior art by providing a communication method for electricity meters, a dedicated transformer data acquisition terminal, and an electricity meter, so as to solve the practical problem of the limitations in communication between the dedicated transformer data acquisition terminal and the electricity meter in the prior art.
[0006] To achieve the above objectives, the technical solutions adopted in the embodiments of this application are as follows: In a first aspect, embodiments of this application provide a communication method for an electricity meter, applied to an electricity meter communication system, the electricity meter communication system including: an electricity meter and a dedicated transformer data acquisition terminal; the electricity meter is equipped with a first TSN communication module, and the dedicated transformer data acquisition terminal is equipped with a second TSN communication module and a clock synchronization module; the method includes: The clock synchronization module performs clock synchronization between the energy meter and the dedicated transformer acquisition terminal based on the first protocol in the preset TSN protocol stack, the second TSN communication module, and the first TSN communication module. The electricity meter collects power data from the power network, including voltage data, current data, and power data. The electricity meter encapsulates the power data into frames based on the second protocol in the TSN protocol stack to obtain a service message, and sends the service message to the dedicated transformer data acquisition terminal through the first TSN communication module and the second TSN communication module.
[0007] As an optional implementation, the clock synchronization module performs clock synchronization between the energy meter and the dedicated transformer data acquisition terminal based on the first protocol in the preset TSN protocol stack, the second TSN communication module, and the first TSN communication module, including: Determine the target master clock and generate a target clock synchronization message based on the target master clock and the first protocol. The target clock synchronization message includes a reference time and a dwell time. The target clock synchronization message is sent to the energy meter through the second TSN communication module and the first TSN communication module so that the slave clock in the energy meter is synchronized with the target master clock in the dedicated transformer acquisition terminal.
[0008] As an optional implementation, determining the target master clock includes: If no positioning satellite signal is detected, the upstream clock is acquired and determined as the target master clock; the upstream clock is either the master station clock or the wireless public network clock. If the positioning satellite signal is detected, the clock corresponding to the positioning satellite signal is determined as the target master clock, and it is determined whether the clock switching conditions are met. If so, a clock smoothing switching algorithm is used to switch the target master clock from the clock corresponding to the positioning satellite signal to the upstream clock.
[0009] As an optional implementation, determining whether the clock switching condition is met includes: The clock corresponding to the positioning satellite signal is input into a pre-trained clock anomaly detection model to obtain the anomaly detection result of the clock corresponding to the positioning satellite signal. Based on the anomaly detection results of the clock corresponding to the positioning satellite signal, determine whether the clock switching conditions are met.
[0010] As an optional implementation, the method employs a clock smoothing algorithm to switch the target master clock from the clock corresponding to the positioning satellite signal to the upstream clock, including: Determine the instantaneous phase difference between the clock corresponding to the positioning satellite signal and the upstream clock; Based on the instantaneous phase difference, the target master clock is switched from the clock corresponding to the positioning satellite signal to the upstream clock.
[0011] As an optional implementation, generating a target clock synchronization message based on the target master clock and the first protocol includes: Generate a reference time based on the target master clock; Determine the dwell time of the PTP event message corresponding to the reference time in the dedicated transformer data acquisition terminal; According to the first protocol, the reference time is filled into the first field of the target clock synchronization message, and the dwell time is filled into the second field of the target clock synchronization message.
[0012] As an optional implementation, sending the target clock synchronization message to the energy meter includes: Based on the pre-configured mapping table between service flows and transmission priorities, the transmission priority of the target clock synchronization message is determined to be high priority; A target time transmission window is sent to the target clock synchronization message, and the target clock synchronization message is sent to the energy meter through the target time transmission window.
[0013] As an optional implementation, sending the target clock synchronization message to the energy meter through the target time transmission window includes: Using PRP, the target clock synchronization message is sent to the energy meter through the target time transmission window and dual independent networks, so that the energy meter retains the target clock synchronization message arriving at the first time and discards the target clock synchronization message arriving at the second time, wherein the first time is earlier than the second time.
[0014] As an optional implementation, sending the target clock synchronization message to the energy meter through the target time transmission window includes: Construct an HSR dual-ring redundant network and bind the message transmission paths of the dual rings to the target time transmission window; Using the HSR protocol, the target clock synchronization message is sent to the energy meter in parallel through a dual-ring and the target time transmission window, so that the energy meter retains the target clock synchronization message arriving at the third time and discards the target clock synchronization message arriving at the fourth time, wherein the third time is earlier than the fourth time.
[0015] As an optional implementation, the energy meter is also equipped with a transmission scheduling module; The step of sending the service message to the dedicated transformer data acquisition terminal through the first TSN communication module and the second TSN communication module includes: Add the service message to the transmission queue of the energy meter; The transmission scheduling module determines the service type of each message to be transmitted in the transmission queue; The transmission scheduling module determines the target message in the transmission queue based on the service type of each message to be transmitted in the transmission queue and the preset power service priority information, using the third protocol in the TSN protocol stack. The target message is sent to the dedicated transformer data acquisition terminal through the first TSN communication module and the second TSN communication module.
[0016] As an optional implementation, the energy meter is also equipped with a redundant transmission module; The method further includes: Real-time monitoring of the data transmission status of the electricity meter; If the data transmission status indicates that the energy meter has a transmission failure, the redundant transmission module constructs a redundant message based on the fourth protocol in the TSN protocol stack, and sends the redundant message to the dedicated transformer acquisition terminal through the first TSN communication module and the second TSN communication module.
[0017] Secondly, embodiments of this application provide a dedicated transformer data acquisition terminal, including: a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the dedicated transformer data acquisition terminal is running, the processor communicates with the memory via the bus, and the processor executes the machine-readable instructions to perform the steps of the energy meter communication method described in the first aspect above.
[0018] Thirdly, embodiments of this application provide an energy meter, including: a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the energy meter is running, the processor communicates with the memory via the bus, and the processor executes the machine-readable instructions to perform the steps of the energy meter communication method described in the first aspect above.
[0019] Fourthly, this application provides an energy meter communication system, which includes an energy meter and a dedicated transformer data acquisition terminal; the energy meter is equipped with a first TSN communication module, and the dedicated transformer data acquisition terminal is equipped with a second TSN communication module and a clock synchronization module. The electricity meter communication system is used to perform the steps of the electricity meter communication method described in the first aspect above.
[0020] Fifthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the electricity meter communication method described in the first aspect above.
[0021] The beneficial effects of this application are: This application provides a communication method for an electricity meter, a dedicated transformer data acquisition terminal, and an electricity meter. A first TSN communication module is deployed in the electricity meter, and a second TSN communication module and a clock synchronization module are deployed in the dedicated transformer data acquisition terminal. The clock synchronization module performs nanosecond-level clock synchronization between the electricity meter and the dedicated transformer data acquisition terminal based on a first protocol in a preset TSN protocol stack and the first TSN communication module, ensuring no time stamp deviation between the electricity meter and the dedicated transformer data acquisition terminal. The electricity meter collects power data in real time during the operation of the power network, including voltage, current, and power data. The electricity meter encapsulates the power data into frames according to the second protocol in the TSN protocol stack, generating a service message containing a timestamp, data type identifier, and verification fields. This service message is sent to the dedicated transformer data acquisition terminal through the first and second TSN communication modules, achieving deterministic transmission of power data between the electricity meter and the dedicated transformer data acquisition terminal. By synchronizing the electricity meter with the dedicated transformer data acquisition terminal at the nanosecond level and transmitting service messages between the first TSN communication module and the second TSN communication module, deterministic communication between the electricity meter and the dedicated transformer data acquisition terminal is achieved, thereby improving communication efficiency and quality. Attached Figure Description
[0022] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0023] Figure 1 This is a schematic diagram of the architecture of the electricity meter communication system provided in the embodiments of this application; Figure 2 A flowchart illustrating the communication method for electricity meters provided in this application embodiment. Figure 1 ; Figure 3 A flowchart illustrating the communication method for electricity meters provided in this application embodiment. Figure 2 ; Figure 4 A flowchart illustrating the communication method for electricity meters provided in this application embodiment. Figure 3 ; Figure 5 A flowchart illustrating the communication method for electricity meters provided in this application embodiment. Figure 4 ; Figure 6 A flowchart illustrating the communication method for electricity meters provided in this application embodiment. Figure 5 ; Figure 7 A flowchart illustrating the communication method for electricity meters provided in this application embodiment. Figure 6 ; Figure 8 A flowchart illustrating the communication method for electricity meters provided in this application embodiment. Figure 7 ; Figure 9 A flowchart illustrating the communication method for electricity meters provided in this application embodiment. Figure 8 ; Figure 10 A flowchart illustrating the communication method for electricity meters provided in this application embodiment. Figure 9 ; Figure 11 A flowchart illustrating the communication method for electricity meters provided in this application embodiment. Figure 10 ; Figure 12 This is a schematic diagram of the structure of the dedicated transformer data acquisition terminal provided in the embodiments of this application; Figure 13 This is a schematic diagram of the structure of an electricity meter provided in an embodiment of this application. Detailed Implementation
[0024] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the accompanying drawings in this application are for illustrative and descriptive purposes only and are not intended to limit the scope of protection of this application. Furthermore, it should be understood that the schematic drawings are not drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of this application. It should be understood that the operations in the flowcharts may not be implemented in sequence, and steps without logical contextual relationships may be reversed or implemented simultaneously. In addition, those skilled in the art, guided by the content of this application, may add one or more other operations to the flowcharts, or remove one or more operations from the flowcharts.
[0025] Furthermore, the described embodiments are merely some, not all, of the embodiments of this application. The components of the embodiments of this application described and illustrated herein can typically be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0026] It should be noted that the term "comprising" will be used in the embodiments of this application to indicate the presence of the features declared thereafter, but does not exclude the addition of other features.
[0027] In a power distribution network, the clock synchronization accuracy and deterministic latency of the dedicated transformer data acquisition terminal (DTMC) are crucial parameters limiting the efficiency of power grid operation when communicating with the main station and electricity meters. Currently, DTMCs primarily use the NTP protocol for clock synchronization, which suffers from low synchronization accuracy and poor stability, thus hindering deterministic communication between the DTMC and the main station and electricity meters. In other words, existing technologies for communication between DTMCs and electricity meters have certain limitations.
[0028] Based on the above-mentioned problems, this application provides a communication method for electricity meters. A first Time-Sensitive Network (TSN) communication module is deployed in the electricity meter, and a second TSN communication module and a clock synchronization module are deployed in the dedicated transformer data acquisition terminal. By applying TSN to the electricity meter system, deterministic communication between the electricity meter and the dedicated transformer data acquisition terminal is achieved.
[0029] Figure 1 This is a schematic diagram of the architecture of the electricity meter communication system provided in the embodiments of this application, such as... Figure 1 As shown, the electricity meter communication system includes an electricity meter and a dedicated transformer data acquisition terminal. The electricity meter is equipped with a first TSN communication module, a transmission scheduling module, and a redundant transmission module, while the dedicated transformer data acquisition terminal is equipped with a second TSN communication module and a clock synchronization module.
[0030] Specifically, refer to Figure 1 Based on the first TSN communication module deployed in the energy meter and the second TSN communication module and clock synchronization module deployed in the dedicated transformer data acquisition terminal, clock synchronization between the energy meter and the dedicated transformer data acquisition terminal is achieved through deterministic communication. Based on the transmission scheduling module deployed in the energy meter, priority transmission of service flows between the energy meter and the dedicated transformer data acquisition terminal is implemented. Based on the redundant transmission module deployed in the energy meter, redundant messages are used to promptly remedy transmission anomalies from the energy meter, improving data transmission quality.
[0031] Figure 2 A flowchart illustrating the communication method for electricity meters provided in this application embodiment. Figure 1 The execution subject of this method is Figure 1 The electricity meter communication system shown. (For example...) Figure 2 As shown, the method includes: S101, the clock synchronization module performs clock synchronization between the energy meter and the special transformer acquisition terminal based on the first protocol in the preset TSN protocol stack, the second TSN communication module, and the first TSN communication module.
[0032] Optionally, the clock synchronization module in the dedicated transformer data acquisition terminal initiates a clock synchronization request to the first TSN communication module of the energy meter through the second TSN communication module, based on the first protocol in the preset TSN protocol stack. After the energy meter responds to the clock synchronization request, it establishes a nanosecond-level time synchronization relationship with the data acquisition terminal. The power communication link between the second TSN communication module and the first TSN communication module is an Ethernet link, for example, a gigabit Ethernet link.
[0033] The first protocol can be the IEEE 802.1AS-Rev protocol, which is a time synchronization protocol in the TSN protocol stack. It provides a unified time awareness capability for the second TSN communication module in the dedicated transformer acquisition terminal and the first TSN communication module in the energy meter, so as to realize nanosecond-level clock synchronization between the energy meter and the dedicated transformer acquisition terminal, greatly improving the clock synchronization accuracy and stability between the energy meter and the dedicated transformer acquisition terminal, thereby ensuring deterministic communication between the energy meter and the dedicated transformer acquisition terminal.
[0034] In other words, nanosecond-level clock synchronization can ensure that the timestamps of the energy meter and the dedicated transformer data acquisition terminal are in sync, thus avoiding data transmission scheduling logic chaos caused by timing misalignment when transmitting data between the energy meter and the dedicated transformer data acquisition terminal.
[0035] S102. The electricity meter collects power data from the power network, including voltage data, current data, and power data.
[0036] Optionally, the electricity meter also has built-in data acquisition modules such as voltage transformers, current transformers, and power detection chips, which are used to collect power data in real time during the operation of the power network, including voltage data, current data, and power data.
[0037] The electricity meter stores the collected electricity data in a local cache so that the electricity data can be transmitted to the dedicated transformer data acquisition terminal when the terminal reads the meter.
[0038] S103. The electricity meter encapsulates the power data into frames based on the second protocol in the TSN protocol stack to obtain a service message, and sends the service message to the dedicated transformer acquisition terminal through the first TSN communication module and the second TSN communication module.
[0039] Optionally, the electricity meter encapsulates the electricity data into frames according to the second protocol in the TSN protocol stack, generating an electricity data frame containing a timestamp, data type identifier, and check field, and uses the electricity data frame as a service message. The timestamp in the service message is a timestamp synchronized with a nanosecond-level clock, and is identical to the timestamp of the dedicated transformer data acquisition terminal. The second protocol is the IEEE 802.1Qbv protocol, and the electricity meter encapsulates the collected electricity data into frames according to the IEEE 802.1Qbv protocol.
[0040] The first TSN communication module in the electricity meter transmits the encapsulated service message to the second TSN communication module in the dedicated transformer data acquisition terminal via an Ethernet link. The dedicated transformer data acquisition terminal parses the received service message according to the IEEE 802.1Qbv protocol, extracts the power data from the service message, and realizes deterministic transmission of power data between the electricity meter and the dedicated transformer data acquisition terminal.
[0041] In this embodiment, a first TSN communication module is deployed in the energy meter, and a second TSN communication module and a clock synchronization module are deployed in the dedicated transformer data acquisition terminal. The clock synchronization module performs nanosecond-level clock synchronization between the energy meter and the dedicated transformer data acquisition terminal based on the first protocol in the preset TSN protocol stack and the first TSN communication module, ensuring that the timestamps of the energy meter and the dedicated transformer data acquisition terminal are without deviation. The energy meter collects power data during the operation of the power network in real time, including voltage data, current data, and power data. The energy meter performs frame encapsulation of the power data according to the second protocol in the TSN protocol stack, generating a service message containing a timestamp, data type identifier, and verification field. The service message is sent to the dedicated transformer data acquisition terminal through the first and second TSN communication modules, realizing deterministic transmission of power data between the energy meter and the dedicated transformer data acquisition terminal. Through nanosecond-level clock synchronization between the energy meter and the dedicated transformer data acquisition terminal, and the transmission of service messages between the first and second TSN communication modules, deterministic communication between the energy meter and the dedicated transformer data acquisition terminal is achieved, improving communication efficiency and quality.
[0042] Figure 3 A flowchart illustrating the communication method for electricity meters provided in this application embodiment. Figure 2 ,like Figure 3 As shown, in step S101 above, the clock synchronization module performs clock synchronization between the energy meter and the dedicated transformer acquisition terminal based on the first protocol in the preset TSN protocol stack, the second TSN communication module, and the first TSN communication module, including: S201. Determine the target master clock and generate a target clock synchronization message based on the target master clock and the first protocol. The target clock synchronization message includes the reference time and dwell time.
[0043] Optionally, the dedicated transformer acquisition terminal selects the best clock source from multiple clock sources as the target master clock. The target master clock is a clock source used to unify the time reference between the dedicated transformer acquisition terminal and the electricity meter. The target master clock provides a unique time reference for the communication link between the dedicated transformer acquisition terminal and the electricity meter in the electricity meter communication system, which can avoid clock deviation caused by the independent operation of the clocks of the dedicated transformer acquisition terminal and the electricity meter.
[0044] The dedicated transformer data acquisition terminal generates a target clock synchronization message containing a reference time and dwell time according to the target master clock and the first protocol, namely the IEEE 802.1AS-Rev protocol. The reference time can be the current time of the target master clock, accurate to the nanosecond level, and serves as the reference time for calibrating the slave clock in the energy meter. The dwell time is the time taken from the dedicated transformer data acquisition terminal reading the current time of the target master clock to generating the target clock synchronization message and submitting it to the second TSN communication module. It characterizes the time delay in generating the target clock synchronization message internally within the dedicated transformer data acquisition terminal. After determining the dwell time, it is appended to the target clock synchronization message so that the energy meter combines the reference time and the dwell time when calibrating the slave clock, avoiding time deviations caused by the dwell time of the dedicated transformer data acquisition terminal.
[0045] S202. Send a target clock synchronization message to the energy meter through the second TSN communication module and the first TSN communication module so that the slave clock in the energy meter is synchronized with the target master clock in the dedicated transformer acquisition terminal.
[0046] Optionally, the second TSN communication module in the dedicated transformer acquisition terminal sends the target clock synchronization message to the first TSN communication module in the energy meter via an Ethernet link. Based on the reference time and dwell time delay in the received target clock synchronization message, the energy meter calculates the deviation between the slave clock and the target master clock, and fine-tunes the local slave clock of the energy meter according to the deviation, so that the slave clock of the energy meter is consistent with the target master clock of the dedicated transformer acquisition terminal, thereby achieving nanosecond-level clock synchronization.
[0047] The second TSN communication module sends the target clock synchronization message to the first TSN communication module via an Ethernet link, which is a deterministic communication that can ensure that the target clock synchronization message is transmitted to the energy meter stably and in a timely manner, avoiding time deviations caused by transmission delays.
[0048] In this embodiment, the dedicated transformer data acquisition terminal determines the target master clock and generates a target clock synchronization message containing a reference time and dwell time delay according to the first protocol based on the target master clock. The second TSN communication module in the dedicated transformer data acquisition terminal sends the target clock synchronization message to the first TSN communication module in the energy meter via an Ethernet link. The energy meter fine-tunes its local slave clock based on the reference time and dwell time delay in the target clock synchronization message, so that the slave clock of the energy meter is consistent with the target master clock of the dedicated transformer data acquisition terminal, achieving nanosecond-level clock synchronization.
[0049] Figure 4 A flowchart illustrating the communication method for electricity meters provided in this application embodiment. Figure 3 ,like Figure 4 As shown, determining the target master clock in step S201 above includes: S301. If no positioning satellite signal is detected, the upstream clock is acquired and determined as the target master clock; the upstream clock is the master station clock or the wireless public network clock.
[0050] Optionally, the dedicated transformer data acquisition terminal also has a built-in satellite receiving module, such as a BeiDou and / or Global Positioning System (GPS) module. When the satellite receiving module of the dedicated transformer data acquisition terminal does not detect a positioning satellite signal, it obtains an upstream clock as the target master clock from upstream of the dedicated transformer data acquisition terminal. The upstream clock is either the master station clock or the wireless public network clock, where the master station clock has higher priority than the wireless public network clock.
[0051] In other words, when the dedicated transformer data acquisition terminal is installed in obstructed areas such as indoors or basements, or when the positioning satellite signal is lost due to electromagnetic interference, the dedicated transformer data acquisition terminal obtains the upstream master station clock or the wireless public network clock as the target master clock. Among them, the wireless public network clock can be used as a backup clock when the master station clock is unavailable, that is, when the master station clock is unavailable, the wireless public network clock is used as the target master clock.
[0052] S302. If a positioning satellite signal is detected, the clock corresponding to the positioning satellite signal is determined as the target master clock, and it is determined whether the clock switching conditions are met.
[0053] Optionally, since the accuracy of the clock corresponding to the positioning satellite signal is usually at the nanosecond level, if the satellite receiving module of the dedicated transformer acquisition terminal detects the satellite signal, it will prioritize determining the clock corresponding to the positioning satellite signal as the target master clock to ensure the nanosecond-level accuracy of the target master clock.
[0054] After determining the clock corresponding to the positioning satellite signal as the target master clock, it is also necessary to monitor the stability of the clock corresponding to the positioning satellite signal in real time and dynamically to determine whether the clock switching conditions are met.
[0055] S303. If so, a clock smoothing switching algorithm is used to switch the target master clock from the clock corresponding to the positioning satellite signal to the upstream clock.
[0056] Optionally, if the clock corresponding to the positioning satellite signal is not stable enough and the clock switching conditions are met, a clock smooth switching algorithm is adopted to gradually and smoothly switch the target master clock from the clock corresponding to the positioning satellite signal to the upstream clock, so as to avoid clock jumps when switching clock sources.
[0057] In this embodiment, when the dedicated transformer data acquisition terminal does not detect a positioning satellite signal, the upstream clock is obtained from the upstream of the dedicated transformer data acquisition terminal as the target master clock. If the satellite receiving module of the dedicated transformer data acquisition terminal detects a satellite signal, the clock corresponding to the positioning satellite signal is determined as the target master clock, ensuring the nanosecond-level accuracy of the target master clock. After determining the clock corresponding to the positioning satellite signal as the target master clock, the stability of the clock corresponding to the positioning satellite signal is monitored in real time to determine whether the clock switching conditions are met. If the clock switching conditions are met, a clock smoothing switching algorithm is used to gradually and smoothly switch the target master clock from the clock corresponding to the positioning satellite signal to the upstream clock, avoiding clock jumps caused when switching clock sources.
[0058] Figure 5 A flowchart illustrating the communication method for electricity meters provided in this application embodiment. Figure 4 ,like Figure 5 As shown, determining whether the clock switching conditions are met in step S302 above includes: S401. Input the clock corresponding to the positioning satellite signal into the pre-trained clock anomaly detection model to obtain the anomaly detection result of the clock corresponding to the positioning satellite signal.
[0059] Optionally, the clock corresponding to the positioning satellite signal includes features such as real-time timestamp, clock drift rate, number of transitions, and signal-to-noise ratio. The clock anomaly detection model is based on machine learning algorithms to learn historical normal satellite clock data and abnormal samples, enabling it to detect anomalies in the clock corresponding to the positioning satellite signal.
[0060] The clock corresponding to the positioning satellite signal is input into a pre-trained clock anomaly detection model. The clock anomaly detection model performs anomaly detection based on features such as the real-time timestamp, clock drift rate, number of transitions, and signal-to-noise ratio of the clock corresponding to the positioning satellite signal, and obtains the anomaly detection result of the clock corresponding to the positioning satellite signal.
[0061] S402. Based on the anomaly detection results of the clock corresponding to the positioning satellite signal, determine whether the clock switching conditions are met.
[0062] Optionally, if the anomaly detection result of the clock corresponding to the positioning satellite signal indicates that the real-time timestamp, clock drift rate, number of jumps, signal-to-noise ratio, and other characteristics of the clock corresponding to the positioning satellite signal are all normal, then it is determined that the clock switching condition is not met, and the clock corresponding to the positioning satellite signal is still kept as the target master clock, without the need to switch to the upstream clock.
[0063] If the anomaly detection result of the clock corresponding to the positioning satellite signal indicates that any of the characteristics of the clock, such as the real-time timestamp, clock drift rate, number of jumps, or signal-to-noise ratio, are abnormal, then the clock switching condition is met. The target master clock needs to be smoothly switched from the clock corresponding to the positioning satellite signal to the upstream clock to maintain the stability of the target master clock.
[0064] In this embodiment, the clock corresponding to the positioning satellite signal is input into a pre-trained clock anomaly detection model. The clock anomaly detection model obtains the anomaly detection result of the clock corresponding to the positioning satellite signal based on the anomaly detection result. Based on the anomaly detection result, it is determined whether the clock switching condition is met, so that when the clock switching condition is met, the target master clock is smoothly switched from the clock corresponding to the positioning satellite signal to the upstream clock, thus maintaining the stability of the target master clock.
[0065] Figure 6 A flowchart illustrating the communication method for electricity meters provided in this application embodiment. Figure 5 ,like Figure 6 As shown, step S303 above employs a clock smoothing switching algorithm to switch the target master clock from the clock corresponding to the positioning satellite signal to the upstream clock, including: S501. Determine the instantaneous phase difference between the clock corresponding to the positioning satellite signal and the upstream clock.
[0066] Optionally, the dedicated transformer acquisition terminal acquires the first instantaneous value of the clock corresponding to the positioning satellite signal and the second instantaneous value of the upstream clock. Based on the difference between the first instantaneous value and the second instantaneous value, the instantaneous phase difference between the clock corresponding to the positioning satellite signal and the upstream clock is determined.
[0067] S502. Based on the instantaneous phase difference, switch the target master clock from the clock corresponding to the positioning satellite signal to the upstream clock.
[0068] Optionally, based on the instantaneous phase difference, a transition slope is determined, and the proportional-integral controller in the dedicated transformer acquisition terminal smoothly switches the target master clock from the clock corresponding to the positioning satellite signal to the upstream clock in a linear transition according to the transition slope.
[0069] By using a linear and smooth clock switching process, the target master clock can be switched from the clock corresponding to the positioning satellite signal to the upstream clock without any perceptible transition or clock jump, thus ensuring the accuracy of the target master clock.
[0070] In this embodiment, the dedicated transformer acquisition terminal determines the instantaneous phase difference between the clock corresponding to the positioning satellite signal and the upstream clock. Based on the instantaneous phase difference, it determines the transition slope. The proportional-integral controller in the dedicated transformer acquisition terminal then linearly and smoothly switches the target master clock from the clock corresponding to the positioning satellite signal to the upstream clock according to the transition slope. This achieves a seamless, clock-jump-free, and smooth clock switching, ensuring the accuracy of the target master clock.
[0071] Figure 7 A flowchart illustrating the communication method for electricity meters provided in this application embodiment. Figure 6 ,like Figure 7 As shown, step S201 above, which generates a target clock synchronization message based on the target master clock and the first protocol, includes: S601. Generate a reference time based on the target master clock.
[0072] Optionally, a nanosecond-level reference time is generated based on the target master clock of the dedicated transformer acquisition terminal, wherein the reference time is the current Coordinated Universal Time (UTC) time, and the UTC time is accurate to the nanosecond level.
[0073] S602. Determine the dwell time of the PTP event message corresponding to the reference time in the dedicated transformer acquisition terminal.
[0074] Optionally, a Precise Time Protocol (PTP) event message is generated based on the reference time. The dedicated transformer data acquisition terminal also includes a transparent clock, which records the dwell time of the PTP event message corresponding to the reference time in the dedicated transformer data acquisition terminal.
[0075] For example, the dwell time can be the time difference between the entry timestamp of the PTP event message corresponding to the reference time entering the dedicated transformer acquisition terminal and the exit timestamp of the physical port leaving the dedicated transformer acquisition terminal, representing the time consumed by the PTP event message corresponding to the reference time during processing inside the dedicated transformer acquisition terminal.
[0076] S603. According to the first protocol, fill the reference time into the first field of the target clock synchronization message and fill the dwell time into the second field of the target clock synchronization message.
[0077] Optionally, the reference time and dwell time delay are filled into the corresponding fields of the target clock synchronization message according to the first protocol, namely the IEEE 802.1AS-Rev protocol.
[0078] Specifically, according to the IEEE 802.1AS-Rev protocol, the reference time is filled into the first field of the target clock synchronization message, and the dwell time is filled into the second field of the target clock synchronization message to generate the target clock synchronization message. The dwell time in the target clock synchronization message is used to compensate for the dwell time of the PTP event message corresponding to the reference time within the dedicated transformer data acquisition terminal, eliminating internal delays within the dedicated transformer data acquisition terminal, achieving zero-deviation reference time transmission, and thus ensuring absolute clock alignment between the energy meter and the dedicated transformer data acquisition terminal.
[0079] In this embodiment, a nanosecond-level reference time is generated based on the target master clock of the dedicated transformer data acquisition terminal. A corresponding PTP event message is then generated based on this reference time. The dwell time of the PTP event message corresponding to the reference time within the dedicated transformer data acquisition terminal is recorded by the transparent clock in the terminal. According to the first protocol, the reference time is filled into the first field of the target clock synchronization message, and the dwell time is filled into the second field, generating the target clock synchronization message. By compensating for the dwell time of the PTP event message corresponding to the reference time within the dedicated transformer data acquisition terminal through dwell time compensation, the internal delay of the dedicated transformer data acquisition terminal is eliminated, achieving zero-deviation reference time transmission, thereby ensuring absolute clock alignment between the energy meter and the dedicated transformer data acquisition terminal.
[0080] Figure 8 A flowchart illustrating the communication method for electricity meters provided in this application embodiment. Figure 7 ,like Figure 8 As shown, sending a target clock synchronization message to the energy meter in step S102 above includes: S701. Based on the pre-configured mapping table between service flows and transmission priorities, determine that the transmission priority of the target clock synchronization message is high priority.
[0081] Optionally, a pre-configured mapping table of service flows and transmission priorities defines the mapping relationship between service flows and transmission priorities, wherein the higher the importance of the service flow, the higher the transmission priority.
[0082] The second TSN communication module of the dedicated transformer acquisition terminal queries the mapping table between service flow and transmission priority based on the service flow type of the target clock synchronization message, and identifies the transmission priority of the target clock synchronization message as high priority.
[0083] S702, Send the target time transmission window for the target clock synchronization message, and send the target clock synchronization message to the energy meter through the target time transmission window.
[0084] Optionally, the second TSN communication module of the dedicated transformer acquisition terminal, based on the time-aware scheduling of TSN, issues a dedicated target time transmission window for high-priority target clock synchronization messages during the transmission cycle of the Ethernet communication link. For example, only high-priority target clock synchronization messages are allowed to be transmitted in the first 100 microseconds of each transmission cycle, and other low-priority messages cannot be transmitted.
[0085] The second TSN communication module of the dedicated transformer data acquisition terminal sends a target clock synchronization message to the first TSN communication module of the energy meter through a dedicated target time transmission window in the Ethernet communication link. This avoids time transmission window conflicts with other service messages, enabling the energy meter to quickly receive the target clock synchronization message and synchronize its clock with the dedicated transformer data acquisition terminal.
[0086] In this embodiment, the second TSN communication module of the dedicated transformer data acquisition terminal queries the mapping table between service flow and transmission priority based on the service flow type of the target clock synchronization message, and identifies the transmission priority of the target clock synchronization message as high priority. Based on TSN time-aware scheduling, the second TSN communication module of the dedicated transformer data acquisition terminal issues a dedicated target time transmission window for the high-priority target clock synchronization message during the transmission cycle of the Ethernet communication link. It then sends the target clock synchronization message to the first TSN communication module of the energy meter through the issued dedicated target time transmission window in the Ethernet communication link, avoiding conflicts with the time transmission windows of other service messages. This allows the energy meter to quickly receive the target clock synchronization message and synchronize its clock with the dedicated transformer data acquisition terminal.
[0087] As an optional implementation, step S702 above, which involves sending a target clock synchronization message to the energy meter through a target time transmission window, includes: PRP is used to send target clock synchronization messages to the energy meter through the target time transmission window and dual independent networks, so that the energy meter retains the target clock synchronization message that arrives at the first time and discards the target clock synchronization message that arrives at the second time, wherein the first time is earlier than the second time.
[0088] Optionally, when using the Parallel Redundancy Protocol (PRP) to transmit the target clock synchronization message in parallel across two networks, two physically independent network links, i.e., two independent networks, are deployed between the dedicated transformer acquisition terminal and the energy meter. These links are either two Ethernet networks with different routes and have no intersection on the transmission path. This can prevent the loss of the target clock synchronization message due to a single link failure or electromagnetic interference.
[0089] Specifically, when the target time window is opened, the second TSN communication module of the dedicated transformer acquisition terminal simultaneously sends the same target clock synchronization message to the Ethernet links of the dual independent networks, i.e., two independent routes. The target clock synchronization messages transmitted by the dual independent networks are transmitted in parallel within the target time window. Due to the difference in the physical characteristics of the links, they will arrive at the first TSN communication module of the energy meter one after the other.
[0090] The energy meter retains only the target clock synchronization message that arrives at the first moment and uses it as a valid message for clock calibration immediately. If the target clock synchronization message that arrives at the second moment is the same as the target clock synchronization message that arrives at the first moment and has lower timeliness, the energy meter will directly discard the target clock synchronization message that arrives at the second moment to avoid clock jitter caused by repeated clock calibration.
[0091] In this embodiment, a dual independent network is deployed between the dedicated transformer data acquisition terminal and the energy meter. When the target time window opens, the second TSN communication module of the dedicated transformer data acquisition terminal simultaneously sends identical target clock synchronization messages to the dual independent networks, i.e., two independently routed Ethernet links. The target clock synchronization messages transmitted by the dual independent networks are transmitted in parallel within the target time window and arrive at the first TSN communication module of the energy meter sequentially. The energy meter only retains the target clock synchronization message arriving at the first moment and discards the target clock synchronization message arriving at the second moment to avoid clock jitter caused by repeated clock calibration.
[0092] Figure 9 A flowchart illustrating the communication method for electricity meters provided in this application embodiment. Figure 8 ,like Figure 9 As shown, in step S702 above, sending a target clock synchronization message to the energy meter through the target time transmission window includes: S801. Construct an HSR dual-ring redundant network and bind the message transmission paths of the dual rings to the target time transmission window.
[0093] Optionally, a High-availability Seamless Redundancy (HSR) dual-ring redundant network can be constructed. The dedicated transformer data acquisition terminal and the energy meter are connected to two physically independent ring links. The two rings (the main ring and the backup ring) share nodes, but the message transmission paths of the two rings are opposite. For example, the main ring transmits messages in a clockwise direction, and the backup ring transmits messages in a counterclockwise direction, avoiding message transmission failure due to the breakage of a single ring link.
[0094] By combining the Time-Aware Shaper (TAS) of TSN, the message transmission path of the dual rings is bound to the target time transmission window, so that the dual rings can only transmit target clock synchronization messages within the target time transmission window.
[0095] S802 uses the HSR protocol to send target clock synchronization messages to the energy meter in parallel through dual rings and target time transmission window, so that the energy meter retains the target clock synchronization message that arrives at the third time and discards the target clock synchronization message that arrives at the fourth time, where the third time is earlier than the fourth time.
[0096] Optionally, the HSR protocol is adopted. The dedicated transformer data acquisition terminal simultaneously sends the same target clock synchronization message to both the main ring and the backup ring within the target time transmission window. The target clock synchronization message in the main ring is transmitted clockwise, while the target clock synchronization message in the backup ring is transmitted counter-clockwise. Due to potential slight differences in the path length and link medium characteristics between the two rings, the target clock synchronization messages arrive at the energy meter at different times during parallel transmission, meaning the parallel transmission of target clock synchronization messages results in a sequential arrival at the energy meter.
[0097] The energy meter only retains the target clock synchronization message that arrives at the third time and uses it as a valid message for immediate clock calibration. If the target clock synchronization message that arrives at the fourth time is the same as the target clock synchronization message that arrives at the third time and has lower timeliness, the energy meter will directly discard the target clock synchronization message that arrives at the fourth time to avoid clock jitter caused by repeated clock calibration.
[0098] In this embodiment, an HSR dual-ring redundant network is constructed. The dedicated transformer data acquisition terminal and the energy meter are connected to two physically independent ring links. Combined with TSN time-aware shaping, the message transmission paths of the two rings are bound to the target time transmission window, ensuring that the two rings can only transmit target clock synchronization messages within the target time transmission window. Using the HSR protocol, the dedicated transformer data acquisition terminal simultaneously sends the same target clock synchronization message to both the main ring and the backup ring within the target time transmission window. The target clock synchronization messages transmitted in parallel arrive at the energy meter sequentially. The energy meter only retains the target clock synchronization message arriving at the third time and discards the target clock synchronization message arriving at the fourth time, avoiding clock jitter caused by repeated clock calibration.
[0099] Figure 10 A flowchart illustrating the communication method for electricity meters provided in this application embodiment. Figure 9 ,like Figure 10 As shown, in step S103 above, the service message is sent to the dedicated transformer data acquisition terminal through the first TSN communication module and the second TSN communication module, including: S901. Add the service message to the transmission queue of the energy meter.
[0100] Optionally, when the energy meter sends a service message to the dedicated transformer data acquisition terminal, the service message is added to the energy meter's transmission queue. The service messages can be categorized into different service types, including emergency alarm types, real-time parameter types, metering types, and statistical types.
[0101] For example, emergency alarm types may include differential protection messages, relay protection messages, and overcurrent messages.
[0102] S902, The service type of each message to be transmitted in the transmission queue is determined by the transmission scheduling module.
[0103] Optionally, the transmission scheduling module deployed in the electricity meter embeds a service type tag field in each message to be transmitted when generating each message to be transmitted, so as to determine the service type of each message to be transmitted in the transmission queue based on the service type tag field.
[0104] For example, the service type flag field of an emergency alarm type service message can be 0x01, the service type flag field of a real-time parameter type service message can be 0x02, and the service type flag field of a metering type service message can be 0x03. There are no specific restrictions on the service type flag field here.
[0105] The transmission scheduling module determines the service type of each message to be transmitted in the transmission queue by parsing the service type flag field of each message to be transmitted. For example, if the service type flag field of a message to be transmitted in the transmission queue is read as 0x01, the service type of the message to be transmitted can be quickly identified as an emergency alarm type.
[0106] S903. The transmission scheduling module determines the target message in the transmission queue based on the service type of each message to be transmitted in the transmission queue and the preset power service priority information, using the third protocol in the TSN protocol stack.
[0107] Optionally, based on the importance and real-time requirements of the business, power service priority information is preset as a scheduling rule table for the transmission scheduling module according to the third protocol. For example, an emergency alarm type is matched with a first transmission priority, a real-time parameter type with a second transmission priority, a metering type with a third transmission priority, and a statistics type with a fourth transmission priority. The first transmission priority is higher than the second transmission priority, the second transmission priority is higher than the third transmission priority, and the third transmission priority is higher than the fourth transmission priority.
[0108] The third protocol can be the IEEE 802.1Qci protocol, which uses preset power service priority information to schedule each message to be transmitted in the transmission queue based on priority.
[0109] Specifically, the transmission scheduling module traverses all the packets to be transmitted in the transmission queue, determines the transmission priority corresponding to the service type of each packet to be transmitted, sorts the transmission priorities from highest to lowest, and takes the packet to be transmitted corresponding to the service type with the highest transmission priority in the transmission queue as the target packet so as to transmit the target packet first.
[0110] For example, if there are three messages to be transmitted in the transmission queue, namely an emergency alarm type service message, a real-time parameter type service message, and a metering type service message, and the emergency alarm type service message has the highest priority, then the emergency alarm type service message will be transmitted as the target message with priority.
[0111] S904. The target message is sent to the dedicated transformer data acquisition terminal through the first TSN communication module and the second TSN communication module.
[0112] Optionally, the first TSN communication module in the energy meter sends the target message to the second TSN communication module of the dedicated transformer acquisition terminal according to the third protocol, namely the IEEE 802.1Qci protocol, so that the target message is preferentially transmitted to the dedicated transformer acquisition terminal.
[0113] In this embodiment, when the energy meter sends a service message to the dedicated transformer data acquisition terminal, the service message is added to the energy meter's transmission queue. The transmission scheduling module deployed in the energy meter embeds a service type marker field into each message to be transmitted when generating the message to be transmitted, and determines the service type of each message to be transmitted in the transmission queue based on the service type marker field. The transmission scheduling module determines the highest priority target message in the transmission queue based on the service type of each message to be transmitted in the transmission queue and the preset power service priority information, using the third protocol in the TSN protocol stack. The target message is then sent to the dedicated transformer data acquisition terminal through the first TSN communication module and the second TSN communication module, achieving efficient identification of the service type of each message to be transmitted in the transmission queue and classifying it into the corresponding priority transmission queue, ensuring priority transmission of the highest priority target message in the transmission queue.
[0114] Figure 11 A flowchart illustrating the communication method for electricity meters provided in this application embodiment. Figure 10 ,like Figure 11 As shown, the method also includes: S1001. Real-time monitoring of the data transmission status of the electricity meter.
[0115] Optionally, the electricity meter determines the data transmission status by real-time monitoring of message confirmation frame feedback, link error codes, message retransmission counts, or TSN time window transmission success rate.
[0116] For example, after receiving a service message, the dedicated transformer data acquisition terminal will return an acknowledgment frame within a preset time. If no acknowledgment frame is received from the dedicated transformer data acquisition terminal within the preset time, it is determined that the data transmission status of the electricity meter is abnormal.
[0117] S1002. If the data transmission status indicates that the energy meter has a transmission failure, the redundant transmission module constructs a redundant message based on the fourth protocol in the TSN protocol stack, and sends the redundant message to the dedicated transformer acquisition terminal through the first TSN communication module and the second TSN communication module.
[0118] Optionally, if a transmission failure is determined based on the data transmission status of the energy meter, the redundant transmission module deployed in the energy meter constructs redundant messages based on the fourth protocol in the TSN protocol stack. The fourth protocol is the IEEE 802.1CB protocol. The IEEE 802.1CB protocol is used to achieve redundant transmission of the message to be transmitted when there is a transmission failure such as link termination or data packet loss between the energy meter and the dedicated transformer acquisition terminal, so as to ensure that the message to be transmitted is successfully delivered to the dedicated transformer acquisition terminal.
[0119] Specifically, the redundant transmission module generates redundant messages based on the fourth protocol, namely the IEEE 802.1CB protocol, for messages that fail to be transmitted. The timestamp, checksum, and other contents of the redundant messages are completely consistent with those of the messages to be transmitted.
[0120] The electricity meter sends redundant messages to the second TSN communication module of the dedicated transformer data acquisition terminal through the first TSN communication module. The transmission path of the redundant messages is completely different from the transmission path of the messages to be transmitted that failed to be transmitted, which can improve the reliability of the transmission of redundant messages to the dedicated transformer data acquisition terminal.
[0121] In this embodiment, the electricity meter monitors the data transmission status of the electricity meter in real time. If the data transmission status indicates that the electricity meter has a transmission failure, the redundant transmission module in the electricity meter constructs a redundant message based on the fourth protocol in the TSN protocol stack, and sends the redundant message to the second TSN communication module of the dedicated transformer acquisition terminal through the first TSN communication module, thereby improving the reliability of the redundant message transmission to the dedicated transformer acquisition terminal.
[0122] This application also provides a dedicated transformer data acquisition terminal, such as... Figure 12 The diagram shows the structure of a dedicated transformer data acquisition terminal provided in this embodiment, including a first processor 121, a first memory 122, and a first bus 123. The first memory 122 stores machine-readable instructions executable by the first processor 121. When the dedicated transformer data acquisition terminal is running, the first processor 121 and the first memory 122 communicate via the first bus 123. When the machine-readable instructions are executed by the first processor 121, the steps of the energy meter communication method in the above embodiment are performed.
[0123] This application also provides an electricity meter, such as... Figure 13 The diagram shown is a schematic representation of the structure of an energy meter provided in an embodiment of this application, including: a second processor 131, a second memory 132, and a second bus 133. The second memory 132 stores machine-readable instructions executable by the second processor 131. When the energy meter is running, the second processor 131 and the second memory 132 communicate via the second bus 133. When the machine-readable instructions are executed by the second processor 131, the steps of the energy meter communication method in the above embodiment are performed.
[0124] This application also provides an energy meter communication system, such as... Figure 1 As shown, the electricity meter communication system includes: an electricity meter and a dedicated transformer acquisition terminal; the electricity meter is equipped with a first TSN communication module, and the dedicated transformer acquisition terminal is equipped with a second TSN communication module and a clock synchronization module.
[0125] The electricity meter communication system is used to perform the steps of the electricity meter communication method described in the above embodiments.
[0126] This application also provides a computer-readable storage medium storing a computer program, which is executed by the first processor 121 and / or the second processor 131 to perform the steps of the electricity meter communication method described in the above embodiments.
[0127] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems and devices described above can be referred to the corresponding processes in the method embodiments, and will not be repeated here. In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection can be through some communication interfaces; the indirect coupling or communication connection of devices or modules can be electrical, mechanical, or other forms.
[0128] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. If the functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes: USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, optical disks, and other media capable of storing program code.
[0129] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.
Claims
1. A communication method for an electricity meter, characterized in that, An application is made in an electricity meter communication system, the electricity meter communication system comprising: an electricity meter and a dedicated transformer data acquisition terminal; the electricity meter is equipped with a first TSN communication module, and the dedicated transformer data acquisition terminal is equipped with a second TSN communication module and a clock synchronization module; the method includes: The clock synchronization module performs clock synchronization between the energy meter and the dedicated transformer acquisition terminal based on the first protocol in the preset TSN protocol stack, the second TSN communication module, and the first TSN communication module. The electricity meter collects power data from the power network, including voltage data, current data, and power data. The electricity meter encapsulates the power data into frames based on the second protocol in the TSN protocol stack to obtain a service message, and sends the service message to the dedicated transformer acquisition terminal through the first TSN communication module and the second TSN communication module.
2. The method according to claim 1, characterized in that, The clock synchronization module performs clock synchronization between the energy meter and the dedicated transformer data acquisition terminal based on the first protocol in the preset TSN protocol stack, the second TSN communication module, and the first TSN communication module, including: Determine the target master clock, and generate a target clock synchronization message based on the target master clock and the first protocol. The target clock synchronization message includes a reference time and a dwell time. The target clock synchronization message is sent to the energy meter through the second TSN communication module and the first TSN communication module so that the slave clock in the energy meter is synchronized with the target master clock in the dedicated transformer acquisition terminal.
3. The method according to claim 2, characterized in that, The determination of the target master clock includes: If no positioning satellite signal is detected, the upstream clock is acquired and determined as the target master clock; the upstream clock is either the master station clock or the wireless public network clock. If the positioning satellite signal is detected, the clock corresponding to the positioning satellite signal is determined as the target master clock, and it is determined whether the clock switching conditions are met. If so, a clock smoothing switching algorithm is used to switch the target master clock from the clock corresponding to the positioning satellite signal to the upstream clock.
4. The method according to claim 3, characterized in that, Determining whether the clock switching conditions are met includes: The clock corresponding to the positioning satellite signal is input into a pre-trained clock anomaly detection model to obtain the anomaly detection result of the clock corresponding to the positioning satellite signal. Based on the anomaly detection results of the clock corresponding to the positioning satellite signal, determine whether the clock switching conditions are met.
5. The method according to claim 3, characterized in that, The step of employing a clock smoothing switching algorithm to switch the target master clock from the clock corresponding to the positioning satellite signal to the upstream clock includes: Determine the instantaneous phase difference between the clock corresponding to the positioning satellite signal and the upstream clock; Based on the instantaneous phase difference, the target master clock is switched from the clock corresponding to the positioning satellite signal to the upstream clock.
6. The method according to claim 2, characterized in that, The step of generating a target clock synchronization message based on the target master clock and the first protocol includes: Generate a reference time based on the target master clock; Determine the dwell time of the Precision Time Protocol (PTP) event message corresponding to the reference time in the dedicated transformer data acquisition terminal; According to the first protocol, the reference time is filled into the first field of the target clock synchronization message, and the dwell time is filled into the second field of the target clock synchronization message.
7. The method according to claim 2, characterized in that, Sending the target clock synchronization message to the electricity meter includes: Based on the pre-configured mapping table between service flows and transmission priorities, the transmission priority of the target clock synchronization message is determined to be high priority; A target time transmission window is sent to the target clock synchronization message, and the target clock synchronization message is sent to the energy meter through the target time transmission window.
8. The method according to claim 7, characterized in that, Sending the target clock synchronization message to the energy meter through the target time transmission window includes: The Parallel Redundancy Protocol (PRP) is used to send the target clock synchronization message to the energy meter through the target time transmission window and dual independent networks, so that the energy meter retains the target clock synchronization message arriving at the first time and discards the target clock synchronization message arriving at the second time, wherein the first time is earlier than the second time.
9. The method according to claim 7, characterized in that, Sending the target clock synchronization message to the energy meter through the target time transmission window includes: Construct a highly available, seamless, redundant HSR dual-ring redundant network and bind the message transmission paths of the dual rings to the target time transmission window; Using the HSR protocol, the target clock synchronization message is sent to the energy meter in parallel through a dual-ring and the target time transmission window, so that the energy meter retains the target clock synchronization message arriving at the third time and discards the target clock synchronization message arriving at the fourth time, wherein the third time is earlier than the fourth time.
10. The method according to claim 1, characterized in that, The electricity meter is also equipped with a transmission scheduling module; The step of sending the service message to the dedicated transformer data acquisition terminal through the first TSN communication module and the second TSN communication module includes: Add the service message to the transmission queue of the energy meter; The transmission scheduling module determines the service type of each message to be transmitted in the transmission queue; The transmission scheduling module determines the target message in the transmission queue based on the service type of each message to be transmitted in the transmission queue and the preset power service priority information, using the third protocol in the TSN protocol stack. The target message is sent to the dedicated transformer data acquisition terminal through the first TSN communication module and the second TSN communication module.
11. The method according to claim 1, characterized in that, The energy meter is also equipped with redundant transmission modules; The method further includes: Real-time monitoring of the data transmission status of the electricity meter; If the data transmission status indicates that the energy meter has a transmission failure, the redundant transmission module constructs a redundant message based on the fourth protocol in the TSN protocol stack, and sends the redundant message to the dedicated transformer acquisition terminal through the first TSN communication module and the second TSN communication module.
12. A dedicated transformer data acquisition terminal, characterized in that, include: The device includes a processor, a memory, and a bus. The memory stores machine-readable instructions that the processor can execute. When the dedicated transformer data acquisition terminal is running, the processor communicates with the memory via the bus. The processor executes the machine-readable instructions and performs the steps of the energy meter communication method as described in any one of claims 1 to 11.
13. An electricity meter, characterized in that, include: The device includes a processor, a memory, and a bus. The memory stores machine-readable instructions that the processor can execute. When the energy meter is running, the processor communicates with the memory via the bus, and the processor executes the machine-readable instructions to perform the steps of the energy meter communication method as described in any one of claims 1 to 11.
14. A communication system for an electricity meter, characterized in that, The electricity meter communication system includes: an electricity meter and a dedicated transformer data acquisition terminal; the electricity meter is equipped with a first TSN communication module, and the dedicated transformer data acquisition terminal is equipped with a second TSN communication module and a clock synchronization module; The electricity meter communication system is used to perform the steps of the electricity meter communication method according to any one of claims 1-11.
Citation Information
Patent Citations
Clock synchronization method and device, network equipment, converter and storage medium
CN115397004A
Meter reading method of electricity consumption information acquisition terminal
CN117641157A
Time synchronization method, server and system, and storage medium
WO2017000480A1
Clock synchronization method and device for electric energy meter, computer device and storage medium
WO2019205498A1