Time synchronization model and algorithm

Through the clock synchronization model and algorithm between the power grid test equipment and the server, the problem of inaccuracy in delay calculation caused by clock deviation is solved, accurate delay measurement and system flexibility are achieved, and the efficiency and stability of power grid operation and maintenance are improved. sex.

CN118590980AInactive Publication Date: 2024-09-03KNOWYOU INFORMATION TECH SHANGHAI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410635028.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-21
Publication Date
2024-09-03
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

There is a clock deviation between the existing power grid test equipment and the test server, which leads to inaccuracy and reliability problems in delay calculation, and requires cumbersome network timing operations, which affects operation and maintenance efficiency.

Method used

A time synchronization model and algorithm are used to estimate clock deviation and drift parameters through message exchange between nodes to achieve clock synchronization, avoid independent network time correction operations, dynamically correct clock drift, and ensure the accuracy of delay measurement and system flexibility.

Benefits of technology

It achieves accurate measurement of the delay between the device and the server, shields the interference caused by clock deviation, provides millisecond to microsecond level timing data support, improves the flexibility and adaptability of the system, and ensures power grid stability monitoring and fault monitoring. Positioning accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118590980A
    Figure CN118590980A
Patent Text Reader

Abstract

The invention discloses a time synchronization model and algorithm, and relates to the technical field of power grid testing. According to the time synchronization model and algorithm, the time difference is accurately quantified by using an innovative algorithm on the premise that the time synchronization model and the algorithm do not need to independently carry out tedious network timing operation, so that the time delay between the equipment and the server can be accurately measured, interference factors introduced by clock skew are effectively shielded, and the time synchronization accuracy is improved. Reliability and accuracy of time delay calculation are ensured, and through accurate diagnosis and compensation of clock skew between equipment and a server, the algorithm of the invention endows time delay measurement with an innovative precision dimension. The method is accurate to millisecond and even microsecond levels, can provide incomparably firm time sequence data support for key tasks such as power grid stability monitoring, fault positioning and performance optimization, and greatly improves the flexibility and adaptability of the whole system. And the dependence on periodic network timing is abandoned.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of power grid testing, and in particular to a time synchronization model and algorithm. Background Art

[0002] Power testing specifically tests the insulation performance of the test equipment and the operating status of the equipment. The power grid test equipment needs to be connected to the test server during the test.

[0003] Referring to a time synchronization method suitable for distribution network with Chinese patent publication number CN112491015B, clock synchronization can be completed by using line carrier communication channel without laying another dedicated channel, thereby reducing costs; it has the conditions for being widely used in medium and low voltage distribution networks, promotes the application of differential protection in medium and low voltage distribution networks, fills the gap in the protection of trunk lines in medium and low voltage distribution networks, and can achieve high clock synchronization accuracy. Since the voltage level in the medium and low voltage distribution network is low, it is easy to generate high-frequency disturbances by switching on and off the resistors, and it is also convenient to adjust the resistance value under different low voltage distribution environments.

[0004] Referring to the method and device for synchronous testing of distributed devices in a distribution network based on 5G communication, which is disclosed in Chinese Patent Publication No. CN117320050A, a preset signal is sent to each test terminal on the basis of synchronization of each test terminal; the test platform receives time information or feedback information in response, and determines the synchronization of each test terminal based on the time information or feedback information, thereby realizing the synchronization test of the test terminal. The problem that the synchronization between test terminals cannot be verified in the prior art is effectively solved. Moreover, when performing a synchronous test, the embodiment of the present invention only needs to use the test platform to send a preset signal and receive the time information or feedback information in response, which greatly saves the manpower requirements for on-site testing and can greatly improve the efficiency of operation and inspection.

[0005] Comprehensive analysis of the above reference patents shows the following defects:

