CN113273105B - Method for time synchronization of a plurality of auxiliary devices of an autonomous vehicle, computer device and storage medium - Google Patents
Method for time synchronization of a plurality of auxiliary devices of an autonomous vehicle, computer device and storage medium Download PDFInfo
- Publication number
- CN113273105B CN113273105B CN202080007588.7A CN202080007588A CN113273105B CN 113273105 B CN113273105 B CN 113273105B CN 202080007588 A CN202080007588 A CN 202080007588A CN 113273105 B CN113273105 B CN 113273105B
- Authority
- CN
- China
- Prior art keywords
- auxiliary
- ptp protocol
- auxiliary devices
- time
- message
- Prior art date
- Legal status (The legal status 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 status listed.)
- Active
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04J—MULTIPLEX COMMUNICATION
- H04J3/00—Time-division multiplex systems
- H04J3/02—Details
- H04J3/06—Synchronising arrangements
- H04J3/0635—Clock or time synchronisation in a network
- H04J3/0638—Clock or time synchronisation among nodes; Internode synchronisation
- H04J3/0658—Clock or time synchronisation among packet nodes
- H04J3/0661—Clock or time synchronisation among packet nodes using timestamps
- H04J3/0667—Bidirectional timestamps, e.g. NTP or PTP for compensation of clock drift and for compensation of propagation delays
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Synchronisation In Digital Transmission Systems (AREA)
Abstract
A method, a vehicle, a computer device and a computer readable storage medium for time synchronizing a plurality of auxiliary devices in an autonomous vehicle, the method comprising: determining one of the plurality of auxiliary devices as a master auxiliary device and taking a clock of the master auxiliary device as a master clock (202); controlling, by the programmable logic device, transmission of PTP protocol messages between the primary auxiliary device and the other auxiliary devices via the network (204); calculating a time offset between clocks of other auxiliary devices and a master clock of the master auxiliary device based on the transmission of the PTP protocol messages (206); and adjusting clocks of other auxiliary devices based on the time offset such that the clocks of the other auxiliary devices are synchronized with the master clock (208).
Description
Technical Field
The present application relates to the field of time synchronization, and in particular to a method, a vehicle, a computer device and a computer readable storage medium for time synchronizing a plurality of auxiliary devices in a vehicle.
Background
The precision time synchronization protocol (Precision Timing Protocol, PTP) is a high precision time synchronization protocol proposed by institute of electrical and electronics engineers (IEEE, institute of Electrical and Electronics Engineers) 1588 and IEEE802.1as organization. The precise time synchronization protocol is used to precisely synchronize clocks of respective devices mounted in a network. In particular, in the field of automatic driving, for example, it is necessary to synchronize clocks of a plurality of sensors mounted in a vehicle with high accuracy using an accurate time synchronization protocol to ensure that the plurality of sensors can provide data at the same time, thereby ensuring high reliability of sensor data so that various environmental factors can be recognized and judged accurately in time in automatic driving. In conventional manner, a software scheme of a personal computer (Personal Computer, PC) or micro control unit (Micro Control Unit, MCU) software system or a network synchronization technique using chips to implement a precise time synchronization protocol is generally used. However, the synchronization accuracy of clock synchronization by software is not high, and the scheme of clock synchronization by a chip is not flexible enough.
Disclosure of Invention
According to various embodiments of the present application, a method, a vehicle, a computer device and a computer-readable storage medium for time-synchronizing auxiliary devices in an autonomous vehicle are provided, the technical solutions being as follows.
A method for time synchronizing a plurality of auxiliary devices of an autonomous vehicle, comprising: determining one of the plurality of auxiliary devices as a master auxiliary device and taking a clock of the master auxiliary device as a master clock; controlling messages of PTP protocol to be transmitted between the main auxiliary equipment and other auxiliary equipment through a network by a programmable logic device; calculating time deviation between clocks of the other auxiliary devices and a master clock of the master auxiliary device based on the transmission of the messages of the PTP protocol; and adjusting clocks of the other auxiliary devices based on the time deviation so that the clocks of the other auxiliary devices are synchronous with the master clock.
An autonomous vehicle, comprising: a plurality of auxiliary devices each having a clock; a processor configured to determine one of the plurality of auxiliary devices as a primary auxiliary device and to take a clock of the primary auxiliary device as a primary clock; and a programmable logic device configured to: controlling transmission of a PTP protocol message between the primary auxiliary device and the other auxiliary device via a network; the other auxiliary equipment calculates time deviation between clocks of the other auxiliary equipment and a main clock of the main auxiliary equipment based on the transmission of the PTP protocol message; and adjusting clocks of the other auxiliary devices based on the time deviation so that the clocks of the other auxiliary devices are synchronous with the master clock.
Computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor when executing the computer program performs the following processing: determining one of a plurality of auxiliary devices in an autonomous vehicle as a master auxiliary device and taking a clock of the master auxiliary device as a master clock; controlling, by a programmable logic device, transmission of a PTP protocol message between the primary auxiliary device and the other auxiliary device via a network; calculating time deviation between clocks of the other auxiliary devices and a master clock of the master auxiliary device based on the transmission of the messages of the PTP protocol; and adjusting clocks of the other auxiliary devices based on the time deviation so that the clocks of the other auxiliary devices are synchronous with the master clock.
A computer readable storage medium having stored thereon a computer program, wherein the computer program when executed by a processor performs the following process: determining one of a plurality of auxiliary devices in an autonomous vehicle as a master auxiliary device and taking a clock of the master auxiliary device as a master clock; controlling, by a programmable logic device, transmission of a PTP protocol message between the primary auxiliary device and the other auxiliary device via a network; calculating time deviation between clocks of the other auxiliary devices and a master clock of the master auxiliary device based on the transmission of the messages of the PTP protocol; and adjusting clocks of the other auxiliary devices based on the time deviation so that the clocks of the other auxiliary devices are synchronous with the master clock.
According to the method, the vehicle, the computer device and the computer readable storage medium for time synchronization of the auxiliary device of the automatic driving vehicle, the auxiliary device in the vehicle is controlled by the programmable logic device, and the time for processing the message in the process of executing the message transmission of the PTP protocol can be accurately controlled due to the multipath parallel characteristic of the programmable logic device, namely the instability of the time in each process of executing the PTP protocol is eliminated, in other words, the time for processing the message is the same in each process of executing the PTP protocol, so that the calculation of the time deviation between the master clock of the master auxiliary device and the clocks of other auxiliary devices is more accurate, and the time synchronization precision among a plurality of auxiliary devices is improved. Therefore, in the automatic driving vehicle, the data of a plurality of auxiliary equipment at the same time can be provided, more reliable data of the auxiliary equipment is provided for automatic driving, and the performance of automatic driving is improved. In addition, since the functions of the programmable logic device can be changed according to actual demands, the processing of the PTP protocol is performed based on the clock of the auxiliary device of the vehicle controlled by the programmable logic device to perform time synchronization, and thus, higher flexibility is provided.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic illustration of an application environment for a method for time synchronizing a plurality of auxiliary devices in an autonomous vehicle according to an embodiment;
FIG. 2 is a flow chart of a method for time synchronizing an accessory of an autonomous vehicle according to an embodiment;
FIG. 3 is a flow chart of a method for time synchronizing an accessory of an autonomous vehicle according to an embodiment;
fig. 4 is a schematic diagram of packet transmission in a network according to PTP protocol of an embodiment;
fig. 5 is a schematic diagram of a packet of PTP protocol processing in a network according to an embodiment;
FIG. 6 is a flowchart of a method for time synchronizing an accessory of an autonomous vehicle according to an embodiment;
FIG. 7 is a block diagram of a vehicle according to an embodiment;
Fig. 8 is a block diagram of a computer device according to an embodiment.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
The application provides a method for time synchronizing auxiliary equipment of an automatic driving vehicle, which can be applied to various application environments. For example, it can be applied to an application environment of automatic driving as shown in fig. 1. As shown in fig. 1, in this application environment, the vehicle 100 includes a plurality of auxiliary devices, a programmable logic device 130, and a vehicle control apparatus 140. The vehicle may in particular be an autonomous vehicle, such as an unmanned vehicle, or other vehicle with remote assistance driving functions, such as a warehouse fork lift truck, a shovel, etc. The auxiliary devices include a primary auxiliary device 110 and at least one other auxiliary device 120. The auxiliary devices are, for example, a plurality of sensors for assisting an autopilot function, such as a video camera (including monocular, binocular stereoscopic, panoramic vision, and infrared camera), a range sensor (including radar, lidar, etc.), and the like. The programmable logic device 130 may be a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic device capable of implementing multiplexed parallel processing of signals. The vehicle control device 140 may be a processor that controls auxiliary devices in the vehicle for acquiring data of a plurality of auxiliary devices. In order to ensure the reliability of data of auxiliary devices used in the autopilot function, high-precision synchronization of the times of a plurality of auxiliary devices is generally required. Thus, network synchronization techniques based on PTP protocols are utilized between the plurality of auxiliary devices to synchronize clocks between the plurality of auxiliary devices. For simplicity of description, one other auxiliary device 120 is illustrated in the application environment, however, the number of other auxiliary devices 120 is not limited and may be more than one other auxiliary device 120.
In one embodiment, the primary auxiliary device 110 includes a primary clock as the clock source for the primary auxiliary device 110 and clocks for the other auxiliary devices 120 as the clock sources for the other auxiliary devices 120. In time synchronization between the primary and the further auxiliary devices 110, 120, the transmission of messages of the PTP protocol between said primary and said further auxiliary devices 110, 120 via the network is controlled by means of the programmable logic device 130. The other auxiliary device 120 calculates a time deviation between the clock of the other auxiliary device 120 and the master clock of the master auxiliary device 110 based on the transmission of the PTP protocol message, and adjusts the clock of the other auxiliary device 120 based on the time deviation so that the clock of the other auxiliary device 120 is synchronized with the master clock of the master auxiliary device 110.
In one embodiment, as shown in FIG. 2, a method for time synchronizing a plurality of auxiliary devices of an autonomous vehicle is provided. The following steps are taken as an example of the application of the method to the autopilot application environment of fig. 1.
Step 202: one of the plurality of auxiliary devices is determined as the primary auxiliary device 110 and the clock of the primary auxiliary device 110 is taken as the primary clock.
Wherein the primary auxiliary device 110 and the other auxiliary devices 120 are respectively different auxiliary devices in the vehicle.
Step 204: the transmission of PTP protocol messages between the primary and other auxiliary devices 110, 120 via the network is controlled by a programmable logic device 130.
The programmable logic device 130 is a general-purpose integrated circuit whose logic functions are determined by the design and programming of the device by the user, the user can design the programmable logic device 130 according to the functional needs of the actual circuit, and can reprogram or upgrade at any time according to the functions desired by the user, and the user can create new hardware logic in the programmable logic device 130 by simply uploading new logic programming files to the programmable logic device 130 through data transmission. Thus, there is a high flexibility in implementing the functions of the hardware circuits using the programmable logic device 130. In addition, since the programmable logic device 130 has the property of multiple parallel, i.e., is capable of processing multiple signals in parallel. In contrast to a general-purpose CPU, the processing of a high-level program language by the CPU is executed serially, and the result returned by the CPU is executed serially in order to correspond to the execution order of the high-level program language. Thus, in digital signal processing, programmable logic device 130 is more controllable in time for instruction execution than a general purpose CPU, with greater performance advantages.
The PTP protocol is a high-precision time synchronization protocol. By performing a PTP protocol-based time synchronization process between auxiliary devices in a network, the time of clocks of the auxiliary devices in the network can be synchronized. The PTP protocol messages are messages transmitted in the network when time synchronization is performed based on the PTP protocol. The network is, for example, an ethernet network, or other network that can be used for packet transmission in the PTP protocol.
In one embodiment, during the transmission of the PTP protocol packet in the network, that is, during the transmission of the PTP protocol packet from the primary auxiliary device 110 to the other auxiliary devices 120 and from the other auxiliary devices 120 to the primary auxiliary device 110, the PTP protocol packet needs to be processed, and may also need to be transferred through network devices such as routers and switches. The processing of the message includes encapsulation and decapsulation of the message, which will be described in detail later.
Step 206: based on the transmission of the PTP protocol messages, the time offset between the clocks of the other auxiliary devices 120 and the master clock of the master auxiliary device 110 is calculated.
In the transmission process of the PTP protocol packet, it is necessary to record the time of sending and receiving the packet by the auxiliary device in the network, for example, the time of sending the PTP protocol packet by the primary auxiliary device 110, the time of receiving the PTP protocol packet by the other auxiliary device 120, the time of sending the PTP protocol packet by the other auxiliary device 120, and the time of receiving the PTP protocol packet by the primary auxiliary device 110. By performing the calculation using the above time, a time deviation between the clocks of the other auxiliary devices 120 and the master clock of the master auxiliary device 110 can be obtained.
Step 208: the clocks of the other auxiliary devices 120 are adjusted based on the time offset such that the clocks of the other auxiliary devices 120 are synchronized with the master clock.
The calculation in step 206 results in a time offset (offset) between the master clock of the master auxiliary device 110 and the clocks of the other auxiliary devices 120, i.e. the offset between the two clocks that needs to be calibrated. By adjusting the offset such that the master clock of the master auxiliary device 110 and the clocks of the other auxiliary devices 120 are time synchronized, the master clock of the master auxiliary device 110 and the clocks of the other auxiliary devices 120 are time synchronized.
According to the above method for time synchronization of auxiliary devices of an autonomous vehicle, the auxiliary devices in the vehicle are controlled by the programmable logic device 130, and due to the multi-path parallel characteristic of the programmable logic device, the time of processing the message in the process of executing the PTP protocol can be accurately controlled, that is, instability of the time in each process of executing the PTP protocol is eliminated, in other words, the time of processing the message is the same in each process of executing the PTP protocol, so that the calculation of time deviation between the master clock of the master auxiliary device 110 and the clocks of the other auxiliary devices 120 is more accurate, and the time synchronization precision between the plurality of auxiliary devices is improved. Therefore, in the automatic driving vehicle, the data of a plurality of auxiliary equipment at the same time can be provided, more reliable data of the auxiliary equipment is provided for automatic driving, and the performance of automatic driving is improved. In addition, since the functions of the programmable logic device 130 can be changed according to actual demands, the processing of the PTP protocol is performed based on the clock of the auxiliary device of the programmable logic device 130 to control the vehicle, thereby performing time synchronization, with higher flexibility.
In one embodiment, as shown in fig. 3 and 4, the steps of controlling, by the programmable logic device 130, the transmission of the PTP protocol messages between the primary auxiliary device 110 and the other auxiliary devices 120 via the network include the following.
Step 302: a PTP protocol synchronization message is sent from the primary auxiliary device 110 to the other auxiliary devices 120 and a first timestamp T1 is generated.
Step 304: when the other auxiliary device 120 receives the PTP protocol synchronization message, a second timestamp T2 is generated.
Step 306: a PTP protocol follow up message including a first time stamp T1 is sent from the primary auxiliary device 110 to the other auxiliary devices 120.
Step 308: the slave other slave device 120 sends a PTP protocol delay request message to the master slave device 110 and generates a third timestamp T3.
Step 310: when the primary and secondary device 110 receives the PTP protocol delay request message, a fourth timestamp T4 is generated.
Step 312: a PTP protocol delay request response message including a fourth timestamp T4 is sent from the primary auxiliary device 110 to the other auxiliary devices 120 in response to the PTP protocol delay request message.
Wherein, in step 302, when the PTP protocol synchronization message is transmitted from the primary auxiliary device 110 to the other auxiliary device 120, the PTP protocol synchronization message may include a transmission time estimation timestamp estimating a time at which the synchronization message is transmitted. Wherein the time stamp is generated by programmable logic device 130. The programmable logic device generates a continuous operation time by continuously generating PPS second pulse signals and periodically outputs UTC timestamp information. Since the PTP protocol synchronization message is periodically transmitted from the master clock of the primary and secondary devices 110 to the clocks of the other secondary devices 120, the transmission time estimation timestamp carried by the PTP protocol synchronization message is only used to estimate the time of transmission, and cannot carry the exact time of the PTP protocol synchronization message leaving the master clock of the primary and secondary devices 110. Thus, when the PTP protocol synchronization message leaves the master clock of the primary and secondary device 110, a first timestamp T1 is generated that accurately records the time. Then, when the PTP protocol follow message is subsequently transmitted from the master clock of the master auxiliary device 110 to the clocks of the other auxiliary devices 120, a first time stamp T1 indicating the precise transmission time of the PTP protocol synchronous message is encapsulated in the PTP protocol follow message. The time that the PTP protocol synchronization message leaves the master clock of the primary auxiliary device 110 and the time that the clocks of the other auxiliary devices 120 are reached and the time that the PTP protocol delay request message leaves the master clock of the primary auxiliary device 110 and the time that the clocks of the other auxiliary devices 120 are respectively time stamped with time stamps T1, T2, T3, T4. Through the above steps, the clocks of the other auxiliary devices 120 obtain the first timestamp T1, the second timestamp T2, the third timestamp T3, and the fourth timestamp T4, and obtain the transmission time T1 of the PTP protocol synchronous message, the reception time T2 of the PTP protocol synchronous message, the transmission time T3 of the PTP protocol delay request message, and the reception time T4 of the PTP protocol delay request message, which are respectively identified by the above timestamps. The time stamp may be generated by programmable logic device 130.
In one embodiment, the step of calculating a time offset between the clocks of the other auxiliary devices and the master clock of the master auxiliary device based on the transmission of the packets of the PTP protocol further comprises: based on the first, second, third and fourth time stamps T1, T2, T3 and T4, a time offset between the clocks of the other auxiliary devices 120 and the master clock of the primary auxiliary device 110 is calculated.
Fig. 4 is a schematic diagram of packet transmission in a network according to the PTP protocol of an embodiment. In fig. 4, offset represents the time offset between the master clock of the master auxiliary device 110 and the clocks of the other auxiliary devices 120. That is, the time offset value between the two clocks is offset. In fig. 4, the delay represents a network delay when a PTP protocol packet is transmitted in the network, that is, a delay generated when the PTP protocol packet is transmitted from one clock to another clock through the network. The clocks of the other auxiliary devices 120 may calculate the time offset and the network delay between the master clock of the master auxiliary device 110 and the clocks of the other auxiliary devices 120 by the resulting times T1, T2, T3, T4 identified by the accurate time stamps T1, T2, T3, T4. Specifically, the following formula (1) and formula (2) can be used.
The above-described process of calculating the time offset between the master clock of the master auxiliary device 110 and the clocks of the other auxiliary devices 120 may be performed by the other auxiliary devices 120. Thus, the other auxiliary device 120 can obtain the time offset between the two clocks. After the other auxiliary device 120 obtains the time offset between the two clocks, the clocks of the other auxiliary device 120 may be adjusted and modified so that the master clock of the master auxiliary device 110 and the clocks of the other auxiliary devices 120 are synchronized.
In one embodiment, in the process of transmitting the PTP protocol messages, the same type of PTP protocol messages are transmitted at the same message processing time.
As described above, the PTP protocol messages include PTP protocol synchronous messages, PTP protocol follow messages, PTP protocol delay request response messages, and other types of PTP protocol messages. Since PTP protocol synchronous messages are periodically sent from the master clock of the primary auxiliary device 110 to the clocks of the other auxiliary devices 120, the transmission process of the PTP protocol messages in the network shown in fig. 4 is performed periodically. The processing of the PTP protocol is the processing of completing the transmission of four types of PTP protocol messages, namely a PTP protocol synchronous message, a PTP protocol follow message, a PTP protocol delay request message and a PTP protocol delay request response message. In this embodiment, the message processing time of the PTP protocol synchronous message is the same in each of the processes of executing the PTP protocol, the message processing time of the PTP protocol follow message is the same in each of the processes of executing the PTP protocol, the message processing time of the PTP protocol delay request message is the same in each of the processes of executing the PTP protocol, and the message processing time of the PTP protocol delay request response message is the same in each of the processes of executing the PTP protocol. In other words, in each process of executing the PTP protocol, the processing time of the packet of the PTP protocol is the same.
With continued reference to fig. 5, fig. 5 is a schematic diagram of processing of a packet of the PTP protocol in a network according to an embodiment. The arrow direction in fig. 5 is an example of the transmission direction of a message of the PTP protocol in the network. The transmission times of messages in the network, i.e., t2-t1 and t4-t3, include the time that the messages are transmitted through routers and/or switches in the network, as well as the message processing time. Message processing time refers to the time from processing the message. The process of processing the message will be described in detail below. In the process of passing a PTP protocol message from the primary auxiliary device 110 to the other auxiliary devices 120, the message passes through the application layer, transport layer, network layer, MAC layer and physical layer in the network. In each layer of the network, the message is encapsulated by adding a header and/or a trailer, so as to be sequentially transmitted in each layer. In this embodiment, the time for performing the above processing in the transmission of the same type of PTP protocol packet is the same in each transmission of the PTP protocol, and the processing time for the PTP protocol packet is the same in each transmission of the PTP protocol.
In the process of transmitting the PTP protocol messages, the same type of PTP protocol messages are transmitted with the same message processing time, so that instability of the message processing time can be eliminated, time deviation and delay caused by time of the messages passing through a router and/or a switch in the process of transmitting the messages in a network are only needed to be calculated, and the overall time synchronization accuracy is improved.
In one embodiment, the message processing time is a transmission time of a PTP protocol message between a MAC layer and an application layer of the network on the primary auxiliary device side or on the other auxiliary device side.
With continued reference to fig. 5, when a PTP protocol packet is transferred from the primary auxiliary device to the other auxiliary device 120, the PTP protocol packet sequentially passes through an application layer, a transport layer, a network layer, a link layer (MAC layer) in the network on the primary auxiliary device 110 side, and is encapsulated in the respective layers. The specific encapsulation process is, for example, that a PTP protocol message in an application layer is transmitted after being filled by an application program; encapsulating the PTP message and the UDP header into a UDP message at a transport layer; adding an IPv4 IP header into a network layer, and encapsulating the IP header into an IP message; encapsulation into ethernet frame transmissions occurs in the link layer. It should be understood that the PTP protocol packets are not limited to encapsulation via UDP and IPv4, but may also be encapsulated via UDP and IPv6, or using other known encapsulation means. Thereafter, the PTP protocol messages are passed through routers and/or switches (i.e., through the transit of the physical, link, and network layers) to other auxiliary devices 120. On the other auxiliary device 120 side, the encapsulated PTP protocol packet sequentially passes through the physical layer, the link layer (MAC layer), the network layer, the transport layer, and the application layer, and is decapsulated in each layer, so that the other auxiliary device 120 obtains the PTP protocol packet. Specifically, the time for encapsulating and decapsulating the message is the message processing time.
In this embodiment, the message processing time is the time when a message of the PTP protocol is transmitted from the application layer to the MAC layer and from the MAC layer to the application layer in the network. By controlling the time of the messages of the same type of PTP protocol transmitted from the application layer to the MAC layer and from the MAC layer to the application layer in the network to be the same in each PTP protocol executing process, the message processing time of the messages can be controlled to be the same in each PTP protocol executing process, namely instability of the message processing time is eliminated, and time deviation and delay caused by the time of the messages passing through a router and/or a switch in the network transmitting process are only calculated, so that the integral time synchronization precision is improved.
In one embodiment, referring to fig. 6, the method for time synchronizing an auxiliary device of an autonomous vehicle further comprises:
step 602: the network media interface is monitored.
Step 604: when signals of the network media interface are monitored, messages of PTP protocol are transmitted between the primary and other auxiliary devices 110, 120 via the network.
The network media interface may be a media independent interface (Media Independent Interface, MII), or media independent interface, which includes a management interface between the MAC layer and the physical layer for communication between the MAC layer and the physical layer. The network media interface may detect whether data is being transferred over the network. Specifically, the network media interface generates an interface signal when the physical layer transmits data or when the physical layer receives data transmitted from the MAC. When the programmable logic device 130 monitors the signals of the network media interface, the transmission of the PTP protocol is performed, i.e. the transmission of the messages of the PTP protocol between the primary auxiliary device 110 and the other auxiliary devices 120 via the network. The network media interface may be MII, RMII, SMII or GMII, among others.
In one embodiment, the method further comprises modifying the hardware logic of programmable logic device 130 based on the number of auxiliary devices.
As described above, the number of other auxiliary devices 120 is not limited, and there may be more other auxiliary devices 120. Thus, the user may change the number of other auxiliary devices 120. In this embodiment, the hardware logic of programmable logic device 130 may be modified based on the number of auxiliary devices. That is, as the number of other auxiliary devices 120 increases or decreases, the functionality of programmable logic device 130 may be adaptively modified to enable it to control a greater or lesser number of auxiliary devices. Compared with the scheme of controlling the transmission of the PTP protocol using the chip, the scheme according to the embodiment of the application can control the auxiliary device by adjusting the function of the programmable logic device 130, does not need to re-develop and replace the chip, and is more flexible.
In one embodiment, the auxiliary device includes a ranging sensor and a camera.
Specifically, the primary auxiliary device 110 and the other auxiliary devices 120 may be a plurality of sensors, such as a ranging sensor and a camera, respectively, that are mounted in the vehicle. The sensors may be sensors for assisting autopilot, or sensors for remote assistance of driving functions. In the field of automatic driving or driving assistance, it is necessary to synchronize clocks of a plurality of sensors mounted in a vehicle with high accuracy using an accurate time synchronization protocol to ensure that the plurality of sensors can provide data at the same time. According to the technical scheme, the high-precision PTP protocol time synchronization is performed on the plurality of sensors mounted in the vehicle based on the programmable logic device, and the time synchronization precision is higher.
Referring to fig. 7, in one embodiment, an autonomous vehicle 700 is provided that includes a plurality of auxiliary devices, a programmable logic device 730, and a processor 750. The plurality of auxiliary devices each have a clock. Wherein the processor 750 is configured to determine one of the plurality of auxiliary devices as a primary auxiliary device 710 and to take a clock of the primary auxiliary device 710 as a primary clock; the programmable logic device 730 is configured to control the transmission of PTP protocol messages between the primary auxiliary device 710 and the other auxiliary devices 720 via a network. The other auxiliary device 720 is configured to calculate a time offset between the clock of the other auxiliary device 720 and the master clock of the master auxiliary device 710 based on the transmission of the PTP protocol, and adjust the clock of the other auxiliary device 720 based on the time offset so that the clock of the other auxiliary device 720 is synchronized with the master clock.
According to the automatic driving vehicle, the auxiliary equipment in the vehicle is controlled through the programmable logic device, and due to the multipath parallel characteristic of the programmable logic device, the time for processing the message in the process of executing the PTP protocol message transmission can be accurately controlled, namely instability of the time in each PTP protocol processing is eliminated, in other words, the time for processing the message is the same in each PTP protocol processing, so that time deviation between a main clock of a main auxiliary equipment and clocks of other auxiliary equipment is calculated more accurately, and time synchronization precision among a plurality of auxiliary equipment is improved. Therefore, in the automatic driving vehicle, the data of a plurality of auxiliary equipment at the same time can be provided, more reliable data of the auxiliary equipment is provided for automatic driving, and the performance of automatic driving is improved. In addition, since the functions of the programmable logic device can be changed according to actual requirements, the clock of the auxiliary equipment for controlling the vehicle based on the programmable logic device performs the PTP protocol to perform time synchronization, and thus, the system has higher flexibility.
In one embodiment, vehicle 700 further includes a vehicle control 740. The vehicle control 740 may be a processor that controls the primary auxiliary device 710 and the other auxiliary devices 720 in the vehicle for acquiring data of the primary auxiliary device 710 and the other auxiliary devices 720. Programmable logic device 730 is coupled to processor 750 by a bus, and the operating state of programmable logic device 730 is controlled by processor 750. For simplicity of description, only one other auxiliary device 720 is shown in fig. 7, but it should be understood that the vehicle 700 may include more other auxiliary devices 720.
In one embodiment, programmable logic device 730 is further configured to: transmitting PTP protocol synchronization messages from the primary auxiliary device 710 to the other auxiliary devices 720 and generating a first timestamp; when the other auxiliary device 720 receives the PTP protocol synchronization message, a second timestamp is generated; transmitting a PTP protocol follow up message including a first time stamp from the primary auxiliary device 710 to the other auxiliary devices 720; transmitting a PTP protocol delay request message from the other auxiliary device 720 to the primary auxiliary device and generating a third timestamp; when the primary and secondary device 710 receives the PTP protocol delay request message, a fourth timestamp is generated; and transmitting a PTP protocol delay request response message including a fourth timestamp from the primary auxiliary device 710 to the other auxiliary devices 720 in response to the PTP protocol delay request message.
In one embodiment, the other auxiliary device 720 is further configured to: based on the first, second, third, and fourth time stamps, a time offset between the clocks of the other auxiliary devices 720 and the master clock of the master auxiliary device is calculated.
In one embodiment, programmable logic device 730 is further configured to: in the process of transmitting the PTP protocol messages, the same type of PTP protocol messages are transmitted with the same message processing time.
In one embodiment, the message processing time is the transmission time of a PTP protocol message between the MAC layer and the application layer of the network on the primary assist device 710 side or other assist device side 720.
In one embodiment, the programmable logic device is further configured to: monitoring a network media interface; and when signals of the network media interface are monitored, control is made to transmit messages of PTP protocol between the primary auxiliary device 710 and the other auxiliary devices 720 via the network.
In one embodiment, the hardware logic of programmable logic device 730 can be modified based on the number of auxiliary devices.
In one embodiment, the auxiliary device includes a ranging sensor and a camera.
For specific limitations on the vehicle of the present embodiment, reference may be made to the above limitation on the method for time-synchronizing auxiliary devices of an autonomous vehicle, and no further description is given here.
In one embodiment, a computer device is provided, which may be a terminal, and the internal structure thereof may be as shown in fig. 8. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface of the computer device is used for communicating with an external terminal through a network connection. Which computer program, when being executed by a processor, carries out the steps of the various method embodiments described above. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, can also be keys, a track ball or a touch pad arranged on the shell of the computer equipment, and can also be an external keyboard, a touch pad or a mouse and the like.
It will be appreciated by those skilled in the art that the structure shown in FIG. 8 is merely a block diagram of some of the structures associated with the present inventive arrangements and is not limiting of the computer device to which the present inventive arrangements may be applied, and that a particular computer device may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
A computer device comprising a memory and one or more processors, the memory having stored thereon computer-readable instructions that, when executed by the one or more processors, cause the one or more processors to perform the steps of the various method embodiments described above.
One or more non-transitory computer-readable storage media storing computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps in the various method embodiments described above.
Those skilled in the art will appreciate that implementing all or part of the processes of the methods of the embodiments described above may be accomplished by instructing the associated hardware by computer readable instructions stored on a non-transitory computer readable storage medium, which when executed may comprise processes of embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
The technical features of the above-described embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above-described embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples illustrate only a few embodiments of the invention, which are described in detail and are not to be construed as limiting the scope of the invention. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the invention, which are all within the scope of the invention. Accordingly, the scope of protection of the present invention is to be determined by the appended claims.
Claims (14)
1. A method for time synchronizing a plurality of auxiliary devices of an autonomous vehicle, for use in an autonomous vehicle, the autonomous vehicle comprising a plurality of auxiliary devices and a programmable logic device, the method comprising:
determining one of the plurality of auxiliary devices as a master auxiliary device and taking a clock of the master auxiliary device as a master clock;
Monitoring a network media interface;
when the signal of the network media interface is monitored, the programmable logic device is used for controlling the transmission of the PTP protocol messages between the main auxiliary equipment and other auxiliary equipment through the network, and the same type of PTP protocol messages are transmitted at the same message processing time in the process of transmitting the PTP protocol messages; the programmable logic device carries out multipath parallel processing on the signals;
calculating time deviation between clocks of the other auxiliary devices and a master clock of the master auxiliary device based on the transmission of the messages of the PTP protocol; the PTP protocol message comprises a PTP protocol synchronous message; the PTP protocol synchronous message comprises a time stamp for estimating the time of sending the PTP protocol synchronous message; the timestamp is generated by the programmable logic device; and
adjusting clocks of the other auxiliary devices based on the time deviation so that the clocks of the other auxiliary devices are synchronous with the master clock;
the method further comprises the steps of: when the user changes the number of other auxiliary devices, the hardware logic of the programmable logic device is modified based on the number of auxiliary devices, so that the number of auxiliary devices which can be controlled by the programmable logic device is increased or decreased corresponding to the increased or decreased number of other auxiliary devices.
2. The method of claim 1, wherein controlling, by a programmable logic device, transmission of PTP protocol messages between the primary auxiliary device and the other auxiliary device via a network, comprises:
transmitting a PTP protocol synchronous message from the main auxiliary equipment to the other auxiliary equipment, and generating a first time stamp;
when the other auxiliary equipment receives the PTP protocol synchronous message, generating a second timestamp;
transmitting a PTP protocol follow-up message including the first timestamp from the primary auxiliary device to the other auxiliary device;
transmitting a PTP protocol delay request message from the other auxiliary equipment to the main auxiliary equipment, and generating a third timestamp;
when the primary and secondary equipment receives the PTP protocol delay request message, generating a fourth timestamp; and
and transmitting a PTP protocol delay request response message including the fourth timestamp from the primary auxiliary device to the other auxiliary device in response to the PTP protocol delay request message.
3. The method of claim 2, wherein calculating a time offset between the clocks of the other auxiliary devices and the master clock of the master auxiliary device based on the transmission of the messages of the PTP protocol comprises:
A time offset between the clocks of the other auxiliary devices and the master clock of the master auxiliary device is calculated based on the first, second, third and fourth time stamps.
4. The method according to claim 1, wherein the message processing time is a transmission time of a PTP protocol message between a MAC layer and an application layer of the network on the primary auxiliary device side or on the other auxiliary device side.
5. The method of claim 1, further comprising:
the network media interface is a media independent interface.
6. The method of claim 1, wherein the auxiliary device comprises a ranging sensor and a camera.
7. An autonomous vehicle, comprising:
a plurality of auxiliary devices each having a clock;
a processor configured to determine one of the plurality of auxiliary devices as a primary auxiliary device and to take a clock of the primary auxiliary device as a primary clock; and
a programmable logic device configured to monitor the network media interface; when the signal of the network media interface is monitored, controlling the transmission of the PTP protocol messages between the main auxiliary equipment and other auxiliary equipment through the network, and transmitting the PTP protocol messages of the same type with the same message processing time in the process of transmitting the PTP protocol messages; the programmable logic device carries out multipath parallel processing on the signals;
Wherein the other auxiliary equipment is configured to calculate time deviation between clocks of the other auxiliary equipment and a master clock of the master auxiliary equipment based on the transmission of the messages of the PTP protocol; the PTP protocol message comprises a PTP protocol synchronous message; the PTP protocol synchronous message comprises a time stamp for estimating the time of sending the PTP protocol synchronous message; the timestamp is generated by the programmable logic device; adjusting clocks of the other auxiliary equipment based on the time deviation so that the clocks of the other auxiliary equipment are synchronous with the master clock; when the user changes the number of other auxiliary devices, the hardware logic of the programmable logic device is modified based on the number of auxiliary devices, so that the number of auxiliary devices which can be controlled by the programmable logic device is increased or decreased corresponding to the increased or decreased number of other auxiliary devices.
8. The autonomous vehicle of claim 7, wherein the programmable logic device is further configured to:
transmitting a PTP protocol synchronous message from the main auxiliary equipment to the other auxiliary equipment, and generating a first time stamp;
when the other auxiliary equipment receives the PTP protocol synchronous message, generating a second timestamp;
Transmitting a PTP protocol follow-up message including the first timestamp from the primary auxiliary device to the other auxiliary device;
transmitting a PTP protocol delay request message from the other auxiliary equipment to the main auxiliary equipment, and generating a third timestamp;
when the primary and secondary equipment receives the PTP protocol delay request message, generating a fourth timestamp; and
and transmitting a PTP protocol delay request response message including the fourth timestamp from the primary auxiliary device to the other auxiliary device in response to the PTP protocol delay request message.
9. The autonomous vehicle of claim 8, wherein the other auxiliary devices are further configured to:
a time offset between the clocks of the other auxiliary devices and the master clock of the master auxiliary device is calculated based on the first, second, third and fourth time stamps.
10. The autonomous vehicle of claim 7, wherein the message processing time is a transmission time of a PTP protocol message between a MAC layer and an application layer of the network on the primary auxiliary device side or the other auxiliary device side.
11. The autonomous vehicle of claim 7, wherein the programmable logic device is further configured to:
The network media interface is a media independent interface.
12. The autonomous vehicle of claim 7, wherein the auxiliary device comprises a ranging sensor and a camera.
13. Computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor when executing the computer program performs the following processing:
determining one of a plurality of auxiliary devices in an autonomous vehicle as a master auxiliary device and taking a clock of the master auxiliary device as a master clock;
monitoring a network media interface;
when the signal of the network media interface is monitored, a programmable logic device is used for controlling the transmission of the PTP protocol messages between the main auxiliary equipment and other auxiliary equipment through a network, and the same type of PTP protocol messages are transmitted with the same message processing time in the process of transmitting the PTP protocol messages; the programmable logic device carries out multipath parallel processing on the signals;
calculating time deviation between clocks of the other auxiliary devices and a master clock of the master auxiliary device based on the transmission of the messages of the PTP protocol; the PTP protocol message comprises a PTP protocol synchronous message; the PTP protocol synchronous message comprises a time stamp for estimating the time of sending the PTP protocol synchronous message; the timestamp is generated by the programmable logic device; and
Adjusting clocks of the other auxiliary devices based on the time deviation so that the clocks of the other auxiliary devices are synchronous with the master clock;
when the user changes the number of other auxiliary devices, the hardware logic of the programmable logic device is modified based on the number of auxiliary devices, so that the number of auxiliary devices which can be controlled by the programmable logic device is increased or decreased corresponding to the increased or decreased number of other auxiliary devices.
14. A computer readable storage medium having stored thereon a computer program, wherein the computer program when executed by a processor performs the following process:
determining one of a plurality of auxiliary devices in an autonomous vehicle as a master auxiliary device and taking a clock of the master auxiliary device as a master clock;
monitoring a network media interface;
when the signal of the network media interface is monitored, a programmable logic device is used for controlling the transmission of the PTP protocol messages between the main auxiliary equipment and other auxiliary equipment through a network, and the same type of PTP protocol messages are transmitted with the same message processing time in the process of transmitting the PTP protocol messages; the programmable logic device carries out multipath parallel processing on the signals;
Calculating time deviation between clocks of the other auxiliary devices and a master clock of the master auxiliary device based on the transmission of the messages of the PTP protocol; the PTP protocol message comprises a PTP protocol synchronous message; the PTP protocol synchronous message comprises a time stamp for estimating the time of sending the PTP protocol synchronous message; the timestamp is generated by the programmable logic device; and
adjusting clocks of the other auxiliary devices based on the time deviation so that the clocks of the other auxiliary devices are synchronous with the master clock;
when the user changes the number of other auxiliary devices, the hardware logic of the programmable logic device is modified based on the number of auxiliary devices, so that the number of auxiliary devices which can be controlled by the programmable logic device is increased or decreased corresponding to the increased or decreased number of other auxiliary devices.
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2020/091144 WO2021232260A1 (en) | 2020-05-20 | 2020-05-20 | Method for time synchronization of a plurality of auxiliary devices of autonomous vehicle, vehicle, computer device, and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113273105A CN113273105A (en) | 2021-08-17 |
CN113273105B true CN113273105B (en) | 2023-09-12 |
Family
ID=77227970
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202080007588.7A Active CN113273105B (en) | 2020-05-20 | 2020-05-20 | Method for time synchronization of a plurality of auxiliary devices of an autonomous vehicle, computer device and storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN113273105B (en) |
WO (1) | WO2021232260A1 (en) |
Families Citing this family (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113821074B (en) * | 2021-09-06 | 2023-09-08 | 北京车和家信息技术有限公司 | Time synchronization method and device, electronic equipment and storage medium |
CN113839732B (en) * | 2021-09-18 | 2024-07-05 | 阿里巴巴达摩院(杭州)科技有限公司 | Clock synchronization method, device and equipment |
CN113904959B (en) * | 2021-11-02 | 2023-04-07 | 广州小鹏自动驾驶科技有限公司 | Time delay analysis method and device, vehicle and storage medium |
CN114980005A (en) * | 2022-05-16 | 2022-08-30 | 中国第一汽车股份有限公司 | Data transmission method, data transmission device, storage medium, processor and electronic device |
CN115276867A (en) * | 2022-06-16 | 2022-11-01 | 中国第一汽车股份有限公司 | Radar data transmission method and device based on TSN time sensitive network communication technology and vehicle thereof |
CN115047938B (en) * | 2022-08-12 | 2022-11-04 | 浙江大学 | Clock synchronization method, system, electronic device and computer readable storage medium |
CN116054987B (en) * | 2022-10-12 | 2023-12-15 | 哈尔滨市科佳通用机电股份有限公司 | Timing method of vehicle-mounted equipment and storage medium |
CN116032412B (en) * | 2023-03-28 | 2023-07-18 | 之江实验室 | Multi-camera cross-platform time synchronization method, device and system and electronic equipment |
CN116938378B (en) * | 2023-09-14 | 2024-01-09 | 西安羚控电子科技有限公司 | Clock synchronization precision measurement method and device based on reflection memory network |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109462454A (en) * | 2018-12-31 | 2019-03-12 | 武汉环宇智行科技有限公司 | Automobile sensor method for synchronizing time and system based on PTP protocol |
CN110225544A (en) * | 2019-06-27 | 2019-09-10 | 合肥更鼓电子科技有限公司 | A kind of mobile communication base station high-precision time synchronization method based on fiber optic network |
CN110351823A (en) * | 2018-04-03 | 2019-10-18 | 华为技术有限公司 | The method and apparatus of communication |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TWI411277B (en) * | 2009-12-23 | 2013-10-01 | Ind Tech Res Inst | Network slave node and time synchronization method in network applying the same |
KR102208580B1 (en) * | 2018-02-09 | 2021-01-28 | 한국전자통신연구원 | Unmanned vehicle, apparatus for supporting time synchronization between unmanned vehicles and method for the same |
US10868664B2 (en) * | 2018-07-20 | 2020-12-15 | Integrated Device Technology, Inc. | Minimizing timestamp error in PTP systems |
CN110401505A (en) * | 2019-07-19 | 2019-11-01 | 深圳大学 | A kind of wireless network accurate time synchronization method |
-
2020
- 2020-05-20 CN CN202080007588.7A patent/CN113273105B/en active Active
- 2020-05-20 WO PCT/CN2020/091144 patent/WO2021232260A1/en unknown
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110351823A (en) * | 2018-04-03 | 2019-10-18 | 华为技术有限公司 | The method and apparatus of communication |
CN109462454A (en) * | 2018-12-31 | 2019-03-12 | 武汉环宇智行科技有限公司 | Automobile sensor method for synchronizing time and system based on PTP protocol |
CN110225544A (en) * | 2019-06-27 | 2019-09-10 | 合肥更鼓电子科技有限公司 | A kind of mobile communication base station high-precision time synchronization method based on fiber optic network |
Also Published As
Publication number | Publication date |
---|---|
WO2021232260A1 (en) | 2021-11-25 |
CN113273105A (en) | 2021-08-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113273105B (en) | Method for time synchronization of a plurality of auxiliary devices of an autonomous vehicle, computer device and storage medium | |
US11177896B2 (en) | Time synchronization device and time synchronization method | |
KR102652569B1 (en) | Implementation of PHY-level hardware timestamping and time synchronization in cost-optimized environments | |
KR101426325B1 (en) | Network element for a packet-switched network | |
US9960871B1 (en) | Method and apparatus for securing clock synchronization in a network | |
US11979481B2 (en) | Time synchronisation | |
CN107710753B (en) | Decentralized synchronous multisensor system | |
CN111555834B (en) | Clock synchronization method and system of wireless network based on IEEE1588 protocol | |
US11316605B2 (en) | Method, device, and computer program for improving synchronization of clocks in devices linked according to a daisy-chain topology | |
US10592552B1 (en) | Determining real-time timestamps for robotic sensor data | |
CN110176973B (en) | Method, system, computer device and storage medium for clock synchronization | |
US11463973B2 (en) | Clock synchronization using wireless side channel | |
KR20160078893A (en) | Semiconductor device, electronic device module and network system | |
US11349587B2 (en) | Generating a timestamp | |
CN114586297A (en) | Synchronization method and device | |
WO2018041108A1 (en) | Method, apparatus, and device for determining clock time of time synchronization packet | |
EP3985890A1 (en) | Physical layer device with precision timing | |
US10111189B2 (en) | Enhanced phase synchronization of a timing slave apparatus in a packet switching network | |
Gutiérrez et al. | Time synchronization in modular collaborative robots | |
US20170117980A1 (en) | Time synchronization for network device | |
CN116017670A (en) | Wireless network node synchronization method, system, equipment and readable storage medium | |
CN113887557A (en) | Method, system, equipment and storage medium for multi-sensor data fusion | |
US20140241344A1 (en) | Direct updating of network delay in synchronization packets | |
CN112119366A (en) | Time synchronization method, device and system and movable platform | |
CN115276866B (en) | Clock synchronization method and device of intelligent driving system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |