WO2023004576A1 - Clock synchronization method, apparatus and system, and chip - Google Patents

Clock synchronization method, apparatus and system, and chip Download PDF

Info

Publication number
WO2023004576A1
WO2023004576A1 PCT/CN2021/108624 CN2021108624W WO2023004576A1 WO 2023004576 A1 WO2023004576 A1 WO 2023004576A1 CN 2021108624 W CN2021108624 W CN 2021108624W WO 2023004576 A1 WO2023004576 A1 WO 2023004576A1
Authority
WO
WIPO (PCT)
Prior art keywords
sampling
clock
sub
signal
signals
Prior art date
Application number
PCT/CN2021/108624
Other languages
French (fr)
Chinese (zh)
Inventor
章成旻
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to CN202180100996.1A priority Critical patent/CN117716644A/en
Priority to PCT/CN2021/108624 priority patent/WO2023004576A1/en
Publication of WO2023004576A1 publication Critical patent/WO2023004576A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements

Definitions

  • the present application relates to the technical field of distributed networks, in particular to a clock synchronization method, device, system and chip.
  • the clock synchronization system can accurately synchronize the real-time clocks of each node in the distributed network communication to adopt the clock synchronization system of the standard for a precision clock synchronization protocol for networked measurement and control systems (IEEE 1588)
  • each node of the distributed network is equipped with a clock module and a processing module, wherein the processing module is used to process related protocols of IEEE 1588 messages and collect time stamps, and convert the time stamps to It is sent to the clock module, and the clock module is used to calculate the clock information based on the time stamp sent by the processing module, and then adjust the local real-time clock to realize the clock synchronization of each node.
  • the clock module periodically sends time stamp information and pulse per second (PPS) information to the processing module, so that the real-time clock of the processing module is synchronized with the clock module.
  • PPS pulse per second
  • the IEEE 1588 synchronization system has very high requirements for sampling accuracy.
  • the sampling accuracy required is at the nanosecond level.
  • the sampling accuracy of second pulse information is an important factor affecting the accuracy of the entire IEEE 1588 synchronization system.
  • the sampling accuracy of the second pulse information is completely dependent on the clock frequency of the sampling clock, that is, the sampling accuracy of the second pulse information can only be improved by increasing the clock frequency of the sampling clock.
  • a sampling clock with a clock frequency of 1 GHz is required to make the sampling accuracy of the second pulse information reach 1 ns.
  • the present application provides a clock synchronization method, device, system and chip, which can ensure higher precision sampling when the clock frequency of the sampling clock is low.
  • the present application provides a clock synchronization method, including: receiving a second pulse signal and a clock synchronization protocol message, analyzing the clock synchronization protocol message to obtain timestamp information;
  • the clock signal is frequency-divided to obtain a plurality of first sub-clock signals; wherein, the period of each first sub-clock signal is the same;
  • the second pulse signal is sampled by using a plurality of first sub-clock signals to obtain a plurality of first sampling signals ; Taking the first jump edge of each first sampling signal as the sampling point, determine multiple first sampling values of the multiple first sampling signals at the sampling point; perform clock synchronization according to the timestamp information and the multiple first sampling values .
  • a clock synchronization method provided in the embodiment of the present application uses a fractional frequency-division phase-locked loop circuit to divide the frequency of the first reference clock signal to obtain N first sub-clock signals clk1 ⁇ clkN; using the above-mentioned first sub-clock signal
  • the second pulse signal is sampled to obtain first sampling signals Q1-QN.
  • the jump edge position of the second pulse signal so that the current time can be determined more accurately.
  • the present application uses N first sub-clock signals , the sampling precision can be reduced to 1/N clock period of the first reference clock signal, and the sampling precision can be increased to N times of the original.
  • using multiple first sub-clock signals to sample the second pulse signal includes: using multiple first sub-clock signals to sample the second pulse signal N times, and determining N sets of sampling results; wherein, N is a positive integer; each group of sampling results includes multiple first sampling signals.
  • the phases of multiple first sub-clock signals obtained by frequency division of the first reference clock signal may drift or be inaccurate.
  • the sampling average can be determined by the total number of sampling results N and multiple sets of sampling results to avoid the problem that the sampling accuracy of the second pulse information is affected by the drift or inaccuracy of multiple first sub-clock signals obtained after frequency division.
  • using a fractional frequency-division phase-locked loop circuit to divide the first reference clock signal to obtain a plurality of first sub-clock signals includes: using a fractional frequency-division phase-locked loop circuit to divide the first reference clock signal The frequency of the signal is divided by four to obtain four first sub-clock signals; wherein, after the frequency division, the phase difference between two adjacent first sub-clock signals is 90°.
  • the fractional frequency division phase-locked loop circuit includes: an inverter, a first frequency divider and a second frequency divider; the inverter is used to: generate and A signal with the opposite phase of the first reference clock signal; the first frequency divider is configured to divide the frequency of the first reference clock signal by two to obtain two first sub-clock signals, wherein the starting point of the two first sub-clock signals is The initial phases are respectively 0° and 180°; the second frequency divider is used to divide the frequency of the signal opposite to the phase of the first reference clock signal by two to obtain two first sub-clock signals, wherein the two first The starting phases of the sub clock signals are 90° and 270° respectively.
  • the inverter in the fractional frequency-division phase-locked loop After the first reference clock signal is input to the inverter in the fractional frequency-division phase-locked loop, its 0° and 180° phase clock signals are obtained, and the 0° and 180° phase clock signals are respectively subjected to the first frequency division
  • the second frequency divider and the second frequency divider obtain the first sub-clock signals with initial phases of 0°, 90°, 180° and 270° respectively.
  • the structure of the fractional frequency division phase-locked loop circuit of the present application is not limited thereto.
  • the inverter in the fractional frequency division phase-locked loop circuit can also be a phase separation circuit, and the phase separation circuit can also generate A signal that is in phase opposite to the first reference clock signal.
  • the first jump edge is a rising edge transitioning from a low level to a high level and/or a falling edge transitioning from a high level to a low level.
  • the second pulse signal is sampled by using a plurality of first sub-clock signals, including: sampling the second pulse signal by using the second jump edge of a plurality of first sub-clock signals, and the second jump edge is a transition from a low level to Rising edge high, and/or falling edge transition from high to low.
  • the method further includes: generating a first multi-phase clock signal according to the multiple first sub-clock signals, and using the first multi-phase clock signal to compare the second pulse signal Take a sample.
  • determining the time stamp information according to a plurality of second sampling values and the local time includes: when a sampling value of a set size appears for the first time among the plurality of second sampling values, according to the pulse period of the second pulse signal As well as the local time, determine the timestamp information.
  • the sampling error stipulated in the clock synchronization protocol message used will also be low.
  • the sampling error stipulated in the clock synchronization protocol message is not greater than ⁇ 0.5 ns.
  • the clock synchronization method provided by this application can also be completed by using a clock below 500MHz, which is relatively common in clock frequency and has relatively low requirements on clock manufacturing technology.
  • the clock frequency of the first reference clock signal is not higher than 500MHz.
  • the present application provides a clock synchronization method, which is applied to a master synchronization device, and uses a fractional frequency-division phase-locked loop circuit to divide the frequency of the second reference clock signal to obtain multiple second sub-clock signals; wherein, each The period of the second sub-clock signal is the same; Utilize a plurality of second sub-clock signals to sample the second pulse signal to obtain a plurality of second sampling signals; take the first jump edge of each second sampling signal as the sampling point, determine how many A plurality of second sampling values of a second sampling signal at the sampling point; determine time stamp information according to the plurality of second sampling values and local time, and send a clock synchronization protocol message, and the clock synchronization protocol message carries time stamp information.
  • the technical effect of the corresponding solution in the second aspect can refer to the technical effect that can be obtained by the corresponding solution in the first aspect, and the repeated parts will not be described in detail.
  • using multiple second sub-clock signals to sample the second pulse signal includes: using multiple second sub-clock signals to sample the second pulse signal N times, and determining N sets of sampling results; wherein, N is a positive integer; each group of sampling results includes multiple second sampling signals.
  • using a fractional frequency-division phase-locked loop circuit to divide the second reference clock signal to obtain a plurality of second sub-clock signals includes: using a fractional frequency-division phase-locked loop circuit to divide the second reference clock signal The frequency of the signal is divided by four to obtain four second sub-clock signals; wherein, after the frequency division, the phase difference between two adjacent first sub-clock signals is 90°.
  • the fractional frequency division phase-locked loop circuit includes: an inverter, a first frequency divider and a second frequency divider; the inverter is used to: generate and The signal with the opposite phase of the second reference clock signal; the first frequency divider is used to divide the frequency of the second reference clock signal by two to obtain two first sub-clock signals, wherein the starting point of the two first sub-clock signals The initial phases are respectively 0° and 180°; the second frequency divider is used to divide the frequency of the signal opposite to the phase of the second reference clock signal by two to obtain two first sub-clock signals, wherein the two first The starting phases of the sub clock signals are 90° and 270° respectively.
  • the first jump edge is a rising edge transitioning from a low level to a high level and/or a falling edge transitioning from a high level to a low level.
  • using multiple first sub-clock signals to sample the second pulse signal includes: using the second jump edges of the multiple first sub-clock signals to sample the second pulse signal, and the second jump edge is the rising edge from low to high, and/or the falling edge from high to low.
  • the method further includes: generating a second multi-phase clock signal according to the multiple second sub-clock signals, and using the second multi-phase clock signal to compare the second pulse signal Take a sample.
  • determining the time stamp information according to a plurality of second sampling values and the local time includes: when a sampling value of a set size appears for the first time among the plurality of second sampling values, according to the pulse period of the second pulse signal As well as the local time, determine the timestamp information.
  • the sampling error stipulated in the clock synchronization protocol message is not greater than ⁇ 0.5 ns.
  • the clock frequency of the first reference clock signal is not higher than 500 MHz.
  • the present application also provides a clock synchronization device, including a message and pulse-per-second signal receiving module, used to: receive the pulse-second signal and a clock synchronization protocol message, and analyze the clock synchronization protocol message to obtain time stamp information;
  • the frequency division module is used to: use the fractional frequency division phase-locked loop circuit to divide the frequency of the first reference clock signal to obtain a plurality of first sub-clock signals; wherein, the period of each first sub-clock signal is the same;
  • the sampling module It is used to: use a plurality of first sub-clock signals to sample the second pulse signal to obtain a plurality of first sampling signals;
  • the sampling value determination module is used to: take the first jump edge of each first sampling signal as a sampling point, A plurality of first sampling values of the plurality of first sampling signals at the sampling point are determined;
  • a clock synchronization module is configured to perform clock synchronization according to the time stamp information and the plurality of first sampling values.
  • the present application also provides a clock synchronization device, including a frequency division module, configured to: use a fractional frequency division phase-locked loop circuit to divide the frequency of the second reference clock signal to obtain multiple second sub-clock signals; Wherein, the period of each second sub-clock signal is the same; the sampling module is used to: use a plurality of second sub-clock signals to sample the second pulse signal to obtain a plurality of second sampling signals; the sampling value determination module is used to: Taking the first jump edge of each second sampling signal as the sampling point, determine a plurality of second sampling values of the plurality of second sampling signals at the sampling point; the message generation module is used for: according to the plurality of second sampling values And the local time determines the time stamp information, sends the clock synchronization protocol message, and the clock synchronization protocol message carries the time stamp information.
  • the technical effect of the corresponding solution in the fourth aspect can refer to the technical effect that can be obtained by the corresponding solution in the first aspect, and the repeated parts will not be described in
  • the present application provides a chip, including: a processor and a memory, the processor is connected to the memory, and an instruction program is stored in the memory, and the processor, under the control of the instruction program, is used to perform the following steps: obtain the second pulse signal and a clock synchronization protocol message, analyzing the clock synchronization protocol message to obtain time stamp information; using a fractional frequency division phase-locked loop circuit to divide the frequency of the first reference clock signal to obtain a plurality of first sub-clock signals; wherein, each The period of a sub-clock signal is the same; Utilize a plurality of first sub-clock signals to sample the second pulse signal to obtain a plurality of first sampling signals; take the first jump edge of each first sampling signal as a sampling point to determine a plurality of A plurality of first sampling values of the first sampling signal at the sampling point; clock synchronization is performed according to the time stamp information and the plurality of first sampling values.
  • the technical effect of the corresponding solution in the fifth aspect can refer to the technical effect that can be obtained
  • the present application provides a chip, including: a processor and a memory, the processor is connected to the memory, and an instruction program is stored in the memory, and the processor is used to perform the following steps under the control of the instruction program: using fractional frequency division
  • the phase-locked loop circuit divides the frequency of the second reference clock signal to obtain a plurality of second sub-clock signals; wherein, the period of each second sub-clock signal is the same; the second pulse signal is sampled by using a plurality of second sub-clock signals , to obtain a plurality of second sampling signals; taking the first jump edge of each second sampling signal as a sampling point, determine a plurality of second sampling values of a plurality of second sampling signals at the sampling point; according to a plurality of second sampling The value and the local time determine the time stamp information, and generate a clock synchronization protocol message, and the clock synchronization protocol message carries the time stamp information.
  • the technical effect of the corresponding solution in the sixth aspect can refer to the technical effect that can be obtained by the corresponding solution
  • the present application provides a clock synchronization system.
  • the clock synchronization system includes: a second frequency division module, which is used to divide the frequency of the second reference clock signal by a fractional frequency division phase-locked loop circuit to obtain a plurality of second sub-clocks.
  • the second sampling module is used to sample the second pulse signal by using a plurality of second sub-clock signals to obtain a plurality of second sampling signals;
  • the second sampling value The determination module is used to take the first jump edge of each second sampling signal as a sampling point to determine a plurality of second sampling values of a plurality of second sampling signals at the sampling point;
  • the second sampling value and the local time determine the time stamp information, and send a clock synchronization protocol message to the message and second pulse signal receiving module, and the clock synchronization protocol message carries time stamp information;
  • the message and second pulse signal receiving module is used to receive
  • the second pulse signal sent by the message generation module and the clock synchronization protocol message are parsed to obtain the time stamp information;
  • the first frequency division module is used to use the fractional frequency division phase-locked loop circuit to process the first reference clock signal frequency division to obtain a plurality of first sub-clock signals; wherein, the period of each first sub-clock signal is the same;
  • the first sampling module is used
  • FIG. 1 is a first schematic flow diagram of a clock synchronization method
  • FIG. 2 is a timing diagram corresponding to a clock synchronization method
  • Fig. 3 is a structural schematic diagram of a fractional frequency division phase-locked loop circuit
  • FIG. 4 is a second schematic flow diagram of a clock synchronization method
  • Fig. 5 is a schematic diagram of a clock synchronization device
  • Fig. 6 is a schematic diagram of another clock synchronization device.
  • one of the multiple nodes acts as a master synchronization device (master), and the remaining nodes act as slave synchronization devices (slave).
  • the master synchronization device can synchronize the reference time to all slave synchronization devices.
  • the master synchronization device sends an IEEE 1588 protocol message, and the slave synchronization device can collect time stamp information according to the received protocol message.
  • the real-time clock is adjusted so that the clock module of the slave synchronization device is synchronized with the time of the master synchronization device.
  • the slave synchronization device sends the time stamp information and the pulse-per-second information to the processing module, and the slave synchronization device adjusts its own real-time clock according to the time stamp information and the pulse-per-second information, and finally realizes clock synchronization.
  • the sampling error specified in the clock synchronization protocol message used will be relatively low.
  • a sampling clock with a clock frequency of 1 GHz is required to sample the second pulse signal in order to achieve a sampling accuracy of 1 ns.
  • the cost of producing a 1GHz clock is too high, and the clock frequency is less than 500MHz, but the sampling accuracy of the clock at a lower cost is difficult to meet the requirements of the IEEE 1588 synchronization system. Accuracy requirements. In view of this, when the clock frequency of the sampling clock used is low, how to ensure a higher precision sampling requirement is an urgent problem to be solved by those skilled in the art.
  • Figure 1 is a flow chart of the clock synchronization method provided by the embodiment of the application
  • Figure 2 is a timing diagram corresponding to the clock synchronization method provided by the implementation of the application, in combination with Figure 1 and Figure 2, the clock synchronization method in the embodiment of the application is applied to When syncing from a device, you can include methods like:
  • S101 Receive a second pulse signal and a clock synchronization protocol message, and analyze the clock synchronization protocol message to obtain time stamp information.
  • the clock synchronization protocol message may include: a high-precision time synchronization protocol (precision time protocol, PTP) message, a generalized precision time protocol (generalized precision time protocol, 802.1AS) message, a sync synchronization message, and a follow_up following message , delay_req delay request message or delay_resp delay response message, etc.
  • the sampling error stipulated in the clock synchronization protocol message may not be greater than ⁇ 0.5ns.
  • a PTP type message is used as an example, but it does not constitute a limitation to this application.
  • any All clock synchronization protocols can be applied in this application, and are not limited here.
  • the second pulse signal can be generated by an external clock device, and can also be sent together with the master synchronization device.
  • the time stamp information master synchronization device is determined based on the current time, and the current time is not limited to universal time coordinated (UTC) time and global positioning system (global positioning system, GPS) time, etc., which are not specifically limited here.
  • UTC universal time coordinated
  • GPS global positioning system
  • S102 Using a fractional frequency-division phase-locked loop circuit to divide the frequency of the first reference clock signal to obtain a plurality of first sub-clock signals. The period of each first sub-clock signal is the same.
  • the first reference clock signal may be generated by an internal clock
  • the internal clock may include: a crystal oscillator, a frequency multiplication circuit, a phase detector, a clock pulse circuit, an input digital-to-analog converter, a voltage-controlled oscillator, etc. .
  • the crystal oscillator can generate a clock signal with a reference frequency, and the reference frequency is related to the specific structure of the crystal oscillator; the frequency multiplication circuit is used to perform frequency multiplication processing on the reference frequency clock signal; The pulse circuit converts the phase detection signal into a clock pulse signal for the phase detection signal, and inputs the digital-analog converter to convert the clock pulse signal into an analog clock pulse signal, and the voltage-controlled oscillator outputs the first reference clock signal according to the analog clock pulse signal.
  • the above-mentioned processing process of the clock signal of the reference frequency is only an example, and the device connection relationship in the internal clock is not limited.
  • the purpose is to generate a clock signal of a specific frequency.
  • the specific generation method is not limited, and those skilled in the art should know .
  • the existing frequency division circuit can use a delay loop (time to digital converter, TDC) to divide the frequency of the first reference clock signal.
  • TDC time to digital converter
  • the timing time after frequency division will be completely determined by the timing chip (cell), but the timing chip (cell) jitter and high uncertainty, and is greatly affected by process voltage temperature (precess voltage temperature, PVT) conditions, so the reliability of frequency division using TDC is low, and a delay jitter of up to 1.68% will be generated, and due to The structure of its delay loop will lead to the accumulation of delay jitter, resulting in greater errors.
  • this application uses analog devices to form a fractional frequency division phase-locked loop circuit, which is not affected by process angle deviation and temperature.
  • a complex closed-loop structure is used to meet the requirements of high-speed clock scenarios, which has the advantages of low delay and high precision.
  • the first reference clock signal is divided by four using a fractional frequency-division phase-locked loop circuit to obtain four first sub-clock signals; wherein, after frequency division, adjacent The phase difference between the two first sub-clock signals is 90°.
  • a fractional frequency-division phase-locked loop circuit is used to divide the frequency of the first reference clock signal by four, thereby obtaining four first sub-clock signals: the first sub-clock signal clk1, the first sub-clock signal clk2, the first sub-clock The signal clk3 and the first sub-clock signal clk4; wherein, the phase difference between each adjacent clock signal is 90°.
  • phase difference between adjacent clock signals in the embodiment of the present application is 90° means, for example, the phase difference between the first sub-clock signal clk1 and the first sub-clock signal clk2 may have a certain deviation range Or, in other words, the phase difference between the first sub-clock signal clk1 and the first sub-clock signal clk2 is approximately 90°, and each first sub-clock needs to be kept in sync.
  • the clock frequency of the first reference clock signal is not higher than 500 MHz.
  • the number of generated first sub-clock signals may be related to the clock frequency of the first reference clock signal, for example, when the clock frequency of the first reference clock signal is 500MHz, fractional frequency division
  • the phase-locked loop circuit can divide the frequency of the first reference clock signal by four to obtain four first sub-clock signals, and when the clock frequency of the first reference clock signal is 250MHz, the fractional frequency-division phase-locked loop circuit can divide the first sub-clock signal A reference clock signal is divided by eight to obtain eight first sub-clock signals.
  • the first sub-clock signal can use the second jump edge to sample the second pulse signal.
  • the second jump edge can be a rising edge, that is, from a low level (0) Jumping to the transition edge of high level (1), of course, the second transition edge can also be a falling edge, that is, the transition edge from high level (1) to low level (0), in order
  • the second transition edge is taken as an example for illustration. Exemplarily, taking rising edge sampling as an example, after the second pulse signal is sampled by using the first sub-clock signal clk1, the first sampling signal Q1 can be obtained.
  • S104 Using the first jump edge of each first sampling signal as a sampling point, determine a plurality of first sampling values of the plurality of first sampling signals at the sampling point.
  • the sampling point refers to the first transition edge of the first sampling signal, wherein the first transition edge is the transition edge from the first value to the second value
  • the first transition edge can be a rising edge, that is, a transition edge that transitions from a low level (0) to a high level (1).
  • the first transition edge can also be a falling edge, that is, a transition from a high level to
  • the transition edge from the level (1) to the low level (0) is described in this application by taking the first transition edge as a rising edge as an example.
  • S105 Perform clock synchronization according to the time stamp information and multiple first sampling values.
  • the current time is determined according to the sampling value at which the updated time is first collected among the multiple first sampling values and the time stamp information, so as to realize clock synchronization.
  • each device may include a clock synchronization module and a processing module, and the above steps S101 to S105 may be performed in the processing module, that is, the clock synchronization module periodically receives time stamp information from the master synchronization device and second pulse information, and periodically send time stamp information and second pulse information to the processing module.
  • the processing module executes the above steps S101 to step S105, so that the master synchronization device and the slave synchronization Devices implement clock synchronization.
  • clock synchronization based on time stamp information and multiple first sampling values may be: when a sampling value of a set size appears for the first time in multiple first sampling values, according to the pulse of the second pulse signal Period and timestamp information to determine the current time.
  • the embodiment of the present application can obtain four first sub-clock signals clk1-clk4 by dividing the frequency of the first reference clock by four;
  • the sampling of the signal can obtain the first sampling signals Q1-Q4, and obtain a plurality of first sampling values based on the first transition edges of the first sampling signals Q1-Q4.
  • the pulse period of the second pulse signal is 1s
  • the time indicated by the time stamp information is 10:00:00.
  • the current time change is determined from the synchronization device is 10:00:01.
  • the sending time can be used as the compensation time, which is pre-added to the value carried by the time stamp. In the time, and then perform clock synchronization after compensating the sending time; and, because of the different ways of sending the clock synchronization protocol message, or the distance between the master synchronization device and the slave synchronization device, the corresponding sending time is also different.
  • the clock synchronization method uses a fractional frequency-division phase-locked loop circuit to divide the frequency of the first reference clock signal to obtain the first sub-clock signals clk1-clk4; wherein, each adjacent clock signal The phase difference of each is 90°, and the second pulse signal is sampled by using the above-mentioned first sub-clock signal to obtain the first sampling signals Q1-Q4.
  • the present application uses N first sub-clock signals , the sampling precision can be reduced to 1/N clock period of the first reference clock signal, and the sampling precision can be increased to N times of the original.
  • the synchronization method may further include: using a plurality of first sub-clock signals to sample the second pulse signal N times to determine N groups of sampling results; wherein, N is a positive integer; each group of sampling results includes a plurality of first sampling signals.
  • the above steps S103-S105 are executed N times, that is, after the second pulse signal is sampled N times by using a plurality of first sub-clock signals, if the phases of the plurality of first sub-clock signals do not drift, then Among the N groups of sampling results, each group of sampling results is basically the same. If the phases of multiple first sub-clock signals drift, the sampling average value can be determined by the total amount of sampling results N and multiple groups of sampling results, so as to avoid obtaining The drift or inaccuracy of multiple first sub-clock signals affects the sampling accuracy of the second pulse information.
  • the fractional frequency division phase-locked loop circuit includes: an inverter, a first frequency divider and a second frequency divider; the inverter is used to: generate and A signal with the opposite phase of the first reference clock signal; the first frequency divider is configured to divide the frequency of the first reference clock signal by two to obtain two first sub-clock signals, wherein the starting point of the two first sub-clock signals is The initial phases are respectively 0° and 180°; the second frequency divider is used to divide the frequency of the signal opposite to the phase of the first reference clock signal by two to obtain two first sub-clock signals, wherein the two first The starting phases of the sub clock signals are 90° and 270° respectively.
  • Fig. 3 is a structural schematic diagram of a fractional frequency division PLL circuit; referring to Fig. 3, the first reference clock signal is first input into the inverter in the fractional frequency division PLL to obtain its 0° and 180° phase clocks CLK0 and CLK1, CLK0 passes through the first frequency divider to obtain CLK00 and CLK01 with a frequency of 1/2 and a phase of 0° and 180°; CLK1 passes through the second frequency divider to obtain a frequency of 1/2 2. CLK10 and CLK11 with phases of 90° and 270°.
  • the structure of the fractional frequency division phase-locked loop circuit of the present application is not limited thereto.
  • the inverter in the fractional frequency division phase-locked loop circuit can also be a phase separation circuit, and the phase separation circuit can also be based on the first reference clock
  • the signal generates 0° and 180° phase clocks CLK0 and CLK1.
  • the delay error of the phase separation circuit is smaller, and its value is generally less than 3ps, which is more suitable for the high-precision clock synchronization protocol scenario of this application.
  • the method further includes:
  • a first multi-phase clock signal is generated according to the plurality of first sub-clock signals, and the second pulse signal is sampled by using the first multi-phase clock signal.
  • the fractional frequency-division phase-locked loop circuit may further include: an AND gate circuit for synthesizing a plurality of first sub-clock signals into a first multi-phase clock.
  • an AND gate circuit for synthesizing a plurality of first sub-clock signals into a first multi-phase clock.
  • CLK00, CLK01, CLK10, and CLK11 of the above embodiment are input to the AND gate circuit, the AND gate circuit can obtain a frequency half of the first reference clock signal, a duty cycle of 25%, and a starting phase of 0 °, 90°, 180° and 270° four-phase clock.
  • FIG. 4 is a flow chart of the clock synchronization method provided by the embodiment of the present application.
  • the clock synchronization method in the embodiment of the present application is applied to the master synchronization device, which may include:
  • S402 Use the multiple second sub-clock signals to sample the second pulse signal to obtain multiple second sampling signals
  • the present application provides a clock synchronization device 500, which device includes: message and second pulse signal receiving module 501, used for: receiving second pulse signal and clock synchronization protocol message, and analyzing the clock synchronization protocol
  • the time stamp information is obtained from the message;
  • the frequency division module 502 is configured to: use a fractional frequency division phase-locked loop circuit to divide the frequency of the first reference clock signal to obtain a plurality of first sub-clock signals; wherein, each first sub-clock The period of the signal is the same;
  • the sampling module 503 is configured to: use the plurality of first sub-clock signals to sample the second pulse signal to obtain a plurality of first sampling signals;
  • the sampling value determination module 504 is configured to: The first jump edge of the first sampling signal is a sampling point, and a plurality of first sampling values of the plurality of first sampling signals at the sampling point are determined;
  • the clock synchronization module 505 is configured to: according to the time stamp Clock synchronization is performed on the information and the plurality of first sampled
  • the present application also provides a clock synchronization device 600, which includes: a frequency division module 601, configured to: use a fractional frequency division phase-locked loop circuit to divide the second reference clock signal to obtain multiple The second sub-clock signal; wherein, the period of each second sub-clock signal is the same; the sampling module 602 is configured to: use the plurality of second sub-clock signals to sample the second pulse signal to obtain a plurality of second Sampling signal; sampling value determination module 603, configured to: take the first jump edge of each second sampling signal as a sampling point, and determine multiple second sampling values of the multiple second sampling signals at the sampling point ; A message generating module 604, configured to: determine time stamp information according to the plurality of second sampling values and local time, and send a clock synchronization protocol message, where the clock synchronization protocol message carries the time stamp information.
  • a frequency division module 601 configured to: use a fractional frequency division phase-locked loop circuit to divide the second reference clock signal to obtain multiple The second sub-clock signal; wherein, the period of each
  • each functional module can be integrated in In one processing module, each module may exist independently, or two or more units may be integrated into one unit.
  • the above-mentioned integrated modules can be implemented in the form of hardware or in the form of software function modules.
  • the present application also provides a clock synchronization system.
  • the clock synchronization system includes: a second frequency division module, which is used to divide the frequency of the second reference clock signal by using a fractional frequency division phase-locked loop circuit to obtain a plurality of second sub-clocks signal; wherein, the period of each second sub-clock signal is the same; the second sampling module is used to use the plurality of second sub-clock signals to sample the second pulse signal to obtain a plurality of second sampling signals; Two sampling value determination modules, used to take the first jump edge of each second sampling signal as a sampling point to determine a plurality of second sampling values of the plurality of second sampling signals at the sampling point; message generation A module, configured to determine time stamp information according to the plurality of second sampling values and local time, and send a clock synchronization protocol message to the message and second pulse signal receiving module, the clock synchronization protocol message carrying the time Stamp information; message and second pulse signal receiving module, used to receive the second pulse signal and clock synchronization protocol message sent by the message generation module, and analyze
  • the present application also provides a chip, a processor and a memory, the processor is connected to the memory, an instruction program is stored in the memory, and the processor is used to perform the following steps under the control of the instruction program : Obtain a second pulse signal and a clock synchronization protocol message, analyze the clock synchronization protocol message to obtain time stamp information; use a fractional frequency division phase-locked loop circuit to divide the frequency of the first reference clock signal to obtain multiple first sub-clocks signal; wherein, the period of each first sub-clock signal is the same; the second pulse signal is sampled by using the plurality of first sub-clock signals to obtain a plurality of first sampling signals; The first jump edge is a sampling point, and determining a plurality of first sampling values of the plurality of first sampling signals at the sampling point; performing clock synchronization according to the time stamp information and the plurality of first sampling values.
  • the present application also provides a chip, including: a processor and a memory, the processor is connected to the memory, an instruction program is stored in the memory, and the processor is used to execute The following steps: use the fractional frequency division phase-locked loop circuit to divide the second reference clock signal to obtain a plurality of second sub-clock signals; wherein, the period of each second sub-clock signal is the same; using the plurality of second sub-clock signals The sub-clock signal samples the second pulse signal to obtain a plurality of second sampling signals; taking the first jump edge of each second sampling signal as a sampling point, and determining that the plurality of second sampling signals are at the sampling point multiple second sampled values at the same time; determine time stamp information according to the multiple second sampled values and local time, and generate a clock synchronization protocol message, where the clock synchronization protocol message carries the time stamp information.
  • an embodiment of the present application further provides a computer program, which causes the computer to execute the clock synchronization method provided in the above embodiments when the computer program is run on a computer.
  • the embodiments of the present application also provide a computer-readable storage medium, in which a computer program is stored in the computer-readable storage medium.
  • the computer program When the computer program is executed by a computer, the computer executes the clock synchronization provided by the above embodiments. method.
  • the embodiments of the present application may be provided as methods, systems, or computer program products. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
  • computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
  • These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to operate in a specific manner, such that the instructions stored in the computer-readable memory produce an article of manufacture comprising instruction means, the instructions
  • the device realizes the function specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.

