IEEE 802.1 AS clock synchronization method for smart power grid

By introducing link asymmetry compensation and adaptive dynamic frequency correction algorithms into IEEE 802.1AS clock synchronization technology, the synchronization deviation and frequency deviation problems are solved, and high-precision and high-reliability clock synchronization in smart grids is realized, ensuring the system's Stable operation and precise control.

CN119011058APending Publication Date: 2024-11-22STATE GRID SICHUAN ELECTRIC POWER CORP ELECTRIC POWER RES INST +2
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411129074.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-16
Publication Date
2024-11-22

AI Technical Summary

Technical Problem

The existing IEEE 802.1AS clock synchronization technology fails to effectively consider link asymmetry, resulting in synchronization deviation and frequency deviation, affecting synchronization accuracy.

Method used

Link asymmetry compensation algorithm and adaptive dynamic frequency correction algorithm are introduced to detect and calibrate the frequency deviation of the local clock of the node by estimating and compensating for transmission delay differences on different links to ensure that the clock frequency is consistent.

Benefits of technology

It realizes high-precision and high-reliability clock synchronization in smart grids, improves synchronization accuracy and system stability, and provides technical support for the stable operation and precise control of smart grids.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119011058A_ABST
    Figure CN119011058A_ABST
Patent Text Reader

Abstract

The invention discloses an IEEE (Institute of Electrical and Electronic Engineers) 802.1 AS (Institute of Electrical and Electronic Engineers) clock synchronization method for a smart power grid. The clock synchronization method comprises the following steps: selecting an optimal master clock according to parameter information of each clock; a local clock crystal oscillator source is used for providing clock pulses, a virtual clock is constructed, and a timestamp is stamped on the virtual clock; performing link asymmetry correction by adopting the link asymmetry degree; performing crystal oscillator frequency offset correction by adopting an adjacent frequency ratio; comprehensively considering link asymmetry and frequency deviation factors caused by a crystal oscillator, measuring link delay and calculating to obtain an accumulated frequency deviation value of a master clock and a slave clock; and dynamically correcting the local clock of the slave clock by adopting a self-adaptive dynamic frequency correction algorithm. According to the invention, high-precision and high-reliability clock synchronization in the smart power grid is realized, and technical support is provided for stable operation and accurate control of the smart power grid.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of smart grid communication, and in particular relates to an IEEE 802.1AS clock synchronization method for a smart grid. Background Art

[0002] As a new modern power transmission information network, smart grid uses communication technology to connect the power usage information collected by analog or digital signals at the user end with the power supply information at the supply end, and then uses this information to adjust the production and distribution of power, and adjust the power consumption of corporate and individual users, so as to reduce losses, save energy, and enhance the reliability of the power grid. The real-time and high efficiency of communication technology are directly related to the overall value of the entire power system.

[0003] The IEEE802.1AS protocol is mainly used to provide timing and synchronization for time-sensitive networks. It achieves this by synchronizing the time of each node in the network to a common optimal master clock, ensuring low latency and synchronous data transmission in time-sensitive networks. Synchronization can usually be achieved through pure software or hardware-assisted timestamping, where pure software timestamping will cause long delays and jitter, while hardware-assisted timestamping provides more accurate capabilities. Secondly, IEEE 802.1AS needs to assume that the upper and lower links are completely symmetrical, which does not match the actual link situation in wireless / hybrid networks. Therefore, the existing IEEE 802.1AS synchronization is obviously inaccurate, especially in asymmetric wireless networks. Asymmetric delay is one of the main reasons for inaccurate synchronization process. Link asymmetry not only affects the measurement of link delay, but also causes frequency error accumulation. Finally, due to the influence of manufacturing process and external environment, crystal oscillators will be affected. For example, due to temperature or clock aging, the oscillator frequency of each node may deviate from the ideal situation, which may cause phase fluctuations or drift to increase, resulting in counting deviations, which seriously affects the synchronization accuracy of the time synchronization system.