[0006] There is a certain clock deviation between the existing power grid test equipment and the test server. The present invention realizes the accurate quantification of the time difference by using an innovative algorithm without the need for the two to independently perform tedious network time calibration operations. It can not only accurately measure the delay between the equipment and the server, but also effectively shield the interference factors introduced by the clock deviation, thereby ensuring the reliability and accuracy of the delay calculation.

[0007] By accurately diagnosing and compensating for clock deviations between devices and servers, the algorithm of this invention provides an innovative precision dimension for latency measurement, accurate to milliseconds or even microseconds, providing extremely solid timing data support for key tasks such as grid stability monitoring, fault location, and performance optimization.

[0008] In addition, the algorithm has greatly improved the flexibility and adaptability of the entire system. Abandoning the reliance on periodic network time calibration, it can dynamically and in real time capture and correct clock drift in a complex and changing network environment, and can always accurately indicate the direction of the time coordinate regardless of how the environment changes. This self-calibration capability undoubtedly lays a solid foundation for the efficient operation and maintenance and intelligent management of the power system. Summary of the invention

[0009] 1. Technical issues to be solved

[0010] In view of the deficiencies in the prior art, the present invention provides a time synchronization model and algorithm, which solves the problem of certain clock deviation between the existing power grid test equipment and the test server. The present invention realizes the accurate quantification of the time difference by using an innovative algorithm without the need for the two to independently perform tedious network time calibration operations. It can not only accurately measure the delay between the device and the server, but also effectively shield the interference factors introduced by the clock deviation, thereby ensuring the reliability and accuracy of the delay calculation.

[0011] (II) Technical solution

[0012] To achieve the above objectives, the present invention is implemented through the following technical solutions: a time synchronization model, including a plurality of nodes in a wireless sensor network for power testing, wherein the time synchronization model between each of the nodes is expressed as:

[0013] C i (t) = θ + f·t,

[0014] Among them, θ and f are the clock deviation and clock drift of the node clock relative to the reference time t, respectively. From the time synchronization model, the clock relationship between node A and node B is expressed as:

[0015] C B (t) = θ AB +f AB ·C A (t),

[0016] Among them, θ AB and f AB are the clock deviation and clock drift of node B clock relative to node A respectively. If we want to synchronize the clock of node B with that of A, we need to estimate the parameter θ AB and f AB , thereby achieving the purpose of correcting the B clock.

[0017] On the one hand, the present invention also provides a time synchronization algorithm, which adopts a time synchronization model and specifically includes the following steps:

[0018] S1, parameter θ ABand f AB The estimation of is achieved through mutual message exchange between nodes A and B;

[0019] S2, {T 1,n ,T 2,n ,T 3,n ,T 4,n} is the timestamp information in an exchange, and T is calculated by the following formula 2,n and T 3,n :

[0020] T 2,n =f(T 1,n +τ)+θ,

[0021] T 3,n =f(T 4,n -τ)+θ,

[0022] Adding the two equations together gives:

[0023]

[0024] S3. Order The above formula can be written in vector form:

[0025] A T xb=0,

[0026] in,

[0027]

[0028] S4. According to the least squares principle, the following optimization problem is formed:

[0029]

[0030] To solve this problem, let

[0031]

[0032] 2A T (Ax-b)=0, so x=(A T A) -1 A T b.

[0033] On the one hand, the present invention also provides a method for testing a time synchronization algorithm in a 5G environment, which specifically includes the following steps:

[0034] E1. Perform GPS time calibration on NTP service;

[0035] E2. Using the NTP server in step E1 as a medium, the industrial computer is configured to connect to the NTP server, and then the two industrial computers in the 5G environment are time-calibrated to ensure that the time of the two industrial computers is basically consistent, and the deviation value between the device and the NTP server after NTP synchronization is recorded;

[0036] E3. Then deploy the test program corresponding to the time synchronization algorithm on the two industrial computers to measure the clock deviation and obtain the time deviation value.

[0037] Preferably, the time deviation value obtained in step E3 is -439us.

[0038] On the one hand, the present invention also provides a method for testing a time synchronization algorithm in a router cable direct connection network environment, which specifically includes the following steps:

[0039] P1, deploy and configure NTP service on the first virtual machine;

[0040] P2. Using the NTP server in step P1 as a medium, configure the second and third virtual machines with network cards to connect to the direct network, then calibrate the time of the two virtual machines to ensure that the time of the two virtual machines is basically consistent, and record the deviation value between the device and the NTP server after NTP synchronization;

[0041] P3. Then, the relevant test program corresponding to the time synchronization algorithm is deployed on the second and third virtual machines to measure the clock deviation and obtain the time deviation value.

[0042] Preferably, the time deviation value obtained in step P3 is 429us.

[0043] On the other hand, the present invention also provides a method for testing a time synchronization algorithm in a router WIFI network environment, which specifically includes the following steps:

[0044] U1, deploy and configure NTP service on the first virtual machine;

[0045] U2, using the NTP server in step U1 as the medium, configure the second virtual machine as a wired network, and then perform time calibration to ensure that the time of the two virtual machines is basically consistent, and record the deviation value between the device and the NTP server after synchronizing NTP;

[0046] U3, then the third virtual machine quickly configures the network card to connect to the WIFI network, but does not perform time calibration;

[0047] U4. Then, the relevant test program corresponding to the time synchronization algorithm is deployed on the second and third virtual machines to measure the clock deviation and obtain the time deviation value.

[0048] Preferably, the time deviation value obtained in step U4 is 219us.

[0049] (III) Beneficial effects

[0050] The present invention provides a time synchronization model and algorithm. Compared with the prior art, it has the following beneficial effects:

[0051] (1) The time synchronization model and algorithm of the present invention realizes the accurate quantification of the time difference by using an innovative algorithm without the need for the two to independently perform tedious network time calibration operations. It can not only accurately measure the delay between the device and the server, but also effectively shield the interference factors introduced by the clock deviation, thereby ensuring the reliability and accuracy of the delay calculation.

[0052] (2) The time synchronization model and algorithm, through accurate diagnosis and compensation of clock deviation between devices and servers, endows the algorithm of the present invention with an innovative precision dimension for delay measurement. Accurate to milliseconds or even microseconds, it can provide extremely solid timing data support for key tasks such as power grid stability monitoring, fault location, and performance optimization.

[0053] (3) The time synchronization model and algorithm also greatly improve the flexibility and adaptability of the entire system. Abandoning the reliance on periodic network time synchronization, it can dynamically and in real time capture and correct clock drift in a complex and changing network environment, and can always accurately indicate the direction of the time coordinate regardless of how the environment changes. This self-calibration capability undoubtedly lays a solid foundation for the efficient operation and maintenance and intelligent management of the power system. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] Figure 1 A schematic diagram of the message exchange process and important timestamp information between node A and node B of the present invention;

[0055] Figure 2 This is a result diagram of the NTP time deviation value in Example 3 of the present invention;

[0056] Figure 3 This is a diagram showing the test results of the time synchronization algorithm used in Example 3 of the present invention;

[0057] Figure 4 This is a result diagram of the NTP time deviation value in Example 4 of the present invention;

[0058] Figure 5 This is a graph showing the test results of the time synchronization algorithm used in Example 4 of the present invention;

[0059] Figure 6 This is a result diagram of the NTP time deviation value in Example 5 of the present invention;

[0060] Figure 7 This is a graph showing the test results of the time synchronization algorithm used in Example 5 of the present invention. DETAILED DESCRIPTION

[0061] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0062] See also Figure 1-7 The embodiment of the present invention provides five technical solutions: a time synchronization model and algorithm, specifically including the following embodiments:

[0063] Embodiment 1: A time synchronization model includes several nodes in a wireless sensor network for power testing, and the time synchronization model between each of the nodes is expressed as:

[0064] C i (t) = θ + f·t,

