A Multi-Source and Multi-Precision Operating System Time Synchronization Method

Through the multi-source and multi-precision operating system time synchronization method, multiple time synchronization modes and 5G-CPE network are adopted to solve the problem of insufficient time synchronization accuracy of traditional special vehicle electronic information systems, and realize high-precision time synchronization in sub-microsecond level, meeting the needs of multi-vehicle collaboration and unmanned vehicle collaboration in complex environments of special vehicles.

CN119906514BActive Publication Date: 2025-07-11COMP APPL TECH INST OF CHINA NORTH IND GRP
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510064641.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-15
Publication Date
2025-07-11
Estimated Expiration
2045-01-15

AI Technical Summary

Technical Problem

The traditional special vehicle electronic information system based on domestic software and hardware environments has poor time synchronization capabilities and cannot meet the fire protection and rescue operations tasks of multi-vehicle collaboration and unmanned vehicles participating in the networked architecture of the new special vehicle electronic system. The time synchronization accuracy is insufficient and a single clock source causes the equipment to be unable to synchronize in complex environments.

Method used

The multi-source and multi-precision operating system time synchronization method is adopted, and the fleet's on-board embedded information platform is built, and the Bully election algorithm is used to elect monitoring nodes. Combined with high-precision PTP time synchronization, low-precision PTP time synchronization, local autonomous time synchronization and local manual time synchronization, combined with 5G-CPE's workshop 5G cellular network for time synchronization, ensuring effective synchronization under different environments and equipment states.

Benefits of technology

It realizes high-precision time synchronization in sub-microsecond level, improves the multi-vehicle coordination and unmanned vehicle collaboration operation capabilities of special vehicles in complex environments, ensures the continuity and stability of time synchronization, and meets the high-precision needs of new special vehicle electronic systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119906514B_ABST
    Figure CN119906514B_ABST
Patent Text Reader

Abstract

The present invention relates to a multi-source and multi-precision operating system time synchronization method, which includes building an embedded information platform for the fleet and each vehicle based on domestic software and hardware, including in-vehicle computers, 5G-CPEs, timekeeping and time dissemination devices, Beidou devices, and multiple in-vehicle terminals. The in-vehicle computer includes multiple computing and processing modules; each vehicle sets the time synchronization priority of each node, and each node multicasts the IP address, CPU main frequency, time synchronization priority, and MAC address into the node resource pool; the in-vehicle nodes include multiple in-vehicle terminals and multiple computing and processing modules; each vehicle elects a monitoring node based on the CPU main frequency and MAC address, and the monitoring node communicates with the timekeeping and time dissemination device to judge the working state of the timekeeping and time dissemination device and the status of the calendar information; the monitoring node of each vehicle determines the time synchronization mode based on the working state of the timekeeping and time dissemination device and the valid state of the calendar information, and synchronizes the time of each in-vehicle node based on the time synchronization mode and the time synchronization priority.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of time synchronization for electronic information systems of special vehicles, and particularly to a multi-source and multi-precision operating system time synchronization method. Background Art

[0002] With the development of new civilian intelligent vehicles and special vehicles, the vehicle electronic information system has evolved into a networked architecture centered on in-vehicle computers and in-vehicle terminals, realizing an in-vehicle transmission network and service-oriented software architecture with information sharing, large bandwidth, low latency, and high reliability. With the increasing informatization and intelligence of vehicles and the rapid development of unmanned special operations, in the process of vehicle operation and multi-vehicle data interaction, the transmission of various data is inseparable from time information. Therefore, time synchronization is an important guarantee for the coordinated operation of various devices in the special vehicle electronic system and the error-free transmission of information, and it is also a prerequisite for special vehicles to perform tasks such as fire fighting and rescue. As an important equipment for performing tasks such as fire fighting and rescue, special vehicles have the development goal of being independent, safe, and reliable.

[0003] Traditional special vehicle electronic information systems based on domestic software and hardware environments have poor time synchronization capabilities and have the following main defects:

[0004] In traditional domestic special vehicle electronic information systems, the Beidou device can only perform high-precision time synchronization of TOD (Time of Day) with in-vehicle communication devices. The Beidou device uses a low-precision time synchronization method to send Beidou astronomical time data to electronic devices such as in-vehicle computers and in-vehicle terminals through in-vehicle buses such as CAN (Controller Area Network) or gigabit Ethernet. The electronic devices set the received Beidou astronomical time as the local time, and the time synchronization accuracy is in the millisecond level or even the second level. This method can no longer meet the time synchronization requirements under the networked architecture of the new special vehicle electronic system, nor can it meet the requirements of fire fighting and rescue operation tasks involving multi-vehicle cooperation and unmanned vehicle cooperation under complex environmental conditions.

[0005] The time synchronization strategy is single. Although traditional special vehicle electronic information systems based on domestic software and hardware environments have replaced the GPS technology (Global Positioning System) of the United States with the domestic Beidou satellite navigation system technology to complete the domestic substitution, they only use a single clock source (Beidou astronomical time). The local time synchronization depends on Beidou satellite astronomical time information. When the vehicle is in an area with poor Beidou satellite signals and the in-vehicle timekeeping and time dissemination equipment is not working properly, the time synchronization of each device within the system cannot be completed, affecting the information transmission and fusion of the vehicle system and unable to meet the actual operation requirements such as vehicle movement, multi-vehicle cooperation, and unmanned vehicle control.

[0006] The time synchronization accuracy is poor. In the traditional electronic information system of special vehicles based on domestic software and hardware environments, the Beidou device can only perform high-precision TOD time synchronization with in-vehicle communication devices (such as vehicle-mounted radios, etc.). The Beidou device uses a low-precision time synchronization method to send Beidou astronomical time data to in-vehicle electronic devices such as in-vehicle computers and in-vehicle terminals through in-vehicle buses such as CAN (Controller Area Network) or Gigabit Ethernet. The electronic devices set the received Beidou astronomical time as the local time, and the time synchronization accuracy is only at the millisecond level or even the second level. This method can no longer meet the time synchronization requirements of the new special vehicle electronic system networking architecture and cannot meet the requirements of fire fighting and rescue operation tasks involving multi-vehicle cooperation and unmanned vehicle cooperation under complex environmental conditions. Summary of the Invention

[0007] In view of the above analysis, embodiments of the present invention aim to provide a multi-source and multi-precision operating system time synchronization method to solve the technical problems of how to synchronize the time of in-vehicle computer and in-vehicle terminal in-vehicle nodes under special vehicles based on domestic software and hardware platforms, improve the time synchronization accuracy, and provide multiple time synchronization strategies to meet the time requirements in different scenarios.

[0008] The object of the present invention is mainly achieved through the following technical solutions:

[0009] The present invention provides a multi-source and multi-precision operating system time synchronization method, including the following steps:

[0010] Step S1: Construct a special vehicle fleet and build an in-vehicle embedded information platform for each special vehicle in the fleet. Among them, the platform includes an in-vehicle computer, a 5G-CPE, a timekeeping and time-sending device, a Beidou device, and multiple in-vehicle terminals. The in-vehicle computer includes multiple computing and processing modules;

[0011] Step S2: Each special vehicle sets the time synchronization priority of each in-vehicle node, and each in-vehicle node multicasts its own IP address, CPU main frequency, time synchronization priority, and MAC address ID into the node resource pool; the in-vehicle nodes include multiple in-vehicle terminals and multiple computing and processing modules;

[0012] Step S3: Each special vehicle elects monitoring nodes for each in-vehicle node based on the CPU main frequency and MAC address ID in the node resource pool. The monitoring nodes establish communication with the timekeeping and time-sending device, and judge the working state of the timekeeping and time-sending device and the valid state of the current calendar information;

[0013] Step S4: Each monitoring node of each special vehicle determines a time synchronization mode based on the working state of the timekeeping and time - granting device and the valid state of the current calendar information, and performs time synchronization on each vehicle - mounted node based on the time synchronization mode and the time synchronization priority.

