Low-voltage transformer area electric energy meter time synchronization method and system based on swarm intelligence
By performing bidirectional message exchange and consensus algorithm calculation among the electricity meter nodes in the low-voltage distribution area, the problem of single-point master clock dependence in the existing technology is solved, achieving high-precision, low-overhead time synchronization, which is suitable for the distributed expansion of large-scale low-voltage distribution areas.
Patent Information
- Application Number
- CN202511687319.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-18
- Publication Date
- 2026-02-27
AI Technical Summary
Existing time synchronization methods for low-voltage distribution area electricity meters rely on a single-point master clock, which is susceptible to network latency and jitter. It is difficult to achieve a balance between synchronization accuracy, robustness, and low-cost deployment, and synchronization quality is difficult to maintain in time-varying and packet-loss-prone communication environments.
By adopting a swarm intelligence-based approach, neighborhood information is collected through bidirectional message exchange between electricity meter nodes within the transformer area. A consensus algorithm is used to calculate clock deviation and drift rate, and a software compensation method is employed to adjust the virtual synchronization time. Combined with adaptive adjustment of the synchronization cycle interval and convergence step size, high-precision and low-overhead time synchronization is achieved.
In time-varying and packet-loss-prone communication environments, it achieves high-precision, low-jitter, and highly robust time synchronization, avoiding time jump problems caused by hardware clock rollback, and is suitable for distributed expansion of large-scale low-voltage distribution areas.
Smart Images