[0065] Among them, θ and f are the clock deviation and clock drift of the node clock relative to the reference time t, respectively. From the time synchronization model, the clock relationship between node A and node B is expressed as:

[0066] C B (t) = θ AB +f AB ·C A (t),

[0067] Among them, θ AB and f AB are the clock deviation and clock drift of node B clock relative to node A respectively. If we want to synchronize the clock of node B with that of A, we need to estimate the parameter θ AB and f AB , thereby achieving the purpose of correcting the B clock.

[0068] Embodiment 2: A time synchronization algorithm adopts the time synchronization model of embodiment 1, specifically comprising the following steps:

[0069] S1, parameter θ AB and f AB The estimation of is achieved through mutual message exchange between nodes A and B; Figure 1 Describes the message exchange process between A and B and important timestamp information

[0070] S2. It can be seen from the figure that {T 1,n ,T 2,n ,T 3,n ,T 4,n} is the timestamp information in an exchange, and T is calculated by the following formula 2,n and T 3,n :

[0071] T 2,n =f(T 1,n +τ)+θ,

[0072] T 3,n =f(T 4,n -τ)+θ,

[0073] Adding the two equations together gives:

[0074]

[0075] S3. Order The above formula can be written in vector form:

[0076] A T xb=0,

[0077] in,

[0078]

[0079] S4. According to the least squares principle, the following optimization problem is formed:

[0080]

[0081] To solve this problem, let

[0082]

[0083] 2A T (Ax-b)=0, so x=(A T A) -1 A T b.

[0084] Embodiment 3: A method for testing a time synchronization algorithm in a 5G environment, specifically comprising the following steps:

[0085] E1. Perform GPS time calibration on NTP service to ensure the NTP server time is stable and reliable;

[0086] E2. Using the NTP server in step E1 as a medium, the industrial computer is configured to connect to the NTP server, and then the two industrial computers in the 5G environment are time-calibrated to ensure that the time of the two industrial computers is basically consistent, and the deviation value between the device and the NTP server after NTP synchronization is recorded;

[0087] E3. Then, the relevant test program corresponding to the time synchronization algorithm is deployed on the two industrial computers to measure the clock deviation and obtain the time deviation value. The obtained time deviation value is -439us.

[0088] The time offset between the host and the remote node or server time source. The closer the offset is to 0, the closer the time between the host and the NTP server is (expressed in RMS, in milliseconds)

[0089] Test environment for 5G environmental testing: 5G test environment;

[0090] Test equipment: two Huawei power grid test industrial computers;

[0091] Control variable: local time of the two industrial computers.

[0092] Depend on Figure 2 As shown in the figure, the NTP time deviation values ​​are 0.008ms, i.e. 8us, and -0.118ms, i.e. 118us. Figure 3 As shown, the time deviation value of the embodiment of the present invention and the deviation value calculated by NTP have an overall difference of -439-(-118-8)=-313us.

[0093] Embodiment 4: A method for testing a time synchronization algorithm in a router cable direct connection network environment, specifically comprising the following steps:

[0094] P1, deploy and configure NTP service on the first virtual machine;

[0095] P2. Using the NTP server in step P1 as a medium, configure the second and third virtual machines with network cards to connect to the direct network, then calibrate the time of the two virtual machines to ensure that the time of the two virtual machines is basically consistent, and record the deviation value between the device and the NTP server after NTP synchronization;

[0096] P3. Then, the relevant test program corresponding to the time synchronization algorithm is deployed on the second and third virtual machines to measure the clock deviation and obtain the time deviation value. The obtained time deviation value is 429us.

[0097] Test environment for testing the network environment of a router directly connected to a network cable: Router direct connection test environment;

[0098] Test equipment: three virtual machines;

[0099] Control variable: local time of the two virtual machines.