[0004] In summary, the existing IEEE 802.1AS synchronization technology does not take into account the link asymmetry, which leads to synchronization deviation and frequency deviation, thereby affecting the synchronization accuracy. Summary of the invention

[0005] In order to solve the problem of synchronization deviation and frequency deviation caused by IEEE 802.1AS synchronization technology not considering link asymmetry, the present invention proposes an IEEE 802.1AS clock synchronization method for smart grid. The clock synchronization method proposed by the present invention introduces a link asymmetry compensation algorithm, estimates and compensates for the transmission delay difference on different links according to the network topology and communication topology, so as to solve the synchronization deviation problem. At the same time, the frequency deviation of the local clock of the node is detected and calibrated through the frequency calibration algorithm to ensure that the clock frequency remains consistent, so as to solve the frequency deviation problem, and realize high-precision and high-reliability clock synchronization in the smart grid.

[0006] The present invention is achieved through the following technical solutions:

[0007] An IEEE 802.1AS clock synchronization method for a smart grid, the clock synchronization method comprising:

[0008] Select the best master clock according to the parameter information of each clock;

[0009] Using a local clock crystal source to provide clock pulses, constructing a virtual clock, and putting a timestamp on the virtual clock;

[0010] Link asymmetry is used to correct link asymmetry;

[0011] Adopt adjacent frequency ratio to correct crystal oscillator frequency deviation;

[0012] Taking into account the factors of link asymmetry and frequency deviation caused by the crystal oscillator, the link delay is measured and the cumulative frequency deviation value of the master and slave clocks is calculated according to the link delay;

[0013] An adaptive dynamic frequency correction algorithm is used to dynamically correct the local clock of the slave clock based on the accumulated frequency deviation value.

[0014] As a highly complex and dynamically changing network system, the smart grid has particularly important requirements for clock synchronization. The current IEEE 802.1AS synchronization technology does not take into account the link asymmetry problem in the power grid, which may lead to synchronization deviation. At the same time, the frequency synchronization implementation plan is also insufficient and lacks reliability. In view of the synchronization deviation and frequency deviation problems existing in the smart grid, the present invention introduces a link asymmetry compensation algorithm to estimate and compensate for the transmission delay differences on different links to solve the synchronization deviation problem. At the same time, an adaptive dynamic frequency correction algorithm is used to ensure that the clock frequency remains consistent and solve the frequency deviation problem, thereby realizing high-precision and high-reliability clock synchronization in the smart grid, providing technical support for the stable operation and precise control of the smart grid.

[0015] As a preferred implementation, the present invention uses link asymmetry to correct link asymmetry, specifically including:

[0016] Calculate the processing time of the synchronization message at the transmitting port;

[0017] Calculate the time it takes for the synchronization message to propagate in the air;

[0018] The fixed time difference is calculated based on the processing time of the synchronization message at the transmitting port and the propagation time in the air;

[0019] Calculating the asymmetry according to the fixed time difference;

[0020] The link delay is corrected using the asymmetry.

[0021] As a preferred embodiment, the fixed time difference calculation method of the present invention is:

[0022] Fixed_time=(request_propagation-reply_propagation)+(request_trans-reply_trans) Among them, Fixed_time is the fixed time difference between the uplink and downlink; request_propagation is the propagation time of the request message packet in the air; reply_propagation is the propagation time of the reply message packet in the air; request_trans is the sending time of the Delay_request message packet; reply_trans is the sending time of the Delay_reply message packet.

[0023] As a preferred embodiment, the asymmetry degree of the present invention is calculated as follows:

[0024]

[0025] Among them, Ratio is the asymmetry between the uplink and downlink; Delay_request is the uplink delay; Delay_reply is the downlink delay; Fixed_time is the fixed time difference between the uplink and downlink.

[0026] As a preferred embodiment, the present invention adopts the adjacent frequency ratio to correct the crystal oscillator frequency deviation, specifically including:

[0027] The adjacent frequency ratio is calculated as follows:

[0028]

[0029] Among them, Frequency_ratio is the adjacent frequency ratio; t sThe synchronization message receiving time of this cycle; t m The time for sending synchronization message in this cycle; t s ` is the next cycle synchronization message receiving time; t m `Send time for the next cycle synchronization message;

[0030] According to the adjacent frequency ratio, the link delay under the influence of the crystal oscillator frequency deviation is corrected.

[0031] As a preferred implementation, the present invention comprehensively considers the factors of link asymmetry and frequency deviation caused by the crystal oscillator, and obtains a link delay calculation method as follows:

[0032]

[0033] Among them, Frequency_ratio is the adjacent frequency ratio, Ratio is the asymmetry between the uplink and downlink, t 1 Delay request message sending time, t 2 Delay request message receiving time, t 3 The time to send the response message, t 4 T is the time to receive the response message; delay Link delay value between the master and slave clocks.

[0034] As a preferred embodiment, the cumulative frequency deviation value of the master and slave clocks of the present invention is calculated as follows:

[0035] offset = t s -t m -T delay

[0036] Wherein, offset is the cumulative frequency deviation between the master and slave clocks.

[0037] As a preferred embodiment, the adaptive dynamic frequency correction algorithm of the present invention specifically includes:

[0038] The frequency deviation between the master and slave clocks during a complete synchronization message transmission within a synchronization cycle is calculated;

[0039] According to the frequency deviation, a corresponding correction interval and a corresponding correction frequency and correction value within the correction interval are set to dynamically correct the local clock of the slave clock.

[0040] As a preferred embodiment, the dynamic correction process of the present invention specifically includes:

[0041] The first correction is to take the frequency deviation when the master and slave clocks are stable, select the corresponding correction interval, and correct the local clock of the slave clock according to the corresponding correction frequency and correction value in the correction interval;

[0042] Determine whether the previous correction is completed, and if so, proceed to the next step;

[0043] Determine whether the accumulated frequency offset value in the current synchronization period is within the allowable range, if so, end the dynamic correction process, otherwise proceed to the next step;

[0044] Determine whether the master-slave clock speed has changed. If so, the cumulative frequency offset value in the current synchronization cycle is updated to the sum of the cumulative frequency offset value in the current synchronization cycle and the cumulative frequency offset value in the previous synchronization cycle. Otherwise, the cumulative frequency offset value in the current synchronization cycle remains unchanged.

[0045] Determine whether the cumulative frequency offset value in the current synchronization cycle is greater than the cumulative frequency offset value in the previous synchronization cycle. If so, the cumulative frequency offset value in the current cycle is updated to the difference between the cumulative frequency offset value in the current synchronization cycle and the cumulative frequency offset value in the previous synchronization cycle. Otherwise, the cumulative frequency offset value in the current cycle is updated to the difference between the cumulative frequency offset value in the previous synchronization cycle and the cumulative frequency offset value in the current synchronization cycle.

[0046] A corresponding interval is selected according to the updated cumulative frequency offset value in the current cycle and the speed of the master clock, and the local clock of the slave clock is corrected.

[0047] On the other hand, the present invention proposes an IEEE 802.1AS clock synchronization system for a smart grid, the clock synchronization system comprising:

[0048] A master-slave clock determination module, wherein the master-slave clock determination module selects the best master clock according to parameter information of each clock;

[0049] A timestamp acquisition module, wherein the timestamp acquisition module uses a local clock crystal source to provide a clock pulse, constructs a virtual clock, and puts a timestamp on the virtual clock;

[0050] an asymmetry correction module, wherein the asymmetry correction module uses a link asymmetry to perform link asymmetry correction;

[0051] A frequency deviation correction module, wherein the frequency deviation correction module uses an adjacent frequency ratio to perform crystal oscillator frequency deviation correction;

[0052] A link delay measurement module, wherein the link delay measurement module comprehensively considers the link asymmetry and the frequency deviation factors caused by the crystal oscillator, measures the link delay and calculates the cumulative frequency deviation value of the master and slave clocks according to the link delay;

[0053] and a dynamic correction module, wherein the dynamic correction module adopts an adaptive dynamic frequency correction algorithm to dynamically correct the local clock of the slave clock based on the accumulated frequency deviation value.

[0054] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0055] 1. The clock synchronization method proposed in the present invention introduces asymmetry to measure the asymmetry degree of the uplink and downlink links, and corrects the link asymmetry to improve the accuracy of link delay measurement; at the same time, for the frequency deviation caused by the crystal oscillator factor, the adjacent frequency ratio is used to measure the asymmetry degree of the uplink and downlink links caused by it, and the link asymmetry is corrected to avoid the influence of the frequency deviation on the link delay measurement; the link asymmetry and the adjacent frequency ratio are combined to achieve accurate and reliable measurement of the link delay, thereby ensuring the reliability and accuracy of clock synchronization;

[0056] 2. The clock synchronization method proposed in the present invention adopts an adaptive dynamic frequency correction algorithm to correct the local frequency, ensuring that the master and slave clock frequencies remain consistent, which can be applied to frequency changes in different environments and improve the stability and applicability of the system;

[0057] 3. The clock synchronization method proposed in the present invention can realize high-precision and high-reliability clock synchronization in smart grids, providing technical support for the stable operation and precise control of smart grids. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] The drawings described herein are used to provide a further understanding of the embodiments of the present invention, constitute a part of this application, and do not constitute a limitation of the embodiments of the present invention. In the drawings:

[0059] Figure 1 A flow chart of a clock synchronization method according to an embodiment of the present invention;

[0060] Figure 2 A schematic diagram of sending a master-slave clock synchronization message according to an embodiment of the present invention;

[0061] Figure 3 A schematic diagram of a master-slave clock link delay measurement message according to an embodiment of the present invention;

[0062] Figure 4 is an overall flow chart of an embodiment of the present invention;

[0063] Figure 5 A schematic diagram of timestamps of messages sent and received by master and slave clocks according to an embodiment of the present invention;

[0064] Figure 6 A dynamic correction flow chart of an embodiment of the present invention;

[0065] Figure 7 The figure is a principle block diagram of a clock synchronization system according to an embodiment of the present invention. DETAILED DESCRIPTION

[0066] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with embodiments and drawings. The exemplary embodiments of the present invention and their description are only used to explain the present invention and are not intended to limit the present invention.

[0067] Example

[0068] As a highly complex and dynamically changing system, the smart grid has particularly important requirements for clock synchronization. However, the current IEEE 802.1AS synchronization technology does not take into account the link asymmetry problem existing in the power grid, which easily leads to synchronization deviation and frequency deviation, thereby affecting the synchronization accuracy. In view of this, this embodiment proposes an IEEE802.1AS clock synchronization method for smart grids. The clock synchronization method proposed in this embodiment first estimates and compensates for the transmission delay difference on different links based on the network topology and communication delay to solve the synchronization deviation problem; secondly, a reliable frequency synchronization implementation plan is adopted to ensure that the clock frequency remains consistent and solve the frequency deviation problem. High-precision and high-reliability clock synchronization is achieved in smart grids, providing technical support for the stable operation and precise control of smart grids.

[0069] like Figure 1 As shown, the clock synchronization method proposed in this embodiment specifically includes the following steps:

[0070] Step 10, selecting the best master clock according to the parameter information of each clock; specifically, the best master clock can be selected according to the parameter information of each clock by comprehensively considering the error estimation value of the clock, and other clocks except the master clock are slave clocks;

[0071] Step 20, using a local clock crystal source to provide a clock pulse, the local clock reference is triggered to count by the rising edge of the clock pulse, a virtual clock is constructed, and a timestamp is put on the virtual clock;

[0072] Step 30, using the link asymmetry to perform link asymmetry correction;

[0073] Step 40, using the adjacent frequency ratio to correct the crystal oscillator frequency deviation;

[0074] Step 50, comprehensively considering the link asymmetry and the frequency deviation factors caused by the crystal oscillator, measuring the link delay and calculating the cumulative frequency deviation value of the master and slave clocks according to the link delay;

[0075] Step 60: Adopt an adaptive dynamic frequency correction algorithm to dynamically correct the slave clock local clock based on the accumulated frequency deviation value.