Abstract

Disclosed in the present application are a clock synchronization method, apparatus and system, and a chip. The method comprises: receiving pulse-per-second signals and a clock synchronization protocol message, wherein timestamp information can be obtained by means of parsing the clock synchronization protocol; performing frequency division on a first reference clock signal by using a fractional frequency division phase-locked loop circuit, so as to obtain a plurality of first clock sub-signals; sampling the pulse-per-second signals by using the plurality of first clock sub-signals, so as to obtain a plurality of first sampled signals; taking first hop edges of the first sampled signals as sampling points, and determining a plurality of first sampling values of the plurality of first sampled signals at the sampling points; and realizing clock synchronization on the basis of the timestamp information and the plurality of first sampling values. In the present application, after frequency division is performed on a first reference clock signal by using a fractional frequency division phase-locked loop circuit, pulse-per-second signals can be sampled with a higher precision by using a plurality of first clock sub-signals, such that the sampling precision can be improved, thereby further improving the accuracy of clock synchronization.

Description

一种时钟同步方法、装置、系统及芯片A clock synchronization method, device, system and chip 技术领域technical field
本申请涉及分布式网络技术领域,特别涉及一种时钟同步方法、装置、系统及芯片。The present application relates to the technical field of distributed networks, in particular to a clock synchronization method, device, system and chip.
背景技术Background technique
时钟同步系统可以精确地将分布式网络通讯中的各个节点的实时时钟同步起来,以采用精密时钟同步协议标准(standard for a precision clock synchronization protocol for networked measurement and control systems,IEEE 1588)的时钟同步系统为例,在该时钟同步系统中,分布式网络的各个节点中都设有时钟模块和处理模块,其中,处理模块用于进行IEEE 1588报文的相关协议处理并收集时间戳,以及将时间戳发送给时钟模块,时钟模块用于基于处理模块发送的时间戳进行时钟信息的运算,进而调整本地的实时时钟,以实现各个节点的时钟同步。时钟模块会周期性地向处理模块发送时戳信息和秒脉冲信息(pulse per second,PPS),从而使处理模块的实时时钟与时钟模块同步。The clock synchronization system can accurately synchronize the real-time clocks of each node in the distributed network communication to adopt the clock synchronization system of the standard for a precision clock synchronization protocol for networked measurement and control systems (IEEE 1588) As an example, in this clock synchronization system, each node of the distributed network is equipped with a clock module and a processing module, wherein the processing module is used to process related protocols of IEEE 1588 messages and collect time stamps, and convert the time stamps to It is sent to the clock module, and the clock module is used to calculate the clock information based on the time stamp sent by the processing module, and then adjust the local real-time clock to realize the clock synchronization of each node. The clock module periodically sends time stamp information and pulse per second (PPS) information to the processing module, so that the real-time clock of the processing module is synchronized with the clock module.
IEEE 1588同步系统对采样精度的要求非常高,目前要求的采样精度要求为纳秒级,其中,秒脉冲信息的采样精度是影响整个IEEE 1588同步系统精度的重要因素。而秒脉冲信息的采样精度完全依赖于采样时钟的时钟频率,也就是说,只能通过提高采样时钟的时钟频率才能提高秒脉冲信息的采样精度。例如,若要满足IEEE 1588同步系统的精度要求,需要时钟频率为1GHz的采样时钟,才能使秒脉冲信息的采样精度达到1ns。但是,在现有的时钟制程工艺下,1GHz的时钟实现成本过高,但较低成本制程的时钟的采样精度又难以满足IEEE 1588同步系统的精度要求。有鉴于此,在采样时钟的时钟频率较低时,如何保证较高精度的采样要求,是本领域人员亟待解决的。The IEEE 1588 synchronization system has very high requirements for sampling accuracy. Currently, the sampling accuracy required is at the nanosecond level. Among them, the sampling accuracy of second pulse information is an important factor affecting the accuracy of the entire IEEE 1588 synchronization system. The sampling accuracy of the second pulse information is completely dependent on the clock frequency of the sampling clock, that is, the sampling accuracy of the second pulse information can only be improved by increasing the clock frequency of the sampling clock. For example, to meet the accuracy requirements of the IEEE 1588 synchronization system, a sampling clock with a clock frequency of 1 GHz is required to make the sampling accuracy of the second pulse information reach 1 ns. However, under the existing clock manufacturing process, the cost of implementing a 1GHz clock is too high, but the sampling accuracy of a clock with a lower cost process is difficult to meet the accuracy requirements of the IEEE 1588 synchronization system. In view of this, when the clock frequency of the sampling clock is low, how to ensure a higher precision sampling requirement is urgently to be solved by those skilled in the art.
发明内容Contents of the invention
本申请提供一种时钟同步方法、装置、系统及芯片,在采样时钟的时钟频率较低时,能够保证较高精度的采样。The present application provides a clock synchronization method, device, system and chip, which can ensure higher precision sampling when the clock frequency of the sampling clock is low.
第一方面,本申请提供了一种时钟同步方法,包括:接收秒脉冲信号以及时钟同步协议报文,解析时钟同步协议报文得到时戳信息;利用小数分频锁相环电路对第一参考时钟信号进行分频,得到多个第一子时钟信号;其中,每个第一子时钟信号的周期相同;利用多个第一子时钟信号对秒脉冲信号进行采样,得到多个第一采样信号;以每个第一采样信号的第一跳边沿为采样点,确定多个第一采样信号在采样点时的多个第一采样值;根据时戳信息以及多个第一采样值进行时钟同步。In the first aspect, the present application provides a clock synchronization method, including: receiving a second pulse signal and a clock synchronization protocol message, analyzing the clock synchronization protocol message to obtain timestamp information; The clock signal is frequency-divided to obtain a plurality of first sub-clock signals; wherein, the period of each first sub-clock signal is the same; the second pulse signal is sampled by using a plurality of first sub-clock signals to obtain a plurality of first sampling signals ; Taking the first jump edge of each first sampling signal as the sampling point, determine multiple first sampling values of the multiple first sampling signals at the sampling point; perform clock synchronization according to the timestamp information and the multiple first sampling values .
本申请实施例提供的一种时钟同步方法,采用小数分频锁相环电路对第一参考时钟信号进行分频,可以得到N个第一子时钟信号clk1~clkN;利用上述第一子时钟信号对秒脉冲信号进行采样,得到第一采样信号Q1~QN。根据不同的第一采样信号Q1~QN的第一跳边沿为采样点,确定多个第一采样信号在采样点时的多个第一采样值;根据多个第一采样值可以更精准的确定秒脉冲信号的跳边沿位置,从而可以更精准的确定当前时间,因此,相比于现有技术仅采用一个第一参考时钟信号对秒脉冲信号进行采样,本申请通过N个第一子时钟信号,可以将采样精度缩小到1/N个第一参考时钟信号的时钟周期,将采样精度 提高至原来的N倍。A clock synchronization method provided in the embodiment of the present application uses a fractional frequency-division phase-locked loop circuit to divide the frequency of the first reference clock signal to obtain N first sub-clock signals clk1~clkN; using the above-mentioned first sub-clock signal The second pulse signal is sampled to obtain first sampling signals Q1-QN. According to the first jump edge of different first sampling signals Q1~QN as the sampling point, determine the multiple first sampling values of the multiple first sampling signals at the sampling point; according to the multiple first sampling values, it can be more accurately determined The jump edge position of the second pulse signal, so that the current time can be determined more accurately. Therefore, compared with the prior art, only one first reference clock signal is used to sample the second pulse signal, the present application uses N first sub-clock signals , the sampling precision can be reduced to 1/N clock period of the first reference clock signal, and the sampling precision can be increased to N times of the original.
在一些可能的实施方式中,利用多个第一子时钟信号对秒脉冲信号进行采样,包括:采用多个第一子时钟信号对秒脉冲信号进行N次采样,确定N组采样结果;其中,N为正整数;每一组采样结果包括多个第一采样信号。In some possible implementation manners, using multiple first sub-clock signals to sample the second pulse signal includes: using multiple first sub-clock signals to sample the second pulse signal N times, and determining N sets of sampling results; wherein, N is a positive integer; each group of sampling results includes multiple first sampling signals.
在实际应用中,由第一参考时钟信号分频得到的多个第一子时钟信号的相位可能会出现漂移或不准确的问题,对秒脉冲信号进行N次采样后,如果多个第一子时钟信号相位不漂移,则N组采样结果中,每一组采样结果基本一致,如果多个第一子时钟信号相位发生漂移,则可以通过采样结果总量N以及多组采样结果确定采样平均值,避免因分频后得到的多个第一子时钟信号漂移或不准确,影响秒脉冲信息的采样精度的问题。In practical applications, the phases of multiple first sub-clock signals obtained by frequency division of the first reference clock signal may drift or be inaccurate. After sampling the second pulse signal N times, if multiple first sub-clock signals If the phase of the clock signal does not drift, then among the N sets of sampling results, each set of sampling results is basically the same. If the phases of multiple first sub-clock signals drift, the sampling average can be determined by the total number of sampling results N and multiple sets of sampling results To avoid the problem that the sampling accuracy of the second pulse information is affected by the drift or inaccuracy of multiple first sub-clock signals obtained after frequency division.
作为一种可能的实施方式,利用小数分频锁相环电路对第一参考时钟信号进行分频,得到多个第一子时钟信号,包括:利用小数分频锁相环电路对第一参考时钟信号进行四分频,得到四个第一子时钟信号;其中,分频后相邻两个第一子时钟信号的相位差为90°。As a possible implementation manner, using a fractional frequency-division phase-locked loop circuit to divide the first reference clock signal to obtain a plurality of first sub-clock signals includes: using a fractional frequency-division phase-locked loop circuit to divide the first reference clock signal The frequency of the signal is divided by four to obtain four first sub-clock signals; wherein, after the frequency division, the phase difference between two adjacent first sub-clock signals is 90°.
作为一种可能的实施方式,小数分频锁相环电路中包括:反相器,第一分频器以及第二分频器;反相器,用于:基于第一参考时钟信号,生成与第一参考时钟信号相位相反的信号;第一分频器,用于:对第一参考时钟信号进行二分频,得到两个第一子时钟信号,其中,两个第一子时钟信号的起始相位分别为0°和180°;第二分频器,用于:对与第一参考时钟信号相位相反的信号进行二分频,得到两个第一子时钟信号,其中,两个第一子时钟信号的起始相位分别为90°和270°。As a possible implementation manner, the fractional frequency division phase-locked loop circuit includes: an inverter, a first frequency divider and a second frequency divider; the inverter is used to: generate and A signal with the opposite phase of the first reference clock signal; the first frequency divider is configured to divide the frequency of the first reference clock signal by two to obtain two first sub-clock signals, wherein the starting point of the two first sub-clock signals is The initial phases are respectively 0° and 180°; the second frequency divider is used to divide the frequency of the signal opposite to the phase of the first reference clock signal by two to obtain two first sub-clock signals, wherein the two first The starting phases of the sub clock signals are 90° and 270° respectively.
在实际应用中,第一参考时钟信号输入小数分频锁相环中的反相器后,得到它的0°和180°相位时钟信号,0°和180°相位时钟信号分别经过第一分频器、第二分频器得到起始相位分别为0°、90°、180°和270°的第一子时钟信号。此外,本申请的小数分频锁相环电路的结构并不限于此,小数分频锁相环电路中的反相器还可以为相位分离电路,相位分离电路同样可以根据第一参考时钟信号生成与第一参考时钟信号相位相反的信号。In practical applications, after the first reference clock signal is input to the inverter in the fractional frequency-division phase-locked loop, its 0° and 180° phase clock signals are obtained, and the 0° and 180° phase clock signals are respectively subjected to the first frequency division The second frequency divider and the second frequency divider obtain the first sub-clock signals with initial phases of 0°, 90°, 180° and 270° respectively. In addition, the structure of the fractional frequency division phase-locked loop circuit of the present application is not limited thereto. The inverter in the fractional frequency division phase-locked loop circuit can also be a phase separation circuit, and the phase separation circuit can also generate A signal that is in phase opposite to the first reference clock signal.
作为一种可能的实施方式,第一跳边沿为从低电平跳变为高电平的上升沿和/或从高电平跳变为低电平的下降沿。利用多个第一子时钟信号对秒脉冲信号进行采样,包括:利用多个第一子时钟信号的第二跳边沿,对秒脉冲信号进行采样,第二跳边沿为从低电平跳变为高电平的上升沿,和/或从高电平跳变为低电平的下降沿。As a possible implementation manner, the first jump edge is a rising edge transitioning from a low level to a high level and/or a falling edge transitioning from a high level to a low level. The second pulse signal is sampled by using a plurality of first sub-clock signals, including: sampling the second pulse signal by using the second jump edge of a plurality of first sub-clock signals, and the second jump edge is a transition from a low level to Rising edge high, and/or falling edge transition from high to low.
作为一种可能的实施方式,得到多个第一子时钟信号之后,方法还包括:根据多个第一子时钟信号,生成第一多相位时钟信号,利用第一多相位时钟信号对秒脉冲信号进行采样。As a possible implementation manner, after the multiple first sub-clock signals are obtained, the method further includes: generating a first multi-phase clock signal according to the multiple first sub-clock signals, and using the first multi-phase clock signal to compare the second pulse signal Take a sample.
作为一种可能的实施方式,根据多个第二采样值以及本地时间确定时戳信息,包括:在多个第二采样值中首次出现设定大小的采样数值时,根据秒脉冲信号的脉冲周期以及本地时间,确定时戳信息。As a possible implementation manner, determining the time stamp information according to a plurality of second sampling values and the local time includes: when a sampling value of a set size appears for the first time among the plurality of second sampling values, according to the pulse period of the second pulse signal As well as the local time, determine the timestamp information.
由于在精度要求较高的分布式网络中,使用的时钟同步协议报文规定的采样误差也会较低。作为一种可能的实施方式,时钟同步协议报文规定的采样误差不大于±0.5ns。Because in a distributed network with high precision requirements, the sampling error stipulated in the clock synchronization protocol message used will also be low. As a possible implementation manner, the sampling error stipulated in the clock synchronization protocol message is not greater than ±0.5 ns.
若需要满足IEEE 1588同步系统的精度要求,则需要时钟频率为1GHz的采样时钟对秒脉冲信号进行采样,而在现有的时钟制程工艺下,生产1GHz的时钟的成本过高,现有较为常见的还是时钟频率为500MHz以下的时钟,在本方面中,采用时钟频率较为常见的且对时钟制程工艺要求较低的500MHz以下的时钟,同样可以完成本申请提供的时钟同步方法,作为一种可能的实施方式,第一参考时钟信号的时钟频率不高于500MHz。If it is necessary to meet the accuracy requirements of the IEEE 1588 synchronization system, a sampling clock with a clock frequency of 1GHz is required to sample the second pulse signal. However, under the existing clock manufacturing process, the cost of producing a 1GHz clock is too high, and it is relatively common at present. The clock frequency is still a clock below 500MHz. In this aspect, the clock synchronization method provided by this application can also be completed by using a clock below 500MHz, which is relatively common in clock frequency and has relatively low requirements on clock manufacturing technology. As a possibility In an implementation manner, the clock frequency of the first reference clock signal is not higher than 500MHz.
第二方面,本申请提供一种时钟同步方法,应用于主同步设备,利用小数分频锁相环电路对第二参考时钟信号进行分频,得到多个第二子时钟信号;其中,每个第二子时钟信号的周期相同;利用多个第二子时钟信号对秒脉冲信号进行采样,得到多个第二采样信号;以每个第二采样信号的第一跳边沿为采样点,确定多个第二采样信号在采样点时的多个第二采样值;根据多个第二采样值以及本地时间确定时戳信息,发送时钟同步协议报文,时钟同步协议报文携带时戳信息。其中,第二方面中相应方案的技术效果可以参照第一方面中对应方案可以得到的技术效果,重复之处不予详述。In the second aspect, the present application provides a clock synchronization method, which is applied to a master synchronization device, and uses a fractional frequency-division phase-locked loop circuit to divide the frequency of the second reference clock signal to obtain multiple second sub-clock signals; wherein, each The period of the second sub-clock signal is the same; Utilize a plurality of second sub-clock signals to sample the second pulse signal to obtain a plurality of second sampling signals; take the first jump edge of each second sampling signal as the sampling point, determine how many A plurality of second sampling values of a second sampling signal at the sampling point; determine time stamp information according to the plurality of second sampling values and local time, and send a clock synchronization protocol message, and the clock synchronization protocol message carries time stamp information. Wherein, the technical effect of the corresponding solution in the second aspect can refer to the technical effect that can be obtained by the corresponding solution in the first aspect, and the repeated parts will not be described in detail.
作为一种可能的实施方式,利用多个第二子时钟信号对秒脉冲信号进行采样,包括:采用多个第二子时钟信号对秒脉冲信号进行N次采样,确定N组采样结果;其中,N为正整数;每一组采样结果包括多个第二采样信号。As a possible implementation manner, using multiple second sub-clock signals to sample the second pulse signal includes: using multiple second sub-clock signals to sample the second pulse signal N times, and determining N sets of sampling results; wherein, N is a positive integer; each group of sampling results includes multiple second sampling signals.
作为一种可能的实施方式,利用小数分频锁相环电路对第二参考时钟信号进行分频,得到多个第二子时钟信号,包括:利用小数分频锁相环电路对第二参考时钟信号进行四分频,得到四个第二子时钟信号;其中,分频后相邻两个第一子时钟信号的相位差为90°。As a possible implementation manner, using a fractional frequency-division phase-locked loop circuit to divide the second reference clock signal to obtain a plurality of second sub-clock signals includes: using a fractional frequency-division phase-locked loop circuit to divide the second reference clock signal The frequency of the signal is divided by four to obtain four second sub-clock signals; wherein, after the frequency division, the phase difference between two adjacent first sub-clock signals is 90°.
作为一种可能的实施方式,小数分频锁相环电路中包括:反相器,第一分频器以及第二分频器;反相器,用于:基于第二参考时钟信号,生成与第二参考时钟信号相位相反的信号;第一分频器,用于:对第二参考时钟信号进行二分频,得到两个第一子时钟信号,其中,两个第一子时钟信号的起始相位分别为0°和180°;第二分频器,用于:对与第二参考时钟信号相位相反的信号进行二分频,得到两个第一子时钟信号,其中,两个第一子时钟信号的起始相位分别为90°和270°。As a possible implementation manner, the fractional frequency division phase-locked loop circuit includes: an inverter, a first frequency divider and a second frequency divider; the inverter is used to: generate and The signal with the opposite phase of the second reference clock signal; the first frequency divider is used to divide the frequency of the second reference clock signal by two to obtain two first sub-clock signals, wherein the starting point of the two first sub-clock signals The initial phases are respectively 0° and 180°; the second frequency divider is used to divide the frequency of the signal opposite to the phase of the second reference clock signal by two to obtain two first sub-clock signals, wherein the two first The starting phases of the sub clock signals are 90° and 270° respectively.
作为一种可能的实施方式,第一跳边沿为从低电平跳变为高电平的上升沿和/或从高电平跳变为低电平的下降沿。As a possible implementation manner, the first jump edge is a rising edge transitioning from a low level to a high level and/or a falling edge transitioning from a high level to a low level.
作为一种可能的实施方式,利用多个第一子时钟信号对秒脉冲信号进行采样,包括:利用多个第一子时钟信号的第二跳边沿,对秒脉冲信号进行采样,第二跳边沿为从低电平跳变为高电平的上升沿,和/或从高电平跳变为低电平的下降沿。As a possible implementation manner, using multiple first sub-clock signals to sample the second pulse signal includes: using the second jump edges of the multiple first sub-clock signals to sample the second pulse signal, and the second jump edge is the rising edge from low to high, and/or the falling edge from high to low.
作为一种可能的实施方式,得到多个第一子时钟信号之后,方法还包括:根据多个第二子时钟信号,生成第二多相位时钟信号,利用第二多相位时钟信号对秒脉冲信号进行采样。As a possible implementation manner, after the multiple first sub-clock signals are obtained, the method further includes: generating a second multi-phase clock signal according to the multiple second sub-clock signals, and using the second multi-phase clock signal to compare the second pulse signal Take a sample.
作为一种可能的实施方式,根据多个第二采样值以及本地时间确定时戳信息,包括:在多个第二采样值中首次出现设定大小的采样数值时,根据秒脉冲信号的脉冲周期以及本地时间,确定时戳信息。As a possible implementation manner, determining the time stamp information according to a plurality of second sampling values and the local time includes: when a sampling value of a set size appears for the first time among the plurality of second sampling values, according to the pulse period of the second pulse signal As well as the local time, determine the timestamp information.
作为一种可能的实施方式,时钟同步协议报文规定的采样误差不大于±0.5ns。As a possible implementation manner, the sampling error stipulated in the clock synchronization protocol message is not greater than ±0.5 ns.
作为一种可能的实施方式,第一参考时钟信号的时钟频率不高于500MHz。As a possible implementation manner, the clock frequency of the first reference clock signal is not higher than 500 MHz.
第三方面,本申请还提供了一种时钟同步装置,包括报文及秒脉冲信号接收模块,用于:接收秒脉冲信号以及时钟同步协议报文,解析时钟同步协议报文得到时戳信息;分频模块,用于:利用小数分频锁相环电路对第一参考时钟信号进行分频,得到多个第一子时钟信号;其中,每个第一子时钟信号的周期相同;采样模块,用于:利用多个第一子时钟信号对秒脉冲信号进行采样,得到多个第一采样信号;采样值确定模块,用于:以每个第一采样信号的第一跳边沿为采样点,确定多个第一采样信号在采样点时的多个第一采样值;时钟同步模块,用于:根据时戳信息以及多个第一采样值进行时钟同步。其中,第三方面中相应方案的技术效果可以参照第一方面中对应方案可以得到的技术效果,重复之处不予 详述。In the third aspect, the present application also provides a clock synchronization device, including a message and pulse-per-second signal receiving module, used to: receive the pulse-second signal and a clock synchronization protocol message, and analyze the clock synchronization protocol message to obtain time stamp information; The frequency division module is used to: use the fractional frequency division phase-locked loop circuit to divide the frequency of the first reference clock signal to obtain a plurality of first sub-clock signals; wherein, the period of each first sub-clock signal is the same; the sampling module, It is used to: use a plurality of first sub-clock signals to sample the second pulse signal to obtain a plurality of first sampling signals; the sampling value determination module is used to: take the first jump edge of each first sampling signal as a sampling point, A plurality of first sampling values of the plurality of first sampling signals at the sampling point are determined; a clock synchronization module is configured to perform clock synchronization according to the time stamp information and the plurality of first sampling values. Among them, the technical effect of the corresponding solution in the third aspect can refer to the technical effect that can be obtained by the corresponding solution in the first aspect, and the repeated parts will not be described in detail.
第四方面,本申请还提供了一种时钟同步装置,包括分频模块,用于:利用小数分频锁相环电路对第二参考时钟信号进行分频,得到多个第二子时钟信号;其中,每个第二子时钟信号的周期相同;采样模块,用于:利用多个第二子时钟信号对秒脉冲信号进行采样,得到多个第二采样信号;采样值确定模块,用于:以每个第二采样信号的第一跳边沿为采样点,确定多个第二采样信号在采样点时的多个第二采样值;报文生成模块,用于:根据多个第二采样值以及本地时间确定时戳信息,发送时钟同步协议报文,时钟同步协议报文携带时戳信息。其中,第四方面中相应方案的技术效果可以参照第一方面中对应方案可以得到的技术效果,重复之处不予详述。In a fourth aspect, the present application also provides a clock synchronization device, including a frequency division module, configured to: use a fractional frequency division phase-locked loop circuit to divide the frequency of the second reference clock signal to obtain multiple second sub-clock signals; Wherein, the period of each second sub-clock signal is the same; the sampling module is used to: use a plurality of second sub-clock signals to sample the second pulse signal to obtain a plurality of second sampling signals; the sampling value determination module is used to: Taking the first jump edge of each second sampling signal as the sampling point, determine a plurality of second sampling values of the plurality of second sampling signals at the sampling point; the message generation module is used for: according to the plurality of second sampling values And the local time determines the time stamp information, sends the clock synchronization protocol message, and the clock synchronization protocol message carries the time stamp information. Wherein, the technical effect of the corresponding solution in the fourth aspect can refer to the technical effect that can be obtained by the corresponding solution in the first aspect, and the repeated parts will not be described in detail.
第五方面,本申请提供一种芯片,包括:处理器和存储器,处理器与存储器相连,存储器中保存有指令程序,处理器在指令程序的控制下,用于执行如下步骤:获得秒脉冲信号以及时钟同步协议报文,解析时钟同步协议报文得到时戳信息;利用小数分频锁相环电路对第一参考时钟信号进行分频,得到多个第一子时钟信号;其中,每个第一子时钟信号的周期相同;利用多个第一子时钟信号对秒脉冲信号进行采样,得到多个第一采样信号;以每个第一采样信号的第一跳边沿为采样点,确定多个第一采样信号在采样点时的多个第一采样值;根据时戳信息以及多个第一采样值进行时钟同步。第五方面中相应方案的技术效果可以参照第一方面中对应方案可以得到的技术效果,重复之处不予详述。In a fifth aspect, the present application provides a chip, including: a processor and a memory, the processor is connected to the memory, and an instruction program is stored in the memory, and the processor, under the control of the instruction program, is used to perform the following steps: obtain the second pulse signal and a clock synchronization protocol message, analyzing the clock synchronization protocol message to obtain time stamp information; using a fractional frequency division phase-locked loop circuit to divide the frequency of the first reference clock signal to obtain a plurality of first sub-clock signals; wherein, each The period of a sub-clock signal is the same; Utilize a plurality of first sub-clock signals to sample the second pulse signal to obtain a plurality of first sampling signals; take the first jump edge of each first sampling signal as a sampling point to determine a plurality of A plurality of first sampling values of the first sampling signal at the sampling point; clock synchronization is performed according to the time stamp information and the plurality of first sampling values. The technical effect of the corresponding solution in the fifth aspect can refer to the technical effect that can be obtained by the corresponding solution in the first aspect, and the repeated parts will not be described in detail.
第六方面,本申请提供一种芯片,包括:处理器和存储器,处理器与存储器相连,存储器中保存有指令程序,处理器在指令程序的控制下,用于执行如下步骤:利用小数分频锁相环电路对第二参考时钟信号进行分频,得到多个第二子时钟信号;其中,每个第二子时钟信号的周期相同;利用多个第二子时钟信号对秒脉冲信号进行采样,得到多个第二采样信号;以每个第二采样信号的第一跳边沿为采样点,确定多个第二采样信号在采样点时的多个第二采样值;根据多个第二采样值以及本地时间确定时戳信息,生成时钟同步协议报文,时钟同步协议报文携带时戳信息。第六方面中相应方案的技术效果可以参照第二方面中对应方案可以得到的技术效果,重复之处不予详述。In a sixth aspect, the present application provides a chip, including: a processor and a memory, the processor is connected to the memory, and an instruction program is stored in the memory, and the processor is used to perform the following steps under the control of the instruction program: using fractional frequency division The phase-locked loop circuit divides the frequency of the second reference clock signal to obtain a plurality of second sub-clock signals; wherein, the period of each second sub-clock signal is the same; the second pulse signal is sampled by using a plurality of second sub-clock signals , to obtain a plurality of second sampling signals; taking the first jump edge of each second sampling signal as a sampling point, determine a plurality of second sampling values of a plurality of second sampling signals at the sampling point; according to a plurality of second sampling The value and the local time determine the time stamp information, and generate a clock synchronization protocol message, and the clock synchronization protocol message carries the time stamp information. The technical effect of the corresponding solution in the sixth aspect can refer to the technical effect that can be obtained by the corresponding solution in the second aspect, and the repeated parts will not be described in detail.
第七方面,本申请提供一种时钟同步系统,时钟同步系统包括:第二分频模块,用于利用小数分频锁相环电路对第二参考时钟信号进行分频,得到多个第二子时钟信号;其中,每个第二子时钟信号的周期相同;第二采样模块,用于利用多个第二子时钟信号对秒脉冲信号进行采样,得到多个第二采样信号;第二采样值确定模块,用于以每个第二采样信号的第一跳边沿为采样点,确定多个第二采样信号在采样点时的多个第二采样值;报文生成模块,用于根据多个第二采样值以及本地时间确定时戳信息,向报文及秒脉冲信号接收模块发送时钟同步协议报文,时钟同步协议报文携带时戳信息;报文及秒脉冲信号接收模块,用于接收报文生成模块发送的秒脉冲信号以及时钟同步协议报文,解析时钟同步协议报文得到时戳信息;第一分频模块,用于利用小数分频锁相环电路对第一参考时钟信号进行分频,得到多个第一子时钟信号;其中,每个第一子时钟信号的周期相同;第一采样模块,用于利用多个第一子时钟信号对秒脉冲信号进行采样,得到多个第一采样信号;第一采样值确定模块,用于以每个第一采样信号的第一跳边沿为采样点,确定多个第一采样信号在采样点时的多个第一采样值;时钟同步模块,用于根据时戳信息以及多个第一采样值进行时钟同步。第七方面中相应方案的技术效果可以参照第一方面以及第二方面中对应方案可以得到的技术效果,重复之处不予详述。In the seventh aspect, the present application provides a clock synchronization system. The clock synchronization system includes: a second frequency division module, which is used to divide the frequency of the second reference clock signal by a fractional frequency division phase-locked loop circuit to obtain a plurality of second sub-clocks. Clock signal; wherein, the period of each second sub-clock signal is the same; the second sampling module is used to sample the second pulse signal by using a plurality of second sub-clock signals to obtain a plurality of second sampling signals; the second sampling value The determination module is used to take the first jump edge of each second sampling signal as a sampling point to determine a plurality of second sampling values of a plurality of second sampling signals at the sampling point; The second sampling value and the local time determine the time stamp information, and send a clock synchronization protocol message to the message and second pulse signal receiving module, and the clock synchronization protocol message carries time stamp information; the message and second pulse signal receiving module is used to receive The second pulse signal sent by the message generation module and the clock synchronization protocol message are parsed to obtain the time stamp information; the first frequency division module is used to use the fractional frequency division phase-locked loop circuit to process the first reference clock signal frequency division to obtain a plurality of first sub-clock signals; wherein, the period of each first sub-clock signal is the same; the first sampling module is used to sample the second pulse signal by using a plurality of first sub-clock signals to obtain a plurality of The first sampled signal; the first sampled value determination module, which is used to take the first jump edge of each first sampled signal as the sampling point to determine a plurality of first sampled values of the multiple first sampled signals at the sampling point; clock A synchronization module, configured to perform clock synchronization according to time stamp information and multiple first sampling values. The technical effect of the corresponding solution in the seventh aspect can refer to the technical effect that can be obtained by the corresponding solution in the first aspect and the second aspect, and the repeated parts will not be described in detail.
本申请的这些方面或其它方面在以下实施例的描述中会更加简明易懂。These or other aspects of the present application will be more concise and understandable in the description of the following embodiments.
附图说明Description of drawings
图1为一种时钟同步方法的流程示意图一;FIG. 1 is a first schematic flow diagram of a clock synchronization method;
图2为一种时钟同步方法对应的时序示意图;FIG. 2 is a timing diagram corresponding to a clock synchronization method;
图3为一种小数分频锁相环电路的结构示意图;Fig. 3 is a structural schematic diagram of a fractional frequency division phase-locked loop circuit;
图4为一种时钟同步方法的流程示意图二;FIG. 4 is a second schematic flow diagram of a clock synchronization method;
图5为一种时钟同步装置的示意图;Fig. 5 is a schematic diagram of a clock synchronization device;
图6为另一种时钟同步装置的示意图。Fig. 6 is a schematic diagram of another clock synchronization device.
具体实施方式Detailed ways
下面将结合附图,对本申请实施例进行详细描述。Embodiments of the present application will be described in detail below in conjunction with the accompanying drawings.
为了使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请作进一步地详细描述。应注意的是,在本说明书中,相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步定义和解释。In order to make the purpose, technical solution and advantages of the application clearer, the application will be further described in detail below in conjunction with the accompanying drawings. It should be noted that in this specification, similar numerals and letters denote similar items in the following drawings, therefore, once an item is defined in one drawing, it does not need to be identified in subsequent drawings. for further definition and explanation.
本申请实施例的描述中,“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。字符“/”一般表示前后关联对象是一种“或”的关系。本申请中所涉及的至少一个是指一个或多个;多个,是指两个或两个以上。另外,需要理解的是,在本申请的描述中,“第一”、“第二”等词汇,仅用于区分描述的目的,而不能理解为指示或暗示相对重要性,也不能理解为指示或暗示顺序。In the description of the embodiments of the present application, "and/or" describes the association relationship of associated objects, indicating that there may be three types of relationships, for example, A and/or B, which may mean: A exists alone, A and B exist simultaneously, and There are three cases of B. The character "/" generally indicates that the contextual objects are an "or" relationship. The at least one involved in this application refers to one or more; a plurality refers to two or more than two. In addition, it should be understood that in the description of this application, words such as "first" and "second" are only used for the purpose of distinguishing descriptions, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or imply order.
在分布式网络中,多个节点中有一个节点作为主同步设备(master),其余的节点作为从同步设备(slave),主同步设备可以将基准时间同步给所有的从同步设备。主同步设备发送IEEE 1588的协议报文,从同步设备可以根据接收到的协议报文收集时戳信息,从同步设备可以根据时戳信息确定与主同步设备之间的时间偏差,可以对自身的实时时钟进行调整,从而使从同步设备的时钟模块与主同步设备的时间同步。然后,从同步设备将时戳信息与秒脉冲信息发送给处理模块,从同步设备根据时戳信息与秒脉冲信息调节自身的实时时钟,最终实现时钟同步。In a distributed network, one of the multiple nodes acts as a master synchronization device (master), and the remaining nodes act as slave synchronization devices (slave). The master synchronization device can synchronize the reference time to all slave synchronization devices. The master synchronization device sends an IEEE 1588 protocol message, and the slave synchronization device can collect time stamp information according to the received protocol message. The real-time clock is adjusted so that the clock module of the slave synchronization device is synchronized with the time of the master synchronization device. Then, the slave synchronization device sends the time stamp information and the pulse-per-second information to the processing module, and the slave synchronization device adjusts its own real-time clock according to the time stamp information and the pulse-per-second information, and finally realizes clock synchronization.
但某些对精度要求较高的分布式网络中,使用的时钟同步协议报文规定的采样误差也会较低。例如,若要满足IEEE 1588同步系统的精度要求,则需要时钟频率为1GHz的采样时钟对秒脉冲信号进行采样,才能采样精度达到1ns。但是,在现有的时钟制程工艺下,生产1GHz的时钟的成本过高,较为常见的还是时钟频率为500MHz以下的时钟,但较低成本制程的时钟的采样精度又难以满足IEEE 1588同步系统的精度要求。有鉴于此,在采用的采样时钟的时钟频率较低时,如何保证较高精度的采样要求,是本领域人员亟待解决的。However, in some distributed networks that require high precision, the sampling error specified in the clock synchronization protocol message used will be relatively low. For example, to meet the accuracy requirements of the IEEE 1588 synchronous system, a sampling clock with a clock frequency of 1 GHz is required to sample the second pulse signal in order to achieve a sampling accuracy of 1 ns. However, under the existing clock manufacturing process, the cost of producing a 1GHz clock is too high, and the clock frequency is less than 500MHz, but the sampling accuracy of the clock at a lower cost is difficult to meet the requirements of the IEEE 1588 synchronization system. Accuracy requirements. In view of this, when the clock frequency of the sampling clock used is low, how to ensure a higher precision sampling requirement is an urgent problem to be solved by those skilled in the art.
图1为本申请实施例提供的时钟同步方法的流程图,图2为本申请实施提供的时钟同步方法对应的时序图,结合图1和图2,本申请实施例中的时钟同步方法应用于从同步设备时,可以包括如下方法:Figure 1 is a flow chart of the clock synchronization method provided by the embodiment of the application, and Figure 2 is a timing diagram corresponding to the clock synchronization method provided by the implementation of the application, in combination with Figure 1 and Figure 2, the clock synchronization method in the embodiment of the application is applied to When syncing from a device, you can include methods like:
S101:接收秒脉冲信号以及时钟同步协议报文,解析时钟同步协议报文得到时戳信息。S101: Receive a second pulse signal and a clock synchronization protocol message, and analyze the clock synchronization protocol message to obtain time stamp information.
其中,时钟同步协议报文可以包括:高精度时间同步协议(precision time protocol,PTP)报文、通用精确时间协议(generalized precision time protocol,802.1AS)报文、sync同步报文、follow_up跟随报文、delay_req延迟请求报文或者delay_resp延迟响应报文等。其中,时钟同步协议报文规定的采样误差可以不大于±0.5ns,这里以PTP类型的报文进行举例,但并不构成对本申请的限定,本领域人员应当知晓,任何对精度要求较高的时钟同步协议(不大于±0.5ns),均可以应用于本申请中,这里不做过多限定。而秒脉冲信号既可以为外部的时钟设备生成的,还可以是跟随主同步设备一同发送的。Among them, the clock synchronization protocol message may include: a high-precision time synchronization protocol (precision time protocol, PTP) message, a generalized precision time protocol (generalized precision time protocol, 802.1AS) message, a sync synchronization message, and a follow_up following message , delay_req delay request message or delay_resp delay response message, etc. Among them, the sampling error stipulated in the clock synchronization protocol message may not be greater than ±0.5ns. Here, a PTP type message is used as an example, but it does not constitute a limitation to this application. Those skilled in the art should know that any All clock synchronization protocols (not greater than ±0.5ns) can be applied in this application, and are not limited here. The second pulse signal can be generated by an external clock device, and can also be sent together with the master synchronization device.
时戳信息主同步设备是基于当前时间确定的,当前时间不限于世界标准时间(universal time coordinated,UTC)时间和全球定位系统(global positioning system,GPS)时间等,此处不做具体限定。The time stamp information master synchronization device is determined based on the current time, and the current time is not limited to universal time coordinated (UTC) time and global positioning system (global positioning system, GPS) time, etc., which are not specifically limited here.
S102:利用小数分频锁相环电路对第一参考时钟信号进行分频,得到多个第一子时钟信号。每个第一子时钟信号的周期相同。S102: Using a fractional frequency-division phase-locked loop circuit to divide the frequency of the first reference clock signal to obtain a plurality of first sub-clock signals. The period of each first sub-clock signal is the same.
其中,第一参考时钟信号可以由内部时钟产生,可选的,在内部时钟中可以包括:晶振、倍频电路、鉴相器、时钟脉冲电路、输入数字模拟转换器、压控振荡器等等。例如,晶振可以生成基准频率的时钟信号,基准频率和晶振的具体结构有关;倍频电路用于对基准频率时钟信号进行倍频处理;鉴相器用于倍频处理的信号进行鉴相处理,时钟脉冲电路对鉴相信号将鉴相信号转换为时钟脉冲信号,输入数字模拟转换器用于将时钟脉冲信号转换为模拟时钟脉冲信号,由压控振荡器根据模拟时钟脉冲信号输出第一参考时钟信号。上述对基准频率的时钟信号的处理过程仅为示例,内部时钟中的器件连接关系也并不限定,其目的均为生成特定频率的时钟信号,具体的生成方式不做限制,本领域人员应当知晓。Wherein, the first reference clock signal may be generated by an internal clock, optionally, the internal clock may include: a crystal oscillator, a frequency multiplication circuit, a phase detector, a clock pulse circuit, an input digital-to-analog converter, a voltage-controlled oscillator, etc. . For example, the crystal oscillator can generate a clock signal with a reference frequency, and the reference frequency is related to the specific structure of the crystal oscillator; the frequency multiplication circuit is used to perform frequency multiplication processing on the reference frequency clock signal; The pulse circuit converts the phase detection signal into a clock pulse signal for the phase detection signal, and inputs the digital-analog converter to convert the clock pulse signal into an analog clock pulse signal, and the voltage-controlled oscillator outputs the first reference clock signal according to the analog clock pulse signal. The above-mentioned processing process of the clock signal of the reference frequency is only an example, and the device connection relationship in the internal clock is not limited. The purpose is to generate a clock signal of a specific frequency. The specific generation method is not limited, and those skilled in the art should know .
现有分频电路可以采用延迟环(time to digital converter,TDC)对第一参考时钟信号进行分频,若使用TDC会使分频后计时的时间完全由计时芯片(cell)决定,但计时芯片(cell)抖动且不确定性高,同时受工艺电压温度(precess voltage temperature,PVT)条件影响大,因此导致使用TDC的分频可靠性较低,最多会产生1.68%的延时抖动,并且由于其延迟环的结构会导致延时抖动累积,从而造成更大的误差。The existing frequency division circuit can use a delay loop (time to digital converter, TDC) to divide the frequency of the first reference clock signal. If TDC is used, the timing time after frequency division will be completely determined by the timing chip (cell), but the timing chip (cell) jitter and high uncertainty, and is greatly affected by process voltage temperature (precess voltage temperature, PVT) conditions, so the reliability of frequency division using TDC is low, and a delay jitter of up to 1.68% will be generated, and due to The structure of its delay loop will lead to the accumulation of delay jitter, resulting in greater errors.
而本申请采用模拟器件构成小数分频锁相环电路,不受工艺角偏差和温度的影响,小数分频锁相环电路为开环结构,能够更好的适用于高速时钟场景,并且无需使用复杂的闭环结构来实现高速时钟场景的要求,具有延时低精度高的优点。However, this application uses analog devices to form a fractional frequency division phase-locked loop circuit, which is not affected by process angle deviation and temperature. A complex closed-loop structure is used to meet the requirements of high-speed clock scenarios, which has the advantages of low delay and high precision.
继续参阅图2所示,作为一种可能的实施方式,利用小数分频锁相环电路对第一参考时钟信号进行四分频,得到四个第一子时钟信号;其中,分频后相邻两个第一子时钟信号的相位差为90°。图2中采用小数分频锁相环电路对第一参考时钟信号进行四分频,从而得到四个第一子时钟信号:第一子时钟信号clk1、第一子时钟信号clk2、第一子时钟信号clk3、第一子时钟信号clk4;其中,每个相邻的时钟信号的相位差均为90°。应说明的是,本申请实施例中相邻的时钟信号的相位差均为90°指的是,如,第一子时钟信号clk1和第一子时钟信号clk2的相位差可以存在一定的偏差范围,或者,换言之,第一子时钟信号clk1与第一子时钟信号clk2的相位差近似为90°,且各个第一子时钟需要保持同步。作为一种可能的实施方式,第一参考时钟信号的时钟频率不高于500MHz。示例性的,以提升采样精度为目的,生成的第一子时钟信号的数量可以与第一参考时钟信号的时钟频率有关,例如,在第一参考时钟信号的时钟频率为500MHz时,小数分频锁相环电路可以对第一参考 时钟信号进行四分频,得到四个第一子时钟信号,而在第一参考时钟信号的时钟频率为250MHz时,则小数分频锁相环电路可以对第一参考时钟信号进行八分频,得到八个第一子时钟信号。Continuing to refer to Fig. 2, as a possible implementation manner, the first reference clock signal is divided by four using a fractional frequency-division phase-locked loop circuit to obtain four first sub-clock signals; wherein, after frequency division, adjacent The phase difference between the two first sub-clock signals is 90°. In Fig. 2, a fractional frequency-division phase-locked loop circuit is used to divide the frequency of the first reference clock signal by four, thereby obtaining four first sub-clock signals: the first sub-clock signal clk1, the first sub-clock signal clk2, the first sub-clock The signal clk3 and the first sub-clock signal clk4; wherein, the phase difference between each adjacent clock signal is 90°. It should be noted that the phase difference between adjacent clock signals in the embodiment of the present application is 90° means, for example, the phase difference between the first sub-clock signal clk1 and the first sub-clock signal clk2 may have a certain deviation range Or, in other words, the phase difference between the first sub-clock signal clk1 and the first sub-clock signal clk2 is approximately 90°, and each first sub-clock needs to be kept in sync. As a possible implementation manner, the clock frequency of the first reference clock signal is not higher than 500 MHz. Exemplarily, for the purpose of improving the sampling accuracy, the number of generated first sub-clock signals may be related to the clock frequency of the first reference clock signal, for example, when the clock frequency of the first reference clock signal is 500MHz, fractional frequency division The phase-locked loop circuit can divide the frequency of the first reference clock signal by four to obtain four first sub-clock signals, and when the clock frequency of the first reference clock signal is 250MHz, the fractional frequency-division phase-locked loop circuit can divide the first sub-clock signal A reference clock signal is divided by eight to obtain eight first sub-clock signals.
S103:利用多个第一子时钟信号对秒脉冲信号进行采样,得到多个第一采样信号。S103: Using multiple first sub-clock signals to sample the second pulse signal to obtain multiple first sampling signals.
应该说明的是,在本申请实施例中,第一子时钟信号可以采用第二跳边沿对秒脉冲信号进行采样,例如,第二跳变沿可以为上升沿,即从低电平(0)跳变为高电平(1)的跳变沿,当然,第二跳变沿也可以为下降沿,即从高电平(1)跳变为低电平(0)的跳变沿,为了便于说明,在本申请中均以第二跳变沿为上升沿为例进行说明。示例性的,以上升沿采样为例,利用第一子时钟信号clk1对秒脉冲信号采样后,可以得到第一采样信号Q1。It should be noted that, in the embodiment of the present application, the first sub-clock signal can use the second jump edge to sample the second pulse signal. For example, the second jump edge can be a rising edge, that is, from a low level (0) Jumping to the transition edge of high level (1), of course, the second transition edge can also be a falling edge, that is, the transition edge from high level (1) to low level (0), in order For ease of description, in this application, the second transition edge is taken as an example for illustration. Exemplarily, taking rising edge sampling as an example, after the second pulse signal is sampled by using the first sub-clock signal clk1, the first sampling signal Q1 can be obtained.
S104:以每个第一采样信号的第一跳边沿为采样点,确定多个第一采样信号在采样点时的多个第一采样值。S104: Using the first jump edge of each first sampling signal as a sampling point, determine a plurality of first sampling values of the plurality of first sampling signals at the sampling point.
以第一采样信号Q1的第一跳变沿为采样点A,确定第一采样信号Q1在采样点A时的第一采样值。应该说明的是,在本申请实施例中,采样点均指第一采样信号的第一跳变沿,其中,第一跳变沿为从第一数值跳变为第二数值的跳变沿,例如,第一跳变沿可以为上升沿,即从低电平(0)跳变为高电平(1)的跳变沿,当然,第一跳变沿也可以为下降沿,即从高电平(1)跳变为低电平(0)的跳变沿,为了便于说明,在本申请中均以第一跳变沿为上升沿为例进行说明。Taking the first transition edge of the first sampling signal Q1 as the sampling point A, the first sampling value of the first sampling signal Q1 at the sampling point A is determined. It should be noted that, in the embodiments of the present application, the sampling point refers to the first transition edge of the first sampling signal, wherein the first transition edge is the transition edge from the first value to the second value, For example, the first transition edge can be a rising edge, that is, a transition edge that transitions from a low level (0) to a high level (1). Of course, the first transition edge can also be a falling edge, that is, a transition from a high level to For the convenience of description, the transition edge from the level (1) to the low level (0) is described in this application by taking the first transition edge as a rising edge as an example.
S105:根据时戳信息以及多个第一采样值进行时钟同步。S105: Perform clock synchronization according to the time stamp information and multiple first sampling values.
在得到多个第一采样值后,根据多个第一采样值中最先采集到更新的时间的采样值以及时戳信息确定当前时间,从而实现时钟同步。After the multiple first sampling values are obtained, the current time is determined according to the sampling value at which the updated time is first collected among the multiple first sampling values and the time stamp information, so as to realize clock synchronization.
在分布式网络中,每一个设备中可以包括时钟同步模块和处理模块,上述步骤S101至步骤S105可以在处理模块中执行,也就是说,时钟同步模块周期性地从主同步设备接收时戳信息和秒脉冲信息,并周期性地向处理模块发送时戳信息和秒脉冲信息,处理模块在接收时戳信息和秒脉冲信息后,执行上述步骤S101至步骤S105,从而使主同步设备和从同步设备实现时钟同步。In a distributed network, each device may include a clock synchronization module and a processing module, and the above steps S101 to S105 may be performed in the processing module, that is, the clock synchronization module periodically receives time stamp information from the master synchronization device and second pulse information, and periodically send time stamp information and second pulse information to the processing module. After receiving the time stamp information and second pulse information, the processing module executes the above steps S101 to step S105, so that the master synchronization device and the slave synchronization Devices implement clock synchronization.
作为一种可能的实施方式,根据时戳信息以及多个第一采样值进行时钟同步,可以为:在多个第一采样值中首次出现设定大小的采样数值时,根据秒脉冲信号的脉冲周期以及时戳信息,确定当前时间。示例性的,继续参阅图2所示,本申请实施例可以通过将第一参考时钟进行四分频,得到四个第一子时钟信号clk1~clk4;通过四个第一子时钟信号对秒脉冲信号的采样,能得到第一采样信号Q1~Q4,基于第一采样信号Q1~Q4的第一跳变沿得到多个第一采样值。例如,秒脉冲信号的脉冲周期为1s,时戳信息所指示的时间为10:00:00,在多个第一采样值中出现采样值为1的采样值时,从同步设备确定当前时间变化为10:00:01。利用上述方式,能够更精准的确定秒脉冲信号的跳边沿位置,从而更加准确的确定当前时间。As a possible implementation, clock synchronization based on time stamp information and multiple first sampling values may be: when a sampling value of a set size appears for the first time in multiple first sampling values, according to the pulse of the second pulse signal Period and timestamp information to determine the current time. Exemplarily, continuing to refer to FIG. 2, the embodiment of the present application can obtain four first sub-clock signals clk1-clk4 by dividing the frequency of the first reference clock by four; The sampling of the signal can obtain the first sampling signals Q1-Q4, and obtain a plurality of first sampling values based on the first transition edges of the first sampling signals Q1-Q4. For example, the pulse period of the second pulse signal is 1s, and the time indicated by the time stamp information is 10:00:00. When a sampling value with a sampling value of 1 appears in multiple first sampling values, the current time change is determined from the synchronization device is 10:00:01. By using the above method, the edge position of the second pulse signal can be determined more accurately, so that the current time can be determined more accurately.
此外,由于时钟同步协议报文从主同步设备到从同步设备需要耗费一定的发送时间,因此,本申请实施例在计算实时时间时,可以将发送时间作为补偿时间,预先增加到时间戳所携带的时间中,进而在补偿发送时间后进行时钟同步;并且,由于发送时钟同步协议报文的方式不同,或者主同步设备与从同步设备之间的距离不同,相应的发送时间也不同。In addition, since the clock synchronization protocol message takes a certain amount of time to be sent from the master synchronization device to the slave synchronization device, when calculating the real-time time in this embodiment of the application, the sending time can be used as the compensation time, which is pre-added to the value carried by the time stamp. In the time, and then perform clock synchronization after compensating the sending time; and, because of the different ways of sending the clock synchronization protocol message, or the distance between the master synchronization device and the slave synchronization device, the corresponding sending time is also different.
示例性的,本申请实施例提供的时钟同步方法采用小数分频锁相环电路对第一参考时钟信号进行分频,得到第一子时钟信号clk1~clk4;其中,每个相邻的时钟信号的相位差均 为90°,利用上述第一子时钟信号对秒脉冲信号进行采样,得到第一采样信号Q1~Q4。根据不同的第一采样信号Q1~Q4对应的第一采样值,因此,相比于现有技术仅采用一个第一参考时钟信号对秒脉冲信号进行采样,本申请通过N个第一子时钟信号,可以将采样精度缩小到1/N个第一参考时钟信号的时钟周期,将采样精度提高至原来的N倍。Exemplarily, the clock synchronization method provided by the embodiment of the present application uses a fractional frequency-division phase-locked loop circuit to divide the frequency of the first reference clock signal to obtain the first sub-clock signals clk1-clk4; wherein, each adjacent clock signal The phase difference of each is 90°, and the second pulse signal is sampled by using the above-mentioned first sub-clock signal to obtain the first sampling signals Q1-Q4. According to the first sampling values corresponding to different first sampling signals Q1-Q4, therefore, compared with the prior art, only one first reference clock signal is used to sample the second pulse signal, the present application uses N first sub-clock signals , the sampling precision can be reduced to 1/N clock period of the first reference clock signal, and the sampling precision can be increased to N times of the original.
在实际场景中,由第一参考时钟信号分频得到的多个第一子时钟信号的相位可能会出现漂移或不准确的问题,作为一种可能的实施方式,本申请实施例提供的上述时钟同步方法,还可以包括:采用多个第一子时钟信号对秒脉冲信号进行N次采样,确定N组采样结果;其中,N为正整数;每一组采样结果包括多个第一采样信号。In actual scenarios, the phases of multiple first sub-clock signals obtained by frequency division of the first reference clock signal may drift or be inaccurate. As a possible implementation, the above-mentioned clock The synchronization method may further include: using a plurality of first sub-clock signals to sample the second pulse signal N times to determine N groups of sampling results; wherein, N is a positive integer; each group of sampling results includes a plurality of first sampling signals.
也就是说,本申请实施例通过N次执行上述步骤S103~S105,即利用多个第一子时钟信号对秒脉冲信号进行N次采样后,如果多个第一子时钟信号相位不漂移,则N组采样结果中,每一组采样结果基本一致,如果多个第一子时钟信号相位发生漂移,则可以通过采样结果总量N以及多组采样结果确定采样平均值,避免因分频后得到的多个第一子时钟信号漂移或不准确,影响秒脉冲信息的采样精度的问题。That is to say, in the embodiment of the present application, the above steps S103-S105 are executed N times, that is, after the second pulse signal is sampled N times by using a plurality of first sub-clock signals, if the phases of the plurality of first sub-clock signals do not drift, then Among the N groups of sampling results, each group of sampling results is basically the same. If the phases of multiple first sub-clock signals drift, the sampling average value can be determined by the total amount of sampling results N and multiple groups of sampling results, so as to avoid obtaining The drift or inaccuracy of multiple first sub-clock signals affects the sampling accuracy of the second pulse information.
作为一种可能的实施方式,小数分频锁相环电路中包括:反相器,第一分频器以及第二分频器;反相器,用于:基于第一参考时钟信号,生成与第一参考时钟信号相位相反的信号;第一分频器,用于:对第一参考时钟信号进行二分频,得到两个第一子时钟信号,其中,两个第一子时钟信号的起始相位分别为0°和180°;第二分频器,用于:对与第一参考时钟信号相位相反的信号进行二分频,得到两个第一子时钟信号,其中,两个第一子时钟信号的起始相位分别为90°和270°。As a possible implementation manner, the fractional frequency division phase-locked loop circuit includes: an inverter, a first frequency divider and a second frequency divider; the inverter is used to: generate and A signal with the opposite phase of the first reference clock signal; the first frequency divider is configured to divide the frequency of the first reference clock signal by two to obtain two first sub-clock signals, wherein the starting point of the two first sub-clock signals is The initial phases are respectively 0° and 180°; the second frequency divider is used to divide the frequency of the signal opposite to the phase of the first reference clock signal by two to obtain two first sub-clock signals, wherein the two first The starting phases of the sub clock signals are 90° and 270° respectively.
图3为一种小数分频锁相环电路的结构示意图;参阅图3所示,先将第一参考时钟信号输入小数分频锁相环中的反相器内,从而得到它的0°和180°相位时钟CLK0和CLK1,CLK0经过第一分频器,从而得到频率为1/2,相位为0°和180°的CLK00以及CLK01;CLK1经过第二分频器,从而得到频率为1/2,相位为90°和270°的CLK10以及CLK11。Fig. 3 is a structural schematic diagram of a fractional frequency division PLL circuit; referring to Fig. 3, the first reference clock signal is first input into the inverter in the fractional frequency division PLL to obtain its 0° and 180° phase clocks CLK0 and CLK1, CLK0 passes through the first frequency divider to obtain CLK00 and CLK01 with a frequency of 1/2 and a phase of 0° and 180°; CLK1 passes through the second frequency divider to obtain a frequency of 1/2 2. CLK10 and CLK11 with phases of 90° and 270°.
此外,本申请的小数分频锁相环电路的结构并不限于此,小数分频锁相环电路中的反相器还可以为相位分离电路,所述相位分离电路同样可以根据第一参考时钟信号生成0°和180°相位时钟CLK0和CLK1,相位分离电路相比于反相器的延时误差更小,其值一般小于3ps,更能适用于本申请的高精度时钟同步协议场景。In addition, the structure of the fractional frequency division phase-locked loop circuit of the present application is not limited thereto. The inverter in the fractional frequency division phase-locked loop circuit can also be a phase separation circuit, and the phase separation circuit can also be based on the first reference clock The signal generates 0° and 180° phase clocks CLK0 and CLK1. Compared with the inverter, the delay error of the phase separation circuit is smaller, and its value is generally less than 3ps, which is more suitable for the high-precision clock synchronization protocol scenario of this application.
作为一种可能的实施方式,所述得到多个第一子时钟信号之后,所述方法还包括:As a possible implementation manner, after the multiple first sub-clock signals are obtained, the method further includes:
根据所述多个第一子时钟信号,生成第一多相位时钟信号,利用所述第一多相位时钟信号对所述秒脉冲信号进行采样。A first multi-phase clock signal is generated according to the plurality of first sub-clock signals, and the second pulse signal is sampled by using the first multi-phase clock signal.
其中,所述小数分频锁相环电路可能还包括:与门电路,用于将多个第一子时钟信号合成为第一多相位时钟。示例性的,若将上述实施例的CLK00、CLK01、CLK10以及CLK11输入与门电路后,所述与门电路得到频率为第一参考时钟信号一半,占空比为25%,起始相位为0°,90°,180°和270°的四相位时钟。Wherein, the fractional frequency-division phase-locked loop circuit may further include: an AND gate circuit for synthesizing a plurality of first sub-clock signals into a first multi-phase clock. Exemplarily, if CLK00, CLK01, CLK10, and CLK11 of the above embodiment are input to the AND gate circuit, the AND gate circuit can obtain a frequency half of the first reference clock signal, a duty cycle of 25%, and a starting phase of 0 °, 90°, 180° and 270° four-phase clock.
图4为本申请实施例提供的时钟同步方法的流程图,本申请实施例中的时钟同步方法应用于主同步设备,可以包括:Figure 4 is a flow chart of the clock synchronization method provided by the embodiment of the present application. The clock synchronization method in the embodiment of the present application is applied to the master synchronization device, which may include:
S401:利用小数分频锁相环电路对第二参考时钟信号进行分频,得到多个第二子时钟信号;其中,每个第二子时钟信号的周期相同;S401: Using a fractional frequency-division phase-locked loop circuit to divide the frequency of the second reference clock signal to obtain a plurality of second sub-clock signals; wherein, the period of each second sub-clock signal is the same;
S402:利用所述多个第二子时钟信号对所述秒脉冲信号进行采样,得到多个第二采样信号;S402: Use the multiple second sub-clock signals to sample the second pulse signal to obtain multiple second sampling signals;
S403:以每个第二采样信号的第一跳边沿为采样点,确定所述多个第二采样信号在所述采样点时的多个第二采样值;S403: Using the first jump edge of each second sampling signal as a sampling point, determine a plurality of second sampling values of the plurality of second sampling signals at the sampling point;
S404:根据所述多个第二采样值以及本地时间确定时戳信息,发送时钟同步协议报文,所述时钟同步协议报文携带所述时戳信息。本申请实施例可能的实施方式以及有益效果参见上述实施例步骤S101~S105,重复之处不再赘述,本领域人员应当知晓。S404: Determine time stamp information according to the plurality of second sampling values and local time, and send a clock synchronization protocol message, where the clock synchronization protocol message carries the time stamp information. For the possible implementation manners and beneficial effects of the embodiment of the present application, refer to steps S101 to S105 in the above embodiment, and the repetition will not be repeated, and those skilled in the art should know it.
参阅图5所示,本申请提供一种时钟同步装置500,该装置包括:报文及秒脉冲信号接收模块501,用于:接收秒脉冲信号以及时钟同步协议报文,解析所述时钟同步协议报文得到时戳信息;分频模块502,用于:利用小数分频锁相环电路对第一参考时钟信号进行分频,得到多个第一子时钟信号;其中,每个第一子时钟信号的周期相同;采样模块503,用于:利用所述多个第一子时钟信号对所述秒脉冲信号进行采样,得到多个第一采样信号;采样值确定模块504,用于:以每个第一采样信号的第一跳边沿为采样点,确定所述多个第一采样信号在所述采样点时的多个第一采样值;时钟同步模块505,用于:根据所述时戳信息以及所述多个第一采样值进行时钟同步。Referring to Fig. 5, the present application provides a clock synchronization device 500, which device includes: message and second pulse signal receiving module 501, used for: receiving second pulse signal and clock synchronization protocol message, and analyzing the clock synchronization protocol The time stamp information is obtained from the message; the frequency division module 502 is configured to: use a fractional frequency division phase-locked loop circuit to divide the frequency of the first reference clock signal to obtain a plurality of first sub-clock signals; wherein, each first sub-clock The period of the signal is the same; the sampling module 503 is configured to: use the plurality of first sub-clock signals to sample the second pulse signal to obtain a plurality of first sampling signals; the sampling value determination module 504 is configured to: The first jump edge of the first sampling signal is a sampling point, and a plurality of first sampling values of the plurality of first sampling signals at the sampling point are determined; the clock synchronization module 505 is configured to: according to the time stamp Clock synchronization is performed on the information and the plurality of first sampled values.
参阅图6所示,本申请还提供一种时钟同步装置600,该装置包括:分频模块601,用于:利用小数分频锁相环电路对第二参考时钟信号进行分频,得到多个第二子时钟信号;其中,每个第二子时钟信号的周期相同;采样模块602,用于:利用所述多个第二子时钟信号对所述秒脉冲信号进行采样,得到多个第二采样信号;采样值确定模块603,用于:以每个第二采样信号的第一跳边沿为采样点,确定所述多个第二采样信号在所述采样点时的多个第二采样值;报文生成模块604,用于:根据所述多个第二采样值以及本地时间确定时戳信息,发送时钟同步协议报文,所述时钟同步协议报文携带所述时戳信息。Referring to FIG. 6, the present application also provides a clock synchronization device 600, which includes: a frequency division module 601, configured to: use a fractional frequency division phase-locked loop circuit to divide the second reference clock signal to obtain multiple The second sub-clock signal; wherein, the period of each second sub-clock signal is the same; the sampling module 602 is configured to: use the plurality of second sub-clock signals to sample the second pulse signal to obtain a plurality of second Sampling signal; sampling value determination module 603, configured to: take the first jump edge of each second sampling signal as a sampling point, and determine multiple second sampling values of the multiple second sampling signals at the sampling point ; A message generating module 604, configured to: determine time stamp information according to the plurality of second sampling values and local time, and send a clock synchronization protocol message, where the clock synchronization protocol message carries the time stamp information.
需要说明的是,本申请实施例中对模块的划分是示意性的,仅仅为一种轮机功能划分,实际实现时可以有另外的划分方式,在本申请的示例中的各功能模块可以集成在一个处理模块中,也可以是各个模块单独的物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的模块,既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。It should be noted that the division of modules in the embodiment of the present application is schematic, and is only a division of turbine functions. In actual implementation, there may be other division methods. In the example of this application, each functional module can be integrated in In one processing module, each module may exist independently, or two or more units may be integrated into one unit. The above-mentioned integrated modules can be implemented in the form of hardware or in the form of software function modules.
本申请还提供一种时钟同步系统,所述时钟同步系统包括:第二分频模块,用于利用小数分频锁相环电路对第二参考时钟信号进行分频,得到多个第二子时钟信号;其中,每个第二子时钟信号的周期相同;第二采样模块,用于利用所述多个第二子时钟信号对所述秒脉冲信号进行采样,得到多个第二采样信号;第二采样值确定模块,用于以每个第二采样信号的第一跳边沿为采样点,确定所述多个第二采样信号在所述采样点时的多个第二采样值;报文生成模块,用于根据所述多个第二采样值以及本地时间确定时戳信息,向所述报文及秒脉冲信号接收模块发送时钟同步协议报文,所述时钟同步协议报文携带所述时戳信息;报文及秒脉冲信号接收模块,用于接收所述报文生成模块发送的秒脉冲信号以及时钟同步协议报文,解析所述时钟同步协议报文得到时戳信息;第二分频模块,用于利用小数分频锁相环电路对第一参考时钟信号进行分频,得到多个第一子时钟信号;其中,每个第一子时钟信号的周期相同;第二采样模块,用于利用所述多个第一子时钟信号对所述秒脉冲信号进行采样,得到多个第一采样信号;第二采样值确定模块,用于以每个第一采样信号的第一跳边沿为采样点,确定所述多个第一采样信号在所述采样点时的多个第一采样值;时钟同步模块,用于根据所述时戳信息以及所述多个第一采样值进行时钟同步。The present application also provides a clock synchronization system. The clock synchronization system includes: a second frequency division module, which is used to divide the frequency of the second reference clock signal by using a fractional frequency division phase-locked loop circuit to obtain a plurality of second sub-clocks signal; wherein, the period of each second sub-clock signal is the same; the second sampling module is used to use the plurality of second sub-clock signals to sample the second pulse signal to obtain a plurality of second sampling signals; Two sampling value determination modules, used to take the first jump edge of each second sampling signal as a sampling point to determine a plurality of second sampling values of the plurality of second sampling signals at the sampling point; message generation A module, configured to determine time stamp information according to the plurality of second sampling values and local time, and send a clock synchronization protocol message to the message and second pulse signal receiving module, the clock synchronization protocol message carrying the time Stamp information; message and second pulse signal receiving module, used to receive the second pulse signal and clock synchronization protocol message sent by the message generation module, and analyze the clock synchronization protocol message to obtain time stamp information; the second frequency division The module is used to divide the frequency of the first reference clock signal by a fractional frequency-division phase-locked loop circuit to obtain a plurality of first sub-clock signals; wherein, the period of each first sub-clock signal is the same; the second sampling module uses The second pulse signal is sampled by using the plurality of first sub-clock signals to obtain a plurality of first sampling signals; the second sampling value determination module is configured to use the first jump edge of each first sampling signal as A sampling point, determining a plurality of first sampling values of the plurality of first sampling signals at the sampling point; a clock synchronization module, configured to perform clock synchronization according to the timestamp information and the plurality of first sampling values .
本申请还提供一种芯片,处理器和存储器,所述处理器与所述存储器相连,所述存储器中保存有指令程序,所述处理器在所述指令程序的控制下,用于执行如下步骤:获得秒 脉冲信号以及时钟同步协议报文,解析所述时钟同步协议报文得到时戳信息;利用小数分频锁相环电路对第一参考时钟信号进行分频,得到多个第一子时钟信号;其中,每个第一子时钟信号的周期相同;利用所述多个第一子时钟信号对所述秒脉冲信号进行采样,得到多个第一采样信号;以每个第一采样信号的第一跳边沿为采样点,确定所述多个第一采样信号在所述采样点时的多个第一采样值;根据所述时戳信息以及所述多个第一采样值进行时钟同步。The present application also provides a chip, a processor and a memory, the processor is connected to the memory, an instruction program is stored in the memory, and the processor is used to perform the following steps under the control of the instruction program : Obtain a second pulse signal and a clock synchronization protocol message, analyze the clock synchronization protocol message to obtain time stamp information; use a fractional frequency division phase-locked loop circuit to divide the frequency of the first reference clock signal to obtain multiple first sub-clocks signal; wherein, the period of each first sub-clock signal is the same; the second pulse signal is sampled by using the plurality of first sub-clock signals to obtain a plurality of first sampling signals; The first jump edge is a sampling point, and determining a plurality of first sampling values of the plurality of first sampling signals at the sampling point; performing clock synchronization according to the time stamp information and the plurality of first sampling values.
本申请还提供一种芯片,包括:处理器和存储器,所述处理器与所述存储器相连,所述存储器中保存有指令程序,所述处理器在所述指令程序的控制下,用于执行如下步骤:利用小数分频锁相环电路对第二参考时钟信号进行分频,得到多个第二子时钟信号;其中,每个第二子时钟信号的周期相同;利用所述多个第二子时钟信号对所述秒脉冲信号进行采样,得到多个第二采样信号;以每个第二采样信号的第一跳边沿为采样点,确定所述多个第二采样信号在所述采样点时的多个第二采样值;根据所述多个第二采样值以及本地时间确定时戳信息,生成时钟同步协议报文,所述时钟同步协议报文携带所述时戳信息。The present application also provides a chip, including: a processor and a memory, the processor is connected to the memory, an instruction program is stored in the memory, and the processor is used to execute The following steps: use the fractional frequency division phase-locked loop circuit to divide the second reference clock signal to obtain a plurality of second sub-clock signals; wherein, the period of each second sub-clock signal is the same; using the plurality of second sub-clock signals The sub-clock signal samples the second pulse signal to obtain a plurality of second sampling signals; taking the first jump edge of each second sampling signal as a sampling point, and determining that the plurality of second sampling signals are at the sampling point multiple second sampled values at the same time; determine time stamp information according to the multiple second sampled values and local time, and generate a clock synchronization protocol message, where the clock synchronization protocol message carries the time stamp information.
基于以上实施例,本申请实施例还提供一种计算机程序,在所述计算机程序在计算机上运行时,使得所述计算机执行以上实施例提供的时钟同步方法。Based on the above embodiments, an embodiment of the present application further provides a computer program, which causes the computer to execute the clock synchronization method provided in the above embodiments when the computer program is run on a computer.
基于以上实施例,本申请实施例还提供了一种计算机可读存储介质,该计算机刻度存储介质中存储有计算机程序,所述计算机程序被计算机执行时,使得计算机执行以上实施例提供的时钟同步方法。Based on the above embodiments, the embodiments of the present application also provide a computer-readable storage medium, in which a computer program is stored in the computer-readable storage medium. When the computer program is executed by a computer, the computer executes the clock synchronization provided by the above embodiments. method.
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the embodiments of the present application may be provided as methods, systems, or computer program products. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
本申请是参照根据本申请的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to the present application. It should be understood that each procedure and/or block in the flowchart and/or block diagram, and a combination of procedures and/or blocks in the flowchart and/or block diagram can be realized by computer program instructions. These computer program instructions may be provided to a general purpose computer, special purpose computer, embedded processor, or processor of other programmable data processing equipment to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing equipment produce a An apparatus for realizing the functions specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to operate in a specific manner, such that the instructions stored in the computer-readable memory produce an article of manufacture comprising instruction means, the instructions The device realizes the function specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device, causing a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process, thereby The instructions provide steps for implementing the functions specified in the flow chart or blocks of the flowchart and/or the block or blocks of the block diagrams.
显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的保护范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。Apparently, those skilled in the art can make various changes and modifications to this application without departing from the protection scope of this application. In this way, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application is also intended to include these modifications and variations.