[0100] Depend on Figure 4 As shown in the figure, the NTP time deviation values ​​are -0.260ms, i.e. -260us, and -0.364ms, i.e. -364us. Figure 5 As shown, the time deviation value of the embodiment of the present invention and the deviation value calculated by NTP have an overall difference of 429-(-364+260)=533us.

[0101] Embodiment 5: A method for testing a time synchronization algorithm in a router WIFI network environment, specifically comprising the following steps:

[0102] U1, deploy and configure NTP service on the first virtual machine;

[0103] U2, using the NTP server in step U1 as the medium, configure the second virtual machine as a wired network, and then perform time calibration to ensure that the time of the two virtual machines is basically consistent, and record the deviation value between the device and the NTP server after synchronizing NTP;

[0104] U3, then the third virtual machine quickly configures the network card to connect to the WIFI network, but does not perform time calibration;

[0105] U4. Then, the relevant test program corresponding to the time synchronization algorithm is deployed on the second and third virtual machines to measure the clock deviation and obtain the time deviation value. The obtained time deviation value is 219us.

[0106] Test environment for router WIFI network environment test: router WIFI test environment;

[0107] Test equipment: three virtual machines;

[0108] Control variable: local time of the two virtual machines.

[0109] Depend on Figure 6 As shown in the figure, the NTP time deviation values ​​are -0.033ms, i.e. -33us, and -0.168ms, i.e. -168us. Figure 7 As shown, the time deviation value of the embodiment of the present invention and the deviation value calculated by NTP have an overall difference of 219-(-168+33)=354us.

[0110] In summary, assuming that the NTP service time error after GPS timing is 0, the delay values ​​calculated by testing time synchronization in three environments, namely, 5G environment, Ethernet router direct cable environment, and Ethernet router WiFi environment, and the errors generated by NTP time synchronization are 313us, 533us, and 354us, respectively. That is, the error between the current time synchronization algorithm and the NTP time synchronization algorithm is between 300-600us, and the current time synchronization algorithm is basically close to the time synchronization capability of NTP.

[0111] After effectively overcoming the clock deviation problem between the power grid test equipment and the test server, the present invention uses an innovative algorithm to accurately quantify the time difference without the need for the two to independently perform tedious network time calibration operations. This not only accurately measures the delay between the equipment and the server, but also effectively shields the interference factors introduced by the clock deviation, ensuring the reliability and accuracy of the delay calculation.

[0112] This algorithm is like a bridge, built on the time axis of the power grid test equipment and the test server, and cleverly weaves an invisible synchronization bond. It uses a smart path that goes beyond the traditional timekeeping method to reveal and bridge the subtle gaps originally hidden in the clock veins of the two, making the difference of seconds nowhere to hide. This process is like a precise watchmaker who adjusts the oscillation frequency of the double pendulum with unique skills, so that they are precisely synchronized at both ends during the time process, thereby achieving precise timing.

[0113] Our algorithm provides an innovative precision dimension to latency measurement by accurately diagnosing and compensating for clock deviations between devices and servers. It calculates the start and end moments of each data transmission from a fair and scientific perspective, accurate to milliseconds or even microseconds, ensuring that any deviation in timing cannot escape its eyes. In this way, it can provide extremely solid timing data support for key tasks such as power grid stability monitoring, fault location, and performance optimization.

[0114] In addition, the algorithm has greatly improved the flexibility and adaptability of the entire system. Abandoning the reliance on periodic network time calibration, it can dynamically and in real time capture and correct clock drift in a complex and changing network environment, and can always accurately indicate the direction of the time coordinate regardless of how the environment changes. This self-calibration capability undoubtedly lays a solid foundation for the efficient operation and maintenance and intelligent management of the power system.

[0115] In summary, this innovative algorithm of the present invention successfully controls the time ripples between the power grid test equipment and the test server, allowing them to find a rhythm of dancing in the ocean of clock deviation. It outlines a precise delay picture with a scientific pen, provides an indispensable time dimension guarantee for the deep insight and decision-making of the power industry, and demonstrates the outstanding contribution of scientific and technological forces in improving the efficiency and stability of power grid operation.