Figure CN121585299A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of smart grid and power distribution automation, and particularly relates to a low-voltage transformer area electric energy meter time synchronization method and system based on swarm intelligence. BACKGROUND
[0002] The intelligent electric energy meter of the low-voltage power distribution transformer area needs to work under a unified time reference to ensure the accuracy and comparability of time-of-use (TOU) tariff settlement, load control, event sequencing and out-of-limit alarm. The existing time synchronization mode adopts a master-slave synchronization mode in which a concentrator and a total meter of the transformer area are used as master clocks and each electric energy meter is used as a slave clock, and the time is adjusted by relying on periodic broadcasting. However, this mode has the problems of dependence on a single master clock and communication link, susceptibility to network time delay and jitter, difficulty in simultaneously meeting the requirements of synchronization accuracy, robustness and low-cost deployment after the scale of the transformer area is expanded, single-point failure and insufficient scalability.
[0003] In an actual transformer area environment, the quality of the low-voltage carrier wave and the wireless link is time-varying, which is manifested as message success rate fluctuation, signal-to-noise ratio fluctuation and time delay jitter. These factors will be transmitted to the timestamp error and reduce the consistency between terminals. The traditional time synchronization mechanism relying on fixed period and fixed parameters is difficult to respond to the changes in link quality and node stability in a timely manner, and it is difficult to dynamically balance between synchronization accuracy and communication energy consumption.
[0004] In addition, some schemes directly adjust the terminal hardware clock to eliminate the deviation, which is easy to introduce time jump or rollback risk, and is not conducive to the monotonicity maintenance of settlement records and event logs. In order to avoid this problem, the industry gradually focuses on outputting a unified time compensated at the software layer as a business timestamp and scheduling basis, but how to obtain stable and reliable deviation and drift rate estimates for software compensation still lacks a systematic solution path for the power supply and utilization scene.
[0005] At the same time, the existing centralized method usually does not fully utilize the relative time information and neighborhood state information available between the meters, and it is difficult to maintain synchronization quality when the master clock is unavailable for a short time or the link is degraded. When facing heterogeneous nodes and uneven links, there is a lack of mechanism for weighting and sensing neighbor information according to multi-dimensional indicators such as message success rate, signal-to-noise ratio and historical stability, which leads to the consensus process being easily disturbed by abnormal nodes or poor links. SUMMARY
[0006] In view of the above existing problems, the present application is proposed.
[0007] Therefore, the present application provides a low-voltage transformer area electric energy meter time synchronization method based on swarm intelligence to solve the problem of electric energy meters relying on a single master clock in a time-varying, packet-loss-prone and asymmetric time delay communication environment.
[0008] To solve the above technical problems, the present application provides the following technical solutions: In the first aspect, the present application provides a low-voltage area electric energy meter time synchronization method based on swarm intelligence, which includes publishing reference time information obtained by an area collection terminal to electric energy meter nodes in the area, based on the reference time information, the electric energy meter nodes exchange messages with neighbor electric energy meter nodes in the communication range to collect neighborhood information sets.
[0009] The neighborhood information sets are subjected to a swarm intelligence consistency algorithm to calculate the deviation of the electric energy meter's own clock from the network average time and the drift rate representing the change in the unit time deviation.
[0010] Based on the time deviation and the drift rate, a software compensation method is used to adjust the virtual synchronization time provided by the electric energy meter node to the outside.
[0011] According to the synchronization error monitored by the electric energy meter node, the synchronization state is determined through a set threshold value, and the synchronization cycle interval and the convergence step are adaptively adjusted.
[0012] As a preferred scheme of the low-voltage area electric energy meter time synchronization method based on swarm intelligence, the method includes collecting neighborhood information sets by exchanging messages in both directions, which includes sending a request message by an electric energy meter node defined as the initiator of the message exchange request, recording the sending time, receiving the response message from the neighbor electric energy meter node, recording the arrival time, and immediately sending a response message, wherein the response message contains the arrival time of the request message and the time of sending the response message, and carries the local time of the electric energy meter node. The electric energy meter node defined as the initiator of the message exchange request, The electric energy meter node defined as the initiator of the message exchange request, The neighbor electric energy meter node in the node communication range.
[0013] The electric energy meter node defined as the initiator of the message exchange request, The electric energy meter node defined as the initiator of the message exchange request, Sends a request message and records the sending time .
[0014] The electric energy meter node defined as the initiator of the message exchange request, Records the arrival time after receiving the request message , and immediately sends a response message, wherein the response message contains the arrival time of the request message and the time of sending the response message, and carries the local time of the electric energy meter node. The electric energy meter node defined as the initiator of the message exchange request,
[0015] The electric energy meter node defined as the initiator of the message exchange request, Records the arrival time after receiving the response message .
[0016] Based on the sending time and the arrival time of the message, the transmission delay and the relative clock deviation measurement value between the electric energy meter node and the electric energy meter node are calculated.
[0017] wherein, Indicates the electricity meter i and the electricity meter Transmission delay between; Indicates electricity meter The time when the request message was sent; This indicates that a request message has arrived at the electricity meter. Time; Indicates electricity meter The time when the response message was sent; Indicates electricity meter The time when the response message was received.
[0018] in, Indicates the electricity meter i and the electricity meter The relative clock offset between them; Indicates electricity meter The time when the request message was sent; This indicates that a request message has arrived at the electricity meter. Time; Indicates electricity meter The time when the response message was sent; Indicates electricity meter The time when the response message was received.
[0019] During a two-way message exchange, the electricity meter Statistics and electricity meters The message success rate is measured and the signal-to-noise ratio (SNR) is read; the message success rate is measured by the energy meter. and electricity meter The signal-to-noise ratio (SNR) is the ratio of the number of successfully received and verified messages to the total number of transmission attempts during communication; the SNR is the ratio of the signal power to the noise power measured at the receiver.
[0020] Based on transmission delay, relative clock deviation measurements, and electricity meter readings. The local time, message success rate, and signal-to-noise ratio constitute the neighborhood information set.
[0021] As a preferred embodiment of the low-voltage distribution area electricity meter time synchronization method based on swarm intelligence described in this invention, the calculation of the deviation of the electricity meter's own clock relative to the network average time and the drift rate representing the change in deviation per unit time includes iteratively updating the local state vector of each electricity meter based on the neighborhood information set using a consensus algorithm to estimate the deviation and drift rate of its own clock relative to the network average time.
[0022] The consensus algorithm includes updating the local state vector of each energy meter node using a combination of consensus terms and relative measurement correction terms. And use convergent step size control the amplitude and speed of the local state vector correction in each iteration; denotes the deviation of the local time of node i from the network average time; the network average time is the unified time reference of the whole network; denotes the drift rate.
[0023] the consistency term includes, in each round of update, the electric energy meter i makes the local state vector and the state vector of the neighbor electric energy meter j difference and weighted sum, so that converges to the average level of the neighbor electric energy meter state vector at the same time.
[0024] the relative measurement correction term includes, based on the obtained relative clock deviation measurement value of the electric energy meter i and the neighbor electric energy meter j directly corrects the deviation of the local time of the electric energy meter i from the network average time ; the correction only acts on , and does not directly modify the drift rate component , so as to maintain the stability of the frequency estimation and improve the stability of the overall convergence.
[0025] wherein, denotes the local clock state vector of the electric energy meter i obtained after the kth round of iteration; denotes the local state vector of the electric energy meter obtained after the kth round of iteration; denotes the local state vector of the electric energy meter obtained after the kth round of iteration; denotes the local state vector of the electric energy meter denotes the convergence step and is less than 1; denotes the time-varying confidence weight; denotes the relative clock deviation measurement value obtained by the bidirectional packet exchange; denotes the deviation of the local time of the electric energy meter from the network average time obtained after the kth round of iteration; denotes the convergence step for controlling the amplitude of each round of update; denotes the neighbor electric energy meter set of the electric energy meter ; and denotes the iteration period.
[0026] As a preferred scheme of the low-voltage area electric energy meter time synchronization method based on swarm intelligence, wherein: the swarm intelligence consistency algorithm for the neighborhood information set comprises, in the consistency algorithm, at the kth iteration, the neighborhood electric energy meter of the electric energy meter i Setting time-varying confidence weight for weighted fusion of neighborhood information and convergence of the local state vector to the average level of the neighbor electric energy meter state vector.
[0027] The time-varying confidence weight is calculated based on the neighborhood information set: Wherein, indicates the confidence weight of the electric energy meter j in the kth round; indicates the electric energy meter i to the electric energy meter j The signal-to-noise ratio obtained in the kth round iteration of the link; indicates the electric energy meter i to the electric energy meter j The message success rate statistically obtained in the kth round iteration; indicates the historical stability factor of the electric energy meter i ; indicates the electric energy meter i to the electric energy meter m The signal-to-noise ratio obtained in the kth round iteration of the link; indicates the message success rate statistically obtained by the electric energy meter i to the electric energy meter m in the kth round iteration; indicates the historical stability factor of the electric energy meter m indicates any neighbor electric energy meter of the electric energy meter i
[0028] As a preferred scheme of the low-voltage area electric energy meter time synchronization method based on swarm intelligence, wherein: the software compensation method is used to adjust the virtual synchronization time provided by the electric energy meter node based on the obtained clock deviation and drift rate, which comprises, without modifying the hardware clock chip of the electric energy meter itself, reading the local hardware clock time and combining the clock deviation and drift rate obtained by the consistency iteration algorithm, calculating and outputting the virtual synchronization time online by the program running on the electric energy meter processor.
[0029] The virtual synchronization time is a unified time reference as a data timestamp and scheduling alignment without directly adjusting the hardware clock.
[0030] Wherein, indicates the virtual synchronization time; indicates the local hardware clock time; denotes a drift rate estimate; denotes a clock bias estimate.
[0031] As a preferred scheme of the low-voltage area electric energy meter time synchronization method based on swarm intelligence, the adaptive adjustment of the synchronization cycle interval and the convergence step size comprises adjusting the synchronization cycle interval and the convergence step size through intelligent decision of double thresholds: Step one: define a synchronization error threshold and .
[0032] Step two: if the current synchronization error , it is determined that the synchronization state is deteriorating, a non-periodic synchronization process is triggered immediately, and the interval of the next synchronization cycle is shortened; the synchronization error is the absolute value of the deviation between the virtual synchronization time provided by the node to the outside and the network average time, which is monitored by each electric energy meter node at each synchronization cycle k; the non-periodic synchronization process comprises performing an additional bidirectional message exchange and performing a consistent iteration correction once; the interval of the synchronization cycle is the time length between the current time synchronization end and the planned initiation of the next regular time synchronization.
[0033] If the synchronization error of three or more consecutive cycles satisfies , it is determined that the synchronization state is stable, and the interval of the next synchronization cycle is extended.
[0034] Step three: adjust the convergence step size according to the synchronization cycle interval , reduce to maintain convergence stability when the synchronization cycle interval is extended; increase to speed up the convergence rate when the synchronization cycle interval is shortened.
[0035] In a second aspect, the application provides a low-voltage area electric energy meter time synchronization system based on swarm intelligence, comprising a collection module: publishing reference time information obtained by an area collection terminal to electric energy meter nodes in the area, based on the reference time information, the electric energy meter nodes perform bidirectional message exchange with neighbor electric energy meter nodes within the communication range to collect neighborhood information sets.
[0036] A calculation module: using a swarm intelligence consistency algorithm on the neighborhood information set, calculating the deviation of the electric energy meter's own clock from the network average time and the drift rate representing the change in the deviation per unit time.
[0037] A software compensation module: based on the time deviation and the drift rate, adjusting the virtual synchronization time provided by the electric energy meter node to the outside using a software compensation method.
[0038] An adjustment module: according to the synchronization error monitored by the electric energy meter node, determining the synchronization state through a set threshold, and adaptively adjusting the synchronization cycle interval and the convergence step size.
[0039] In a third aspect, the present application provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and wherein the computer program, when executed by the processor, implements any step of the method for synchronizing low-voltage transformer area electric energy meters based on swarm intelligence according to the first aspect of the present application.
[0040] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements any step of the method for synchronizing low-voltage transformer area electric energy meters based on swarm intelligence according to the first aspect of the present application.
[0041] The present application has the following advantages: through the cooperative design of neighbor bidirectional time stamp measurement, consistency iteration and relative measurement correction, the clock deviation and drift rate of each electric energy meter converge to the weighted average of the neighbor set, and when the error increases, the synchronization cycle interval is shortened and the convergence step is increased by means of a double-threshold adaptive strategy, so as to quickly pull the synchronization error back within the threshold; in the stable stage, the cycle is lengthened and the step is reduced to suppress the slight noise and reduce the time synchronization message and power consumption, thereby realizing the dynamic compromise of high precision and low cost; the time-varying confidence weight calculated according to the message success rate, signal-to-noise ratio and historical stability is introduced to weaken the interference of abnormal nodes and deteriorated links on consistency, thereby significantly improving the time synchronization robustness; the virtual synchronization time compensated by software is used to avoid the time jump problem caused by hardware clock rollback, thereby ensuring the monotonicity and smoothness of the business time stamp and facilitating the scheduling alignment; at the same time, the method is decentralized and dependent, and is easy to be distributed and expanded in a large-scale low-voltage transformer area, and only light calculation and a small amount of messages are required at the end side, so it is easy to be implemented in engineering. BRIEF DESCRIPTION OF DRAWINGS
[0042] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed in the embodiment description. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0043] Figure 1 The flowchart of the method for synchronizing low-voltage transformer area electric energy meters based on swarm intelligence.
[0044] Figure 2 The system network topology diagram of the method for synchronizing low-voltage transformer area electric energy meters based on swarm intelligence.
[0045] Figure 3 The overall flowchart of the method for synchronizing low-voltage transformer area electric energy meters based on swarm intelligence.
[0046] Figure 4A two-way message exchange timing diagram for a low-voltage area electric energy meter time synchronization method based on swarm intelligence.
[0047] Figure 5 A consistency algorithm iteration flowchart for a low-voltage area electric energy meter time synchronization method based on swarm intelligence. DETAILED DESCRIPTION
[0048] In order to make the above objectives, characteristics and advantages of the present application more apparent, specific embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0049] In the following description, a large number of specific details are set forth in order to facilitate a thorough understanding of the present application, but the present application can also be implemented in other ways different from those described herein, and those skilled in the art can make similar generalizations without departing from the connotation of the present application, therefore the present application is not limited by the specific embodiments disclosed below.
[0050] Secondly, "one embodiment" or "embodiment" referred to herein means that a specific feature, structure or characteristic can be included in at least one implementation of the present application. "In one embodiment" appearing in different places in the specification does not mean the same embodiment, nor is it an embodiment that is independent or alternative to other embodiments.
[0051] Embodiment 1, Reference Figures 1-5 For one embodiment of the present application, the embodiment provides a low-voltage area electric energy meter time synchronization method based on swarm intelligence, comprising the following steps: S1: publishing the reference time information obtained by the area collection terminal to the electric energy meter nodes in the area, based on the reference time information, the electric energy meter nodes perform two-way message exchange with the neighbor electric energy meter nodes within the communication range to collect the neighborhood information set.
[0052] As Figure 2 A local time synchronization and communication domain at the area level is shown: taking the area collection terminal as the center node and the surrounding multiple electric energy meters as slave nodes, a one-to-many coverage is formed together and supports interconnection between adjacent meters. The terminal provides time reference and dispatching, the electric energy meter receives the reference, exchanges messages and performs consistency synchronization, embodying the system form of centralized coordination and distributed cooperation.
[0053] As Figure 4 The electric energy meter and the two-way message time synchronization process of the electric energy meter : the electric energy meter sends a request message to at time , receives and records time , and immediately returns a response message at time , Receive and record time Based on these four time scales, the link transmission delay and clock deviation measurement results between the two tables can be obtained, which can be used for subsequent time synchronization correction and consistency update.
[0054] By employing a design that combines bidirectional neighbor message exchange with synchronous acquisition of link quality metrics, the system can simultaneously obtain the relative time difference between adjacent energy meters, round-trip transmission delay, and link message success rate and signal-to-noise ratio in a single interaction. Round-trip timestamps can offset uncertainties in single-end transmission and reception, providing the consensus algorithm with observational inputs that can both quantify errors and assess reliability. Accordingly, during the update process, high-quality links are given higher weight, the impact of inferior or abnormal nodes is reduced, and the convergence speed and steady-state accuracy of time deviation and drift estimation are improved. Fluctuations in success rate and delay serve as the triggering basis for adaptively adjusting the synchronization period and convergence step size. Ultimately, the system achieves low jitter, high robustness, low communication, and low energy consumption time synchronization effects in time-varying, packet-loss-prone, and topology-disruptive scenarios. Furthermore, relying on local neighborhood exchange facilitates large-scale deployment and maintenance within existing power distribution information acquisition systems.
[0055] The process of collecting neighborhood information by bidirectional message exchange includes... Defined as the electricity meter node that initiates a message exchange request. Defined as Neighboring electricity meter nodes within the node's communication range.
[0056] Electricity meter to the electricity meter Send a request message and record the sending time. .
[0057] Electricity meter Record the arrival time after receiving the request message. It will immediately reply with a response message, which includes the arrival time of the request message. With the time of sending the response message and carry an electricity meter Local time.
[0058] Electricity meter Record the arrival time after receiving the response message. .
[0059] Calculate the electricity meter based on the message's sending and arrival times. and electricity meter Transmission delay between and relative clock deviation measurement value .
[0060] wherein, denotes the transmission delay between the electric energy meter i and the electric energy meter j; denotes the time at which the electric energy meter i sends the request message; denotes the time at which the request message arrives at the electric energy meter j; denotes the time at which the electric energy meter j sends the response message; denotes the time at which the electric energy meter j receives the response message.
[0061] wherein, denotes the relative clock deviation between the electric energy meter i and the electric energy meter j; denotes the time at which the electric energy meter i sends the request message; denotes the time at which the request message arrives at the electric energy meter j; denotes the time at which the electric energy meter j sends the response message; denotes the time at which the electric energy meter j receives the response message. In a two-way message exchange process, the electric energy meter i counts the message success rate between the electric energy meter i and the electric energy meter j and reads the signal-to-noise ratio (SNR).
[0062] The message success rate is the ratio of the number of messages successfully received and verified to the total number of sending attempts in the communication process between the electric energy meter i and the electric energy meter j.
[0063] The signal-to-noise ratio is the ratio of the signal power to the noise power measured at the receiving end.
[0064] wherein, denotes the message success rate between the electric energy meter i and the electric energy meter j; denotes the number of messages successfully received and verified in the current two-way exchange; denotes the total number of sending attempts.
[0065] The signal-to-noise ratio is the ratio of the signal power to the noise power measured at the receiving end.
[0066] wherein, denotes the signal-to-noise ratio measured at the receiving end; denotes the signal power measured at the receiving end; represents the noise power measured by the receiving end.
[0067] Based on the transmission delay, the relative clock bias measurement, the local time of the electric energy meter , the message success rate and the signal-to-noise ratio constitute a neighborhood information set.
[0068] S2: A swarm intelligence consistency algorithm is used on the neighborhood information set to calculate the deviation of the electric energy meter clock relative to the network average time and the drift rate representing the change of the deviation per unit time.
[0069] The reason why the swarm intelligence consistency algorithm is used on the neighborhood information set and the deviation relative to the network average time and the drift rate representing the change of the deviation per unit time are estimated at the same time is that: the local clock of the electric energy meter has both instantaneous deviation and frequency error that accumulates over time, and only correcting the deviation will soon fail, so the drift must be estimated and compensated to obtain long-term stable synchronization; using the network average time as a virtual reference can eliminate the dependence on a single reference, avoid single-point failure and amplify errors due to link fluctuations; the consistency algorithm only needs to interact with the local electric energy meter and the neighbor electric energy meter to converge in the whole network, which is naturally adapted to the distributed AMI topology and has scalability and fault tolerance; in combination with the time-varying weight set by the message success rate, the signal-to-noise ratio and the historical stability, the influence of poor links and abnormal nodes can be automatically reduced, and the convergence speed and steady-state accuracy can be improved; at the same time, the joint output of the deviation and the drift facilitates the feedforward compensation and adaptive adjustment of the synchronization period at the software layer, and realizes low jitter, low communication overhead and high robustness of the time synchronization effect under the conditions of time variation, easy packet loss and topology disturbance.
[0070] Figure 5 The distributed time synchronization and consistency update process of the electric energy meter node is shown: first, the time state of the node, including the clock deviation and the drift rate, is initialized; then, a bidirectional message interaction is performed with the neighbor node to obtain the relative clock bias and other measurement quantities; then, the current time state vector of the neighbor is obtained; based on the preset weight and in combination with the filtering and smoothing mechanism, the time state of the node is updated once; the local clock is corrected in real time with the updated parameters; and it is decided whether to continue the next round of iteration or end the process according to whether the nodes have met the consistent estimation condition.
[0071] The calculation of the deviation of the electric energy meter clock relative to the network average time and the drift rate representing the change of the deviation per unit time includes iterative updating of the local state vector of each electric energy meter based on the neighborhood information set using a consistency algorithm to estimate the deviation of the clock relative to the network average time and the drift rate.
[0072] The consistency algorithm includes updating the local state vector of each electric energy meter node using a combination of a consistency term and a relative measurement correction term and using a convergence step controlling the amplitude and speed of the local state vector correction in each iteration; denotes the deviation of the local time of node i from the network average time; the network average time is the unified time reference of the whole network; denotes the drift rate.
[0073] the consistency term includes, in each round of update, the electric energy meter i will make the local state vector and the state vector of the neighbor electric energy meter j difference and weighted sum, so that converges to the average level of the neighbor electric energy meter state vector at the same time.
[0074] the relative measurement correction term includes, based on the obtained relative clock deviation measurement value of the electric energy meter i and the neighbor electric energy meter j directly correct the deviation of the local time of the electric energy meter i from the network average time ; the correction only acts on , and does not directly modify the drift rate component , so as to maintain the stability of the frequency estimation and improve the stability of the overall convergence.
[0075] wherein, denotes the local clock state vector of the electric energy meter i obtained after the kth round of iteration; denotes the local state vector of the electric energy meter obtained after the kth round of iteration; denotes the local state vector of the electric energy meter obtained after the kth round of iteration; denotes the local state vector of the electric energy meter obtained after the kth round of iteration; denotes the convergence step and is less than 1; denotes the time-varying confidence weight; denotes the relative clock deviation measurement value obtained by the bidirectional packet exchange; denotes the deviation of the local time of the electric energy meter from the network average time obtained after the kth round of iteration; denotes the convergence step for controlling the amplitude of each round of update; denotes the neighbor electric energy meter set of the electric energy meter ; and denotes the iteration period.
[0076] the group intelligence consistency algorithm for the neighborhood information set includes, in the consistency algorithm, at the kth iteration, for the neighbor electric energy meter of the electric energy meter i, a time-varying confidence weight , for weighted fusion of neighborhood information and convergence of local state vector to the average level of neighbor energy meter state vectors.
[0077] Time-varying confidence weight based on neighborhood information set: wherein, denotes the confidence weight of the kth round for the energy meter j; denotes the energy meter to the energy meter the signal-to-noise ratio obtained in the kth round iteration of the link; denotes the energy meter to the energy meter the message success rate statistically obtained in the kth round iteration; denotes the energy meter the historical stability factor of the energy meter; denotes the energy meter the signal-to-noise ratio obtained in the kth round iteration of the link between the energy meter i and the energy meter m; denotes the energy meter the message success rate statistically obtained in the kth round iteration between the energy meter i and the energy meter m; denotes the historical stability factor of the energy meter m; denotes any neighbor energy meter of the energy meter i; denotes the neighbor energy meter node set within the communication range of the energy meter i.
[0078] S3: Based on the time deviation and drift rate, a software compensation method is adopted to adjust the virtual synchronous time provided by the energy meter node to the outside.
[0079] To avoid the time jump, log disorder and metering compliance risk caused by directly calling back or fast forwarding the hardware clock, a virtual synchronous time is generated by software compensation in this step, that is, without modifying the hardware clock chip of the meter, the local hardware time is read and the deviation and drift parameters obtained by consistent iteration are superimposed, and the unified time reference is output online according to the calculation formula; wherein the deviation term is used to shift the current local time as a whole in a direct addition manner when generating the virtual synchronous time, so that the virtual time at this moment is aligned with the network reference time without changing the subsequent timing speed; the drift term is used to continuously correct the timing proportion deviation, and realize the simultaneous suppression of instantaneous error and cumulative error. This design has the characteristics of smooth, monotonic and rollbackable time evolution, and can update the parameters in small steps to reduce jitter, has long-term robustness to frequency shift caused by temperature drift and power disturbance; at the same time, it is compatible with the existing AMI system and existing applications, and only takes effect at the software layer, so the deployment and maintenance are simple and low-risk, which is conducive to large-scale promotion.
[0080] The software compensation method is used to adjust the virtual synchronous time provided by the electric energy meter node, which comprises the following steps: without modifying the hardware clock chip of the electric energy meter, reading the local hardware clock time and combining the clock deviation and drift rate obtained by the consistency iteration algorithm, calculating and outputting the virtual synchronous time by the program running on the electric energy meter processor.
[0081] The virtual synchronous time is a unified time reference aligned with the data timestamp and the schedule without directly adjusting the hardware clock.
[0082] wherein, represents the virtual synchronous time; represents the local hardware clock time; represents the drift rate estimation; represents the clock deviation estimation.
[0083] S4: According to the synchronization error monitored by the electric energy meter node, the synchronization state is determined by the set threshold value, and the synchronization period interval and the convergence step are adaptively adjusted.
[0084] Figure 3 It is shown that the electric energy meter interacts with the neighbor under the terminal reference, updates the deviation and drift, and corrects the local clock, while continuously monitoring the synchronization error. By establishing the synchronization state determination on the real-time deviation of the external virtual time and the network average time, the system can make a closed loop with the business-related indicators; the high and low double thresholds form a hysteresis zone to avoid frequent time synchronization and parameter oscillation caused by single threshold boundary jitter; when the error worsens and exceeds the high threshold, an additional two-way exchange is immediately performed and the next period is shortened, so that the sampling frequency of estimation and compensation is improved to quickly reduce the error; when the error continuously decreases below the low threshold, the period is automatically lengthened to reduce the network message volume and energy consumption; at the same time, the convergence step and the period are linked, which is equivalent to the stable condition of discrete control to coordinate the update amplitude and update frequency: the step is reduced to prevent overshoot and divergence when the period is lengthened, and the step is increased to improve the response speed when the period is shortened. Thus, in the time-varying environment of link quality fluctuation, topology change and temperature drift, fast convergence, low jitter and low communication cost are realized while the robustness and scalable operation and maintenance are taken into account.
[0085] The adaptive adjustment of the synchronization period interval and the convergence step comprises the adjustment of the synchronization period interval and the convergence step by the intelligent decision of the double thresholds: Step one: define the synchronization error threshold and .
[0086] Step two: if the current synchronization error If the synchronization error of three or more consecutive periods satisfies the condition of
[0087] If the synchronization error of three or more consecutive periods satisfies the condition of the synchronization state is determined to be stable, and the interval of the next synchronization period is extended.
[0088] The interval of the synchronization period is directly rewritten in the regular time maintenance setting of the local firmware of the electric energy meter, and the time interval of the next regular time is increased or reduced by a fixed value.
[0089] Step three: adjust the convergence step size according to the synchronization period interval When the synchronization period interval is extended, the microcontroller in the local firmware of the electric energy meter reduces by a preset proportion to maintain convergence stability; when the synchronization period interval is shortened, the preset proportion is increased to speed up the convergence speed.
[0090] After adaptive adjustment, when the error is deteriorated, the clock deviation and drift rate of each electric energy meter in the substation are quickly converged to the average level of the neighbor electric energy meter state vector, and the synchronization error of each electric energy meter is pulled back to within the threshold; when the error is small, the overall communication overhead and energy consumption of the substation are reduced.
[0091] The embodiment also provides a low-voltage substation electric energy meter time synchronization system based on swarm intelligence, comprising: a collection module: publishing the reference time information obtained by the substation acquisition terminal to the electric energy meter nodes in the substation, based on the reference time information, the electric energy meter nodes and the neighbor electric energy meter nodes within the communication range perform bidirectional message exchange to collect the neighborhood information set.
[0092] A calculation module: using a swarm intelligence consistency algorithm on the neighborhood information set, calculates the deviation of the electric energy meter clock relative to the network average time and the drift rate representing the change of the deviation per unit time.
[0093] A software compensation module: based on the time deviation and the drift rate, adjusts the virtual synchronization time provided by the electric energy meter node to the outside by using software compensation.
[0094] An adjustment module: according to the synchronization error monitored by the electric energy meter node, determines the synchronization state through a set threshold, and adaptively adjusts the synchronization period interval and the convergence step size.
[0095] The embodiment also provides a computer device suitable for the case of the low-voltage transformer area electric energy meter time synchronization method based on swarm intelligence, which comprises a memory and a processor; the memory is used for storing computer executable instructions, and the processor is used for executing the computer executable instructions to realize the low-voltage transformer area electric energy meter time synchronization method based on swarm intelligence proposed in the above embodiment.
[0096] The computer device can be a terminal, and the computer device comprises a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. The processor of the computer device is used for providing computing and control capabilities. The memory of the computer device comprises a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used for wired or wireless communication with external terminals. The wireless communication can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer overlaid on the display screen, or a key, trackball or touchpad arranged on the shell of the computer device, or an external keyboard, touchpad or mouse, etc.
[0097] The embodiment also provides a storage medium having a computer program stored thereon, the program being executed by a processor to realize the low-voltage transformer area electric energy meter time synchronization method based on swarm intelligence proposed in the above embodiment. The storage medium can be realized by any type of volatile or non-volatile storage device or a combination thereof, such as a static random access memory (SRAM), an electrically erasable programmable read-only memory (EEPROM), an erasable programmable read-only memory (EPROM), a programmable read-only memory (PROM), a read-only memory (ROM), a magnetic memory, a flash memory, a magnetic disk or an optical disk.
[0098] Embodiment 2, reference Figure 2 provides a low-voltage transformer area electric energy meter time synchronization method based on swarm intelligence. In order to verify the beneficial effects of the present application, economic benefit calculation and simulation experiments are used for scientific demonstration.
[0099] This example is implemented in a typical low-voltage area, as shown in the figure, which contains 1 area acquisition terminal (time synchronization through the main station) and 100 smart electric energy meters. All devices communicate through power line carrier (PLC). Figure 2
[0100] 1. Initialization and reference release: The area acquisition terminal broadcasts a standard time message to the 100 smart electric energy meters every 60 seconds, and the message format is: [message sequence number SEQ, standard time T_standard, sending timestamp T_send].
[0101] 2. Neighborhood discovery and measurement: After each electric energy meter is powered on, it first discovers the neighbor electric energy meter. Electric energy meter A communicates with its neighbors B, C, D... through bidirectional message exchange. For example, a communication with B measures the transmission delay , the relative clock deviation . At the same time, A will record the message success rate (such as 100%) of the last 5 communications with B, and read the signal-to-noise ratio of the current link from the PLC modem.
[0102] 3. Distributed consistency estimation The current state vector of electric energy meter A is .
[0103] It obtains the state vectors and measurement values from neighbors B, C, and D: B: ; ; ; ; .
[0104] C: ; ; ; ; .
[0105] D: ; ; ; ; .
[0106] According to the time-varying confidence weight formula, the weight assigned to each neighbor is calculated: Perform consistency update: According to the consistency algorithm calculation formula, calculate the update amount of deviation θ and drift rate α respectively.
[0107] For updating the deviation θ: θ = 0.1*{ ω AB * [(80-100)-(120-100)]+ ω AC * [(150 - 100) - (90 - 100) ] + ω AD * [(110 - 100) - (105 - 100) ]}=-0.425ms.
[0108] For updating the drift rate α: This yields the intermediate state estimation vector. .
[0109] Smooth the intermediate state estimation vector using Kalman filtering: The observed values are input into a Kalman filter pre-defined with the covariance of process noise and measurement noise, yielding the final state estimate after this round of optimization. = [+95ms, +14.5ppm].
[0110] 4. Clock Correction: Energy meter A uses software compensation. When its hardware clock reading is... At that time, the synchronization time it provides to the application layer is: .
[0111] 5. Adaptive Adjustment: Energy meter A monitors the change in its state estimate. If the change in deviation θ is less than 1 ms for three consecutive cycles, the synchronization is considered good, and it gradually extends the synchronization cycle from 60 seconds to 300 seconds or longer. If a calculation reveals that the deviation suddenly increases to more than 50 ms, it immediately triggers a new synchronization process and resets the cycle to 60 seconds.
[0112] Through the above process, the electricity meters in the entire distribution area form a distributed collaborative system, quickly converging and maintaining a high-precision synchronization state. Even if the main meter in the distribution area experiences a brief failure, the network can rely on collective intelligence to maintain synchronization accuracy for a period of time, greatly enhancing the reliability of the system.
[0113] The method described in this invention is not only applicable to smart energy meters, but can also be widely used in fields that require low-cost, highly robust time synchronization, such as water meters, gas meter data collection systems, and IoT sensor networks.
[0114] To sum up, the application is characterized by: the reference time is issued by the terminal of the transformer area, the relative deviation and time delay are obtained by the two-way time stamp exchange of each electric energy meter within the communication range, the clock deviation and drift rate are jointly estimated by the consistency algorithm, the time-varying confidence weight is dynamically weighted by the message success rate, the signal-to-noise ratio and the historical stability, the synchronization cycle interval and the convergence step are jointly adjusted by the adaptive strategy based on the double threshold, the error is quickly converged when the error is deteriorated, and the communication and power consumption are reduced in the stable stage; the virtual synchronous time output by the software compensation is used to avoid the time jump caused by the hardware backtracking, the alignment residual error is set to be above the threshold to re-align and update the mechanism, and finally the high-precision, low-cost, strong-robust and scalable deployment of the electric energy meter time unification and business alignment are realized in the low-voltage transformer area environment with time-varying and easy packet loss.
[0115] It should be noted that the above embodiments are only used to illustrate the technical solutions of the application and not to limit the application. Although the application has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the application can be modified or replaced by equivalents without departing from the spirit and scope of the application, and they should be covered in the scope of the claims of the application.
Claims
1. A method for time synchronization of low-voltage transformer area electric energy meters based on swarm intelligence, characterized in that: The method comprises the following steps: a collection module: publishing reference time information obtained by a terminal of a transformer area to electric energy meter nodes in the transformer area, and based on the reference time information, the electric energy meter nodes exchange messages with neighbor electric energy meter nodes in a communication range to collect a neighborhood information set; A calculation module: using a swarm intelligence consistency algorithm on the neighborhood information set to calculate a deviation of a clock of the electric energy meter from a network average time and a drift rate representing a change in the deviation per unit time; A software compensation module: based on the time deviation and the drift rate, adjusting a virtual synchronization time provided by the electric energy meter node to the outside in a software compensation manner; An adjustment module: based on a synchronization error monitored by the electric energy meter node, determining a synchronization state through a set threshold value, and adaptively adjusting a synchronization cycle interval and a convergence step size.
2. The method for low-voltage transformer area electric energy meter time synchronization based on swarm intelligence according to claim 1, characterized in that: The collecting neighborhood information set by performing the bidirectional message exchange includes a power meter node defined as an initiating message exchange request, a neighbor power meter node within a communication range of the node, a neighbor power meter node within a communication range of the node, Electricity meter To the electricity meter Send a request message and record the sending time ; Electricity meter Record the arrival time after receiving the request message And immediately reply a response message, the response message contains the arrival time of the request message And the time of sending the response message And carries the local time of the electricity meter Electricity meter Record arrival time on receipt of response message ; Calculating transmission delay between a power meter and a relative clock bias measurement based on packet sending time and arrival time and a power meter and a power meter and a power meter ; wherein, denotes the transmission delay between the electricity meter i and the electricity meter ; denotes the time at which the electricity meter sends the request message; denotes the time at which the request message arrives at the electricity meter ; denotes the time at which the electricity meter sends the response message; denotes the time at which the electricity meter receives the response message; wherein represents the relative clock offset between the electric energy meter i and the electric energy meter ; represents the time at which the electric energy meter sends the request message; represents the time at which the request message arrives at the electric energy meter ; represents the time at which the electric energy meter sends the response message; represents the time at which the electric energy meter receives the response message; In a two-way message exchange process, the electric energy meter Statistics and electric energy meter between the message success rate and read the signal-to-noise ratio SNR; the message success rate is the electric energy meter And the electric energy meter The ratio of the number of messages successfully received and checked in the communication process to the total number of sending attempts; the signal-to-noise ratio is the ratio of the received signal power to the noise power; Based on transmission delay, relative clock bias measurement, electric energy meter Local time, message success rate and signal-to-noise ratio of the electric energy meter 3. The method for low-voltage transformer area electric energy meter time synchronization based on swarm intelligence according to claim 2, characterized in that: The calculation of the deviation of the clock of the electric energy meter from the network average time and the drift rate includes: based on the neighborhood information set, using a consistency algorithm to iteratively update a local state vector of each electric energy meter to estimate the deviation of the clock of the electric energy meter from the network average time and the drift rate; The consistency algorithm includes updating the local state vector of each electric energy meter node using a combination of a consistency term and a relative measurement correction term and a convergence step controlling the amplitude and speed of the local state vector correction at each iteration; denotes the deviation of the local time of node i from the network average time; the network average time is a unified time reference for the entire network; denotes the drift rate; the consistency term including, in each round of updates, the power meter i will locally update its state vector with the state vector of the neighbor power meter j differencing and weighted summing, so that with converging to the average level of the neighbor power meter state vectors simultaneously said relative measurement correction term comprises, based on the obtained relative clock bias measurement of the electric energy meter i and the neighbor electric energy meter j correcting directly the deviation of the local time of the electric energy meter i relative to the network average time ; the correction only acts on without directly modifying the drift rate component so as to maintain the stationarity of the frequency estimation and improve the stability of the overall convergence; in, Indicates that the electricity meter i is in the first... The local clock state vector obtained after round of iteration; Indicates electricity meter The local state vector obtained after the k-th iteration; Indicates electricity meter The local state vector obtained after the k-th iteration; Indicates the convergence step size and Less than 1; Indicates time-varying confidence weights; This represents the relative clock offset measurement, obtained through bidirectional message exchange. Indicates electricity meter The deviation of the local time from the network average time obtained after the k-th iteration; This indicates the convergence step size, used to control the update magnitude in each round; Indicates electricity meter The set of neighboring electricity meters; Indicates the iteration period.
4. The method for low-voltage transformer area electric energy meter time synchronization based on swarm intelligence according to claim 3, characterized in that: The swarm intelligence consensus algorithm for the neighbor information set comprises, in the consensus algorithm, at the kth iteration, for the neighbor electric energy meter of the electric energy meter i Setting time-varying confidence weight for weighted fusion of the neighborhood information and convergence of the local state vector to the average level of the neighbor electric energy meter state vector; Based on the neighborhood information set, a time-varying confidence weight is calculated: wherein, denotes the confidence weight of the kth round of iteration for the electric energy meter j; denotes the electric energy meter to the electric energy meter the signal-to-noise ratio obtained by the kth round of iteration of the link; denotes the electric energy meter to the electric energy meter the message success rate obtained by the kth round of iteration statistics; denotes the electric energy meter the historical stability factor of the electric energy meter denotes the electric energy meter the signal-to-noise ratio obtained by the kth round of iteration of the link between the electric energy meter i and the electric energy meter m; denotes the electric energy meter the message success rate obtained by the kth round of iteration statistics between the electric energy meter i and the electric energy meter m; denotes the historical stability factor of the electric energy meter m; denotes any neighbor electric energy meter of the electric energy meter i; denotes the neighbor electric energy meter node set within the communication range of the electric energy meter i.
5. The method for low-voltage transformer area electric energy meter time synchronization based on swarm intelligence according to claim 4, characterized in that: The software compensation module adjusts the virtual synchronization time provided by the electric energy meter node to the outside in a software compensation manner based on the obtained clock deviation and drift rate, which includes: without modifying a hardware clock chip of the electric energy meter itself, reading a local hardware clock time and combining the clock deviation and the drift rate obtained through the consistency iteration algorithm, and online calculating and outputting the virtual synchronization time by a program running on a processor of the electric energy meter; The virtual synchronization time is a unified time reference aligned with a data timestamp and a schedule without directly adjusting the hardware clock; wherein, represents a virtual synchronization time; represents a local hardware clock time; represents a drift rate estimate; represents a clock bias estimate.
6. The method for low-voltage transformer area electric energy meter time synchronization based on swarm intelligence according to claim 5, characterized in that: The adjustment module adaptively adjusts the synchronization cycle interval and the convergence step size by intelligent decision-making through a double threshold value: Step one: define a synchronization error threshold with ; Step two: if the current synchronization error is greater than the threshold, it is determined that the synchronization state is deteriorating, a non-periodic synchronization process is triggered immediately, and the interval of the next synchronization period is shortened; the synchronization error is the absolute value of the deviation between the virtual synchronization time provided by the node to the outside and the network average time, which is monitored by each electric energy meter node at each synchronization period k; the non-periodic synchronization process includes performing an additional two-way message exchange and performing a consistent iterative correction once; the interval of the synchronization period is the time length between the end of the current time synchronization and the planned initiation of the next regular time synchronization. If the synchronization error of three or more consecutive periods satisfies the synchronization state is determined to be stable, and the interval of the next synchronization period is extended; Step three: adjust the convergence step size according to the synchronization period interval When the synchronization period interval is extended, decrease to maintain the convergence stability; when the synchronization period interval is shortened, increase to accelerate the convergence speed.
7. A low-voltage transformer area electric energy meter time synchronization system based on swarm intelligence, the low-voltage transformer area electric energy meter time synchronization method based on swarm intelligence according to any one of claims 1-7, characterized in that: The method comprises the following steps: a collection module: publishing reference time information obtained by a terminal of a transformer area to electric energy meter nodes in the transformer area, and based on the reference time information, the electric energy meter nodes exchange messages with neighbor electric energy meter nodes in a communication range to collect a neighborhood information set; A calculation module: using a swarm intelligence consistency algorithm on the neighborhood information set to calculate a deviation of a clock of the electric energy meter from a network average time and a drift rate representing a change in the deviation per unit time; A software compensation module: based on the time deviation and the drift rate, adjusting a virtual synchronization time provided by the electric energy meter node to the outside in a software compensation manner; An adjustment module: based on a synchronization error monitored by the electric energy meter node, determining a synchronization state through a set threshold value, and adaptively adjusting a synchronization cycle interval and a convergence step size.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that: The processor executes the computer program to implement the steps of the low-voltage transformer area electric energy meter synchronization method based on swarm intelligence according to any one of claims 1-7.
9. A computer readable storage medium having stored thereon a computer program, characterized in that: The computer program is executed by the processor to implement the steps of the low-voltage transformer area electric energy meter synchronization method based on swarm intelligence according to any one of claims 1-7.
Citation Information
Cited By
Electric energy meter online deviation calibration method and system
CN121784653A