Time synchronization method based on vehicle-mounted virtual architecture
By dynamically adjusting the SyncInterval value using PTP protocol and linear regression method in the on-board virtual architecture, the flexibility and adaptability of the time synchronization method in the on-board environment is solved, and more efficient time synchronization and bandwidth utilization are achieved.
Patent Information
- Application Number
- CN202410841269.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-26
- Publication Date
- 2024-12-06
AI Technical Summary
In vehicle-mounted environments, existing time synchronization methods lack flexibility, cannot effectively weigh the relationship between synchronization accuracy and network bandwidth usage, and preset experience values lack adaptability when facing different vehicle environments.
The time synchronization method based on the on-board virtual architecture is adopted, and the message flow and linear regression method of the PTP protocol are dynamically adjusted to form an adaptive synchronization strategy, reducing the complexity of manual configuration and adapting to changes in the vehicle environment.
It realizes flexible time synchronization in different vehicle environments, reduces the rate of manual operation errors, improves synchronization accuracy and bandwidth utilization flexibility, and adapts to the actual situation of different environments.
Smart Images

Figure CN119094066A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of server management, and in particular to a time synchronization method based on a vehicle-mounted virtual architecture. Background Art
[0002] With the popularity of driverless driving, intelligent transportation, and the popularization of in-vehicle Ethernet, there are a large number of time synchronization requirements for data usage scenarios in different domains of the vehicle, such as the precise collection of camera, laser / millimeter wave radar data in the intelligent driving domain, the synchronous playback of audio and video in the front and rear rows in the cockpit domain, and the synthetic display of multi-camera data. Among them, time synchronization basically uses the PTP (Precision Time Protocol) or gPTP (generalized Precision Time Protocol) protocol of the IEEE 1588 standard.
[0003] The mainstream automotive Ethernet configurations include 100M (IEEE 100BASE-T1) and 1G (IEEE 1000BASE-T1). The difference between them is that the bandwidth requirements in each domain are different, and the transmission of synchronous data between time nodes also has unicast and multicast modes, which have certain requirements for network bandwidth. The principle is that the higher the synchronization frequency, the higher the time accuracy, and the higher the bandwidth occupancy, and vice versa.
[0004] In the vehicle environment, the requirements for time synchronization accuracy are not the same. For example, intelligent driving data requires high accuracy, while the synchronous playback of audio and video in the cockpit domain is relatively low. Reasonable and flexible setting of the synchronization frequency to achieve a balance between accuracy and bandwidth occupancy is a problem to be solved at this stage.
[0005] In addition, for the setting of synchronization frequency, the distributed time synchronization system based on industrial Ethernet has sufficient network bandwidth and the server is located in a stable environment, so the preset experience value method is usually used. However, vehicles are greatly affected by the surrounding temperature and humidity environment, the oscillation frequency of the local clock varies greatly, and the natural environment in which different vehicles operate for a long time is also different. There is a lack of flexibility in presetting the same experience value for each vehicle.
[0006] Therefore, the present invention provides a time synchronization method based on a vehicle-mounted virtual architecture to solve the above technical problems. Summary of the invention
[0007] In order to solve the above technical problems, the present invention provides a time synchronization method based on a vehicle-mounted virtual architecture, comprising the following steps:
[0008] Step 1: Initialize the sample set. If the sample set already exists, this operation is not necessary.
[0009] Step 2: According to the PTP protocol, the Sync message process, Follow_up message process, Delay_Req message process, and Delay_Resp message process are executed in sequence;
[0010] Step 3: Get the delay and offset parameters through a request response;
[0011] Step 4: Repeat steps 2 and 3 according to the current SyncInterval value until the offset parameter is 0, indicating that the local clock synchronization is complete.
[0012] Step 5: Record the SyncCount and SyncInterval of the local clock synchronization and update the sample set. Follow the time principle and delete the oldest sample information in the sample set.
[0013] Step 6: Use the linear regression method to calculate the new SyncInterval value and save it for next reading.
[0014] As a further solution, the sample set is designed as: [SyncInterval, SyncCount] xSamplesCount; SyncCount indicates the number of requests in a cycle, SyncInterval indicates the time interval between two requests as the synchronization step, and SamplesCount indicates the number of samples.
[0015] As a further solution, the Sync message process: the master clock Master sends a sync message and records the precise sending time T1 when the sync message leaves the master clock Master; the slave clock Slave receives the sync message and records the receiving time T2.
[0016] As a further solution, the Follow_up message process is as follows: the master clock Master encapsulates the time T1 into the Follow_up message and sends it to the slave clock Slave.
[0017] As a further solution, the Delay_Req message process is as follows: after the slave clock Slave receives the Follow up message, it sends a Delay_Req message to the master clock Master and records the sending time T3.
[0018] As a further solution, the Delay_Resp message process is as follows: after receiving the Delay_Req message, the master clock Master records the receiving time T4 and packs it into the Delay_Resp message to reply to the slave clock Slave.
[0019] As a further solution, the delay parameter represents the delay of transmission between the master and slave nodes, and the specific calculation formula is: delay = [(T2-T1)+(T4-T3)] / 2.
[0020] As a further solution, the Sync message, Follow_up message, Delay_Req message and Delay_Resp message are set based on the IEEE 1588v2 protocol.
[0021] As a further solution, a new SyncInterval value is calculated using a linear regression method.
[0022] As a further solution, step 5 also follows the time principle and deletes the oldest sample information in the sample set after the sample set is updated.
[0023] Compared with the related art, the time synchronization method based on the vehicle virtual architecture provided by the present invention has the following beneficial effects:
[0024] The present invention uses an adaptive dynamic adjustment method to reduce the complexity of manual preset. For the situation where a vehicle needs to independently configure each time node, it reduces the workload while also reducing the error rate introduced by manual operation. In addition, the PTP synchronization strategy with adjusted stride has stronger flexibility and can be dynamically adjusted according to the actual situation of the vehicle in different environments. Unlike traditional methods, it is insensitive to environmental changes and will lose a certain degree of synchronization accuracy when the local clock oscillates frequently. Conversely, the synchronization accuracy must be sacrificed at the cost of bandwidth flow. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 A schematic diagram of the steps of a time synchronization method based on a vehicle-mounted virtual architecture provided by the present invention;
[0026] Figure 2 A schematic diagram of a single-device vehicle-mounted virtual architecture provided by the present invention;
[0027] Figure 3 A schematic diagram of a multi-device vehicle-mounted virtual architecture provided by the present invention;
[0028] Figure 4 This is a schematic diagram of the PTP protocol response mechanism provided by the present invention. DETAILED DESCRIPTION
[0029] The present invention will be further described below in conjunction with the accompanying drawings and implementation modes.
[0030] like Figure 1 As shown, a time synchronization method based on a vehicle-mounted virtual architecture includes the following steps:
[0031] Step 1: Initialize the sample set. If the sample set already exists, this operation is not necessary.
[0032] Step 2: According to the PTP protocol, the Sync message process, Follow_up message process, Delay_Req message process, and Delay_Resp message process are executed in sequence;
[0033] Step 3: Get the delay and offset parameters through a request response;
[0034] Step 4: Repeat steps 2 and 3 according to the current SyncInterval value until the offset parameter is 0, indicating that the local clock synchronization is complete.
[0035] Step 5: Record the SyncCount and SyncInterval of the local clock synchronization and update the sample set. Follow the time principle and delete the oldest sample information in the sample set.
[0036] Step 6: Use the linear regression method to calculate the new SyncInterval value and save it for next reading.
[0037] It should be noted that in actual applications, the software and hardware of the vehicle system mostly use the virtualization (Hypevisor) architecture solution. Taking the cockpit domain as an example, a single device ( Figure 2 ) or multiple devices ( Figure 3 ) form, the clock role of each subsystem also varies according to its location, such as Figure 2 The instrument system in the car plays the role of both a slave clock and a master clock, namely the boundary clock (BC). The entertainment systems in the front and rear rows only play the role of a slave clock, namely the ordinary clock (OC). Their clock references all come from the master clock GM (Grandmaster Clock), so each time node can independently control the synchronization frequency according to its own location to seek an adaptive balance between accuracy and bandwidth.
[0038] Time synchronization is mainly used in distributed systems. Due to the requirements of scenarios such as intelligent driving and in-car projection, it is gradually being taken seriously in the automotive field. The standard PTP protocol performs synchronization through a request-response mechanism. A complete interaction includes four steps, which can obtain the transmission delay (delay) and time offset (offset) of the master and slave time nodes. The specific process is as follows: Figure 4 shown.
[0039] As a further solution, the sample set is designed as: [SyncInterval, SyncCount] xSamplesCount; SyncCount indicates the number of requests in a cycle, SyncInterval indicates the time interval between two requests as the synchronization step, and SamplesCount indicates the number of samples.
[0040] It should be noted that: this embodiment dynamically sets the value of SyncInterval to balance the relationship between synchronization accuracy and bandwidth occupancy; uses training iterations of sample sets to increase the rationality of SyncInterval adjustment so that it can adapt to the latest environmental status of the current vehicle; each time node operates independently to meet the requirements of different links in the vehicle domain and flexibly adapt to different processes. The algorithm idea is: within a synchronization cycle, multiple PTP request responses need to be completed to achieve master-slave synchronization, where SyncCount represents the number of requests within the cycle, and the time interval between two requests is the synchronization step expressed as SyncInterval, in seconds. When SyncCount is too large, reduce SyncInterval to quickly achieve synchronization control accuracy; when SyncCount is small, appropriately increase SyncInterval to alleviate the pressure of bandwidth occupancy.
[0041] As a further solution, the Sync message process: the master clock Master sends a sync message and records the precise sending time T1 when the sync message leaves the master clock Master; the slave clock Slave receives the sync message and records the receiving time T2.
[0042] As a further solution, the Follow_up message process is as follows: the master clock Master encapsulates the time T1 into the Follow_up message and sends it to the slave clock Slave.
[0043] As a further solution, the Delay_Req message process is as follows: after the slave clock Slave receives the Follow up message, it sends a Delay_Req message to the master clock Master and records the sending time T3.
[0044] As a further solution, the Delay_Resp message process is as follows: after receiving the Delay_Req message, the master clock Master records the receiving time T4 and packs it into the Delay_Resp message to reply to the slave clock Slave.
[0045] As a further solution, the delay parameter represents the delay of transmission between the master and slave nodes, and the specific calculation formula is: delay = [(T2-T1)+(T4-T3)] / 2.
[0046] As a further solution, the Sync message, Follow_up message, Delay_Req message and Delay_Resp message are set based on the IEEE 1588v2 protocol.
[0047] As a further solution, a new SyncInterval value is calculated using a linear regression method.
[0048] As a further solution, step 5 also follows the time principle and deletes the oldest sample information in the sample set after the sample set is updated.
[0049] It should be noted that the slave clock adjusts the local clock value according to the offset to achieve synchronization with the master clock. Usually, multiple interactions are required to make the time correction consistent, and with the difference in the local clock oscillation frequency, the master and slave clocks must resynchronize and correct at a certain frequency. The resynchronization frequency step is not defined in the protocol, and is generally defined based on experience, ranging from hundreds of milliseconds to several seconds or even tens of seconds. Note: For details on the definition of each message, refer to "IEEE 1588v2" and protocol-related documents.
[0050] The above are only embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A time synchronization method based on a vehicle-mounted virtual architecture, characterized in that: The steps include: Step 1: Initialize the sample set. If the sample set already exists, this operation is not necessary. Step 2: According to the PTP protocol, the Sync message process, Follow_up message process, Delay_Req message process, and Delay_Resp message process are executed in sequence; Step 3: Get the delay and offset parameters through a request response; Step 4: Repeat steps 2 and 3 according to the current SyncInterval value until the offset parameter is 0, indicating that the local clock synchronization is complete. Step 5: Record the SyncCount and SyncInterval of the local clock synchronization and update the sample set; Step 6: Calculate the new SyncInterval value and save it for next reading.
2. A time synchronization method based on a vehicle-mounted virtual architecture according to claim 1, characterized in that: The sample set is designed as: [SyncInterval, SyncCount] x SamplesCount; SyncCount indicates the number of requests in a cycle, SyncInterval indicates the time interval between two requests as the synchronization step, and SamplesCount indicates the number of samples.
3. The time synchronization method based on vehicle virtual architecture according to claim 2, characterized in that: The Sync message process: the master clock Master sends a sync message and records the precise sending time T1 when the sync message leaves the master clock Master; the slave clock Slave receives the sync message and records the receiving time T2.
4. The time synchronization method based on vehicle virtual architecture according to claim 3 is characterized in that: The Follow_up message process: the master clock Master encapsulates the time T1 into the Follow_up message and sends it to the slave clock Slave.
5. The time synchronization method based on vehicle virtual architecture according to claim 4, characterized in that: The Delay_Req message process: After the slave clock Slave receives the Follow up message, it sends a Delay_Req message to the master clock Master and records the sending time T3.
6. The time synchronization method based on vehicle virtual architecture according to claim 5, characterized in that: The Delay_Resp message process: After receiving the Delay_Req message, the master clock Master records the receiving time T4, and packs it into the Delay_Resp message to reply to the slave clock Slave.
7. The time synchronization method based on vehicle virtual architecture according to claim 6, characterized in that: The delay parameter represents the transmission delay between the master and slave nodes, and the specific calculation formula is: delay = [(T2-T1)+(T4-T3)] / 2.
8. The time synchronization method based on vehicle virtual architecture according to claim 6, characterized in that: The Sync message, Follow_up message, Delay_Req message and Delay_Resp message are set based on the IEEE 1588v2 protocol.
9. The time synchronization method based on vehicle virtual architecture according to claim 1, characterized in that: A new SyncInterval value is calculated using a linear regression method.
10. The time synchronization method based on vehicle virtual architecture according to claim 1, characterized in that: The step 5 also follows the time principle, and deletes the oldest sample information in the sample set after the sample set is updated.
