CN118784130A - Time synchronization method, storage medium and electronic device - Google Patents
Time synchronization method, storage medium and electronic device Download PDFInfo
- Publication number
- CN118784130A CN118784130A CN202410863027.7A CN202410863027A CN118784130A CN 118784130 A CN118784130 A CN 118784130A CN 202410863027 A CN202410863027 A CN 202410863027A CN 118784130 A CN118784130 A CN 118784130A
- Authority
- CN
- China
- Prior art keywords
- time
- synchronization
- pbox
- timestamp
- domain controller
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 58
- 230000001360 synchronised effect Effects 0.000 claims abstract description 53
- 238000010295 mobile communication Methods 0.000 claims abstract description 28
- 230000004044 response Effects 0.000 claims abstract description 22
- 238000004590 computer program Methods 0.000 claims description 23
- 238000010586 diagram Methods 0.000 description 9
- 238000004891 communication Methods 0.000 description 8
- 230000005540 biological transmission Effects 0.000 description 5
- 230000007613 environmental effect Effects 0.000 description 5
- 101001121408 Homo sapiens L-amino-acid oxidase Proteins 0.000 description 4
- 102100026388 L-amino-acid oxidase Human genes 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 4
- 230000006870 function Effects 0.000 description 4
- 230000004927 fusion Effects 0.000 description 3
- 238000012544 monitoring process Methods 0.000 description 3
- 230000006855 networking Effects 0.000 description 3
- 230000008447 perception Effects 0.000 description 3
- 238000012545 processing Methods 0.000 description 3
- 101000827703 Homo sapiens Polyphosphoinositide phosphatase Proteins 0.000 description 2
- 102100023591 Polyphosphoinositide phosphatase Human genes 0.000 description 2
- 230000006872 improvement Effects 0.000 description 2
- 238000005259 measurement Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 101100012902 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) FIG2 gene Proteins 0.000 description 1
- 101100233916 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) KAR5 gene Proteins 0.000 description 1
- 230000002159 abnormal effect Effects 0.000 description 1
- 230000001133 acceleration Effects 0.000 description 1
- 230000006399 behavior Effects 0.000 description 1
- 239000013078 crystal Substances 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 229910052701 rubidium Inorganic materials 0.000 description 1
- IGLNJRXAVVLDKE-UHFFFAOYSA-N rubidium atom Chemical compound [Rb] IGLNJRXAVVLDKE-UHFFFAOYSA-N 0.000 description 1
- 230000002123 temporal effect Effects 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
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
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Synchronisation In Digital Transmission Systems (AREA)
- Electric Clocks (AREA)
Abstract
本发明实施例提供了一种时间同步方法、存储介质及电子装置,该方法包括:在域控制器上电后的指定时间段内,响应于接收到的时间获取请求,通过移动通信网络获取网络时间,并将网络时间发送给域控制器,其中,时间获取请求是域控制器发送给定位盒子Pbox的请求;获取域控制器发送的第一同步时间,其中,域控制器用于对至少一个从设备进行时间同步,至少一个从设备包括Pbox,第一同步时间是以网络时间作为起始时间对域控制器的本地时间进行更新所得到的时间,域控制器的本地时间是域控制器中的第一计时器提供的时间;基于第一同步时间,将Pbox的本地时间更新为第二同步时间,其中,第一同步时间与第二同步时间同步。
An embodiment of the present invention provides a time synchronization method, a storage medium and an electronic device, the method comprising: within a specified time period after a domain controller is powered on, in response to a received time acquisition request, obtaining network time through a mobile communication network, and sending the network time to the domain controller, wherein the time acquisition request is a request sent by the domain controller to a positioning box Pbox; obtaining a first synchronization time sent by the domain controller, wherein the domain controller is used to synchronize time for at least one slave device, the at least one slave device includes a Pbox, the first synchronization time is the time obtained by updating the local time of the domain controller with the network time as the starting time, and the local time of the domain controller is the time provided by a first timer in the domain controller; based on the first synchronization time, updating the local time of the Pbox to a second synchronization time, wherein the first synchronization time is synchronized with the second synchronization time.
Description
技术领域Technical Field
本发明实施例涉及自动驾驶领域,具体而言,涉及一种时间同步方法、存储介质及电子装置。Embodiments of the present invention relate to the field of autonomous driving, and in particular, to a time synchronization method, a storage medium, and an electronic device.
背景技术Background Art
Pbox(定位盒子)是智能驾驶系统中用于提供高精度定位的设备。它通常集成了全球导航卫星系统(GNSS)和INS(Inertial Navigation System,惯性导航系统),以提供车辆的精确位置和姿态信息。Pbox内部的时间同步对于确保导航数据的准确性至关重要。Pbox (positioning box) is a device used to provide high-precision positioning in intelligent driving systems. It usually integrates the Global Navigation Satellite System (GNSS) and INS (Inertial Navigation System) to provide precise position and attitude information of the vehicle. Time synchronization within the Pbox is essential to ensure the accuracy of navigation data.
相关技术中的时间同步方法是通过Pbox给出的PPS(Pulse Per Second,脉冲秒)信号和GPRMC(Global Positioning System Recommended MinimumNavigationInformation,全球定位系统推荐最小导航信息)数据,域控制器(简称域控)接收后进行解析、同步;在地库等没有卫星信号的场景下,由于没有PPS输出,无法完成给域控授时,并且等车辆行驶到路面等卫星信号的场景下,时间会产生跳变。The time synchronization method in the related technology is to use the PPS (Pulse Per Second) signal and GPRMC (Global Positioning System Recommended Minimum Navigation Information) data given by the Pbox, and the domain controller (referred to as domain controller) receives and parses and synchronizes them; in scenarios where there is no satellite signal such as in the basement, due to the lack of PPS output, the domain controller cannot be synchronized with the time, and when the vehicle drives to the road and waits for the satellite signal, the time will jump.
由此可见,相关技术中的时间同步方法存在车辆在没有卫星信号的场景下无法进行时间同步的问题。It can be seen that the time synchronization method in the related art has the problem that the vehicle cannot perform time synchronization in a scenario where there is no satellite signal.
发明内容Summary of the invention
本发明实施例提供了一种时间同步方法、存储介质及电子装置,以至少解决相关技术中的时间同步方法存在车辆在没有卫星信号的场景下无法进行时间同步的问题。The embodiments of the present invention provide a time synchronization method, a storage medium and an electronic device to at least solve the problem that the time synchronization method in the related art cannot perform time synchronization when there is no satellite signal.
根据本发明的一个实施例,提供了一种时间同步方法,包括:在域控制器上电后的指定时间段内,响应于接收到的时间获取请求,通过移动通信网络获取网络时间,并将所述网络时间发送给所述域控制器,其中,所述时间获取请求是所述域控制器发送给定位盒子Pbox的请求;获取所述域控制器发送的第一同步时间,其中,所述域控制器用于对至少一个从设备进行时间同步,所述至少一个从设备包括所述Pbox,所述第一同步时间是以所述网络时间作为起始时间对所述域控制器的本地时间进行更新所得到的时间,所述域控制器的本地时间是所述域控制器中的第一计时器提供的时间;基于所述第一同步时间,将所述Pbox的本地时间更新为第二同步时间,其中,所述第一同步时间与所述第二同步时间同步。According to one embodiment of the present invention, there is provided a time synchronization method, comprising: within a specified time period after a domain controller is powered on, in response to a received time acquisition request, acquiring network time through a mobile communication network, and sending the network time to the domain controller, wherein the time acquisition request is a request sent by the domain controller to a positioning box Pbox; acquiring a first synchronization time sent by the domain controller, wherein the domain controller is used to perform time synchronization on at least one slave device, the at least one slave device includes the Pbox, the first synchronization time is the time obtained by updating the local time of the domain controller with the network time as the starting time, and the local time of the domain controller is the time provided by a first timer in the domain controller; based on the first synchronization time, updating the local time of the Pbox to a second synchronization time, wherein the first synchronization time is synchronized with the second synchronization time.
在一个示例性实施例中,所述响应于接收到的时间获取请求,通过移动通信网络获取网络时间,包括:在所述Pbox无法检测到卫星信号的情况下,响应于接收到的所述时间获取请求,通过所述移动通信网络获取所述网络时间。In an exemplary embodiment, the obtaining of network time through a mobile communication network in response to a received time acquisition request includes: obtaining the network time through the mobile communication network in response to the received time acquisition request when the Pbox cannot detect a satellite signal.
在一个示例性实施例中,所述基于所述第一同步时间,将所述Pbox的本地时间更新为第二同步时间,包括:在所述Pbox的本地时间是所述Pbox中的第二计时器提供的时间的情况下,将所述Pbox中的所述第二计时器提供的当前时间更新为所述第二同步时间,并控制所述第二计时器从所述第二同步时间继续计时,其中,所述第二同步时间等于将所述第一同步时间与第一时间差值进行相加所得到的时间,所述第一时间差值是将所述第二计时器提供的当前时间减去第一时间所得到的差值,所述第一时间是所述Pbox接收到所述第一同步时间时所述第二计时器的时间。In an exemplary embodiment, updating the local time of the Pbox to the second synchronization time based on the first synchronization time includes: when the local time of the Pbox is the time provided by the second timer in the Pbox, updating the current time provided by the second timer in the Pbox to the second synchronization time, and controlling the second timer to continue timing from the second synchronization time, wherein the second synchronization time is equal to the time obtained by adding the first synchronization time to a first time difference, the first time difference is the difference obtained by subtracting the first time from the current time provided by the second timer, and the first time is the time of the second timer when the Pbox receives the first synchronization time.
在一个示例性实施例中,所述基于所述第一同步时间,将所述Pbox的本地时间更新为第二同步时间之后,所述方法还包括:基于所述第二同步时间,将车侧数据中的传感器数据被采集时的时间戳更新为与所述第二同步时间同步的时间戳,其中,所述车侧数据包括由所述Pbox采集到的车辆的所述传感器数据以及所述传感器数据被采集时的时间戳。In an exemplary embodiment, after updating the local time of the Pbox to the second synchronization time based on the first synchronization time, the method further includes: updating the timestamp when the sensor data in the vehicle-side data is collected to a timestamp synchronized with the second synchronization time based on the second synchronization time, wherein the vehicle-side data includes the sensor data of the vehicle collected by the Pbox and the timestamp when the sensor data is collected.
在一个示例性实施例中,在所述基于所述第一同步时间,将所述Pbox的本地时间更新为第二同步时间之后,所述方法还包括:在所述域控制器接收到路侧数据的情况下,基于所述第二同步时间,将所述路侧数据中的传感器数据被采集时的时间戳更新为与所述第二同步时间同步的时间戳,其中,所述路侧数据包括车辆外部的设备采集的所述传感器数据以及所述传感器数据被采集时的时间戳。In an exemplary embodiment, after the local time of the Pbox is updated to the second synchronization time based on the first synchronization time, the method further includes: when the domain controller receives roadside data, based on the second synchronization time, updating the timestamp when the sensor data in the roadside data is collected to a timestamp synchronized with the second synchronization time, wherein the roadside data includes the sensor data collected by a device outside the vehicle and the timestamp when the sensor data is collected.
在一个示例性实施例中,所述基于所述第二同步时间,将所述路侧数据中的传感器数据被采集时的时间戳更新为与所述第二同步时间同步的时间戳,包括:在所述Pbox通过全球导航卫星系统GNSS天线接收到世界标准时间的情况下,将所述路侧数据中的传感器数据被采集时的时间戳与第三时间差值进行相加,得到与所述第二同步时间同步的时间戳,其中,所述路侧数据中的传感器数据被采集时的时间戳是基于所述世界标准时间确定的时间戳,所述第三时间差值是将所述Pbox通过所述GNSS天线接收到所述世界标准时间时所述Pbox中的第二计时器提供的时间减去世界标准时间所得到的差值。In an exemplary embodiment, based on the second synchronization time, the timestamp when the sensor data in the roadside data is collected is updated to a timestamp synchronized with the second synchronization time, including: when the Pbox receives the world standard time through the global navigation satellite system GNSS antenna, the timestamp when the sensor data in the roadside data is collected is added to a third time difference to obtain a timestamp synchronized with the second synchronization time, wherein the timestamp when the sensor data in the roadside data is collected is a timestamp determined based on the world standard time, and the third time difference is the difference obtained by subtracting the world standard time from the time provided by the second timer in the Pbox when the Pbox receives the world standard time through the GNSS antenna.
在一个示例性实施例中,所述基于所述第二同步时间,将所述路侧数据中的传感器数据被采集时的时间戳更新为与所述第二同步时间同步的时间戳之后,所述方法还包括:在车侧数据中的传感器数据被采集时的时间戳更新为与所述第二同步时间同步的时间戳的情况下,基于更新时间戳后的所述车侧数据和更新时间戳后的所述路侧数据,确定车辆环境数据,其中,所述车侧数据包括由所述Pbox采集到的车辆的所述传感器数据以及所述传感器数据被采集时的时间戳,所述车辆环境数据用于指示所述车辆所在的位置。In an exemplary embodiment, after updating the timestamp of when the sensor data in the roadside data is collected to a timestamp synchronized with the second synchronization time based on the second synchronization time, the method further includes: when the timestamp of when the sensor data in the vehicle-side data is collected is updated to a timestamp synchronized with the second synchronization time, determining vehicle environment data based on the vehicle-side data after the updated timestamp and the roadside data after the updated timestamp, wherein the vehicle-side data includes the sensor data of the vehicle collected by the Pbox and the timestamp when the sensor data is collected, and the vehicle environment data is used to indicate the location of the vehicle.
根据本发明的另一个实施例,提供了一种时间同步的方法,包括:在域控制器上电后的指定时间段内,向定位盒子Pbox发送时间获取请求,其中,所述域控制器用于对至少一个从设备进行时间同步,所述至少一个从设备包括所述Pbox;获取所述Pbox响应于所述时间获取请求发送的网络时间,其中,所述网络时间是所述Pbox通过移动通信网络获取的时间;基于所述网络时间,将所述域控制器的本地时间更新为第一同步时间,并控制所述域控制器中的第一计时器从所述第一同步时间继续计时,其中,所述域控制器的本地时间是所述域控制器中的第一计时器提供的时间;向所述Pbox发送所述第一同步时间,其中,所述第一同步时间用于将所述Pbox的本地时间更新为第二同步时间,其中,所述第一同步时间与所述第二同步时间同步。According to another embodiment of the present invention, a time synchronization method is provided, comprising: sending a time acquisition request to a positioning box Pbox within a specified time period after a domain controller is powered on, wherein the domain controller is used to perform time synchronization on at least one slave device, and the at least one slave device includes the Pbox; acquiring the network time sent by the Pbox in response to the time acquisition request, wherein the network time is the time acquired by the Pbox through a mobile communication network; based on the network time, updating the local time of the domain controller to a first synchronization time, and controlling a first timer in the domain controller to continue timing from the first synchronization time, wherein the local time of the domain controller is the time provided by the first timer in the domain controller; sending the first synchronization time to the Pbox, wherein the first synchronization time is used to update the local time of the Pbox to a second synchronization time, wherein the first synchronization time is synchronized with the second synchronization time.
根据本发明的又一个实施例,提供了一种时间同步装置,包括:第一执行单元,用于在域控制器上电后的指定时间段内,响应于接收到的时间获取请求,通过移动通信网络获取网络时间,并将所述网络时间发送给所述域控制器,其中,所述时间获取请求是所述域控制器发送给定位盒子Pbox的请求;第一获取单元,用于获取所述域控制器发送的第一同步时间,其中,所述域控制器用于对至少一个从设备进行时间同步,所述至少一个从设备包括所述Pbox,所述第一同步时间是以所述网络时间作为起始时间对所述域控制器的本地时间进行更新所得到的时间,所述域控制器的本地时间是所述域控制器中的第一计时器提供的时间;第一更新单元,用于基于所述第一同步时间,将所述Pbox的本地时间更新为第二同步时间,其中,所述第一同步时间与所述第二同步时间同步。According to another embodiment of the present invention, a time synchronization device is provided, comprising: a first execution unit, for acquiring network time through a mobile communication network in response to a received time acquisition request within a specified time period after the domain controller is powered on, and sending the network time to the domain controller, wherein the time acquisition request is a request sent by the domain controller to a positioning box Pbox; a first acquisition unit, for acquiring a first synchronization time sent by the domain controller, wherein the domain controller is used to perform time synchronization on at least one slave device, the at least one slave device includes the Pbox, the first synchronization time is the time obtained by updating the local time of the domain controller with the network time as the starting time, and the local time of the domain controller is the time provided by a first timer in the domain controller; a first update unit, for updating the local time of the Pbox to a second synchronization time based on the first synchronization time, wherein the first synchronization time is synchronized with the second synchronization time.
在一个示例性实施例中,所述第一执行单元,包括:获取模块,用于在所述Pbox无法检测到卫星信号的情况下,响应于接收到的所述时间获取请求,通过所述移动通信网络获取所述网络时间。In an exemplary embodiment, the first execution unit includes: an acquisition module, which is used to acquire the network time through the mobile communication network in response to the received time acquisition request when the Pbox cannot detect a satellite signal.
在一个示例性实施例中,所述第一更新单元,包括:第一执行模块,用于在所述Pbox的本地时间是所述Pbox中的第二计时器提供的时间的情况下,将所述Pbox中的所述第二计时器提供的当前时间更新为所述第二同步时间,并控制所述第二计时器从所述第二同步时间继续计时,其中,所述第二同步时间等于将所述第一同步时间与第一时间差值进行相加所得到的时间,所述第一时间差值是将所述第二计时器提供的当前时间减去第一时间所得到的差值,所述第一时间是所述Pbox接收到所述第一同步时间时所述第二计时器的时间。In an exemplary embodiment, the first update unit includes: a first execution module, which is used to update the current time provided by the second timer in the Pbox to the second synchronization time when the local time of the Pbox is the time provided by the second timer in the Pbox, and control the second timer to continue timing from the second synchronization time, wherein the second synchronization time is equal to the time obtained by adding the first synchronization time to the first time difference, the first time difference is the difference obtained by subtracting the first time from the current time provided by the second timer, and the first time is the time of the second timer when the Pbox receives the first synchronization time.
在一个示例性实施例中,所述装置还包括:第二更新单元,用于所述基于所述第一同步时间,将所述Pbox的本地时间更新为第二同步时间之后,基于所述第二同步时间,将车侧数据中的传感器数据被采集时的时间戳更新为与所述第二同步时间同步的时间戳,其中,所述车侧数据包括由所述Pbox采集到的车辆的所述传感器数据以及所述传感器数据被采集时的时间戳。In an exemplary embodiment, the device also includes: a second updating unit, which is used to update the local time of the Pbox to a second synchronization time based on the first synchronization time, and then, based on the second synchronization time, update the timestamp when the sensor data in the vehicle-side data is collected to a timestamp synchronized with the second synchronization time, wherein the vehicle-side data includes the sensor data of the vehicle collected by the Pbox and the timestamp when the sensor data is collected.
在一个示例性实施例中,所述装置还包括:第三更新单元,用于在所述基于所述第一同步时间,将所述Pbox的本地时间更新为第二同步时间之后,在所述域控制器接收到路侧数据的情况下,基于所述第二同步时间,将所述路侧数据中的传感器数据被采集时的时间戳更新为与所述第二同步时间同步的时间戳,其中,所述路侧数据包括车辆外部的设备采集的所述传感器数据以及所述传感器数据被采集时的时间戳。In an exemplary embodiment, the device also includes: a third updating unit, which is used to update the timestamp when the sensor data in the roadside data is collected to a timestamp synchronized with the second synchronization time based on the second synchronization time after the local time of the Pbox is updated to the second synchronization time based on the first synchronization time when the domain controller receives the roadside data, wherein the roadside data includes the sensor data collected by the device outside the vehicle and the timestamp when the sensor data is collected.
在一个示例性实施例中,所述第三更新单元,包括:第二执行模块,用于在所述Pbox通过全球导航卫星系统GNSS天线接收到世界标准时间的情况下,将所述路侧数据中的传感器数据被采集时的时间戳与第三时间差值进行相加,得到与所述第二同步时间同步的时间戳,其中,所述路侧数据中的传感器数据被采集时的时间戳是基于所述世界标准时间确定的时间戳,所述第三时间差值是将所述Pbox通过所述GNSS天线接收到所述世界标准时间时所述Pbox中的第二计时器提供的时间减去世界标准时间所得到的差值。In an exemplary embodiment, the third update unit includes: a second execution module, which is used to add the timestamp when the sensor data in the roadside data is collected to the third time difference to obtain a timestamp synchronized with the second synchronization time when the Pbox receives the world standard time through the global navigation satellite system GNSS antenna, wherein the timestamp when the sensor data in the roadside data is collected is a timestamp determined based on the world standard time, and the third time difference is the difference obtained by subtracting the world standard time from the time provided by the second timer in the Pbox when the Pbox receives the world standard time through the GNSS antenna.
在一个示例性实施例中,所述装置还包括:确定单元,用于所述基于所述第二同步时间,将所述路侧数据中的传感器数据被采集时的时间戳更新为与所述第二同步时间同步的时间戳之后,在车侧数据中的传感器数据被采集时的时间戳更新为与所述第二同步时间同步的时间戳的情况下,基于更新时间戳后的所述车侧数据和更新时间戳后的所述路侧数据,确定车辆环境数据,其中,所述车侧数据包括由所述Pbox采集到的车辆的所述传感器数据以及所述传感器数据被采集时的时间戳,所述车辆环境数据用于指示所述车辆所在的位置。In an exemplary embodiment, the device also includes: a determination unit, which is used to update the timestamp of when the sensor data in the roadside data is collected to a timestamp synchronized with the second synchronization time based on the second synchronization time, and when the timestamp of when the sensor data in the vehicle-side data is collected is updated to a timestamp synchronized with the second synchronization time, determine the vehicle environment data based on the vehicle-side data after the updated timestamp and the roadside data after the updated timestamp, wherein the vehicle-side data includes the sensor data of the vehicle collected by the Pbox and the timestamp when the sensor data is collected, and the vehicle environment data is used to indicate the location of the vehicle.
根据本发明的又一个实施例,提供了一种时间同步装置,包括:第一发送单元,用于在域控制器上电后的指定时间段内,向定位盒子Pbox发送时间获取请求,其中,所述域控制器用于对至少一个从设备进行时间同步,所述至少一个从设备包括所述Pbox;第二获取单元,用于获取所述Pbox响应于所述时间获取请求发送的网络时间,其中,所述网络时间是所述Pbox通过移动通信网络获取的时间;第二执行单元,用于基于所述网络时间,将所述域控制器的本地时间更新为第一同步时间,并控制所述域控制器中的第一计时器从所述第一同步时间继续计时,其中,所述域控制器的本地时间是所述域控制器中的第一计时器提供的时间;第二发送单元,用于向所述Pbox发送所述第一同步时间,其中,所述第一同步时间用于将所述Pbox的本地时间更新为第二同步时间,其中,所述第一同步时间与所述第二同步时间同步。According to another embodiment of the present invention, a time synchronization device is provided, comprising: a first sending unit, configured to send a time acquisition request to a positioning box Pbox within a specified time period after a domain controller is powered on, wherein the domain controller is configured to perform time synchronization on at least one slave device, and the at least one slave device includes the Pbox; a second acquisition unit, configured to acquire a network time sent by the Pbox in response to the time acquisition request, wherein the network time is the time acquired by the Pbox through a mobile communication network; a second execution unit, configured to update the local time of the domain controller to a first synchronization time based on the network time, and control a first timer in the domain controller to continue timing from the first synchronization time, wherein the local time of the domain controller is the time provided by the first timer in the domain controller; a second sending unit, configured to send the first synchronization time to the Pbox, wherein the first synchronization time is used to update the local time of the Pbox to a second synchronization time, wherein the first synchronization time is synchronized with the second synchronization time.
根据本发明的又一个实施例,还提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序,其中,所述计算机程序被设置为运行时执行上述任一项方法实施例中的步骤。According to yet another embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any one of the above method embodiments when run.
根据本发明的又一个实施例,还提供了一种电子装置,包括存储器和处理器,所述存储器中存储有计算机程序,所述处理器被设置为运行所述计算机程序以执行上述任一项方法实施例中的步骤。According to yet another embodiment of the present invention, there is provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
根据本发明的又一个实施例,还提供了一种计算机程序产品,包括计算机程序,所述计算机程序被处理器执行时实现上述任一项方法实施例中的步骤。According to yet another embodiment of the present invention, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in any one of the above method embodiments are implemented.
通过本发明,由于采用移动通信网络获取网络时间作为域控制器的本地时间的起始时间,无需依赖卫星信号,且将域控制器作为主设备对车辆系统中的其他从设备进行时间同步,可以确保来自不同传感器和设备的数据在时间上的一致性,因此,可以解决相关技术中的时间同步方法存在车辆在没有卫星信号的场景下无法进行时间同步的问题,达到单车智能的场景下不依赖卫星信号进行时间同步的效果。Through the present invention, since the mobile communication network is used to obtain the network time as the starting time of the local time of the domain controller, there is no need to rely on satellite signals, and the domain controller is used as the master device to synchronize the time of other slave devices in the vehicle system, the temporal consistency of data from different sensors and devices can be ensured. Therefore, the problem that the time synchronization method in the related art cannot synchronize the vehicle in the scenario without satellite signals can be solved, and the effect of not relying on satellite signals for time synchronization in the scenario of single-vehicle intelligence can be achieved.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1是根据本发明实施例的一种时间同步方法的硬件结构框图;FIG1 is a hardware structure block diagram of a time synchronization method according to an embodiment of the present invention;
图2是根据本发明实施例的一种时间同步方法的流程示意图;FIG2 is a schematic flow chart of a time synchronization method according to an embodiment of the present invention;
图3是根据本发明实施例的一种时间同步方法的示意图;FIG3 is a schematic diagram of a time synchronization method according to an embodiment of the present invention;
图4是根据本发明实施例的另一种时间同步方法的示意图;FIG4 is a schematic diagram of another time synchronization method according to an embodiment of the present invention;
图5是根据本发明实施例的又一种时间同步方法的示意图;FIG5 is a schematic diagram of another time synchronization method according to an embodiment of the present invention;
图6是根据本发明实施例的另一种时间同步方法的流程示意图;FIG6 is a schematic flow chart of another time synchronization method according to an embodiment of the present invention;
图7是根据本发明实施例的一种时间同步装置的结构框图;7 is a structural block diagram of a time synchronization device according to an embodiment of the present invention;
图8是根据本发明实施例的另一种时间同步装置的结构框图。FIG. 8 is a structural block diagram of another time synchronization device according to an embodiment of the present invention.
具体实施方式DETAILED DESCRIPTION
下文中将参考附图并结合实施例来详细说明本发明的实施例。Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings and in combination with the embodiments.
需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
本发明实施例中所提供的方法实施例可以在车辆中执行。图1是本发明实施例的一种时间同步方法的硬件结构框图。如图1所示,时间同步系统包括域控制器与Pbox,其中,域控制器包括第一计时器,Pbox中包括第二计时器,需要说明的是,Pbox中还包括可以接入移动通信网络的通信模块(图1中未示出)。The method embodiment provided in the embodiment of the present invention can be executed in a vehicle. FIG1 is a hardware structure block diagram of a time synchronization method in an embodiment of the present invention. As shown in FIG1 , the time synchronization system includes a domain controller and a Pbox, wherein the domain controller includes a first timer, and the Pbox includes a second timer. It should be noted that the Pbox also includes a communication module (not shown in FIG1 ) that can access a mobile communication network.
在本实施例中提供了一种运行于车辆上的时间同步方法,图2是根据本发明实施例的一种时间同步方法的流程图,如图2所示,该流程包括如下步骤:In this embodiment, a time synchronization method running on a vehicle is provided. FIG. 2 is a flow chart of a time synchronization method according to an embodiment of the present invention. As shown in FIG. 2 , the flow chart includes the following steps:
步骤S202,在域控制器上电后的指定时间段内,响应于接收到的时间获取请求,通过移动通信网络获取网络时间,并将网络时间发送给域控制器,其中,时间获取请求是域控制器发送给定位盒子Pbox的请求。Step S202, within a specified time period after the domain controller is powered on, in response to a received time acquisition request, obtain network time through a mobile communication network and send the network time to the domain controller, wherein the time acquisition request is a request sent by the domain controller to the positioning box Pbox.
本实施例中的时间同步方法可以应用到自动驾驶系统中的时间同步的场景中。在自动驾驶系统中,时间同步是指将各个传感器、控制器和执行器的时钟进行精确对齐,以确保系统内部的所有组件能够在统一的时间基准下工作。时间同步对于实现精确的数据处理和决策至关重要。The time synchronization method in this embodiment can be applied to the scenario of time synchronization in an autonomous driving system. In an autonomous driving system, time synchronization refers to the precise alignment of the clocks of various sensors, controllers, and actuators to ensure that all components within the system can operate under a unified time reference. Time synchronization is essential for achieving accurate data processing and decision-making.
在自动驾驶系统中,域控制器是一种集中式控制单元,负责管理和协调系统内各个子系统的工作。域控制器的主要功能包括:数据融合:将来自不同传感器的数据进行整合,生成一致的、准确的环境感知信息;任务分配:根据系统的需求和各个子系统的能力,合理分配任务,实现资源的最优利用;决策制定:根据环境感知信息和任务分配结果,制定合适的驾驶策略和控制指令;系统监控:实时监控系统的状态,确保各个组件正常工作,及时发现并处理异常情况。高精度定位盒子Pbox(Precision Positioning Box)是一种专为自动驾驶领域设计的高精度定位设备。它的主要作用是提供精确的位置、速度和时间信息,以支持自动驾驶车辆在各种复杂环境下的安全、稳定和高效运行。In the autonomous driving system, the domain controller is a centralized control unit responsible for managing and coordinating the work of each subsystem within the system. The main functions of the domain controller include: data fusion: integrating data from different sensors to generate consistent and accurate environmental perception information; task allocation: reasonably allocating tasks according to the system requirements and the capabilities of each subsystem to achieve optimal use of resources; decision making: formulating appropriate driving strategies and control instructions based on environmental perception information and task allocation results; system monitoring: real-time monitoring of the system status to ensure that each component is working properly and to detect and handle abnormal situations in a timely manner. The high-precision positioning box Pbox (Precision Positioning Box) is a high-precision positioning device designed specifically for the field of autonomous driving. Its main function is to provide accurate position, speed and time information to support the safe, stable and efficient operation of autonomous driving vehicles in various complex environments.
目前,相关技术中的时间同步方法是通过Pbox给出的PPS信号(IO)和GPRMC数据(UART),域控接收后进行解析、同步;在地库等没有卫星信号的场景下,也就没有PPS输出,无法完成给域控授时。At present, the time synchronization method in related technologies is to use the PPS signal (IO) and GPRMC data (UART) given by the Pbox, which are received by the domain controller for analysis and synchronization. In scenarios where there is no satellite signal, such as in underground garages, there is no PPS output, and it is impossible to provide time synchronization to the domain controller.
为了至少部分解决上述问题,在本实施例中,Pbox通过移动通信网络获取网络时间,并将网络时间发送给域控制器,域控制器可以将获取到的网络世界作为本地时间的起始时间,基于起始时间继续计时,并定期对包括Pbox在内的从设备进行时间同步,实现在没有卫星信号灯场景下也可以进行授时,解决自动驾驶车辆在地库等没有卫星启动时无法获取时间的问题。In order to at least partially solve the above problems, in this embodiment, the Pbox obtains network time through the mobile communication network and sends the network time to the domain controller. The domain controller can use the obtained network world as the starting time of the local time, continue timing based on the starting time, and regularly synchronize the time of slave devices including the Pbox, so as to achieve time synchronization even in the absence of satellite signal lights, thereby solving the problem that the autonomous driving vehicle cannot obtain time when there is no satellite started in the basement.
在本实施例中,对于Pbox,在域控制器上电后的指定时间段内,可以响应于接收到的时间获取请求,通过移动通信网络获取网络时间,并将网络时间发送给域控制器,其中,时间获取请求是域控制器发送给Pbox的请求。In this embodiment, for Pbox, within a specified time period after the domain controller is powered on, it can respond to a received time acquisition request, obtain network time through the mobile communication network, and send the network time to the domain controller, wherein the time acquisition request is a request sent by the domain controller to Pbox.
例如,在本实施例中,域控上电之初5秒(该时间可以根据实际情况合理设置)内,通过CAN、以太网或者其他方式,从Pbox中获取时间初值,作为域控本地时钟的起始时钟。For example, in this embodiment, within 5 seconds (this time can be reasonably set according to actual conditions) after the domain controller is powered on, the initial time value is obtained from the Pbox through CAN, Ethernet or other means as the starting clock of the domain controller's local clock.
Pbox内部可以配备4G/5G模组,通过SIM卡或ESIM访问网络,并能获取网络时间(网络时间精度不高,但可以作为起始时间)。The Pbox can be equipped with a 4G/5G module, access the network through a SIM card or ESIM, and obtain network time (the network time is not very accurate, but can be used as the starting time).
这里配备4G/5G模组,获取网络时间,是为了在开机时能输出一个比较接近真实时刻的时间。一方面应对地库等无卫星信号的场景,使域控有起始时间;另一方面是为用户/使用者提供一个连贯的使用时间,如果没有这一项设计,用户在地库等无卫星信号的场景启动看到的时间可能是一个固定的时间(比如1970年1月1日),等开到路面后,有卫星信号了,时间再跳到当前时间。The 4G/5G module is equipped here to obtain the network time so that a time that is closer to the real time can be output when the machine is turned on. On the one hand, it can cope with scenes without satellite signals such as basements, so that the domain controller has a start time; on the other hand, it provides users with a consistent usage time. Without this design, the time that users see when starting up in scenes without satellite signals such as basements may be a fixed time (such as January 1, 1970). When the machine is on the road and there is a satellite signal, the time will jump to the current time.
步骤S204,获取域控制器发送的第一同步时间,其中,域控制器用于对至少一个从设备进行时间同步,至少一个从设备包括Pbox,第一同步时间是以网络时间作为起始时间对域控制器的本地时间进行更新所得到的时间,域控制器的本地时间是域控制器中的第一计时器提供的时间;Step S204, obtaining a first synchronization time sent by the domain controller, wherein the domain controller is used to synchronize time for at least one slave device, the at least one slave device includes a Pbox, the first synchronization time is a time obtained by updating the local time of the domain controller using the network time as the start time, and the local time of the domain controller is a time provided by a first timer in the domain controller;
在本实施例中,域控作为时间同步域的主设备master;其他所有传感器,包括Pbox,都作为同步域的从设备slave;域控给slave设备进行授时,同步方式包括PTP、gPTP、CAN TSN,根据slave支持的同步模式进行合理配置。In this embodiment, the domain controller serves as the master device of the time synchronization domain; all other sensors, including Pbox, serve as slave devices of the synchronization domain; the domain controller provides time synchronization to the slave devices, and the synchronization modes include PTP, gPTP, and CAN TSN, which are reasonably configured according to the synchronization mode supported by the slave.
可选的,在本实施例中,时间同步域(Time Synchronization Domain)是指在多个传感器和系统组件之间实现精确的时间同步。时间同步域的主要目标是确保所有传感器、控制器和执行器在同一时间基准下工作,以便于数据的一致性和决策的准确性。Optionally, in this embodiment, the time synchronization domain refers to achieving accurate time synchronization between multiple sensors and system components. The main goal of the time synchronization domain is to ensure that all sensors, controllers, and actuators work under the same time reference to facilitate data consistency and decision accuracy.
这里,PTP(Precision Time Protocol)、gPTP(Generalized Precision TimeProtocol)和CAN TSN(ControllerAreaNetwork Time-Sensitive Networking)是三种不同的时间同步协议,它们在工业自动化、通信网络和物联网等领域有着广泛的应用。具体地:Here, PTP (Precision Time Protocol), gPTP (Generalized Precision Time Protocol) and CAN TSN (Controller Area Network Time-Sensitive Networking) are three different time synchronization protocols, which are widely used in industrial automation, communication networks and the Internet of Things. Specifically:
PTP(Precision Time Protocol):精确时间协议,主要用于计算机网络中的时间同步。PTP是一种网络协议,通过在网络设备之间交换时间信息,实现高精度的时间同步。PTP有两种版本:PTPv1和PTPv2。PTPv1主要关注于局域网(LAN)中的时间同步,而PTPv2则在PTPv1的基础上进行了扩展,支持更广泛的应用场景,包括广域网(WAN)和分布式系统。PTP (Precision Time Protocol): Precision Time Protocol, mainly used for time synchronization in computer networks. PTP is a network protocol that achieves high-precision time synchronization by exchanging time information between network devices. There are two versions of PTP: PTPv1 and PTPv2. PTPv1 focuses on time synchronization in local area networks (LANs), while PTPv2 expands on PTPv1 to support a wider range of application scenarios, including wide area networks (WANs) and distributed systems.
gPTP(GeneralizedPrecision Time Protocol):通用精确时间协议,是PTP的一种扩展。gPTP在PTP的基础上进行了改进,以满足更广泛的应用需求。gPTP支持多种网络拓扑结构,包括环形、树形、网状等,同时提供了更好的时间同步精度和灵活性。gPTP (Generalized Precision Time Protocol): Generalized Precision Time Protocol is an extension of PTP. gPTP is an improvement on PTP to meet a wider range of application requirements. gPTP supports a variety of network topologies, including ring, tree, mesh, etc., while providing better time synchronization accuracy and flexibility.
CAN TSN(ControllerAreaNetwork Time-Sensitive Networking):控制器局域网时间敏感网络,是一种基于CAN(ControllerArea Network)协议的网络通信技术。CAN TSN在传统CAN协议的基础上,增加了时间同步功能,以满足实时性和确定性通信的需求。CANTSN主要用于汽车、工业自动化等领域,可以实现高速、低延迟的数据传输和时间同步。CAN TSN (Controller Area Network Time-Sensitive Networking): Controller Area Network Time-Sensitive Networking is a network communication technology based on the CAN (Controller Area Network) protocol. CAN TSN adds time synchronization function on the basis of the traditional CAN protocol to meet the needs of real-time and deterministic communication. CAN TSN is mainly used in the fields of automobiles, industrial automation, etc., and can achieve high-speed, low-latency data transmission and time synchronization.
域控制器的本地时间是域控制器中的第一计时器timer提供的时间,在从Pbox获取到网络时间之后,第一计时器以网络时间作为起始时间继续计时。The local time of the domain controller is the time provided by the first timer in the domain controller. After obtaining the network time from the Pbox, the first timer continues to time with the network time as the starting time.
步骤S206,基于第一同步时间,将Pbox的本地时间更新为第二同步时间,其中,第一同步时间与第二同步时间同步。Step S206: based on the first synchronization time, update the local time of the Pbox to the second synchronization time, wherein the first synchronization time is synchronized with the second synchronization time.
对于Pbox,Pbox作为整个时间同步域的slave设备,接受域控master的时间同步;Pbox被同步后,得到Pbox中的第二计时器timer作为整个Pbox数据的时间基准。For Pbox, Pbox acts as the slave device of the entire time synchronization domain and accepts time synchronization from the domain control master. After Pbox is synchronized, the second timer in Pbox is obtained as the time base of the entire Pbox data.
可选的,在本实施例中,可以用第二计时器timer提供的时间基准给定位惯导数据打时间戳。Optionally, in this embodiment, the time reference provided by the second timer timer can be used to time stamp the positioning inertial navigation data.
在本实施例中,IMU(惯性测量单元)可以是以P-Box(即将包括IMU在内的定位器件打包在一个盒子中)的形式独立存在,IMU是INS(惯性导航系统)中的核心硬件,定位惯导数据(Positioning and Inertial Navigation Data)可以是指由INS生成的数据,包括位置、速度、方向和其他运动参数。惯性导航系统是一种不依赖外部信号的自主导航系统,它通过传感器(如加速度计和陀螺仪)来测量和计算物体的运动状态。In this embodiment, the IMU (Inertial Measurement Unit) can exist independently in the form of a P-Box (i.e., the positioning devices including the IMU are packaged in a box). The IMU is the core hardware in the INS (Inertial Navigation System). The Positioning and Inertial Navigation Data (Positioning and Inertial Navigation Data) can refer to the data generated by the INS, including position, speed, direction and other motion parameters. The inertial navigation system is an autonomous navigation system that does not rely on external signals. It measures and calculates the motion state of an object through sensors (such as accelerometers and gyroscopes).
基于域控制器发送的第一同步时间,可以将Pbox的本地时间更新为第二同步时间,即,将Pbox中的第二计时器timer的时间更新为第二同步时间,以实现域控制器的第一同步时间与Pbox的第二同步时间的同步。Based on the first synchronization time sent by the domain controller, the local time of the Pbox can be updated to the second synchronization time, that is, the time of the second timer timer in the Pbox is updated to the second synchronization time to achieve synchronization between the first synchronization time of the domain controller and the second synchronization time of the Pbox.
在Pbox中的第二计时器timer的本地时间更新为第二同步时间之后,Pbox中的第二计时器timer从第二同步时间继续计时。After the local time of the second timer timer in the Pbox is updated to the second synchronization time, the second timer timer in the Pbox continues timing from the second synchronization time.
通过上述步骤,在域控制器上电后的指定时间段内,响应于接收到的时间获取请求,通过移动通信网络获取网络时间,并将网络时间发送给域控制器,其中,时间获取请求是域控制器发送给定位盒子Pbox的请求;获取域控制器发送的第一同步时间,其中,域控制器用于对至少一个从设备进行时间同步,至少一个从设备包括Pbox,第一同步时间是以网络时间作为起始时间对域控制器的本地时间进行更新所得到的时间,域控制器的本地时间是域控制器中的第一计时器提供的时间;基于第一同步时间,将Pbox的本地时间更新为第二同步时间,其中,第一同步时间与第二同步时间同步,解决了相关技术中的时间同步方法存在车辆在没有卫星信号的场景下无法进行时间同步的问题。Through the above steps, within a specified time period after the domain controller is powered on, in response to the received time acquisition request, the network time is acquired through the mobile communication network, and the network time is sent to the domain controller, wherein the time acquisition request is a request sent by the domain controller to the positioning box Pbox; the first synchronization time sent by the domain controller is acquired, wherein the domain controller is used to synchronize the time of at least one slave device, and the at least one slave device includes a Pbox, and the first synchronization time is the time obtained by updating the local time of the domain controller with the network time as the starting time, and the local time of the domain controller is the time provided by the first timer in the domain controller; based on the first synchronization time, the local time of the Pbox is updated to the second synchronization time, wherein the first synchronization time is synchronized with the second synchronization time, which solves the problem in the time synchronization method in the related art that the vehicle cannot synchronize the time in a scenario where there is no satellite signal.
其中,上述步骤的执行主体可以为车辆上的Pbox,但不限于此。The execution subject of the above steps may be a Pbox on the vehicle, but is not limited thereto.
在一个示例性实施例中,响应于接收到的时间获取请求,通过移动通信网络获取网络时间,包括:In an exemplary embodiment, in response to a received time acquisition request, acquiring network time through a mobile communication network includes:
S11,在Pbox无法检测到卫星信号的情况下,响应于接收到的时间获取请求,通过移动通信网络获取网络时间。S11, when the Pbox cannot detect a satellite signal, in response to a received time acquisition request, acquire network time through a mobile communication network.
相关技术中,单车智能的时间同步需要依赖卫星信号,在没有卫星信号的场景下,无法基于Pbox实现对域控制器的授时,在本实施例中,可以是在Pbox无法检测到卫星信号的情况下,响应于接收到的时间获取请求,通过移动通信网络获取网络时间。In the related technology, the time synchronization of a single vehicle needs to rely on satellite signals. In the scenario where there is no satellite signal, it is impossible to synchronize the time of the domain controller based on the Pbox. In this embodiment, when the Pbox cannot detect the satellite signal, it can respond to the received time acquisition request and obtain the network time through the mobile communication network.
Pbox无法检测到卫星信号的情况可以包括但不限于以下场景:The situations where the Pbox cannot detect satellite signals may include but are not limited to the following scenarios:
隧道或地下环境:在隧道或地下停车场等封闭空间,卫星信号可能无法穿透厚厚的混凝土或山体。Tunnels or underground environments: In enclosed spaces such as tunnels or underground parking lots, satellite signals may not be able to penetrate thick concrete or mountains.
高楼大厦区域:在高楼林立的城市地区,建筑物可能阻挡或反射卫星信号,导致信号丢失或不稳定。Areas with tall buildings: In urban areas with tall buildings, buildings may block or reflect satellite signals, causing signal loss or instability.
恶劣天气条件:某些极端天气条件,如暴风雨,可能会干扰或减弱卫星信号。Severe weather conditions: Certain extreme weather conditions, such as storms, may interfere with or degrade satellite signals.
与前述实施例类似的,Pbox内部可以配置有用于实现无线通信的硬件,以连接到移动通信网络,网络时间可以是指网络运营商服务器上的时间,Pbox可以通过连接到网络,获取网络时间。Similar to the above-mentioned embodiment, the Pbox may be internally configured with hardware for realizing wireless communication so as to connect to a mobile communication network. The network time may refer to the time on the network operator's server, and the Pbox may obtain the network time by connecting to the network.
可选的,在本实施例中,在网络时间获取失败的情况下,也可以使用车载的高精度时钟(如铷钟或恒温晶振)作为时间参考,为系统内所有设备提供统一的时间基准,还可以通过手动设置来同步时间。Optionally, in this embodiment, when network time acquisition fails, a high-precision vehicle-mounted clock (such as a rubidium clock or a constant temperature crystal oscillator) can be used as a time reference to provide a unified time base for all devices in the system. Time can also be synchronized through manual settings.
在一个示例性实施例中,基于第一同步时间,将Pbox的本地时间更新为第二同步时间,包括:In an exemplary embodiment, based on the first synchronization time, updating the local time of the Pbox to the second synchronization time includes:
S21,在Pbox的本地时间是Pbox中的第二计时器提供的时间的情况下,将Pbox中的第二计时器提供的当前时间更新为第二同步时间,并控制第二计时器从第二同步时间继续计时,其中,第二同步时间等于将第一同步时间与第一时间差值进行相加所得到的时间,第一时间差值是将第二计时器提供的当前时间减去第一时间所得到的差值,第一时间是Pbox接收到第一同步时间时第二计时器的时间。S21, when the local time of the Pbox is the time provided by the second timer in the Pbox, update the current time provided by the second timer in the Pbox to the second synchronization time, and control the second timer to continue timing from the second synchronization time, wherein the second synchronization time is equal to the time obtained by adding the first synchronization time to the first time difference, the first time difference is the difference obtained by subtracting the first time from the current time provided by the second timer, and the first time is the time of the second timer when the Pbox receives the first synchronization time.
考虑到时间是动态的,为了提高时间同步的精确性,在本实施例中,Pbox接收到第一同步时间时与Pbox更新第二计时器的时间时之间可以存在差值(即,第一时间差值),为了降低该差值对时间同步精度的影响,可以对该差值进行补偿。Taking into account that time is dynamic, in order to improve the accuracy of time synchronization, in this embodiment, there may be a difference (i.e., the first time difference) between when the Pbox receives the first synchronization time and when the Pbox updates the second timer. In order to reduce the impact of the difference on the accuracy of time synchronization, the difference may be compensated.
可选的,结合图3,在本实施例中,在Pbox的本地时间是Pbox中的第二计时器提供的时间的情况下,将Pbox中的第二计时器提供的当前时间T1更新为第二同步时间T2,并控制第二计时器从第二同步时间T2继续计时,其中,第二同步时间T2等于将第一同步时间t1与第一时间差值△T进行相加所得到的时间,第一时间差值是将第二计时器提供的当前时间T1减去第一时间所得到的差值,第一时间是Pbox接收到第一同步时间t1时第二计时器的时间T0。Optionally, in combination with Figure 3, in this embodiment, when the local time of the Pbox is the time provided by the second timer in the Pbox, the current time T1 provided by the second timer in the Pbox is updated to the second synchronization time T2, and the second timer is controlled to continue timing from the second synchronization time T2, wherein the second synchronization time T2 is equal to the time obtained by adding the first synchronization time t1 and the first time difference △T, the first time difference is the difference obtained by subtracting the first time from the current time T1 provided by the second timer, and the first time is the time T0 of the second timer when the Pbox receives the first synchronization time t1.
例如,以第一同步时间t1为2024年6月23日10点30分00秒111毫秒,T0为2024年6月23日10点30分00秒107毫秒,T1为2024年6月23日10点30分00秒108毫秒为例,第二同步时间T2为2024年6月23日10点30分00秒112毫秒。For example, taking the first synchronization time t1 as 10:30:00:111 milliseconds on June 23, 2024, T0 as 10:30:00:107 milliseconds on June 23, 2024, and T1 as 10:30:00:108 milliseconds on June 23, 2024, the second synchronization time T2 is 10:30:00:112 milliseconds on June 23, 2024.
类似的,Pbox从域控制器获取到的第一同步时间t1可以是经过延时补偿得到的,即,从域控制器发出的时间与Pbox接收到的时间可以是不完全相同的时间,Pbox从域控制器获取到的第一同步时间t1可以是从域控制器发出的时间加上传输的时间得到的,即第一同步时间t1是经过延时补偿得到的。Similarly, the first synchronization time t1 obtained by Pbox from the domain controller can be obtained after delay compensation, that is, the time sent from the domain controller and the time received by Pbox may not be exactly the same time. The first synchronization time t1 obtained by Pbox from the domain controller can be obtained by adding the time sent from the domain controller to the transmission time, that is, the first synchronization time t1 is obtained after delay compensation.
通过本实施例,通过在Pbox端对获取到的时间进行延时补偿,可以提高更新后的Pbox的时间的准确性。Through this embodiment, by performing delay compensation on the acquired time at the Pbox end, the accuracy of the updated Pbox time can be improved.
在一个示例性实施例中,基于第一同步时间,将Pbox的本地时间更新为第二同步时间之后,上述方法还包括:In an exemplary embodiment, after updating the local time of the Pbox to the second synchronization time based on the first synchronization time, the method further includes:
S31,基于第二同步时间,将车侧数据中的传感器数据被采集时的时间戳更新为与第二同步时间同步的时间戳,其中,车侧数据包括由Pbox采集到的车辆的传感器数据以及传感器数据被采集时的时间戳。S31, based on the second synchronization time, updating the timestamp when the sensor data in the vehicle-side data is collected to a timestamp synchronized with the second synchronization time, wherein the vehicle-side data includes the sensor data of the vehicle collected by the Pbox and the timestamp when the sensor data is collected.
为了提高传感器数据的同步性,在基于域控制器的时间对从设备的时间进行同步之后,可以基于同步后的时间对新采集的传感器数据打时间戳,以及对时间同步之前的传感器数据的时间戳进行更新,以确保从各个传感器收集的数据在同一时间点上具有一致性,从而提高数据处理的准确性。In order to improve the synchronization of sensor data, after synchronizing the time of the slave device based on the time of the domain controller, the newly collected sensor data can be timestamped based on the synchronized time, and the timestamp of the sensor data before the time synchronization can be updated to ensure that the data collected from each sensor is consistent at the same time point, thereby improving the accuracy of data processing.
这里,车侧数据主要来源于车辆自身的传感器和系统,包括但不限于:Here, the vehicle-side data mainly comes from the vehicle's own sensors and systems, including but not limited to:
车载摄像头:提供车辆周围环境的视觉信息。On-board camera: Provides visual information of the vehicle's surroundings.
激光雷达:用于精确测量车辆周围物体的距离和速度。LiDAR: Used to accurately measure the distance and speed of objects around the vehicle.
车载信息系统:包括车辆状态、位置、速度等信息。Vehicle information system: including vehicle status, location, speed and other information.
车载导航系统:提供车辆的导航和定位数据。In-vehicle navigation system: provides navigation and positioning data for the vehicle.
车载传感器网络:收集车辆的运行状态和环境数据,如加速度、转向角度等。On-vehicle sensor network: collects vehicle operating status and environmental data, such as acceleration, steering angle, etc.
可选的,在本实施例中,将车侧数据中的传感器数据被采集时的时间戳更新为目标时间戳,其中,目标时间戳是将车侧数据中的传感器数据被采集时的时间戳加上第二时间差所得到的时间戳,第二时间差是Pbox的本地时间更新前后的时间差,即,将第二同步时间减去更新前的Pbox的本地时间。Optionally, in this embodiment, the timestamp when the sensor data in the vehicle-side data is collected is updated to the target timestamp, wherein the target timestamp is the timestamp obtained by adding the timestamp when the sensor data in the vehicle-side data is collected to the second time difference, and the second time difference is the time difference before and after the local time of the Pbox is updated, that is, the local time of the Pbox before the update is subtracted from the second synchronization time.
即,车侧数据中的传感器数据被采集时的时间戳加上第二同步时间减去更新前的Pbox的本地时间等于目标时间戳。That is, the timestamp when the sensor data in the vehicle-side data is collected plus the second synchronization time minus the local time of the Pbox before updating equals the target timestamp.
通过本实施例,通过对车侧数据的时间戳进行更新,以实现车侧的各个传感器收集的数据在同一时间点上具有一致性,从而提高数据处理的准确性。Through this embodiment, by updating the timestamp of the vehicle-side data, the data collected by various sensors on the vehicle-side can be made consistent at the same time point, thereby improving the accuracy of data processing.
在一个示例性实施例中,在基于第一同步时间,将Pbox的本地时间更新为第二同步时间之后,上述方法还包括:In an exemplary embodiment, after updating the local time of the Pbox to the second synchronization time based on the first synchronization time, the method further includes:
S41,在域控制器接收到路侧数据的情况下,基于第二同步时间,将路侧数据中的传感器数据被采集时的时间戳更新为与第二同步时间同步的时间戳,其中,路侧数据包括车辆外部的设备采集的传感器数据以及传感器数据被采集时的时间戳。S41, when the domain controller receives the roadside data, based on the second synchronization time, the timestamp when the sensor data in the roadside data is collected is updated to a timestamp synchronized with the second synchronization time, wherein the roadside data includes sensor data collected by equipment outside the vehicle and the timestamp when the sensor data is collected.
可选的,在本实施例中,路侧数据主要来源于道路基础设施的传感器和系统,包括但不限于:Optionally, in this embodiment, the roadside data mainly comes from sensors and systems of road infrastructure, including but not limited to:
路侧摄像头:监控道路状态,包括交通流量、车辆行为等。Roadside cameras: monitor road conditions, including traffic flow, vehicle behavior, etc.
路侧激光雷达:提供更宽广区域的精确距离和速度测量。Roadside LiDAR: Provides accurate distance and speed measurements over a wider area.
路侧通信单元:如RSU(Road Side Unit),负责与车辆进行信息交换。Roadside communication unit: such as RSU (Road Side Unit), responsible for exchanging information with vehicles.
交通信号控制系统:提供交通信号灯状态和时序信息。Traffic signal control system: provides traffic light status and timing information.
路侧环境监测设备:监测天气、路面状况等环境因素。Roadside environmental monitoring equipment: monitors environmental factors such as weather and road conditions.
路侧信息发布系统:向车辆提供交通信息、路况警告等。Roadside information release system: provides vehicles with traffic information, road condition warnings, etc.
路侧传感器网络:收集路侧基础设施状态和周围环境数据。Roadside sensor network: collects data on roadside infrastructure status and surrounding environment.
需要说明的是,域控制器接收到路侧数据的情况下,Pbox可以接收到卫星信号,例如,在本实施例中,结合图5,域控制器接收到路侧数据可以是在车路协同场景下,此时有V2X(Vehicle-to-Everything,车联网)数据接入。V2X数据的时间戳是与路侧的GPS(GlobalPositioning System,全球定位系统)同步的,当V2X数据进入域控后,需要将V2X数据的时间戳归一化到域控的本地时间中,才能对V2X数据进行融合处理,在域控制器接收到路侧数据的情况下,基于第二同步时间,将路侧数据中的传感器数据被采集时的时间戳更新为与第二同步时间同步的时间戳。It should be noted that when the domain controller receives roadside data, the Pbox can receive satellite signals. For example, in this embodiment, in conjunction with Figure 5, the domain controller receives roadside data in a vehicle-road collaboration scenario, and V2X (Vehicle-to-Everything) data is accessed. The timestamp of the V2X data is synchronized with the GPS (Global Positioning System) on the roadside. When the V2X data enters the domain controller, the timestamp of the V2X data needs to be normalized to the local time of the domain controller before the V2X data can be fused. When the domain controller receives roadside data, based on the second synchronization time, the timestamp of the sensor data in the roadside data when it is collected is updated to a timestamp synchronized with the second synchronization time.
通过本实施例,通过在车路协同的场景下,将接入域控制器的路侧数据的时间戳调整为与域控制器的时间基准对应的时间戳,可以提高数据融合的准确性。Through this embodiment, in the scenario of vehicle-road collaboration, by adjusting the timestamp of the roadside data connected to the domain controller to a timestamp corresponding to the time reference of the domain controller, the accuracy of data fusion can be improved.
在一个示例性实施例中,基于第二同步时间,将路侧数据中的传感器数据被采集时的时间戳更新为与第二同步时间同步的时间戳,包括:In an exemplary embodiment, based on the second synchronization time, updating the timestamp when the sensor data in the roadside data is collected to a timestamp synchronized with the second synchronization time includes:
S51,在Pbox通过全球导航卫星系统GNSS天线接收到世界标准时间的情况下,将路侧数据中的传感器数据被采集时的时间戳与第三时间差值进行相加,得到与第二同步时间同步的时间戳,其中,路侧数据中的传感器数据被采集时的时间戳是基于世界标准时间确定的时间戳,第三时间差值是将Pbox通过GNSS天线接收到世界标准时间时Pbox中的第二计时器提供的时间减去世界标准时间所得到的差值。S51, when the Pbox receives the world standard time through the global navigation satellite system GNSS antenna, the timestamp when the sensor data in the roadside data is collected is added to the third time difference to obtain a timestamp synchronized with the second synchronization time, wherein the timestamp when the sensor data in the roadside data is collected is a timestamp determined based on the world standard time, and the third time difference is the difference obtained by subtracting the world standard time from the time provided by the second timer in the Pbox when the Pbox receives the world standard time through the GNSS antenna.
可选的,在本实施例中,在Pbox通过全球导航卫星系统GNSS天线接收到世界标准时间、且第二计时器的时间大于世界标准时间的情况下,将路侧数据中的传感器数据被采集时的时间戳与第三时间差值进行相加,得到与第二同步时间同步的时间戳,其中,路侧数据中的传感器数据被采集时的时间戳是基于世界标准时间确定的时间戳,第三时间差值是将Pbox通过GNSS天线接收到世界标准时间时第二计时器提供的时间减去接收到的世界标准时间所得到的差值;Optionally, in this embodiment, when the Pbox receives the world standard time through the global navigation satellite system GNSS antenna and the time of the second timer is greater than the world standard time, the timestamp when the sensor data in the roadside data is collected is added to the third time difference to obtain a timestamp synchronized with the second synchronization time, wherein the timestamp when the sensor data in the roadside data is collected is a timestamp determined based on the world standard time, and the third time difference is the difference obtained by subtracting the received world standard time from the time provided by the second timer when the Pbox receives the world standard time through the GNSS antenna;
在Pbox通过全球导航卫星系统GNSS天线接收到世界标准时间、且第二计时器的时间小于世界标准时间的情况下,将路侧数据中的传感器数据被采集时的时间戳与第四时间差值进行相减,得到与第二同步时间同步的时间戳,其中,路侧数据中的传感器数据被采集时的时间戳是基于世界标准时间确定的时间戳,第四时间差值是将接收到的世界标准时间减去Pbox通过GNSS天线接收到世界标准时间时第二计时器提供的时间所得到的差值。When the Pbox receives the world standard time through the global navigation satellite system GNSS antenna and the time of the second timer is less than the world standard time, the timestamp when the sensor data in the roadside data is collected is subtracted from the fourth time difference to obtain a timestamp synchronized with the second synchronization time, wherein the timestamp when the sensor data in the roadside data is collected is a timestamp determined based on the world standard time, and the fourth time difference is the difference obtained by subtracting the time provided by the second timer when the Pbox receives the world standard time through the GNSS antenna from the received world standard time.
例如,在本实施例中,结合图4,Pbox可以通过GNSS天线,获取UTC(CoordinatedUniversal Time,协调世界时,也称世界标准时间)时间。定期(1秒或0.1秒都可以)计算Pbox本地计时器timer(即,第二计时器)与UTC时间之间的差值Δt(即,Pbox通过GNSS天线接收到世界标准时间时Pbox中的第二计时器提供的时间减去世界标准时间所得到的差值),将Δt通过CAN、以太网或者其他方式发送给域控。For example, in this embodiment, in conjunction with FIG4 , the Pbox can obtain UTC (Coordinated Universal Time, also known as World Standard Time) time through the GNSS antenna. The difference Δt between the Pbox local timer (i.e., the second timer) and the UTC time is calculated periodically (1 second or 0.1 second) (i.e., the difference obtained by subtracting the world standard time from the time provided by the second timer in the Pbox when the Pbox receives the world standard time through the GNSS antenna), and Δt is sent to the domain controller via CAN, Ethernet or other means.
由于路侧数据的时间戳是与UTC同步的,路侧数据与车侧数据融合计算时,需要使用统一的时间轴,在本实施例中,以车侧数据为基准,对路侧数据的时间戳进行调整。即,将路侧数据更新前的时间戳Tr1更新为Tr2,其中,Tr2=Tr1+△t。Since the timestamp of the roadside data is synchronized with UTC, a unified time axis is required when the roadside data and the vehicle-side data are fused and calculated. In this embodiment, the timestamp of the roadside data is adjusted based on the vehicle-side data. That is, the timestamp Tr1 before the roadside data is updated is updated to Tr2 , where Tr2 = Tr1 + △t.
用Pbox发送给域控的Δt,对V2X数据的时间戳进行归一化补偿。因为域控在对Pbox进行时间同步时,可以认为域控的timer与Pbox的timer是同步的,Δt是Pbox的timer与UTC时间的差值,可以认为Δt也是域控的timer与UTC时间的差值,排除V2X数据的传输延时,进一步可以认为Δt也是域控的timer与V2X数据的时间戳的偏差。The Δt sent by Pbox to the domain controller is used to normalize and compensate the timestamp of V2X data. Because when the domain controller synchronizes the Pbox, it can be considered that the domain controller's timer is synchronized with the Pbox's timer, and Δt is the difference between the Pbox's timer and the UTC time. It can be considered that Δt is also the difference between the domain controller's timer and the UTC time. Excluding the transmission delay of V2X data, it can be further considered that Δt is also the deviation between the domain controller's timer and the timestamp of V2X data.
例如,若UTC时间是2024-5-2810点30分00秒111毫秒;域控时间是2024-5-28,10点30分00秒000毫秒,Pbox时间=域控时间;Pbox根据自身时间和UTC时间,计算得到Δt=111毫秒;Pbox定位惯导数据时间戳是2024-5-28,10点30分00秒000毫秒,车侧传感器时间戳是2024-5-28,10点30分00秒000毫秒;V2X数据时间戳与UTC同步,是2024-5-28,10点30分00秒111毫秒;V2X数据进入域控,做归一化转换,减Δt,得到2024-5-28,10点30分00秒000毫秒做数据融合。For example, if the UTC time is 2024-5-28 10:30:00:111 milliseconds; the domain control time is 2024-5-28, 10:30:00:000 milliseconds, the Pbox time = domain control time; Pbox calculates Δt = 111 milliseconds based on its own time and UTC time; the Pbox positioning inertial navigation data timestamp is 2024-5-28, 10:30:00:000 milliseconds, and the vehicle-side sensor timestamp is 2024-5-28, 10:30:00:000 milliseconds; the V2X data timestamp is synchronized with UTC, which is 2024-5-28, 10:30:00:111 milliseconds; the V2X data enters the domain control, is normalized, and Δt is subtracted to get 2024-5-28, 10:30:00:000 milliseconds for data fusion.
在一个示例性实施例中,基于第二同步时间,将路侧数据中的传感器数据被采集时的时间戳更新为与第二同步时间同步的时间戳之后,上述方法还包括:In an exemplary embodiment, after updating the timestamp of when the sensor data in the roadside data is collected to a timestamp synchronized with the second synchronization time based on the second synchronization time, the method further includes:
S61,在车侧数据中的传感器数据被采集时的时间戳更新为与第二同步时间同步的时间戳的情况下,基于更新时间戳后的车侧数据和更新时间戳后的路侧数据,确定车辆环境数据,其中,车侧数据包括由Pbox采集到的车辆的传感器数据以及传感器数据被采集时的时间戳,车辆环境数据用于指示车辆所在的位置。S61, when the timestamp when the sensor data in the vehicle-side data is collected is updated to a timestamp synchronized with the second synchronization time, the vehicle environment data is determined based on the vehicle-side data after the updated timestamp and the road-side data after the updated timestamp, wherein the vehicle-side data includes the sensor data of the vehicle collected by the Pbox and the timestamp when the sensor data is collected, and the vehicle environment data is used to indicate the location of the vehicle.
可选的,在本实施例中,在车路协同的场景下,基于更新时间戳后的车侧数据和更新时间戳后的路侧数据,确定车辆环境数据,指的是将车辆自身搭载的传感器(如Pbox、车载摄像头、激光雷达、毫米波雷达等)收集到的数据与路侧基础设施(如路侧摄像头、传感器、通信单元等)收集到的数据结合起来,形成一个全面、综合的交通环境感知。Optionally, in this embodiment, in the scenario of vehicle-road collaboration, the vehicle environment data is determined based on the vehicle-side data after the update timestamp and the road-side data after the update timestamp, which means combining the data collected by the vehicle's own sensors (such as Pbox, on-board cameras, lidar, millimeter-wave radar, etc.) with the data collected by the roadside infrastructure (such as roadside cameras, sensors, communication units, etc.) to form a comprehensive and integrated traffic environment perception.
例如,在本实施例中,车辆所在的位置包括与其他道路元素的相对位置,基于更新时间戳后的车侧数据(例如,自车的位置数据)和更新时间戳后的路侧数据(例如,其他车以及行人的位置数据),可以确定同一时间基准上自车与其他车辆或者行人的相对位置。For example, in this embodiment, the position of the vehicle includes its relative position with other road elements. Based on the vehicle-side data after updating the timestamp (for example, the position data of the vehicle itself) and the road-side data after updating the timestamp (for example, the position data of other vehicles and pedestrians), the relative position of the vehicle itself and other vehicles or pedestrians on the same time base can be determined.
通过本实施例,通过将车侧数据和路侧数据进行融合可以提高对交通状况的感知能力,增强智能交通系统的性能,有助于实现车辆与车辆、车辆与基础设施、车辆与行人等之间的有效通信。Through this embodiment, by fusing vehicle-side data and road-side data, the ability to perceive traffic conditions can be improved, the performance of the intelligent transportation system can be enhanced, and effective communication between vehicles, vehicles and infrastructure, vehicles and pedestrians, etc. can be achieved.
在本实施例中提供了一种运行于车辆上的时间同步方法,图6是根据本发明实施例的一种时间同步方法的流程图,如图6所示,该流程包括如下步骤:In this embodiment, a time synchronization method running on a vehicle is provided. FIG. 6 is a flow chart of a time synchronization method according to an embodiment of the present invention. As shown in FIG. 6 , the flow chart includes the following steps:
步骤S602,在域控制器上电后的指定时间段内,向定位盒子Pbox发送时间获取请求,其中,域控制器用于对至少一个从设备进行时间同步,至少一个从设备包括Pbox;Step S602, within a specified time period after the domain controller is powered on, a time acquisition request is sent to the positioning box Pbox, wherein the domain controller is used to synchronize the time of at least one slave device, and the at least one slave device includes the Pbox;
步骤S604,获取Pbox响应于时间获取请求发送的网络时间,其中,网络时间是Pbox通过移动通信网络获取的时间;Step S604, obtaining the network time sent by the Pbox in response to the time acquisition request, wherein the network time is the time obtained by the Pbox through the mobile communication network;
步骤S606,基于网络时间,将域控制器的本地时间更新为第一同步时间,并控制域控制器中的第一计时器从第一同步时间继续计时,其中,域控制器的本地时间是域控制器中的第一计时器提供的时间;Step S606: based on the network time, update the local time of the domain controller to the first synchronization time, and control the first timer in the domain controller to continue timing from the first synchronization time, wherein the local time of the domain controller is the time provided by the first timer in the domain controller;
步骤S608,向Pbox发送第一同步时间,其中,第一同步时间用于将Pbox的本地时间更新为第二同步时间,其中,第一同步时间与第二同步时间同步。Step S608: Send a first synchronization time to the Pbox, wherein the first synchronization time is used to update the local time of the Pbox to a second synchronization time, wherein the first synchronization time is synchronized with the second synchronization time.
对于域控制器,在上电之初的指定时间段内,可以向Pbox发送时间获取请求,与前述实施例类似的,时间获取请求用于从Pbox获取网络时间作为域控制器的本地时间的起始时间,域控制器用于对至少一个从设备进行时间同步,至少一个从设备包括Pbox。For the domain controller, a time acquisition request can be sent to the Pbox within a specified time period at the beginning of power-on. Similar to the aforementioned embodiment, the time acquisition request is used to obtain the network time from the Pbox as the starting time of the local time of the domain controller. The domain controller is used to synchronize the time of at least one slave device, and the at least one slave device includes the Pbox.
在网络信号良好的情况下,域控制器可以获取Pbox响应于时间获取请求发送的网络时间,其中,网络时间是Pbox通过移动通信网络获取的时间。When the network signal is good, the domain controller can obtain the network time sent by the Pbox in response to the time acquisition request, wherein the network time is the time obtained by the Pbox through the mobile communication network.
域控制器可以基于获取到的网络时间,将域控制器的本地时间更新为第一同步时间,并控制域控制器中的第一计时器从第一同步时间继续计时,其中,域控制器的本地时间是域控制器中的第一计时器提供的时间。The domain controller can update the local time of the domain controller to the first synchronization time based on the acquired network time, and control the first timer in the domain controller to continue timing from the first synchronization time, wherein the local time of the domain controller is the time provided by the first timer in the domain controller.
域控制器定时向Pbox发送第一同步时间,其中,第一同步时间用于将Pbox的本地时间更新为第二同步时间,其中,第一同步时间与第二同步时间同步。The domain controller periodically sends a first synchronization time to the Pbox, wherein the first synchronization time is used to update the local time of the Pbox to a second synchronization time, wherein the first synchronization time is synchronized with the second synchronization time.
可选的,Pbox的本地时间可以是Pbox中的第二计时器提供的时间。Optionally, the local time of the Pbox may be the time provided by a second timer in the Pbox.
通过本实施例,可以解决Pbox冷启动无法授时的问题;解决自动驾驶车辆在地库启动时无法获取时间的问题;域控制器作为时间同步系统的master设备,可靠,稳定,不跳变;并且,授时系统无PPS信号线,可以避免干扰和跳变,大大提高自动驾驶系统时间同步的稳定性。Through this embodiment, the problem that the Pbox cannot synchronize time during cold start can be solved; the problem that the autonomous driving vehicle cannot obtain time when starting in the basement can be solved; the domain controller, as the master device of the time synchronization system, is reliable, stable, and does not jump; and the timing system has no PPS signal line, which can avoid interference and jumps, greatly improving the stability of the time synchronization of the autonomous driving system.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本发明各个实施例的方法。Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods of various embodiments of the present invention.
在本实施例中还提供了一种时间同步装置,该装置用于实现上述实施例及优选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。In this embodiment, a time synchronization device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and/or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
图7是根据本发明实施例的时间同步装置的结构框图,如图7所示,该装置包括:FIG. 7 is a structural block diagram of a time synchronization device according to an embodiment of the present invention. As shown in FIG. 7 , the device includes:
第一执行单元702,用于在域控制器上电后的指定时间段内,响应于接收到的时间获取请求,通过移动通信网络获取网络时间,并将网络时间发送给域控制器,其中,时间获取请求是域控制器发送给定位盒子Pbox的请求;The first execution unit 702 is used to obtain network time through the mobile communication network in response to a received time acquisition request within a specified time period after the domain controller is powered on, and send the network time to the domain controller, wherein the time acquisition request is a request sent by the domain controller to the positioning box Pbox;
第一获取单元704,用于获取域控制器发送的第一同步时间,其中,域控制器用于对至少一个从设备进行时间同步,至少一个从设备包括Pbox,第一同步时间是以网络时间作为起始时间对域控制器的本地时间进行更新所得到的时间,域控制器的本地时间是域控制器中的第一计时器提供的时间;A first acquisition unit 704 is configured to acquire a first synchronization time sent by a domain controller, wherein the domain controller is configured to perform time synchronization on at least one slave device, wherein the at least one slave device includes a Pbox, and the first synchronization time is a time obtained by updating a local time of the domain controller using the network time as a start time, and the local time of the domain controller is a time provided by a first timer in the domain controller;
第一更新单元706,用于基于第一同步时间,将Pbox的本地时间更新为第二同步时间,其中,第一同步时间与第二同步时间同步。The first updating unit 706 is used to update the local time of the Pbox to the second synchronization time based on the first synchronization time, wherein the first synchronization time is synchronized with the second synchronization time.
需要说明的是,该实施例中的第一执行单元702可以用于执行上述步骤S202,该实施例中的第一获取单元704可以用于执行上述步骤S204,该实施例中的第一更新单元706可以用于执行上述步骤S206。It should be noted that the first execution unit 702 in this embodiment can be used to execute the above step S202, the first acquisition unit 704 in this embodiment can be used to execute the above step S204, and the first update unit 706 in this embodiment can be used to execute the above step S206.
通过本发明实施例,在域控制器上电后的指定时间段内,响应于接收到的时间获取请求,通过移动通信网络获取网络时间,并将网络时间发送给域控制器,其中,时间获取请求是域控制器发送给定位盒子Pbox的请求;获取域控制器发送的第一同步时间,其中,域控制器用于对至少一个从设备进行时间同步,至少一个从设备包括Pbox,第一同步时间是以网络时间作为起始时间对域控制器的本地时间进行更新所得到的时间,域控制器的本地时间是域控制器中的第一计时器提供的时间;基于第一同步时间,将Pbox的本地时间更新为第二同步时间,其中,第一同步时间与第二同步时间同步。解决了相关技术中的时间同步方法存在车辆在没有卫星信号的场景下无法进行时间同步的问题。Through the embodiment of the present invention, within a specified time period after the domain controller is powered on, in response to the received time acquisition request, the network time is acquired through the mobile communication network, and the network time is sent to the domain controller, wherein the time acquisition request is a request sent by the domain controller to the positioning box Pbox; the first synchronization time sent by the domain controller is acquired, wherein the domain controller is used to synchronize the time of at least one slave device, and the at least one slave device includes Pbox, and the first synchronization time is the time obtained by updating the local time of the domain controller with the network time as the starting time, and the local time of the domain controller is the time provided by the first timer in the domain controller; based on the first synchronization time, the local time of the Pbox is updated to the second synchronization time, wherein the first synchronization time is synchronized with the second synchronization time. The problem that the time synchronization method in the related art cannot synchronize the time of the vehicle in the scenario without satellite signals is solved.
在一个示例性实施例中,第一执行单元,包括:In an exemplary embodiment, the first execution unit includes:
获取模块,用于在Pbox无法检测到卫星信号的情况下,响应于接收到的时间获取请求,通过移动通信网络获取网络时间。The acquisition module is used to acquire the network time through the mobile communication network in response to a received time acquisition request when the Pbox cannot detect a satellite signal.
在一个示例性实施例中,第一更新单元,包括:In an exemplary embodiment, the first updating unit includes:
第一执行模块,用于在Pbox的本地时间是Pbox中的第二计时器提供的时间的情况下,将Pbox中的第二计时器提供的当前时间更新为第二同步时间,并控制第二计时器从第二同步时间继续计时,其中,第二同步时间等于将第一同步时间与第一时间差值进行相加所得到的时间,第一时间差值是将第二计时器提供的当前时间减去第一时间所得到的差值,第一时间是Pbox接收到第一同步时间时第二计时器的时间。The first execution module is used to update the current time provided by the second timer in the Pbox to the second synchronization time when the local time of the Pbox is the time provided by the second timer in the Pbox, and control the second timer to continue timing from the second synchronization time, wherein the second synchronization time is equal to the time obtained by adding the first synchronization time to the first time difference, the first time difference is the difference obtained by subtracting the first time from the current time provided by the second timer, and the first time is the time of the second timer when the Pbox receives the first synchronization time.
在一个示例性实施例中,上述装置还包括:In an exemplary embodiment, the above device further comprises:
第二更新单元,用于基于第一同步时间,将Pbox的本地时间更新为第二同步时间之后,基于第二同步时间,将车侧数据中的传感器数据被采集时的时间戳更新为与第二同步时间同步的时间戳,其中,车侧数据包括由Pbox采集到的车辆的传感器数据以及传感器数据被采集时的时间戳。The second updating unit is used to update the local time of the Pbox to the second synchronization time based on the first synchronization time, and then update the timestamp when the sensor data in the vehicle-side data is collected to a timestamp synchronized with the second synchronization time based on the second synchronization time, wherein the vehicle-side data includes the sensor data of the vehicle collected by the Pbox and the timestamp when the sensor data is collected.
在一个示例性实施例中,上述装置还包括:In an exemplary embodiment, the above device further comprises:
第三更新单元,用于在基于第一同步时间,将Pbox的本地时间更新为第二同步时间之后,在域控制器接收到路侧数据的情况下,基于第二同步时间,将路侧数据中的传感器数据被采集时的时间戳更新为与第二同步时间同步的时间戳,其中,路侧数据包括车辆外部的设备采集的传感器数据以及传感器数据被采集时的时间戳。The third updating unit is used for updating the local time of the Pbox to the second synchronization time based on the first synchronization time, and then, when the domain controller receives the roadside data, updating the timestamp when the sensor data in the roadside data is collected to a timestamp synchronized with the second synchronization time based on the second synchronization time, wherein the roadside data includes sensor data collected by equipment outside the vehicle and the timestamp when the sensor data is collected.
在一个示例性实施例中,第三更新单元,包括:In an exemplary embodiment, the third updating unit includes:
第二执行模块,用于在Pbox通过全球导航卫星系统GNSS天线接收到世界标准时间的情况下,将路侧数据中的传感器数据被采集时的时间戳与第三时间差值进行相加,得到与第二同步时间同步的时间戳,其中,路侧数据中的传感器数据被采集时的时间戳是基于世界标准时间确定的时间戳,第三时间差值是将Pbox通过GNSS天线接收到世界标准时间时Pbox中的第二计时器提供的时间减去世界标准时间所得到的差值。The second execution module is used for adding the timestamp when the sensor data in the roadside data is collected to the third time difference to obtain a timestamp synchronized with the second synchronization time when the Pbox receives the world standard time through the global navigation satellite system GNSS antenna, wherein the timestamp when the sensor data in the roadside data is collected is a timestamp determined based on the world standard time, and the third time difference is the difference obtained by subtracting the world standard time from the time provided by the second timer in the Pbox when the Pbox receives the world standard time through the GNSS antenna.
在一个示例性实施例中,上述装置还包括:In an exemplary embodiment, the above device further comprises:
确定单元,用于基于第二同步时间,将路侧数据中的传感器数据被采集时的时间戳更新为与第二同步时间同步的时间戳之后,在车侧数据中的传感器数据被采集时的时间戳更新为与第二同步时间同步的时间戳的情况下,基于更新时间戳后的车侧数据和更新时间戳后的路侧数据,确定车辆环境数据,其中,车侧数据包括由Pbox采集到的车辆的传感器数据以及传感器数据被采集时的时间戳,车辆环境数据用于指示车辆所在的位置。A determination unit is used to update the timestamp when the sensor data in the roadside data is collected to a timestamp synchronized with the second synchronization time based on the second synchronization time, and determine the vehicle environment data based on the vehicle-side data after the updated timestamp and the roadside data after the updated timestamp, after the timestamp when the sensor data in the vehicle-side data is collected is updated to a timestamp synchronized with the second synchronization time, wherein the vehicle-side data includes the sensor data of the vehicle collected by the Pbox and the timestamp when the sensor data is collected, and the vehicle environment data is used to indicate the location of the vehicle.
图8是根据本发明实施例的时间同步装置的结构框图,如图8所示,该装置包括:FIG8 is a structural block diagram of a time synchronization device according to an embodiment of the present invention. As shown in FIG8 , the device includes:
第一发送单元802,用于在域控制器上电后的指定时间段内,向定位盒子Pbox发送时间获取请求,其中,域控制器用于对至少一个从设备进行时间同步,至少一个从设备包括Pbox;A first sending unit 802 is used to send a time acquisition request to the positioning box Pbox within a specified time period after the domain controller is powered on, wherein the domain controller is used to perform time synchronization on at least one slave device, and the at least one slave device includes the Pbox;
第二获取单元804,用于获取Pbox响应于时间获取请求发送的网络时间,其中,网络时间是Pbox通过移动通信网络获取的时间;A second acquisition unit 804 is used to acquire the network time sent by the Pbox in response to the time acquisition request, wherein the network time is the time acquired by the Pbox through the mobile communication network;
第二执行单元806,用于基于网络时间,将域控制器的本地时间更新为第一同步时间,并控制域控制器中的第一计时器从第一同步时间继续计时,其中,域控制器的本地时间是域控制器中的第一计时器提供的时间;The second execution unit 806 is used to update the local time of the domain controller to the first synchronization time based on the network time, and control the first timer in the domain controller to continue timing from the first synchronization time, wherein the local time of the domain controller is the time provided by the first timer in the domain controller;
第二发送单元808,用于向Pbox发送第一同步时间,其中,第一同步时间用于将Pbox的本地时间更新为第二同步时间,其中,第一同步时间与第二同步时间同步。The second sending unit 808 is used to send a first synchronization time to the Pbox, wherein the first synchronization time is used to update the local time of the Pbox to a second synchronization time, wherein the first synchronization time is synchronized with the second synchronization time.
需要说明的是,该实施例中的第一发送单元802可以用于执行上述步骤S602,该实施例中的第二获取单元804可以用于执行上述步骤S604,该实施例中的第二执行单元806可以用于执行上述步骤S606;该实施例中的第二发送单元808可以用于执行上述步骤S608。It should be noted that the first sending unit 802 in this embodiment can be used to execute the above step S602, the second acquisition unit 804 in this embodiment can be used to execute the above step S604, the second execution unit 806 in this embodiment can be used to execute the above step S606; the second sending unit 808 in this embodiment can be used to execute the above step S608.
本发明的实施例还提供了一种计算机可读存储介质,该计算机可读存储介质中存储有计算机程序,其中,该计算机程序被设置为运行时执行上述任一项方法实施例中的步骤。An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
在一个示例性实施例中,上述计算机可读存储介质可以包括但不限于:U盘、只读存储器(Read-Only Memory,简称为ROM)、随机存取存储器(RandomAccess Memory,简称为RAM)、移动硬盘、磁碟或者光盘等各种可以存储计算机程序的介质。In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
本发明的实施例还提供了一种电子装置,包括存储器和处理器,该存储器中存储有计算机程序,该处理器被设置为运行计算机程序以执行上述任一项方法实施例中的步骤。An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
在一个示例性实施例中,上述电子装置还可以包括传输设备以及输入输出设备,其中,该传输设备和上述处理器连接,该输入输出设备和上述处理器连接。In an exemplary embodiment, the electronic device may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
本实施例中的具体示例可以参考上述实施例及示例性实施方式中所描述的示例,本实施例在此不再赘述。For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
本发明的实施例还提供了一种计算机程序产品,上述计算机程序产品包括计算机程序,计算机程序被处理器执行时实现上述任一项方法实施例中的步骤。An embodiment of the present invention further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any one of the above method embodiments are implemented.
本发明的实施例还提供了另一种计算机程序产品,包括非易失性计算机可读存储介质,非易失性计算机可读存储介质存储计算机程序,计算机程序被处理器执行时实现上述任一项方法实施例中的步骤。An embodiment of the present invention further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.
本发明的实施例还提供了一种计算机程序,该计算机程序包括计算机指令,该计算机指令存储在计算机可读存储介质中;计算机设备的处理器从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得该计算机设备执行上述任一项方法实施例中的步骤。An embodiment of the present invention also provides a computer program, which includes computer instructions stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps in any one of the above-mentioned method embodiments.
显然,本领域的技术人员应该明白,上述的本发明的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本发明不限制于任何特定的硬件和软件结合。Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
以上仅为本发明的优选实施例而已,并不用于限制本发明,对于本领域的技术人员来说,本发明可以有各种更改和变化。凡在本发明的原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above are only preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present invention shall be included in the protection scope of the present invention.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202410863027.7A CN118784130A (en) | 2024-06-28 | 2024-06-28 | Time synchronization method, storage medium and electronic device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202410863027.7A CN118784130A (en) | 2024-06-28 | 2024-06-28 | Time synchronization method, storage medium and electronic device |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN118784130A true CN118784130A (en) | 2024-10-15 |
Family
ID=92985452
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202410863027.7A Pending CN118784130A (en) | 2024-06-28 | 2024-06-28 | Time synchronization method, storage medium and electronic device |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN118784130A (en) |
-
2024
- 2024-06-28 CN CN202410863027.7A patent/CN118784130A/en active Pending
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US10877483B2 (en) | Formatting sensor data for use in autonomous vehicle communications platform | |
| EP3614687B1 (en) | A gps based high precision timestamp generation circuit for an autonomous driving vehicle | |
| EP3613648B1 (en) | A time source recovery system for an autonomous driving vehicle | |
| CN111860604B (en) | Data fusion method, system and computer storage medium | |
| EP4020855B1 (en) | Time synchronization method and apparatus | |
| US20200064859A1 (en) | Hardware centralized time synchronization hub for an autonomous driving vehicle | |
| CN112119365B (en) | Time synchronization method, multi-sensor system and movable platform | |
| US10969783B2 (en) | Time source ranking system for an autonomous driving vehicle | |
| US11029165B2 (en) | Sensor integration and synchronization unit for an autonomous driving vehicle | |
| JP2023502671A (en) | Method and apparatus for providing time source for automated driving | |
| CN114614934B (en) | Time synchronization triggering device and method | |
| US20250251752A1 (en) | Time Synchronization Method and Related Apparatus | |
| WO2022127337A1 (en) | Master clock device, slave clock device and time synchronization method | |
| CN111829515A (en) | Time synchronization method, device, vehicle and storage medium | |
| CN116830689A (en) | A time synchronization method, device and storage medium | |
| CN110572231A (en) | Time synchronization method, device and equipment | |
| CN118784130A (en) | Time synchronization method, storage medium and electronic device | |
| KR20150116066A (en) | Method and Apparatus for Time Synchronization of Car Black Box or Car Electronic Equipment | |
| CN112512111A (en) | Time determination method and device, and signal sending method and device | |
| CN104754734A (en) | Positioning method, device and system | |
| CN118534505B (en) | A vehicle positioning method and system based on in-vehicle T-BOX positioning | |
| CN110518999B (en) | Clock synchronization method, device, equipment and storage medium | |
| CN110138487B (en) | Time noise transfer characteristic measurement method and network node | |
| US20250028061A1 (en) | Signal processing apparatus, signal processing method and program | |
| CN116455498B (en) | Time service method, system and intelligent driving equipment |
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 |