WO2022127337A1 - 主时钟装置、从时钟装置和时间同步方法 - Google Patents

主时钟装置、从时钟装置和时间同步方法 Download PDF

Info

Publication number
WO2022127337A1
WO2022127337A1 PCT/CN2021/124454 CN2021124454W WO2022127337A1 WO 2022127337 A1 WO2022127337 A1 WO 2022127337A1 CN 2021124454 W CN2021124454 W CN 2021124454W WO 2022127337 A1 WO2022127337 A1 WO 2022127337A1
Authority
WO
WIPO (PCT)
Prior art keywords
time
master clock
clock
clock device
slave
Prior art date
Application number
PCT/CN2021/124454
Other languages
English (en)
French (fr)
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 华为技术有限公司
Publication of WO2022127337A1 publication Critical patent/WO2022127337A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G04HOROLOGY
    • G04GELECTRONIC TIME-PIECES
    • G04G3/00Producing timing pulses
    • GPHYSICS
    • G04HOROLOGY
    • G04GELECTRONIC TIME-PIECES
    • G04G7/00Synchronisation
    • GPHYSICS
    • G04HOROLOGY
    • G04RRADIO-CONTROLLED TIME-PIECES
    • G04R20/00Setting the time according to the time information carried or implied by the radio signal
    • G04R20/02Setting the time according to the time information carried or implied by the radio signal the radio signal being sent by a satellite, e.g. GPS
    • G04R20/04Tuning or receiving; Circuits therefor
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04BTRANSMISSION
    • H04B7/00Radio transmission systems, i.e. using radiation field
    • H04B7/14Relay systems
    • H04B7/15Active relay systems
    • H04B7/185Space-based or airborne stations; Stations for satellite systems
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04BTRANSMISSION
    • H04B7/00Radio transmission systems, i.e. using radiation field
    • H04B7/14Relay systems
    • H04B7/15Active relay systems
    • H04B7/185Space-based or airborne stations; Stations for satellite systems
    • H04B7/1851Systems using a satellite or space-based relay
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network
    • H04J3/0638Clock or time synchronisation among nodes; Internode synchronisation

Definitions

  • the present application belongs to the field of artificial intelligence, and specifically relates to a master clock device, a slave clock device and a time synchronization method.
  • the time following the real world is obtained by receiving the Global Navigation Satellite System (GNSS) signal as the system time of the artificial intelligence device.
  • GNSS Global Navigation Satellite System
  • the system time of the AI device is usually synchronized according to the time in the satellite signal at a frequency of 1 time per second.
  • the internal clock is used as the system time of the artificial intelligence device until the system time can be synchronized after the satellite signal can be received again.
  • the present application provides a master clock device, a slave clock device and a time synchronization method, which can eliminate the negative impact of time jump on the time-sensitive part of the application system, while ensuring that the application system has a time that follows the real world. .
  • the present application provides a master clock device, comprising: a first clock unit for providing a first master clock time based on a real-time clock signal; and a second clock unit for receiving a satellite when the master clock device receives When the satellite signal is received, a second master clock time is provided based on the time included in the first positioning data in the received satellite signal, and when the master clock device does not receive the satellite signal, the real time clock signal is provided based on the real time clock signal. the second master clock time.
  • the time in the satellite signal includes but is not limited to Coordinated Universal Time (UTC).
  • UTC Coordinated Universal Time
  • the master clock device can provide different clock times to each part of the system and the device with different time sensitivities.
  • a time-sensitive data plane node is provided with a monotonically increasing first grandmaster time
  • a less time-sensitive management plane node that allows clock hopping is provided with a second grandmaster time that follows the real world UTC .
  • Data plane nodes are, for example, nodes involved in automatic driving algorithm calculation, motion path planning calculation, etc., such as Microprogrammed Control Unit (MCU), LiDAR, etc.
  • Management plane nodes are, for example, other nodes that do not involve automatic driving algorithm calculation, motion path planning calculation, etc., such as dimension measurement, log, etc.
  • This independent dual clock configuration not only provides the application device and the time-sensitive part of the system with extremely stable time without time jump, but also provides the application device and other parts of the system to follow the real world. time, providing a simple and flexible solution to the otherwise contradictory needs of these two parts. Furthermore, by configuring the second clock unit as above, it is possible to provide the second master clock time based on the real-time clock signal when the satellite signal is not received, thereby making the second master clock time available in any case , and make the second master clock time provide coordinated universal time that follows real time when possible.
  • the master clock device further includes: a time processing unit, connected to the second clock unit, for: determining a first time difference, wherein the first time difference is the time difference between a first moment and a second moment, the first moment being the moment when the master clock device receives the first second pulse signal, and the second moment being the moment the master clock device receiving the first second pulse signal
  • the first pulse per second signal and the first positioning data are included in the received satellite signal and correspond to each other; and, based on the time included in the first positioning data and the first time difference , determine the first time.
  • the second clock unit of the master clock device is further configured to provide the second master clock time based on the first time.
  • the positioning data is generally transmitted through a Controller Area Network (CAN) or a serial port such as a Universal Asynchronous Receiver (UART), and there is generally a delay when the master clock device receives the positioning data.
  • the pulse-of-second signal is generally transmitted through the General-Purpose Input/Output (GPIO) interface.
  • GPIO General-Purpose Input/Output
  • the master clock device receives the pulse-of-second signal, the delay is in nanoseconds, which is almost negligible. Therefore, for the positioning data generating device (eg, satellite) to transmit the second pulse signal and the positioning data at the same time, the receiving device has a time difference when receiving the two.
  • the time processing unit By setting the time processing unit to determine the first time difference between the master clock device receiving the first second pulse signal and receiving the first positioning data corresponding to the first second pulse signal, the first positioning data can be obtained and transmitted to the master clock. Delay of the clock device. And based on the time in the positioning data and the first time difference, a first time is determined, and then the second clock unit further provides a second master clock time based on the first time. In this way, the negative influence of the transmission delay of the positioning data is eliminated, and a particularly precise synchronization of the time of the second master clock with the time included in the positioning data in the satellite signal is achieved. Due to the ultra-low delay transmission of the second pulse signal, such synchronization accuracy can be at least microsecond level in practice without accumulating errors.
  • a possible implementation manner of determining the first time difference is to set a sensor control center (Senor Hub) in the time processing unit, and configure the sensor control center to start counting in nanoseconds when the second pulse signal is received, and when receiving The counting ends when the positioning data corresponding to the second pulse signal is reached, and the nanosecond time count obtained thereby is the first time difference.
  • Another possible implementation is to set a counter in the time processing unit instead of the sensor control center to obtain the first time difference with nanosecond precision.
  • Another possible implementation for determining the first time difference is to configure the time processing unit to record the first master clock time at the moment when the first second pulse signal in the received satellite signal is received, and to When the first positioning data corresponding to the second pulse signal is recorded, the first master clock time at the moment is recorded, and then the difference between the first master clock times at two different moments is calculated as the first time difference.
  • the time processing unit is further configured to calculate a second time difference as the transmission delay of the second positioning data received by the master clock device.
  • the second time difference is the time difference between the time included in the second positioning data and a second time
  • the second time is the second master clock provided by the second clock unit at a third time.
  • the third time is the time when the master clock device receives the second positioning data.
  • the second time difference between the time in the received second positioning data and the time of the second master clock when the second positioning data is received may be calculated, and The second time difference is used as the transmission delay of the positioning data.
  • the transmission delay can be used to verify the time conversion of the second positioning data of the navigation system, and monitor the abnormality of the time conversion of the second positioning data.
  • the second positioning data may be any positioning data other than the first positioning data received by the master clock device.
  • the master clock device further includes a time processing unit, connected to the first clock unit, and configured to: record a third time, where the third time is The first master clock time provided by the first clock unit at four time points, the fourth time is the time when the master clock device receives the third second pulse signal; the third time difference is calculated, and the third time difference is the The time difference between the time included in the third positioning data received by the master clock device and the third time, the third positioning data and the third second pulse signal correspond to each other; and, the fourth positioning data The included fourth time is converted to a fifth time, the fourth positioning data is the positioning data received by the master clock device after the third positioning data, the fifth time is based on the fourth time and the The third time difference is determined.
  • the third time is The first master clock time provided by the first clock unit at four time points
  • the fourth time is the time when the master clock device receives the third second pulse signal
  • the third time difference is calculated
  • the third time difference is the The time difference between the time included in the third positioning data received by the master clock device and
  • the positioning data is generally transmitted to the master clock device via CAN or serial port, which may cause problems of transmission time fluctuation and transmission delay.
  • the first master clock time of the master clock device when the third second pulse signal is received is recorded by the time processing unit, and the third time difference between the time in the third positioning data and the recorded clock time is calculated. as the reference time difference.
  • the time processing unit further receives the second positioning data after that, it converts the second time in the second positioning data into a third time by using the third time difference, so that the second time in the second positioning data is consistent with the master clock
  • the first time synchronization of the device is generally transmitted to the master clock device via CAN or serial port, which may cause problems of transmission time fluctuation and transmission delay.
  • the time-converted positioning data can be directly applied to the time-sensitive parts of the system without causing various problems due to time inconsistency or jumping, especially data fusion and path planning.
  • the calculation of the third time difference is independent of the time when the positioning data is received, which reduces the problems of transmission time fluctuation and transmission delay caused by the transmission of the positioning data via the CAN or serial port.
  • the third time difference may persist for precise translation of the time of the second positioning data.
  • the master clock device further includes: an interface unit, connected to the first clock unit and the second clock unit, and configured to provide the slave clock device with the first clock Master clock time and second master clock time.
  • the first master clock time and the second master clock time are provided to the slave clock device, so as to realize the slave clock time of the slave clock device and the master clock of the first master clock device time synchronization.
  • the interface unit is further configured to send the first master clock time to the slave clock device through a generalized precision clock protocol.
  • the master clock device sends the first master clock time to the slave clock device based on the Generalized Precision Time Protocol (gPTP, also known as IEEE 802.1AS) through the interface unit, so that the slave clock device can convert the first slave clock time to the slave clock device. Synchronized to the time of the first master clock. This ensures a particularly precise synchronization between the first master clock time and the first slave clock time.
  • the synchronization skew can be less than 1 microsecond.
  • the interface unit is further configured to periodically send a first time synchronization request message to the slave clock device through the generalized precision clock protocol.
  • the first time synchronization request message includes a sixth time and a seventh time, the sixth time is the first master clock time provided by the first clock unit at the fifth time, and the seventh time The time is the second master clock time provided by the second clock unit at the fifth moment, which is the moment when the interface unit sends the first time synchronization request message.
  • the master clock device sends the first time synchronization request message to the slave clock device through the interface unit based on the generalized precision clock protocol, so that the slave clock device synchronizes the time of the second slave clock to the time of the second master clock. Since a particularly precise synchronization between the first master clock time and the first slave clock time can be achieved by the generalized precision clock protocol, the master clock device transmits the first master clock time and the second master clock time simultaneously to the slave clock device. The clock device can realize high-precision synchronization between the time of the second master clock and the time of the second slave clock according to the time of the first master clock.
  • the interface unit is further configured to periodically send a second time synchronization request message to the slave clock device.
  • the second time synchronization request message includes an eighth time and an average message delay, the eighth time is the second master clock time provided by the second clock unit at a sixth moment, and the sixth moment is the moment when the interface unit sends the second time synchronization request message, and the average delay of the message indicates the time required for message transmission between the master clock device and the slave clock device.
  • the average message delay is a preset value. In some embodiments, the average message delay is calculated based on, for example, messages from outside the master clock device.
  • the interface unit is further configured to receive a second time synchronization response message.
  • the second time synchronization response message includes a ninth time and a tenth time, the ninth time is the second slave clock time of the slave clock device at the seventh moment, and the tenth time is the second slave clock time of the slave clock device at the seventh moment.
  • the second slave clock time of the slave clock device at the eighth time the seventh time is the time when the slave clock device receives the second time synchronization request message, and the eighth time is the slave clock device The moment at which the second time synchronization response message is sent.
  • the master clock device further includes a time processing unit, connected to the interface unit, and configured to: record an eleventh time, and the eleventh time is in the first the second master clock time provided by the second clock unit at the ninth time, where the ninth time is the time when the interface unit receives the second time synchronization response message; and, based on the eighth time, all The ninth time, the tenth time and the eleventh time are used to calculate the average delay of the message.
  • the master clock device can calculate a more accurate average delay of the message, thereby realizing a higher precision between the second master clock time and the second slave clock time. Synchronize.
  • the period may be preset or controllably adjusted.
  • the period can be preset to 1 second/time.
  • the present application provides a slave clock device, the slave clock device comprising: an interface unit for receiving a first master clock time and a second master clock time from the master clock device; a first clock unit for providing a first slave clock time, the first slave clock time being synchronized with the first master clock time; and a second clock unit for providing a second slave clock time, the second slave clock time being the same as the second slave clock time master clock time synchronization; wherein, the first master clock time is based on a real-time clock signal, and when the master clock device receives a satellite signal, the second master clock time is based on the time included in the positioning data in the satellite signal , and, when the master clock means does not receive a satellite signal, the second master clock time is based on the real time clock signal time.
  • the slave clock device can provide the first slave clock time synchronized with the first master clock time and the time synchronization with the second master clock The second slave clock time.
  • a time-sensitive part of the slave clock device can be provided with a very stable first slave clock time without time jumps, and a less time-sensitive part of the slave clock device can be provided with a follow-up time. Real world second slave clock time.
  • the interface unit is further configured to receive the first master clock time from the master clock device through a generalized precision clock protocol.
  • the slave clock device receives the first master clock time from the master clock device through the interface unit based on the generalized precision clock protocol, for synchronizing the first slave clock time to the time of the first master clock.
  • the synchronization deviation of such time synchronization is less than 1 microsecond. This allows each of the slave clock devices that are synchronized with the master clock device to have substantially the same first slave clock time.
  • substantially the same can be understood as the deviation between the corresponding first slave clock times of each slave clock device is less than 1 microsecond or even smaller, and can be ignored.
  • the interface unit is further configured to receive a first time synchronization request message from the master clock device.
  • the first time synchronization request message includes a first time and a second time
  • the first time and the second time are respectively the first master clock provided by the master clock device at the first moment time and the second master clock time
  • the first moment is the moment when the master clock device sends the first time synchronization request message.
  • the slave clock device further includes a time processing unit, connected to the interface unit, for: calculating a first time difference, where the first time difference is the first time difference a time difference between a time and the second time; and calculating a fourth time based on the first time difference and a third time, wherein the third time is provided by the first clock unit at the second instant
  • the first slave clock time, the second time is the time when the interface unit receives the first time synchronization request message, wherein the second clock unit is further configured to provide the Second slave clock time.
  • the slave clock device receives the first time synchronization request message generated by the master clock device through the interface unit based on the generalized precision clock protocol, so as to synchronize the time of the second slave clock to the time of the second master clock. Since a particularly precise synchronization between the first master clock time and the first slave clock time can be achieved by means of the generalized precise clock protocol, the first slave clock time in the slave clock arrangement is very precise.
  • the second slave clock time of the slave clock device is calculated based on the simultaneously transmitted first master clock time and the second master clock time received from the master clock device, and the slave clock device can provide the second slave clock time according to its own first slave clock time. Two slave clock time, the second slave clock time is synchronized with the second master clock time with high precision.
  • the interface unit is further configured to receive a second time synchronization request message from the master clock device.
  • the second time synchronization request message includes a fifth time and an average message delay
  • the fifth time is the second master clock time provided by the master clock device at a third time
  • the third time is the time at which the master clock device sends the second time synchronization request message
  • the message average delay indicates the time required for message transmission between the master clock device and the slave clock device.
  • the slave clock device further includes a time processing unit, connected to the interface unit, and configured to calculate the first time based on the fifth time and the average delay of the message Six times, the second clock unit is further configured to provide the second slave clock time based on the sixth time.
  • the average message delay is a preset value. In some implementations, the average message delay is calculated based on, for example, messages from outside the slave clock device.
  • the interface unit is further configured to send a second time synchronization response message to the master clock device.
  • the second time synchronization response message includes a seventh time and an eighth time, the seventh time is the second slave clock time provided by the second time unit at the fourth time, and the eighth time The time is the second slave clock time provided by the second time unit at the fifth moment, the fourth moment is the moment when the interface unit receives the second time synchronization request message, and the fifth The moment is the moment when the interface unit sends the second time synchronization response message.
  • the slave clock device can realize the difference between the second master clock time and the second slave clock time. more precise synchronization.
  • the present application provides a time system, the time system includes a master clock device according to any one of the above embodiments, a real-time clock signal source and a satellite signal receiving device, where the real-time clock signal source is used to send the master clock to the master clock.
  • the device provides a real-time clock signal, and the satellite signal receiving device is adapted to provide the received satellite signal to the master clock device when the satellite signal is received.
  • the real time clock (Real Time Clock, RTC) time source includes but is not limited to a quartz crystal resonator.
  • the satellite signal receiving device includes but is not limited to a combined positioning sensor, a satellite signal receiving device, and a Real Time Kinematic (RTK) positioning sensor.
  • RTK Real Time Kinematic
  • the time system further includes the slave clock device according to any one of the foregoing implementation manners.
  • the above-mentioned time system includes the above-mentioned master clock device and/or the above-mentioned slave clock device, its advantages or benefits can be correspondingly referred to the advantages or benefits of the above-mentioned master clock device and/or the above-mentioned slave clock device, and will not be repeated here.
  • the present application provides a time synchronization method, the time synchronization method comprising the following steps: a master clock device provides a first master clock time based on a real-time clock signal; and when the master clock device receives a satellite signal, based on The time included in the first positioning data in the received satellite signal provides a second master clock time, and, when the satellite signal is not received, provides the second master clock time based on the real time clock signal.
  • the providing the second master clock time based on the time included in the first positioning data in the received satellite signal includes: the master clock device determining a first time difference , wherein the first time difference is the time difference between the first time and the second time, the first time is the time when the master clock device receives the first second pulse signal, and the second time is the The time when the master clock device receives the first positioning data, the first second pulse signal and the first positioning data are contained in the satellite signal and correspond to each other; the master clock device is based on the first positioning The first time is determined by the difference between the time included in the data and the first time; and the master clock means provides the second master clock time based on the first time.
  • the time synchronization method further includes the following step: the master clock device calculates a second time difference as the transmission time of the second positioning data received by the master clock device extension.
  • the second time difference is a time difference between the time included in the second positioning data and a second time
  • the second time is the second master clock provided by the master clock device at a third time instant time
  • the third time is the time when the master clock device receives the second positioning data.
  • the time synchronization method further includes the following step: the master clock device records a third time, and the third time is in the first The first master clock time provided by the master clock device at four times, the fourth time is the moment when the master clock device receives the third second pulse signal; the master clock device calculates the third time difference, the first time The third time difference is the time difference between the time included in the third positioning data received by the master clock device and the third time, and the third positioning data and the third second pulse signal correspond to each other; The master clock device converts the fourth time included in the fourth positioning data into the fifth time, the fourth positioning data is the positioning data received by the master clock device after the third positioning data, the fifth time The time is determined based on the fourth time and the third time difference.
  • the time synchronization method further includes the following step: the master clock device provides the slave clock device with the first master clock time and the second master clock time.
  • the master clock device providing the first master clock time and the second master clock time to the slave clock device includes: the master clock device The first master clock time is sent to the slave clock device through a generalized precision clock protocol.
  • the master clock device providing the first master clock time and the second master clock time to the slave clock device includes: the master clock device A first time synchronization request message is periodically sent to the slave clock device through the generalized precision clock protocol.
  • the first time synchronization request message includes a sixth time and a seventh time, the sixth time is the first master clock time provided by the master clock device at the fifth time, and the seventh time is the second master clock time provided by the master clock device at the fifth moment, where the fifth moment is the moment when the interface unit sends the first time synchronization request message.
  • the master clock device providing the first master clock time and the second master clock time to the slave clock device includes: the master clock device A second time synchronization request message is periodically sent to the slave clock device.
  • the second time synchronization request message includes an eighth time and an average message delay, the eighth time is the second master clock time provided by the master clock device at the sixth moment, and the sixth moment is The time when the master clock device sends the second time synchronization request message, and the message average delay indicates the time required for message transmission between the master clock device and the slave clock device.
  • the master clock device providing the first master clock time and the second master clock time to the slave clock device includes: the master clock device A second time synchronization response message is received.
  • the second time synchronization response message includes a ninth time and a tenth time, the ninth time is the second slave clock time provided by the slave clock device at the seventh moment, and the tenth time is at The second slave clock time provided by the slave clock device at the eighth moment, the seventh moment is the moment when the slave clock device receives the second time synchronization request message, and the eighth moment is the slave clock device The time when the clock device sends the second time synchronization response message.
  • the master clock device providing the first master clock time and the second master clock time to the slave clock device includes: the master clock device Record the eleventh time, which is the second master clock time provided by the master clock device at the ninth time, the ninth time when the master clock device receives the second time synchronization the time of responding to the message; and the master clock device calculates the average delay of the message based on the eighth time, the ninth time, the tenth time and the eleventh time.
  • the time synchronization method of the fourth aspect may be performed by the master clock device of the first aspect. Therefore, for the advantages or benefits of the time synchronization method related to the fifth aspect, reference may be made to the advantages or benefits of the above-mentioned master clock devices, which will not be repeated here.
  • the present application provides another time synchronization method, the time synchronization method comprising the following steps: the slave clock device receives the first master clock time and the second master clock time from the master clock device; the slave clock device provides the first master clock time and the second master clock time; a slave clock time, the first slave clock time being synchronized with the first master clock time; and the slave clock means providing a second slave clock time, the second slave clock time being the second master clock time synchronization; wherein the first master clock time is based on a real-time clock signal, the second master clock time is based on the time included in the positioning data in the satellite signal when the master clock device receives the satellite signal, and , based on the real-time clock signal time when the master clock device does not receive the satellite signal.
  • the slave clock device receiving the first master clock time and the second master clock time from the master clock device includes: the slave clock device The first grandmaster time is received from the grandmaster device via a generalized precision clock protocol.
  • the slave clock device receiving the first master clock time and the second master clock time from the master clock device further comprises: the slave clock The device receives a first time synchronization request message from the master clock device.
  • the first time synchronization request message includes a first time and a second time
  • the first time and the second time are respectively the first master clock provided by the master clock device at the first moment time and the second master clock time
  • the first moment is the moment when the master clock device sends the first time synchronization request message.
  • providing the second slave clock time by the slave clock device includes: the slave clock device calculates a first time difference, the first time difference is the time difference between the first time and the second time; the slave clock means calculates a fourth time based on the first time difference and a third time, wherein the third time is at the second instant a first slave clock time provided by the slave clock device, the second time instant is the time when the slave clock device received the first time synchronization request message; and the slave clock device is based on the fourth time , providing the second slave clock time.
  • the slave clock device receiving the first master clock time and the second master clock time from the master clock device includes: the slave clock device A second time synchronization request message is received from the master clock device.
  • the second time synchronization request message includes a fifth time and an average message delay
  • the fifth time is the second master clock time provided by the master clock device at a third time
  • the third time is the time at which the master clock device sends the second time synchronization request message
  • the message average delay indicates the time required for message transmission between the master clock device and the slave clock device.
  • the slave clock device synchronizing the clock time of the slave clock device with the clock time provided by the master clock device further includes: the The slave clock means calculates a sixth time based on the fifth time and the message average delay; and the slave clock means provides the second slave clock time based on the sixth time.
  • the time synchronization method further includes: the slave clock device sending a second time synchronization response message to the master clock device.
  • the second time synchronization response message includes a seventh time and an eighth time, the seventh time is the second slave clock time provided by the slave clock device at the fourth time, and the eighth time is the second slave clock time provided by the slave clock device at the fifth moment, the fourth moment is the moment the slave clock device receives the second time synchronization request message, and the fifth moment is the time when the slave clock device sends the second time synchronization response message.
  • the time synchronization method of the fifth aspect may be performed by a master clock device slave clock device slave clock device of the second aspect. Therefore, the advantages or benefits of the time synchronization method related to the fifth aspect can be referred to the advantages or benefits of each slave clock device of the above-mentioned master clock device, which will not be repeated here.
  • the present application provides a computing device comprising: a bus; a communication interface connected to the bus; at least one first processor connected to the bus; and at least one memory connected to the bus
  • the bus is connected to and stores program instructions that, when executed by the at least one first processor, cause the at least one first processor to perform any one of the time synchronization methods in the fourth aspect.
  • the present application provides another computing device, the computing device comprising: a bus; a communication interface connected to the bus; at least one second processor connected to the bus; and at least one memory connected to the bus Connected to the bus and stored with program instructions, the program instructions, when executed by the at least one second processor, cause the at least one second processor to perform any one of the time synchronization methods in the fifth aspect above.
  • the present application provides a computer-readable storage medium on which program instructions are stored, the program instructions, when executed by a first computer, cause the first computer to execute any one of the above fourth aspects. synchronization method.
  • the present application provides another computer-readable storage medium having program instructions stored thereon, the program instructions, when executed by a second computer, cause the second computer to execute any one of the fifth aspects above time synchronization method.
  • sixth to ninth aspects can perform the time synchronization method of the above-mentioned fourth or fifth aspect, it will similarly have the advantages or benefits of the above-mentioned first or second aspect, so for the sixth to ninth aspects The advantages or benefits of this aspect are not repeated here.
  • Fig. 1 schematically shows a time synchronization scheme in the prior art
  • FIG. 2 schematically shows another time synchronization scheme in the prior art
  • FIG. 3 schematically shows an embodiment of the time system of the present application
  • Fig. 4 schematically shows the part of the time system of Fig. 3 that relates to the first clock time
  • Fig. 5 schematically shows the part of the time system of Fig. 3 that relates to the second clock time
  • FIG. 6 schematically shows an implementation scenario of the time system implementation of the present application
  • FIG. 7 schematically shows another implementation scenario of the time system implementation of the present application.
  • FIG. 8 schematically shows an embodiment of the master clock device of the present application
  • FIG. 9 schematically shows an embodiment of the slave clock device of the present application.
  • FIG. 10 schematically shows another embodiment of the time system of the present application.
  • FIG. 11 schematically shows an embodiment of the time synchronization method of the present application
  • Fig. 12 schematically shows an embodiment of synchronizing the first clock time in step S102 shown in Fig. 11;
  • Fig. 13 schematically shows an embodiment of synchronizing the second clock time in step S102 shown in Fig. 11;
  • Figure 14 schematically shows an alternative embodiment to the embodiment of Figure 13;
  • Fig. 15 schematically shows an embodiment of step S104 shown in Fig. 11;
  • Fig. 16 schematically shows an embodiment of step S106 shown in Fig. 11;
  • Figure 17 schematically illustrates one embodiment of the computing device of the present application.
  • the words “one embodiment” or “an embodiment” mean that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the present invention.
  • the appearances of the terms “in one embodiment” or “in an embodiment” in various places in this specification are not necessarily all referring to the same embodiment, but may refer to the same embodiment.
  • the particular features, structures or characteristics can be combined in any suitable manner in one or more embodiments, as would be apparent from this application to one of ordinary skill in the art.
  • the term "satellite signal” used in the description and claims may be a signal transmitted by a satellite in a global satellite navigation system to indicate Coordinated Universal Time (UTC).
  • the satellite signal includes positioning data with a time value and a Pulse Per Second (PPS) signal.
  • PPS Pulse Per Second
  • satellite signals are sent periodically, for example, once per second.
  • the global satellite navigation system referred to in this article can be BeiDou Navigation Satellite System (BDS), Global Positioning System (GPS), GLONASS Satellite Navigation System (Global Navigation Satellite System, GLONASS) , Galileo Satellite Navigation System (Galileo Satellite Navigation System, GALILEO) and so on.
  • positioning data includes, but is not limited to, information indicating a position from a global satellite navigation system or an integrated positioning navigation system.
  • the positioning data may be a signal containing satellite signal time or a system time containing a navigation system (eg, derived from an on-board crystal oscillator of the navigation system).
  • the positioning data may be recommended positioning information, which is generally output by a positioning data generating device (eg, a satellite in a global satellite navigation system) at a frequency of 1 Hz, and includes a system time value of a whole second corresponding to the PPS signal.
  • the recommended positioning information may have a GPRMC format.
  • the words "first positioning data” and "third positioning data” used in the specification and claims may be recommended positioning information.
  • the positioning data can also be fused positioning data, which is generally output by a positioning data generating device (such as a combined positioning sensor) at a frequency of 100 Hz.
  • the fused positioning data may include device system time value, latitude and longitude information, altitude information, information on each component of velocity, azimuth angle information, pitch angle information, roll angle information, and the like.
  • the terms "second positioning data” and “fourth positioning data” used in the specification and claims may include fused positioning data and recommended positioning information.
  • the phrase "the pulse-per-second signal and the positioning data correspond to each other” is a pair of the pulse-per-second signal and the positioning data that are transmitted at the same time. Since the receiving device receives the second pulse signal and positioning data with huge differences in data volume through different methods (such as different serial ports, etc.), the receiving device first receives the second pulse signal, and then receives the positioning data after a period of time.
  • the positioning data corresponding to the second pulse signal referred to in the present application may be positioning data received within a period of time after the second pulse signal is received. This period of time can be 500 milliseconds, generally no more than 1 second. In practice, it may happen that the receiving device receives the second pulse signal but does not receive the corresponding positioning data. Therefore, it can be specified that the positioning data received beyond this period of time does not correspond to the previously received pulse-per-second signal.
  • system time used in the specification, also referred to as clock time in this application, is time information used by artificial intelligence equipment and devices for intelligent control.
  • the clock time involved in the present application is, for example, the first master and slave clock time and the second master and slave clock time.
  • a time synchronization scheme implemented in artificial intelligence devices such as smart cars is: when the GNSS module in the car receives the GNSS signal to obtain the UTC, the vehicle system time is synchronized based on the UTC; when the GNSS signal cannot be obtained, the vehicle system time is synchronized; Then, the vehicle system time is maintained according to the local crystal oscillator until the GNSS signal can be received again and the system time is directly synchronized.
  • Figure 1 schematically illustrates such a time synchronization scheme.
  • the timing accuracy of the internal clock is limited, resulting in a large time difference between the timing of the internal clock of the system and the coordinated universal time in the satellite signal when the satellite signal is not received for a long time.
  • directly synchronizing the system time with the time in the satellite signal will cause the system time to jump and affect the stability of the intelligent control.
  • the accuracy of the internal clock in a smart car is 50 parts per million (ppm).
  • the smart car stops in the underground parking lot its internal GNSS receiving module cannot obtain satellite signals, but can only use the internal clock as the system time.
  • the accuracy of the time of the intelligent control system in the smart car has a significant impact on the network elements of the intelligent control. For example, if the time difference between the system time and the satellite signal time exceeds the sensor frame rate, the intelligent control system directly considers the sensor frame loss, false alarm or abnormal function.
  • the frame rate of the camera sensor is 33ms per frame
  • the frame rate of the laser radar (Lidar) sensor is 50ms per frame.
  • the camera is fused with the lidar frame within a certain time; if the time difference between the system time and the satellite signal time exceeds a certain time, the intelligent control system cannot select the data, resulting in abnormal fusion function.
  • the intelligent control system performs positioning by calculating/transmitting time and speed, acceleration, and angular velocity. Once the system time jumps, it will lead to abnormal system positioning.
  • the intelligent control system generally performs planning control once every 10ms. If the system time jumps, it will cause abnormal planning control in the next delivery.
  • the time difference generated by its internal clock timing is 180 milliseconds. This error is much larger than the frame rate of the camera and lidar, and is also much larger than the planned control frequency of the intelligent control system. Therefore, when a time jump occurs, the system considers that the two sensors lose frames, and an abnormal planning control will occur.
  • the progressive synchronization can be configured so that the step size of each synchronization is 10ms, and the synchronization frequency is 100ms/time.
  • the synchronization step size should be controlled within a certain range. In this case, if the time difference between the system time and the satellite signal time is very long, in order to reduce the synchronization time, it is necessary to set the synchronization frequency very high, which will bring new challenges to the intelligent system.
  • an embodiment of the present application provides a master clock device including a first clock unit and a second clock unit.
  • the first clock unit is used to provide a monotonically increasing first master clock time based on the received real time clock signal.
  • the second clock unit is configured to provide a second master clock time that follows the real world based on the time included in the positioning data in the satellite signal or the real-time clock signal.
  • FIG. 3 schematically shows a schematic diagram of a time system according to an embodiment of the present application.
  • the time system 1000 shown in FIG. 3 may include a master clock device 200, a plurality of slave clock devices 300, 300', 300", a real-time clock signal source 400 and a satellite signal receiving device 500.
  • the master clock device 200 is connected to the real-time clock signal source respectively.
  • 400 is connected in communication with the satellite signal receiving device 500.
  • the real-time clock signal source 400 is used to provide the real-time clock signal Trtc to the master clock device 200.
  • the satellite signal receiving device 500 is used to include the positioning data in the satellite signal when the satellite signal is received.
  • the time Tgnss in the satellite signal is provided to the master clock device 200.
  • the master clock device 200 provides the first master clock time MT1 based on the real-time clock signal Trtc and provides the first master clock time MT1 based on one of the time Tgnss included in the positioning data in the satellite signal and the real-time clock signal Trtc.
  • Two master clock times MT2, the first master clock time MT1 and the second master clock time MT2 can be provided to the slave clock device for use.
  • the slave clock devices 300, 300 ' are connected in communication with the master clock device 200, and obtain the first master clock device 200 from the master clock device 200.
  • the slave clock device 300 can provide the first slave clock time ST1 and the second slave clock time ST2 accordingly.
  • the slave clock device 300" is communicatively connected to the slave clock device 300, and the slave clock device
  • the first slave clock time ST1 and the second slave clock time ST2 are acquired from the clock device 300 . Due to the use of a specific communication protocol, a particularly precise synchronization between the time of the first master clock and the time of the first slave clock, and a highly precise synchronization between the time of the second master clock and the second slave clock can be achieved. Therefore, the time gap between the master and slave clock times is negligible.
  • the master and slave clock devices in the system thus have a first clock time and a second clock time independent of each other.
  • FIG. 4 shows a schematic diagram of the portion of the time system of FIG. 3 that relates to the first clock time.
  • the master node 200a serving as the master clock device 200 receives the real time clock signal Trtc from the real time clock signal source 400, and generates the first master clock time MT1 based on the real time clock signal Trtc. Since the first master clock time MT1 is based on the real-time clock signal Trtc, the first master clock time MT1 is monotonically increasing without time jump, and is very stable and accurate.
  • the master node 200a thus provides a stable and non-jump first master clock time MT1 to the slave node 300a and the service node 300b serving as the slave clock device 300 .
  • the slave node 300a further provides the stable and non-jump first slave clock time ST1 to another service node 300c as the slave clock device 300 .
  • the master node 200a, the slave node 300a, the service node 300b, and the service node 300c in the time system all have the same stable and non-hopping first clock time MT1, ST1.
  • the system of the present application can avoid many defects caused by time jumps in the prior art by implementing the first clock times MT1 and ST1.
  • the slave node 300a is an automatic driving system
  • the service node 300b is a lidar
  • the service node 300c is a camera
  • these nodes all have the same stable and non-jumping first clock time MT1 and ST1
  • the automatic driving system can detect the lidar in the automatic driving system.
  • FIG. 5 shows a schematic diagram of the portion of the time system of FIG. 3 that relates to the second clock time.
  • the master node 200a serving as the master clock device 200 receives the time Tgnss included in the positioning data in the satellite signal from the satellite signal receiving device 500, and generates the first master clock time MT1 based on the time. Since the second clock time T2 is based on the time Tgnss included in the positioning data in the satellite signal, the second clock time can follow the real world, but the second master clock time MT2 may have time jumps due to the interruption of the satellite signal as described above .
  • the master node 200a thus provides the slave node 300d and the service node 300e serving as the slave clock device 300 with the second master clock time MT2 that follows the real world.
  • the slave node 300d further provides the second slave clock time ST2 following the real world to another service node 300f as the slave clock device 300 .
  • the master node 200a, the slave node 300d, the service node 300e, and the service node 300f in the time system all have second clock times MT2 and ST2 that follow the real time. For some parts of artificial intelligence systems and equipment, they need to follow the time in the real world, and can receive a certain degree of time jump.
  • the slave node 300d is an on-board terminal man-machine interface
  • the service node 300e is a collision sensor
  • the service node 300f is a driving recorder
  • these nodes all have second clock times MT2 and ST2 that follow the real world, the on-board terminal is in use.
  • the human-machine interface retrieves the collision data of the collision sensor and the driving recorder, it can know when the vehicle collision event occurred in the real world.
  • the "dual clock" system of the present application can be applied to various artificial intelligence systems, devices and scenarios, and two typical implementation scenarios are exemplarily given below.
  • FIG. 6 schematically shows a possible implementation scenario of the time system of the present application, a smart car.
  • the master clock device 201 of the smart car A receives the time Tgnss included in the positioning data in the satellite signal Xgnss from the satellite receiving device 501 and the real-time clock signal Trtc from the real-time clock signal source 401 and provides the first master clock time MT1 through the CAN bus and the second master clock time MT2.
  • Each slave clock device 301, 302, 303 of the smart car A receives and uses the first master clock time MT1 and/or the second master clock time MT2.
  • the satellite receiving device 501 and the real-time clock signal source 401 are set in the smart car A in this scenario.
  • the master clock device 201 may be provided, for example, in an electronic control unit (Electronic Control Unit, ECU), a vehicle controller (Vehicle Control Unit, VCU), a telematic control unit (Telematic Control Unit, TCU, and Called T-Box), car diagnostic system (On-Board Diagnostic, OBD) or advanced driver assistance system (Advanced Driving Assistance System, ADAS) and so on.
  • ECU Electronic Control Unit
  • VCU vehicle controller
  • Telematic control unit Telematic Control Unit
  • TCU Telematic Control Unit
  • Called T-Box car diagnostic system
  • OBD On-Board Diagnostic
  • ADAS Advanced Driver Assistance System
  • the slave clock devices 301, 302, 303 may be provided in various devices such as processors, sensors, sensor abstractions, actuators as part of these devices.
  • SOC System on a Chip
  • MCU Micro-controller Unit
  • camera and its data processing nodes LiDAR and its data processing nodes
  • LiDAR and its data processing nodes LiDAR and its data processing nodes
  • millimeter-wave radar and its data Processing node millimeter-wave radar and its data Processing node
  • ultrasonic radar and its data processing node chassis and its data processing node
  • vehicle infotainment system Audio Video Navigation, AVN).
  • the master clock device 201 continues to provide the slave clock device 301 such as provided in the in-vehicle infotainment system, the slave clock device 302 such as lidar, and the slave clock device 303 such as millimeter wave radar.
  • the second master clock time MT2 based on the time Tgnss included in the positioning data in the satellite signal or the real-time clock signal Trtc, and continuously provides the slave clock device 302 such as a lidar and the slave clock device 303 such as a millimeter-wave radar with a real-time-based clock
  • the in-vehicle infotainment system uses the second slave clock time ST2 for displaying the time on the human-machine interface, and the second slave clock time ST2 is synchronized with the second master time T2.
  • Lidar and millimeter wave radar use the first slave clock time ST1, which is synchronized with the first master time T1, to provide sensing data for the control system of the smart car A, eg for navigation and path planning.
  • Lidar and millimeter wave radar use a second slave clock time ST2, which is synchronized with the second master time T2, for logging.
  • the master clock device 201 When the smart car A drives into the long tunnel, the master clock device 201 provides the second master clock time MT2 based on the real-time clock signal Trtc because the master clock device 201 does not receive the satellite signal Xgnss. At this time, the second master clock time MT2 jumps due to the interruption of the satellite signal, usually at the millisecond level. The second slave clock time ST2 therefore also jumps in milliseconds. However, such millisecond-level clock jumps usually have no effect on the time displayed by the HMI in the in-vehicle infotainment system, and it is also acceptable for lidar and millimeter-wave radar logging. At the same time, since lidar and millimeter-wave radar use the jump-free first slave clock time ST1 to provide sensing data, navigation and path planning are not affected by the interruption of satellite signals.
  • Fig. 7 schematically shows another possible implementation scenario of the time system of the present application, the robot system B.
  • the master clock device 202 provided in the robot B1 receives the time Tgnss included in the positioning data in the satellite signal Xgnss from the satellite receiving device 502 and the real-time clock signal Trtc from the real-time clock signal source 402, and provides the first master clock through the signal line.
  • the respective slave clock devices 304, 305, 306 provided in the respective robots B2, B3, B4 receive the first master clock time MT2 and the second master clock time MT2.
  • the satellite receiving device 502 and the real-time clock signal source 402 are set in a device outside the robot B1, such as a human-computer interaction device, a general controller of the robot system, and the like.
  • the master clock device 202 may be provided, for example, in the robot control unit of the B1 robot.
  • the slave clock devices 304, 305, 306 may, for example, be provided in various devices such as processors, sensors, sensor abstractions, actuators, etc., as part of these devices.
  • SOC System on a Chip
  • MCU Micro-controller Unit
  • tactile sensor and its data processing node vision sensor and its data processing node
  • proximity sensor and its Data processing node proximity sensor and its Data processing node
  • auditory sensor and its data processing node force sensor and its data processing node.
  • the master clock device 202 of the robot B1 continues to provide the slave clock devices 304, 305, 306 of the robots B2, B3, and B4, such as cameras, with positioning data based on satellite signals.
  • the included time Tgnss is the second master clock time MT2 and the first master clock time MT1 based on the real time clock signal Trtc.
  • the slave clock devices 304, 305, 306 of the cameras use the first slave clock time ST1, which is synchronized with the first master clock time MT1, to provide the control systems of the robots B1, B2, B3 with sensory data, for example for cooperative operation. route plan.
  • the slave clock devices 304 and 305 for the cameras use the second slave clock time ST2 synchronized with the second master clock time MT2 to record the actual occurrence time of the collision event.
  • FIG. 8 and FIG. 9 optional units of the device are represented by dashed boxes, that is, these optional units may be omitted in other embodiments.
  • FIG. 8 shows the master clock device 200 of FIG. 3 in detail.
  • the master clock device 200 includes a first clock unit 210 , a second clock unit 220 , a time processing unit 230 connected to the first clock unit 210 and the second clock unit 220 , and a time processing unit 230 connected to the first clock unit 210 and the second clock unit 220 .
  • the interface unit 240 to which the second clock unit 220 and the time processing unit 230 are connected.
  • the first clock unit 210 is configured to provide the first master clock time MT1 based on the received real time clock signal Trtc.
  • the first clock unit 210 may directly provide the first master clock time MT1 time to other devices other than the master clock device 200, such as the slave clock device 300, or may provide the first master clock time MT1 to the time processing unit 230 and the interface unit 240.
  • the real-time clock signal Trtc is, for example, a stable and precise single-frequency oscillation from a quartz crystal resonator (referred to as a crystal oscillator).
  • the absolute accuracy of common crystal frequencies can reach 50 parts per million, and some crystal frequencies can be even higher, such as 20 parts per million. Therefore, the first master clock signal T1 based on the real-time clock signal Trtc can also have similar precision and stability.
  • the second clock unit 220 is configured to provide the second master clock time MT2 based on the time Tgnss included in the first positioning data W1 in the satellite signal Xgnss or the real-time clock signal Trtc.
  • the second clock unit 220 When receiving the satellite signal Xgnss, the second clock unit 220 provides the second master clock time MT2 based on the time Tgnss included in the first positioning data W1 in the satellite signal.
  • the second clock unit 220 provides the second master clock time MT2 based on the real-time clock signal Trtc. Since the reference signal used by the second clock unit 220 to provide the second master clock time MT2 may vary, such variation of the reference signal may in turn lead to time jumps.
  • the second master clock time MT2 is allowed to have clock jumps.
  • the second clock unit 220 provides the second master clock time MT2 directly based on the time Tgnss included in the positioning data in the satellite signal.
  • the second clock unit 220 may also provide the second master clock time MT2 based on the first time mt1 of the master clock device determined by the time processing unit 230 according to the satellite signal Xgnss. In this case, it can be considered that the second clock unit 220 provides the second master clock time MT2 indirectly based on the time Tgnss included in the first positioning data W1 in the satellite signal.
  • the time processing unit 230 is configured to determine the first time difference ⁇ T1.
  • the first time difference ⁇ T1 is the time difference between the first time and the second time.
  • the first time is the time when the master clock device 200 receives the first second pulse signal PPS1.
  • the second time is the time when the master clock device 200 receives the first positioning data W1.
  • the first pulse per second signal PPS1 and the first positioning data W1 are contained in the satellite signal Xgnss and correspond to each other.
  • the time processing unit 230 is further configured to determine the first time mt1 of the master clock device based on the time Tgnss included in the first positioning data W1 and the first time difference ⁇ T1.
  • the time processing unit 230 sends the determined first time mt1 to the second clock unit 220, so that the second clock unit 220 can further provide the second master clock time MT2 according to the first time mt1.
  • the second master clock time MT2 is precisely synchronized with the time Tgnss of the satellite signal in this way.
  • the precision of this synchronization can reach 5 nanoseconds. This may be omitted in some other master clock device implementations.
  • the time processing unit 200 is provided with a sensor control center (not shown), and the sensor control center is configured to start counting in nanoseconds when the first second pulse signal PPS1 is received, and then The counting ends when the first positioning data W1 corresponding to the second pulse signal PPS1 is received, and the obtained nanosecond time count is the first time difference ⁇ T1.
  • a counter (not shown) is set in the time processing unit 200 instead of the sensor control center to obtain the first time difference ⁇ T1 with nanosecond precision. This may be omitted in some other master clock device implementations.
  • the time processing unit 200 is configured to record the first master clock time MT1 at this moment at the time of the first pulse-of-second signal PPS1 in the received satellite signal Xgnss, and to receive the first master clock time MT1 with The first positioning data W1 corresponding to the first second pulse signal PPS1 records the first master clock time MT1' at this moment, and then calculates the difference between the first master clock times MT1 and MT1' at two different moments as the first time difference ⁇ T1 . This may be omitted in some other master clock device implementations.
  • the time processing unit 230 is further configured to calculate the second time difference ⁇ T2 as the transmission delay of the second positioning data W2 received by the master clock device 200 .
  • the second time difference ⁇ T2 is the difference between the time T W2 in the second positioning data W2 received by the master clock device 200 and the second master clock time MT2 3 (ie, the second time of the master clock device) provided by the second clock unit 220 at the third moment. time difference between.
  • the third time is the time when the master clock device 200 receives the positioning data W2.
  • This way of determining the transmission delay can also be used to determine the transmission delay of the positioning data of the navigation system (for example, the positioning data W41, W42, . . . , W4x mentioned below) for the purpose of determining the positioning data Validation of time conversion. This may be omitted in some other master clock device implementations.
  • the time processing unit 230 is further configured to record the first master clock time MT1 4 (ie, the third time of the master clock device) provided by the first clock unit 210 at the fourth instant when receiving the pulse signal PPS3 at the third second.
  • the fourth time is the time when the master clock device 200 receives the third second pulse signal PPS3.
  • the time processing unit 230 is also configured to calculate a third time difference ⁇ T3.
  • the third time difference ⁇ T3 is the time difference between the time TW3 in the third positioning data W3 and the recorded first master clock time MT14 .
  • the time processing unit 230 is further configured to convert the time TW4 (ie the fourth time of the master clock device) further received in the fourth positioning data W4 into a fifth time mt5, which is based on the fourth positioning data W4
  • the time TW4 and the third time difference ⁇ T3 are determined.
  • the time-converted positioning data W4 (mt5 ) may be sent out via the interface unit 240 . This may be omitted in some other master clock device implementations.
  • the time TW3 in the third positioning data W3 may be the time based on the time Tgnss included in the positioning data in the satellite signal, or may be based on the time of the device providing the third positioning data W3 itself, such as the plate shape of the sensor. crystal time. Therefore, the conversion of the time TW3 in the third positioning data W3 based on the first master clock time MT14 can be understood as not depending on the time Tgnss included in the positioning data in the satellite signal. Furthermore, it should be understood that the third time difference ⁇ T3 can be used for the time TW41 , TW42 , . convert.
  • Such a time conversion is to synchronize the time in the positioning data related to the data plane nodes, such as those involved in autonomous driving algorithm calculations, motion path planning calculations, etc., with the first master clock time MT1, thereby making the time related in the data plane nodes
  • the data are all using the first master clock time MT1 with high stability and precision.
  • the interface unit 240 is configured to communicate with the slave clock device 300 to provide the slave clock device 300 with a first master clock time MT1 and a second master clock time MT2 for the first master clock time MT2 of the slave clock device 300 according to a known or proprietary protocol.
  • the slave clock time ST1 and/or the second slave clock time ST2 are correspondingly synchronized with the respective clock times of the master clock device 200 . This may be omitted in some other master clock device implementations.
  • the interface unit 240 is further configured to send the first master clock time MT1 to the slave clock device 300 through the generalized precision clock protocol, for use between the first master clock time MT1 and the first slave clock time ST1 of the slave clock device 300 especially precise synchronization.
  • the synchronization deviation that is, the deviation between the first slave clock time ST1 of the slave clock device 300 and the first master clock time MT1 of the master clock device 200 can be made less than 1 microsecond. This may be omitted in some other master clock device implementations.
  • the interface unit 240 is further configured to periodically send a first time synchronization request message Xsyn1 to the slave clock device 300 through the generalized precise clock protocol, for the slave clock device 300 (that is, the first slave clock device of the present application) supporting the generalized precise clock protocol. 300') synchronization with the master clock device 200 in terms of the second clock time MT2, ST2.
  • the first time synchronization request message Xsyn1 includes the first master clock time MT1 5 provided by the first clock unit 210 at the fifth moment (that is, the sixth time of the master clock device, that is, the first time of the slave clock device hereinafter) and the first time at this moment.
  • the second master clock time MT25 provided by the second clock unit 220 (that is, the seventh time of the master clock device, that is, the second time of the slave clock device hereinafter), the fifth time is when the interface unit 240 sends the first time synchronization request message The moment of Xsyn1.
  • the period may be preset or controllable. For example, the period can be preset to 1 second/time. This may be omitted in some other master clock device implementations.
  • the interface unit 240 is further configured to periodically send a second time synchronization request message Xsyn2 to the slave clock device 300, which is used for the slave clock device 300 that does not support the generalized precision clock protocol (ie the second slave clock device 300" in this application) and the slave clock device 300".
  • the synchronization of the master clock device 200 in terms of the second clock time MT2 and ST2.
  • the second time synchronization request message Xsyn2 includes the second master clock time MT2 6 (that is, the eighth time of the master clock device) provided by the second clock unit 220 at the sixth moment. ) and the average message time delay P delay .
  • the sixth time is the time when the interface unit 240 sends the second time synchronization request message Xsyn2.
  • the average message time delay P delay indicates that the message transmission is performed between the master clock device 200 and the slave clock device 300.
  • the period can be preset or can be controlled and adjusted. For example, the period can be preset to 1 second/time. This can be omitted in some other implementations of the master clock device.
  • the interface unit 240 is further configured to receive the second time synchronization response message Xresp2 from the slave clock device 300 .
  • the second time synchronization response message Xresp2 corresponds to the second time synchronization request message Xsyn2, that is, the second time synchronization response message Xresp2 is generated by the clock device 300 in response to the second time synchronization request message Xsyn2.
  • the second time synchronization response message Xresp2 includes the second slave clock time ST2 7 at the seventh time (that is, the ninth time of the master clock device, that is, the seventh time of the slave clock device hereinafter) and the second slave clock at the eighth time.
  • Time ST2 8 (ie, the tenth time of the master clock device, that is, the eighth time of the slave clock device hereinafter).
  • the seventh time is when the slave clock device 300 receives the second time synchronization request message Xsyn2
  • the eighth time is when the slave clock device 300 sends the second time synchronization response message Xresp2. This may be omitted in some other master clock device implementations.
  • the time processing unit 230 is further configured to record the second master clock time MT2 9 (ie, the eleventh time of the master clock device) provided by the second clock unit 220 at the ninth moment.
  • the ninth time is the time when the interface unit 240 receives the second time synchronization response message Xresp2.
  • the time processing unit is further configured to be based on the second master clock time MT2 6 at the sixth time, the second slave clock time ST2 7 at the seventh time, the second slave clock time ST2 8 at the eighth time, and the first time at the ninth time.
  • the master clock time MT2 9 is used to calculate the average delay P delay of the message.
  • the time processing unit 230 is further configured to receive the first time synchronization response message Xresp1 via the interface unit 240 and record the first master clock time MT1 resp1 and the second master clock time MT2 resp1 at this time, for monitoring the first clock time MT1, ST1 synchronization between.
  • FIG. 9 schematically shows a schematic diagram of the slave clock device 300 in FIG. 3, which includes a first clock unit 310 providing a first slave clock time ST1, a second clock unit 320 providing a second slave clock time ST2, a time Processing unit 330 and interface unit 340 .
  • the interface unit 340 is configured to communicate with the master clock device 200 and receive the first master clock time MT1 and the second master clock time MT2 from the master clock device 200 .
  • the time processing unit 330 is configured to communicate via the interface unit 340 to make the first slave clock time ST1 of the first clock unit 310 of the slave clock device 300 and the second slave clock time ST2 of the second clock unit 320 communicate with the time of the master clock device 200 . Corresponding to the master clock time synchronization.
  • the slave clock device 300 covers the time processing unit 230 and other optional features, the first slave clock device 300 ′ that supports the generalized precise clock protocol and the first slave clock device 300 ′ that does not support the generalized precise clock protocol can be further understood with reference to FIG. 9 and the following related descriptions.
  • the second slave clock device 300 The second slave clock device 300.
  • the interface unit 340 is further configured to receive the first master clock time MT1 from the master clock device 200 through a generalized fine clock protocol.
  • the first clock unit 310 is further configured to provide the first slave clock time ST1 according to the first master clock time MT1 received by the interface unit 340 according to the interface unit. This achieves precise synchronization of the first slave clock time ST1 of the first clock unit 310 of the slave clock device 300 with the first master clock time MT1 of the master clock device 200 .
  • the first clock times MT1, ST1 involved here are based on the real-time clock signal Trtc. This can be omitted in some other implementations of the slave clock device, especially in the implementation of the slave clock device that does not support the generalized precise clock protocol.
  • the interface unit 340 is further configured to receive the first time synchronization request message Xsyn1 from the master clock device 200 .
  • the first time synchronization request message Xsyn1 includes the first master clock time MT1 5 provided by the first clock unit 210 when the interface unit 340 sends the first time synchronization request message Xsyn1 (that is, the first time of the slave clock device, that is, the above master clock time MT1 5 ). the sixth time of the clock device) and the second master clock time MT2 5 provided by the second clock unit 220 (ie the second time of the slave clock device, that is, the seventh time of the master clock device above).
  • the second master clock time MT2 5 is based on one of the time Tgnss included in the positioning data in the satellite signal Xgnss and the real-time clock signal Trtc. This can be omitted in some other implementations of the slave clock device, especially in the implementation of the slave clock device that does not support the generalized precise clock protocol.
  • a time processing unit 330 connected to the interface unit 340 is provided.
  • the time processing unit is configured to record the first slave clock time ST12 (ie, the third time of the slave clock device) provided by the first clock unit 310 when the interface unit 340 receives the first time synchronization request message Xsyn1.
  • the time processing unit is further configured to calculate the fourth time difference ⁇ T4 (ie the first time difference of the slave clock device) between the first master clock time MT1 5 and the second master clock time MT2 5 included in the first time synchronization request message Xsyn1.
  • the time processing unit 330 then calculates the fourth time st4 of the slave clock device such that the fourth time st4 is the sum of the first slave clock time ST1 2 and the fourth time difference ⁇ T4.
  • the interface unit 340 is further configured to send a first time synchronization response message Xresp1 to the master clock device 200 for verifying the synchronization of the second slave clock time ST2 and the second master clock time MT2 of the slave clock device 300 .
  • the first time synchronization response message Xresp1 includes the second slave clock time ST2 syn12 when the slave clock device 300 receives the first time synchronization request message Xsyn1 and the first time when the slave clock device 300 sends the second time synchronization response message Xresp1.
  • Two slave clock time ST2 resp1 This may be omitted in some other slave clock device implementations.
  • the interface unit 340 is further configured to receive the second time synchronization request message Xsyn2 from the master clock device 200 .
  • the second time synchronization request message Xsyn2 includes the second master clock time MT2 6 provided by the second clock unit 220 when the interface unit 340 sends the second time synchronization request message Xsyn2 (that is, the fifth time of the slave clock device, that is, the above master clock time MT2 6 ). the eighth time of the clock device) and the average message delay P delay .
  • the second master clock time MT2 6 is based on the time Tgnss included in the positioning data in the satellite signal Xgnss or the real-time clock signal Trtc.
  • the average message delay P delay indicates the average time required for message transmission between the master clock device 200 and the slave clock device 300 . This can be omitted in some other implementations of the slave clock device, especially in the implementation of the slave clock device supporting the generalized precision clock protocol.
  • the time processing unit 330 is further configured to calculate the sixth time st6 of the slave clock device based on the second master clock time MT2 6 and the average message delay P delay , so that the sixth time st6 is the second master clock time MT2 6 and the average message time The sum of delay P delay .
  • the second clock unit 320 is further configured to provide the second slave clock time ST2 based on the sixth time st6.
  • the interface unit 340 is further configured to send the second time synchronization response message Xresp2 to the master clock device 200 .
  • the second time synchronization response message Xresp2 corresponds to the second time synchronization request message Xsyn2, that is, the second time synchronization response message Xresp2 is generated by the clock device 300 in response to the second time synchronization request message Xsyn2.
  • the second time synchronization response message Xresp2 includes the second slave clock time ST2 7 when the slave clock device 300 receives the second time synchronization request message Xsyn2 (that is, the seventh time of the slave clock device, that is, the above-mentioned master clock device’s seventh time ninth time) and the second slave clock time ST2 8 at this moment (ie, the eighth time of the slave clock device, that is, the tenth time of the master clock device above).
  • This can be omitted in some other implementations of the slave clock device, especially in the implementation of the slave clock device supporting the generalized precision clock protocol.
  • FIG. 10 schematically shows a schematic diagram of a time system according to an embodiment of the present application.
  • the time system 1100 shown in FIG. 10 does not have the slave clock device 300 .
  • Other structures in the time system 1100 are the same as those of the time system 1000 shown in FIG. 3 . Referring to the relevant description of the time system 1000 shown in FIG. 3 , details are not repeated here. Since the system embodiment has no slave clock device 300, in practice the system embodiment is more likely to be configured in an integrated form, for example, formed in a time providing device or device.
  • time system 1100 may also include slave clock device 300 .
  • the time synchronization method of an embodiment of the present application includes the following steps S101 to S107.
  • step S101 the master clock device 200 initializes the first clock unit 210 and the second clock unit 220 .
  • initializing the first clock unit 210 and the second clock unit 220 is to enable the first clock unit 210 and the second clock unit 220 to provide the first master clock time MT1 and the second master clock time MT2 based on the real-time clock signal Trtc.
  • step S102 the master clock device 200 and the slave clock device 300 periodically synchronize the first clock time MT1, ST1 and the second clock time MT2, ST2.
  • the period may be preset, and may also be adjusted according to the situation in the repeated synchronization process.
  • An example of a period is 1 second/time.
  • step S103 the master clock device 200 judges whether the third second pulse signal PPS3 and the third positioning data W3 are received. If received, go to step S104, if not, go to step S107.
  • step S104 the master clock device 200 converts the time TW4 in the fourth positioning data W4 based on the first master clock time MT1 using the received pulse-per-second signal PPS3.
  • step S105 the master clock device 200 determines whether the satellite signal receiving device 500 has successfully searched for satellites. If successful, go to step S106, if unsuccessful, go to step S107.
  • step S106 the master clock device 200 receives the satellite signal Xgnss sent by the satellite signal receiving device 500 and obtains the time Tgnss included in the positioning data therein, and performs synchronization of the second master clock time MT2 with the time Tgnss of the satellite signal.
  • step S107 the master clock device 200 judges whether to shut down. If it is turned off, go to step S108, if not, go back to step S102.
  • step S108 after the master clock device 200 saves the current second master clock time MT2, the process ends.
  • the interface unit 240 of the master clock device 200 sends SYNC (Synchronization, synchronization) and Follow_UP (follow) messages to the first slave clock device 300 ′ to realize the respective first clocks in the master clock device 200 and the first slave clock device 300 ′ Time MT1, ST1 frequency synchronization.
  • SYNC Synchronization, synchronization
  • follow_UP follow
  • the interface unit 340 of the slave clock device 300 sends a pDelay_Req (peer-delay request, point delay request) message to the interface unit 240 of the master clock device 200, and then the interface unit 240 sends pDelay_Resp (peer-delay response, point delay response) message and pDelay_Resp_Follow_Up (peer-delay response follow up, point delay response follow up) message to measure the delay time.
  • the delay time generated in the process of synchronizing time with the gPTP protocol can actually reach the microsecond level or even less. Such precise synchronization enables the first clock times MT1 and ST1 to maintain high accuracy after time synchronization between different devices.
  • using the gPTP protocol to synchronize the first clock times MT1 and ST1 can make the difference between the respective first clock times MT1 and ST1 of the master clock device 200 and the first slave clock device 300 ′ in the time system extremely small, or even can be ignored.
  • This step may be omitted in some other implementations of the time synchronization method of the present application, especially in implementations in which the slave clock device does not support the generalized precise clock protocol.
  • Periodic synchronization between the second clock times MT2 and ST2 of the master clock device 200 and the first slave clock device 300 ′ involved in step S102 will be described with reference to FIG. 13 .
  • the second slave clock time ST2 can be provided according to the fourth time difference between the first master clock time MT1 and the second master clock time MT2 of the master clock device 200 .
  • the interface unit 240 of the master clock device 200 sends the first time synchronization request message Xsyn1 to the first slave clock device 300'.
  • the first time synchronization request message Xsyn1 includes the first master clock time MT1 5 provided by the first clock unit 210 when the interface unit 240 sends the first time synchronization request message Xsyn1 (that is, the sixth time of the master clock device, that is, the time of the slave clock device. the first time) and the second master clock time MT2 5 provided by the second clock unit 220 at this moment (that is, the seventh time of the master clock device, that is, the second time of the slave clock device) the interface unit of the first slave clock device 300 ′ 340 receives the first time synchronization request message Xsyn1.
  • the time processing unit 330 records the first slave clock time ST1 2 provided by the first clock unit 310 when the interface unit 340 receives the first time synchronization request message Xsyn1. Calculate the fourth time difference ⁇ T4 between the first master clock time MT15 and the second master clock time MT25 included in the first time synchronization request message Xsyn1 (ie, the first time difference of the slave clock device).
  • the time processing unit 330 calculates the fourth time st4 of the slave clock device, so that the fourth time st4 is the first slave clock time ST12 provided by the first clock unit 310 when the interface unit 340 receives the first time synchronization request message Xsyn1 (ie, from The sum of the third time of the clock device) and the fourth time difference ⁇ T4.
  • synchronization between the second slave clock time ST2 of the second clock unit 320 of the first slave clock device 300 ′ and the second master clock time MT2 of the master clock device 200 is achieved.
  • This step may be omitted in some other implementations of the time synchronization method of the present application, especially in implementations in which the slave clock device does not support the generalized precise clock protocol.
  • FIG. 13 also shows that the first slave clock device 300 ′ sends a first time synchronization response message Xresp1 to the master clock device 200 for verifying the synchronization of the first slave clock device 300 ′.
  • the first time synchronization response message Xresp1 includes the second slave clock time ST2 syn12 when the first slave clock device 300' receives the first time synchronization request message Xsyn1 and the first slave clock device 300' sends the first time synchronization The second slave clock time ST2 resp1 in response to the message Xresp1 .
  • the time processing unit 230 of the master clock device 200 receives the first time synchronization response message Xresp1 via the interface unit 240 and records the first master clock time MT1 resp21 and the second master clock time MT2 resp21 at this time, for monitoring the first clock time MT1 , synchronization between ST1.
  • This part of the step is redundant for the synchronization of the first clock time MT1 and ST1 of the first slave clock device 300 ′ and the master clock device 200 , so it can be omitted in some other implementations of the time synchronization method of the present application .
  • the periodic synchronization between the second clock times MT2 and ST2 of the master clock device 200 and the second slave clock device 300 ′′ involved in step S102 will be described. Since the slave clock device 300 ′′ does not support the generalized precise clock protocol, therefore The second clock times MT2 and ST2 may be synchronized based on the average delay of messages between the master clock device 200 and the second slave clock device 300 ′′. Specifically, the interface unit 240 of the master clock device 200 sends a message to the second slave clock device 300 ′′. The second time synchronization request message Xsyn2.
  • the second time synchronization request message Xsyn2 includes the second master clock time MT2 6 (that is, the eighth time of the master clock device) and the average message delay P provided by the second clock unit 220 when the interface unit 240 sends the second time synchronization request message Xsyn2 delay .
  • the average message delay P delay indicates the time required for message transmission between the master clock device 200 and the slave clock device 300 .
  • the message average delay P delay included therein may be a preset value, such as 0, or may be the master clock device 200 The empirical value stored in advance.
  • the interface unit 340 of the second slave clock device 300" receives the second time synchronization request message Xsyn2.
  • the time processing unit 330 records the second slave clock time ST2 7 provided by the second clock unit 320 when the interface unit 340 receives the second time synchronization request message Xsyn2 (that is, the ninth time of the master clock device, that is, the seventh time of the slave clock device. ).
  • the interface unit 340 then sends the corresponding second time synchronization response message Xresp2 to the master clock device 200 .
  • the second time synchronization response message Xresp2 includes the second slave clock time ST2 7 and the second slave clock time ST2 8 ( That is, the tenth time of the master clock device, that is, the eighth time of the slave clock device).
  • the interface unit 240 of the master clock device 200 receives the second time synchronization response message Xresp2.
  • the time processing unit 230 of the master clock device 200 records the second master clock time MT2 9 (ie, the eleventh time of the master clock device) provided by the second clock unit 220 when the interface unit 240 receives the second time synchronization response message Xresp2.
  • the time processing unit 230 then calculates the message average delay P delay based on the second master clock time MT2 6 , the second slave clock time ST2 7 , the second slave clock time ST2 8 and the second master clock time MT2 9 .
  • the tenth time is the time when the interface unit receives the second time synchronization response message.
  • the average message delay P delay included in the message may be the calculated average message delay, rather than a value such as 0 initially sent.
  • the time processing unit 330 of the second slave clock device 300 ′′ calculates the sixth time st6 of the slave clock device based on the second master clock time MT2 6 and the average message delay P delay , so that the sixth time st6 is the second master clock time MT2 6 and the sum of the message average time delay P delay .
  • the master clock device 200 may determine through the time processing unit 230 whether the third second pulse signal PPS3 and the third positioning data W2 corresponding to the third second pulse signal PPS3 are received.
  • the time processing unit 230 executes step S104.
  • the time processing unit 230 executes step S107. This step may be omitted in some other implementations of the time synchronization method of the present application.
  • Step S104 will be described in detail with reference to FIG. 15.
  • the time processing unit 230 records the first master clock provided by the first clock unit 210 at this moment. Clock time MT1 4 .
  • the time processing unit 230 calculates the time T W3 in the third positioning data W3 and the recorded first The third time difference ⁇ T3 between the master clock times MT1 and 4 .
  • the time processing unit 230 converts the fourth time TW4 in the fourth positioning data W4 into the fifth time mt5 of the master clock device, and the fifth time mt5 of the master clock device.
  • the time mt5 is determined based on the fourth time TW4 and the third time difference ⁇ T3.
  • the time processing unit 230 repeats the above-mentioned conversion process, and the time TW4n in the positioning data W4n is converted into TW4n + ⁇ T3.
  • the third time difference ⁇ T3 can be continuously used to convert the time TW4n in the positioning data into the time mt5 based on the first master clock time MT1.
  • the time-converted positioning data W4n(mt5) may be sent out via the interface unit 240 . This step may be omitted in some other implementations of the time synchronization method of the present application.
  • step S105 the master clock device 200 can determine whether the satellite signal receiving device 500 succeeds in satellite through the time processing unit 230 .
  • the time processing unit 230 executes step S106.
  • the time processing unit 230 executes step S107. This step may be omitted in some other implementations of the time synchronization method of the present application.
  • Step S106 is described in detail with reference to FIG. 16 .
  • the satellite signal receiving device 500 transmits the satellite signal Xgnss to the master clock device 200 .
  • the satellite signal Xgnss has the first second pulse signal PPS1 and the corresponding first positioning data W1.
  • the first positioning data W1 includes the time Tgnss1 of the satellite signal. In other words, the time TW1 in the first positioning data W1 is Tgnss1.
  • the time processing unit 230 of the master clock device 200 starts counting when receiving the first second pulse signal PPS1 and ends when receiving the first positioning data W1, thereby obtaining the first time difference ⁇ T1 between the two receptions.
  • the time processing unit 230 determines the first time mt1 based on the time Tgnss1 in the first positioning data W1 and the first time difference ⁇ T1.
  • the time processing unit 230 sends the determined first time mt1 to the second clock unit 220, so that the second clock unit 220 can provide the second master clock time MT2 according to the first time mt1.
  • the second clock time T2 is precisely synchronized with the time Tgnss1 included in the first positioning data W1 in the satellite signal in this way.
  • the precision of this synchronization can reach 5 nanoseconds. This step may be omitted in some other implementations of the time synchronization method of the present application.
  • step S107 may be omitted.
  • step S108 may be omitted.
  • step S104 involves the master clock device using the first master clock time to convert the time in the positioning data
  • step S106 involves the synchronization of the second clock time in the master clock device with the satellite signal time, the two are independent of each other, so it can be Do both at the same time or swap the order of the two.
  • steps S105 and S106 may be performed after step S101, so that the time of the second clock in the master clock device is precisely synchronized with the satellite signal time, and then step S102 is performed, so that the master clock device can provide accurate time to the slave clock device. the second clock time.
  • the step of calculating the transmission delay of the second positioning data W2 based on the second master clock time MT2 is not included in the time synchronization method embodiment shown in FIG. 9 .
  • the step of calculating the positioning data transmission delay may be performed after step S106.
  • the time processing unit 230 of the master clock device 200 calculates the second time difference between the time T W2 in the received positioning data W2 and the second master clock time MT2 3 provided by the second clock unit 220 at the third moment in time ⁇ T2 is the transmission delay of the positioning data W2.
  • the way of determining the transmission delay in this way can also be used for the transmission delay of the positioning data of the navigation system (for example, the positioning data W41, W42, . Transformations are validated and monitored.
  • the computing device 1500 includes: a processor 1510 , a memory 1520 , a communication interface 1530 , and a bus 1540 .
  • the communication interface 1530 in the computing device 1500 shown in FIG. 17 may be used to communicate with other devices.
  • the processor 1510 can be connected with the memory 1520 .
  • the memory 1520 may be used to store the program codes and data. Therefore, the memory 1520 may be a storage unit inside the processor 1510 , or an external storage unit independent from the processor 1510 , or may include a storage unit inside the processor 1510 and an external storage unit independent from the processor 1510 . part.
  • computing device 1500 may also include bus 1540 .
  • the memory 1520 and the communication interface 1530 may be connected to the processor 1510 through the bus 1540 .
  • the bus 1540 may be a peripheral component interconnect standard (Peripheral Component Interconnect, PCI) bus or an Extended Industry Standard Architecture (Extended Industry Standard Architecture, EISA) bus or the like.
  • PCI peripheral component interconnect standard
  • EISA Extended Industry Standard Architecture
  • the bus 1540 can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one line is shown in FIG. 17, but it does not mean that there is only one bus or one type of bus.
  • the processor 1510 may adopt a central control unit (central processing unit, CPU).
  • the processor may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), or other Programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • DSPs digital signal processors
  • ASICs application specific integrated circuits
  • FPGAs field programmable gate arrays
  • a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • the processor 1510 uses one or more integrated circuits to execute related programs to implement the technical solutions provided by the embodiments of the present application.
  • the memory 1520 may include read only memory and random access memory and provides instructions and data to the processor 1510 .
  • a portion of the processor 1510 may also include non-volatile random access memory.
  • the processor 1510 may also store device type information.
  • the processor 1510 executes the computer-executed instructions in the memory 1520 to execute the operation steps of any one of the above-mentioned time synchronization methods executed by the master clock device or the slave clock device.
  • the time synchronization method performed by the master clock device may be understood as any method in the fourth aspect performed by the master clock device.
  • the time synchronization method performed by the slave clock device may be understood as any one of the methods of the fifth aspect performed by the slave clock device.
  • the computing device 1500 may correspond to corresponding subjects in executing the methods according to the various embodiments of the present application, and the above-mentioned and other operations and/or functions of the various modules in the computing device 1500 are respectively for realizing the present invention.
  • the corresponding processes of each method in the implementation manner are not repeated here.
  • the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, for example, the time processing unit and the interface unit may be integrated in the On one chip, or may be distributed to multiple network units, some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this implementation manner.
  • each functional unit in each embodiment of the present application may be integrated into one control unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the functions, if implemented in the form of software functional units and sold or used as independent products, may be stored in a computer-readable storage medium.
  • the technical solution of the present application can be embodied in the form of a software product in essence, or the part that contributes to the prior art or the part of the technical solution.
  • the computer software product is stored in a storage medium, including Several instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program codes .
  • Embodiments of the present application further provide a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, executes the time synchronization method performed by the master clock device or the slave clock device involved in the present application.
  • the time synchronization method performed by the master clock device may be understood as any method in the fourth aspect performed by the master clock device.
  • the time synchronization method performed by the slave clock device may be understood as any one of the methods of the fifth aspect performed by the slave clock device.
  • the computer-readable storage medium stores any method including the fourth aspect and any method in the fifth aspect, wherein any one of the methods in the fourth aspect is performed by the first processor, and the fifth aspect Any one of the methods is performed by the second processor.
  • the computer storage medium of the embodiments of the present application may adopt any combination of one or more computer-readable mediums.
  • the computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium.
  • Computer-readable media may include computer storage media (or non-transitory media) and signal media (or transitory media).
  • the computer readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or any combination of the above.
  • Computer-readable storage media include, but are not limited to, electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable Programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, cloud, or otherwise used to store desired information and can be accessed by a computer any medium.
  • a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
  • a computer-readable signal medium may include a propagated data signal in baseband or as part of a carrier wave, with computer-readable program code embodied thereon. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • a computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device .
  • Program code embodied on a computer readable medium may be transmitted using any suitable medium including, but not limited to, wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
  • Computer program code for performing the operations of the present application may be written in one or more programming languages, including object-oriented programming languages—such as Java, Smalltalk, C++, but also conventional Procedural programming language - such as the "C" language or similar programming language.
  • the program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server.
  • the remote computer may be connected to the user's computer through any kind of network, including a local area network (LAN) or wide area network (WAN), or may be connected to an external computer (eg, through the Internet using an Internet service provider) connect).
  • LAN local area network
  • WAN wide area network
  • Internet service provider an external computer

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Radar, Positioning & Navigation (AREA)
  • Remote Sensing (AREA)
  • Astronomy & Astrophysics (AREA)
  • Aviation & Aerospace Engineering (AREA)
  • Synchronisation In Digital Transmission Systems (AREA)
  • Electric Clocks (AREA)
  • Position Fixing By Use Of Radio Waves (AREA)