[0014] Further, each special vehicle elects a monitoring node based on the Bully election algorithm for the CPU main frequency and the MAC address ID, including:

[0015] Screen the vehicle - mounted node with the highest CPU main frequency as the monitoring candidate node. If the number of monitoring candidate nodes is 1, then this vehicle - mounted node is the monitoring node;

[0016] Otherwise, conduct an election based on the MAC address ID, and elect the vehicle - mounted node with the largest MAC address ID as the monitoring node, and elect other vehicle - mounted nodes as non - monitoring nodes;

[0017] If the monitoring node stops publishing the election factor within a predetermined time period, re - select the monitoring node.

[0018] Further, the monitoring node establishes communication with the timekeeping and time - granting device, including:

[0019] The first step: The monitoring node sends a first UDP heartbeat packet to the fixed IP address and port number of the timekeeping and time - granting device;

[0020] The second step: After receiving the first UDP heartbeat packet, the timekeeping and time - granting device responds by sending a second UDP heartbeat packet and a UDP data packet to the monitoring node; if the timekeeping and time - granting device does not receive the first UDP heartbeat packet within a continuous preset time period, return to the first step;

[0021] The third step: The monitoring node parses based on the received second UDP heartbeat packet to judge the working state of the timekeeping and time - granting device and whether the current calendar information is valid;

[0022] Among them, the UDP data packet includes a sending timestamp.

[0023] Further, the step S4 includes:

[0024] If the working states of the timekeeping and time - granting devices of all vehicles in the fleet are all synchronized or the working states of the timekeeping and time - granting devices of some vehicles are synchronized, and the current calendar information is valid, adopt the high - precision PTP time synchronization mode to perform high - precision time synchronization on each vehicle - mounted node based on the timekeeping and time - granting device clock source;

[0025] If the working state of the timekeeping and time distribution device is time synchronization, timekeeping, or RTC time distribution, and the current calendar information is valid, a reference vehicle is selected from the vehicles based on the 5G cellular network in the workshop of the 5G-CPE. The on-vehicle nodes in the vehicle fleet are synchronously low-precision time based on the clock source of the timekeeping and time distribution device of the reference vehicle in the low-precision PTP time synchronization mode;

[0026] If the working states of the timekeeping and time distribution devices of all vehicles in the vehicle fleet are non-synchronized, the monitoring node of the leading vehicle performs UDP multicast in the local autonomous time synchronization mode. The on-vehicle nodes of each vehicle in the vehicle fleet use the calendar information of the monitoring node of the leading vehicle as the clock source, and based on the time synchronization priority of the on-vehicle nodes, the on-vehicle nodes of all vehicles in the vehicle fleet are synchronously low-precision time using the 5G cellular network in the workshop of the 5G-CPE;

[0027] When the high-precision or low-precision PTP time synchronization mode, or the local autonomous time synchronization mode is not received within a certain time period, each on-vehicle node adopts the local manual time synchronization mode, and based on the system time of the monitoring node of the leading vehicle set manually, the system times of the other on-vehicle nodes of the leading vehicle and the on-vehicle nodes of other vehicles in the vehicle fleet are synchronously low-precision time.

[0028] Furthermore, if the working states of the timekeeping and time distribution devices of all vehicles in the vehicle fleet are synchronized, and the current calendar information is valid, each vehicle uses the clock source of its own timekeeping and time distribution device as the reference to perform high-precision PTP time synchronization for the other on-vehicle nodes of its own vehicle;

[0029] If the working states of the timekeeping and time distribution devices of some vehicles are synchronized, and the current calendar information is valid, the vehicles with the working states of the timekeeping and time distribution devices being synchronized use the clock source of their own timekeeping and time distribution devices as the reference to perform high-precision PTP time synchronization for the other on-vehicle nodes of their own vehicles; at the same time, for the vehicles with the working states of the timekeeping and time distribution devices not being synchronized, based on the system time of the monitoring node of the vehicle with the largest vehicle ID among the vehicles with the working states of the timekeeping and time distribution devices being synchronized, high-precision PTP time synchronization is performed for all on-vehicle nodes of its own vehicle based on the 5G cellular network.

[0030] Furthermore, the high-precision PTP time synchronization mode based on delay-request measurement is used to synchronize the system time of the on-vehicle nodes with high precision as follows:

[0031] The timekeeping and time distribution device serves as the PTP server, and the monitoring node serves as the PTP client;

[0032] The PTP server sends a Sync synchronization message to the PTP client, and at the same time records the message sending time t1;

[0033] The PTP client receives the Sync synchronization message and records the message reception time t2 at the same time;

[0034] The PTP server sends t1 in the Follow_Up follow-up delay message to the PTP client, and the PTP client parses out the time t1 after receiving the message;

[0035] The PTP client sends a Delay_Req delay request message to the PTP server, synchronously records the time t3 when the Delay_Req delay request message is sent, and the PTP server records the received time t4 after receiving the message;

[0036] The PTP server sends the time t4 in the Delay_Resp delay response message to the PTP client, and the PTP client parses out t4 after receiving this message; the PTP client obtains the time values t1, t2, t3, and t4;

[0037] The time deviation value Offset and the network link delay Delay between the PTP server and the client are calculated as follows:

[0038] t2 - t1 - Offset = Delay

[0039] t4 - (t3 - Offset) = Delay

[0040] It is calculated that:

[0041] Offset = [(t2 - t1) + (t3 - t4)] / 2

[0042] Delay = [(t2 - t1) + (t4 - t3)] / 2

[0043] The PTP client subtracts the Offset value from the local system time value based on the time deviation value Offset to obtain the synchronization time with the high-precision clock source of the PTP server, and synchronously updates the local system time of the monitoring node.

[0044] Further, the low-precision PTP time synchronization mode performs low-precision time synchronization on the system time of each vehicle's on-vehicle node as follows:

[0045] The vehicle election includes:

[0046] Find out the special vehicle whose working state of the timekeeping and time-giving device is timekeeping. If the number of vehicles in the timekeeping state is greater than 1, select the vehicle with the smaller vehicle ID value in the convoy in the timekeeping state as the reference vehicle;

[0047] Otherwise, find the special vehicle whose timekeeping and time distribution device is in the time synchronization state. If the number of vehicles in the time synchronization state is greater than 1, select the vehicle with the smallest vehicle ID value in the convoy that is in the time synchronization state as the reference vehicle;

[0048] Otherwise, find the special vehicle whose timekeeping and time distribution device is in the RTC time distribution state. If the number of vehicles in the RTC time distribution state is greater than 1, select the vehicle with the smallest vehicle ID value in the convoy that is in the RTC time distribution state as the reference vehicle;

[0049] Based on the clock source of the timekeeping and time distribution device of the reference vehicle, perform time synchronization on other on-vehicle nodes in the reference vehicle;

[0050] At the same time, use the in-vehicle 5G cellular network of the 5G-CPE to perform low-precision time synchronization on the on-vehicle nodes of other vehicles in the convoy.

[0051] Furthermore, perform low-precision time synchronization on the system time of the on-vehicle nodes of each vehicle in the convoy based on the local autonomous time synchronization mode, including:

[0052] Each on-vehicle node in the leading vehicle is based on the system time and time synchronization priority information periodically multicast by other on-vehicle nodes in the node resource pool; select the system time of the on-vehicle node with the highest time synchronization priority, and judge the validity of the selected system time based on a preset effective time threshold. If it is valid, update the system time of the on-vehicle node to the selected system time;

[0053] Take the system time of the monitoring node of the leading vehicle as the clock source with the highest priority, and use the in-vehicle 5G cellular network of the 5G-CPE to synchronize and update the system time of the on-vehicle nodes of other vehicles in the convoy to the system time of the monitoring node of the leading vehicle.

[0054] Furthermore, based on the local manual time synchronization mode based on the system time of the monitoring node of the leading vehicle set manually, perform low-precision time synchronization on the system time of the on-vehicle nodes of the leading vehicle and the on-vehicle nodes of other vehicles in the convoy, including:

[0055] Use the time modification interface of the operation command on-vehicle terminal of the leading vehicle to set the system time of the monitoring node of the leading vehicle;

[0056] Judge the validity of the set system time of the monitoring node of the leading vehicle based on a preset effective time threshold;

[0057] If it is valid, synchronize the system time of other on-vehicle nodes of the leading vehicle and the on-vehicle nodes of other vehicles in the convoy to the system time of the monitoring node of the leading vehicle.

[0058] Furthermore, the step S1 includes:

[0059] Index the unique vehicle ID assigned to each special vehicle in the convoy to determine the leading vehicle and the following vehicles. The vehicle ID of the leading vehicle is the smallest, and the vehicle IDs of the following vehicles increase in sequence.

[0060] In the in-vehicle embedded information platform of each special vehicle, each in-vehicle node and device are connected through Ethernet.

[0061] The Beidou device will provide the high-precision time of day (TOD) obtained by receiving Beidou satellite signals to the timekeeping and time synchronization device.

[0062] Each special vehicle in the convoy conducts 5G cellular network connection based on the 5G-CPE.

[0063] Both the in-vehicle terminal and the computing and processing module adopt the domestic openEuler operating system. The in-vehicle terminal uses the Rockchip RK3588 CPU processor. The computing and processing module uses the Feiteng FD-2000 / 8-core CPU processor.

[0064] Compared with the prior art, the present invention can achieve at least one of the following beneficial effects:

[0065] 1. The operating system time synchronization method in the present invention is a customized R & D that is independently controllable based on the domestic openEuler operating system and domestic chips. The method of the present invention not only improves the performance and reliability of the in-vehicle embedded information platform of special vehicles, but also ensures the independent controllability and security of the platform, meeting the multi-vehicle cooperation and unmanned vehicle cooperation operation requirements of special vehicles in complex environments.

[0066] 2. The present invention adopts the high-precision PTP time synchronization mode. Based on the high-precision clock source of the timekeeping and time synchronization device, through precise timestamp exchange and deviation calculation, it can achieve high-precision time synchronization at the sub-microsecond level. Compared with the traditional method that can only reach the millisecond level or second level of accuracy, the time synchronization accuracy is greatly improved, meeting the higher requirements for time synchronization accuracy under the new special vehicle electronic system networking architecture, and providing a reliable time guarantee for complex operation tasks participated by multi-vehicle cooperation.

[0067] 3. The present invention adopts a multi-source time synchronization strategy, breaking through the limitations of traditional single time sources and integrating multiple time sources. Adopting a multi-source time synchronization strategy of four modes: high-precision PTP time synchronization mode, low-precision PTP time synchronization mode, local autonomous time synchronization mode, and local manual time synchronization mode, the multi-source time synchronization strategy enhances the adaptability and robustness of the system, ensuring effective time synchronization under different environments and device states.

[0068] 4. The present invention is based on the Bully election algorithm, comprehensively considering the CPU main frequency and MAC address to elect the monitoring node. First, the node with the highest CPU main frequency is screened as the monitoring candidate node. If the number of candidate nodes is greater than 1, the node with the largest MAC address value is elected as the monitoring node based on the MAC address ID. This election mechanism can select a monitoring node with better performance and stronger uniqueness, improving the rationality and accuracy of the monitoring node election. At the same time, when the monitoring node stops publishing the election factor within a predetermined time period, it can reselect the monitoring node in a timely manner to ensure the stable operation of the platform in case of node failure or abnormality;

[0069] 5. The present invention uses 5G-CPE to connect the workshop 5G cellular network, realizing high-speed, low-latency, and high-reliable communication for the special vehicle fleet. The high-bandwidth and low-latency characteristics of the 5G network support the rapid transmission and real-time response of a large amount of data, ensuring the real-time performance and reliability of vehicle-to-vehicle cooperative control; Mobility management and anti-interference technologies ensure the communication stability of vehicles under high-speed movement and complex electromagnetic environments. Through seamless integration with the in-vehicle embedded information platform, 5G-CPE supports multi-vehicle cooperation and time synchronization, improving the operation efficiency and safety of the fleet. At the same time, the encrypted communication and identity authentication mechanisms of the 5G network enhance the security of the system, ensuring the confidentiality and integrity of data transmission;

[0070] 6. The present invention can flexibly adjust the time synchronization mode according to the working state of the timekeeping and time dissemination device and the valid state of the current calendar information. When the working state of the timekeeping and time dissemination device changes, the monitoring node can timely judge and switch to the corresponding time synchronization mode, such as switching from the high-precision PTP mode to the low-precision PTP mode or the local autonomous time synchronization mode. This flexible response mechanism enables the in-vehicle embedded information platform to quickly adapt to changes in the device state, ensuring the continuity and stability of time synchronization, avoiding time synchronization interruption caused by device failure or unstable signals, and ensuring the efficient coordination of special vehicles in various operation tasks and the accuracy of information transmission.

[0071] In the present invention, the above technical solutions can also be combined with each other to achieve more preferred combination schemes. Other features and advantages of the present invention will be described in the subsequent specification, and some advantages can be made obvious from the specification or understood by implementing the present invention. The objectives and other advantages of the present invention can be realized and obtained from the content specifically pointed out in the specification and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0072] The drawings are only for the purpose of showing specific embodiments and are not considered as limiting the present invention. Throughout the drawings, the same reference signs represent the same components.

[0073] Figure 1Flowchart of a multi-source and multi-precision operating system time synchronization method in an embodiment of the present invention;

[0074] Figure 2 Deployment structure diagram of an embedded information platform for a special vehicle in multi-vehicle collaboration in an embodiment of the present invention;

[0075] Figure 3 Flowchart of a monitoring node election algorithm in an embodiment of the present invention;

[0076] Figure 4 Flowchart of time synchronization mode judgment and processing in an embodiment of the present invention;

[0077] Figure 5 Schematic diagram of high-precision PTP time synchronization in an embodiment of the present invention;

[0078] Figure 6 Schematic diagram of a high-precision PTP time synchronization mechanism based on delay-request measurement in an embodiment of the present invention;

[0079] Figure 7 Schematic diagram of local autonomous time synchronization in an embodiment of the present invention;

[0080] Figure 8 Schematic diagram of local manual time synchronization in an embodiment of the present invention. Detailed implementation manners

[0081] Next, the preferred embodiments of the present invention will be specifically described in conjunction with the accompanying drawings. The accompanying drawings form a part of this application and are used together with the embodiments of the present invention to explain the principles of the present invention, rather than to limit the scope of the present invention.

[0082] A specific embodiment of the present invention, as Figure 1 shown, discloses a multi-source and multi-precision operating system time synchronization method, including the following steps:

[0083] Step S1, construct a special vehicle fleet, and build an in-vehicle embedded information platform for each special vehicle in the fleet. Among them, the platform includes an in-vehicle computer, a 5G-CPE, a timekeeping and time-sending device, a Beidou device, and multiple in-vehicle terminals. The in-vehicle computer includes multiple computing and processing modules;

[0084] Step S2, set the time synchronization priority of each in-vehicle node for each special vehicle, and each of the in-vehicle nodes multicasts its own IP address, CPU main frequency, time synchronization priority, and MAC address ID into the node resource pool; the in-vehicle nodes include multiple of the in-vehicle terminals and multiple of the computing and processing modules;

[0085] Step S3: Each special vehicle elects each on-vehicle node based on the CPU main frequency and MAC address ID in the node resource pool to obtain a monitoring node. The monitoring node establishes communication with the timekeeping and time-synchronization device, and judges the working state of the timekeeping and time-synchronization device and the valid state of the current calendar information;

[0086] Step S4: The monitoring node of each special vehicle determines the time synchronization mode based on the working state of the timekeeping and time-synchronization device and the valid state of the current calendar information, and performs time synchronization on each on-vehicle node based on the time synchronization mode and the time synchronization priority.

[0087] The said Step S1 includes:

[0088] Assign a unique vehicle ID to each special vehicle in the fleet for indexing, determine the leading vehicle and the following vehicles. The vehicle ID of the leading vehicle is the smallest, and the vehicle IDs of the following vehicles increase in sequence;

[0089] Each on-vehicle node and device in the on-vehicle embedded information platform of each special vehicle are connected through Ethernet;

[0090] The Beidou device will time the timekeeping and time-synchronization device with the high-precision time of day TOD obtained by receiving Beidou satellite signals;

[0091] Each special vehicle in the fleet conducts 5G cellular network connection based on the 5G-CPE;

[0092] Both the on-vehicle terminal and the computing and processing module adopt the domestic openEuler operating system; the on-vehicle terminal adopts the Rockchip RK3588 CPU processor; the computing and processing module adopts the Feiteng FD-2000 / 8-core CPU processor.

[0093] Exemplarily, the special vehicle in the present invention is a forest fire truck or a rescue and emergency vehicle. A fleet includes multiple special vehicles. As Figure 2 shown, it is the deployment structure diagram of the embedded information platform of a special vehicle in multi-vehicle cooperation. Exemplarily, the hardware environment of a special vehicle includes: 1 on-vehicle computer, 3 on-vehicle terminals, 1 timekeeping and time-synchronization device and 1 Beidou device. Each node in the vehicle is connected through Ethernet; and a 5G-CPE router, which accesses the switch inside the vehicle to provide in-vehicle network access for the special vehicle; the on-vehicle computer mainly includes computing and processing modules 1, 2, 3, a power module, and a network switching module; there is one set of on-vehicle timekeeping and time-synchronization device and Beidou device each. The computing and processing module and the on-vehicle terminal are collectively referred to as on-vehicle nodes.

[0094] The computing and processing modules 1, 2, and 3 adopt the domestic openEuler operating system and the domestic Feiteng FD-2000 / 8-core CPU processor; according to the equipment requirements, it is mainly divided into three types of terminals: the operation command vehicle-mounted terminal, the operation operation vehicle-mounted terminal, and the driver vehicle-mounted terminal. The vehicle-mounted terminal adopts the domestic openEuler operating system and the domestic Rockchip RK3588 CPU processor.

[0095] The function of step S1 is to build an in-vehicle embedded information platform architecture for the special vehicle fleet, enable the in-vehicle nodes to work in coordination with the Beidou device and the timekeeping and time service device through Ethernet connection, and realize vehicle-to-vehicle networking by using 5G-CPE, laying a foundation for subsequent time synchronization and multi-vehicle collaborative synchronization of the system time.

[0096] Step S2 includes steps S21 - S22.

[0097] In step S21, the time synchronization priority of each in-vehicle node is set for each special vehicle.

[0098] Define a time synchronization priority configuration file, deploy the priority configuration file to the vehicle-mounted terminal and the computing and processing module, and complete the priority setting of each type of vehicle-mounted terminal and the computing and processing module.

[0099] According to the specific actual usage requirements, the time synchronization priorities of various vehicle-mounted terminals are divided as shown in Table 1. The larger the priority value, the higher the priority level. Exemplarily, the time synchronization priority of the vehicle-mounted terminal is defined as: operation command vehicle-mounted terminal > operation operation vehicle-mounted terminal > driver vehicle-mounted terminal, and the time synchronization priorities of the vehicle-mounted terminals are all greater than the priorities of the computing and processing modules 1, 2, and 3 of the vehicle-mounted computer.

[0100] Table 1 Explanation of the time synchronization priority of in-vehicle nodes

[0101]

[0102]

[0103] In step S22, each in-vehicle node multicasts its own IP address, CPU main frequency, time synchronization priority, and MAC address ID into the node resource pool through UDP (User Datagram Protocol).

[0104] The fixed IP address of each in-vehicle node preset by the platform. Periodically, each in-vehicle node multicasts its own IP address, CPU main frequency, time synchronization priority, and MAC address ID into the node resource pool. Exemplarily, the period is 100 ms.

[0105] The node resource pool includes the IP addresses, CPU main frequencies, time synchronization priorities, MAC address IDs, and the most recent system time synchronization update time data of all in-vehicle nodes of the current vehicle.

[0106] The CPU main frequencies and MAC address IDs of each node provide election factors for subsequent monitoring node elections.

[0107] Step S3 includes steps S31 - S32.

[0108] Step S31: Each special vehicle elects monitoring nodes for each in-vehicle node based on the CPU main frequency and MAC address ID in the node resource pool.

[0109] As Figure 3 shown, the monitoring node election for each vehicle in the fleet. Each special vehicle elects monitoring nodes based on the Bully election algorithm for the CPU main frequency and MAC address ID, including:

[0110] Screen the in-vehicle node with the highest CPU main frequency as the monitoring candidate node. If the number of monitoring candidate nodes is 1, then this in-vehicle node is the monitoring node;

[0111] Otherwise, conduct an election based on the MAC address ID, and elect the in-vehicle node with the largest MAC address ID as the monitoring node, and the other in-vehicle nodes are elected as non-monitoring nodes;

[0112] If the monitoring node stops publishing election factors within a predetermined time period, reselect the monitoring node.

[0113] Since the MAC address IDs of each in-vehicle node in the in-vehicle network environment are unique, therefore, on the premise of consistent CPU main frequencies, a node with the largest MAC address ID can be elected as the monitoring node, and the other nodes are elected as non-monitoring nodes; Since the CPU main frequency of the Feiteng FD-2000 / 8-core CPU processor is higher than that of the Rockchip RK3588 CPU processor, most of the time the computing and processing module is elected as the monitoring node. This ensures the uniqueness of the monitoring node and simplifies the election logic. Electing the node with the largest MAC address ID as the monitoring node on the premise of consistent CPU main frequencies has obvious identification characteristics, which is convenient for system administrators to identify and locate. During the system management and maintenance process, quickly find the monitoring node through the MAC address ID, and perform corresponding configuration, monitoring, and troubleshooting work, improving the convenience and efficiency of management.

[0114] Based on the most recent system time synchronization update time in the node resource pool, judge the running state of the monitoring node. When the monitoring node stops periodically publishing election factors and the update exceeds the predetermined time period, re-elect the monitoring node. Exemplarily, the predetermined time period is 5 seconds.

[0115] The monitoring node frequently interacts with the timekeeping and time-synchronizing device. To reduce the network bandwidth pressure of special vehicles, this algorithm dynamically elects a monitoring node from the device nodes that need to be time-synchronized to conduct point-to-point network communication with the timekeeping and time-synchronizing device. This method can effectively improve the network resource utilization rate of special vehicles and is suitable for in-vehicle embedded environments with limited network resources.

[0116] Step S32: Establish communication between the monitoring node and the timekeeping and time-synchronizing device, and judge the working state of the timekeeping and time-synchronizing device and the valid state of the current calendar information.

[0117] The establishment of communication between the monitoring node and the timekeeping and time-synchronizing device includes:

[0118] First step: The monitoring node sends a first UDP heartbeat message to the fixed IP address and port number of the timekeeping and time-synchronizing device.

[0119] Second step: After receiving the first UDP heartbeat message, the timekeeping and time-synchronizing device responds by sending a second UDP heartbeat message and a UDP data message to the monitoring node; if the timekeeping and time-synchronizing device does not receive the first UDP heartbeat message within a continuous preset time period, return to the first step.

[0120] Third step: The monitoring node parses based on the received second UDP heartbeat message to judge the working state of the timekeeping and time-synchronizing device and whether the current calendar information is valid.

[0121] Among them, the UDP data message includes a sending timestamp.

[0122] The monitoring node actively sends a first UDP heartbeat message to the fixed IP address and port number of the timekeeping and time-synchronizing device. Exemplarily, the sending period is 1 second, and the UDP heartbeat message format follows the IEEE802.3 Ethernet IP / UDP encapsulation format. Exemplarily, the UDP heartbeat message includes: an IP packet header, a UDP packet header, a packet ID, a packet payload length, and a cycle count field, as shown in Table 2.