[0116] Meanwhile, the contents not described in detail in this specification belong to the prior art known to those skilled in the art.

[0117] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.

[0118] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A time synchronization model, Features: Including several nodes in the wireless sensor network for power testing, the time synchronization model between each of the nodes is expressed as: C i (t)=θ+f·t, Among them, θ and f are the clock deviation and clock drift of the node clock relative to the reference time t, respectively. From the time synchronization model, the clock relationship between node A and node B is expressed as: C B (t)=θ AB +f AB ·C A (t), Among them, θ AB and f AB are the clock deviation and clock drift of node B clock relative to node A respectively. If we want to synchronize the clock of node B with that of A, we need to estimate the parameter θ AB and f AB , thereby achieving the purpose of correcting the B clock.

2. A time synchronization algorithm, Features: The time synchronization model described in claim 1 is adopted, specifically comprising the following steps: S1, parameter θ AB and f AB The estimation of is achieved through mutual message exchange between nodes A and B; S2, {T 1,n ,T 2,n ,T 3,n ,T 4,n } is the timestamp information in an exchange, and T is calculated by the following formula 2,n and T 3,n : T 2,n =f(T 1,n +τ)+θ, T 3,n =f(T 4,n -τ)+θ, Adding the two equations together gives: S3. Order The above formula can be written in vector form: A T x-b=0, in, S4. According to the least squares principle, the following optimization problem is formed: To solve this problem, let 2A T (Ax-b)=0, so x=(A T A) -1 A T b.

3. According to claim 2, a method for testing a time synchronization algorithm in a 5G environment, Features: The specific steps include: E1. Perform GPS time calibration on NTP service; E2. Using the NTP server in step E1 as a medium, the industrial computer is configured to connect to the NTP server, and then the two industrial computers in the 5G environment are time-calibrated to ensure that the time of the two industrial computers is basically consistent, and the deviation value between the device and the NTP server after NTP synchronization is recorded; E3. Then, deploy the relevant test program corresponding to the time synchronization algorithm in claim 2 on the two industrial computers to measure the clock deviation and obtain the time deviation value.

4. According to claim 3, a method for testing a time synchronization algorithm in a 5G environment, Features: The time deviation value obtained in step E3 is -439us.

5. According to claim 2, a method for testing a time synchronization algorithm in a router network cable direct connection network environment, Features: The specific steps include: P1, deploy and configure NTP service on the first virtual machine; P2. Using the NTP server in step P1 as a medium, configure the second and third virtual machines with network cards to connect to the direct network, then calibrate the time of the two virtual machines to ensure that the time of the two virtual machines is basically consistent, and record the deviation value between the device and the NTP server after NTP synchronization; P3. Then, the relevant test program corresponding to the time synchronization algorithm in claim 2 is deployed on the second and third virtual machines to perform clock deviation measurement test to obtain the time deviation value.

6. A method for testing a time synchronization algorithm in a router network cable direct connection network environment according to claim 5, Features: The time deviation value obtained in step P3 is 429 us.

7. A method for testing a time synchronization algorithm in a router WIFI network environment according to claim 2, Features: The specific steps include: U1, deploy and configure NTP service on the first virtual machine; U2, using the NTP server in step U1 as the medium, first configure the second virtual machine as a wired network, then perform time calibration to ensure that the time of the two virtual machines is basically consistent, and record the deviation value between the device and the NTP server after NTP synchronization; U3, then the third virtual machine quickly configures the network card to connect to the WIFI network, but does not perform time calibration; U4. Then, the relevant test program corresponding to the time synchronization algorithm in claim 2 is deployed on the second and third virtual machines to measure the clock deviation and obtain the time deviation value.

8. A method for testing a time synchronization algorithm in a router WIFI network environment according to claim 7, Features: The time deviation value obtained in step U3 is 219 us.