WO2025123727A1 - 一种时间同步方法、系统、电子设备、存储介质及车辆 - Google Patents
一种时间同步方法、系统、电子设备、存储介质及车辆 Download PDFInfo
- Publication number
- WO2025123727A1 WO2025123727A1 PCT/CN2024/111079 CN2024111079W WO2025123727A1 WO 2025123727 A1 WO2025123727 A1 WO 2025123727A1 CN 2024111079 W CN2024111079 W CN 2024111079W WO 2025123727 A1 WO2025123727 A1 WO 2025123727A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- time
- module
- global
- data
- time data
- 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
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
Definitions
- the present invention relates to the field of vehicle technology, and in particular to a time synchronization method, system, electronic equipment, storage medium and vehicle.
- the object of the present invention is to provide a time synchronization method, system, electronic device, storage medium and vehicle, which can solve at least one of the technical problems mentioned above.
- the acquired time data are calibrated to generate global time data
- the global time management module is a time synchronization master node, the time modules to be synchronized are time synchronization slave nodes, and the master node and the slave nodes communicate with each other via Ethernet.
- the various time data obtained are calibrated to generate global time data, including:
- carrying the global time data to each time synchronization module specifically includes:
- the global time management module broadcasts the global time data according to the GPTP protocol, and the AutoSar CP tsync module component in each time synchronization module receives the data;
- the time areas in the CSC system module and the QNX system module are used as the slave nodes.
- parsing the defined time synchronization protocol to obtain the parsed global time data specifically includes:
- the high-precision time data includes propagation delay and correction rate.
- the system time contained in the respective time modules to be synchronized is synchronized through the parsed global time data, specifically including:
- the upper layer application periodically receives the high-precision time data, and synchronizes the CSC system module time according to the high-precision time data;
- the QNX system module synchronizes the QNX system module time by acquiring the high-precision time data through calling the AutoSar CP tsync module component.
- a global time data generation module is configured to calibrate each acquired time data based on the defined global time management module to generate global time data
- a global time data sending module configured to carry the global time data to each time synchronization module based on a defined time synchronization protocol
- a global time data parsing module configured to parse the defined time synchronization protocol and obtain the parsed global time data
- a time synchronization control module configured to synchronize the system time contained in each of the time-to-be-synchronized modules based on the respective time-to-be-synchronized modules through the parsed global time data in response to the time synchronization signal;
- the global time management module is a time synchronization master node, the time modules to be synchronized are time synchronization slave nodes, and the master node and the slave nodes communicate with each other via Ethernet.
- the present invention also provides an electronic device, comprising: a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the steps of the time synchronization method.
- the present invention also provides a vehicle, wherein the vehicle is provided with the time synchronization system as described above.
- the invention has the following beneficial effects:
- the present invention discloses a time synchronization method, system, electronic device, storage medium and vehicle, which do not require frequent cross-process communication between systems, avoid the delay of sending time data in cross-system communication between systems, improve time accuracy and reduce the risk of incorrect time display.
- FIG1 is a schematic flow chart of a time synchronization method in some specific embodiments of the present invention.
- FIG2 is a schematic diagram of the overall architecture of a time synchronization method of the present invention in some applications.
- FIG. 3 is a schematic diagram of an automatic time synchronization architecture of a CSC and QNX system in some applications of a time synchronization method of the present invention
- FIG4 is a schematic diagram of a time synchronization flow chart of a time synchronization method in some applications of the present invention.
- FIG5 is a schematic diagram of the structure of a time synchronization system in some specific embodiments of the present invention.
- FIG. 6 is a schematic diagram of the structure of an electronic device in some specific embodiments of the present invention.
- first, second, third, etc. may be used to describe in the embodiments of the present application, these descriptions should not be limited to these terms. These terms are only used to distinguish the descriptions.
- the first may also be referred to as the second, and similarly, the second may also be referred to as the first.
- the words “if” and “if” may be interpreted as “at the time of” or “when” or “in response to determining” or “in response to detecting”, depending on the context.
- the phrases “if it is determined” or “if (stated condition or event) is detected” may be interpreted as “when it is determined” or “in response to determining” or “when detecting (stated condition or event)” or “in response to detecting (stated condition or event)", depending on the context.
- a time synchronization method includes:
- S101 calibrates each acquired time data based on a defined global time management module to generate global time data
- a global time management module is predefined, and the acquisition and calibration of various time data are performed according to the module to generate global time data;
- Global Time which is the key data for subsequent time synchronization
- various acquired time data are calibrated based on a defined global time management module to generate global time data, including defining an ICC controller, the ICC controller including a global time management module; obtaining absolute time data and time calibration data from various different sources through the global time management module; calibrating absolute time data from various different sources based on the time calibration data to generate global time data;
- the time calibration data includes network UTC, GPS and built-in high-precision RTC time data;
- an ICC controller intelligent connection controller
- a global time management module is set in the ICC controller.
- the global time management module absolute time data from various sources is obtained, and the acquired absolute time data is calibrated through network UTC, GPS and built-in high-precision RTC time data to generate global time data.
- S102 carries the global time data to each time synchronization module based on a defined time synchronization protocol
- a time synchronization protocol is predefined, and the calibrated global time data is carried to each time module to be synchronized according to the protocol;
- the time management module and each time synchronization module are equipped with the AutoSar CP tsync module based on the defined time synchronization protocol to carry the global time data to each time synchronization module.
- Component based on the AutoSar CP tsync module component, the global time management module broadcasts the global time data according to the GPTP protocol, and the AutoSar CP tsync module component in each time synchronization module is received; each time synchronization module includes a CSC and a QNX system module;
- the time synchronization module includes CSC and QNX system modules, and both of them and the global time management module are equipped with AutoSar CP tsync module components for sending and receiving global time data.
- the global time management module broadcasts the global time data through the AutoSar CP tsync module component according to the GPTP protocol, and the global time data is received by the respective AutoSar CP tsync module components in the CSC and QNX system modules.
- the time areas in the CSC system module and the QNX system module are used as slave nodes of the overall architecture, and the global time management module is used as the master node of the overall architecture, and the communication between the master node and the slave node is carried out through Ethernet.
- each time-to-be-synchronized module parses the event synchronization protocol to obtain the parsed global time data
- the GPTP protocol by parsing the GPTP protocol, the GPTP protocol
- the global time data contained in the protocol includes propagation delay and correction rate.
- QNX also synchronizes the QNX system module time by calling the AutoSar CP tsync module component to obtain high-precision time data, thereby eliminating the need for frequent cross-process communication between systems, avoiding the delay in sending time data between systems in cross-system communication, improving time accuracy, and reducing the risk of incorrect time display.
- this invention will reduce the memory usage of the CSC system; and the Qnx instrument system directly obtains the clock data from the GPTP protocol, avoiding the delay of sending time data between the CSC and QNX instrument systems in cross-system communication, and improving the time accuracy of the QNX instrument system; if there is a problem on one of the CSC and QNX systems that makes it impossible to synchronize the time, it will not affect the automatic synchronization of the other system, reducing the risk of incorrect time display.
- VDC ⁇ CSC ⁇ QNX instrument time acts as an Ethernet slave, receives Global Time, and calibrates its own system time according to the correction algorithm.
- ICC acts as the master and configures the AutoSar CP tsync module component to publish high-precision synchronization time to other slave nodes in the same network segment.
- the master broadcasts and publishes high-precision time information according to the Ethernet high-precision time synchronization protocol IEEE 802.1AS (GPTP) standard.
- CSC and QNX instrument system as slave, deploy AutoSar AP tsync module Component, receives GPTP protocol broadcast messages sent by the master, and parses the messages to obtain high-precision time-related information (such as propagation delay, correction rate, etc.).
- This module is used as the time management module in the Android system and is set to start automatically at boot.
- the functions implemented include:
- the acquired high-precision time is provided to the upper-layer application in the form of AIDL; the upper-layer application can determine whether it needs high-precision time based on its own needs;
- This module receives time synchronization information every 500ms and periodically calibrates the system time based on this time. Every 500ms, the received synchronization time is compared with the Android system time. If the difference is greater than or equal to 1s, the system time is updated according to the synchronization time; this completes the synchronization of the Android system time;
- the car computer can obtain the system time for display, and ordinary applications (which do not have high-precision requirements for the clock) can obtain the system time.
- the QNX system time_service module has similar functions to the HAL service of the Android system. It needs to call the AutoSar AP tsync module API to obtain high-precision time to update the QNX system time.
- the instrument screen can directly display the QNX system time.
- the present invention further provides a time synchronization system, comprising:
- the global time data generating module 201 is configured to calibrate each acquired time data based on the defined global time management module to generate global time data;
- the global time data sending module 202 is configured to carry the global time data to each time synchronization module based on a defined time synchronization protocol;
- a global time data parsing module 203 configured for each time synchronization module to parse the defined time synchronization protocol and obtain the parsed global time data;
- the time synchronization control module 204 is configured to synchronize the system time contained in each of the modules to be synchronized based on the modules to be synchronized and through the parsed global time data in response to the time synchronization signal;
- the global time management module is a time synchronization master node, the time modules to be synchronized are time synchronization slave nodes, and the master node and the slave nodes communicate with each other via Ethernet.
- the present invention also provides an electronic device, including: a processor, a communication Interface, memory and communication bus, wherein the processor, communication interface and memory communicate with each other via the communication bus; a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the steps of the time synchronization method.
- Fig. 6 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention.
- the electronic device provided by an embodiment of the present invention includes: one or more processors 710 and a storage device 720; the processor 710 in the electronic device can be one or more, and Fig. 6 takes one processor 710 as an example; the storage device 720 is used to store one or more programs; the one or more programs are executed by the one or more processors 710, so that the one or more processors 710 implement the time synchronization method as described in any one of the embodiments of the present invention.
- the electronic device may further include: an input device 730 and an output device 740 .
- the processor 710, storage device 720, input device 730 and output device 740 in the electronic device may be connected via a bus or other means, and FIG6 takes the connection via a bus as an example.
- the storage device 720 in the electronic device is a computer-readable storage medium that can be used to store one or more programs, which can be software programs, computer executable programs, and modules, such as program instructions/modules corresponding to the time synchronization method provided in the embodiment of the present invention.
- the processor 710 executes various functional applications and data processing of the electronic device by running the software programs, instructions, and modules stored in the storage device 720, that is, the time synchronization method in the above method embodiment is implemented.
- the storage device 720 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and applications required for at least one function; the data storage area may store data created according to the use of the electronic device, etc.
- the storage device 720 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device.
- the storage device 720 may further include a memory remotely arranged relative to the processor 710, and these remote memories may be connected to the device via a network. Examples of the above-mentioned network include But not limited to the Internet, corporate intranet, local area network, mobile communication network and their combination.
- the input device 730 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the electronic device.
- the output device 740 may include a display device such as a display screen.
- the present invention also provides a computer-readable storage medium storing a computer program executable by an electronic device, and when the computer program runs on the electronic device, the electronic device executes the steps of the time synchronization method.
- the computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media.
- the computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium.
- the computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above.
- Non-exhaustive list of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
- the computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.
- the present invention also provides a vehicle, characterized in that the vehicle is provided with the time synchronization system as described above.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Synchronisation In Digital Transmission Systems (AREA)
- Electric Clocks (AREA)
Abstract
本发明公开了一种时间同步方法、系统、电子设备、存储介质及车辆,包括基于定义的全局时间管理模块,对获取的各个时间数据进行校准,生成全局时间数据;基于定义的时间同步协议,携带全局时间数据至各个时间待同步模块;对定义的时间同步协议进行解析,获取解析后的全局时间数据;响应于时间同步信号,基于各个时间待同步模块,通过解析后的全局时间数据,对各个时间待同步模块中包含的系统时间进行同步处理;全局时间管理模块为时间同步主节点,各个时间待同步模块为各个时间同步从节点,主节点和从节点之间通过以太网进行通信。通过上述方法,避免了系统之间跨系统通信发送时间数据的时延,提高了时间准确度,减小了时间显示不正确的风险。
Description
本发明涉及车辆技术领域,特别是涉及一种时间同步方法、系统、电子设备、存储介质及车辆。
当前汽车中包含很多ECU,而这些ECU的时钟计时模块独立工作。比如CSC()自身无法联网并且没有RTC电路时,只能获取到软件版本的编译时间作为它的时间源;仪表盘系统有自己的RTC芯片可以独立计时显示时间;ICC(Intelligent Connected Controller)以及VDC等其他ECU虽然不需要显示时间,但是在进行数据业务时需要准确的时间戳。在整车系统中的现有技术这些ECU是通过内置的硬件时钟分别计时,导致不同ECU系统之间的时间会有偏差。但是不同的ECU之间是需要进行通信业务的,如果彼此之间的时间戳有偏差,可能会导致业务失败或者不能达到预期效果。随着智能化技术的发展,整车需要实现时钟显示的统一。自动驾驶域、大屏上实时高精地图显示、驾驶员实时疲劳检测、实时的流媒体后视镜显示、车辆与路测RSU之间的实时信息交互,无一不需要全域架构中的精确时间同步。另外精确的时间对于网络至关重要,比如网络管理:从不同网络设备采集来的日志信息进行分析时,需要以时间作为参照依据。如果不同设备上的系统时间不一致,会因先后顺序等问题给故障定位带来障碍。计费系统:计费业务对于时间尤其敏感,要求所有设备的时间保持一直,否则会引起计费不准确,导致车主质疑,投诉等;协同处理:多个系统协同处理同一个复杂事件,为保证正确的执行顺序,多个系统必须参考同一时钟;系统时间:某些应用或服务需要准确的时间来标记用户登录、交易等操作信息,确保可追溯记录,因此有一个统一的标准时间对于网络而
言意义重大。
现有技术中智能车机通过TBOX获取GPS实时时间,将车机系统时间发送给仪表系统,比较仪表系统时间和车机系统时间的差值,如果差值大于设定的时间阈值,仪表系统时间设置为车机系统时间。此种方案,仪表系统和车机系统之间的传输时间数据跨系统通信需要一定的时间,这就导致了仪表系统在获取到车机系统时间是有延时的,如果还按照有延时的车机系统时间校准仪表时间,会影响仪表系统时间精确度。并且如果车机系统由于自身原因无法自动同步GPS时间,仪表系统也会无法自动同步系统时间。
因此,本申请提供一种时间同步方法以解决上述技术问题。
发明内容
本发明的目的在于提供一种时间同步方法、系统、电子设备、存储介质及车辆,能够解决上述提到的至少一个技术问题。
为了解决上述技术问题,本发明提供了一种时间同步方法,包括:
基于定义的全局时间管理模块,对获取的各个时间数据进行校准,生成全局时间数据;
基于定义的时间同步协议,携带所述全局时间数据至各个时间待同步模块;
对所述定义的时间同步协议进行解析,获取解析后的所述全局时间数据;
响应于时间同步信号,基于所述各个时间待同步模块,通过所述解析后的全局时间数据,对所述各个时间待同步模块中包含的系统时间进行同步处理;
其中,所述全局时间管理模块为时间同步主节点,所述各个时间待同步模块为各个时间同步从节点,所述主节点和所述从节点之间通过以太网进行通信。
在其中一些具体实施例中,基于定义的全局时间管理模块,对获
取的各个时间数据进行校准,生成全局时间数据,具体包括:
定义ICC控制器,所述ICC控制器中包括所述全局时间管理模块;
通过所述全局时间管理模块,获取各个不同来源的绝对时间数据以及时间校准数据;
基于所述时间校准数据对所述各个不同来源的绝对时间数据进行校准,生成所述全局时间数据;
其中,所述时间校准数据包括网络UTC、GPS以及内置高精度RTC时间数据。
在其中一些具体实施例中,基于定义的时间同步协议,携带所述全局时间数据至各个时间待同步模块,具体包括:
所述全局时间管理模块以及所述各个时间待同步模块均配置有AutoSar CP tsync模块组件;
基于所述AutoSar CP tsync模块组件,所述全局时间管理模块根据GPTP协议对所述全局时间数据进行广播,由所述各个时间待同步模块中的所述AutoSar CP tsync模块组件进行接收;
其中,所述各个时间待同步模块包括CSC和QNX系统模块。
在其中一些具体实施例中,所述CSC系统模块以及所述QNX系统模块均为时间同步的从节点,分别与作为主节点的全局时间管理模块通过以太网进行通信;
所述时间管理模块通过所述以太网将所述全局时间数据发送至所述CSC系统模块以及所述QNX系统模块;
其中,将所述CSC系统模块以及所述QNX系统模块中的时间区域作为所述从节点。
在其中一些具体实施例中,对所述定义的时间同步协议进行解析,获取解析后的所述全局时间数据,具体包括:
所述CSC系统模块以及所述QNX系统模块均为时间同步的从节点,分别与作为主节点的全局时间管理模块通过以太网进行通信;;
基于所述GPTP协议,解析所述全局时间数据,获取高精度时间数据;
其中,所述高精度时间数据包括传播延时以及矫正速率。
在其中一些具体实施例中,响应于时间同步信号,基于所述各个时间待同步模块,通过所述解析后的全局时间数据,对所述各个时间待同步模块中包含的系统时间进行同步处理,具体包括:
在所述CSC系统模块底层创建HAL服务,所述HAL服务用于:
调用所述AutoSar CP tsync模块组件获取所述高精度时间数据;
响应于上层应用的时间同步请求,将所述高精度时间数据通过AIDL的方式发送给所述上层应用;
所述上层应用周期性的接收所述高精度时间数据,并根据所述高精度时间数据对所述CSC系统模块时间进行同步;
所述QNX系统模块通过调用所述AutoSar CP tsync模块组件获取所述高精度时间数据对所述QNX系统模块时间进行同步。
基于同一构思,本发明还提供一种时间同步系统,包括:
全局时间数据生成模块,配置为基于定义的全局时间管理模块,对获取的各个时间数据进行校准,生成全局时间数据;
全局时间数据发送模块,配置为基于定义的时间同步协议,携带所述全局时间数据至各个时间待同步模块;
全局时间数据解析模块,配置为对所述定义的时间同步协议进行解析,获取解析后的所述全局时间数据;
时间同步控制模块,配置为响应于时间同步信号,基于所述各个时间待同步模块,通过所述解析后的全局时间数据,对所述各个时间待同步模块中包含的系统时间进行同步处理;
其中,所述全局时间管理模块为时间同步主节点,所述各个时间待同步模块为各个时间同步从节点,所述主节点和所述从节点之间通过以太网进行通信。
基于同一构思,本发明还提供一种电子设备,包括:处理器、通信接口、存储器和通信总线,其中,处理器,通信接口,存储器通过通信总线完成相互间的通信;所述存储器中存储有计算机程序,当所述计算机程序被所述处理器执行时,使得所述处理器执行时间同步方法的步骤。
基于同一构思,本发明还提供一种计算机可读存储介质,其存储有可由电子设备执行的计算机程序,当所述计算机程序在所述电子设备上运行时,使得所述电子设备执行时间同步方法的步骤。
基于同一构思,本发明还提供一种车辆,所述车辆设置有如上所述的时间同步系统。
与现有技术相比,其有益效果在于:
本发明公开了一种时间同步方法、系统、电子设备、存储介质及车辆,无需各系统之间频繁跨进程通信,避免了系统之间跨系统通信发送时间数据的时延,提高了时间准确度,减小了时间显示不正确的风险。
图1是本发明一种时间同步方法在一些具体实施例的流程示意图;
图2是本发明一种时间同步方法在一些应用中的整体架构示意图;
图3是本发明一种时间同步方法在一些应用中的CSC和QNX系统自动时间同步架构示意图;
图4是本发明一种时间同步方法在一些应用中的时间同步流程示意图;
图5是本发明一种时间同步系统在一些具体实施例的结构示意图;
图6是本发明一种电子设备在一些具体实施例的结构示意图。
为了使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请作进一步地详细描述,显然,所描述的实施例仅仅是本申
请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本申请保护的范围。
在本申请实施例中使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本申请。在本申请实施例和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义,“多种”一般包含至少两种。
应当理解,本文中使用的术语“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。
应当理解,尽管在本申请实施例中可能采用术语第一、第二、第三等来描述,但这些描述不应限于这些术语。这些术语仅用来将描述区分开。例如,在不脱离本申请实施例范围的情况下,第一也可以被称为第二,类似地,第二也可以被称为第一。
取决于语境,如在此所使用的词语“如果”、“若”可以被解释成为“在……时”或“当……时”或“响应于确定”或“响应于检测”。类似地,取决于语境,短语“如果确定”或“如果检测(陈述的条件或事件)”可以被解释成为“当确定时”或“响应于确定”或“当检测(陈述的条件或事件)时”或“响应于检测(陈述的条件或事件)”。
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的商品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种商品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的商品或者装置中还存在另外的相同要素。
特别需要说明的是,在说明书中存在的符号和/或数字,如果在附
图说明中未被标记的,均不是附图标记。
参照图1,一种时间同步方法,包括:
S101基于定义的全局时间管理模块,对获取的各个时间数据进行校准,生成全局时间数据;
具体的,在此步骤中,预设定义全局时间管理模块,根据该模块进行各个时间数据的获取与校准生成全局时间数据;
可以理解的是,全局时间数据可理解为Global Time,是后续时间同步的关键数据;
在其中一些应用中,为了生成高精度的全局时间数据,基于定义的全局时间管理模块,对获取的各个时间数据进行校准,生成全局时间数据,包括定义ICC控制器,ICC控制器中包括全局时间管理模块;通过全局时间管理模块,获取各个不同来源的绝对时间数据以及时间校准数据;基于时间校准数据对各个不同来源的绝对时间数据进行校准,生成全局时间数据;时间校准数据包括网络UTC、GPS以及内置高精度RTC时间数据;
可以理解的是,在此应用中,定义ICC控制器(智能连接控制器),在ICC控制器中设置全局时间管理模块,通过该全局时间管理模块,获取各个不同来源的绝对时间数据,通过网络UTC、GPS以及内置高精度RTC时间数据对获取的绝对时间数据进行校准,进而生成全局时间数据。
S102基于定义的时间同步协议,携带所述全局时间数据至各个时间待同步模块;
具体的,在此步骤中,预先定义时间同步协议,根据该协议携带校准的全局时间数据至各个时间待同步模块;
在其中一些应用中,为了使全局时间数据准确到达各模块,基于定义的时间同步协议,携带全局时间数据至各个时间待同步模块,时间管理模块以及各个时间待同步模块均配置有AutoSar CP tsync模块
组件;基于AutoSar CP tsync模块组件,全局时间管理模块根据GPTP协议对全局时间数据进行广播,由各个时间待同步模块中的所述AutoSar CP tsync模块组件进行接收;各个时间待同步模块包括CSC和QNX系统模块;
可以理解的是,在此应用中,时间待同步模块包括CSC和QNX系统模块,二者以及全局时间管理模块均设置有AutoSar CP tsync模块组件,用于发送以及接收全局时间数据,全局时间管理模块通过AutoSar CP tsync模块组件根据GPTP协议将全局时间数据进行广播,由CSC和QNX系统模块中各自的AutoSar CP tsync模块组件进行接收。
进一步的,在此应用中,为了减少进程间的通信,CSC系统模块以及QNX系统模块均为时间同步的从节点,分别与作为主节点的全局时间管理模块通过以太网进行通信;时间管理模块通过以太网将全局时间数据发送至CSC系统模块以及QNX系统模块;将CSC系统模块以及QNX系统模块中的时间区域作为所述从节点;
可以理解是,在此应用中,将CSC系统模块以及QNX系统模块中的时间区域作为整体架构的从节点,全局时间管理模块作为整体架构的主节点,通过以太网的方式进行主节点和从节点之间的通信。
S103对所述定义的时间同步协议进行解析,获取解析后的所述全局时间数据;
具体的,在此步骤中,各个时间待同步模块对事件同步协议进行解析,获取解析后的全局时间数据;
在其中一些应用中,为了更好的应用解析后的全局时间数据,CSC系统模块以及QNX系统模块均为时间同步的从节点,分别与作为主节点的全局时间管理模块通过以太网进行通信;基于GPTP协议,解析全局时间数据,获取高精度时间数据;高精度时间数据包括传播延时以及矫正速率;
可以理解的是,在此应用中,通过解析GPTP协议,获取GPTP协
议中包含的全局时间数据,该数据包括传播延时以及矫正速率。
S104响应于时间同步信号,基于所述各个时间待同步模块,通过所述解析后的全局时间数据,对所述各个时间待同步模块中包含的系统时间进行同步处理;
其中,所述全局时间管理模块为时间同步主节点,所述各个时间待同步模块为各个时间同步从节点,所述主节点和所述从节点之间通过以太网进行通信。
具体的,在此步骤中,根据解析后的全局时间数据,完成时间同步的处理过程;
在其中一些应用中,为了使时间准确进行同步,在CSC系统模块底层创建HAL服务,HAL服务用于调用AutoSar CP tsync模块组件获取高精度时间数据;响应于上层应用的时间同步请求,将高精度时间数据通过AIDL的方式发送给上层应用;上层应用周期性的接收高精度时间数据,并根据高精度时间数据对CSC系统模块时间进行同步;QNX系统模块通过调用AutoSar CP tsync模块组件获取高精度时间数据对QNX系统模块时间进行同步;
可以理解的是,在此应用中,为了满足CSC以及QNX系统模块的时间同步需求,在CSC系统模块底层创建HAL服务,进而根据上层应用的时间同步需求进行相应的时间同步,上层应用根据需求周期性的接收高精度时间数据,进而同步CSC系统时间,可保证时间同步的准确性,同理QNX也通过调用AutoSar CP tsync模块组件获取高精度时间数据对QNX系统模块时间进行同步,从而无需各系统之间频繁跨进程通信,避免了系统之间跨系统通信发送时间数据的时延,提高了时间准确度,减小了时间显示不正确的风险。
下面结合图2至图4说明本发明一种时间同步方法在一些应用中的实施例:
本实施例以ICC作为GTM全局时间管理器(作为主节点TG),用
GPS/UTC/RTC时间校准生成的Global Time下通过以太网二层协议GPTP发到各个ECU(作为从节点TS),CSC和QNX仪表系统解析协议报文,得到时间数据,根据Global Time修正系统时间。此方案使各系统的时钟达到同步。无需CSC和QNX仪表系统之间频繁跨进程通信,只需要CSC和QNX仪表系统分别和ICC进行通信。目前的技术CSC系统除了需要和网络通信还需要和QNX系统进行通信才能传递时钟数据给QNX仪表系统。因此此发明会减少CSC系统的内存占用;并且Qnx仪表系统直接从GPTP协议获取时钟数据,避免了CSC和QNX仪表系统之间跨系统通信发送时间数据的时延,提高了QNX仪表系统时间准确度;如果CSC和QNX一方系统出现问题导致无法同步时间,并不会影响另一方系统自动同步时间,减小了时间显示不正确的风险。
如图2所示,
1、以ICC为以太网master,ICC MCU CP侧用GPS/UTC/RTC时间校准生成Global Time。
2、GTM作为全局时间管理器,将Global Time下发到各个以太网从节点TS。
3、VDC\CSC\QNX仪表时间作为以太网slave,接收Global Time,并按照修正算法校准自身系统时间。
如图3和图4所示,
1、ICC作为主master,内置时间管理模块,从不同来源获取绝对时间,例如网络UTC、GPS以及内置高精度RTC等作为时间基校准绝对时间,保持绝对时间基高保真。
2、ICC作为主master,配置AutoSar CP tsync模块组件,通过该组件在给同一网段的其他从节点slave发布高精度同步时间。Master根据以太网高精度时间同步协议IEEE 802.1AS(GPTP)标准广播发布高精度时间信息。
3、CSC和QNX仪表系统作为slave,部署AutoSar AP tsync模块
组件,接收master发送过来的GPTP协议广播报文,并解析报文获取高精度时间相关信息(例如传播延时、矫正速率等)。
4、在CSC Android底层创建一个HAL服务,该模块用来作为android系统中时间管理模块,设置为开机自启动。实现功能包括:
(1)调用AutoSar AP tsync模块API获取高精度时间;
(2)将获取到的高精度时间通过AIDL的形式提供给上层应用;上层应用可以根据自己的需求来确定是否需要高精度时间;
(3)此模块每500ms接收一次时间同步信息,根据此时间周期性的校准系统时间。每500ms将接收到的同步时间和Android系统时间进行对比,如果差值大于等于1s,就按照同步时间来更新系统时间;以此来完成Android系统时间的同步;
(4)在冷启动未完成阶段,完成与QNX的跨系统通信,由于QNX启动比android系统启动速度更快,android系统通过QNX接收MCU RTC时间。
5、在HAL service中更新系统时间之后,车机可以获取系统时间进行显示,普通应用(对时钟没有高精度要求)可以获取系统时间。
6、QNX系统time_service模块和android系统的HAL service功能类似,需要调用AutoSar AP tsync模块API获取高精度时间,来更新QNX系统时间。仪表屏可以直接显示QNX系统时间。
7、为了防止车机在冷启动时无法获取到ICC的高精度时间,可以在QNX系统time_service模块中获取MCU的内置RTC时间,通过跨进程通信机制发送给android系统。在android HAL服务里接收RTC时间,和Android系统时间做对比,取最新的时间作为系统时间。保证冷启动时车机时间的正常同步。
对于上述实施例公开的方法步骤,出于简单描述的目的将方法步骤表述为一系列的动作组合,但是本领域技术人员应该知悉,本发明实施例并不受所描述的动作顺序的限制,因为依据本发明实施例,某
些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作并不一定是本发明实施例所必须的。
如图5所示,本发明还提供一种时间同步系统,包括:
全局时间数据生成模块201,配置为基于定义的全局时间管理模块,对获取的各个时间数据进行校准,生成全局时间数据;
全局时间数据发送模块202,配置为基于定义的时间同步协议,携带所述全局时间数据至各个时间待同步模块;
全局时间数据解析模块203,配置为所述各个时间待同步模块对所述定义的时间同步协议进行解析,获取解析后的所述全局时间数据;
时间同步控制模块204,配置为响应于时间同步信号,基于所述各个时间待同步模块,通过所述解析后的全局时间数据,对所述各个时间待同步模块中包含的系统时间进行同步处理;
其中,所述全局时间管理模块为时间同步主节点,所述各个时间待同步模块为各个时间同步从节点,所述主节点和所述从节点之间通过以太网进行通信。
值得注意的是,虽然在本发明实施例中只披露了一些基本功能模块,但并不意味着本系统的组成仅仅局限于上述基本功能模块,相反,本实施例所要表达的意思是:在上述基本功能模块的基础之上本领域技术人员可以结合现有技术任意添加一个或多个功能模块,形成无穷多个实施例或技术方案,也就是说本系统是开放式而非封闭式的,不能因为本实施例仅仅披露了个别基本功能模块,就认为本发明权利要求的保护范围局限于所公开的基本功能模块。同时,为了描述的方便,描述以上装置时以功能分为各种单元、模块分别描述。当然在实施本发明时可以把各单元、模块的功能在同一个或多个软件和/或硬件中实现。
如图6所示,本发明还提供一种电子设备,包括:处理器、通信
接口、存储器和通信总线,其中,处理器,通信接口,存储器通过通信总线完成相互间的通信;所述存储器中存储有计算机程序,当所述计算机程序被所述处理器执行时,使得所述处理器执行时间同步方法的步骤。
图6是本发明实施例提供的一种电子设备的结构示意图。如图6所示结构,本发明实施例中提供的电子设备包括:一个或多个处理器710和存储装置720;该电子设备中的处理器710可以是一个或多个,图6中以一个处理器710为例;存储装置720用于存储一个或多个程序;所述一个或多个程序被所述一个或多个处理器710执行,使得所述一个或多个处理器710实现如本发明实施例中任一项所述的时间同步方法。
该电子设备还可以包括:输入装置730和输出装置740。
该电子设备中的处理器710、存储装置720、输入装置730和输出装置740可以通过总线或其他方式连接,图6中以通过总线连接为例。
该电子设备中的存储装置720作为一种计算机可读存储介质,可用于存储一个或多个程序,所述程序可以是软件程序、计算机可执行程序以及模块,如本发明实施例中所提供的时间同步方法对应的程序指令/模块。处理器710通过运行存储在存储装置720中的软件程序、指令以及模块,从而执行电子设备的各种功能应用以及数据处理,即实现上述方法实施例中时间同步方法。
存储装置720可包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序;存储数据区可存储根据电子设备的使用所创建的数据等。此外,存储装置720可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他非易失性固态存储器件。在一些实例中,存储装置720可进一步包括相对于处理器710远程设置的存储器,这些远程存储器可以通过网络连接至设备。上述网络的实例包括
但不限于互联网、企业内部网、局域网、移动通信网及其组合。
输入装置730可用于接收输入的数字或字符信息,以及产生与电子设备的用户设置以及功能控制有关的键信号输入。输出装置740可包括显示屏等显示设备。
本发明还提供一种计算机可读存储介质,其存储有可由电子设备执行的计算机程序,当所述计算机程序在所述电子设备上运行时,使得所述电子设备执行时间同步方法的步骤。
具体的,本发明实施例的计算机存储介质,可以采用一个或多个计算机可读的介质的任意组合。计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子(非穷举的列表)包括:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本实施例中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。
本发明还提供一种车辆,其特征在于,所述车辆设置有如上所述的时间同步系统。
最后应说明的是:以上各实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述各实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的范围。
Claims (10)
- 一种时间同步方法,其特征在于,包括:基于定义的全局时间管理模块,对获取的各个时间数据进行校准,生成全局时间数据;基于定义的时间同步协议,携带所述全局时间数据至各个时间待同步模块;对所述定义的时间同步协议进行解析,获取解析后的所述全局时间数据;响应于时间同步信号,基于所述各个时间待同步模块,通过所述解析后的全局时间数据,对所述各个时间待同步模块中包含的系统时间进行同步处理;其中,所述全局时间管理模块为时间同步主节点,所述各个时间待同步模块为各个时间同步从节点,所述主节点和所述从节点之间通过以太网进行通信。
- 根据权利要求1所述的时间同步方法,其特征在于,基于定义的全局时间管理模块,对获取的各个时间数据进行校准,生成全局时间数据,具体包括:定义ICC控制器,所述ICC控制器中包括所述全局时间管理模块;通过所述全局时间管理模块,获取各个不同来源的绝对时间数据以及时间校准数据;基于所述时间校准数据对所述各个不同来源的绝对时间数据进行校准,生成所述全局时间数据;其中,所述时间校准数据包括网络UTC、GPS以及内置高精度RTC时间数据。
- 根据权利要求1所述的时间同步方法,其特征在于,基于定义的时间同步协议,携带所述全局时间数据至各个时间待同步模块,具体包括:所述全局时间管理模块以及所述各个时间待同步模块均配置有AutoSar CP tsync模块组件;基于所述AutoSar CP tsync模块组件,所述全局时间管理模块根据GPTP协议对所述全局时间数据进行广播,由所述各个时间待同步模块中的所述AutoSar CP tsync模块组件进行接收;其中,所述各个时间待同步模块包括CSC和QNX系统模块。
- 根据权利要求3所述的时间同步方法,其特征在于,所述CSC系统模块以及所述QNX系统模块均为时间同步的从节点,分别与作为主节点的全局时间管理模块通过以太网进行通信;所述时间管理模块通过所述以太网将所述全局时间数据发送至所述CSC系统模块以及所述QNX系统模块;其中,将所述CSC系统模块以及所述QNX系统模块中的时间区域作为所述从节点。
- 根据权利要求3所述的时间同步方法,其特征在于,所述各个时间待同步模块对所述定义的时间同步协议进行解析,获取解析后的所述全局时间数据,具体包括:所述CSC系统模块以及所述QNX系统模块均为时间同步的从节点,分别与作为主节点的全局时间管理模块通过以太网进行通信;;基于所述GPTP协议,解析所述全局时间数据,获取高精度时间数据;其中,所述高精度时间数据包括传播延时以及矫正速率。
- 根据权利要求5所述的时间同步方法,其特征在于,响应于时间同步信号,基于所述各个时间待同步模块,通过所述解析后的全局时间数据,对所述各个时间待同步模块中包含的系统时间进行同步处理,具体包括:在所述CSC系统模块底层创建HAL服务,所述HAL服务用于:调用所述AutoSar CP tsync模块组件获取所述高精度时间数据;响应于上层应用的时间同步请求,将所述高精度时间数据通过AIDL的方式发送给所述上层应用;所述上层应用周期性的接收所述高精度时间数据,并根据所述高精度时间数据对所述CSC系统模块时间进行同步;所述QNX系统模块通过调用所述AutoSar CP tsync模块组件获取所述高精度时间数据对所述QNX系统模块时间进行同步。
- 一种时间同步系统,其特征在于,包括:全局时间数据生成模块,配置为基于定义的全局时间管理模块,对获取的各个时间数据进行校准,生成全局时间数据;全局时间数据发送模块,配置为基于定义的时间同步协议,携带所述全局时间数据至各个时间待同步模块;全局时间数据解析模块,配置为所述各个时间待同步模块对所述定义的时间同步协议进行解析,获取解析后的所述全局时间数据;时间同步控制模块,配置为响应于时间同步信号,基于所述各个时间待同步模块,通过所述解析后的全局时间数据,对所述各个时间待同步模块中包含的系统时间进行同步处理;其中,所述全局时间管理模块为时间同步主节点,所述各个时间待同步模块为各个时间同步从节点,所述主节点和所述从节点之间通过以太网进行通信。
- 一种电子设备,其特征在于,包括:处理器、通信接口、存储器和通信总线,其中,处理器,通信接口,存储器通过通信总线完成相互间的通信;所述存储器中存储有计算机程序,当所述计算机程序被所述处理器执行时,使得所述处理器执行权利要求1至6中任一项所述方法的步骤。
- 一种计算机可读存储介质,其特征在于,其存储有可由电子设备执行的计算机程序,当所述计算机程序在所述电子设备上运行时,使得所述电子设备执行权利要求1至6中任一项所述方法的步骤。
- 一种车辆,其特征在于,所述车辆设置有如权利要求7所述的时间同步系统。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202311693677.3 | 2023-12-11 | ||
| CN202311693677.3A CN117938290A (zh) | 2023-12-11 | 2023-12-11 | 一种时间同步方法、系统、电子设备、存储介质及车辆 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2025123727A1 true WO2025123727A1 (zh) | 2025-06-19 |
Family
ID=90760278
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2024/111079 Pending WO2025123727A1 (zh) | 2023-12-11 | 2024-08-09 | 一种时间同步方法、系统、电子设备、存储介质及车辆 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN117938290A (zh) |
| WO (1) | WO2025123727A1 (zh) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN117938290A (zh) * | 2023-12-11 | 2024-04-26 | 中国第一汽车股份有限公司 | 一种时间同步方法、系统、电子设备、存储介质及车辆 |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2016184808A (ja) * | 2015-03-25 | 2016-10-20 | セイコーソリューションズ株式会社 | 同期メッセージ送出装置、時刻同期システムおよび同期メッセージ送出方法 |
| WO2020063535A1 (zh) * | 2018-09-27 | 2020-04-02 | 华为技术有限公司 | 一种参考时间确定方法及装置 |
| CN217935627U (zh) * | 2022-08-18 | 2022-11-29 | 微思技术有限公司 | 一种具有时间同步功能的can转以太网设备 |
| CN116620352A (zh) * | 2023-05-15 | 2023-08-22 | 中国铁路上海局集团有限公司上海电务段 | 一种铁路检测列车工电供时空同步系统 |
| CN117938290A (zh) * | 2023-12-11 | 2024-04-26 | 中国第一汽车股份有限公司 | 一种时间同步方法、系统、电子设备、存储介质及车辆 |
-
2023
- 2023-12-11 CN CN202311693677.3A patent/CN117938290A/zh active Pending
-
2024
- 2024-08-09 WO PCT/CN2024/111079 patent/WO2025123727A1/zh active Pending
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2016184808A (ja) * | 2015-03-25 | 2016-10-20 | セイコーソリューションズ株式会社 | 同期メッセージ送出装置、時刻同期システムおよび同期メッセージ送出方法 |
| WO2020063535A1 (zh) * | 2018-09-27 | 2020-04-02 | 华为技术有限公司 | 一种参考时间确定方法及装置 |
| CN217935627U (zh) * | 2022-08-18 | 2022-11-29 | 微思技术有限公司 | 一种具有时间同步功能的can转以太网设备 |
| CN116620352A (zh) * | 2023-05-15 | 2023-08-22 | 中国铁路上海局集团有限公司上海电务段 | 一种铁路检测列车工电供时空同步系统 |
| CN117938290A (zh) * | 2023-12-11 | 2024-04-26 | 中国第一汽车股份有限公司 | 一种时间同步方法、系统、电子设备、存储介质及车辆 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN117938290A (zh) | 2024-04-26 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN113110160B (zh) | 域控制器的时间同步方法、装置、域控制器和存储介质 | |
| JP7401656B2 (ja) | クロック・ソースを選択するための方法、装置、及びシステム、並びに記憶媒体 | |
| CN112821974B (zh) | 一种车载ecu高精度时间同步方法及装置 | |
| KR101109980B1 (ko) | 조정된 타이밍 네트워크 내의 서버 동기화 촉진 | |
| CN111385050A (zh) | 时钟同步方法、装置和存储介质 | |
| Lee et al. | FlexRay and Ethernet AVB synchronization for high QoS automotive gateway | |
| US20190253169A1 (en) | Unmanned vehicle, apparatus for supporting time synchronization between unmanned vehicles and method for the same | |
| CN104079364B (zh) | 一种分布式实时测试系统时钟同步方法 | |
| CN112769517B (zh) | 一种t-box时间同步方法和装置 | |
| CN110719135A (zh) | 时间校准方法、系统及电子装置 | |
| WO2025123727A1 (zh) | 一种时间同步方法、系统、电子设备、存储介质及车辆 | |
| WO2018041108A1 (zh) | 确定时间同步报文的时钟时间的方法、装置和设备 | |
| CN117040676A (zh) | 时间同步方法、装置、设备和存储介质 | |
| CN115706709A (zh) | 一种时间敏感网络tsn测试方法、装置和电子设备 | |
| CN119583000A (zh) | 车载网络时间同步方法、装置、存储介质及电子设备 | |
| CN120357991A (zh) | 一种时间同步方法、装置、设备及存储介质 | |
| CN117856961A (zh) | 时钟同步方法及相关装置 | |
| CN115801176A (zh) | 基于ptp协议的跨平台时钟同步方法、装置及存储介质 | |
| CN113783649B (zh) | 终端校时方法、系统、电子设备及存储介质 | |
| CN117221159A (zh) | 换流站时间同步监测方法、装置、计算机设备和存储介质 | |
| CN115250159A (zh) | 时间同步方法、装置、电子设备、存储介质及程序产品 | |
| CN113259039A (zh) | 时间同步方法、装置、计算机设备和存储介质 | |
| CN120263329A (zh) | 时间同步方法、系统和存储介质 | |
| CN115276869B (zh) | 时钟同步方法、装置、电子设备及存储介质 | |
| CN121508717A (zh) | 座舱域控时间同步方法、系统及程序产品 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 24902153 Country of ref document: EP Kind code of ref document: A1 |