WO2022179605A1 - 时间同步方法、装置、车载设备及存储介质 - Google Patents

时间同步方法、装置、车载设备及存储介质 Download PDF

Info

Publication number
WO2022179605A1
WO2022179605A1 PCT/CN2022/077925 CN2022077925W WO2022179605A1 WO 2022179605 A1 WO2022179605 A1 WO 2022179605A1 CN 2022077925 W CN2022077925 W CN 2022077925W WO 2022179605 A1 WO2022179605 A1 WO 2022179605A1
Authority
WO
WIPO (PCT)
Prior art keywords
time
synchronization
communication data
vehicle
vehicle device
Prior art date
Application number
PCT/CN2022/077925
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 广州导远电子科技有限公司
Priority to EP22758969.4A priority Critical patent/EP4300853A1/en
Publication of WO2022179605A1 publication Critical patent/WO2022179605A1/zh
Priority to US18/454,993 priority patent/US20230396349A1/en

Links

Images

Classifications

    • 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
    • H04J3/0658Clock or time synchronisation among packet nodes
    • H04J3/0661Clock or time synchronisation among packet nodes using timestamps
    • H04J3/0664Clock or time synchronisation among packet nodes using timestamps unidirectional timestamps
    • 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
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01CMEASURING DISTANCES, LEVELS OR BEARINGS; SURVEYING; NAVIGATION; GYROSCOPIC INSTRUMENTS; PHOTOGRAMMETRY OR VIDEOGRAMMETRY
    • G01C21/00Navigation; Navigational instruments not provided for in groups G01C1/00 - G01C19/00
    • G01C21/26Navigation; Navigational instruments not provided for in groups G01C1/00 - G01C19/00 specially adapted for navigation in a road network
    • G01C21/34Route searching; Route guidance
    • G01C21/3446Details of route searching algorithms, e.g. Dijkstra, A*, arc-flags, using precalculated routes
    • GPHYSICS
    • G07CHECKING-DEVICES
    • G07CTIME OR ATTENDANCE REGISTERS; REGISTERING OR INDICATING THE WORKING OF MACHINES; GENERATING RANDOM NUMBERS; VOTING OR LOTTERY APPARATUS; ARRANGEMENTS, SYSTEMS OR APPARATUS FOR CHECKING NOT PROVIDED FOR ELSEWHERE
    • G07C5/00Registering or indicating the working of vehicles
    • G07C5/008Registering or indicating the working of vehicles communicating information to a remotely located station
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/02Details
    • H04L12/12Arrangements for remote connection or disconnection of substations or of equipment thereof
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L12/40006Architecture of a communication node
    • H04L12/40013Details regarding a bus controller
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W56/00Synchronisation arrangements
    • H04W56/001Synchronization between nodes
    • H04W56/002Mutual synchronization
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Definitions

  • the present application relates to the field of computer technology, and in particular, to a time synchronization method, apparatus, vehicle-mounted device, and storage medium.
  • Intelligent driving is an important starting point for the combination of industrial revolution and informatization. It will be able to change the flow of people, resource elements and products, and subversively change human life. Intelligent driving refers to the technology that machines help people to drive and completely replace human driving under special circumstances.
  • the purpose of the embodiments of the present application is to provide a time synchronization method, apparatus, vehicle-mounted device, and storage medium, so as to solve the problem of signal time asynchrony between vehicle-mounted devices.
  • an embodiment of the present application provides a time synchronization method for an in-vehicle device, which is applied to a first in-vehicle device, and the first in-vehicle device is communicatively connected to the second in-vehicle device.
  • the method includes:
  • the second communication data sent by the second in-vehicle device is received, and the second reception time when the second communication data is received is recorded, and the second communication data includes the data of the first communication data. sending time;
  • time synchronization is performed on the first in-vehicle device.
  • the second in-vehicle device by receiving the first communication data sent by the second in-vehicle device, recording the first reception time, and performing rough time alignment on the first in-vehicle device based on the data generation time in the first communication data, thereby Preliminary time synchronization is performed on the first on-board device; after the time of the first on-board device is roughly aligned, the second communication data sent by the second on-board device is received, and the second receiving time and the second receiving time based on the first receiving time and the second receiving time are recorded.
  • the data transmission time to determine the synchronization time of the first in-vehicle device and the second in-vehicle device, so as to perform time synchronization correction on the first in-vehicle device after preliminary time synchronization based on the synchronization time to improve the synchronization accuracy.
  • determining the synchronization time at which the first in-vehicle device is synchronized with the second in-vehicle device includes:
  • the calculation formula calculates the synchronization time between the first vehicle-mounted device and the second vehicle-mounted device.
  • the time difference between the first in-vehicle device and the second in-vehicle device is calculated based on the two receiving times of the communication data, so as to realize low-cost device time synchronization without changing the device hardware.
  • time synchronization is performed on the first in-vehicle device, including:
  • the synchronization time is further corrected by the Kalman filter, so as to correct the error influence caused by the transmission delay and the interruption delay, to further improve the time synchronization accuracy, and to improve the anti-interference performance of the time synchronization process.
  • error correction is performed on the synchronization time to obtain the target synchronization time, including:
  • the synchronization time is updated to obtain the target synchronization time.
  • the current time, the time increment and the preset transmission delay are used as the state vector to correct the error influence of the interruption delay of the communication data on the synchronization time, thereby improving the time synchronization accuracy.
  • the synchronization time is updated according to the observation vector and the state vector to obtain the target synchronization time, including:
  • the synchronization time is updated to obtain the target synchronization time.
  • the observation vector defines the change rule of the observation vector with the state change
  • the synchronization time is a linear function of the local clock
  • the scale and offset of the local clock are included in the local clock error, so as to be corrected by the Kalman filter The adverse effect of local clock errors on synchronization time.
  • an embodiment of the present application provides a time synchronization method for an in-vehicle device, which is applied to a second in-vehicle device, where the second in-vehicle device is communicatively connected to one or more first in-vehicle devices, and the method includes:
  • the first communication data includes the data generation time of the first communication data, and the first communication data is used for the first vehicle-mounted device to record the first reception time when the first communication data is received, The data generation moment is used to perform rough time alignment on the first vehicle-mounted device;
  • the second communication data is sent to the first on-board device.
  • the second communication data is used by the first on-board device to record the second receiving time when the second communication data is received.
  • the second communication data The data transmission time including the first communication data, the first reception time, the second reception time and the data transmission time are used for the first in-vehicle device to determine the synchronization time to be synchronized with the second in-vehicle device, and to perform time synchronization based on the synchronization time.
  • an embodiment of the present application provides a time synchronization device for an in-vehicle device, which is applied to a first in-vehicle device, where the first in-vehicle device is communicatively connected to the second in-vehicle device, and the method includes:
  • a first receiving module configured to receive the first communication data sent by the second vehicle-mounted device, and record the first reception moment when the first communication data is received, and the first communication data includes the data generation moment of the first communication data;
  • an alignment module for performing rough time alignment on the first vehicle-mounted device based on the moment of data generation
  • the second receiving module is used to receive the second communication data sent by the second in-vehicle device after the first in-vehicle device performs rough time alignment, and record the second reception time when the second communication data is received, the second communication data the data sending moment including the first communication data;
  • a determining module configured to determine the synchronization time at which the first vehicle-mounted device is synchronized with the second vehicle-mounted device based on the first receiving moment, the second receiving moment and the data sending moment;
  • the synchronization module is configured to perform time synchronization on the first in-vehicle device based on the synchronization time.
  • an embodiment of the present application provides a time synchronization device for an in-vehicle device, which is applied to a second in-vehicle device, where the second in-vehicle device is communicatively connected to one or more first in-vehicle devices, and the method includes:
  • the first sending module is used for sending the first communication data to the first in-vehicle device, the first communication data includes the data generation time of the first communication data, and the first communication data is used for the first in-vehicle device to record and receive the first communication data
  • the first receiving moment of time, the data generation moment is used to perform rough time alignment on the first vehicle-mounted device
  • the second sending module is used for sending the second communication data to the first in-vehicle device after the time of the first in-vehicle device is roughly aligned, and the second communication data is used for the first in-vehicle device to record the second communication data when the second communication data is received.
  • the reception time, the second communication data includes the data transmission time of the first communication data, the first reception time, the second reception time and the data transmission time are used for the first in-vehicle device to determine the synchronization time to be synchronized with the second in-vehicle device, and based on the synchronization Time is time synchronized.
  • an embodiment of the present application provides an in-vehicle device, including a memory and a processor, where the memory is used to store a computer program, and the processor runs the computer program to make the in-vehicle device execute the time synchronization method of the first aspect or the second aspect.
  • embodiments of the present application provide a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, implements the time synchronization method of the first aspect or the second aspect.
  • FIG. 1 is a schematic flowchart of a time synchronization method provided by an embodiment of the present application
  • FIG. 2 is a schematic flowchart of another time synchronization method provided by an embodiment of the present application.
  • FIG. 3 is a schematic structural diagram of a time synchronization apparatus provided by an embodiment of the present application.
  • FIG. 4 is a schematic structural diagram of another time synchronization apparatus provided by an embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of a vehicle-mounted device provided by an embodiment of the present application.
  • each sensor adds a hard wire and uses an electrical pulse signal for synchronization.
  • each sensor needs to redesign the hardware, which increases the cost and difficulty of circuit wiring, poor anti-interference of pulse signal, easy to trigger falsely, and can only synchronize relative time.
  • the present application provides a time synchronization method for an in-vehicle device, by receiving first communication data sent by a second in-vehicle device, recording the first reception time, and At the moment of data generation, the first in-vehicle device is roughly time aligned, so as to perform preliminary time synchronization on the first in-vehicle device; after the time of the first in-vehicle device is roughly aligned, the second communication data sent by the second in-vehicle device is received, and the Record the second receiving time and determine the synchronization time at which the first in-vehicle device is synchronized with the second in-vehicle device based on the first receiving time, the second receiving time and the data transmission time, so as to determine the synchronization time of the first in-vehicle device after preliminary synchronization based on the synchronization time.
  • the device performs time synchronization correction to improve synchronization accuracy.
  • FIG. 1 shows a flowchart of an implementation of a time synchronization method provided by an embodiment of the present application.
  • the following time synchronization method in this embodiment of the present application can be applied to a first in-vehicle device.
  • the first in-vehicle device is communicatively connected to the second in-vehicle device. devices such as sensors.
  • the time synchronization method in this embodiment of the present application includes steps S101 to S105, which are described in detail as follows:
  • Step S101 Receive the first communication data sent by the second vehicle-mounted device, and record the first reception time, where the first communication data includes the data generation time of the first communication data.
  • the first in-vehicle device is a synchronization device that needs to perform time synchronization
  • the second in-vehicle device is a synchronization device used as a reference time.
  • the communication mode between the first in-vehicle device and the second in-vehicle device may be a controller area network (Controller Area Network, CAN), a local area interconnect network (Local Interconnect Network, LIN), and Ethernet.
  • CAN Controller Area Network
  • LIN Local area interconnect network
  • Ethernet Ethernet
  • the communication mode is CAN
  • the communication data is CAN message data
  • the communication mode is LIN
  • SCI UART
  • the present embodiment uses CAN as the communication mode to describe and explain the time synchronization method.
  • the second in-vehicle device generates a CAN data packet CANMsg(T1) in a specific format at time T1, CANMsg(T1) contains time information of the data generation time T1, and transmits it to the mailbox of the CAN bus. Due to the CAN mechanism, it is determined that CANMsg(T1) will not be issued immediately, but will be issued when the bus is allowed.
  • the second in-vehicle device can record the data sending time T2.
  • the first in-vehicle device receives the CANMsg (T1), it records the first receiving time T1r when the data is received.
  • the second vehicle-mounted device may be synchronized to a reference time, and the reference time may be UTC time or local time.
  • UTC comes from the Gnss module. After obtaining the UTC time from the message of the Gnss module, the timing is reset, and high-precision synchronization is performed according to the second pulse provided by the Gnss module.
  • Step S102 based on the data generation time, perform rough time alignment on the first in-vehicle device.
  • the timer of the first vehicle-mounted device is immediately assigned, so that the timer of the first vehicle-mounted device is synchronized to the data generation time, and the rough time alignment is completed, so as to facilitate the realization of Subsequent precise synchronization.
  • Step S103 after the time of the first vehicle-mounted device is roughly aligned, the second communication data sent by the second vehicle-mounted device is received, and the second reception time is recorded, and the second communication data includes the data transmission time of the first communication data.
  • CAN data can only be sent when the CAN bus is permitted, so when the first communication data is received, the first in-vehicle device cannot parse out the first communication data from the first communication data.
  • the data transmission time of the communication data after the time of the first on-board device is roughly aligned, the second on-board device repackages the recorded data sending time T2 into specific CAN information CANMsg(T2), just like the sending process of the first communication data, CANMsg(T2 ) information will be sent to the CAN bus, and sent out after the CAN bus allows it.
  • the first in-vehicle device receives the CANMsg (T2), it records the second receiving time T2r, and analyzes the time information to the data sending time T2.
  • Step S104 Determine the synchronization time at which the first in-vehicle device is synchronized with the second in-vehicle device based on the first receiving time, the second receiving time and the data sending time.
  • the first in-vehicle device obtains the data generation time, data sending time, first receiving time and second receiving time.
  • the time difference between the in-vehicle device and the second in-vehicle device can obtain the synchronization time.
  • determining the synchronization time at which the first in-vehicle device is synchronized with the second in-vehicle device based on the first reception time, the second reception time and the data transmission time includes: calculating the first in-vehicle device according to a preset calculation formula.
  • the time difference between the first in-vehicle device and the second in-vehicle device is calculated based on the two receiving times of the communication data, so as to realize low-cost device time synchronization without changing the device hardware.
  • Step S105 based on the synchronization time, perform time synchronization on the first in-vehicle device.
  • the first in-vehicle device is synchronized to the synchronization time.
  • this embodiment performs error correction on the synchronization time.
  • performing time synchronization on the first in-vehicle device based on the synchronization time includes: performing error correction on the synchronization time based on a preset Kalman filter to obtain a target synchronization time; synchronizing the time of the first in-vehicle device; to the target synchronization time.
  • the Kalman filter is an algorithm for optimally estimating the system state by using the linear system state equation and inputting and outputting observation data of the system.
  • the synchronization time is further corrected by the Kalman filter, so as to correct the error influence caused by the transmission delay and the interruption delay, further improve the time synchronization precision, and improve the anti-interference performance of the time synchronization process.
  • performing error correction on the synchronization time based on the preset Kalman filter to obtain the target synchronization time including: constructing the observation vector of the Kalman filter according to the synchronization time and the clock unit of the first vehicle-mounted device; Based on the current time, time increment and preset transmission delay of the first vehicle-mounted device, the state vector of the Kalman filter is determined; the synchronization time is updated according to the observation vector and the state vector to obtain the target synchronization time.
  • an observation vector is established: where T re is the synchronization time and T sec is the timing unit of the local clock.
  • build state vector x t is the current moment
  • dx t is each time increment
  • l t is the preset transmission delay. Since the interrupt delay is a fixed value, the adverse effect of the interrupt delay on the synchronization time can be corrected when Tre is obtained.
  • the observation vector and the state vector are input to the Kalman filter to update the state of the synchronization time, and finally the target synchronization time is obtained.
  • the current time, the time increment and the preset transmission delay are used as the state vector to correct the error influence of the interruption delay of the communication data on the synchronization time, thereby improving the time synchronization accuracy.
  • the synchronization time is updated to obtain the target synchronization time, including: calculating the state transition matrix of the Kalman filter according to the state vector; updating the covariance matrix of the state vector according to the state transition matrix; According to the covariance matrix, the Kalman gain matrix of the Kalman filter is calculated; according to the observation vector and the Kalman gain matrix, the synchronization time is updated to obtain the target synchronization time.
  • x t x t-1 +dx t-1 -l t
  • dx t dx t-1
  • l t l t-1
  • the kinematics formula of the state transition matrix can determine that the state transition matrix is: Based on the state transition matrix, update the covariance matrix of the state vector where Q is the system noise. Compute the Kalman gain matrix: Where R is the observation noise, H is the observation matrix; complete the state update:
  • the observation matrix H defines the change law of the observation vector with the state
  • the synchronization time is a linear function of the local clock
  • the scale and offset of the local clock are included in the local clock error.
  • the system noise Q which can be derived from the simulation results, can be used as a preset value for the Kalman filter.
  • the observation noise R can be considered as a related quantity of the stability of the crystal oscillator, and can also be used as a preset value of the Kalman filter. It can be seen that the time information obtained by the first in-vehicle device through CAN is corrected, and the local clock deviation of the first in-vehicle device itself due to the crystal oscillator error is also corrected.
  • FIG. 2 shows a flowchart for implementing a time synchronization method provided by an embodiment of the present application.
  • the following time synchronization method in this embodiment of the present application can be applied to a second in-vehicle device.
  • the first in-vehicle device is communicatively connected to the second in-vehicle device. devices such as sensors.
  • the time synchronization method in this embodiment of the present application includes steps S201 to S202, which are described in detail as follows:
  • Step S201 sending first communication data to the first in-vehicle device, the first communication data includes the data generation time of the first communication data, and the first communication data is used by the first in-vehicle device to record the first reception of the first communication data. time, the data generation time is used to perform rough time alignment on the first vehicle-mounted device;
  • Step S202 after the time of the first on-board device is roughly aligned, the second communication data is sent to the first on-board device, and the second communication data is used for the first on-board device to record the second receiving moment of the second communication data, and the second The communication data includes the data sending time of the first communication data.
  • the first receiving time, the second receiving time and the data sending time are used for the first in-vehicle device to determine the synchronization time to be synchronized with the second in-vehicle device, and to perform time synchronization based on the synchronization time.
  • the second in-vehicle device can realize time synchronization for a plurality of first in-vehicle devices, supports a mode of one master and multiple slaves, and improves the efficiency of time synchronization.
  • steps S201 and S202 in the foregoing steps reference may be made to the explanation of the steps in the foregoing steps S101 to S105, which will not be repeated here.
  • FIG. 3 is a structural block diagram of a time synchronization apparatus provided by an embodiment of the present application.
  • each module included in the apparatus is used to execute each step in the embodiment corresponding to FIG. 1 .
  • FIG. 1 and the related description in the embodiment corresponding to FIG. 1 For the convenience of description, only the part related to this embodiment is shown, and the time synchronization apparatus provided by the embodiment of this application includes:
  • the first receiving module 301 is configured to receive the first communication data sent by the second in-vehicle device, and record the first reception time, where the first communication data includes the data generation time of the first communication data;
  • an alignment module 302 configured to perform rough time alignment on the first vehicle-mounted device based on the moment of data generation
  • the second receiving module 303 is configured to receive the second communication data sent by the second in-vehicle device after the time of the first in-vehicle device is roughly aligned, and record the second reception time, where the second communication data includes the data transmission of the first communication data time;
  • a determination module 304 configured to determine the synchronization time at which the first vehicle-mounted device is synchronized with the second vehicle-mounted device based on the first receiving moment, the second receiving moment and the data sending moment;
  • the synchronization module 305 is configured to perform time synchronization on the first in-vehicle device based on the synchronization time.
  • the determining module 304 includes:
  • the synchronization module 305 includes:
  • the correction unit is used for performing error correction on the synchronization time based on the preset Kalman filter to obtain the target synchronization time;
  • the synchronization unit is used for synchronizing the time of the first vehicle-mounted device to the target synchronization time.
  • the correction unit includes:
  • a determination subunit for determining the state vector of the Kalman filter based on the current moment, the time increment and the preset transmission delay of the first vehicle-mounted device
  • the update subunit is used to update the synchronization time according to the observation vector and the state vector to obtain the target synchronization time.
  • the subunit is updated, specifically for:
  • the synchronization time is updated to obtain the target synchronization time.
  • FIG. 4 is a structural block diagram of a time synchronization apparatus provided by an embodiment of the present application.
  • the modules included in the apparatus are used to execute the steps in the embodiment corresponding to FIG. 2 .
  • FIG. 2 and the related descriptions in the embodiment corresponding to FIG. 2 For the convenience of description, only the part related to this embodiment is shown, and the time synchronization apparatus provided by the embodiment of this application includes:
  • the first sending module 401 is configured to send the first communication data to the first in-vehicle device, the first communication data includes the data generation time of the first communication data, and the first communication data is used for the first in-vehicle device to record the receipt of the first communication
  • the first reception moment of the data, and the data generation moment is used to perform rough time alignment on the first vehicle-mounted device;
  • the second sending module 402 is configured to send the second communication data to the first in-vehicle device after the time of the first in-vehicle device is roughly aligned, and the second communication data is used for the first in-vehicle device to record the second communication data that has received the second communication data.
  • the reception time, the second communication data includes the data transmission time of the first communication data, the first reception time, the second reception time and the data transmission time are used for the first in-vehicle device to determine the synchronization time to be synchronized with the second in-vehicle device, and based on the synchronization Time is time synchronized.
  • FIG. 5 is a schematic structural diagram of a vehicle-mounted device provided by an embodiment of the present application.
  • the in-vehicle device 5 of this embodiment includes: at least one processor 50 (only one is shown in FIG. 5 ), a processor, a memory 51 , and a processor 51 stored in the memory 51 and capable of processing in the at least one A computer program 52 running on the processor 50, the processor 50 implements the steps in any of the above method embodiments when the computer program 52 is executed.
  • the in-vehicle device 5 may be an in-vehicle computer, an in-vehicle audio system, an in-vehicle smart rearview mirror, an in-vehicle sensor and other smart devices.
  • the in-vehicle device may include, but is not limited to, the processor 50 and the memory 51 .
  • FIG. 5 is only an example of the in-vehicle device 5 , and does not constitute a limitation on the in-vehicle device 5 , and may include more or less components than shown, or combine some components, or different components , for example, may also include input and output devices, network access devices, and the like.
  • the so-called processor 50 may be a central processing unit (Central Processing Unit, CPU), and the processor 50 may also be other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuits) , ASIC), off-the-shelf programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • the memory 51 may be an internal storage unit of the in-vehicle device 5 in some embodiments, such as a hard disk or a memory of the in-vehicle device 5 .
  • the memory 51 may also be an external storage device of the vehicle-mounted device 5, such as a plug-in hard disk equipped on the vehicle-mounted device 5, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, flash memory card (Flash Card), etc.
  • the memory 51 may also include both an internal storage unit of the in-vehicle device 5 and an external storage device.
  • the memory 51 is used to store an operating system, an application program, a boot loader (Boot Loader), data, and other programs, such as program codes of the computer program, and the like.
  • the memory 51 can also be used to temporarily store data that has been output or will be output.
  • an embodiment of the present application further provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the foregoing method embodiments can be implemented.
  • the embodiments of the present application provide a computer program product, when the computer program product runs on the in-vehicle device, the in-vehicle device can implement the steps in the above method embodiments when the in-vehicle device is executed.
  • each block in the flowchart or block diagrams may represent a module, segment, or portion of code that contains one or more functions for implementing the specified logical function(s) executable instructions. It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures.
  • each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations can be implemented in dedicated hardware-based systems that perform the specified functions or actions , or can be implemented in a combination of dedicated hardware and computer instructions.
  • each functional module in each embodiment of the present application may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.
  • the functions are implemented in the form of software function modules and sold or used as independent products, they can 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 (ROM, Read-Only Memory), Random Access Memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program codes .

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Radar, Positioning & Navigation (AREA)
  • Remote Sensing (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Health & Medical Sciences (AREA)
  • Automation & Control Theory (AREA)
  • Synchronisation In Digital Transmission Systems (AREA)

Abstract

本申请提供一种车载设备的时间同步方法、装置、车载设备及存储介质,时间同步方法通过接收第二车载设备发送的第一通信数据,并记录第一接收时刻,以及基于第一通信数据中的数据生成时刻,对第一车载设备进行时间粗对准,从而对第一车载设备进行时间初步同步;在第一车载设备时间粗对准后,接收第二车载设备发送的第二通信数据,并记录第二接收时刻以及基于第一接收时刻、第二接收时刻和数据发送时刻,确定第一车载设备与第二车载设备同步的同步时间,从而基于同步时间,对时间初步同步后的第一车载设备进行时间同步修正,提高同步精度。

Description

时间同步方法、装置、车载设备及存储介质 技术领域
本申请涉及计算机技术领域,具体而言,涉及一种时间同步方法、装置、车载设备及存储介质。
背景技术
目前,随着现代汽车工业的快速发展,智能驾驶已成为汽车行业的发展趋势。智能驾驶是工业革命和信息化结合的重要抓手,其将能够改变人、资源要素和产品的流动方式,颠覆性地改变人类生活。智能驾驶是指机器帮助人进行驾驶,以及在特殊情况下完全取代人驾驶的技术。
在相关技术中,将机器视觉、卫星定位和激光雷达定位等技术大量应用于智能驾驶。以上技术在实现智能驾驶时需要多个车载设备协同工作,但是多个车载设备在信号融合时存在信号延迟,所以会产生定位误差,影响自动驾驶安全。可见,目前车载设备之间存在信号时间不同步的问题。
发明内容
本申请实施例的目的在于提供一种时间同步方法、装置、车载设备及存储介质,旨在解决车载设备之间的存在信号时间不同步的问题。
第一方面,本申请实施例提供了一种车载设备的时间同步方法,应用于第一车载设备,第一车载设备与第二车载设备通信连接,方法包括:
接收第二车载设备发送的第一通信数据,并记录接收到第一通信数据时的第一接收时刻,第一通信数据中包含第一通信数据的数据生成时刻;
基于数据生成时刻,对第一车载设备进行时间粗对准;
在第一车载设备进行时间粗对准后,接收第二车载设备发送的第二通 信数据,并记录接收到第二通信数据时的第二接收时刻,第二通信数据包含第一通信数据的数据发送时刻;
基于第一接收时刻、第二接收时刻和数据发送时刻,确定第一车载设备与第二车载设备同步的同步时间;
基于同步时间,对第一车载设备进行时间同步。
在本实施例中,通过接收第二车载设备发送的第一通信数据,并记录第一接收时刻,以及基于第一通信数据中的数据生成时刻,对第一车载设备进行时间粗对准,从而对第一车载设备进行时间初步同步;在第一车载设备时间粗对准后,接收第二车载设备发送的第二通信数据,并记录第二接收时刻以及基于第一接收时刻、第二接收时刻和数据发送时刻,确定第一车载设备与第二车载设备同步的同步时间,从而基于同步时间,对时间初步同步后的第一车载设备进行时间同步修正,提高同步精度。
在一实施例中,基于第一接收时刻、第二接收时刻和数据发送时刻,确定第一车载设备与第二车载设备同步的同步时间,包括:
根据预设的计算公式,计算第一车载设备与第二车载设备同步的同步时间,计算公式为:Tre=(T2r-T1r)+T2,其中Tre为同步时间,T2r为第二接收时刻,T1r为第一接收时刻,T2为数据发送时刻。
在本实施例中,基于通信数据的两次接收时间,计算出第一车载设备与第二车载设备的时间差,实现无需改动设备硬件,而实现低成本化的设备时间同步。
在一实施例中,基于同步时间,对第一车载设备进行时间同步,包括:
基于预设的卡尔曼滤波器,对同步时间进行误差修正,得到目标同步时间;
将第一车载设备的时间同步至目标同步时间。
在本实施例中,通过卡尔曼滤波器进一步修正同步时间,以修正传输延迟和中断延迟带来的误差影响,进一步提高时间同步精度,以及提高时 间同步过程的抗干扰性。
在一实施例中,基于预设的卡尔曼滤波器,对同步时间进行误差修正,得到目标同步时间,包括:
根据同步时间与第一车载设备的时钟单位,构建卡尔曼滤波器的观测向量;
基于第一车载设备的当前时刻、时间增量和预设传输延迟,确定卡尔曼滤波器的状态向量;
根据观测向量和状态向量,对同步时间进行更新,得到目标同步时间。
在本实施例中,通过将当前时间、时间增量和预设传输延迟作为状态向量,以修正出通信数据的中断延迟对同步时间的误差影响,从而提高时间同步精度。
在一实施例中,根据观测向量和状态向量,对同步时间进行更新,得到目标同步时间,包括:
根据状态向量,计算卡尔曼滤波器的状态转移矩阵;
根据状态转移矩阵,更新状态向量的协方差矩阵;
根据协方差矩阵,计算卡尔曼滤波器的卡尔曼增益矩阵;
根据观测向量、卡尔曼增益矩阵,对同步时间进行更新,得到目标同步时刻。
在本实施例中,观测向量定义了观测向量随状态变化的变化规律,同步时间是本地时钟的线性函数,本地时钟的标度和偏移包含在本地时钟误差里面,从而通过卡尔曼滤波器修正本地时钟误差对同步时间的不利影响。
第二方面,本申请实施例提供了一种车载设备的时间同步方法,应用于第二车载设备,第二车载设备与一个或多个第一车载设备通信连接,方法包括:
向第一车载设备发送第一通信数据,第一通信数据中包含第一通信数据的数据生成时刻,第一通信数据用于第一车载设备记录接收到第一通信 数据时的第一接收时刻,数据生成时刻用于对第一车载设备进行时间粗对准;
在第一车载设备时间粗对准后,向第一车载设备发送第二通信数据,第二通信数据用于第一车载设备记录接收到第二通信数据时的第二接收时刻,第二通信数据包含第一通信数据的数据发送时刻,第一接收时刻、第二接收时刻和数据发送时刻用于第一车载设备确定与第二车载设备同步的同步时间,并基于同步时间进行时间同步。
第三方面,本申请实施例提供了一种车载设备的时间同步装置,应用于第一车载设备,第一车载设备与第二车载设备通信连接,方法包括:
第一接收模块,用于接收第二车载设备发送的第一通信数据,并记录接收到第一通信数据时的第一接收时刻,第一通信数据中包含第一通信数据的数据生成时刻;
对准模块,用于基于数据生成时刻,对第一车载设备进行时间粗对准;
第二接收模块,用于在第一车载设备进行时间粗对准后,接收第二车载设备发送的第二通信数据,并记录接收到第二通信数据时的第二接收时刻,第二通信数据包含第一通信数据的数据发送时刻;
确定模块,用于基于第一接收时刻、第二接收时刻和数据发送时刻,确定第一车载设备与第二车载设备同步的同步时间;
同步模块,用于基于同步时间,对第一车载设备进行时间同步。
第四方面,本申请实施例提供了一种车载设备的时间同步装置,应用于第二车载设备,第二车载设备与一个或多个第一车载设备通信连接,方法包括:
第一发送模块,用于向第一车载设备发送第一通信数据,第一通信数据中包含第一通信数据的数据生成时刻,第一通信数据用于第一车载设备记录接收到第一通信数据时的第一接收时刻,数据生成时刻用于对第一车载设备进行时间粗对准;
第二发送模块,用于在第一车载设备时间粗对准后,向第一车载设备发送第二通信数据,第二通信数据用于第一车载设备记录接收到第二通信数据时的第二接收时刻,第二通信数据包含第一通信数据的数据发送时刻,第一接收时刻、第二接收时刻和数据发送时刻用于第一车载设备确定与第二车载设备同步的同步时间,并基于同步时间进行时间同步。
第五方面,本申请实施例提供了一种车载设备,包括存储器及处理器,存储器用于存储计算机程序,处理器运行计算机程序以使车载设备执行第一方面或第二方面的时间同步方法。
第六方面,本申请实施例提供了一种计算机可读存储介质,其存储有计算机程序,计算机程序被处理器执行时实现如第一方面或第二方面的时间同步方法。
可以理解的是,上述第二方面至第六方面的有益效果可参见第一方面的描述,在此不再赘述。
附图说明
为了更清楚地说明本申请实施例的技术方案,下面将对本申请实施例中所需要使用的附图作简单地介绍,应当理解,以下附图仅示出了本申请的某些实施例,因此不应被看作是对范围的限定,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他相关的附图。
图1为本申请实施例提供的时间同步方法的流程示意图;
图2为本申请实施例提供的另一种时间同步方法的流程示意图;
图3为本申请实施例提供的时间同步装置的结构示意图;
图4为本申请实施例提供的另一种时间同步装置的结构示意图;
图5为本申请实施例提供的车载设备的结构示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。
应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步定义和解释。同时,在本申请的描述中,术语“第一”、“第二”等仅用于区分描述,而不能理解为指示或暗示相对重要性。
如背景技术相关记载,多个车载设备在信号融合时存在信号延迟,主要体现在传感器之间信号不同步。当前大部分方案为了解决同步问题,使用了硬线同步:每个传感器增加一根硬线,使用电脉冲信号进行同步。但是每个传感器需要重新设计硬件,使得电路布线的成本和难度增加,脉冲信号抗干扰差,容易误触发,以及只能同步相对时间。
针对上述现有技术中的问题,本申请提供了一种车载设备的时间同步方法,通过接收第二车载设备发送的第一通信数据,并记录第一接收时刻,以及基于第一通信数据中的数据生成时刻,对第一车载设备进行时间粗对准,从而对第一车载设备进行时间初步同步;在第一车载设备时间粗对准后,接收第二车载设备发送的第二通信数据,并记录第二接收时刻以及基于第一接收时刻、第二接收时刻和数据发送时刻,确定第一车载设备与第二车载设备同步的同步时间,从而基于同步时间,对时间初步同步后的第一车载设备进行时间同步修正,提高同步精度。
实施例一
参见图1,图1示出了本申请实施例提供的一种时间同步方法的实现流程图。本申请实施例中下述的时间同步方法可应用于第一车载设备,第一车载设备与第二车载设备通信连接,车载设备包括但不限于车载电脑、车载音响、车载智能后视镜、车载传感器等设备。本申请实施例的时间同步方法,包括步骤S101至S105,详述如下:
步骤S101,接收第二车载设备发送的第一通信数据,并记录第一接收时刻,第一通信数据中包含第一通信数据的数据生成时刻。
在本实施例中,第一车载设备为需要进行时间同步的同步设备,第二车载设备为作为基准时间的同步设备。第一车载设备与第二车载设备的通信方式可以是控制器局域网络(Controller Area Network,CAN)、局域互联网络(Local Interconnect Network,LIN)和以太网等。当通信方式为CAN时,通信数据为CAN报文数据,当通信方式为LIN时,通信数据为SCI(UART)数据。为便于说明,本实施例以CAN作为通信方式对时间同步方法进行说明与解释。
示例性地,第二车载设备在T1时刻产生特定格式的CAN数据包CANMsg(T1),CANMsg(T1)包含数据生成时刻T1的时间信息,并传入CAN总线的邮箱。由于CAN机制,决定了CANMsg(T1)并不会立刻发出,而是在总线允许时发出。CANMsg(T1)发出时,第二车载设备可以记录数据发送时刻T2。第一车载设备在接收到CANMsg(T1)时,记录接收到该数据的第一接收时间T1r。
进一步地,可以将第二车载设备同步到基准时间,基准时间可以是UTC时间或者本地时间。以UTC为例,UTC来自于Gnss模块,从Gnss模块的报文中获取UTC时间后,重置计时,并且根据Gnss模块提供秒脉冲进行高精度同步。
步骤S102,基于数据生成时刻,对第一车载设备进行时间粗对准。
在本实施例中,在接收到第一通信数据后,立刻对第一车载设备的计时器进行赋值,使第一车载设备的计时器同步到数据生成时刻,完成时间粗对准,以便于实现后续精准同步。
步骤S103,在第一车载设备时间粗对准后,接收第二车载设备发送的第二通信数据,并记录第二接收时刻,第二通信数据包含第一通信数据的数据发送时刻。
在本实施例中,由于数据传输过程中存在发送延迟,如CAN数据需要CAN总线允许时才能发出,所以接收到第一通信数据时,第一车载设备无法从第一通信数据中解析出第一通信数据的数据发送时刻。因此,本实施例在第一车载设备时间粗对准后,第二车载设备将记录的数据发送时刻T2再次打包成特定CAN信息CANMsg(T2),如同第一通信数据的发送过程,CANMsg(T2)信息将被发送到CAN总线上,CAN总线允许后发出。第一车载设备接收到CANMsg(T2)时,记录第二接收时刻T2r,并解析到数据发送时刻T2的时间信息。
步骤S104,基于第一接收时刻、第二接收时刻和数据发送时刻,确定第一车载设备与第二车载设备同步的同步时间。
在本实施例中,通过上述数据收发过程,第一车载设备获取数据生成时刻、数据发送时刻、第一接收时刻和第二接收时刻,因此可以通过两次收发过程的时刻差,得知第一车载设备与第二车载设备的时间差,从而可以得到同步时间。
在一实施例中,基于第一接收时刻、第二接收时刻和数据发送时刻,确定第一车载设备与第二车载设备同步的同步时间,包括:根据预设的计算公式,计算第一车载设备与第二车载设备同步的同步时间,计算公式为:Tre=(T2r-T1r)+T2,其中Tre为同步时间,T2r为第二接收时刻,T1r为第一接收时刻,T2为数据发送时刻。
在本实施例中,基于通信数据的两次接收时间,计算出第一车载设备与第二车载设备的时间差,实现无需改动设备硬件,而实现低成本化的设备时间同步。
步骤S105,基于同步时间,对第一车载设备进行时间同步。
在本实施例中,由于步骤S104已经得到第一车载设备与第二车载设备之间的时间差,并得到同步时间,所以将第一车载设备同步至该同步时间。可选地,由于数据传输过程存在传输延迟和中断延迟,所以为了进一步提 高同步精度,本实施例对同步时间进行误差修正。
在一实施例中,基于同步时间,对第一车载设备进行时间同步,包括:基于预设的卡尔曼滤波器,对同步时间进行误差修正,得到目标同步时间;将第一车载设备的时间同步至目标同步时间。
在本实施例中,卡尔曼滤波器为利用线性系统状态方程,通过系统输入输出观测数据,对系统状态进行最优估算的算法。本实施例通过卡尔曼滤波器进一步修正同步时间,以修正传输延迟和中断延迟带来的误差影响,进一步提高时间同步精度,以及提高时间同步过程的抗干扰性。
在一实施例中,基于预设的卡尔曼滤波器,对同步时间进行误差修正,得到目标同步时间,包括:根据同步时间与第一车载设备的时钟单位,构建卡尔曼滤波器的观测向量;基于第一车载设备的当前时刻、时间增量和预设传输延迟,确定卡尔曼滤波器的状态向量;根据观测向量和状态向量,对同步时间进行更新,得到目标同步时间。
在本实施例中,示例性地,建立观测向量:
Figure PCTCN2022077925-appb-000001
其中T re是同步时间,T sec是本地时钟的计时单位。建立状态向量
Figure PCTCN2022077925-appb-000002
x t为当前时刻,dx t为每次的时间增量,l t为预设传输延迟。由于中断延迟是固定值,所以可以在得到Tre时修正该中断延迟对同步时间的不利影响。将观测向量和状态向量输入到卡尔曼滤波器,以对同步时间进行状态更新,最终得到目标同步时间。本实施例通过将当前时间、时间增量和预设传输延迟作为状态向量,以修正出通信数据的中断延迟对同步时间的误差影响,从而提高时间同步精度。
进一步地,根据观测向量和状态向量,对同步时间进行更新,得到目标同步时间,包括:根据状态向量,计算卡尔曼滤波器的状态转移矩阵;根据状态转移矩阵,更新状态向量的协方差矩阵;根据协方差矩阵,计算 卡尔曼滤波器的卡尔曼增益矩阵;根据观测向量、卡尔曼增益矩阵,对同步时间进行更新,得到目标同步时刻。
在本实施例中,示例性地,根据时间递推可得到:x t=x t-1+dx t-1-l t,dx t=dx t-1,l t=l t-1,因此状态转移矩阵的运动学公式可以确定状态转移矩阵为:
Figure PCTCN2022077925-appb-000003
基于状态转移矩阵,更新状态向量的协方差矩阵
Figure PCTCN2022077925-appb-000004
其中Q为系统噪声。计算卡尔曼增益矩阵:
Figure PCTCN2022077925-appb-000005
其中R为观测噪声,H为观测矩阵;完成状态更新:
Figure PCTCN2022077925-appb-000006
在上述实现过程中,观测矩阵H定义了观测向量随状态的变化规律,同步时间是本地时钟的线性函数,本地时钟的标度和偏移包含在本地钟误差里面。系统噪声Q,可以通过仿真结果推导,以作为卡尔曼滤波器的预设值。观测噪声R可以认为是晶振的稳定度的相关量,也可以作为卡尔曼滤波器的预设值。可见,第一车载设备通过CAN所获得的时间信息被修正,而且第一车载设备本身由于晶振误差带来的本地钟偏差也被修正。
实施例二
参见图2,图2示出了本申请实施例提供的一种时间同步方法的实现流程图。本申请实施例中下述的时间同步方法可应用于第二车载设备,第一车载设备与第二车载设备通信连接,车载设备包括但不限于车载电脑、车载音响、车载智能后视镜、车载传感器等设备。本申请实施例的时间同步方法,包括步骤S201至S202,详述如下:
步骤S201,向第一车载设备发送第一通信数据,第一通信数据中包含第一通信数据的数据生成时刻,第一通信数据用于第一车载设备记录接收到第一通信数据的第一接收时刻,数据生成时刻用于对第一车载设备进行时间粗对准;
步骤S202,在第一车载设备时间粗对准后,向第一车载设备发送第二通信数据,第二通信数据用于第一车载设备记录接收到第二通信数据的第二接收时刻,第二通信数据包含第一通信数据的数据发送时刻,第一接收时刻、第二接收时刻和数据发送时刻用于第一车载设备确定与第二车载设备同步的同步时间,并基于同步时间进行时间同步。
在本实施例中,第二车载设备可以对多个第一车载设备实现时间同步,支持一主多从模式,提高时间同步效率。为便于描述,上步骤述S201和S202的相关步骤描述和解释,可参见上述步骤S101至S105的步骤解释,在此不再赘述。
实施例三
为了执行上述方法实施例一对应的方法,以实现相应的功能和技术效果,下面提供一种时间同步装置。参见图3,图3是本申请实施例提供的一种时间同步装置的结构框图。本实施例中该装置包括的各模块用于执行图1对应的实施例中的各步骤,具体参见图1以及图1所对应的实施例中的相关描述。为了便于说明,仅示出了与本实施例相关的部分,本申请实施例提供的时间同步装置,包括:
第一接收模块301,用于接收第二车载设备发送的第一通信数据,并记录第一接收时刻,第一通信数据中包含第一通信数据的数据生成时刻;
对准模块302,用于基于数据生成时刻,对第一车载设备进行时间粗对准;
第二接收模块303,用于在第一车载设备时间粗对准后,接收第二车载设备发送的第二通信数据,并记录第二接收时刻,第二通信数据包含第一通信数据的数据发送时刻;
确定模块304,用于基于第一接收时刻、第二接收时刻和数据发送时刻,确定第一车载设备与第二车载设备同步的同步时间;
同步模块305,用于基于同步时间,对第一车载设备进行时间同步。
在一实施例中,确定模块304,包括:
计算单元,用于根据预设的计算公式,计算第一车载设备与第二车载设备同步的同步时间,计算公式为:Tre=(T2r-T1r)+T2,其中Tre为同步时间,T2r为第二接收时刻,T1r为第一接收时刻,T2为数据发送时刻。
在一实施例中,同步模块305,包括:
修正单元,用于基于预设的卡尔曼滤波器,对同步时间进行误差修正,得到目标同步时间;
同步单元,用于将第一车载设备的时间同步至目标同步时间。
在一实施例中,修正单元,包括:
构建子单元,用于根据同步时间与第一车载设备的时钟单位,构建卡尔曼滤波器的观测向量;
确定子单元,用于基于第一车载设备的当前时刻、时间增量和预设传输延迟,确定卡尔曼滤波器的状态向量;
更新子单元,用于根据观测向量和状态向量,对同步时间进行更新,得到目标同步时间。
在一实施例中,更新子单元,具体用于:
根据状态向量,计算卡尔曼滤波器的状态转移矩阵;
根据状态转移矩阵,更新状态向量的协方差矩阵;
根据协方差矩阵,计算卡尔曼滤波器的卡尔曼增益矩阵;
根据观测向量、卡尔曼增益矩阵,对同步时间进行更新,得到目标同步时刻。
实施例四
为了执行上述方法实施例二对应的方法,以实现相应的功能和技术效果,下面提供一种时间同步装置。参见图4,图4是本申请实施例提供的一种时间同步装置的结构框图。本实施例中该装置包括的各模块用于执行图2对应的实施例中的各步骤,具体参见图2以及图2所对应的实施例中的相 关描述。为了便于说明,仅示出了与本实施例相关的部分,本申请实施例提供的时间同步装置,包括:
第一发送模块401,用于向第一车载设备发送第一通信数据,第一通信数据中包含第一通信数据的数据生成时刻,第一通信数据用于第一车载设备记录接收到第一通信数据的第一接收时刻,数据生成时刻用于对第一车载设备进行时间粗对准;
第二发送模块402,用于在第一车载设备时间粗对准后,向第一车载设备发送第二通信数据,第二通信数据用于第一车载设备记录接收到第二通信数据的第二接收时刻,第二通信数据包含第一通信数据的数据发送时刻,第一接收时刻、第二接收时刻和数据发送时刻用于第一车载设备确定与第二车载设备同步的同步时间,并基于同步时间进行时间同步。
实施例五
图5为本申请一实施例提供的车载设备的结构示意图。如图5所示,该实施例的车载设备5包括:至少一个处理器50(图5中仅示出一个)处理器、存储器51以及存储在所述存储器51中并可在所述至少一个处理器50上运行的计算机程序52,所述处理器50执行所述计算机程序52时实现上述任意方法实施例中的步骤。
所述车载设备5可以是车载电脑、车载音响、车载智能后视镜、车载传感器等智能设备。该车载设备可包括但不仅限于处理器50、存储器51。本领域技术人员可以理解,图5仅仅是车载设备5的举例,并不构成对车载设备5的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如还可以包括输入输出设备、网络接入设备等。
所称处理器50可以是中央处理单元(Central Processing Unit,CPU),该处理器50还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其 他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
所述存储器51在一些实施例中可以是所述车载设备5的内部存储单元,例如车载设备5的硬盘或内存。所述存储器51在另一些实施例中也可以是所述车载设备5的外部存储设备,例如所述车载设备5上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,所述存储器51还可以既包括所述车载设备5的内部存储单元也包括外部存储设备。所述存储器51用于存储操作系统、应用程序、引导装载程序(BootLoader)、数据以及其他程序等,例如所述计算机程序的程序代码等。所述存储器51还可以用于暂时地存储已经输出或者将要输出的数据。
另外,本申请实施例还提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现可实现上述任意方法实施例中的步骤。
本申请实施例提供了一种计算机程序产品,当计算机程序产品在车载设备上运行时,使得车载设备执行时实现可实现上述各个方法实施例中的步骤。
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,也可以通过其它的方式实现。以上所描述的装置实施例仅仅是示意性的,例如,附图中的流程图和框图显示了根据本申请的多个实施例的装置、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或代码的一部分,所述模块、程序段或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现方式中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依 所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或动作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
另外,在本申请各个实施例中的各功能模块可以集成在一起形成一个独立的部分,也可以是各个模块单独存在,也可以两个或两个以上模块集成形成一个独立的部分。
所述功能如果以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述仅为本申请的实施例而已,并不用于限制本申请的保护范围,对于本领域的技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步定义和解释。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应所述以权利要求的保护范围为准。
需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用 来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。

Claims (10)

  1. 一种车载设备的时间同步方法,其特征在于,应用于第一车载设备,所述第一车载设备与第二车载设备通信连接,所述方法包括:
    接收所述第二车载设备发送的第一通信数据,并记录接收到所述第一通信数据时的第一接收时刻,所述第一通信数据中包含所述第一通信数据的数据生成时刻;
    基于所述数据生成时刻,对所述第一车载设备进行时间粗对准;
    在所述第一车载设备进行时间粗对准后,接收所述第二车载设备发送的第二通信数据,并记录所述接收到所述第二通信数据时的第二接收时刻,所述第二通信数据包含所述第一通信数据的数据发送时刻;
    基于所述第一接收时刻、第二接收时刻和数据发送时刻,确定所述第一车载设备与所述第二车载设备同步的同步时间;
    基于所述同步时间,对所述第一车载设备进行时间同步。
  2. 根据权利要求1所述的时间同步方法,其特征在于,所述基于所述第一接收时刻、第二接收时刻和数据发送时刻,确定所述第一车载设备与所述第二车载设备同步的同步时间,包括:
    根据预设的计算公式,计算所述第一车载设备与所述第二车载设备同步的同步时间,所述计算公式为:Tre=(T2r-T1r)+T2,其中Tre为所述同步时间,T2r为所述第二接收时刻,T1r为所述第一接收时刻,T2为所述数据发送时刻。
  3. 根据权利要求1所述的时间同步方法,其特征在于,所述基于所述同步时间,对所述第一车载设备进行时间同步,包括:
    基于预设的卡尔曼滤波器,对所述同步时间进行误差修正,得到目标同步时间;
    将所述第一车载设备的时间同步至所述目标同步时间。
  4. 根据权利要求3所述的时间同步方法,其特征在于,所述基于预设的卡尔曼滤波器,对所述同步时间进行误差修正,得到目标同步时间,包括:
    根据所述同步时间与所述第一车载设备的时钟单位,构建所述卡尔曼滤波器的观测向量;
    基于所述第一车载设备的当前时刻、时间增量和预设传输延迟,确定所述卡尔曼滤波器的状态向量;
    根据所述观测向量和所述状态向量,对所述同步时间进行更新,得到所述目标同步时间。
  5. 根据权利要求4所述的时间同步方法,其特征在于,所述根据所述观测向量和所述状态向量,对所述同步时间进行更新,得到所述目标同步时间,包括:
    根据所述状态向量,计算所述卡尔曼滤波器的状态转移矩阵;
    根据所述状态转移矩阵,更新所述状态向量的协方差矩阵;
    根据所述协方差矩阵,计算所述卡尔曼滤波器的卡尔曼增益矩阵;
    根据所述观测向量、卡尔曼增益矩阵,对所述同步时间进行更新,得到所述目标同步时刻。
  6. 一种车载设备的时间同步方法,其特征在于,应用于第二车载设备,所述第二车载设备与一个或多个第一车载设备通信连接,所述方法包括:
    向所述第一车载设备发送第一通信数据,所述第一通信数据中包含所述第一通信数据的数据生成时刻,所述第一通信数据用于所述第一车载设备记录接收到所述第一通信数据时的第一接收时刻,所述数据生成时刻用于对所述第一车载设备进行时间粗对准;
    在所述第一车载设备进行时间粗对准后,向所述第一车载设备发送第二通信数据,所述第二通信数据用于所述第一车载设备记录接收到所述第二通信数据的第二接收时刻,所述第二通信数据包含所述第一通信数据的 数据发送时刻,所述第一接收时刻、第二接收时刻和数据发送时刻用于所述第一车载设备确定与所述第二车载设备同步的同步时间,并基于所述同步时间进行时间同步。
  7. 一种车载设备的时间同步装置,其特征在于,应用于第一车载设备,所述第一车载设备与第二车载设备通信连接,所述方法包括:
    第一接收模块,用于接收所述第二车载设备发送的第一通信数据,并记录接收到所述第一通信数据时的第一接收时刻,所述第一通信数据中包含所述第一通信数据的数据生成时刻;
    对准模块,用于基于所述数据生成时刻,对所述第一车载设备进行时间粗对准;
    第二接收模块,用于在所述第一车载设备进行时间粗对准后,接收所述第二车载设备发送的第二通信数据,并记录接收到所述第二通信数据时的第二接收时刻,所述第二通信数据包含所述第一通信数据的数据发送时刻;
    确定模块,用于基于所述第一接收时刻、第二接收时刻和数据发送时刻,确定所述第一车载设备与所述第二车载设备同步的同步时间;
    同步模块,用于基于所述同步时间,对所述第一车载设备进行时间同步。
  8. 一种车载设备的时间同步装置,其特征在于,应用于第二车载设备,所述第二车载设备与一个或多个第一车载设备通信连接,所述方法包括:
    第一发送模块,用于向所述第一车载设备发送第一通信数据,所述第一通信数据中包含所述第一通信数据的数据生成时刻,所述第一通信数据用于所述第一车载设备记录接收到所述第一通信数据的第一接收时刻,所述数据生成时刻用于对所述第一车载设备进行时间粗对准;
    第二发送模块,用于在所述第一车载设备进行时间粗对准后,向所述第一车载设备发送第二通信数据,所述第二通信数据用于所述第一车载设 备记录接收到所述第二通信数据的第二接收时刻,所述第二通信数据包含所述第一通信数据的数据发送时刻,所述第一接收时刻、第二接收时刻和数据发送时刻用于所述第一车载设备确定与所述第二车载设备同步的同步时间,并基于所述同步时间进行时间同步。
  9. 一种车载设备,其特征在于,包括存储器及处理器,所述存储器用于存储计算机程序,所述处理器运行所述计算机程序以使所述车载设备执行权利要求1至5中任一项或权利要求6所述的时间同步方法。
  10. 一种计算机可读存储介质,其特征在于,其存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1至5中任一项或权利要求6所述的时间同步方法。
PCT/CN2022/077925 2021-02-25 2022-02-25 时间同步方法、装置、车载设备及存储介质 WO2022179605A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP22758969.4A EP4300853A1 (en) 2021-02-25 2022-02-25 Time synchronization method and apparatus, and vehicle-mounted device and storage medium
US18/454,993 US20230396349A1 (en) 2021-02-25 2023-08-24 Time synchronization method and apparatus for vehicle-mounted device, vehicle-mounted device, and storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110214124.X 2021-02-25
CN202110214124.XA CN113037416B (zh) 2021-02-25 2021-02-25 时间同步方法、装置、车载设备及存储介质

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US18/454,993 Continuation US20230396349A1 (en) 2021-02-25 2023-08-24 Time synchronization method and apparatus for vehicle-mounted device, vehicle-mounted device, and storage medium

Publications (1)

Publication Number Publication Date
WO2022179605A1 true WO2022179605A1 (zh) 2022-09-01

Family

ID=76461552

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/077925 WO2022179605A1 (zh) 2021-02-25 2022-02-25 时间同步方法、装置、车载设备及存储介质

Country Status (4)

Country Link
US (1) US20230396349A1 (zh)
EP (1) EP4300853A1 (zh)
CN (1) CN113037416B (zh)
WO (1) WO2022179605A1 (zh)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113037416B (zh) * 2021-02-25 2023-04-18 广州导远电子科技有限公司 时间同步方法、装置、车载设备及存储介质
CN114114245B (zh) * 2022-01-27 2022-04-12 成都工航科技有限公司 一种高速列车定位方法及系统
CN115979277B (zh) * 2023-02-22 2023-06-02 广州导远电子科技有限公司 时间同步方法、装置、电子设备和计算机可读存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107635280A (zh) * 2017-08-24 2018-01-26 中国电子科技集团公司第五十四研究所 基于信号比对和频差在线估计的信号源时间同步方法
CN111224733A (zh) * 2020-01-09 2020-06-02 珠海格力电器股份有限公司 时间校准方法、装置、计算机设备和存储介质
CN111585682A (zh) * 2020-05-09 2020-08-25 森思泰克河北科技有限公司 传感器时间同步方法、装置及终端设备
CN113037416A (zh) * 2021-02-25 2021-06-25 广州导远电子科技有限公司 时间同步方法、装置、车载设备及存储介质

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101631016B (zh) * 2009-04-14 2011-09-14 华中科技大学 一种现场总线的时间同步方法
JP5455799B2 (ja) * 2010-06-10 2014-03-26 矢崎エナジーシステム株式会社 車載記録装置
CN110351823A (zh) * 2018-04-03 2019-10-18 华为技术有限公司 通信的方法和装置
CN111245593B (zh) * 2020-01-03 2021-04-20 北京邮电大学 一种基于卡尔曼滤波的时间同步方法及装置
CN112394634A (zh) * 2021-01-21 2021-02-23 国汽智控(北京)科技有限公司 车载计算平台的授时方法、装置、设备及存储介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107635280A (zh) * 2017-08-24 2018-01-26 中国电子科技集团公司第五十四研究所 基于信号比对和频差在线估计的信号源时间同步方法
CN111224733A (zh) * 2020-01-09 2020-06-02 珠海格力电器股份有限公司 时间校准方法、装置、计算机设备和存储介质
CN111585682A (zh) * 2020-05-09 2020-08-25 森思泰克河北科技有限公司 传感器时间同步方法、装置及终端设备
CN113037416A (zh) * 2021-02-25 2021-06-25 广州导远电子科技有限公司 时间同步方法、装置、车载设备及存储介质

Also Published As

Publication number Publication date
CN113037416B (zh) 2023-04-18
CN113037416A (zh) 2021-06-25
EP4300853A1 (en) 2024-01-03
US20230396349A1 (en) 2023-12-07

Similar Documents

Publication Publication Date Title
WO2022179605A1 (zh) 时间同步方法、装置、车载设备及存储介质
KR102378380B1 (ko) 차량의 시간 동기화 방법, 장치, 기기 및 저장매체
US20180003822A1 (en) Environmental sensing device and information acquiring method applied to environmental sensing device
CN111585682B (zh) 传感器时间同步方法、装置及终端设备
CN110865406A (zh) 基于车载gps授时系统的多传感器数据同步处理系统及方法
WO2019183750A1 (zh) 一种惯量传感器的校正方法、装置、终端设备和存储介质
EP4044466A1 (en) Synchronization method and device
CN111829515A (zh) 一种时间同步方法、装置、车辆及存储介质
WO2022077224A1 (zh) 时钟同步方法和装置、芯片系统、无人机和终端
CN113267795B (zh) 时间确定方法、装置、介质和设备
US11025357B1 (en) Robust sensor timestamp management
EP3862901A1 (en) Techniques for protection and accuracy of system time
JP2018112425A (ja) システム時刻同期方法
CN112590929B (zh) 自动驾驶车辆方向盘的校正方法、装置、电子设备和介质
WO2023141817A1 (zh) 一种时间同步方法、装置及存储介质
CN109660310B (zh) 一种时钟同步的方法、装置、计算设备及计算机存储介质
CN114545762B (zh) 一种基于惯性测量单元的时间数据同步方法及系统
JP5585536B2 (ja) 車載電子制御装置および運転情報記憶システム
US20230093337A1 (en) Method and System for Performing Time-Synchronization
WO2019119228A1 (zh) 时间更新方法,装置及可移动平台
CN112463125B (zh) 一种虚拟定时器的定时方法及设备
CN115603849B (zh) 多传感器触发控制方法、装置、设备及存储介质
WO2022127337A1 (zh) 主时钟装置、从时钟装置和时间同步方法
WO2023044802A1 (zh) 时间同步方法及相关装置
JP6929492B2 (ja) ロケータ装置およびその精度評価システムならびに測位方法

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

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2022758969

Country of ref document: EP

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2022758969

Country of ref document: EP

Effective date: 20230925