Abstract

本申请属于人工智能领域,具体涉及一种主时钟装置、从时钟装置和时间同步方法。本申请提供的主时钟装置用于为从时钟装置提供时钟时间,包括:用于基于实时时钟信号提供第一主时钟时间的第一时钟单元;以及第二时钟单元,用于基于所述卫星信号中的第一定位数据所包括的时间或基于所述实时时钟信号提供所述第二主时钟时间。本申请还提供主时钟装置与卫星时间的精确同步方法以及主时钟装置与各种从时钟装置的时间同步方法。本申请提供的方案能够消除时间跳变对应用系统的对时间敏感的部分产生的负面影响,同时保证应用系统中具有跟随真实世界的时间,尤其适用于智能汽车的自动驾驶和机器人系统的自动操作等应用。

Description

主时钟装置、从时钟装置和时间同步方法 技术领域
本申请属于人工智能领域,具体涉及一种主时钟装置、从时钟装置和时间同步方法。
背景技术
随着人工智能技术的发展,越来越多的人工智能设备得以实现,例如智能汽车、智能无人机、机器人、智能船舶等。智能控制是人工智能技术中的关键,而时间同步的精度对于智能控制是至关重要的。
例如,智能控制中传感器时间、传感器数据融合、定位精度补偿、路径规划决策等都强依赖于系统时间。因此,智能控制中的这些部分对时间精度有更高的要求。
当前,通过接收全球卫星导航系统(Global Navigation Satellite System,GNSS)信号得到跟随真实世界的时间来作为人工智能设备的系统时间。在有卫星信号的场景中,通常以1次/秒的频率根据卫星信号中的时间同步人工智能设备的系统时间。然而,当人工智能设备处于一些例如室内、地下或隧道等遮挡场景时,无法接收卫星信号或卫星信号接收不佳,从而无法根据卫星信号中的时间同步系统时间。这时,使用内部时钟计时作为人工智能设备的系统时间,直到再次能够接收到卫星信号后同步系统时间。
然而,这种时钟的切换往往会导致系统时间跳变的问题。这样的时间跳变会对人工智能设备的稳定性造成严重影响,例如发生各项传感器丢帧、融合数据无法匹配、定位精度不准等问题,甚至导致人工智能设备运行异常或发生故障。
发明内容
鉴于上述问题,本申请提供主时钟装置、从时钟装置和时间同步方法,其能够消除时间跳变对应用系统的对时间敏感的部分产生的负面影响,同时保证应用系统中具有跟随真实世界的时间。
第一方面,本申请提供一种主时钟装置,包括:第一时钟单元,用于基于实时时钟信号提供第一主时钟时间;以及第二时钟单元,用于在所述主时钟装置接收到卫星信号时,基于所接收的卫星信号中的第一定位数据所包括的时间来提供第二主时钟时间,以及,在所述主时钟装置没有接收到卫星信号时,基于所述实时时钟信号提供所述第二主时钟时间。
其中,卫星信号中的时间包括但不限于世界协调时(Coordinated Universal Time,UTC)。
通过设置两个时钟单元,即设置双时钟,主时钟装置可以向系统、装置中对时间敏感度不同的各部分提供不同的时钟时间。例如向对时间敏感的数据面节点提 供单调递增的第一主时钟时间,向对时间不太敏感的,即允许时钟跳变的管理面节点提供跟随现实世界的协调世界时的第二主时钟时间。数据面节点例如是涉及自动驾驶算法计算、运动路径规划计算等的节点,如微程序控制器(Microprogrammed Control Unit,MCU)、激光雷达等。管理面节点例如是不涉及自动驾驶算法计算、运动路径规划计算等的其他节点,如维测、日志等。这种互相独立的双时钟配置,既为应用装置、系统中对时间敏感的部分提供了没有时间跳变的稳定性极高的时间,又为应用装置、系统中的其他部分提供了跟随现实世界的时间,为这两种部分的本来矛盾的需求提供了简单而灵活的解决方案。此外,通过如上配置第二时钟单元,能够在没有接收到所述卫星信号时基于所述实时时钟信号提供所述第二主时钟时间,从而使得第二主时钟时间在任何情况下都是可用的,并且使得第二主时钟时间在可能的情况下提供跟随现实时间的协调世界时。
结合第一方面,在一种可能的实现方式中,所述主时钟装置还包括:时间处理单元,与所述第二时钟单元连接,用于:确定第一时间差,其中,所述第一时间差是第一时刻和第二时刻之间的时间差,所述第一时刻是所述主时钟装置接收到第一秒脉冲信号的时刻,所述第二时刻是所述主时钟装置接收到所述第一定位数据的时刻,所述第一秒脉冲信号和所述第一定位数据包含于所接收的卫星信号中并彼此对应;以及,基于所述第一定位数据包括的时间和所述第一时间差,确定第一时间。所述主时钟装置的所述第二时钟单元进一步用于基于所述第一时间提供所述第二主时钟时间。
定位数据一般通过控制器局域网络(Controller Area Network,CAN)或者通过例如为通用异步收发传输器(Universal Asynchronous Receiver,UART)的串口传输,在主时钟装置收到定位数据时一般有延时。秒脉冲信号一般通过通用型输入输出(General-Purpose Input/Output,GPIO)接口传输,在主时钟装置收到秒脉冲信号时时延在纳秒级,几乎可以忽略不计。因此,对于定位数据产生装置(例如卫星)在同一时刻发送秒脉冲信号和定位数据,接收装置在接收二者时具有时间差。通过设置时间处理单元,确定主时钟装置在接收第一秒脉冲信号和在接收到与第一秒脉冲信号相对应的第一定位数据之间的第一时间差,可以得到第一定位数据传输到主时钟装置的延时。并且基于该定位数据中的时间和第一时间差,确定第一时间,然后所述第二时钟单元进一步基于该第一时间提供第二主时钟时间。通过这种方式消减了定位数据传输延时的负面影响,实现了所述第二主时钟时间与卫星信号中定位数据所包括的时间的尤其精确的同步。由于依赖秒脉冲信号的超低延时的传输,这样的同步精度在实际中可以至少达到微秒级而且没有累积误差。
其中,确定第一时间差的一种可能的实现方式是在时间处理单元中设置传感器控制中心(Senor Hub),并将传感器控制中心配置为在接收到秒脉冲信号时开始以纳秒计数,在接收到与该秒脉冲信号相对应的定位数据时结束所述计数,由此得到的纳秒级时间计数即为第一时间差。另一种可能实现方式是在时间处理单元中设置替代于传感器控制中心的计数器,以得到纳秒级精度的第一时间差。
确定第一时间差的另一种可能实现方式是将时间处理单元配置为在接收到的卫星信号中的第一秒脉冲信号时记录此刻的第一主时钟时间,并且在接收到与所述第一秒脉冲信号对应的第一定位数据时记录此刻的第一主时钟时间,然后计算两个 不同时刻的第一主时钟时间的差异作为第一时间差。
结合第一方面,在一种可能的实现方式中,所述时间处理单元进一步用于计算第二时间差,作为所述主时钟装置接收到的第二定位数据的传输时延。其中,所述第二时间差是所述第二定位数据包括的时间和第二时间之间的时间差,所述第二时间是在第三时刻处所述第二时钟单元提供的所述第二主时钟时间,所述第三时刻是所述主时钟装置接收到所述第二定位数据的时刻。
可以在精确同步第二主时钟时间后,计算接收到的第二定位数据中的时间和在接收到所述第二定位数据时的所述第二主时钟时间的之间的第二时间差,并将该第二时间差作为该定位数据的传输时延。所述传输时延可以用于导航系统的第二定位数据的时间转换的验证,监控第二定位数据的时间转换异常。这里,第二定位数据可以是主时钟装置接收到的除了第一定位数据以外的任何定位数据。
结合第一方面,在一种可能的实现方式中,所述主时钟装置还包括时间处理单元,与所述第一时钟单元连接,用于:记录第三时间,所述第三时间是在第四时刻处所述第一时钟单元提供的第一主时钟时间,所述第四时刻是所述主时钟装置接收到第三秒脉冲信号的时刻;计算第三时间差,所述第三时间差是所述主时钟装置接收到的第三定位数据所包括的时间与所述第三时间之间的时间差,所述第三定位数据与所述第三秒脉冲信号彼此对应;以及,将第四定位数据包括的第四时间转换为第五时间,所述第四定位数据是所述主时钟装置在所述第三定位数据之后接收到的定位数据,所述第五时间是基于所述第四时间和所述第三时间差确定的。
定位数据一般经由CAN或串口传输至主时钟装置,这可能导致传输时间波动和传输延时的问题。通过时间处理单元记录主时钟装置在接收到所述第三秒脉冲信号时的第一主时钟时间,并计算所述第三定位数据中的时间与所记录的时钟时间之间的第三时间差来作为基准时间差。当时间处理单元在此之后进一步接收到第二定位数据时,利用第三时间差将第二定位数据中的第二时间转换为第三时间,从而使得第二定位数据中的第二时间与主时钟装置的第一时间同步。通过这种方式,使得时间转换后的定位数据能直接应用于系统对时间敏感的部分,而不会造成由于时间不一致或跳变而产生的各种问题,尤其是数据融合、路径规划方面的问题。此外,第三时间差的计算独立于定位数据接收时刻的时间,消减了定位数据经由CAN或串口传输而导致的传输时间波动和传输时延的问题。第三时间差可以持续用于第二定位数据的时间的精确转换。
结合第一方面,在一种可能的实现方式中,所述主时钟装置还包括:接口单元,与所述第一时钟单元和所述第二时钟单元连接,用于向从时钟装置提供第一主时钟时间和第二主时钟时间。
通过设置接口单元,来向所述从时钟装置传提供第一主时钟时间和第二主时钟时间,以用于实现所述从时钟装置的从时钟时间与所述第一主时钟装置的主时钟时间的同步。
结合第一方面,在一种可能的实现方式中,所述接口单元进一步用于通过广义精准时钟协议,向所述从时钟装置发送所述第一主时钟时间。
主时钟装置通过接口单元基于广义精准时钟协议(Generalized Precision  Time Protocol,gPTP,又称IEEE 802.1AS)向从时钟装置发送所述第一主时钟时间,以用于从时钟装置将第一从时钟时间同步为第一主时钟的时间。这样可以保证第一主时钟时间和第一从时钟时间之间的尤其精确的同步。同步偏差可以小于1微秒。
结合第一方面,在一种可能的实现方式中,所述接口单元进一步用于通过所述广义精准时钟协议周期性地向所述从时钟装置发送第一时间同步请求消息。其中,所述第一时间同步请求消息包括第六时间和第七时间,所述第六时间是在第五时刻处所述第一时钟单元提供的所述第一主时钟时间,所述第七时间是在所述第五时刻处所述第二时钟单元提供的所述第二主时钟时间,所述第五时刻是所述接口单元发送第一时间同步请求消息的时刻。
主时钟装置通过接口单元基于广义精准时钟协议向从时钟装置发送所述第一时间同步请求消息,以用于从时钟装置将第二从时钟时间同步为第二主时钟的时间。由于可以通过广义精准时钟协议实现第一主时钟时间和第一从时钟时间之间的尤其精确的同步,主时钟装置通过向从时钟装置同时发送第一主时钟时间和第二主时钟时间,从时钟装置就可以依据第一主时钟时间,实现第二主时钟时间和第二从时钟时间之间的高精度的同步。
结合第一方面,在一种可能的实现方式中,所述接口单元进一步用于周期性地向所述从时钟装置发送第二时间同步请求消息。其中,所述第二时间同步请求消息包括第八时间和消息平均时延,所述第八时间是在第六时刻处所述第二时钟单元提供的第二主时钟时间,所述第六时刻是所述接口单元发送所述第二时间同步请求消息的时刻,所述消息平均时延指示在所述主时钟装置与所述从时钟装置之间进行消息传输所需的时间。
其中,在一些实施方式中,所述消息平均时延是预设值。在一些实施方式中,所述消息平均时延是基于例如来自于主时钟装置以外的消息计算而得到。
对于不支持广义精准时钟协议的从时钟装置,无法依据基于该协议实现第一主时钟时间与第一从时钟时间之间的尤其精确同步,从而无法依据第一主时钟时间实现第二主时钟时间和第二从时钟时间之间的高精度的同步。在这种情况下,利用主时钟装置和从时钟装置之间的消息平均时延,实现第二主时钟时间和第二从时钟时间之间的较高精度的同步。
结合第一方面,在一种可能的实现方式中,所述接口单元进一步用于接收第二时间同步响应消息。其中,所述第二时间同步响应消息包括第九时间和第十时间,所述第九时间是在第七时刻处所述从时钟装置的第二从时钟时间,所述第十时间是在第八时刻处所述从时钟装置的第二从时钟时间,所述第七时刻是所述从时钟装置接收到所述第二时间同步请求消息的时刻,所述第八时刻是所述从时钟装置发送所述第二时间同步响应消息的时刻。
结合第一方面,在一种可能的实现方式中,所述主时钟装置还包括时间处理单元,与所述接口单元连接,用于:记录第十一时间,所述第十一时间是在第九时刻处所述第二时钟单元提供的第二主时钟时间,所述第九时刻是所述接口单元接收到所述第二时间同步响应消息的时刻;以及,基于所述第八时间、所述九时间、所述第十时间和所述第十一时间,计算所述消息平均时延。
通过利用来自从时钟装置的第二时间同步响应消息,主时钟装置能够计算得到更加准确的消息平均时延,由此能够实现第二主时钟时间和第二从时钟时间之间的更高精度的同步。
在第一方面和其可能的实现方式中,所述周期可以是预设的,或者是可受控调整的。例如,周期可以预设为1秒/次。
第二方面,本申请提供一种从时钟装置,所述从时钟装置包括:接口单元,用于从主时钟装置接收第一主时钟时间和第二主时钟时间;第一时钟单元,用于提供第一从时钟时间,所述第一从时钟时间与所述第一主时钟时间同步;以及第二时钟单元,用于提供第二从时钟时间,所述第二从时钟时间与所述第二主时钟时间同步;其中,所述第一主时钟时间基于实时时钟信号,在所述主时钟装置接收到卫星信号时,所述第二主时钟时间基于所述卫星信号中的定位数据包括的时间,以及,在所述主时钟装置没有接收到卫星信号时,所述第二主时钟时间基于所述实时时钟信号时间。
通过设置两个时钟单元和接收主时钟装置的第一、第二主时钟时间的接口单元,从时钟装置可以提供与第一主时钟时间同步的第一从时钟时间和与第二主时钟时间同步的第二从时钟时间。由此,例如可以为从时钟装置中对时间敏感的部分提供了没有时间跳变的稳定性极高的第一从时钟时间,并且可以为从时钟装置中对时间不太敏感的部分提供可以跟随现实世界的第二从时钟时间。
结合第二方面,在一种可能的实施方式中,所述接口单元进一步用于通过广义精准时钟协议从所述主时钟装置接收所述第一主时钟时间。
从时钟装置通过接口单元基于广义精准时钟协议从主时钟装置接收所述第一主时钟时间,用于将第一从时钟时间同步为第一主时钟的时间。这样的时间同步的同步偏差小于1微秒。这使得与主时钟装置进行第一主时钟时间同步的各个从时钟装置均具有基本上相同的第一从时钟时间。这里,“基本上相同”可以理解为各个从时钟装置具有的相应第一从时钟时间之间的偏差小于1微秒甚至更小,可以忽略不计。
结合第二方面,在一种可能的实施方式中,所述接口单元进一步用于从所述主时钟装置接收第一时间同步请求消息。其中,所述第一时间同步请求消息包括第一时间和第二时间,所述第一时间和所述第二时间分别是在第一时刻处所述主时钟装置提供的所述第一主时钟时间和所述第二主时钟时间,所述第一时刻是所述主时钟装置发送第一时间同步请求消息的时刻。
结合第二方面,在一种可能的实施方式中,所述从时钟装置还包括时间处理单元,与所述接口单元连接,用于:计算第一时间差,所述第一时间差是所述第一时间和所述第二时间之间的时间差;以及基于所述第一时间差和第三时间来计算第四时间,其中,所述第三时间是在第二时刻处所述第一时钟单元提供的第一从时钟时间,所述第二时刻是所述接口单元接收到所述第一时间同步请求消息的时刻,其中,所述第二时钟单元进一步用于基于所述第四时间,提供所述第二从时钟时间。
从时钟装置通过接口单元基于广义精准时钟协议接收主时钟装置发生的所述第一时间同步请求消息,以用于将第二从时钟时间同步为第二主时钟的时间。由于可以通过广义精准时钟协议实现第一主时钟时间和第一从时钟时间之间的尤其精确的同步,从时钟装置中的第一从时钟时间很精确。基于从主时钟装置接收的、同时 发送的第一主时钟时间和第二主时钟时间来计算从时钟装置的第二从时钟时间,从时钟装置就可以依据其自身的第一从时钟时间提供第二从时钟时间,该第二从时钟时间与第二主时钟时间高精度同步。
结合第二方面,在一种可能的实施方式中,所述接口单元进一步用于从所述主时钟装置接收第二时间同步请求消息。其中,所述第二时间同步请求消息包括第五时间和消息平均时延,所述第五时间是在第三时刻处所述主时钟装置提供的所述第二主时钟时间,所述第三时刻是所述主时钟装置发送所述第二时间同步请求消息的时刻,所述消息平均时延指示在所述主时钟装置与所述从时钟装置之间进行消息传输所需的时间。
结合第二方面,在一种可能的实施方式中,所述从时钟装置还包括时间处理单元,与所述接口单元连接,用于基于所述第五时间和所述消息平均时延,计算第六时间,所述第二时钟单元进一步用于基于所述第六时间,提供所述第二从时钟时间。
在一些实现方式中,所述消息平均时延是预设值。在一些实现方式中,所述消息平均时延是基于例如来自于从时钟装置以外的消息计算而得到。
对于不支持广义精准时钟协议的从时钟装置,无法依据基于该协议实现第一主时钟时间与第一从时钟时间之间的尤其精确同步,从而无法依据第一主时钟时间实现第二主时钟时间和第二从时钟时间之间的高精确的同步。在这种情况下,利用主时钟装置和从时钟装置之间的消息平均时延,实现第二主时钟时间和第二从时钟时间之间的较高精度的同步。
结合第二方面,在一种可能的实施方式中,所述接口单元进一步用于向所述主时钟装置发送第二时间同步响应消息。其中,所述第二时间同步响应消息包括第七时间和第八时间,所述第七时间是在第四时刻处所述第二时间单元提供的所述第二从时钟时间,所述第八时间是在第五时刻处所述第二时间单元提供的所述第二从时钟时间,所述第四时刻是所述接口单元接收到所述第二时间同步请求消息的时刻,所述第五时刻是所述接口单元发送所述第二时间同步响应消息的时刻。
通过发送第二时间同步响应消息来从主时钟装置中得到更加准确的消息平均时延,利用更准确的消息平均时延,从时钟装置能够实现第二主时钟时间和第二从时钟时间之间的更高精确的同步。
第三方面,本申请提供一种时间系统,所述时间系统包括根据上述任一种实施方式的主时钟装置、实时时钟信号源和卫星信号接收装置,实时时钟信号源用于向所述主时钟装置提供实时时钟信号,卫星信号接收装置用于当接收到卫星信号时将所接收的卫星信号提供给所述主时钟装置。
其中,所述实时时钟(Real Time Clock,RTC)时间源包括但不限于石英晶体谐振器。
其中,所述卫星信号接收装置包括但不限于组合定位传感器、卫星信号接收装置、实时动态(Real Time Kinematic,RTK)定位传感器。
结合第三方面,在一种可能的实施方式中,所述时间系统还包括根据上述任一种实施方式的从时钟装置。
上述时间系统由于包括上述主时钟装置和/或上述从时钟装置,因此其优点 或益处可以对应地参照上述主时钟装置和/或上述从时钟装置的优点或益处,在此不再赘述。
第四方面,本申请提供一种时间同步方法,所述时间同步方法包括以下步骤:主时钟装置基于实时时钟信号提供第一主时钟时间;以及所述主时钟装置在接收到卫星信号时,基于所接收的卫星信号中的第一定位数据所包括的时间来提供第二主时钟时间,以及,在没有接收到所述卫星信号时,基于所述实时时钟信号提供所述第二主时钟时间。
结合第四方面,在一种可能的实施方式中,所述基于所接收的卫星信号中的第一定位数据所包括的时间来提供第二主时钟时间包括:所述主时钟装置确定第一时间差,其中,所述第一时间差是第一时刻和第二时刻之间的时间差,所述第一时刻是所述主时钟装置接收到第一秒脉冲信号的时刻,所述第二时刻是所述主时钟装置接收到所述第一定位数据的时刻,所述第一秒脉冲信号和所述第一定位数据包含于所述卫星信号中并彼此对应;所述主时钟装置基于所述第一定位数据包括的时间和所述第一时间差,确定第一时间;以及所述主时钟装置基于所述第一时间,提供所述第二主时钟时间。
结合第四方面,在一种可能的实施方式中,所述时间同步方法还包括以下步骤:所述主时钟装置计算第二时间差,作为所述主时钟装置接收到的第二定位数据的传输时延。其中,所述第二时间差是所述第二定位数据包括的时间和第二时间之间的时间差,所述第二时间是在第三时刻处所述主时钟装置提供的所述第二主时钟时间,所述第三时刻是所述主时钟装置接收到所述第二定位数据的时刻。
结合第四方面,在一种可能的实施方式中,在所述时间同步方法中,所述时间同步方法还包括以下步骤:所述主时钟装置记录第三时间,所述第三时间是在第四时刻处所述主时钟装置提供的第一主时钟时间,所述第四时刻是所述主时钟装置接收到第三秒脉冲信号的时刻;所述主时钟装置计算第三时间差,所述第三时间差是所述主时钟装置接收到的第三定位数据所包括的时间与所述第三时间之间的时间差,所述第三定位数据与所述第三秒脉冲信号彼此对应;以及,所述主时钟装置将第四定位数据包括的第四时间转换为第五时间,所述第四定位数据是所述主时钟装置在所述第三定位数据之后接收到的定位数据,所述第五时间是基于所述第四时间和所述第三时间差确定的。
结合第四方面,在一种可能的实施方式中,所述时间同步方法还包括以下步骤:所述主时钟装置向从时钟装置提供第一主时钟时间和第二主时钟时间。
结合第四方面,在一种可能的实施方式中,在所述时间同步方法中,所述主时钟装置向从时钟装置提供第一主时钟时间和第二主时钟时间包括:所述主时钟装置通过广义精准时钟协议,向所述从时钟装置发送所述第一主时钟时间。
结合第四方面,在一种可能的实施方式中,在所述时间同步方法中,所述主时钟装置向从时钟装置提供第一主时钟时间和第二主时钟时间包括:所述主时钟装置通过所述广义精准时钟协议周期性地向所述从时钟装置发送第一时间同步请求消息。其中,所述第一时间同步请求消息包括第六时间和第七时间,所述第六时间是在第五时刻处所述主时钟装置提供的所述第一主时钟时间,所述第七时间是在所述第五 时刻处所述主时钟装置提供的所述第二主时钟时间,所述第五时刻是所述接口单元发送第一时间同步请求消息的时刻。
结合第四方面,在一种可能的实施方式中,在所述时间同步方法中,所述主时钟装置向从时钟装置提供第一主时钟时间和第二主时钟时间包括:所述主时钟装置周期性地向所述从时钟装置发送第二时间同步请求消息。其中,所述第二时间同步请求消息包括第八时间和消息平均时延,所述第八时间是在第六时刻处所述主时钟装置提供的第二主时钟时间,所述第六时刻是所述主时钟装置发送所述第二时间同步请求消息的时刻,所述消息平均时延指示在所述主时钟装置与所述从时钟装置之间进行消息传输所需的时间。
结合第四方面,在一种可能的实施方式中,在所述时间同步方法中,所述主时钟装置向从时钟装置提供第一主时钟时间和第二主时钟时间包括:所述主时钟装置接收第二时间同步响应消息。其中,所述第二时间同步响应消息包括第九时间和第十时间,所述第九时间是在第七时刻处所述从时钟装置提供的第二从时钟时间,所述第十时间是在第八时刻处所述从时钟装置提供的第二从时钟时间,所述第七时刻是所述从时钟装置接收到所述第二时间同步请求消息的时刻,所述第八时刻是所述从时钟装置发送所述第二时间同步响应消息的时刻。
结合第四方面,在一种可能的实施方式中,在所述时间同步方法中,所述主时钟装置向从时钟装置提供第一主时钟时间和第二主时钟时间包括:所述主时钟装置记录第十一时间,所述第十一时间是在第九时刻处所述主时钟装置提供的第二主时钟时间,所述第九时刻是所述主时钟装置接收到所述第二时间同步响应消息的时刻;以及,所述主时钟装置基于所述第八时间、所述第九时间、所述第十时间和所述第十一时间,计算所述消息平均时延。
第四方面的时间同步方法可以由第一方面的主时钟装置执行。因此涉及第五方面的时间同步方法的优点或益处可以对应地参照上述各主时钟装置的优点或益处,在此不再赘述。
第五方面,本申请提供另一种时间同步方法,所述时间同步方法包括以下步骤:从时钟装置从主时钟装置接收第一主时钟时间和第二主时钟时间;所述从时钟装置提供第一从时钟时间,所述第一从时钟时间与所述第一主时钟时间同步;以及所述从时钟装置提供第二从时钟时间,所述第二从时钟时间与所述第二主时钟时间同步;其中,所述第一主时钟时间基于实时时钟信号,所述第二主时钟时间在所述主时钟装置接收到卫星信号时,基于所述卫星信号中的定位数据所包括的时间,以及,在所述主时钟装置没有接收到所述卫星信号时,基于所述实时时钟信号时间。
结合第五方面,在一种可能的实施方式中,在所述时间同步方法中,所述从时钟装置从主时钟装置接收第一主时钟时间和第二主时钟时间包括:所述从时钟装置通过广义精准时钟协议从所述主时钟装置接收所述第一主时钟时间。
结合第五方面,在一种可能的实施方式中,在所述时间同步方法中,所述从时钟装置从主时钟装置接收第一主时钟时间和第二主时钟时间还包括:所述从时钟装置从所述主时钟装置接收第一时间同步请求消息。其中,所述第一时间同步请求消息包括第一时间和第二时间,所述第一时间和所述第二时间分别是在第一时刻处所述 主时钟装置提供的所述第一主时钟时间和所述第二主时钟时间,所述第一时刻是所述主时钟装置发送第一时间同步请求消息的时刻。
结合第五方面,在一种可能的实施方式中,在所述时间同步方法中,所述从时钟装置提供第二从时钟时间包括:所述从时钟装置计算第一时间差,所述第一时间差是所述第一时间和所述第二时间之间的时间差;所述从时钟装置基于所述第一时间差和第三时间来计算第四时间,其中,所述第三时间是在第二时刻处所述从时钟装置提供的第一从时钟时间,所述第二时刻是所述从时钟装置接收到所述第一时间同步请求消息的时刻;以及所述从时钟装置基于所述第四时间,提供所述第二从时钟时间。
结合第五方面,在一种可能的实施方式中,在所述时间同步方法中,所述从时钟装置从主时钟装置接收第一主时钟时间和第二主时钟时间包括:所述从时钟装置从所述主时钟装置接收第二时间同步请求消息。其中,所述第二时间同步请求消息包括第五时间和消息平均时延,所述第五时间是在第三时刻处所述主时钟装置提供的所述第二主时钟时间,所述第三时刻是所述主时钟装置发送所述第二时间同步请求消息的时刻,所述消息平均时延指示在所述主时钟装置与所述从时钟装置之间进行消息传输所需的时间。
结合第五方面,在一种可能的实施方式中,在所述时间同步方法中,所述从时钟装置使所述从时钟装置的时钟时间与主时钟装置提供的时钟时间同步还包括:所述从时钟装置基于所述第五时间和所述消息平均时延,计算第六时间;以及所述从时钟装置基于所述第六时间,提供所述第二从时钟时间。
结合第五方面,在一种可能的实施方式中,在所述时间同步方法中,还包括:所述从时钟装置向所述主时钟装置发送第二时间同步响应消息。其中,所述第二时间同步响应消息包括第七时间和第八时间,所述第七时间是在第四时刻处所述从时钟装置提供的所述第二从时钟时间,所述第八时间是在第五时刻处所述从时钟装置提供的所述第二从时钟时间,所述第四时刻是所述从时钟装置接收到所述第二时间同步请求消息的时刻,所述第五时刻是所述从时钟装置发送所述第二时间同步响应消息的时刻。
第五方面的时间同步方法可以由主时钟装置从时钟装置第二方面的从时钟装置执行。因此涉及第五方面的时间同步方法的优点或益处可以对应地参照上述主时钟装置各从时钟装置的优点或益处,在此不再赘述。
第六方面,本申请提供一种计算设备,该计算设备包括:总线;通信接口,其与所述总线连接;至少一个第一处理器,其与所述总线连接;以及至少一个存储器,其与所述总线连接并存储有程序指令,所述程序指令当被所述至少一个第一处理器执行时使得所述至少一个第一处理器执行上述第四方面中的任一种时间同步方法。
第七方面,本申请提供另一种计算设备,该计算设备包括:总线;通信接口,其与所述总线连接;至少一个第二处理器,其与所述总线连接;以及至少一个存储器,其与所述总线连接并存储有程序指令,所述程序指令当被所述至少一个第二处理器执行时使得所述至少一个第二处理器执行上述第五方面中的任一种时间同步方法。
第八方面,本申请提供一种计算机可读存储介质,其上存储有程序指令, 所述程序指令当被第一计算机执行时使得所述第一计算机执行上述第四方面中的任一种时间同步方法。
第九方面,本申请提供另一种计算机可读存储介质,其上存储有程序指令,所述程序指令当被第二计算机执行时使得所述第二计算机执行上述第五方面中的任一种时间同步方法。
由于第六方面至第九方面可以执行上述第四或第五方面的时间同步方法,其将类似地具有上述第一方面或第二方面所具有的优点或益处,因此对于第六方面至第九方面的优点或益处在此不再赘述。
本发明的这些和其它方面在以下(多个)实施方式的描述中会更加简明易懂。
附图说明
以下参照附图来进一步说明本发明的各个特征和各个特征之间的联系。附图均为示例性的,一些特征并不以实际比例示出,并且一些附图中可能省略了本申请所涉及领域的惯常的且对于本申请非必要的特征,或是额外示出了对于本申请非必要的特征,附图所示的各个特征的组合并不用以限制本申请。另外,在本说明书全文中,相同的附图标记所指代的内容也是相同的。具体的附图说明如下:
图1示意性地示出了现有技术中的一个时间同步方案;
图2示意性地示出了现有技术中的另一个时间同步方案;
图3示意性地示出了本申请的时间系统一个实施方式;
图4示意性地示出了图3的时间系统涉及第一时钟时间的部分;
图5示意性地示出了图3的时间系统涉及第二时钟时间的部分;
图6示意性地示出了本申请的时间系统实施方式的一个实施场景;
图7示意性地示出了本申请的时间系统实施方式的另一个实施场景;
图8示意性地示出了本申请的主时钟装置的一个实施方式;
图9示意性地示出了本申请的从时钟装置的一个实施方式;
图10示意性地示出了本申请的时间系统的另一个实施方式;
图11示意性地示出了本申请的时间同步方法的一个实施方式;
图12示意性地示出了图11示出的步骤S102中同步第一时钟时间的一个实施方式;
图13示意性地示出了图11示出的步骤S102中同步第二时钟时间的一个实施方式;
图14示意性地示出了图13的实施方式的替代实施方式;
图15示意性地示出了图11示出的步骤S104的一个实施方式;
图16示意性地示出了图11示出的步骤S106的一个实施方式;以及
图17示意性地示出了本申请的计算设备的一个实施方式。
具体实施方式
<定义>
除非另有定义,本文所使用的所有的技术和科学术语与属于本申请的技术领域的技术人员通常理解的含义相同。如有不一致,以本说明书中所说明的含义或者根据本说明书中记载的内容得出的含义为准。另外,本文中所使用的术语只是为了描述本申请实施方式的目的,不是旨在限制本申请。
为了准确地对本申请中的技术内容进行叙述,以及为了准确地理解本发明,在对具体实施方式进行说明之前先对本说明书中所使用的词语和术语给出如下的解释说明或定义。
说明书和权利要求书中的词语“第一、第二、第三等”或模块A、模块B、模块C等类似用语,仅用于区别类似的对象,不代表针对对象的特定排序,可以理解地,在允许的情况下可以互换特定的顺序或先后次序,以使这里描述的本申请实施方式能够以除了在这里图示或描述的以外的顺序实施。
说明书和权利要求书中使用的术语“包括”不应解释为限制于其后列出的内容;它不排除其它的元件或步骤。因此,其应当诠释为指定所提到的所述特征、整体、步骤或部件的存在,但并不排除存在或添加一个或更多其它特征、整体、步骤或部件及其组群。因此,表述“包括装置A和B的设备”不应局限为仅由部件A和B组成的设备。
本说明书中使用的词语“一个实施方式”或“实施方式”意味着与该实施方式结合描述的特定特征、结构或特性包括在本发明的至少一个实施方式中。因此,在本说明书各处出现的用语“在一个实施方式中”或“在实施方式中”并不一定都指同一实施方式,但可以指同一实施方式。此外,在一个或多个实施方式中,能够以任何适当的方式组合各特定特征、结构或特性,如从本申请对本领域的普通技术人员显而易见的那样。
说明书中使用的词语“可选的”、“可选地”、“可选”,指的是其所修饰的特征是在一些实施方式中是可以省略的,但在存在于一些替代实施方式中。
说明书和权利要求书中使用术语的“卫星信号”可以是全球卫星导航系统中的卫星发送的用于指示协调世界时(Coordinated Universal Time,UTC)的信号。例如,该卫星信号包括具有时间值的定位数据和秒脉冲(Pulse Per Second,PPS)信号。在实际应用中,卫星信号周期性发送,例如每秒发送1次。本文所称的全球卫星导航系统,可以是北斗卫星导航系统(BeiDou Navigation Satellite System,BDS)、全球定位系统(Global Positioning System,GPS)、格洛纳斯卫星导航系统(Global Navigation Satellite System,GLONASS)、伽利略卫星导航系统(Galileo Satellite Navigation System,GALILEO)等。
说明书和权利要求书中使用的术语“定位数据”包括但不限于来自全球卫星导航系统或者组合定位导航系统的用于指示位置的信息。定位数据可以是包含有卫星信号时间或包含有导航系统的(例如源自于导航系统的板载晶振)系统时间的信号。定位数据可以是推荐定位信息,一般由定位数据产生装置(例如全球卫星导航系统中的卫星)以1HZ的频率输出,包含与PPS信号对应的整秒的系统时间值。推荐定位信息可以具有GPRMC格式。说明书和权利要求书中使用的词语“第一定位数据”和“第三定位数据”可以是推荐定位信息。定位数据还可以是融合定位数据,一般由定位数 据产生装置(例如组合定位传感器)以100HZ的频率输出。融合定位数据中可以包括装置系统时间值、经纬度信息、海拔高度信息、速度各分量信息、方位角信息、俯仰角信息、横滚角信息等。说明书和权利要求书中使用的词语“第二定位数据”和“第四定位数据”可以包括融合定位数据和推荐定位信息。
说明书和权利要求书中使用的词语“秒脉冲信号与定位数据彼此对应”是同时发送的一对秒脉冲信号和定位数据。由于接收设备通过不同的方式(例如不同的串口等)接收数据量差别巨大的秒脉冲信号和定位数据,接收设备先接收到秒脉冲信,在一段时间后接收到定位数据。在这种情况下,本申请涉及的与秒脉冲信号对应的定位数据可以是在接收到秒脉冲信号之后一段时间内接收到的定位数据。这段时间可以是500毫秒,一般不超过1秒。在实际中,可能出现接收设备接收到秒脉冲信号但没有接收到对应的定位数据的情况。因此,可以规定,超过该段时间接收到的定位数据是与先前接收到的秒脉冲信号不对应。
说明书中使用的术语“系统时间”,在本申请中也称为时钟时间,是人工智能设备、装置进行智能控制使用的时间信息。本申请涉及的时钟时间例如是第一主、从时钟时间和第二主、从时钟时间。
<技术背景>
目前,在例如为智能汽车的人工智能设备中实现的一种时间同步方案是:车中的GNSS模块接收GNSS信号得到协调世界时,基于协调世界时同步车载系统时间;当无法获取GNSS信号时,则根据本地晶振维持车载系统时间,直到再次能够接收到GNSS信号后直接同步系统时间。图1示意性地示出了这种时间同步方案。然而,内部时钟的计时精度有限,导致在长时间接收不到卫星信号的情况下,系统内部时钟计时与卫星信号中的协调世界时之间有较大的时间差。当再次接受到卫星信号时,直接将系统时间与卫星信号中的时间同步会导致系统时间跳变,影响智能控制的稳定性。
例如,智能汽车中内部时钟的精度为50百万分比(part per million,ppm)。智能汽车在地下停车场停留时,其内部的GNSS接收模块无法获取卫星信号,而只能使用内部时钟计时作为系统时间。
若智能汽车在地下停车场停留的时间为10分钟,也就是说丢失卫星信号的时长为10分钟,则内部时钟计时产生的时间差为60*10*50/1000=30毫秒(millisecond,ms);
若智能汽车在地下停车场停留的时间为60分钟,也就是说丢失卫星信号的时长为60分钟,则内部时钟计时产生的时间差为60*60*50/1000=180毫秒;
若智能汽车在地下停车场停留的时间为120分钟,也就是说丢失卫星信号的时长为120分钟,则内部时钟计时产生的时间差为120*60*50/1000=360毫秒。
由上述数据可知,人工智能设备无法获取卫星信号的时间越长,内部时钟计时的产生的时间差越大,在卫星信号恢复时,直接将系统时间与卫星信号中的协调世界时同步的跳变值也将越大。
当前,智能汽车中的智能控制系统时间的精度对智能控制的网元有显著影响。例如,如果系统时间与卫星信号时间的时间差超过传感器帧率,智能控制系统就直接认为传感器丢帧,误触告警或功能异常。通常,摄像头(Camera)传感器的帧率 为33ms一帧,激光雷达(Laser Radar,Lidar)传感器的帧率为50ms一帧。在智能汽车的融合系统中,例如将摄像机与一定时间内的激光雷达帧进行融合;如果系统时间与卫星信号时间的时间差超过一定的时间,智能控制系统则无法选取数据,导致融合功能异常。智能控制系统通过计算/传输时间与速度、加速度、角速度来进行定位,一旦系统时间跳变,将会导致系统定位异常。智能控制系统一般10ms左右进行一次规划控制,如果系统时间跳变,会导致下次下发规划控制异常。
由此,目前在人工智能设备中实现的另一种时间同步方案是:当再次能够接收到卫星信号时,渐进式地,而不是直接的一步到位式地,同步系统时间。通过渐进式地同步,减小每次时间同步的跳变值,来满足智能控制的网元对系统时间精度的要求。图2示意性地示出了这种时间同步方案。
例如,参考上述智能汽车的示例,当该智能汽车因为在地下停车场停留而丢失了60分钟的卫星信号,其内部时钟计时产生的时间差为180毫秒。这个误差远大于摄像头和激光雷达的帧率,也远远大于智能控制系统的规划控制频率,因此在发生时间跳变时,系统为认为这两种传感器丢帧,且会发生规划控制异常。
为此,可以将渐进式同步配置为,每次同步的步长为10ms,同步频率为100ms/次。如此配置使得系统时间与卫星信号时间完全同步的时长则为180/10*100=1800ms,即1.8秒。这样的同步时长甚至超过了卫星信号通常为1秒的同步周期时长。
可以理解的是,为了保证同步步长满足智能控制中对于时间精度的要求,同步步长应当要控制在一定范围内。在这种情况下,如果系统时间与卫星信号时间的时间差很长,为了减小同步时长,就要将同步频率设置得很高,而这将会给智能系统带来新的挑战。
有鉴于此,本申请的一个实施方式提供一种主时钟装置,其包括第一时钟单元和第二时钟单元。第一时钟单元用于基于接收到的实时时钟信号提供单调递增的第一主时钟时间。第二时钟单元用于基于卫星信号中定位数据所包括的时间或实时时钟信号提供跟随真实世界的第二主时钟时间。通过这种主时钟装置,可以为人工智能系统、设备对时间敏感的部分提供稳定无跳变的第一主时钟时间,同时为对时间不太敏感的部分提供跟随真实世界的第二主时钟时间,灵活地满足对时间敏感度不同部分的需求。
<技术构思>
以下结合图3-5进一步说明本申请的“双时钟”构思。
图3示意性地示出了根据本申请的实施方式的时间系统的示意图。图3所示的时间系统1000可以包括主时钟装置200,多个从时钟装置300、300’、300”,实时时钟信号源400和卫星信号接收装置500。主时钟装置200分别与实时时钟信号源400和卫星信号接收装置500通信连接。实时时钟信号源400用于向主时钟装置200提供实时时钟信号Trtc。卫星信号接收装置500用于当接收到卫星信号时将卫星信号中的定位数据所包括的时间Tgnss提供给主时钟装置200。主时钟装置200基于实时时钟信号Trtc提供第一主时钟时间MT1和基于卫星信号中的定位数据所包括的时间Tgnss和实时时钟信号Trtc的其中之一提供第二主时钟时间MT2,第一主时钟时间 MT1和第二主时钟时间MT2可以提供给从时钟装置使用。从时钟装置300、300’和主时钟装置200通信连接,从主时钟装置200获取第一主时钟时间MT1和/或第二主时钟时间MT2。从时钟装置300可以据此提供第一从时钟时间ST1和第二从时钟时间ST2。从时钟装置300”与从时钟装置300通信连接,从从时钟装置300获取第一从时钟时间ST1和第二从时钟时间ST2。由于采用特定的通讯协议,可以实现第一主时钟时间和第一从时钟时间之间的尤其精确的同步,并且实现第二主时钟时间和第二从时钟时间之间的高精确的同步。因此,主、从时钟时间之间的时间差距可以忽略不计。系统中的主、从时钟装置由此具有彼此独立的第一时钟时间和第二时钟时间。
图4示出了图3的时间系统涉及第一时钟时间的部分的示意图。作为主时钟装置200的主节点200a接收来自实时时钟信号源400的实时时钟信号Trtc,并基于该实时时钟信号Trtc产生第一主时钟时间MT1。由于第一主时钟时间MT1基于实时时钟信号Trtc,因此第一主时钟时间MT1是单调递增而没有时间跳变的,非常稳定和精确。主节点200a由此向作为从时钟装置300的从节点300a、业务节点300b提供稳定无跳变的第一主时钟时间MT1。从节点300a进一步向作为从时钟装置300的另一业务节点300c提供稳定无跳变的第一从时钟时间ST1。通过这种方式,时间系统中的主节点200a、从节点300a、业务节点300b、业务节点300c均具有同一稳定无跳变的第一时钟时间MT1、ST1。本申请系统通过实现第一时钟时间MT1、ST1能够避免现有技术因时间跳变导致的诸多缺陷。例如当从节点300a为自动驾驶系统、业务节点300b为激光雷达、业务节点300c为摄像头时,由于这些节点均具有同一稳定无跳变的第一时钟时间MT1、ST1,在自动驾驶系统对激光雷达和摄像头的数据进行融合时,就不会产生因时间跳变而导致融合功能异常。
图5示出了图3的时间系统涉及第二时钟时间的部分的示意图。作为主时钟装置200的主节点200a接收来自卫星信号接收装置500的卫星信号中的定位数据所包括的时间Tgnss,并基于该时间产生第一主时钟时间MT1。由于第二时钟时间T2基于卫星信号中的定位数据所包括的时间Tgnss,因此第二时钟时间可以跟随现实世界,但第二主时钟时间MT2如上所述可能由于卫星信号的中断而存在时间跳变。主节点200a由此向作为从时钟装置300的从节点300d、业务节点300e提供跟随现实世界的第二主时钟时间MT2。从节点300d进一步向作为从时钟装置300的另一业务节点300f提供跟随现实世界的第二从时钟时间ST2。通过这种方式,时间系统中的主节点200a、从节点300d、业务节点300e、业务节点300f均具有跟随现实时间的第二时钟时间MT2、ST2。对于人工智能系统、设备中的一些部分,需要跟随现实世界的时间,而可以接收一定程度的时间跳变。例如,当从节点300d为车载终端人机界面、业务节点300e为碰撞传感器、业务节点300f为行车记录仪时,由于这些节点均具有跟随现实世界的第二时钟时间MT2、ST2,在用车载终端人机界面调取碰撞传感器和行车记录仪的碰撞数据的情况下,可以知道车辆碰撞事件是在现实世界中何时发生的。
<实施场景>
本申请的“双时钟”系统可以应用于多种人工智能系统、设备和场景,以下示例性地给出两个典型的实施场景。
图6示意性地示出了本申请的时间系统的一种可能的实施场景,智能汽车。 智能汽车A的主时钟装置201接收来自卫星接收装置501的卫星信号Xgnss中的定位数据所包括的时间Tgnss和来自实时时钟信号源401的实时时钟信号Trtc并通过CAN总线提供第一主时钟时间MT1和第二主时钟时间MT2。智能汽车A的各个从时钟装置301、302、303接收和使用第一主时钟时间MT1和/或第二主时钟时间MT2。卫星接收装置501和实时时钟信号源401在该场景中设置在智能汽车A中。此外,在该场景中,主时钟装置201例如可以设置在电子控制单元(Electronic Control Unit,ECU)、整车控制器(Vehicle Control Unit,VCU)、车载信息控制单元(Telematic Control Unit,TCU,又称T-Box)、汽车诊断系统(On-Board Diagnostic,OBD)或高级驾驶辅助系统(Advanced Driving Assistance System,ADAS)等中。从时钟装置301、302、303可以设置在例如为处理器、传感器、传感器抽象、执行器的各种装置中,作为这些装置的一部分。这些装置包括但不限于片上系统(System on a Chip,SOC)、微控制单元(Micro-controller Unit,MCU)、摄像头及其数据处理节点、激光雷达及其数据处理节点、毫米波雷达及其数据处理节点、超声波雷达及其数据处理节点、底盘及其数据处理节点、车载信息娱乐系统(Audio Video Navigation,AVN)。
在智能汽车A的行驶过程中,主时钟装置201持续向例如设置在车载信息娱乐系统中的从时钟装置301、例如为激光雷达的从时钟装置302和例如为毫米波雷达的从时钟装置303提供基于卫星信号中定位数据所包括的时间Tgnss或实时时钟信号Trtc的第二主时钟时间MT2,并且持续向例如为激光雷达的从时钟装置302和例如为毫米波雷达的从时钟装置303提供基于实时时钟信号Trtc的第一主时钟时间MT1。车载信息娱乐系统使用第二从时钟时间ST2来用于在人机交互界面显示时间,该第二从时钟时间ST2与第二主时间T2同步。激光雷达和毫米波雷达使用第一从时钟时间ST1来为智能汽车A的控制系统提供传感数据,以例如用于导航和路径规划,该第一从时钟时间ST1与第一主时间T1同步。激光雷达和毫米波雷达使用第二从时钟时间ST2来用于日志记录,该第二从时钟时间ST2与第二主时间T2同步。当智能汽车A行驶进入长隧道时,主时钟装置201由于没有接收到卫星信号Xgnss,因此提供基于实时时钟信号Trtc的第二主时钟时间MT2。此时,第二主时钟时间MT2由于卫星信号的中断而出现跳变,通常为毫秒级。第二从时钟时间ST2因此也出现毫秒级跳变。然而这种毫秒级的时钟跳变对于车载信息娱乐系统中人机交互界面显示的时间通常没有影响,并且其对于激光雷达和毫米波雷达的日志记录也是可以接受的。与此同时,由于激光雷达和毫米波雷达使用无跳变的第一从时钟时间ST1来提供传感数据,因此导航和路径规划不受卫星信号中断的影响。
图7示意性地示出了本申请的时间系统的另一种可能的实施场景,机器人系统B。设置在机器人B1中的主时钟装置202接收来自卫星接收装置502的卫星信号Xgnss中的定位数据所包括的时间Tgnss和来自实时时钟信号源402的实时时钟信号Trtc,并通过信号线路提供第一主时钟时间MT1和第二主时钟时间MT2。设置在各个机器人B2、B3、B4中的相应从时钟装置304、305、306接收第一主时钟时间MT2和第二主时钟时间MT2。卫星接收装置502和实时时钟信号源402在该场景中设置在机器人B1外部的设备中,该设备例如为人机交互设备、机器人系统总控制器等。此外,在该场景中,主时钟装置202例如可以设置在B1机器人的机器人控制单 元中。从时钟装置304、305、306可以例如是设置在例如为处理器、传感器、传感器抽象、执行器等的各种装置中,作为这些装置的一部分。这些装置包括但不限于片上系统(System on a Chip,SOC)、微控制单元(Micro-controller Unit,MCU)、触觉传感器及其数据处理节点、视觉传感器及其数据处理节点、接近觉传感器及其数据处理节点、听觉传感器及其数据处理节点、力觉传感器及其数据处理节点。
在机器人B1、B2、B3、B4协同工作时,机器人B1的主时钟装置202持续向机器人B2、B3、B4中的例如为摄像头的从时钟装置304、305、306提供基于卫星信号中的定位数据所包括的时间Tgnss的第二主时钟时间MT2和基于实时时钟信号Trtc的第一主时钟时间MT1。为摄像头的从时钟装置304、305、306使用与第一主时钟时间MT1同步的第一从时钟时间ST1来为机器人B1、B2、B3的控制系统提供传感数据,以例如用于协同操作的路径规划。当机器人B1和B2发生碰撞时,为摄像头的从时钟装置304和305使用与第二主时钟时间MT2同步的第二从时钟时间ST2记录碰撞事件的实际发生时间。
以下将参照图3、图8和图9对本申请的主时钟装置的一个实施方式和从时钟装置的一个实施方式进行详细的说明。在图8和图9中,用虚线框表示装置的可选单元,即这些可选单元在其他一些实施方式中是可以省略的。
<主时钟装置实施方式>
图8详细示出了图3中的主时钟装置200。如图8所示,主时钟装置200包括第一时钟单元210,第二时钟单元220,与第一时钟单元210、第二时钟单元220连接的时间处理单元230,以及与第一时钟单元210、第二时钟单元220和时间处理单元230连接的接口单元240。
第一时钟单元210配置为基于接收到的实时时钟信号Trtc提供第一主时钟时间MT1。第一时钟单元210可以直接向主时钟装置200外的例如为从时钟装置300的其他装置提供第一主时钟时间MT1时间,也可以向时间处理单元230和接口单元240提供第一主时钟时间MT1。实时时钟信号Trtc例如是来自石英晶体谐振器(简称晶振)的稳定且精确的单频振荡。普通晶振频率的绝对精度可达百万分之五十,一些晶振频率甚至可以达到更高,例如百万分之二十。因此,基于实时时钟信号Trtc的第一主时钟信号T1也可以具有类似的精度和稳定度。
第二时钟单元220配置为基于卫星信号Xgnss中的第一定位数据W1包括的时间Tgnss或实时时钟信号Trtc提供第二主时钟时间MT2。当接收到卫星信号Xgnss时,第二时钟单元220提供基于卫星信号中的第一定位数据W1包括的时间Tgnss的第二主时钟时间MT2。当没有接收到卫星信号Xgnss时,第二时钟单元220提供基于实时时钟信号Trtc的第二主时钟时间MT2。由于第二时钟单元220用于提供第二主时钟时间MT2的参考信号可能是变化的,这种参考信号的变化反过来可能导致时间跳变。因此,不同于第一主时钟时间MT1,第二主时钟时间MT2是允许存在时钟跳变的。在一些主时钟装置实施方式中,第二时钟单元220直接基于卫星信号中定位数据所包括的时间Tgnss提供第二主时钟时间MT2。然而,如下详述,在其他一些主时钟装置实施方式中,第二时钟单元220也可以基于时间处理单元230根据卫星信号Xgnss确定的主时钟装置的第一时间mt1提供第二主时钟时间MT2。在这种情况下, 可以认为第二时钟单元220间接基于卫星信号中第一定位数据W1包括的时间Tgnss提供第二主时钟时间MT2。
时间处理单元230配置为确定第一时间差ΔT1。第一时间差ΔT1是第一时刻和第二时刻之间的时间差。第一时刻是主时钟装置200接收到第一秒脉冲信号PPS1的时刻。第二时刻是主时钟装置200接收到第一定位数据W1的时刻。第一秒脉冲信号PPS1和第一定位数据W1包含于卫星信号Xgnss中并彼此对应。时间处理单元230还配置为基于第一定位数据W1包括的时间Tgnss和所述第一时间差ΔT1来确定主时钟装置的第一时间mt1。用数学方式表示确定第一时间mt1的过程为:mt1=ΔT1+Tgnss。时间处理单元230将所确定的第一时间mt1发送给第二时钟单元220,以使得第二时钟单元220可以根据第一时间mt1进一步提供第二主时钟时间MT2。换句话说,第二主时钟时间MT2通过这种方式与卫星信号的时间Tgnss精准同步。用数学方式表示第二时钟单元220进一步提供第二主时钟时间MT2的过程为:MT2=mt1。这样同步的精度可以达到5纳秒。这在其他一些主时钟装置实施方式中是可以省略的。
在主时钟装置200的一种实现方式中,时间处理单元200中设置有传感器控制中心(未示出),传感器控制中心配置为在接收到第一秒脉冲信号PPS1时开始以纳秒计数,在接收到与该秒脉冲信号PPS1相对应的第一定位数据W1时结束所述计数,得到的纳秒级时间计数即为第一时间差ΔT1。在主时钟装置200的另一种实现方式中,时间处理单元200中设置替代于传感器控制中心的计数器(未示出),以得到纳秒级精度的第一时间差ΔT1。这在其他一些主时钟装置实施方式中是可以省略的。
在主时钟装置200的一种另实现方式中,时间处理单元200配置为在接收到的卫星信号Xgnss中的第一秒脉冲信号PPS1时记录此刻的第一主时钟时间MT1,并且在接收到与所述第一秒脉冲信号PPS1对应的第一定位数据W1时记录此刻的第一主时钟时间MT1’,然后计算两个不同时刻的第一主时钟时间MT1、MT1’的差异作为第一时间差ΔT1。这在其他一些主时钟装置实施方式中是可以省略的。
时间处理单元230还配置为计算第二时间差ΔT2作为主时钟装置200接收到的第二定位数据W2的传输时延。第二时间差ΔT2是主时钟装置200接收到第二定位数据W2中的时间T W2和第三时刻第二时钟单元220提供的第二主时钟时间MT2 3(即主时钟装置的第二时间)之间的时间差。第三时刻是主时钟装置200在接收到该定位数据W2的时刻。这种传输时延的确定方式可以同样地用于确定导航系统的定位数据(例如下述提及的定位数据W41、W42、...、W4x)的传输时延,以用于这些定位数据的时间转换的验证。这在其他一些主时钟装置实施方式中是可以省略的。
时间处理单元230还配置成当接收到在第三秒脉冲信号PPS3时,记录在第四时刻第一时钟单元210提供的第一主时钟时间MT1 4(即主时钟装置的第三时间)。第四时刻是主时钟装置200接收到第三秒脉冲信号PPS3的时刻。时间处理单元230还配置成计算第三时间差ΔT3。第三时间差ΔT3是第三定位数据W3中的时间T W3与所记录的第一主时钟时间MT1 4之间的时间差。时间处理单元230还配置成将进一步接收到第四定位数据W4中的时间T W4(即主时钟装置的第四时间)转换为第五时间mt5,而第五时间mt5是基于第四定位数据W4中的时间T W4和第三时间差ΔT3确定的。用数学方式表示第四定位数据W4中时间T W4这种基于第一主时钟时间MT1 4的 转换为:W4(T W4)→W4(mt5),mt5=T W4+ΔT3=T W4+(MT1 4-T W3)。经过时间转换的定位数据W4(mt5)可以经由接口单元240发送出去。这在其他一些主时钟装置实施方式中是可以省略的。
在这里,第三定位数据W3中的时间T W3可以是基于卫星信号中定位数据所包括的时间Tgnss的时间,也可以是基于提供第三定位数据W3的装置自身的时间,例如传感器的板状晶振的时间。因此,第三定位数据W3中时间T W3这种基于第一主时钟时间MT1 4的转换可以理解为不取决于卫星信号中定位数据所包括的时间Tgnss。此外,应当理解,第三时间差ΔT3可用于更多第四定位数据W41、W42、...、W4x的时间T W41、T W42、...、T W4n的基于第一主时钟时间MT1 4的转换。这样的时间转换是为了使与例如涉及自动驾驶算法计算、运动路径规划计算等的与数据面节点有关的定位数据中的时间与第一主时钟时间MT1同步,从而使得数据面节点中与时间有关的数据均使用稳定性和精度很高的第一主时钟时间MT1。
接口单元240配置为与从时钟装置300通信,以根据已知或私有协议,向从时钟装置300提供第一主时钟时间MT1和第二主时钟时间MT2,以用于从时钟装置300的第一从时钟时间ST1和/或第二从时钟时间ST2对应地与主时钟装置200的各时钟时间同步。这在其他一些主时钟装置实施方式中是可以省略的。
接口单元240还配置为通过广义精准时钟协议,向所述从时钟装置300发送第一主时钟时间MT1,以用于第一主时钟时间MT1和从时钟装置300的第一从时钟时间ST1之间的尤其精确的同步。通过广义精准时钟协议,可以使同步偏差,即从时钟装置300的第一从时钟时间ST1与所述主时钟装置200的第一主时钟时间MT1之间的偏差,小于1微秒。这在其他一些主时钟装置实施方式中是可以省略的。
接口单元240还配置为通过广义精准时钟协议周期性地向从时钟装置300发送第一时间同步请求消息Xsyn1,用于支持广义精准时钟协议的从时钟装置300(即本申请的第一从时钟装置300’)与主时钟装置200在第二时钟时间MT2、ST2方面的同步。第一时间同步请求消息Xsyn1包括第五时刻第一时钟单元210提供的第一主时钟时间MT1 5(即主时钟装置的第六时间,亦即下文的从时钟装置的第一时间)和此刻第二时钟单元220提供的第二主时钟时间MT2 5(即主时钟装置的第七时间,亦即下文的从时钟装置的第二时间),第五时刻是接口单元240发送第一时间同步请求消息Xsyn1的时刻。其中,周期可以是预设的,或者是可受控调整的。例如,周期可以预设为1秒/次。这在其他一些主时钟装置实施方式中是可以省略的。
接口单元240还配置为周期性地向从时钟装置300发送第二时间同步请求消息Xsyn2,用于不支持广义精准时钟协议的从时钟装置300(即本申请的第二从时钟装置300”)与主时钟装置200在第二时钟时间MT2、ST2方面的同步。第二时间同步请求消息Xsyn2包括第六时刻第二时钟单元220提供的第二主时钟时间MT2 6(即主时钟装置的第八时间)和消息平均时延P delay。第六时刻是接口单元240发送第二时间同步请求消息Xsyn2的时刻。消息平均时延P delay指示在主时钟装置200与从时钟装置300之间进行消息传输所需的时间。其中,周期可以是预设的,或者是可受控调整的。例如,周期可以预设为1秒/次。这在其他一些主时钟装置实施方式中是可以省略的。
接口单元240还配置为接收来自从时钟装置300的第二时间同步响应消息Xresp2。第二时间同步响应消息Xresp2与第二时间同步请求消息Xsyn2对应,即第二时间同步响应消息Xresp2是从时钟装置300响应于第二时间同步请求消息Xsyn2而产生的。第二时间同步响应消息Xresp2包括第七时刻的第二从时钟时间ST2 7(即主时钟装置的第九时间,亦即下文的从时钟装置的第七时间)以及第八时刻的第二从时钟时间ST2 8(即主时钟装置的第十时间,亦即下文的从时钟装置的第八时间)。第七时刻是从时钟装置300在接收到第二时间同步请求消息Xsyn2的时刻,第八时刻是从时钟装置300在发送第二时间同步响应消息Xresp2的时刻。这在其他一些主时钟装置实施方式中是可以省略的。
时间处理单元230还配置为记录第九时刻第二时钟单元220提供的第二主时钟时间MT2 9(即主时钟装置的第十一时间)。第九时刻是接口单元240接收到第二时间同步响应消息Xresp2的时刻。时间处理单元还配置为基于第六时刻的所述第二主时钟时间MT2 6、第七时刻的第二从时钟时间ST2 7、第八时刻的第二从时钟时间ST2 8和第九时刻的第二主时钟时间MT2 9,计算所述消息平均时延P delay。所述第十时刻是所述接口单元接收到所述第二时间同步响应消息的时刻。用数学方式表示消息平均时延的这种计算为:P delay=[(MT2 9-MT2 6)-(ST2 8-ST2 7)]/2。这在其他一些主时钟装置实施方式中是可以省略的。
时间处理单元230还配置为经由接口单元240接收第一时间同步响应消息Xresp1并记录此时的第一主时钟时间MT1 resp1和第二主时钟时间MT2 resp1,用于监控第一时钟时间MT1、ST1之间的同步。
<从时钟装置实施方式>
图9示意性地示出了图3中的从时钟装置300的示意图,其包括提供第一从时钟时间ST1的第一时钟单元310、提供第二从时钟时间ST2的第二时钟单元320、时间处理单元330和接口单元340。接口单元340用于与主时钟装置200通信,从主时钟装置200接收第一主时钟时间MT1和第二主时钟时间MT2。时间处理单元330用于经由接口单元340的通信,使从时钟装置300的第一时钟单元310的第一从时钟时间ST1和第二时钟单元320的第二从时钟时间ST2与主时钟装置200的对应主时钟时间同步。由于从时钟装置300涵盖时间处理单元230以及其他可选的特征,因此,可以参考图9和以下相关描述进一步了解支持广义精准时钟协议的第一从时钟装置300’和不支持广义精准时钟协议的第二从时钟装置300”。
在一些实施方式中,接口单元340还配置为通过广义精准时钟协议从主时钟装置200接收所述第一主时钟时间MT1。并且第一时钟单元310还配置为根据接口单元340根据所述接口单元接收的第一主时钟时间MT1提供所述第一从时钟时间ST1。由此实现从时钟装置300的第一时钟单元310的第一从时钟时间ST1与主时钟装置200的第一主时钟时间MT1的精确同步。这里涉及的第一时钟时间MT1、ST1基于实时时钟信号Trtc。这在其他一些从时钟装置实施方式中,尤其是不支持广义精准时钟协议的从时钟装置实施方式中,是可以省略的。
在一些实施方式中,接口单元340还配置为从主时钟装置200接收第一时间同步请求消息Xsyn1。第一时间同步请求消息Xsyn1包括接口单元340发送第一时 间同步请求消息Xsyn1时第一时钟单元210提供的第一主时钟时间MT1 5(即从时钟装置的第一时间,亦即上文的主时钟装置的第六时间)和第二时钟单元220提供的第二主时钟时间MT2 5(即从时钟装置的第二时间,亦即上文的主时钟装置的第七时间)。第二主时钟时间MT2 5基于卫星信号Xgnss中的定位数据所包括的时间Tgnss和所述实时时钟信号Trtc之一。这在其他一些从时钟装置实施方式中,尤其是不支持广义精准时钟协议的从时钟装置实施方式中,是可以省略的。
在一些实施方式中,设置有与接口单元340连接的时间处理单元330。时间处理单元配置为记录接口单元340接收到第一时间同步请求消息Xsyn1时第一时钟单元310提供的第一从时钟时间ST12(即从时钟装置的第三时间)。时间处理单元还配置为计算第一时间同步请求消息Xsyn1所包括的第一主时钟时间MT1 5和第二主时钟时间MT2 5之间的第四时间差ΔT4(即从时钟装置的第一时间差)。时间处理单元330然后计算从时钟装置的第四时间st4,使得第四时间st4为第一从时钟时间ST1 2与第四时间差ΔT4的和。用数学方式表示时间处理单元340计算第四时间st4的过程为:st4=ST1 2+ΔT4=ST1 2+|MT1 5-MT2 5|。
第二时钟单元320由此还配置为基于第四时间st4进一步提供第二从时钟时间ST2。用数学方式表示这一过程为ST2=st4。这在其他一些从时钟装置实施方式中,尤其是不支持广义精准时钟协议的从时钟装置实施方式中,是可以省略的。
接口单元340还配置为向主时钟装置200发送第一时间同步响应消息Xresp1用于验证从时钟装置300的第二从时钟时间ST2与第二主时钟时间MT2的同步。第一时间同步响应消息Xresp1包括所述从时钟装置300在接收到第一时间同步请求消息Xsyn1时的第二从时钟时间ST2 syn12以及从时钟装置300在发送第二时间同步响应消息Xresp1时的第二从时钟时间ST2 resp1。这在其他一些从时钟装置实施方式中是可以省略的。
接口单元340还配置为从主时钟装置200接收第二时间同步请求消息Xsyn2。第二时间同步请求消息Xsyn2包括接口单元340发送第二时间同步请求消息Xsyn2时第二时钟单元220提供的第二主时钟时间MT2 6(即从时钟装置的第五时间,亦即上文的主时钟装置的第八时间)和消息平均时延P delay。其中,第二主时钟时间MT2 6基于卫星信号Xgnss中定位数据所包括的时间Tgnss或所述实时时钟信号Trtc。消息平均时延P delay指示在主时钟装置200与从时钟装置300之间进行消息传输所需的平均时间。这在其他一些从时钟装置实施方式中,尤其是支持广义精准时钟协议的从时钟装置实施方式中,是可以省略的。
时间处理单元330还配置为基于第二主时钟时间MT2 6和消息平均时延P delay,计算从时钟装置的第六时间st6,使得第六时间st6为第二主时钟时间MT2 6和消息平均时延P delay的和。用数学方式表示时间处理单元330计算第六时间st6的过程为:st6=MT2 6+P delay
然后,第二时钟单元320还配置为基于第六时间st6,提供第二从时钟时间ST2。用数学方式表示第二时钟单元320提供第二从时钟时间ST2的过程为:ST2=st6。这在其他一些从时钟装置实施方式中,尤其是支持广义精准时钟协议的从时钟装置实施方式中,是可以省略的。
接口单元340还配置为向主时钟装置200发送第二时间同步响应消息Xresp2。第二时间同步响应消息Xresp2与第二时间同步请求消息Xsyn2对应,即第二时间同步响应消息Xresp2是从时钟装置300响应于第二时间同步请求消息Xsyn2而产生的。第二时间同步响应消息Xresp2包括从时钟装置300在接收到第二时间同步请求消息Xsyn2时的第二从时钟时间ST2 7(即从时钟装置的第七时间,亦即上文的主时钟装置的第九时间)和此刻的第二从时钟时间ST2 8(即从时钟装置的第八时间,亦即上文的主时钟装置的第十时间)。这在其他一些从时钟装置实施方式中,尤其是支持广义精准时钟协议的从时钟装置实施方式中,是可以省略的。
图10示意性地示出了根据本申请的实施方式的时间系统的示意图。图10所示的时间系统1100没有从时钟装置300。时间系统1100中的其他结构与图3示出的时间系统1000相同,参照图3示出的时间系统1000的相关描述,在此不再赘述。该系统实施方式由于没有从时钟装置300,因此在实际中该系统实施方式更可能以集成的形式配置,例如形成在一个时间提供装置或设备中。
在一些实施方式中,时间系统1100还可以包括从时钟装置300。
以下将基于图3的时间系统、图8的主时钟装置200和图9的从时钟装置300,参照图11详细描述本申请时间同步方法的一个实施方式。如下所述,其中一些步骤由仅由本申请的主时钟装置或主时钟装置的可选单元执行,一些步骤由仅由本申请的从时钟装置或主时钟装置的可选单元执行,而另一些步骤则涉及二者或二者的可选单元。因此,以下一些步骤在本申请时间同步方法的其他一些实施方式中不是必须的并因此是可以省略的。
<时间同步方法实施方式>
本申请一个实施方式的时间同步方法包括以下步骤S101至S107。
在步骤S101,主时钟装置200初始化第一时钟单元210和第二时钟单元220。具体地,初始化第一时钟单元210和第二时钟单元220是使第一时钟单元210和第二时钟单元220基于实时时钟信号Trtc提供第一主时钟时间MT1和第二主时钟时间MT2。
在步骤S102,主时钟装置200和从时钟装置300周期性进行第一时钟时间MT1、ST1和第二时钟时间MT2、ST2的同步。这里,主时钟装置200和从时钟装置300周期性进行第一时钟时间MT1、ST1和第二时钟时间MT2、ST2的同步的具体方式将在以下详述。其中,周期可以是预设的,也可以在重复的同步过程中根据情况调整。周期的一个例子是1秒/次。
在步骤S103,主时钟装置200判断是否接收到第三秒脉冲信号PPS3、第三定位数据W3。如接收到则转步骤S104,如未接收到则转步骤S107。
在步骤S104,主时钟装置200利用接收到的秒脉冲信号PPS3,基于第一主时钟时间MT1转换第四定位数据W4中的时间T W4
在步骤S105,主时钟装置200判断卫星信号接收装置500是否搜星成功。如成功定则转步骤S106,如未成功则转步骤S107。
在步骤S106,主时钟装置200接收由卫星信号接收装置500发送的卫星信号Xgnss并获取其中的定位数据所包括的时间Tgnss,执行第二主时钟时间MT2与卫 星信号的时间Tgnss的同步。
在步骤S107,主时钟装置200判断是否关机。如关机则则转步骤S108,如不关机则返回步骤S102。
在步骤S108中,主时钟装置200保存当前第二主时钟时间MT2后,结束。
参照图12说明步骤S102中涉及的主时钟装置200和从时钟装置300的第一时钟时间MT1、ST1之间的周期性同步。主时钟装置200的接口单元240向第一从时钟装置300’发送SYNC(Synchronization,同步)和Follow_UP(跟随)报文以实现主时钟装置200和第一从时钟装置300’中的各个第一时钟时间MT1、ST1频率同步。然后从时钟装置300的接口单元340向主时钟装置200的接口单元240发送pDelay_Req(peer-delay request,点延迟请求)报文,而后接口单元240向接口单元340先后发送pDelay_Resp(peer-delay response,点延迟响应)报文和pDelay_Resp_Follow_Up(peer-delay response follow up,点延迟响应跟随)报文来测量延迟时间。用gPTP协议同步时间过程中产生的延迟时间实际上可以达到微秒级甚至更小。这样精确同步使得第一时钟时间MT1、ST1在经过不同装置之间的时间同步后仍保持很高的精度。也就是说,用gPTP协议同步第一时钟时间MT1、ST1能够使得时间系统中主时钟装置200和第一从时钟装置300’的各个第一时钟时间MT1、ST1之间的差异极小,甚至可以忽略不计。这个步骤部分在本申请时间同步方法的其他一些实施方式中,尤其是其中从时钟装置不支持广义精准时钟协议的实施方式中,是可以省略的。
参照图13说明步骤S102中涉及的主时钟装置200和第一从时钟装置300’的第二时钟时间MT2、ST2之间的周期性同步。第一从时钟装置300’由于支持广义精准时钟协议,可以依据主时钟装置200的第一主时钟时间MT1和第二主时钟时间MT2之间的第四时间差提供第二从时钟时间ST2。具体地,主时钟装置200的接口单元240向第一从时钟装置300’发送第一时间同步请求消息Xsyn1。第一时间同步请求消息Xsyn1包括接口单元240发送第一时间同步请求消息Xsyn1时第一时钟单元210提供的第一主时钟时间MT1 5(即主时钟装置的第六时间,亦即从时钟装置的第一时间)和此刻第二时钟单元220提供的第二主时钟时间MT2 5(即主时钟装置的第七时间,亦即从时钟装置的第二时间)第一从时钟装置300’的接口单元340接收第一时间同步请求消息Xsyn1。时间处理单元330记录接口单元340接收第一时间同步请求消息Xsyn1时第一时钟单元310提供的第一从时钟时间ST1 2。计算第一时间同步请求消息Xsyn1所包括的第一主时钟时间MT15和第二主时钟时间MT25之间的第四时间差ΔT4(即从时钟装置的第一时间差)。时间处理单元330然后计算从时钟装置的第四时间st4,使得第四时间st4为接口单元340接收到第一时间同步请求消息Xsyn1时第一时钟单元310提供的第一从时钟时间ST12(即从时钟装置的第三时间)与第四时间差ΔT4的和。用数学方式表示时间处理单元340计算第四时间的过程为:st4=MT1 2+ΔT4=MT1 2+|MT1 5-MT2 5|。然后,第二时钟单元320基于第四时间st4进一步提供第二从时钟时间ST2。用数学方式表示这一过程为ST2=st4。据此实现第一从时钟装置300’的第二时钟单元320的第二从时钟时间ST2与主时钟装置200的第二主时钟时间MT2之间的同步。这个步骤部分在本申请时间同步方法的其他一些实施方式中,尤其是其中从时钟装置不支持广义精准时钟协议的实施方式中,是可以省略的。
此外,图13还示出了第一从时钟装置300’向主时钟装置200发送第一时间同步响应消息Xresp1用于验证第一从时钟装置300’的同步。第一时间同步响应消息Xresp1包括所述第一从时钟装置300’在接收到第一时间同步请求消息Xsyn1时的第二从时钟时间ST2 syn12以及第一从时钟装置300’在发送第一时间同步响应消息Xresp1时的第二从时钟时间ST2 resp1。主时钟装置200的时间处理单元230经由接口单元240接收第一时间同步响应消息Xresp1并记录此时的第一主时钟时间MT1 resp21和第二主时钟时间MT2 resp21,用于监控第一时钟时间MT1、ST1之间的同步。这个步骤部分对于第一从时钟装置300’与主时钟装置200的第一时钟时间MT1、ST1的同步来说是冗余的,因此在本申请时间同步方法的其他一些实施方式中是可以省略的。
参照图14说明步骤S102中涉及的主时钟装置200和第二从时钟装置300”的第二时钟时间MT2、ST2之间的周期性同步。由于从时钟装置300”不支持广义精准时钟协议,因此可以基于主时钟装置200与第二从时钟装置300”之间的消息平均时延同步第二时钟时间MT2、ST2。具体地,主时钟装置200的接口单元240向第二从时钟装置300”发送第二时间同步请求消息Xsyn2。第二时间同步请求消息Xsyn2包括接口单元240发送第二时间同步请求消息Xsyn2时第二时钟单元220提供的第二主时钟时间MT2 6(即主时钟装置的第八时间)和消息平均时延P delay。消息平均时延P delay指示在主时钟装置200与从时钟装置300之间进行消息传输所需的时间。当主时钟装置200初次向第二时钟从时钟装置300”发送第二时间同步请求消息Xsyn2时;其中包括的消息平均时延P delay可以是预设值,例如为0,或者可以是主时钟装置200事先存储的经验数值。第二从时钟装置300”的接口单元340接收第二时间同步请求消息Xsyn2。时间处理单元330记录接口单元340接收第二时间同步请求消息Xsyn2时第二时钟单元320提供的第二从时钟时间ST2 7(即主时钟装置的第九时间,亦即从时钟装置的第七时间)。接口单元340然后向主时钟装置200发送对应的第二时间同步响应消息Xresp2。第二时间同步响应消息Xresp2包括第二从时钟时间ST2 7以及接口单元340向主时钟装置200发送对应的第二时间同步响应消息Xresp2时第二时钟装置320提供的第二从时钟时间ST2 8(即主时钟装置的第十时间,亦即从时钟装置的第八时间)。主时钟装置200的接口单元240接收第二时间同步响应消息Xresp2。主时钟装置200的时间处理单元230记录接口单元240接收第二时间同步响应消息Xresp2时第二时钟单元220提供的第二主时钟时间MT2 9(即主时钟装置的第十一时间)。时间处理单元230然后基于第二主时钟时间MT2 6、第二从时钟时间ST2 7、第二从时钟时间ST2 8和第二主时钟时间MT2 9,计算所述消息平均时延P delay。所述第十时刻是所述接口单元接收到所述第二时间同步响应消息的时刻。用数学方式表示消息平均时延的这种计算为:P delay=[(MT2 9-MT2 6)-(ST2 8-ST2 7)]/2。主时钟装置200再次发送第二时间同步请求消息Xresp2时,其中包括的消息平均时延P delay就可以是计算得到的消息平均时延,而不是初次发送的例如为0的数值。第二从时钟装置300”的时间处理单元330基于第二主时钟时间MT2 6和消息平均时延P delay,计算从时钟装置的第六时间st6,使得第六时间st6为第二主时钟时间MT2 6和消息平均时延P delay的和。用数学方式表示时间处理单元330计算第六时间st6的过程为:st6=MT2 6+P delay。然后,第二时钟单元320基于第六时间st6,提供第二从时钟时间ST2。用数学方式表示第二时钟 单元320提供第二从时钟时间ST2的过程为:ST2=st6。这个步骤部分在本申请时间同步方法的其他一些实施方式中,尤其是其中从时钟装置支持广义精准时钟协议的实施方式中,是可以省略的。
具体地,在步骤S103中,主时钟装置200可以通过时间处理单元230判断是否接收到第三秒脉冲信号PPS3和与第三秒脉冲信号PPS3对应的第三定位数据W2。当接收到第三秒脉冲信号PPS3和第三定位数据W3时,时间处理单元230执行步骤S104。当没有接收到第三秒脉冲信号PPS3和第三定位数据W3时,时间处理单元230执行步骤S107。这个步骤在本申请时间同步方法的其他一些实施方式中是可以省略的。
参照图15详细描述步骤S104在主时钟装置200接收到卫星信号接收装置500的第三秒脉冲信号PPS3时(即第四时刻),时间处理单元230记录第一时钟单元210此刻提供的第一主时钟时间MT1 4。然后在接收到来自于卫星信号接收装置500的与第三秒脉冲信号PPS3对应的第三定位数据W3情况下,时间处理单元230计算第三定位数据W3中的时间T W3与所记录的第一主时钟时间MT1 4之间的第三时间差ΔT3。随后,当进一步从卫星信号接收装置500接收到第四定位数据W4时,时间处理单元230将第四定位数据W4中的第四时间T W4转换为主时钟装置的第五时间mt5,而第五时间mt5是基于所述第四时间T W4和所述第三时间差ΔT3确定的。用数学方式表示第四定位数据W4中时间T W4这种基于第一主时钟时间MT1 4的转换为:W4(T W4)→W4(mt5),mt5=T W4+ΔT3=T W4+(MT1 4-T W3)。此后,当进一步从卫星信号接收装置500接收到另一定位数据W4n时,时间处理单元230重复上述的转换过程,定位数据W4n中的时间T W4n转换为T W4n+ΔT3。以此类推,可以持续使用第三时间差ΔT3将定位数据中的时间T W4n转换为基于第一主时钟时间MT1的时间mt5。经过时间转换的定位数据W4n(mt5)可以经由接口单元240发送出去。这个步骤在本申请时间同步方法的其他一些实施方式中是可以省略的。
具体地,在步骤S105中,主时钟装置200可以通过时间处理单元230判断卫星信号接收装置500是否星成功。当卫星信号接收装置500搜星成功时,时间处理单元230执行步骤S106。当卫星信号接收装置500搜星不成功时,时间处理单元230执行步骤S107。这个步骤在本申请时间同步方法的其他一些实施方式中是可以省略的。
参照图16详细描述步骤S106。卫星信号接收装置500向主时钟装置200发送卫星信号Xgnss。卫星信号Xgnss具有第一秒脉冲信号PPS1和对应的第一定位数据W1。其中,第一定位数据W1中具有卫星信号的时间Tgnss1。换句话说,第一定位数据W1中的时间T W1是Tgnss1。主时钟装置200的时间处理单元230在接收到第一秒脉冲信号PPS1时开始计数,并且在接收到第一定位数据W1时结束计数,据此获得这两种接收之间的第一时间差ΔT1。然后时间处理单元230基于第一定位数据W1中的时间Tgnss1和所述第一时间差ΔT1来确定第一时间mt1。用数学方式表示确定第一时间mt1的过程为:mt1=ΔT1+Tgnss1。时间处理单元230将所确定的第一时间mt1发送给第二时钟单元220,以使得第二时钟单元220可以根据第一时间mt1提供第二主时钟时间MT2。换句话说,第二时钟时间T2通过这种方式与卫星信号中第一 定位数据W1所包括的时间Tgnss1精准同步。用数学方式表示第二时钟单元220进一步提供第二主时钟时间MT2的过程为:MT2=mt1。这样同步的精度可以达到5纳秒。这个步骤在本申请时间同步方法的其他一些实施方式中是可以省略的。
在本申请时间同步方法的其他一些实施方式中,可以省略步骤S107。
在本申请时间同步方法的其他一些实施方式中,可以省略步骤S108。
应当理解,在以上的描述中,所涉及的表示步骤的标号,如S101、S102……等,并不表示一定会按此步骤顺序执行,在允许的情况下可以互换前后步骤的顺序,或同时执行。例如,步骤S104涉及主时钟装置利用第一主时钟时间来转换定位数据中的时间,而步骤S106则涉及主时钟装置中的第二时钟时间与卫星信号时间的同步,二者互相独立,因此可以同时执行两者或将这两者互换顺序。又例如,可以在步骤S101后先执行步骤S105和S106,以使主时钟装置中的第二时钟时间与卫星信号时间精确同步,而后再执行步骤S102,使得主时钟装置能够向从时钟装置提供精确的第二时钟时间。
此外,基于第二主时钟时间MT2计算第二定位数据W2的传输时延的步骤没有包括在图9示出的时间同步方法实施方式中。该计算定位数据传输时延的步骤可以在步骤S106之后执行。在该步骤中,主时钟装置200的时间处理单元230计算接收到的定位数据W2中的时间T W2和第三时刻第二时钟单元220提供的第二主时钟时间MT2 3之间的第二时间差ΔT2作为所述定位数据W2的传输时延。这样确定传输时延的方式可以同样地用于导航系统的定位数据(例如上文提及的定位数据W41、W42、...、W4x)的传输时延,以用于对这些定位数据的时间转换进行验证和监控。
<计算设备实施方式>
参见图17,示意性地示出了本申请的计算设备的一个实施方式。在本实施方式中,计算设备1500包括:处理器1510、存储器1520、通信接口1530、总线1540。
应理解,图17所示的计算设备1500中的通信接口1530可以用于与其他设备之间进行通信。
其中,该处理器1510可以与存储器1520连接。该存储器1520可以用于存储该程序代码和数据。因此,该存储器1520可以是处理器1510内部的存储单元,也可以是与处理器1510独立的外部存储单元,还可以是包括处理器1510内部的存储单元和与处理器1510独立的外部存储单元的部件。
可选的,计算设备1500还可以包括总线1540。其中,存储器1520、通信接口1530可以通过总线1540与处理器1510连接。总线1540可以是外设部件互连标准(Peripheral Component Interconnect,PCI)总线或扩展工业标准结构(Extended Industry Standard Architecture,EISA)总线等。所述总线1540可以分为地址总线、数据总线、控制总线等。为便于表示,图17中仅用一条线表示,但并不表示仅有一根总线或一种类型的总线。
应理解,在本申请实施方式中,该处理器1510可以采用中央控制单元(central processing unit,CPU)。该处理器还可以是其它通用处理器、数字信号处理器(digital signal processor,DSP)、专用集成电路(application specific integrated circuit,ASIC)、现成可编程门阵列(field programable gate Array,FPGA)或者其它可编程逻辑 器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。或者该处理器1510采用一个或多个集成电路,用于执行相关程序,以实现本申请实施方式所提供的技术方案。
该存储器1520可以包括只读存储器和随机存取存储器,并向处理器1510提供指令和数据。处理器1510的一部分还可以包括非易失性随机存取存储器。例如,处理器1510还可以存储设备类型的信息。
在计算设备1500运行时,所述处理器1510执行所述存储器1520中的计算机执行指令执行上述由主时钟装置或由从时钟装置执行的任一种时间同步方法的操作步骤。其中,由主时钟装置执行的时间同步方法可以理解为由主时钟装置执行的第四方面中的任一种方法。类似地,由从时钟装置执行的时间同步方法可以理解为由从时钟装置执行的第五方面中的任一种方法。
应理解,根据本申请实施方式的计算设备1500可以对应于执行根据本申请各实施方式的方法中的相应主体,并且计算设备1500中的各个模块的上述和其它操作和/或功能分别为了实现本实施方式各方法的相应流程,为了简洁,在此不再赘述。
本领域普通技术人员可以意识到,结合本文中所公开的实施方式描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施方式中的对应过程,在此不再赘述。
在本申请所提供的几个实施方式中,应该理解到,所揭露的装置、系统和方法,可以通过其它的方式实现。以上所描述的装置实施方式仅仅是示意性的。所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的连接或直接连接或通信连接可以是通过一些接口,装置或单元的间接连接或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,例如,时间处理单元和接口单元可以集成于一个芯片上,或者也可以分布到多个网络单元上,可以根据实际的需要选择其中的部分或者全部单元来实现本实施方式方案的目的。
另外,在本申请各个实施方式中的各功能单元可以集成在一个控制单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施方 式所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
<计算机可读存储介质实施方式>
本申请实施方式还提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时执行本申请涉及的由主时钟装置或从时钟装置执行的时间同步方法。其中,由主时钟装置执行的时间同步方法可以理解为由主时钟装置执行的第四方面中的任一种方法。类似地,由从时钟装置执行的时间同步方法可以理解为由从时钟装置执行的第五方面中的任一种方法。或者,计算机可读存储介质存储有包括第四方面中的任一种方法和第五方面中的任一种方法,其中第四方面中的任一种方法由第一处理器执行,第五方面中的任一种方法由第二处理器执行。
本申请实施方式的计算机存储介质,可以采用一个或多个计算机可读的介质的任意组合。计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质。计算机可读介质可以包括计算机存储介质(或非暂时性介质)和信号介质(或暂时性介质)。计算机可读存储介质例如可以是,但不限于,电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、云(cloud)或者是用于存储期望的信息并且可以被计算机访问的任何介质。在本文件中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。
计算机可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。
计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括、但不限于无线、电线、光缆、RF等等,或者上述的任意合适的组合。
可以以一种或多种程序设计语言或其组合来编写用于执行本申请操作的计算机程序代码,所述程序设计语言包括面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络,包括局域网(LAN)或广域网(WAN),连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。
注意,上述仅为本申请的较佳实施方式及所运用的技术原理。本领域技术人员会理解,本发明不限于这里所述的特定实施方式,对本领域技术人员来说能够进 行各种明显的变化、重新调整和替代而不会脱离本发明的保护范围。因此,虽然通过以上实施方式对本申请进行了较为详细的说明,但是本发明不仅仅限于以上实施方式,在不脱离本发明的构思的情况下,还可以包括更多其他等效实施方式,均属于本发明的保护范畴。