[0076] Further, such as Figure 2 and Figure 3 As shown, timestamp the virtual clock to obtain t1 ,t 2 ,t 3 ,t 4 ,t s ,t m .

[0077] (1) The delay measurement requester constructs and sends a delay request message and records the sending time t 1 ;

[0078] (2) After receiving the delay request message, the delay measurement responder records the receiving time t 2 ;

[0079] (3) The delay measurement responder constructs a response message and timestamps it t 2 Encapsulate it into the message and record the sending time t 3 ;

[0080] (4) The delay measurement responder constructs a response follow-up message and timestamps it t 3 Encapsulate into a message;

[0081] (5) The delay requester receives the response message and the follow-up message from the responder and extracts the timestamp t contained in the message. 2 ,t 3 , and record the response message receiving time t 4 ;

[0082] (6) The master clock port sends a sync message to its directly connected slave clock port and records the sending time t m , the slave clock port of the time-aware system B records the receiving time t s .

[0083] Under the premise of symmetric transmission links, the link delay measurement value between nodes is calculated by the following equations (1)-(3). The overall process is as follows: Figure 4 As shown:

[0084] Delay_request = t 2 -t 1 (1)

[0085] Delay_reply = t 4 -t 3 (2)

[0086]

[0087] Where Delay_request is the uplink delay; Delay_reply is the downlink delay; T delay is the average link delay of the uplink and downlink.

[0088] However, in wireless situations, the uplink and downlink are not necessarily symmetrical. To address this issue, we need to consider the impact of the fixed time difference on the link asymmetry Ratio. Furthermore, the fixed time difference includes the processing time of the synchronization message at the transmitting port and the propagation time in the air. Therefore, the asymmetry Ratio calculation process specifically includes:

[0089] Step 301, calculate the processing time of the synchronization message at the transmitting port, and the specific calculation method is shown in the following formulas (4)-(5).

[0090]

[0091] Wherein, data_rate is the synchronization message transmission rate; Delay_requst_size is the size of the Delay_requst synchronization message; request_trans is the time for sending the Delay_request message; Delay_reply_size is the size of the Delay_reply_size synchronization message; reply_trans is the time for sending the Delay_reply message;

[0092] Step 302, calculate the time it takes for the synchronization message to propagate in the air. The specific calculation method is shown in the following formulas (6)-(7).

[0093]

[0094] Where speed_light is the propagation speed in the air; request_propagation is the propagation time of the request message in the air; Delay_req represents the distance between the master and slave clocks; reply_propagation is the propagation time of the reply message in the air;

[0095] Step 303, a fixed time difference is calculated based on the processing time of the synchronization message at the transmitting port and the propagation time in the air. The specific calculation method is shown in the following formula (8).

[0096] Fixed_time=(request_propagation-reply_propagation)+(request_trans-reply_trans) (8)

[0098] Step 304: Calculate the asymmetry according to the fixed time difference. The specific calculation method is shown in the following formula (9).

[0099]

[0100] Furthermore, the asymmetry degree of the uplink and downlink is measured by the asymmetry degree, and the influence of the uplink and downlink asymmetry on the link delay measurement in the wireless dynamic environment is considered to improve the measurement accuracy. Specifically, the correction process of the link delay considering the asymmetry degree is shown in the following formula (10).

[0101]

[0102] Further, such as Figure 4 As shown, the master clock records the timestamp t of the delay_req (delay request message) received this time. 2 and the timestamp t of the next received delay_req (delay request message) 2 `. The slave clock records the timestamp t of the delay_req (delay request message) sent this time 1 And the timestamp t of the next delay_req (delay request message) 1 `.

[0103] Among them, t 1 `It is expressed as:

[0104] t 1 `=t 1 +T delay +offset+Frequency_ratio*(t 1 -sync_time)(11)

[0105] t 2 `It is expressed as:

[0106] t 2 `=t 2 +T delay +offset+Frequency_ratio*(t 2 -sync_time)(12)