Claims (39)

  1. 一种时钟同步方法,应用于从同步设备,其特征在于,所述方法包括:A clock synchronization method applied to a slave synchronization device, wherein the method comprises:
    接收秒脉冲信号以及时钟同步协议报文,解析所述时钟同步协议报文得到时戳信息;receiving the second pulse signal and the clock synchronization protocol message, and analyzing the clock synchronization protocol message to obtain timestamp information;
    利用小数分频锁相环电路对第一参考时钟信号进行分频,得到多个第一子时钟信号;其中,每个第一子时钟信号的周期相同;Using a fractional frequency-division phase-locked loop circuit to divide the frequency of the first reference clock signal to obtain a plurality of first sub-clock signals; wherein, the period of each first sub-clock signal is the same;
    利用所述多个第一子时钟信号对所述秒脉冲信号进行采样,得到多个第一采样信号;sampling the second pulse signal by using the plurality of first sub-clock signals to obtain a plurality of first sampling signals;
    以每个第一采样信号的第一跳边沿为采样点,确定所述多个第一采样信号在所述采样点时的多个第一采样值;Using the first jump edge of each first sampling signal as a sampling point, determine a plurality of first sampling values of the plurality of first sampling signals at the sampling point;
    根据所述时戳信息以及所述多个第一采样值进行时钟同步。Clock synchronization is performed according to the time stamp information and the plurality of first sampling values.
  2. 根据权利要求1所述的方法,其特征在于,所述利用所述多个第一子时钟信号对秒脉冲信号进行采样,包括:The method according to claim 1, wherein the sampling of the second pulse signal by using the plurality of first sub-clock signals comprises:
    采用所述多个第一子时钟信号对所述秒脉冲信号进行N次采样,确定N组采样结果;其中,所述N为正整数;每一组所述采样结果包括所述多个第一采样信号。The second pulse signal is sampled N times by using the plurality of first sub-clock signals to determine N groups of sampling results; wherein, the N is a positive integer; each group of the sampling results includes the plurality of first sub-clock signals sample signal.
  3. 根据权利要求1或2所述的方法,其特征在于,所述利用小数分频锁相环电路对第一参考时钟信号进行分频,得到多个第一子时钟信号,包括:The method according to claim 1 or 2, wherein the first reference clock signal is frequency-divided by a fractional frequency-division PLL circuit to obtain a plurality of first sub-clock signals, including:
    利用小数分频锁相环电路对第一参考时钟信号进行四分频,得到四个第一子时钟信号;其中,分频后相邻两个第一子时钟信号的相位差为90°。The first reference clock signal is divided by four by using a fractional frequency-division phase-locked loop circuit to obtain four first sub-clock signals; wherein, after the frequency division, the phase difference between two adjacent first sub-clock signals is 90°.
  4. 根据权利要求3所述的方法,其特征在于,所述小数分频锁相环电路中包括:反相器,第一分频器以及第二分频器;The method according to claim 3, wherein the fractional frequency division PLL circuit comprises: an inverter, a first frequency divider and a second frequency divider;
    所述反相器,用于:基于第一参考时钟信号,生成与所述第一参考时钟信号相位相反的信号;The inverter is configured to: generate a signal with an opposite phase to the first reference clock signal based on the first reference clock signal;
    所述第一分频器,用于:对第一参考时钟信号进行二分频,得到两个第一子时钟信号,其中,两个第一子时钟信号的起始相位分别为0°和180°;The first frequency divider is configured to divide the frequency of the first reference clock signal by two to obtain two first sub-clock signals, wherein the initial phases of the two first sub-clock signals are 0° and 180° respectively. °;
    所述第二分频器,用于:对与第一参考时钟信号相位相反的信号进行二分频,得到两个第一子时钟信号,其中,两个第一子时钟信号的起始相位分别为90°和270°。The second frequency divider is configured to divide the frequency of the signal opposite to the phase of the first reference clock signal by two to obtain two first sub-clock signals, wherein the initial phases of the two first sub-clock signals are respectively for 90° and 270°.
  5. 根据权利要求1-4任一所述的方法,其特征在于,所述第一跳边沿为从低电平跳变为高电平的上升沿和/或从高电平跳变为低电平的下降沿。The method according to any one of claims 1-4, wherein the first jump edge is a rising edge from a low level to a high level and/or a transition from a high level to a low level the falling edge of .
  6. 根据权利要求1-5任一所述的方法,其特征在于,所述利用所述多个第一子时钟信号对所述秒脉冲信号进行采样,包括:The method according to any one of claims 1-5, wherein the sampling of the second pulse signal by using the plurality of first sub-clock signals comprises:
    利用所述多个第一子时钟信号的第二跳边沿,对所述秒脉冲信号进行采样,所述第二跳边沿为从低电平跳变为高电平的上升沿,和/或从高电平跳变为低电平的下降沿。The second pulse signal is sampled by using the second jump edge of the plurality of first sub-clock signals, the second jump edge is a rising edge from a low level to a high level, and/or from Falling edge from high level to low level.
  7. 根据权利要求1-6任一所述的方法,其特征在于,所述得到多个第一子时钟信号之后,所述方法还包括:The method according to any one of claims 1-6, wherein after said obtaining a plurality of first sub-clock signals, said method further comprises:
    根据所述多个第一子时钟信号,生成第一多相位时钟信号,利用所述第一多相位时钟信号对所述秒脉冲信号进行采样。A first multi-phase clock signal is generated according to the plurality of first sub-clock signals, and the second pulse signal is sampled by using the first multi-phase clock signal.
  8. 根据权利要求1-7任一所述的方法,其特征在于,所述根据所述时戳信息以及所述多个第一采样值进行时钟同步,包括:The method according to any one of claims 1-7, wherein the performing clock synchronization according to the time stamp information and the plurality of first sampling values comprises:
    在所述多个第一采样值中首次出现设定大小的采样数值时,根据所述秒脉冲信号的脉冲周期以及所述时戳信息,确定当前时间。When a sampling value of a set size appears for the first time among the plurality of first sampling values, the current time is determined according to the pulse period of the second pulse signal and the time stamp information.
  9. 根据权利要求1-8任一所述的方法,其特征在于,所述时钟同步协议报文规定的采样误差不大于±0.5ns。The method according to any one of claims 1-8, characterized in that the sampling error stipulated in the clock synchronization protocol message is not greater than ±0.5 ns.
  10. 根据权利要求1-9任一所述的方法,其特征在于,所述第一参考时钟信号的时钟频率不高于500MHz。The method according to any one of claims 1-9, wherein the clock frequency of the first reference clock signal is not higher than 500MHz.
  11. 一种时钟同步方法,应用于主同步设备,其特征在于,所述方法包括:A clock synchronization method applied to a master synchronization device, characterized in that the method comprises:
    利用小数分频锁相环电路对第二参考时钟信号进行分频,得到多个第二子时钟信号;其中,每个第二子时钟信号的周期相同;Using a fractional frequency-division phase-locked loop circuit to divide the frequency of the second reference clock signal to obtain a plurality of second sub-clock signals; wherein, the period of each second sub-clock signal is the same;
    利用所述多个第二子时钟信号对所述秒脉冲信号进行采样,得到多个第二采样信号;sampling the second pulse signal by using the plurality of second sub-clock signals to obtain a plurality of second sampling signals;
    以每个第二采样信号的第一跳边沿为采样点,确定所述多个第二采样信号在所述采样点时的多个第二采样值;Using the first jump edge of each second sampling signal as a sampling point, determine a plurality of second sampling values of the plurality of second sampling signals at the sampling point;
    根据所述多个第二采样值以及本地时间确定时戳信息,发送时钟同步协议报文,所述时钟同步协议报文携带所述时戳信息。Determine time stamp information according to the plurality of second sampling values and local time, and send a clock synchronization protocol message, where the clock synchronization protocol message carries the time stamp information.
  12. 根据权利要求11所述的方法,其特征在于,所述利用所述多个第二子时钟信号对秒脉冲信号进行采样,包括:The method according to claim 11, wherein the sampling of the second pulse signal by using the plurality of second sub-clock signals comprises:
    采用所述多个第二子时钟信号对所述秒脉冲信号进行N次采样,确定N组采样结果;其中,所述N为正整数;每一组所述采样结果包括所述多个第二采样信号。The second pulse signal is sampled N times by using the plurality of second sub-clock signals to determine N groups of sampling results; wherein, the N is a positive integer; each group of the sampling results includes the plurality of second sub-clock signals sample signal.
  13. 根据权利要求11或12所述的方法,其特征在于,所述利用小数分频锁相环电路对第二参考时钟信号进行分频,得到多个第二子时钟信号,包括:The method according to claim 11 or 12, wherein the second reference clock signal is frequency-divided by a fractional frequency-division phase-locked loop circuit to obtain a plurality of second sub-clock signals, including:
    利用小数分频锁相环电路对第二参考时钟信号进行四分频,得到四个第二子时钟信号;其中,分频后相邻两个第一子时钟信号的相位差为90°。The second reference clock signal is divided by four by using a fractional frequency-division phase-locked loop circuit to obtain four second sub-clock signals; wherein, after frequency division, the phase difference between two adjacent first sub-clock signals is 90°.
  14. 根据权利要求13所述的方法,其特征在于,所述小数分频锁相环电路中包括:反相器,第一分频器以及第二分频器;The method according to claim 13, wherein the fractional frequency division PLL circuit comprises: an inverter, a first frequency divider and a second frequency divider;
    所述反相器,用于:基于第二参考时钟信号,生成与所述第二参考时钟信号相位相反的信号;The inverter is configured to: generate a signal with an opposite phase to the second reference clock signal based on the second reference clock signal;
    所述第一分频器,用于:对第二参考时钟信号进行二分频,得到两个第一子时钟信号,其中,两个第一子时钟信号的起始相位分别为0°和180°;The first frequency divider is configured to divide the frequency of the second reference clock signal by two to obtain two first sub-clock signals, wherein the initial phases of the two first sub-clock signals are 0° and 180° respectively. °;
    所述第二分频器,用于:对与第二参考时钟信号相位相反的信号进行二分频,得到两 个第一子时钟信号,其中,两个第一子时钟信号的起始相位分别为90°和270°。The second frequency divider is configured to divide the frequency of the signal opposite to the phase of the second reference clock signal by two to obtain two first sub-clock signals, wherein the initial phases of the two first sub-clock signals are respectively for 90° and 270°.
  15. 根据权利要求11-14任一所述的方法,其特征在于,所述第一跳边沿为从低电平跳变为高电平的上升沿和/或从高电平跳变为低电平的下降沿。The method according to any one of claims 11-14, wherein the first jump edge is a rising edge from a low level to a high level and/or a transition from a high level to a low level the falling edge of .
  16. 根据权利要求11-15任一所述的方法,其特征在于,所述利用所述多个第一子时钟信号对所述秒脉冲信号进行采样,包括:The method according to any one of claims 11-15, wherein the sampling of the second pulse signal by using the plurality of first sub-clock signals comprises:
    利用所述多个第一子时钟信号的第二跳边沿,对所述秒脉冲信号进行采样,所述第二跳边沿为从低电平跳变为高电平的上升沿,和/或从高电平跳变为低电平的下降沿。The second pulse signal is sampled by using the second jump edge of the plurality of first sub-clock signals, the second jump edge is a rising edge from a low level to a high level, and/or from Falling edge from high level to low level.
  17. 根据权利要求11-16任一所述的方法,其特征在于,所述得到多个第一子时钟信号之后,所述方法还包括:The method according to any one of claims 11-16, wherein after said obtaining a plurality of first sub-clock signals, said method further comprises:
    根据所述多个第二子时钟信号,生成第二多相位时钟信号,利用所述第二多相位时钟信号对所述秒脉冲信号进行采样。A second multi-phase clock signal is generated according to the plurality of second sub-clock signals, and the second pulse signal is sampled by using the second multi-phase clock signal.
  18. 根据权利要求11-17任一所述的方法,其特征在于,所述根据所述多个第二采样值以及本地时间确定时戳信息,包括:The method according to any one of claims 11-17, wherein the determining time stamp information according to the plurality of second sampling values and local time includes:
    在所述多个第二采样值中首次出现设定大小的采样数值时,根据所述秒脉冲信号的脉冲周期以及所述本地时间,确定时戳信息。When a sample value of a set size appears for the first time in the plurality of second sample values, time stamp information is determined according to the pulse period of the second pulse signal and the local time.
  19. 根据权利要求11-18任一所述的方法,其特征在于,所述时钟同步协议报文规定的采样误差不大于±0.5ns。The method according to any one of claims 11-18, characterized in that the sampling error stipulated in the clock synchronization protocol message is not greater than ±0.5 ns.
  20. 根据权利要求11-19任一所述的方法,其特征在于,所述第一参考时钟信号的时钟频率不高于500MHz。The method according to any one of claims 11-19, wherein the clock frequency of the first reference clock signal is not higher than 500MHz.
  21. 一种时钟同步装置,其特征在于,所述装置包括:A clock synchronization device, characterized in that the device comprises:
    报文及秒脉冲信号接收模块,用于:接收秒脉冲信号以及时钟同步协议报文,解析所述时钟同步协议报文得到时戳信息;The message and second pulse signal receiving module is used to: receive the second pulse signal and clock synchronization protocol message, analyze the clock synchronization protocol message to obtain time stamp information;
    分频模块,用于:利用小数分频锁相环电路对第一参考时钟信号进行分频,得到多个第一子时钟信号;其中,每个第一子时钟信号的周期相同;The frequency division module is used for: using the fractional frequency division phase-locked loop circuit to divide the frequency of the first reference clock signal to obtain a plurality of first sub-clock signals; wherein, the period of each first sub-clock signal is the same;
    采样模块,用于:利用所述多个第一子时钟信号对所述秒脉冲信号进行采样,得到多个第一采样信号;A sampling module, configured to: use the plurality of first sub-clock signals to sample the second pulse signal to obtain a plurality of first sampling signals;
    采样值确定模块,用于:以每个第一采样信号的第一跳边沿为采样点,确定所述多个第一采样信号在所述采样点时的多个第一采样值;A sampling value determination module, configured to: take the first jump edge of each first sampling signal as a sampling point, and determine a plurality of first sampling values of the plurality of first sampling signals at the sampling point;
    时钟同步模块,用于:根据所述时戳信息以及所述多个第一采样值进行时钟同步。A clock synchronization module, configured to: perform clock synchronization according to the time stamp information and the plurality of first sampling values.
  22. 根据权利要求21所述的装置,其特征在于,所述装置包括:The device according to claim 21, characterized in that said device comprises:
    所述采样模块,具体用于:采用所述多个第一子时钟信号对所述秒脉冲信号进行N次采样,确定N组采样结果;其中,所述N为正整数;每一组所述采样结果包括所述多个第 一采样信号。The sampling module is specifically used to: use the plurality of first sub-clock signals to sample the second pulse signal N times, and determine N sets of sampling results; wherein, the N is a positive integer; each set of The sampling result includes the plurality of first sampling signals.
  23. 根据权利要求21或22所述的装置,其特征在于,所述分频模块,具体用于:The device according to claim 21 or 22, wherein the frequency division module is specifically used for:
    利用小数分频锁相环电路对第一参考时钟信号进行四分频,得到四个第一子时钟信号;其中,分频后相邻两个第一子时钟信号的相位差为90°。The first reference clock signal is divided by four by using a fractional frequency-division phase-locked loop circuit to obtain four first sub-clock signals; wherein, after the frequency division, the phase difference between two adjacent first sub-clock signals is 90°.
  24. 根据权利要求23所述的装置,其特征在于,所述小数分频锁相环电路中包括:反相器,第一分频器以及第二分频器;The device according to claim 23, wherein the fractional frequency division PLL circuit comprises: an inverter, a first frequency divider and a second frequency divider;
    所述反相器,用于:基于第一参考时钟信号,生成与所述第一参考时钟信号相位相反的信号;The inverter is configured to: generate a signal with an opposite phase to the first reference clock signal based on the first reference clock signal;
    所述第一分频器,用于:对第一参考时钟信号进行二分频,得到两个第一子时钟信号,其中,两个第一子时钟信号的起始相位分别为0°和180°;The first frequency divider is configured to divide the frequency of the first reference clock signal by two to obtain two first sub-clock signals, wherein the initial phases of the two first sub-clock signals are 0° and 180° respectively. °;
    所述第二分频器,用于:对与第一参考时钟信号相位相反的信号进行二分频,得到两个第一子时钟信号,其中,两个第一子时钟信号的起始相位分别为90°和270°。The second frequency divider is configured to divide the frequency of the signal opposite to the phase of the first reference clock signal by two to obtain two first sub-clock signals, wherein the initial phases of the two first sub-clock signals are respectively for 90° and 270°.
  25. 根据权利要求21-24任一所述的装置,其特征在于,所述第一跳边沿为从低电平跳变为高电平的上升沿和/或从高电平跳变为低电平的下降沿。The device according to any one of claims 21-24, wherein the first jump edge is a rising edge from a low level to a high level and/or a transition from a high level to a low level the falling edge of .
  26. 根据权利要求21-25任一所述的装置,其特征在于,所述采样模块,具体用于:The device according to any one of claims 21-25, wherein the sampling module is specifically used for:
    利用所述多个第一子时钟信号的第二跳边沿,对所述秒脉冲信号进行采样,所述第二跳边沿为从低电平跳变为高电平的上升沿,和/或从高电平跳变为低电平的下降沿。The second pulse signal is sampled by using the second jump edge of the plurality of first sub-clock signals, the second jump edge is a rising edge from a low level to a high level, and/or from Falling edge from high level to low level.
  27. 根据权利要求21-26任一所述的装置,其特征在于,所述时钟同步装置还包括:信号合成模块,所述信号合成模块用于根据所述多个第一子时钟信号,生成第一多相位时钟信号,利用所述第一多相位时钟信号对所述秒脉冲信号进行采样。The device according to any one of claims 21-26, wherein the clock synchronization device further comprises: a signal synthesis module, the signal synthesis module is configured to generate a first sub-clock signal according to the plurality of first sub-clock signals A multi-phase clock signal, using the first multi-phase clock signal to sample the second pulse signal.
  28. 根据权利要求21-27任一所述的装置,其特征在于,所述时钟同步模块,具体用于:The device according to any one of claims 21-27, wherein the clock synchronization module is specifically used for:
    在所述多个第一采样值中首次出现设定大小的采样数值时,根据所述秒脉冲信号的脉冲周期以及所述时戳信息,确定当前时间。When a sampling value of a set size appears for the first time among the plurality of first sampling values, the current time is determined according to the pulse period of the second pulse signal and the time stamp information.
  29. 一种时钟同步装置,其特征在于,所述装置包括:A clock synchronization device, characterized in that the device comprises:
    分频模块,用于:利用小数分频锁相环电路对第二参考时钟信号进行分频,得到多个第二子时钟信号;其中,每个第二子时钟信号的周期相同;The frequency dividing module is used for: dividing the frequency of the second reference clock signal by a fractional frequency division phase-locked loop circuit to obtain a plurality of second sub-clock signals; wherein, the period of each second sub-clock signal is the same;
    采样模块,用于:利用所述多个第二子时钟信号对所述秒脉冲信号进行采样,得到多个第二采样信号;A sampling module, configured to: use the plurality of second sub-clock signals to sample the second pulse signal to obtain a plurality of second sampling signals;
    采样值确定模块,用于:以每个第二采样信号的第一跳边沿为采样点,确定所述多个第二采样信号在所述采样点时的多个第二采样值;A sampling value determination module, configured to: take the first jump edge of each second sampling signal as a sampling point, and determine a plurality of second sampling values of the plurality of second sampling signals at the sampling point;
    报文生成模块,用于:根据所述多个第二采样值以及本地时间确定时戳信息,发送时钟同步协议报文,所述时钟同步协议报文携带所述时戳信息。A message generating module, configured to: determine time stamp information according to the plurality of second sampling values and local time, and send a clock synchronization protocol message, where the clock synchronization protocol message carries the time stamp information.
  30. 根据权利要求29所述的装置,其特征在于,所述采样模块,具体用于:采用所述多个第二子时钟信号对所述秒脉冲信号进行N次采样,确定N组采样结果;其中,所述N为正整数;每一组所述采样结果包括所述多个第二采样信号。The device according to claim 29, wherein the sampling module is specifically configured to: use the plurality of second sub-clock signals to sample the second pulse signal N times, and determine N sets of sampling results; wherein , the N is a positive integer; each group of the sampling results includes the plurality of second sampling signals.
  31. 根据权利要求29或30所述的装置,其特征在于,所述分频模块,具体用于:The device according to claim 29 or 30, wherein the frequency division module is specifically used for:
    利用小数分频锁相环电路对第二参考时钟信号进行四分频,得到四个第二子时钟信号;其中,分频后相邻两个第一子时钟信号的相位差为90°。The second reference clock signal is divided by four by using a fractional frequency-division phase-locked loop circuit to obtain four second sub-clock signals; wherein, after frequency division, the phase difference between two adjacent first sub-clock signals is 90°.
  32. 根据权利要求31所述的装置,其特征在于,所述小数分频锁相环电路中包括:反相器,第一分频器以及第二分频器;The device according to claim 31, wherein the fractional frequency division PLL circuit comprises: an inverter, a first frequency divider and a second frequency divider;
    所述反相器,用于:基于第二参考时钟信号,生成与所述第二参考时钟信号相位相反的信号;The inverter is configured to: generate a signal with an opposite phase to the second reference clock signal based on the second reference clock signal;
    所述第一分频器,用于:对第二参考时钟信号进行二分频,得到两个第一子时钟信号,其中,两个第一子时钟信号的起始相位分别为0°和180°;The first frequency divider is configured to divide the frequency of the second reference clock signal by two to obtain two first sub-clock signals, wherein the initial phases of the two first sub-clock signals are 0° and 180° respectively. °;
    所述第二分频器,用于:对与第二参考时钟信号相位相反的信号进行二分频,得到两个第一子时钟信号,其中,两个第一子时钟信号的起始相位分别为90°和270°。The second frequency divider is configured to divide the frequency of the signal opposite to the phase of the second reference clock signal by two to obtain two first sub-clock signals, wherein the initial phases of the two first sub-clock signals are respectively for 90° and 270°.
  33. 根据权利要求29-32任一所述的装置,其特征在于,所述第一跳边沿为从低电平跳变为高电平的上升沿和/或从高电平跳变为低电平的下降沿。The device according to any one of claims 29-32, wherein the first jump edge is a rising edge from a low level to a high level and/or a transition from a high level to a low level the falling edge of .
  34. 根据权利要求29-33任一所述的装置,其特征在于,所述采样模块,具体用于:The device according to any one of claims 29-33, wherein the sampling module is specifically used for:
    利用所述多个第一子时钟信号的第二跳边沿,对所述秒脉冲信号进行采样,所述第二跳边沿为从低电平跳变为高电平的上升沿,和/或从高电平跳变为低电平的下降沿。The second pulse signal is sampled by using the second jump edge of the plurality of first sub-clock signals, the second jump edge is a rising edge from a low level to a high level, and/or from Falling edge from high level to low level.
  35. 根据权利要求29-34任一所述的装置,其特征在于,所述时钟同步装置还包括:信号合成模块,所述信号合成模块用于根据所述多个第二子时钟信号,生成第二多相位时钟信号,利用所述第二多相位时钟信号对所述秒脉冲信号进行采样。The device according to any one of claims 29-34, wherein the clock synchronization device further comprises: a signal synthesis module, the signal synthesis module is configured to generate a second sub-clock signal according to the plurality of second sub-clock signals A multi-phase clock signal, using the second multi-phase clock signal to sample the second pulse signal.
  36. 根据权利要求29-35任一所述的装置,其特征在于,所述报文生成模块,具体用于:The device according to any one of claims 29-35, wherein the message generating module is specifically used for:
    在所述多个第二采样值中首次出现设定大小的采样数值时,根据所述秒脉冲信号的脉冲周期以及所述本地时间,确定时戳信息。When a sample value of a set size appears for the first time in the plurality of second sample values, time stamp information is determined according to the pulse period of the second pulse signal and the local time.
  37. 一种芯片,其特征在于,包括:处理器和存储器,所述处理器与所述存储器相连,所述存储器中保存有指令程序,所述处理器在所述指令程序的控制下,用于执行如下步骤:A chip, characterized in that it includes: a processor and a memory, the processor is connected to the memory, an instruction program is stored in the memory, and the processor is used to execute Follow the steps below:
    获得秒脉冲信号以及时钟同步协议报文,解析所述时钟同步协议报文得到时戳信息;Obtaining a second pulse signal and a clock synchronization protocol message, and parsing the clock synchronization protocol message to obtain timestamp information;
    利用小数分频锁相环电路对第一参考时钟信号进行分频,得到多个第一子时钟信号;其中,每个第一子时钟信号的周期相同;Using a fractional frequency-division phase-locked loop circuit to divide the frequency of the first reference clock signal to obtain a plurality of first sub-clock signals; wherein, the period of each first sub-clock signal is the same;
    利用所述多个第一子时钟信号对所述秒脉冲信号进行采样,得到多个第一采样信号;sampling the second pulse signal by using the plurality of first sub-clock signals to obtain a plurality of first sampling signals;
    以每个第一采样信号的第一跳边沿为采样点,确定所述多个第一采样信号在所述采样点时的多个第一采样值;Using the first jump edge of each first sampling signal as a sampling point, determine a plurality of first sampling values of the plurality of first sampling signals at the sampling point;
    根据所述时戳信息以及所述多个第一采样值进行时钟同步。Clock synchronization is performed according to the time stamp information and the plurality of first sampling values.
  38. 一种芯片,其特征在于,包括:处理器和存储器,所述处理器与所述存储器相连,所述存储器中保存有指令程序,所述处理器在所述指令程序的控制下,用于执行如下步骤:A chip, characterized in that it includes: a processor and a memory, the processor is connected to the memory, an instruction program is stored in the memory, and the processor is used to execute Follow the steps below:
    利用小数分频锁相环电路对第二参考时钟信号进行分频,得到多个第二子时钟信号;其中,每个第二子时钟信号的周期相同;Using a fractional frequency-division phase-locked loop circuit to divide the frequency of the second reference clock signal to obtain a plurality of second sub-clock signals; wherein, the period of each second sub-clock signal is the same;
    利用所述多个第二子时钟信号对所述秒脉冲信号进行采样,得到多个第二采样信号;sampling the second pulse signal by using the plurality of second sub-clock signals to obtain a plurality of second sampling signals;
    以每个第二采样信号的第一跳边沿为采样点,确定所述多个第二采样信号在所述采样点时的多个第二采样值;Using the first jump edge of each second sampling signal as a sampling point, determine a plurality of second sampling values of the plurality of second sampling signals at the sampling point;
    根据所述多个第二采样值以及本地时间确定时戳信息,生成时钟同步协议报文,所述时钟同步协议报文携带所述时戳信息。Determine time stamp information according to the plurality of second sampled values and local time, and generate a clock synchronization protocol message, where the clock synchronization protocol message carries the time stamp information.
  39. 一种时钟同步系统,其特征在于,所述时钟同步系统包括:A clock synchronization system, characterized in that the clock synchronization system comprises:
    第二分频模块,用于利用小数分频锁相环电路对第二参考时钟信号进行分频,得到多个第二子时钟信号;其中,每个第二子时钟信号的周期相同;The second frequency division module is used to divide the frequency of the second reference clock signal by a fractional frequency division phase-locked loop circuit to obtain a plurality of second sub-clock signals; wherein, the period of each second sub-clock signal is the same;
    第二采样模块,用于利用所述多个第二子时钟信号对所述秒脉冲信号进行采样,得到多个第二采样信号;A second sampling module, configured to use the plurality of second sub-clock signals to sample the second pulse signal to obtain a plurality of second sampling signals;
    第二采样值确定模块,用于以每个第二采样信号的第一跳边沿为采样点,确定所述多个第二采样信号在所述采样点时的多个第二采样值;The second sampling value determination module is configured to use the first jump edge of each second sampling signal as a sampling point to determine a plurality of second sampling values of the plurality of second sampling signals at the sampling point;
    报文生成模块,用于根据所述多个第二采样值以及本地时间确定时戳信息,向所述报文及秒脉冲信号接收模块发送时钟同步协议报文,所述时钟同步协议报文携带所述时戳信息;A message generating module, configured to determine time stamp information according to the plurality of second sampling values and local time, and send a clock synchronization protocol message to the message and second pulse signal receiving module, the clock synchronization protocol message carrying said timestamp information;
    报文及秒脉冲信号接收模块,用于接收所述报文生成模块发送的秒脉冲信号以及时钟同步协议报文,解析所述时钟同步协议报文得到时戳信息;The message and second pulse signal receiving module is used to receive the second pulse signal and the clock synchronization protocol message sent by the message generating module, and analyze the clock synchronization protocol message to obtain time stamp information;
    第一分频模块,用于利用小数分频锁相环电路对第一参考时钟信号进行分频,得到多个第一子时钟信号;其中,每个第一子时钟信号的周期相同;The first frequency division module is used to divide the frequency of the first reference clock signal by a fractional frequency division phase-locked loop circuit to obtain a plurality of first sub-clock signals; wherein, the period of each first sub-clock signal is the same;
    第一采样模块,用于利用所述多个第一子时钟信号对所述秒脉冲信号进行采样,得到多个第一采样信号;A first sampling module, configured to use the plurality of first sub-clock signals to sample the second pulse signal to obtain a plurality of first sampling signals;
    第一采样值确定模块,用于以每个第一采样信号的第一跳边沿为采样点,确定所述多个第一采样信号在所述采样点时的多个第一采样值;A first sampling value determining module, configured to use the first jump edge of each first sampling signal as a sampling point to determine a plurality of first sampling values of the plurality of first sampling signals at the sampling point;
    时钟同步模块,用于根据所述时戳信息以及所述多个第一采样值进行时钟同步。A clock synchronization module, configured to perform clock synchronization according to the time stamp information and the plurality of first sampling values.