Claims (40)

  1. 一种主时钟装置,其特征在于,包括:
    第一时钟单元,用于基于实时时钟信号提供第一主时钟时间;以及
    第二时钟单元,用于在所述主时钟装置接收到卫星信号时,基于所接收的卫星信号中的第一定位数据所包括的时间来提供第二主时钟时间,以及,在所述主时钟装置没有接收到卫星信号时,基于所述实时时钟信号提供所述第二主时钟时间。
  2. 根据权利要求1所述的主时钟装置,其特征在于,所述主时钟装置还包括:
    时间处理单元,与所述第二时钟单元连接,用于:
    确定第一时间差,其中,所述第一时间差是第一时刻和第二时刻之间的时间差,所述第一时刻是所述主时钟装置接收到第一秒脉冲信号的时刻,所述第二时刻是所述主时钟装置接收到所述第一定位数据的时刻,所述第一秒脉冲信号和所述第一定位数据包含于所接收的卫星信号中并彼此对应;以及,
    基于所述第一定位数据包括的时间和所述第一时间差,确定第一时间,
    其中,所述第二时钟单元进一步用于基于所述第一时间提供所述第二主时钟时间。
  3. 根据权利要求2所述的主时钟装置,其特征在于,
    所述时间处理单元进一步用于计算第二时间差,作为所述主时钟装置接收到的第二定位数据的传输时延,
    其中,所述第二时间差是所述第二定位数据包括的时间和第二时间之间的时间差,所述第二时间是在第三时刻处所述第二时钟单元提供的所述第二主时钟时间,所述第三时刻是所述主时钟装置接收到所述第二定位数据的时刻。
  4. 根据权利要求1所述的主时钟装置,其特征在于,还包括:
    时间处理单元,与所述第一时钟单元连接,用于:
    记录第三时间,所述第三时间是在第四时刻处所述第一时钟单元提供的第一主时钟时间,所述第四时刻是所述主时钟装置接收到第三秒脉冲信号的时刻;
    计算第三时间差,所述第三时间差是所述主时钟装置接收到的第三定位数据所包括的时间与所述第三时间之间的时间差,所述第三定位数据与所述第三秒脉冲信号彼此对应;以及,
    将第四定位数据包括的第四时间转换为第五时间,所述第四定位数据是所述主时钟装置在所述第三定位数据之后接收到的定位数据,所述第五时间是基于所述第四时间和所述第三时间差确定的。
  5. 根据权利要求1所述的主时钟装置,其特征在于,所述主时钟装置还包括:
    接口单元,与所述第一时钟单元和所述第二时钟单元连接,用于向从时钟装置提供第一主时钟时间和第二主时钟时间。
  6. 根据权利要求5所述的主时钟装置,其特征在于,所述接口单元进一步用于通过广义精准时钟协议,向所述从时钟装置发送所述第一主时钟时间。
  7. 根据权利要求6所述的主时钟装置,其特征在于,
    所述接口单元进一步用于通过所述广义精准时钟协议周期性地向所述从时钟装置发送第一时间同步请求消息,
    其中,所述第一时间同步请求消息包括第六时间和第七时间,所述第六时间是在第五时刻处所述第一时钟单元提供的所述第一主时钟时间,所述第七时间是在所述第五时刻处所述第二时钟单元提供的所述第二主时钟时间,所述第五时刻是所述接口单元发送第一时间同步请求消息的时刻。
  8. 根据权利要求5所述的主时钟装置,其特征在于,
    所述接口单元进一步用于周期性地向所述从时钟装置发送第二时间同步请求消息,
    其中,所述第二时间同步请求消息包括第八时间和消息平均时延,所述第八时间是在第六时刻处所述第二时钟单元提供的第二主时钟时间,所述第六时刻是所述接口单元发送所述第二时间同步请求消息的时刻,所述消息平均时延指示在所述主时钟装置与所述从时钟装置之间进行消息传输所需的时间。
  9. 根据权利要求8所述的主时钟装置,其特征在于,
    所述接口单元进一步用于接收第二时间同步响应消息,
    其中,所述第二时间同步响应消息包括第九时间和第十时间,所述第九时间是在第七时刻处所述从时钟装置的第二从时钟时间,所述第十时间是在第八时刻处所述从时钟装置的第二从时钟时间,所述第七时刻是所述从时钟装置接收到所述第二时间同步请求消息的时刻,所述第八时刻是所述从时钟装置发送所述第二时间同步响应消息的时刻。
  10. 根据权利要求9所述主时钟装置,其特征在于,还包括:
    时间处理单元,与所述接口单元连接,用于:
    记录第十一时间,所述第十一时间是在第九时刻处所述第二时钟单元提供的第二主时钟时间,所述第九时刻是所述接口单元接收到所述第二时间同步响应消息的时刻;以及,
    基于所述第八时间、所述九时间、所述第十时间和所述第十一时间,计算所述消息平均时延。
  11. 一种从时钟装置,其特征在于,包括:
    接口单元,用于从主时钟装置接收第一主时钟时间和第二主时钟时间;
    第一时钟单元,用于提供第一从时钟时间,所述第一从时钟时间与所述第一主时钟时间同步;以及
    第二时钟单元,用于提供第二从时钟时间,所述第二从时钟时间与所述第二主时钟时间同步;
    其中,所述第一主时钟时间基于实时时钟信号,
    在所述主时钟装置接收到卫星信号时,所述第二主时钟时间基于所述卫星信号中的定位数据包括的时间,以及,在所述主时钟装置没有接收到卫星信号时,所述第二主时钟时间基于所述实时时钟信号。
  12. 根据权利要求11所述的从时钟装置,其特征在于,
    所述接口单元进一步用于通过广义精准时钟协议从所述主时钟装置接收所述第一主时钟时间。
  13. 根据权利要求12所述的从时钟装置,其特征在于,
    所述接口单元进一步用于从所述主时钟装置接收第一时间同步请求消息,
    其中,所述第一时间同步请求消息包括第一时间和第二时间,所述第一时间和所述第二时间分别是在第一时刻处所述主时钟装置提供的所述第一主时钟时间和所述第二主时钟时间,所述第一时刻是所述主时钟装置发送第一时间同步请求消息的时刻。
  14. 根据权利要求13所述的从时钟装置,其特征在于,还包括:
    时间处理单元,与所述接口单元连接,用于:
    计算第一时间差,所述第一时间差是所述第一时间和所述第二时间之间的时间差;以及
    基于所述第一时间差和第三时间来计算第四时间,其中,所述第三时间是在第二时刻处所述第一时钟单元提供的第一从时钟时间,所述第二时刻是所述接口单元接收到所述第一时间同步请求消息的时刻,
    其中,所述第二时钟单元进一步用于基于所述第四时间,提供所述第二从时钟时间。
  15. 根据权利要求11所述的从时钟装置,其特征在于,
    所述接口单元进一步用于从所述主时钟装置接收第二时间同步请求消息,
    其中,所述第二时间同步请求消息包括第五时间和消息平均时延,所述第五时间是在第三时刻处所述主时钟装置提供的所述第二主时钟时间,所述第三时刻是所述主时钟装置发送所述第二时间同步请求消息的时刻,所述消息平均时延指示在所述主时钟装置与所述从时钟装置之间进行消息传输所需的时间。
  16. 根据权利要求15所述的从时钟装置,其特征在于,还包括:
    时间处理单元,与所述接口单元连接,用于基于所述第五时间和所述消息平均时延,计算第六时间,
    所述第二时钟单元进一步用于基于所述第六时间,提供所述第二从时钟时间。
  17. 根据权利要求16所述的从时钟装置,其特征在于,
    所述接口单元进一步用于向所述主时钟装置发送第二时间同步响应消息,
    其中,所述第二时间同步响应消息包括第七时间和第八时间,所述第七时间是在第四时刻处所述第二时间单元提供的所述第二从时钟时间,所述第八时间是在第五时刻处所述第二时间单元提供的所述第二从时钟时间,所述第四时刻是所述接口单元接收到所述第二时间同步请求消息的时刻,所述第五时刻是所述接口单元发送所述第二时间同步响应消息的时刻。
  18. 一种时间系统,其特征在于,包括:
    权利要求1至10中任一项所述的主时钟装置;
    实时时钟信号源,用于向所述主时钟装置提供实时时钟信号;以及
    卫星信号接收装置,用于当接收到卫星信号时,将所接收的卫星信号提供给所述主时钟装置。
  19. 根据权利要求18所述的时间系统,其特征在于,还包括:利要求11至17中任一项所述的从时钟装置。
  20. 一种时钟同步方法,其特征在于,包括:
    主时钟装置基于实时时钟信号提供第一主时钟时间;以及
    所述主时钟装置在接收到卫星信号时,基于所接收的卫星信号中的第一定位数据所包括的时间来提供第二主时钟时间,以及,在没有接收到所述卫星信号时,基于所述实时时钟信号提供所述第二主时钟时间。
  21. 根据权利要求20所述的方法,其特征在于,所述基于所接收的卫星信号中的第一定位数据所包括的时间来提供第二主时钟时间包括:
    所述主时钟装置确定第一时间差,其中,所述第一时间差是第一时刻和第二时刻之间的时间差,所述第一时刻是所述主时钟装置接收到第一秒脉冲信号的时刻,所述第二时刻是所述主时钟装置接收到所述第一定位数据的时刻,所述第一秒脉冲信号和所述第一定位数据包含于所述卫星信号中并彼此对应;
    所述主时钟装置基于所述第一定位数据包括的时间和所述第一时间差,确定第一时间;以及
    所述主时钟装置基于所述第一时间,提供所述第二主时钟时间。
  22. 根据权利要求21所述的方法,其特征在于,还包括:
    所述主时钟装置计算第二时间差,作为所述主时钟装置接收到的第二定位数据的传输时延;
    其中,所述第二时间差是所述第二定位数据包括的时间和第二时间之间的时间差,所述第二时间是在第三时刻处所述主时钟装置提供的所述第二主时钟时间,所述第三时刻是所述主时钟装置接收到所述第二定位数据的时刻。
  23. 根据权利要求20所述的方法,其特征在于,还包括:
    所述主时钟装置记录第三时间,所述第三时间是在第四时刻处所述主时钟装置提供的第一主时钟时间,所述第四时刻是所述主时钟装置接收到第三秒脉冲信号的时刻;
    所述主时钟装置计算第三时间差,所述第三时间差是所述主时钟装置接收到的第三定位数据所包括的时间与所述第三时间之间的时间差,所述第三定位数据与所述第三秒脉冲信号彼此对应;以及,
    所述主时钟装置将第四定位数据包括的第四时间转换为第五时间,所述第四定位数据是所述主时钟装置在所述第三定位数据之后接收到的定位数据,所述第五时间是基于所述第四时间和所述第三时间差确定的。
  24. 根据权利要求20所述的方法,其特征在于,还包括:
    所述主时钟装置向从时钟装置提供第一主时钟时间和第二主时钟时间。
  25. 根据权利要求24所述的方法,其特征在于,所述主时钟装置向从时钟装置提供第一主时钟时间和第二主时钟时间包括:
    所述主时钟装置通过广义精准时钟协议,向所述从时钟装置发送所述第一主时钟时间。
  26. 根据权利要求25所述的方法,其特征在于,所述主时钟装置向从时钟装置提供第一主时钟时间和第二主时钟时间还包括:
    所述主时钟装置通过所述广义精准时钟协议周期性地向所述从时钟装置发送第一时间同步请求消息,
    其中,所述第一时间同步请求消息包括第六时间和第七时间,所述第六时间是在第五时刻处所述主时钟装置提供的所述第一主时钟时间,所述第七时间是在所述第五时刻处所述主时钟装置提供的所述第二主时钟时间,所述第五时刻是接口单元发送第一时间同步请求消息的时刻。
  27. 根据权利要求24所述的方法,其特征在于,所述主时钟装置向从时钟装置提供第一主时钟时间和第二主时钟时间包括:
    所述主时钟装置周期性地向所述从时钟装置发送第二时间同步请求消息;
    其中,所述第二时间同步请求消息包括第八时间和消息平均时延,所述第八时间是在第六时刻处所述主时钟装置提供的第二主时钟时间,所述第六时刻是所述主时钟装置发送所述第二时间同步请求消息的时刻,所述消息平均时延指示在所述主时钟装置与所述从时钟装置之间进行消息传输所需的时间。
  28. 根据权利要求27所述的方法,其特征在于,所述主时钟装置向从时钟装置提供第一主时钟时间和第二主时钟时间还包括:
    所述主时钟装置接收第二时间同步响应消息;
    其中,所述第二时间同步响应消息包括第九时间和第十时间,所述第九时间是在第七时刻处所述从时钟装置提供的第二从时钟时间,所述第十时间是在第八时刻处所述从时钟装置提供的第二从时钟时间,所述第七时刻是所述从时钟装置接收到所述第二时间同步请求消息的时刻,所述第八时刻是所述从时钟装置发送所述第二时间同步响应消息的时刻。
  29. 根据权利要求28所述的方法,其特征在于,所述主时钟装置向从时钟装置提供第一主时钟时间和第二主时钟时间还包括:
    所述主时钟装置记录第十一时间,所述第十一时间是在第九时刻处所述主时钟装置提供的第二主时钟时间,所述第九时刻是所述主时钟装置接收到所述第二时间同步响应消息的时刻;以及,
    所述主时钟装置基于所述第八时间、所述第九时间、所述第十时间和所述第十一时间,计算所述消息平均时延。
  30. 一种时钟同步方法,其特征在于,包括:
    从时钟装置从主时钟装置接收第一主时钟时间和第二主时钟时间;
    所述从时钟装置提供第一从时钟时间,所述第一从时钟时间与所述第一主时钟时间同步;以及
    所述从时钟装置提供第二从时钟时间,所述第二从时钟时间与所述第二主时钟时间同步;
    其中,所述第一主时钟时间基于实时时钟信号,
    所述第二主时钟时间在所述主时钟装置接收到卫星信号时,基于所述卫星信号中的定位数据所包括的时间,以及,在所述主时钟装置没有接收到所述卫星信号时,基于所述实时时钟信号。
  31. 根据权利要求30所述的方法,其特征在于,从时钟装置从主时钟装置接收第一主时钟时间和第二主时钟时间包括:
    所述从时钟装置通过广义精准时钟协议从所述主时钟装置接收所述第一主时钟时间。
  32. 根据权利要求31所述的方法,其特征在于,从时钟装置从主时钟装置接收第一主时钟时间和第二主时钟时间还包括:
    所述从时钟装置从所述主时钟装置接收第一时间同步请求消息,
    其中,所述第一时间同步请求消息包括第一时间和第二时间,所述第一时间和所述第二时间分别是在第一时刻处所述主时钟装置提供的所述第一主时钟时间和所述第二主时钟时间,所述第一时刻是所述主时钟装置发送第一时间同步请求消息的时刻。
  33. 根据权利要求32所述的方法,其特征在于,所述从时钟装置提供第二从时钟时间包括:
    所述从时钟装置计算第一时间差,所述第一时间差是所述第一时间和所述第二时间之间的时间差;
    所述从时钟装置基于所述第一时间差和第三时间来计算第四时间,其中,所述第三时间是在第二时刻处所述从时钟装置提供的第一从时钟时间,所述第二时刻是所述从时钟装置接收到所述第一时间同步请求消息的时刻;以及
    所述从时钟装置基于所述第四时间,提供所述第二从时钟时间。
  34. 根据权利要求30所述的方法,其特征在于,从时钟装置从主时钟装置接收第一主时钟时间和第二主时钟时间包括:
    所述从时钟装置从所述主时钟装置接收第二时间同步请求消息;
    其中,所述第二时间同步请求消息包括第五时间和消息平均时延,所述第五时间是在第三时刻处所述主时钟装置提供的所述第二主时钟时间,所述第三时刻是所述主时钟装置发送所述第二时间同步请求消息的时刻,所述消息平均时延指示在所述主时钟装置与所述从时钟装置之间进行消息传输所需的时间。
  35. 根据权利要求34所述的方法,其特征在于,所述从时钟装置提供第二从时钟时间包括:
    所述从时钟装置基于所述第五时间和所述消息平均时延,计算第六时间;以及
    所述从时钟装置基于所述第六时间,提供所述第二从时钟时间。
  36. 根据权利要求35所述的方法,其特征在于,还包括:
    所述从时钟装置向所述主时钟装置发送第二时间同步响应消息;
    其中,所述第二时间同步响应消息包括第七时间和第八时间,所述第七时间是在第四时刻处所述从时钟装置提供的所述第二从时钟时间,所述第八时间是在第五时刻处所述从时钟装置提供的所述第二从时钟时间,所述第四时刻是所述从时钟装置接收到所述第二时间同步请求消息的时刻,所述第五时刻是所述从时钟装置发送所述第二时间同步响应消息的时刻。
  37. 一种计算设备,其特征在于,包括:
    总线;
    通信接口,其与所述总线连接;
    至少一个第一处理器,其与所述总线连接;以及
    至少一个存储器,其与所述总线连接并存储有程序指令,所述程序指令当被所述至少一个第一处理器执行时使得所述至少一个第一处理器执行权利要求20至29中任一项所述的方法。
  38. 一种计算设备,其特征在于,包括:
    总线;
    通信接口,其与所述总线连接;
    至少一个第二处理器,其与所述总线连接;以及
    至少一个存储器,其与所述总线连接并存储有程序指令,所述程序指令当被所述至少一个第二处理器执行时使得所述至少一个第二处理器执行权利要求30至36中任一项所述的方法。
  39. 一种计算机可读存储介质,其上存储有程序指令,其特征在于,所述程序指令当被第一计算机执行时使得所述第一计算机执行权利要求20至29中任一项所述的方法。
  40. 一种计算机可读存储介质,其上存储有程序指令,其特征在于,所述程序指令当被第二计算机执行时使得所述第二计算机执行权利要求30至36中任一项所述的方法。
PCT/CN2021/124454 2020-12-18 2021-10-18 主时钟装置、从时钟装置和时间同步方法 WO2022127337A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011501257.7 2020-12-18
CN202011501257.7A CN114647179A (zh) 2020-12-18 2020-12-18 主时钟装置、从时钟装置和时间同步方法

Publications (1)

Publication Number Publication Date
WO2022127337A1 true WO2022127337A1 (zh) 2022-06-23

Family

ID=81990594

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/124454 WO2022127337A1 (zh) 2020-12-18 2021-10-18 主时钟装置、从时钟装置和时间同步方法

Country Status (2)

Country Link
CN (1) CN114647179A (zh)
WO (1) WO2022127337A1 (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103546268A (zh) * 2013-10-15 2014-01-29 瑞斯康达科技发展股份有限公司 一种系统时间的补偿方法及设备
US20140056318A1 (en) * 2012-08-24 2014-02-27 Accedian Networks Inc. System for establishing and maintaining a clock reference indicating one-way latency in a data network
CN106712888A (zh) * 2016-12-30 2017-05-24 江汉大学 一种高稳时基信号输出系统
CN108107711A (zh) * 2017-12-19 2018-06-01 江汉大学 一种时钟源装置

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100912808B1 (ko) * 2007-07-11 2009-08-18 한국전자통신연구원 위성항법수신기를 이용한 차량용 시각동기
DE102011087472B4 (de) * 2011-11-30 2016-10-20 Continental Automotive Gmbh Verfahren zur Synchronisation von Uhren in Knoten eines Fahrzeugnetzes und zur Durchführung des Verfahrens eingerichteter Knoten
US9369225B2 (en) * 2012-10-01 2016-06-14 Intel Deutschland Gmbh Distribution of an electronic reference clock signal that includes delay and validity information
CN103913753B (zh) * 2014-04-14 2017-01-18 杨坤 一种利用导航卫星的高精度授时系统及方法
CN108628156A (zh) * 2018-03-15 2018-10-09 中国人民解放军63895部队 一种高精度计算机串口授时方法
CN111381487B (zh) * 2018-12-29 2022-01-11 阿里巴巴集团控股有限公司 多传感器同步授时系统、方法、装置及电子设备
CN110620632B (zh) * 2019-09-12 2021-02-23 华为技术有限公司 一种时间同步方法及装置
JP7385033B2 (ja) * 2019-11-20 2023-11-21 華為技術有限公司 自動運転のための時間源を提供するための方法および装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140056318A1 (en) * 2012-08-24 2014-02-27 Accedian Networks Inc. System for establishing and maintaining a clock reference indicating one-way latency in a data network
CN103546268A (zh) * 2013-10-15 2014-01-29 瑞斯康达科技发展股份有限公司 一种系统时间的补偿方法及设备
CN106712888A (zh) * 2016-12-30 2017-05-24 江汉大学 一种高稳时基信号输出系统
CN108107711A (zh) * 2017-12-19 2018-06-01 江汉大学 一种时钟源装置

Also Published As

Publication number Publication date
CN114647179A (zh) 2022-06-21

Similar Documents

Publication Publication Date Title
US10788841B2 (en) Hardware centralized time synchronization hub for an autonomous driving vehicle
WO2020135382A1 (zh) 多传感器同步授时系统、方法、装置及电子设备
EP3614687B1 (en) A gps based high precision timestamp generation circuit for an autonomous driving vehicle
EP3613648B1 (en) A time source recovery system for an autonomous driving vehicle
WO2021047271A1 (zh) 一种时间同步方法及装置
EP3614222B1 (en) A time source ranking system for an autonomous driving vehicle
US20220278745A1 (en) Method and apparatus for providing time source for autonomous driving
CN112929122A (zh) 时间同步方法、装置、终端设备及计算机可读存储介质
US20200116502A1 (en) Sensor integration and synchronization unit for an autonomous driving vehicle
CN111600670B (zh) 感应数据计算控制方法以及授时装置
KR20210105918A (ko) 자율 주행 차량의 동기화 센서
CN113992469B (zh) 数据融合方法、装置、电子设备和计算机可读介质
WO2022127337A1 (zh) 主时钟装置、从时钟装置和时间同步方法
US20200228219A1 (en) Synchronization of components by a control unit
WO2023141817A1 (zh) 一种时间同步方法、装置及存储介质
CN113890665A (zh) 一种时间同步方法、系统、存储介质及处理器
US11604439B2 (en) GNSS time synchronization in redundant systems
CN113342899B (zh) 一种数据同步获取方法、装置及系统
WO2023044802A1 (zh) 时间同步方法及相关装置
CN115685270A (zh) 用于提供时间服务的方法、装置、电子设备及fpga芯片
CN116743300A (zh) 多传感器时钟同步方法和系统
CN116068603A (zh) 一种具有多时钟的自动导航驾驶系统
CN117978317A (zh) 一种时间校正的装置、方法及智能车辆
KR20170050977A (ko) Gps 신호를 생성하기 위한 방법 및 장치

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: 21905266

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21905266

Country of ref document: EP

Kind code of ref document: A1