[0107] The adjacent frequency ratio is calculated by formula (13):

[0108]

[0109] Among them, Frequency_ratio is the adjacent frequency ratio; t s The synchronization message receiving time of this cycle; t m The time for sending synchronization message in this cycle; t s ` is the next cycle synchronization message receiving time; t m `Send time for the next cycle synchronization message.

[0110] According to the calculated adjacent frequency ratio, the link delay under the influence of frequency offset is corrected. The specific correction process is shown in the following formula (14):

[0111]

[0112] Furthermore, by comprehensively considering the factors of link asymmetry and frequency deviation caused by the crystal oscillator, the link delay calculation formula is obtained as shown in the following formula (15):

[0113]

[0114] Therefore, according to the above corrected link delay, the cumulative frequency offset value between the master and slave clocks in a synchronization cycle is obtained:

[0115] offset = t s -t m -T delay (16).

[0116] Furthermore, the adaptive dynamic frequency correction algorithm specifically includes:

[0117] Step 601, calculate and obtain the frequency deviation between the master and slave clocks in a process of sending a complete synchronization message within a synchronization cycle.

[0118] Specifically, the calculation steps are as follows:

[0119] Calculate the time T for the master clock to complete sending a synchronization message m :T m =t` m -t m ;

[0120] Calculate the time T for the slave clock to complete sending a synchronization message s :T s =t` s -t s ; where t m The time when the master clock sends the current synchronization message sync, t s is the time to receive the current synchronization message sync from the clock end, t` m The time when the master clock sends the next synchronization message Next sync, t` s The time when the next synchronization message Next sync is received from the clock end;

[0121] Calculate the frequency deviation Frequency_offset between the master and slave clocks during a complete synchronization message transmission process: Frequency_offset = T m -T s .

[0122] Step 602, according to the calculated frequency deviation, set the corresponding correction interval and the corresponding correction frequency and correction value within the correction interval, and dynamically correct the local clock of the slave clock, such as Figure 6 As shown, the dynamic correction process specifically includes:

[0123] Step 6021, the frequency deviation of the master and slave clocks when they are stable is first corrected, a corresponding interval is selected, and the local clock of the slave clock is corrected according to the corresponding correction frequency and correction value in the interval;

[0124] Step 6022, determine whether the previous correction is completed, if the correction is completed, continue to the next step, if the correction is not completed, wait;

[0125] Step 6023, determining whether the accumulated frequency offset value in the current synchronization period is within the allowable range, if so, the process ends, if not, proceeding to the next step;

[0126] Step 6024, determine whether the speed of the master and slave clocks has changed (for example, if the master clock is faster than the slave clock in the previous synchronization cycle, and the slave clock is faster than the master clock in the current synchronization cycle, the speed has changed; if the master clock is faster than the slave clock in the previous synchronization cycle, and the master clock is faster than the slave clock in the current synchronization cycle, the speed has not changed). If it has changed, the cumulative frequency offset value in the current synchronization cycle is updated to the sum of the cumulative frequency offset value in the current synchronization cycle and the cumulative frequency offset value in the previous synchronization cycle. If it has not changed, the cumulative frequency offset value in the current synchronization cycle remains unchanged, and the next step is executed;

[0127] Step 6025, determine whether the cumulative frequency offset value in the current synchronization cycle is greater than the cumulative frequency offset value in the previous synchronization cycle. If so, the cumulative frequency offset value in the current cycle is updated to the difference between the cumulative frequency offset value in the current synchronization cycle and the cumulative frequency offset value in the previous synchronization cycle. Otherwise, the cumulative frequency offset value in the current cycle is updated to the difference between the cumulative frequency offset value in the previous synchronization cycle and the cumulative frequency offset value in the current synchronization cycle, and continue to the next step;

[0128] Step 6026, select a corresponding interval based on the updated cumulative frequency offset value in the current cycle and the speed of the master clock, and correct the local clock of the slave clock.

[0129] The clock synchronization method proposed in this embodiment solves the synchronization deviation problem by introducing a link asymmetry compensation algorithm, estimating and compensating the transmission delay differences on different links according to the network topology and communication delay; and adopts a reliable frequency synchronization implementation scheme to ensure that the clock frequency remains consistent by detecting and calibrating the frequency deviation of the node local clock, thereby solving the frequency deviation problem, thereby realizing high-precision and high-reliability clock synchronization in the smart grid, and providing technical support for the stable operation and precise control of the smart grid.

[0130] Based on the same technical concept as above, this embodiment also proposes an IEEE 802.1AS clock synchronization system for smart grid, such as Figure 7 As shown, the clock synchronization system proposed in this embodiment specifically includes:

[0131] A master-slave clock determination module, which selects the best master clock based on the parameter information of each clock;

[0132] A timestamp acquisition module, which uses a local clock crystal source to provide a clock pulse. The local clock reference is triggered by the rising edge of the clock pulse to count, build a virtual clock, and put a timestamp on the virtual clock;

[0133] An asymmetry correction module, which uses link asymmetry to perform link asymmetry correction;

[0134] Frequency deviation correction module, which uses adjacent frequency ratio to correct the crystal oscillator frequency deviation;

[0135] Link delay measurement module, which comprehensively considers the factors of link asymmetry and frequency deviation caused by crystal oscillator, measures link delay and calculates the cumulative frequency deviation value of master and slave clocks based on the link delay;

[0136] And, a dynamic correction module, which adopts an adaptive dynamic frequency correction algorithm to dynamically correct the local clock of the slave clock based on the accumulated frequency deviation value.

[0137] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0138] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0139] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0140] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0141] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. An IEEE 802.1AS clock synchronization method for smart grid, characterized in that: The clock synchronization method comprises: Select the best master clock according to the parameter information of each clock; Using a local clock crystal source to provide clock pulses, constructing a virtual clock, and putting a timestamp on the virtual clock; Link asymmetry is used to correct link asymmetry; Adopt adjacent frequency ratio to correct crystal oscillator frequency deviation; Taking into account the factors of link asymmetry and frequency deviation caused by the crystal oscillator, the link delay is measured and the cumulative frequency deviation value of the master and slave clocks is calculated according to the link delay; An adaptive dynamic frequency correction algorithm is used to dynamically correct the local clock of the slave clock based on the accumulated frequency deviation value.

2. The IEEE 802.1AS clock synchronization method for smart grid according to claim 1, characterized in that: Link asymmetry is used to correct link asymmetry, including: Calculate the processing time of the synchronization message at the transmitting port; Calculate the time it takes for the synchronization message to propagate in the air; The fixed time difference is calculated based on the processing time of the synchronization message at the transmitting port and the propagation time in the air; Calculating the asymmetry according to the fixed time difference; The link delay is corrected using the asymmetry.

3. The IEEE 802.1AS clock synchronization method for smart grid according to claim 2, characterized in that: The fixed time difference is calculated as follows: Fixed_time=(request_propagation-reply_propagation)+(request_trans-reply_trans) Among them, Fixed_time is the fixed time difference between the uplink and downlink; request_propagation is the propagation time of the request message packet in the air; reply_propagation is the propagation time of the reply message packet in the air; request_trans is the sending time of the Delay_request message packet; reply_trans is the sending time of the Delay_reply message packet.

4. The IEEE 802.1AS clock synchronization method for smart grid according to claim 2, characterized in that: The asymmetry is calculated as follows: Among them, Ratio is the asymmetry between the uplink and downlink; Delay_request is the uplink delay; Delay_reply is the downlink delay; Fixed_time is the fixed time difference between the uplink and downlink.

5. The IEEE 802.1AS clock synchronization method for smart grid according to claim 4, characterized in that: Adjacent frequency ratio is used to correct the crystal oscillator frequency deviation, including: The adjacent frequency ratio is calculated as follows: Among them, Frequency_ratio is the adjacent frequency ratio; t s The synchronization message receiving time of this cycle; t m The time for sending synchronization message in this cycle; t s ` is the next cycle synchronization message receiving time; t m `Send time for the next cycle synchronization message; According to the adjacent frequency ratio, the link delay under the influence of the crystal oscillator frequency deviation is corrected.

6. The IEEE 802.1AS clock synchronization method for smart grid according to claim 5, characterized in that: Taking into account the factors of link asymmetry and frequency deviation caused by the crystal oscillator, the link delay calculation method is obtained as follows: Wherein, Frequency_ratio is the adjacent frequency ratio, Ratio is the asymmetry between the uplink and downlink, t1 is the delay request message sending time, t2 is the delay request message receiving time, t3 is the response message sending time, and t4 is the response message receiving time; T delay The link delay value between the master and slave clocks.

7. The IEEE 802.1AS clock synchronization method for smart grid according to claim 6, characterized in that: The cumulative frequency deviation value of the master and slave clocks is calculated as follows: offset=t s -t m -T delay Wherein, offset is the cumulative frequency deviation between the master and slave clocks.

8. The IEEE 802.1AS clock synchronization method for smart grid according to claim 1, characterized in that: The adaptive dynamic frequency correction algorithm specifically includes: The frequency deviation between the master and slave clocks during a complete synchronization message transmission within a synchronization cycle is calculated; According to the frequency deviation, a corresponding correction interval and a corresponding correction frequency and correction value within the correction interval are set to dynamically correct the local clock of the slave clock.

9. The IEEE 802.1AS clock synchronization method for smart grid according to claim 8, characterized in that: The dynamic correction process specifically includes: The first correction is to take the frequency deviation when the master and slave clocks are stable, select the corresponding correction interval, and correct the local clock of the slave clock according to the corresponding correction frequency and correction value in the correction interval; Determine whether the previous correction is completed, and if so, proceed to the next step; Determine whether the accumulated frequency offset value in the current synchronization period is within the allowable range, if so, end the dynamic correction process, otherwise proceed to the next step; Determine whether the master-slave clock speed has changed. If so, the cumulative frequency offset value in the current synchronization cycle is updated to the sum of the cumulative frequency offset value in the current synchronization cycle and the cumulative frequency offset value in the previous synchronization cycle. Otherwise, the cumulative frequency offset value in the current synchronization cycle remains unchanged. Determine whether the cumulative frequency offset value in the current synchronization cycle is greater than the cumulative frequency offset value in the previous synchronization cycle. If so, the cumulative frequency offset value in the current cycle is updated to the difference between the cumulative frequency offset value in the current synchronization cycle and the cumulative frequency offset value in the previous synchronization cycle. Otherwise, the cumulative frequency offset value in the current cycle is updated to the difference between the cumulative frequency offset value in the previous synchronization cycle and the cumulative frequency offset value in the current synchronization cycle. A corresponding interval is selected according to the updated cumulative frequency offset value in the current cycle and the speed of the master clock, and the local clock of the slave clock is corrected.

10. An IEEE 802.1AS clock synchronization system for smart grid, characterized in that: The clock synchronization system comprises: A master-slave clock determination module, wherein the master-slave clock determination module selects the best master clock according to parameter information of each clock; A timestamp acquisition module, wherein the timestamp acquisition module uses a local clock crystal source to provide a clock pulse, constructs a virtual clock, and puts a timestamp on the virtual clock; an asymmetry correction module, wherein the asymmetry correction module uses a link asymmetry to perform link asymmetry correction; A frequency deviation correction module, wherein the frequency deviation correction module uses an adjacent frequency ratio to perform crystal oscillator frequency deviation correction; A link delay measurement module, wherein the link delay measurement module comprehensively considers the link asymmetry and the frequency deviation factors caused by the crystal oscillator, measures the link delay and calculates the cumulative frequency deviation value of the master and slave clocks according to the link delay; and a dynamic correction module, wherein the dynamic correction module adopts an adaptive dynamic frequency correction algorithm to dynamically correct the slave clock local clock based on the accumulated frequency deviation value.

Citation Information

Cited By

  • Time calibration precision test method and system based on bidirectional timestamp statistical analysis

    CN120295086A