PCT/CN2021/108624 2021-07-27 2021-07-27 Clock synchronization method, apparatus and system, and chip WO2023004576A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202180100996.1A CN117716644A (en) 2021-07-27 2021-07-27 Clock synchronization method, device, system and chip
PCT/CN2021/108624 WO2023004576A1 (en) 2021-07-27 2021-07-27 Clock synchronization method, apparatus and system, and chip

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2021/108624 WO2023004576A1 (en) 2021-07-27 2021-07-27 Clock synchronization method, apparatus and system, and chip

Publications (1)

Publication Number Publication Date
WO2023004576A1 true WO2023004576A1 (en) 2023-02-02

Family

ID=85086151

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/108624 WO2023004576A1 (en) 2021-07-27 2021-07-27 Clock synchronization method, apparatus and system, and chip

Country Status (2)

Country Link
CN (1) CN117716644A (en)
WO (1) WO2023004576A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109765583A (en) * 2019-03-04 2019-05-17 华通信安(北京)科技发展有限公司 A kind of clock synchronizing method based on GNSS receiver pulse per second (PPS)
US10608647B1 (en) * 2018-12-14 2020-03-31 Silicon Laboratories Inc. Delay adjustment using frequency estimation
CN111431650A (en) * 2019-12-26 2020-07-17 武汉光谷互连科技有限公司 Satellite signal real-time service method and system based on FPGA
EP3806413A1 (en) * 2019-10-07 2021-04-14 FRAUNHOFER-GESELLSCHAFT zur Förderung der angewandten Forschung e.V. Method for the acquisition of impulse responses, e.g. for ultra-wideband systems
CN112748758A (en) * 2020-12-28 2021-05-04 深兰人工智能(深圳)有限公司 Clock source selection method and device, electronic equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10608647B1 (en) * 2018-12-14 2020-03-31 Silicon Laboratories Inc. Delay adjustment using frequency estimation
CN109765583A (en) * 2019-03-04 2019-05-17 华通信安(北京)科技发展有限公司 A kind of clock synchronizing method based on GNSS receiver pulse per second (PPS)
EP3806413A1 (en) * 2019-10-07 2021-04-14 FRAUNHOFER-GESELLSCHAFT zur Förderung der angewandten Forschung e.V. Method for the acquisition of impulse responses, e.g. for ultra-wideband systems
CN111431650A (en) * 2019-12-26 2020-07-17 武汉光谷互连科技有限公司 Satellite signal real-time service method and system based on FPGA
CN112748758A (en) * 2020-12-28 2021-05-04 深兰人工智能(深圳)有限公司 Clock source selection method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN117716644A (en) 2024-03-15