[0123] Table 2 First UDP Heartbeat Message Data Protocol

[0124]

[0125] The first UDP heartbeat message protocol, the message data is 40 bytes in length, including:

[0126] (1) The IP packet header, with a length of 20 bytes, follows the IP encapsulation format of TCP / IP, RFC1122, and RFC1123 protocols, mainly including the source IP address (the IP address of the monitoring node) and the destination IP address (the IP address of the timekeeping and time dissemination device).

[0127] (2) The UDP packet header, with a length of 8 bytes, follows the UDP encapsulation format of RFC768 protocol, mainly including the source port number (the port number of the monitoring node), the destination port number (the port number of the timekeeping and time dissemination device), length, checksum, etc.

[0128] (3) The packet ID, with a length of 4 bytes. Exemplarily, the ID of the first UDP heartbeat packet is 0x111222, which is used to identify the packet type.

[0129] (4) The packet payload length, with a length of 4 bytes, which is used to represent the length of the payload data.

[0130] (5) The cycle count, with a length of 4 bytes, which is used to count the number of times the monitoring node sends the first UDP heartbeat packet. The physical value range is [0, 4294967295], which is used to represent the number of heartbeats. When it reaches the maximum value of 4294967295, it will cycle back to 0.

[0131] After receiving the first UDP heartbeat packet sent by the monitoring node, the timekeeping and time dissemination device records the source IP address and source port number (the IP address and port number of the monitoring node) of the first UDP heartbeat packet. The timekeeping and time dissemination device responds to the source IP address and source port number by sending the second UDP heartbeat packet. Exemplarily, the period is 1 second, and the format of the second UDP heartbeat packet follows the IEEE802.3 Ethernet IP / UDP encapsulation format. Exemplarily, the second UDP heartbeat packet includes fields such as the IP packet header, UDP packet header, packet ID, packet payload length, cycle count, etc. The specific format is shown in Table 3. The monitoring node receives the second UDP heartbeat packet from the timekeeping and time dissemination device and confirms that the timekeeping and time dissemination device is online.

[0132] The timekeeping and time dissemination device encapsulates the working status data of the timekeeping and time dissemination device into a UDP data packet and sends the working status message data of the timekeeping and time dissemination device to the source IP address and source port number. The format of the working status message of the timekeeping and time dissemination device follows the IEEE802.3 Ethernet IP / UDP encapsulation format. Exemplarily, the second UDP heartbeat packet includes: IP packet header, UDP packet header, packet ID, packet payload length, clock synchronization status of the timekeeping and time dissemination device, current calendar information validity status field. The specific message format is shown in Table 3.

[0133] Table 3 Second UDP heartbeat packet data protocol

[0134]

[0135]

[0136] The second UDP heartbeat message, with a total message data length of 40 bytes, includes:

[0137] (1) IP message header, 20 bytes in length, following the IP encapsulation format of TCP / IP, RFC1122, and RFC1123 protocols, including the source IP address (the IP address of the timekeeping and time-giving device) and the destination IP address (the IP address of the monitoring node);

[0138] (2) UDP message header, 8 bytes in length, following the UDP encapsulation format of RFC768 protocol, mainly including the source port number (the port number of the timekeeping and time-giving device), the destination port number (the port number of the monitoring node), length, and checksum;

[0139] (3) Message ID, 4 bytes in length, and the ID of the second UDP heartbeat message is 0x222333, which is used to identify the message type;

[0140] (4) Message payload length, 4 bytes in length, which is used to represent the length of the payload data;

[0141] (5) Timekeeping and time-giving device clock synchronization status, 1 byte in length, with the physical value range: {0, 1, 2, 3, 4}, where 0 indicates non-synchronized, 1 indicates time alignment in progress, 2 indicates synchronized, 3 indicates timekeeping, and 4 indicates RTC (Real-Time Clock) time-giving;

[0142] 0: Non-synchronized state, indicating that the timekeeping and time-giving device is currently not synchronized with the time source of the Beidou device;

[0143] 1: Time alignment in progress state, indicating that the timekeeping and time-giving device is performing a synchronization operation with the time source of the Beidou device but has not completed the synchronization;

[0144] 2: Synchronized state, indicating that the timekeeping and time-giving device has successfully synchronized with the time source of the Beidou device, and the current time is the most accurate;

[0145] 3: Timekeeping state, indicating that the timekeeping and time-giving device relies on its own clock source (such as an oven-controlled crystal oscillator, rubidium atomic clock, etc.) to maintain the accuracy of time in the case of losing the time source of the Beidou device;

[0146] 4: RTC time-giving state, indicating that the timekeeping and time-giving device uses the RTC module to provide time information, which is usually used to provide basic time functions for the timekeeping and time-giving device in the case of not having a time source from the Beidou device.

[0147] (6) Current calendar information validity status, 1 byte in length, with the physical value range: {0, 1}, where 0 indicates invalid and 1 indicates valid; The reserved bits occupy 2 bytes;

[0148] The monitoring node analyzes the second UDP heartbeat packet to judge the working state of the timekeeping and time-synchronizing device; if the timekeeping and time-synchronizing device does not receive the first UDP heartbeat packet sent by the monitoring node for 10 consecutive seconds, it is determined that the connection communication is interrupted. At this time, the timekeeping and time-synchronizing device terminates the sending of all UDP data packets and the second UDP heartbeat packet, stops receiving all UDP data packets, and restarts the communication connection between the monitoring node and the timekeeping and time-synchronizing device.

[0149] The monitoring node parses the valid data of the working state calendar information of the timekeeping and time-synchronizing device from the UDP data of the obtained timekeeping and time-synchronizing device.

[0150] Step S4, specifically.

[0151] Such as Figure 4 As shown, the step S4 includes:

[0152] If the working states of the timekeeping and time-synchronizing devices of all vehicles in the vehicle fleet are all synchronized or the working states of the timekeeping and time-synchronizing devices of some vehicles are synchronized, and the current calendar information is valid, a high-precision PTP time synchronization mode is adopted to perform high-precision time synchronization on each on-vehicle node based on the clock source of the timekeeping and time-synchronizing device.

[0153] If the working state of the timekeeping and time-synchronizing device is time synchronization in progress, timekeeping or RTC time synchronization, and the current calendar information is valid, a reference vehicle is selected through vehicle election based on the in-vehicle 5G cellular network of the 5G-CPE, and a low-precision PTP time synchronization mode is adopted to perform low-precision time synchronization on the on-vehicle nodes in the vehicle fleet based on the clock source of the timekeeping and time-synchronizing device of the reference vehicle.

[0154] If the working states of the timekeeping and time-synchronizing devices of all vehicles in the vehicle fleet are all unsynchronized, the monitoring node of the leading vehicle performs UDP multicast and adopts the local autonomous time synchronization mode. The on-vehicle node of each vehicle in the vehicle fleet uses the calendar information of the monitoring node of the leading vehicle as the clock source, and based on the time synchronization priority of the on-vehicle node, uses the in-vehicle 5G cellular network of the 5G-CPE to perform low-precision time synchronization on the on-vehicle nodes of all vehicles in the vehicle fleet.

[0155] When the high-precision or low-precision PTP time synchronization mode, or the local autonomous time synchronization mode is not received within a certain time period, each on-vehicle node adopts the local manual time synchronization mode, and based on the system time of the monitoring node of the leading vehicle set manually, performs low-precision time synchronization on the system time of other on-vehicle nodes of the leading vehicle and the on-vehicle nodes of other vehicles in the vehicle fleet.

[0156] Exemplarily, the priority definitions of four modes, namely high-precision PTP time synchronization, low-precision PTP time synchronization, local autonomous time synchronization, and manual time synchronization, are shown in Table 4. The higher the priority value, the higher the priority level.

[0157] Table 4 Explanation of Time Synchronization Mode Priorities

[0158] Mode Name Priority High-precision PTP Time Synchronization Mode 4 Low-precision PTP Time Synchronization Mode 3 Manual Time Synchronization Mode 2 Local Autonomous Time Synchronization Mode 1

[0159] Based on the different environmental states of the existing vehicle, multiple in-vehicle and vehicle-to-vehicle time synchronization modes are provided based on different in-vehicle time source information. High-precision PTP time synchronization is as Figure 5 shown.

[0160] If the working status of the timekeeping and time dissemination devices of all vehicles in the fleet is synchronized, and the current calendar information is valid, each vehicle uses the clock source of its own timekeeping and time dissemination device as a reference to perform high-precision PTP time synchronization on other in-vehicle nodes of the vehicle;

[0161] If the working status of the timekeeping and time dissemination devices of some vehicles is synchronized, and the current calendar information is valid, the vehicles with the working status of the timekeeping and time dissemination devices synchronized use the clock source of their own timekeeping and time dissemination devices as a reference to perform high-precision PTP time synchronization on other in-vehicle nodes of the vehicle; at the same time, for the vehicles with the working status of the timekeeping and time dissemination devices not synchronized, they use the system time of the monitoring node of the vehicle with the largest vehicle ID among the vehicles with the working status of the timekeeping and time dissemination devices synchronized as a reference, and perform high-precision PTP time synchronization on all in-vehicle nodes of the vehicle based on the 5G cellular network.

[0162] High-precision time synchronization of the system time of in-vehicle nodes is performed based on the high-precision PTP time synchronization mode of delay-request measurement as follows:

[0163] The timekeeping and time dissemination device serves as the PTP server, and the monitoring node serves as the PTP client;

[0164] The PTP server sends a Sync synchronization message to the PTP client and records the message sending time t1 at the same time;

[0165] The PTP client receives the Sync synchronization message and records the message reception time t2 at the same time;

[0166] The PTP server sends t1 in a Follow_Up follow-up delay message to the PTP client, and the PTP client parses out the time t1 after receiving the message;

[0167] The PTP client sends a Delay_Req delay request message to the PTP server, and synchronously records the time t3 when the Delay_Req delay request message is sent. The PTP server receives the message and records the received time t4.

[0168] The PTP server places the time t4 in the Delay_Resp delay response message and sends it to the PTP client. The PTP client receives this message and parses out t4. The PTP client obtains the time values t1, t2, t3, and t4.

[0169] The time deviation value Offset and the network link delay Delay between the PTP server and the client are calculated as follows:

[0170] t2 - t1 - Offset = Delay

[0171] t4 - (t3 - Offset) = Delay

[0172] It is calculated that:

[0173] Offset = [(t2 - t1) + (t3 - t4)] / 2

[0174] Delay = [(t2 - t1) + (t4 - t3)] / 2

[0175] The PTP client subtracts the Offset value from the local system time value based on the time deviation value Offset to obtain the synchronized time with the high-precision clock source of the PTP server, and synchronously updates the local system time of the monitoring node.

[0176] Based on the IEEE 1588V2 (PTP) protocol time synchronization method, high-precision PTP time synchronization of vehicle-mounted nodes is achieved. Based on the time synchronization mechanism of delay-request measurement, high-precision PTP time synchronization of the vehicle-mounted nodes of each vehicle is completed.

[0177] The timekeeping and time dissemination device broadcasts synchronization messages through Ethernet; the vehicle-mounted nodes respond to the synchronization messages; the timekeeping and time dissemination device sends delay response messages to each vehicle-mounted node, and each vehicle-mounted node calculates the network link delay and the time deviation value, and performs high-precision calibration on the local time of each device node.

[0178] The time synchronization mechanism based on delay-request measurement completes the time synchronization between the timekeeping and time dissemination device and the vehicle-mounted nodes of each vehicle. The specific process is as Figure 6 shown:

[0179] a) The PTP server synchronizes and sends a Sync message to the PTP client. The timekeeping and time - delivering device records the time t1 when the Sync message is sent. After receiving the Sync message, the PTP client records the reception time t2.

[0180] b) The PTP server sends the time t1 in a Follow_Up message to the PTP client. After receiving this message, the PTP client software parses out the time t1.

[0181] c) The PTP client sends a Delay_Req message to the PTP server. The timekeeping and time - delivering device records the time t3 when the Delay_Req message is sent. After receiving the message, the PTP server records the reception time t4.

[0182] d) The PTP server sends the time t4 in a Delay_Resp message to the PTP client. After receiving this message, the PTP client parses out t4. At this time, the PTP client has received the four time values t1, t2, t3, and t4 required for high - precision synchronization calculation, and then can calculate two key parameters: the time deviation value Offset and the network link delay Delay:

[0183] Based on the high - precision time synchronization of the PTP protocol, it can achieve higher precision than the traditional time - delivering methods through in - vehicle buses such as CAN and Ethernet. Its time - delivering precision reaches the sub - microsecond level, and it can meet the requirements of multi - vehicle cooperation with higher time - synchronization precision and complex operation tasks such as fire fighting and rescue that require unmanned vehicle cooperation and control.

[0184] If the working state of the timekeeping and time - delivering device is time - synchronization, time - keeping, or RTC time - delivering, enter the low - precision PTP time - synchronization mode.

[0185] In the low - precision PTP time - synchronization mode, each vehicle performs low - precision time synchronization on the system time of in - vehicle nodes as follows:

[0186] The vehicle election includes:

[0187] Find out the special vehicle whose timekeeping and time - delivering device is in the time - keeping state. If the number of vehicles in the time - keeping state is greater than 1, select the vehicle with the smaller vehicle ID value in the convoy as the reference vehicle;

[0188] Otherwise, find out the special vehicle whose timekeeping and time - delivering device is in the time - synchronization state. If the number of vehicles in the time - synchronization state is greater than 1, select the vehicle with the smaller vehicle ID value in the convoy as the reference vehicle;

[0189] Otherwise, find out the special vehicles whose timekeeping and time dissemination devices are in the RTC time dissemination state. If the number of vehicles in the RTC time dissemination state is greater than 1, select the vehicle with the smallest vehicle ID value in the convoy that is in the RTC time dissemination state as the reference vehicle;

[0190] Taking the clock source of the timekeeping and time dissemination device of the reference vehicle as the reference, perform time synchronization on other on-vehicle nodes in the reference vehicle;

[0191] At the same time, use the in-vehicle 5G cellular network of the 5G-CPE to perform low-precision time synchronization on the on-vehicle nodes of other vehicles in the convoy.

[0192] As Figure 7 shown, if the working states of the timekeeping and time dissemination devices of all vehicles in the convoy are not synchronized, the monitoring node of the leading vehicle performs UDP multicast in the local autonomous time synchronization mode.

[0193] Based on the local autonomous time synchronization mode, perform low-precision time synchronization on the system time of the on-vehicle nodes of each vehicle in the convoy, including:

[0194] Each on-vehicle node in the leading vehicle is based on the system time and time synchronization priority information periodically UDP multicast by other on-vehicle nodes in the node resource pool; select the system time of the on-vehicle node with the highest time synchronization priority, and judge the validity of the selected system time based on the preset effective time threshold. If it is valid, update the system time of this on-vehicle node to the selected system time;

[0195] Take the system time of the monitoring node of the leading vehicle as the clock source with the highest priority, and use the in-vehicle 5G cellular network of the 5G-CPE to synchronize and update the system time of the on-vehicle nodes of other vehicles in the convoy to the system time of the monitoring node of the leading vehicle.

[0196] The on-vehicle node multicasts its system time and time synchronization priority information at a period of 100 ms, and judges the validity of the selected system time according to the preset effective time threshold information. When the selected system time information is earlier than the threshold information, it is judged as invalid and the processing ends. Otherwise, it is judged as valid time information and the subsequent steps are processed; Exemplarily, the effective time threshold is set to 00:00:00:00 on January 1, 2023.

[0197] When the working state of the timekeeping and time dissemination device is abnormal and high-precision time synchronization information cannot be received, in order to ensure the normal operation mode of the special vehicle mission, provide an in-vehicle and in-vehicle time dissemination mechanism for the local manual time synchronization mode.

[0198] As Figure 8As shown in the figure, based on the system time of the monitoring node of the leading vehicle manually set in the local manual time synchronization mode, low-precision time synchronization is performed on the system time of the on-vehicle nodes of the leading vehicle and the on-vehicle nodes of other vehicles in the vehicle fleet, including:

[0199] Use the time modification interface of the operation command on-vehicle terminal of the leading vehicle to set the system time of the monitoring node of the leading vehicle;

[0200] Based on a preset effective time threshold, judge the effectiveness of the system time of the monitoring node of the leading vehicle set;

[0201] If it is effective, synchronize the system time of other on-vehicle nodes of the leading vehicle and the on-vehicle nodes of other vehicles in the vehicle fleet to the system time of the monitoring node of the leading vehicle.

[0202] The local manual time synchronization mode of the on-vehicle node receives the time information set by the user through the time modification interface of the operation command on-vehicle terminal, and judges the time effectiveness according to the effective time threshold information. When the modified time information is earlier than the threshold information, it is judged as invalid and the process ends. Otherwise, it is judged as valid time information.

[0203] When the timekeeping and time dissemination device is in an abnormal working state, high-precision time synchronization information cannot be received and the local time of each on-vehicle terminal is inconsistent with the actual time. In order to ensure that the vehicle clock information can be manually modified in time, a local manual time synchronization method is provided, that is, the user manually sets the system time of the monitoring node of the leading vehicle through the time modification interface of the operation command on-vehicle terminal. On the premise that the set system time is effective, the synchronous time update of other on-vehicle terminals and the calculation processing module of the on-vehicle computer in the leading vehicle, as well as the synchronous time update of the on-vehicle terminals and the calculation processing module of other vehicles, are completed to achieve the same time of each on-vehicle node.

[0204] In summary, a multi-source and multi-precision operating system time synchronization method according to an embodiment of the present invention has the following beneficial effects:

[0205] 1. The operating system time synchronization method in the present invention is a customized R & D based on the domestic openEuler operating system and domestic chips, which is autonomous and controllable; the method of the present invention not only improves the performance and reliability of the on-vehicle embedded information platform of special vehicles, but also ensures the autonomy, controllability and security of the platform, meeting the multi-vehicle cooperation and unmanned vehicle cooperation operation requirements of special vehicles in complex environments;

[0206] 2. The present invention adopts a high-precision PTP time synchronization mode. Based on the high-precision clock source of the timekeeping and time dissemination device, through precise timestamp exchange and deviation calculation, it can achieve high-precision time synchronization at the sub-microsecond level. Compared with the traditional method that can only achieve millisecond-level or second-level precision, it greatly improves the time synchronization precision, meets the higher requirements for time synchronization precision under the networked architecture of the new special vehicle electronic system, and provides reliable time guarantee for complex operation tasks participated by multiple vehicles in cooperation;

[0207] 3. The present invention adopts a multi-source time synchronization strategy, breaks through the limitation of the traditional single time source, and integrates multiple time sources. It adopts a multi-source time synchronization strategy with four modes: high-precision PTP time synchronization mode, low-precision PTP time synchronization mode, local autonomous time synchronization mode, and local manual time synchronization mode. The multi-source time synchronization strategy enhances the adaptability and robustness of the system, ensuring effective time synchronization under different environments and device states;

[0208] 4. The present invention is based on the Bully election algorithm, comprehensively considering the CPU main frequency and MAC address to elect the monitoring node. First, the node with the highest CPU main frequency is selected as the monitoring candidate node. If the number of candidate nodes is greater than 1, the node with the largest MAC address value is elected as the monitoring node based on the MAC address. This election mechanism can select a monitoring node with better performance and stronger uniqueness, improving the rationality and accuracy of the monitoring node election. At the same time, when the monitoring node stops publishing the election factor within a predetermined time period, it can re-select the monitoring node in a timely manner, ensuring the stable operation of the platform in case of node failure or abnormality;

[0209] 5. The present invention uses 5G-CPE to connect the in-plant 5G cellular network, achieving high-speed, low-latency, and high-reliability communication for the special vehicle fleet. The high-bandwidth and low-latency characteristics of the 5G network support the rapid transmission and real-time response of a large amount of data, ensuring the real-time and reliability of vehicle-to-vehicle cooperative control; mobility management and anti-interference technologies ensure the communication stability of vehicles under high-speed movement and complex electromagnetic environments. Through seamless integration with the in-vehicle embedded information platform, 5G-CPE supports multi-vehicle cooperation and time synchronization, improving the operation efficiency and safety of the fleet. At the same time, the encrypted communication and identity authentication mechanism of the 5G network enhance the security of the system, ensuring the confidentiality and integrity of data transmission;

[0210] 6. The present invention can flexibly adjust the time synchronization mode according to the working state of the timekeeping and time dissemination device and the valid state of the current calendar information. When the working state of the timekeeping and time dissemination device changes, the monitoring node can promptly judge and switch to the corresponding time synchronization mode, such as switching from the high-precision PTP mode to the low-precision PTP mode or the local autonomous time synchronization mode. This flexible response mechanism enables the in-vehicle embedded information platform to quickly adapt to changes in the device state, ensuring the continuity and stability of time synchronization, avoiding time synchronization interruption caused by device failures or unstable signals, and ensuring the efficient coordination of special vehicles in various operation tasks and the accuracy of information transmission.

[0211] The above is only a preferred specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed by the present invention should be covered by the protection scope of the present invention.

Claims

1. A multi-source and multi-precision operating system time synchronization method, characterized in that, The steps are as follows: Step S1: Construct a special vehicle fleet and build an in-vehicle embedded information platform for each special vehicle in the fleet. Among them, the platform includes an in-vehicle computer, a 5G-CPE, a timekeeping and timing device, a Beidou device, and multiple in-vehicle terminals. The in-vehicle computer includes multiple computing and processing modules; Step S2: Set the time synchronization priority of each in-vehicle node for each special vehicle. Each of the in-vehicle nodes multicasts its own IP address, CPU main frequency, time synchronization priority, and MAC address ID into the node resource pool through UDP. The in-vehicle nodes include multiple of the in-vehicle terminals and multiple of the computing and processing modules; Step S3: Each special vehicle elects each in-vehicle node based on the CPU main frequency and MAC address ID in the node resource pool to obtain a monitoring node. The monitoring node establishes communication with the timekeeping and timing device to judge the working state of the timekeeping and timing device and the valid state of the current calendar information; Step S4: The monitoring node of each special vehicle determines the time synchronization mode based on the working state of the timekeeping and timing device and the valid state of the current calendar information, and performs time synchronization on each of the in-vehicle nodes based on the time synchronization mode and the time synchronization priority; The step S4 includes: If the working states of the timekeeping and timing devices of all vehicles in the fleet are all synchronized or the working states of the timekeeping and timing devices of some vehicles are synchronized, and the current calendar information is valid, a high-precision PTP time synchronization mode is adopted to perform high-precision time synchronization on each in-vehicle node based on the clock source of the timekeeping and timing device; If the working state of the timekeeping and timing device is time alignment, timekeeping, or RTC timing, and the current calendar information is valid, a reference vehicle is obtained through vehicle election based on the in-vehicle 5G cellular network of the 5G-CPE, and a low-precision PTP time synchronization mode is adopted to perform low-precision time synchronization on the in-vehicle nodes in the fleet based on the clock source of the timekeeping and timing device of the reference vehicle; If the working states of the timekeeping and timing devices of all vehicles in the fleet are all asynchronous, the monitoring node of the leading vehicle performs UDP multicast and adopts the local autonomous time synchronization mode. The in-vehicle nodes of each vehicle in the fleet use the calendar information of the monitoring node of the leading vehicle as the clock source, and use the in-vehicle 5G cellular network of the 5G-CPE to perform low-precision time synchronization on the in-vehicle nodes of all vehicles in the fleet based on the time synchronization priority of the in-vehicle nodes; When the high-precision or low-precision PTP time synchronization mode, or the local autonomous time synchronization mode is not received within a certain time period, each in-vehicle node adopts the local manual time synchronization mode, and based on the system time of the monitoring node of the leading vehicle set manually, performs low-precision time synchronization on the other in-vehicle nodes of the leading vehicle and the in-vehicle nodes of other vehicles in the fleet.

2. The method according to claim 1, wherein Each special vehicle elects the monitoring node based on the CPU main frequency and MAC address ID through the Bully election algorithm, including: Screen the in-vehicle node with the highest CPU main frequency as the monitoring candidate node. If the number of monitoring candidate nodes is 1, then this in-vehicle node is the monitoring node; Otherwise, an election is carried out based on the MAC address ID, and the vehicle-mounted node with the largest MAC address ID is elected as the monitoring node, and other vehicle-mounted nodes are elected as non-monitoring nodes; If the monitoring node stops publishing the election factor within a predetermined time period, a new monitoring node is reselected.

3. The method according to claim 1, wherein The monitoring node establishes communication with the timekeeping and time synchronization device, including: First step, the monitoring node sends a first UDP heartbeat message to the fixed IP address and port number of the timekeeping and time synchronization device; Second step, after receiving the first UDP heartbeat message, the timekeeping and time synchronization device responds to the monitoring node by sending a second UDP heartbeat message and a UDP data message; if the timekeeping and time synchronization device does not receive the first UDP heartbeat message within a continuous preset time period, return to the first step; Third step, the monitoring node parses based on the received second UDP heartbeat message to determine the working state of the timekeeping and time synchronization device and whether the current calendar information is valid; Among them, the UDP data message includes a transmission timestamp.

4. The method according to claim 1, wherein If the working states of the timekeeping and time synchronization devices of all vehicles in the vehicle fleet are all synchronized, and the current calendar information is valid, each vehicle uses the clock source of its own timekeeping and time synchronization device as a reference to perform high-precision PTP time synchronization on other vehicle-mounted nodes of the vehicle; If the working states of the timekeeping and time synchronization devices of some vehicles are synchronized, and the current calendar information is valid, the vehicles with the working states of the timekeeping and time synchronization devices being synchronized use the clock source of their own timekeeping and time synchronization devices as a reference to perform high-precision PTP time synchronization on other vehicle-mounted nodes of the vehicle; at the same time, for the vehicles whose working states of the timekeeping and time synchronization devices are not synchronized, based on the system time of the monitoring node of the vehicle with the largest ID of the vehicle whose working state of the timekeeping and time synchronization device is synchronized, high-precision PTP time synchronization is performed on all vehicle-mounted nodes of the vehicle based on the 5G cellular network.

5. The method according to claim 4, wherein High-precision time synchronization of the system time of vehicle-mounted nodes is performed based on the high-precision PTP time synchronization mode of delay-request measurement, as follows: The timekeeping and time synchronization device serves as the PTP server, and the monitoring node serves as the PTP client; The PTP server sends a Sync synchronization message to the PTP client, and at the same time records the message sending time t1; The PTP client receives the Sync synchronization message and records the message reception time t2 at the same time; The PTP server sends t1 in the Follow_Up follow-up delay message to the PTP client, and the PTP client parses out the time t1 after receiving the message; The PTP client sends a Delay_Req delay request message to the PTP server, and synchronously records the time t3 when the Delay_Req delay request message is sent. The PTP server receives the message and records the received time t4; The PTP server sends the time t4 in the Delay_Resp delay response message to the PTP client, and the PTP client parses out t4 after receiving this message; the PTP client obtains the time values t1, t2, t3, and t4; The time deviation value Offset and network link delay Delay between the PTP server and the client are calculated as follows: t2 - t1 - Offset = Delay t4 - (t3 - Offset) = Delay It is calculated that: Offset = [(t2 - t1) + (t3 - t4)] / 2 Delay = [(t2 - t1) + (t4 - t3)] / 2 Based on the time deviation value Offset, the PTP client subtracts the Offset value from the local system time value to obtain the synchronized time with the high-precision clock source of the PTP server, and synchronously updates the local system time of the monitoring node.

6. The method according to claim 1, wherein In the low-precision PTP time synchronization mode, each vehicle performs low-precision time synchronization on the system time of the vehicle-mounted node as follows: The vehicle election includes: Find out the special vehicle whose timekeeping and time-giving device is in the timekeeping state. If the number of vehicles in the timekeeping state is greater than 1, select the vehicle with the smaller vehicle ID value in the convoy that is in the timekeeping state as the reference vehicle; Otherwise, find out the special vehicle whose timekeeping and time-giving device is in the time-synchronizing state. If the number of vehicles in the time-synchronizing state is greater than 1, select the vehicle with the smaller vehicle ID value in the convoy that is in the time-synchronizing state as the reference vehicle; Otherwise, find out the special vehicle whose timekeeping and time-giving device is in the RTC time-giving state. If the number of vehicles in the RTC time-giving state is greater than 1, select the vehicle with the smaller vehicle ID value in the convoy that is in the RTC time-giving state as the reference vehicle; Based on the clock source of the timekeeping and time-giving device of the reference vehicle, perform time synchronization on other vehicle-mounted nodes in the reference vehicle; At the same time, use the in-vehicle 5G cellular network of the 5G-CPE to perform low-precision time synchronization on the vehicle-mounted nodes of other vehicles in the convoy.

7. The method according to claim 1, characterized in that Performing low-precision time synchronization on the system time of the vehicle-mounted nodes of each vehicle in the convoy based on the local autonomous time synchronization mode includes: Each vehicle-mounted node in the leading vehicle, based on the system time and time synchronization priority information periodically UDP multicast by other vehicle-mounted nodes in the node resource pool, selects the system time of the vehicle-mounted node with the highest time synchronization priority, and judges the validity of the selected system time based on a preset effective time threshold. If it is valid, update the system time of the local vehicle-mounted node to the selected system time; Take the system time of the monitoring node of the leading vehicle as the clock source with the highest priority, and use the in-vehicle 5G cellular network of the 5G-CPE to synchronously update the system time of the vehicle-mounted nodes of other vehicles in the convoy to the system time of the monitoring node of the leading vehicle.

8. The method according to claim 1, wherein Based on the local manual time synchronization mode, perform low-precision time synchronization on the system time of the vehicle-mounted nodes of the leading vehicle and the vehicle-mounted nodes of other vehicles in the convoy based on the system time of the monitoring node of the leading vehicle manually set, including: Use the time modification interface of the operation command vehicle-mounted terminal of the leading vehicle to set the system time of the monitoring node of the leading vehicle; Judge the validity of the system time of the monitoring node of the leading vehicle set based on a preset effective time threshold; If valid, synchronize the system time of other on-vehicle nodes of the leading vehicle and the on-vehicle nodes of other vehicles in the vehicle fleet to the system time of the monitoring node of the leading vehicle.

9. The method according to any one of claims 1-8, characterized in that, The step S1 includes: Assign a unique vehicle ID to each special vehicle in the vehicle fleet for indexing to determine the leading vehicle and the following vehicles. The vehicle ID of the leading vehicle is the smallest, and the vehicle IDs of the following vehicles increase in sequence. Each on-vehicle node and device in the on-vehicle embedded information platform of each special vehicle are connected through Ethernet. The Beidou device provides the high-precision time of day (TOD) obtained by receiving Beidou satellite signals to the timekeeping and timing device. Each special vehicle in the vehicle fleet makes a 5G cellular network connection based on the 5G-CPE. Both the on-vehicle terminal and the computing and processing module use the domestic openEuler operating system; the on-vehicle terminal uses a Rockchip RK3588 CPU processor; the computing and processing module uses a Feiteng FD-2000 / 8-core CPU processor.

Citation Information

Patent Citations

  • Wireless sensor network time synchronization method and device based on error statistics

    CN101087219A

  • Network port PTP time service function extension device and extension method

    CN114629586A