Similar Documents

Publication Publication Date Title
EP2740228B1 (en) Method and system for frequency synchronization
US10868664B2 (en) Minimizing timestamp error in PTP systems
CN101388741B (en) Highly precised time synchronization device, system and method for computer network
US20070260906A1 (en) Clock synchronization method and apparatus
CN103532652B (en) A kind of time synchronism apparatus and method
US10177897B2 (en) Method and system for synchronizing and interleaving separate sampler groups
WO2018082665A1 (en) Frequency synchronization method and slave clock
CN102474410A (en) High-precision synchronisation method and system
CN111106894B (en) Time synchronization method and system
TWI642277B (en) Frequency division clock alignment
Włostowski et al. Trigger and RF distribution using White Rabbit
Moreira et al. Digital femtosecond time difference circuit for CERN’s timing system
US8767898B2 (en) Method and system of synchronizing data to reference time signal with data resampling
WO2023004576A1 (en) Clock synchronization method, apparatus and system, and chip
Kinali et al. Fault-tolerant clock synchronization with high precision
CN115801175B (en) Time-frequency synchronization method, system, storage medium and electronic equipment
CN102780554A (en) Method and system for realizing synchronization through 1588 protocol
CN112019288B (en) Time synchronization method, service single board and network equipment
WO2022160283A1 (en) Sampling method, sampling circuit, and clock synchronization method of distributed network
CN111884749B (en) High-precision fixed period PTP time synchronization method based on clock split phase
Xu et al. Implementation of field-programmable Gate array-based clock synchronization in the fiber channel communication system
CN114513273B (en) Method and device for realizing PTP chip clock module
Han et al. A Circuit Implementation of 1000BASE-T White Rabbit Using MMCMs and SyncE Frequency Transfer for High-Accuracy Clock Synchronization
Duan et al. Comparison and Testing of Time Synchronization Accuracy between IEEE 1588v2 and IEEE 802.1 AS
CN117768055A (en) Clock synchronization test system and method

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21951193

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE