Time synchronization method and apparatus, and vehicle
Patent Information
- Application Number
- PCT/CN2025/078691
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2025-02-24
- Publication Date
- 2026-08-27
Smart Images

Figure CN2025078691_27082026_PF_FP_ABST
Abstract
Description
Time synchronization methods, devices and vehicles Technical Field
[0001] This application relates to the field of communication technology, and more specifically, to a time synchronization method, apparatus, and vehicle. Background Technology
[0002] With the rapid development of automotive intelligence, the level of driving automation is constantly improving. Key technologies for vehicle intelligence, such as autonomous driving domains, real-time high-precision map display on large screens, real-time information interaction between vehicles and road side units (RSUs), multi-device collaboration or data fusion functions, or the analysis and fault location of log information collected from different network devices, all require precise time synchronization under the whole-vehicle architecture.
[0003] Currently, a vehicle contains multiple electronic control units (ECUs). Each ECU's clock timing module works independently. Due to differences in manufacturers and their product technical requirements, the clock drift of each ECU is not the same, and there are also slight differences in system time and time frequency.
[0004] Therefore, how to reduce the time deviation between various ECUs, thereby enabling the coordinated operation of various intelligent systems within the vehicle, has become an urgent problem to be solved. Summary of the Invention
[0005] This application provides a clock synchronization method, apparatus, and vehicle that can adjust the packet transmission frequency of sending time synchronization messages to each ECU, thereby improving link bandwidth and utilization of internal processing resources while ensuring low time deviation between ECUs.
[0006] Firstly, a clock synchronization method is provided, which can be executed by a vehicle, or by a chip or circuitry used in the vehicle. Specifically, the method can be executed by the vehicle's computing platform. The following explanation uses the execution of this method by the first master node as an example.
[0007] The method includes: sending a first time synchronization message to a first slave node based on a first frequency, the first time synchronization message including a first local time of a first master node; receiving a deviation feedback message from the first slave node, the deviation feedback message indicating a time deviation between a second local time and a first local time of the first slave node; determining a second frequency for sending the first time synchronization message based on the time deviation; and sending the first time synchronization message to the first slave node based on the second frequency.
[0008] In the above technical solution, adjusting the packet sending frequency of time synchronization messages based on the time deviation reported by the slave node can reduce the time deviation between the master and slave nodes. Furthermore, it helps improve the ease of use of the time synchronization function, reducing the consumption of link bandwidth and equipment processing resources while achieving the target time synchronization accuracy, saving the manpower costs required for debugging the packet sending frequency, and avoiding performance waste.
[0009] In conjunction with the first aspect, in some implementations of the first aspect, determining a second frequency for sending the first time synchronization message based on the time deviation includes: determining that the second frequency is less than the first frequency when the time deviation is less than the deviation threshold; or, determining that the second frequency is greater than the first frequency and less than the third frequency when the time deviation is greater than the deviation threshold, wherein the third frequency is the packet sending frequency of the first master node sending the first time synchronization message to the first slave node in the first time period, the first time period is before the second time period, and the time interval between the end time of the first time period and the start time of the second time period is less than or equal to the duration threshold, and the second time period is the time period in which the first master node sends the first time synchronization message to the first slave node at the first frequency.
[0010] In the above technical solution, adjusting the packet sending frequency using the above method helps to obtain the optimal packet sending frequency that meets the time accuracy as soon as possible.
[0011] In conjunction with the first aspect, in some implementations of the first aspect, the method further includes: sending a second frequency to the global master node so that the global master node can obtain the packet transmission frequency corresponding to the first time domain to which the first slave node belongs.
[0012] In some implementations, the second frequency is the optimal packet transmission frequency at which the first master node sends time synchronization messages to the first time domain. The optimal packet transmission frequency can be understood as the frequency at which the time deviation between the second local time and the first local time of the first slave node converges to the optimal packet transmission frequency. More specifically, convergence of the time deviation to the optimal frequency can be understood as follows: after multiple adjustments to the packet transmission frequency, the time deviation remains less than or equal to a deviation threshold for several consecutive packet transmission cycles.
[0013] In some implementations, the first master node is also used to complete time synchronization of one or more slave nodes in the second time domain. The optimal packet transmission frequency of the first master node sending time synchronization messages to the first time domain may be different from the optimal packet transmission frequency of the first master node sending time synchronization messages to the second time domain.
[0014] It should be noted that at least one slave node in each time domain communicates with the master node through a communication link to complete time synchronization. In other words, the master node can broadcast a time synchronization message to at least one slave node in a time domain to complete time synchronization.
[0015] In the above technical solution, after the global master node obtains and stores the optimal packet sending frequency of the first time domain, when the first master node fails, the global master node can directly send time synchronization messages to the slave nodes in the first time domain to avoid time synchronization failure between the first time domain and the global master node. This helps to improve the overall time synchronization success rate of the time synchronization system and the robustness of the time synchronization system.
[0016] In conjunction with the first aspect, in some implementations of the first aspect, the time deviation corresponding to the second frequency is less than or equal to the deviation threshold.
[0017] In some implementations, the time deviation corresponding to the second frequency refers to the time deviation determined by the first slave node based on the first time synchronization message sent by the first master node based on the second frequency.
[0018] In conjunction with the first aspect, in some implementations of the first aspect, the method further includes: receiving a first fault feedback message from a first slave node, the first fault feedback message indicating that the first slave node has lost synchronization; when the time management module of the first master node is abnormal, sending a second fault feedback message to the global master node, the second fault feedback message indicating that the time management module of the first master node is abnormal, the time management module being used to send a first time synchronization message to the first slave node.
[0019] The first slave node losing synchronization can be understood as the first slave node failing to synchronize its time. For example, the first slave node does not receive the first time synchronization message in n packet sending cycles (where n is a value from 3 to 5, or it can be other values); or, although the first slave node can receive the first time synchronization message, the time deviation between the local time of the first slave node and the local time of the first master node is greater than or equal to the deviation threshold within a tolerable period of time.
[0020] In some implementations, the frame structure and content of the second fault feedback message are the same as those of the first fault feedback message.
[0021] In the above technical solution, when the first master node itself malfunctions and is unable to send the first time synchronization message to the first slave node, the first master node sends a second fault feedback message to the global master node, so that the global master node can directly send the time synchronization message to the first slave node, thereby avoiding the failure of time synchronization between the first time domain and the global master node, which helps to improve the time synchronization success rate and robustness of the time synchronization system.
[0022] In conjunction with the first aspect, in some implementations of the first aspect, the method further includes: receiving a first fault feedback message from a first slave node, the first fault feedback message indicating that the first slave node has lost synchronization, the first fault feedback message also including a time deviation between a second local time and a first local time; when the communication link between the first slave node and the first master node is normal, determining the packet transmission frequency for sending a first time synchronization message based on the time deviation.
[0023] In the above technical solution, when the first slave node loses synchronization, the first master node adjusts the packet sending frequency of time synchronization messages based on the time deviation reported by the first slave node, which helps the first slave node to restore time synchronization as soon as possible and improves the self-healing capability of the entire time synchronization network.
[0024] In conjunction with the first aspect, in some implementations of the first aspect, the frequency of sending the first time synchronization message is adjusted according to the time deviation, including: when the deviation threshold is less than the time deviation, sending the first time synchronization message based on the initial reference frequency.
[0025] For example, the initial reference frequency can be the packet transmission frequency preset by the system for sending the first time synchronization message. For instance, the initial reference frequency can be manually configured. In some scenarios, the initial reference frequency and the aforementioned first frequency can be the same frequency.
[0026] In some implementations, after sending the first time synchronization message based on the initial packet transmission frequency (e.g., the first frequency), if the time deviation corresponding to the first slave node is less than or equal to the deviation threshold, the first master node switches to sending the first time synchronization message using the optimal packet transmission frequency (e.g., the second frequency) corresponding to the first slave node. This allows for rapid restoration of the first slave node's time synchronization capability while avoiding continuous occupation of network resources.
[0027] Secondly, a clock synchronization method is provided, which can be executed by a vehicle, or by a chip or circuitry used in the vehicle. Specifically, the method can be executed by the vehicle's ECU. The following explanation uses the example of the method being executed by a first slave node.
[0028] The method includes: receiving a first time synchronization message from a first master node, the first time synchronization message including a first local time of the first master node; determining the time deviation between a second local time of a first slave node and the first local time based on the first time synchronization message; and sending a deviation feedback message to the first master node, the deviation feedback message indicating the time deviation.
[0029] In the above technical solution, the time deviation between the local time and the local time of the first master node is determined based on the time synchronization message sent by the first master node, and the deviation is fed back to the first master node. This helps the first master node to adjust the packet sending frequency of the time synchronization message, thereby reducing the occupation of link bandwidth and equipment processing resources while achieving the time synchronization accuracy target, saving the manpower cost required to debug the packet sending frequency, and avoiding performance waste.
[0030] In conjunction with the second aspect, in some implementations of the second aspect, the method further includes: sending a first fault feedback message to the first master node, the first fault feedback message indicating that the first slave node has lost synchronization.
[0031] In conjunction with the second aspect, in some implementations of the second aspect, the first fault feedback message also includes the time deviation between the second local time and the first local time.
[0032] In conjunction with the second aspect, in some implementations of the second aspect, the method further includes: receiving a second time synchronization message from a global master node, the second time synchronization message including a clock reference.
[0033] In the above technical solution, time synchronization is completed based on the time synchronization message sent by the global master node, which can reduce the impact of the failure of the first master node on the time synchronization of the first slave node itself, and help improve the overall time synchronization rate of the time synchronization system and the robustness of the time synchronization system.
[0034] In conjunction with the second aspect, in some implementations of the second aspect, receiving the first time synchronization message from the first master node includes: receiving the first time synchronization message based on the second frequency.
[0035] Thirdly, a clock synchronization method is provided, which can be executed by the vehicle, or by a chip or circuitry used in the vehicle. Specifically, the method can be executed by the vehicle's communication device. The following explanation uses the example of the method being executed by the global master node.
[0036] The method includes: receiving a second fault feedback message from a first master node, the second fault feedback message indicating an anomaly in the time management module of the first master node, the time management module being used to send a first time synchronization message, the first time synchronization message carrying the first local time of the first master node; and, based on the second fault feedback message, sending a second time synchronization message to a slave node in the first time domain associated with the first master node, the second time synchronization message carrying a time reference.
[0037] In the above technical solution, when the global master node receives the second fault feedback message from the first master node, the global master node directly sends a time synchronization message to the first slave node to avoid time synchronization failure between the first time domain and the global master node, which helps to improve the time synchronization success rate and robustness of the time synchronization system.
[0038] In conjunction with the third aspect, in some implementations of the third aspect, the method further includes: receiving multiple frequency information, wherein each frequency information indicates a packet transmission frequency in a time domain associated with an intermediate master node, and the intermediate master node corresponding to the multiple frequency information includes a first master node.
[0039] In this context, the intermediate master node corresponding to the frequency information can be understood as the node from which the frequency information originates. An intermediate master node is a node between the global master node and the slave nodes. Each frequency information in multiple frequency information sets can originate from one intermediate master node, thus the intermediate master nodes corresponding to multiple frequency information sets include multiple intermediate master nodes, among which the first master node can be included. Alternatively, multiple frequency information sets can also originate from a single intermediate master node. For example, when an intermediate master node is responsible for time synchronization across multiple time domains, it can send multiple frequency information sets to the global master node; in this case, the intermediate master node corresponding to the multiple frequency information sets is the first master node.
[0040] In conjunction with the third aspect, in some implementations of the third aspect, the method further includes: creating and saving frequency network mapping information based on multiple frequency information, wherein the frequency network mapping information indicates the packet transmission frequency of a time domain associated with each of the multiple intermediate master nodes; sending a second time synchronization message to the first time domain associated with the first master node based on the second fault feedback message, including: determining the second frequency corresponding to the first time domain based on the second fault feedback message and the frequency network mapping information; and sending the second time synchronization message to the first master node based on the second frequency.
[0041] In the above technical solution, the global master node can determine the optimal packet transmission frequency of at least one time domain associated with the first master node based on the frequency network mapping information, and send time synchronization messages to the slave nodes in the relevant time domain based on the optimal packet transmission frequency. This helps to ensure the success rate of time synchronization in the time domain associated with the first master node in the event of a failure of the first master node.
[0042] In some implementations, the global master node may also have the capabilities of an intermediate master node. When the global master node has the capabilities of an intermediate master node, it can also execute some or all of the methods in the possible implementations of the first aspect.
[0043] Fourthly, a time synchronization device is provided, which can be disposed in the aforementioned first master node. The device includes a transceiver unit and a processing unit. The transceiver unit is configured to: send a first time synchronization message to a first slave node based on a first frequency, the first time synchronization message including a first local time of the first master node; the transceiver unit is further configured to: receive a deviation feedback message from the first slave node, the deviation feedback message indicating a time deviation between a second local time and the first local time of the first slave node; the processing unit is configured to: determine a second frequency for sending the first time synchronization message based on the time deviation; the transceiver unit is further configured to: send the first time synchronization message to the first slave node based on the second frequency.
[0044] In conjunction with the fourth aspect, in some implementations of the fourth aspect, the processing unit is used to: determine that the second frequency is less than the first frequency when the time deviation is less than the deviation threshold; or, determine that the second frequency is greater than the first frequency and less than the third frequency when the time deviation is greater than the deviation threshold, wherein the third frequency is the packet transmission frequency at which the first master node sends the first time synchronization message to the first slave node in the first time period, the first time period is before the second time period, and the time interval between the end time of the first time period and the start time of the second time period is less than or equal to the duration threshold, and the second time period is the time period during which the first master node sends the first time synchronization message to the first slave node at the first frequency.
[0045] In conjunction with the fourth aspect, in some implementations of the fourth aspect, the transceiver unit is also used to: send a second frequency to the global master node so that the global master node can obtain the packet transmission frequency corresponding to the first time domain to which the first slave node belongs.
[0046] In conjunction with the fourth aspect, in some implementations of the fourth aspect, the time deviation corresponding to the second frequency is less than or equal to the deviation threshold.
[0047] In conjunction with the fourth aspect, in some implementations of the fourth aspect, the transceiver unit is also used to: receive a first fault feedback message from the first slave node, the first fault feedback message indicating that the first slave node has lost synchronization; and when the time management module of the first master node is abnormal, send a second fault feedback message to the global master node, the second fault feedback message indicating that the time management module of the first master node is abnormal, and the time management module is used to send a first time synchronization message to the first slave node.
[0048] In conjunction with the fourth aspect, in some implementations of the fourth aspect, the transceiver unit is further configured to: receive a first fault feedback message from the first slave node, the first fault feedback message indicating that the first slave node has lost synchronization, the first fault feedback message also including the time deviation between the second local time and the first local time; and, when the communication link between the first slave node and the first master node is normal, determine the packet transmission frequency for sending the first time synchronization message based on the time deviation.
[0049] In conjunction with the fourth aspect, in some implementations of the fourth aspect, the transceiver unit is used to: send a first time synchronization message based on the initial reference frequency when the deviation threshold is less than the time deviation.
[0050] Fifthly, a time synchronization device is provided, which can be disposed in the aforementioned first slave node. The device includes a transceiver unit and a processing unit, wherein the transceiver unit is configured to: receive a first time synchronization message from a first master node, the first time synchronization message including a first local time of the first master node; the processing unit is configured to: determine the time deviation between a second local time of the first slave node and the first local time based on the first time synchronization message; the transceiver unit is further configured to: send a deviation feedback message to the first master node, the deviation feedback message indicating the time deviation.
[0051] In conjunction with the fifth aspect, in some implementations of the fifth aspect, the transceiver unit is also used to: send a first fault feedback message to the first master node, the first fault feedback message indicating that the first slave node has lost synchronization.
[0052] In conjunction with the fifth aspect, in some implementations of the fifth aspect, the first fault feedback message also includes the time deviation between the second local time and the first local time.
[0053] In conjunction with the fifth aspect, in some implementations of the fifth aspect, the transceiver unit is also used to: receive a second time synchronization message from the global master node, the second time synchronization message including a clock reference.
[0054] In conjunction with the fifth aspect, in some implementations of the fifth aspect, the transceiver unit is used to: receive the first time synchronization message based on the second frequency.
[0055] Sixthly, a time synchronization device is provided, which can be set at the aforementioned global master node. The device includes a transceiver unit and a processing unit. The transceiver unit is used to: receive a second fault feedback message from a first master node, the second fault feedback message indicating that the time management module of the first master node is abnormal, and the time management module is used to send a first time synchronization message, the first time synchronization message carrying the first local time of the first master node; the processing unit is used to: control the transceiver unit to send a second time synchronization message to the slave nodes in the first time domain associated with the first master node according to the second fault feedback message, the second time synchronization message carrying a time reference.
[0056] In conjunction with the sixth aspect, in some implementations of the sixth aspect, the transceiver unit is also used to: receive multiple frequency information, each of the multiple frequency information indicating a time domain packet transmission frequency associated with an intermediate master node, and the intermediate master node corresponding to the multiple frequency information includes the first master node.
[0057] In conjunction with the sixth aspect, in some implementations of the sixth aspect, the processing unit is further configured to: create and save frequency network mapping information based on multiple frequency information, wherein the frequency network mapping information indicates the packet transmission frequency of a time domain associated with each of the multiple intermediate master nodes; determine the second frequency corresponding to the first time domain based on the second fault feedback message and the frequency network mapping information; and send a second time synchronization message to the first master node based on the second frequency.
[0058] A seventh aspect provides a time synchronization device, the device comprising: a processor for executing a computer program stored in the memory, such that the device performs the method in any of the possible implementations of the first to third aspects described above.
[0059] In conjunction with the seventh aspect, in some implementations of the seventh aspect, the device also includes a memory.
[0060] Eighthly, a time synchronization system is provided, comprising at least two of the means in any possible implementation of the fourth aspect, the means in any possible implementation of the fifth aspect, and the means in any possible implementation of the sixth aspect.
[0061] Ninthly, a computer program product is provided, the computer program product comprising: computer program code, which, when executed on a computer or processor, causes the computer or processor to perform the method in any of the possible implementations of the first to third aspects.
[0062] It should be noted that the above computer program code can be stored in whole or in part on a storage medium, which can be packaged together with the processor or packaged separately from the processor.
[0063] In a tenth aspect, a computer-readable storage medium is provided, the computer-readable medium storing instructions that, when executed by a processor, cause the processor to implement the method in any one of the possible implementations of the first to third aspects.
[0064] Eleventhly, a chip is provided, the chip including circuitry for performing the method in any possible implementation of the first aspect described above.
[0065] In the twelfth aspect, a vehicle is provided that includes means as in any of the possible implementations of the fourth to seventh aspects, or the vehicle includes a system as in any of the possible implementations of the eighth aspect, or the vehicle includes a computer-readable storage medium as in any of the possible implementations of the tenth aspect, or the vehicle includes a chip as in any of the possible implementations of the eleventh aspect, or the vehicle is loaded with a computer program product as in any of the possible implementations of the ninth aspect.
[0066] In conjunction with aspect 12, in some implementations of aspect 12, the vehicle is a vehicle in a broad sense, such as a means of transportation (e.g., commercial vehicles, passenger cars, motorcycles, flying cars, trains, etc.), industrial vehicles (e.g., forklifts, trailers, tractors, etc.), engineering vehicles (e.g., excavators, bulldozers, cranes, etc.), agricultural equipment (e.g., lawnmowers, harvesters, etc.), amusement equipment, toy vehicles, etc. In practical implementation, the vehicle can also be a road vehicle, a water vehicle, an air vehicle, industrial equipment, agricultural equipment, or other intelligent driving equipment such as entertainment equipment.
[0067] For the beneficial effects not described in detail in aspects four through twelfth, please refer to the descriptions in aspects one through three, which will not be repeated here. Attached Figure Description
[0068] Figure 1 is a schematic block diagram of the distributed time network architecture provided in an embodiment of this application;
[0069] Figure 2 is a schematic block diagram of the time synchronization system architecture provided in an embodiment of this application;
[0070] Figure 3 is a schematic flowchart of the time synchronization method provided in the embodiments of this application;
[0071] Figure 4 is a schematic diagram of the frame structure of the message involved in the embodiments of this application;
[0072] Figure 5 is another schematic flowchart of the time synchronization method provided in the embodiments of this application;
[0073] Figure 6 is another schematic flowchart of the time synchronization method provided in the embodiments of this application;
[0074] Figure 7 is a schematic block diagram of a time synchronization device provided in an embodiment of this application;
[0075] Figure 8 is another schematic block diagram of the time synchronization device provided in the embodiments of this application. Detailed Implementation
[0076] As mentioned earlier, the clock drift of each ECU within a vehicle is not exactly the same, and there are also slight differences in system time and time frequency. To address this issue, the Automotive Open System Architecture (AUTOSAR) classic platform (CP) provides a standardized time synchronization protocol. This involves a designated master node periodically sending time synchronization messages containing the master node's time information to slave nodes at a set frequency. Slave nodes parse these messages to obtain the relevant information and use it to correct their local time, thus achieving time synchronization between the master and slave nodes. The higher the frequency at which the master node sends time synchronization messages, the higher the frequency at which the slave nodes correct their local time, resulting in a smaller time deviation between them and the master node. However, the current AUTOSAR CP solution requires manual configuration of the parameters for transmitting time synchronization messages. Once configured, these parameters are fixed and cannot be changed during operation, leading to the following problems:
[0077] 1. Under a specified time synchronization accuracy, it is difficult to manually configure the appropriate frequency of time synchronization messages sent by the master node (hereinafter referred to as the packet sending frequency). An inappropriate packet sending frequency may lead to a waste of link bandwidth resources, and a fixed packet sending frequency is difficult to adapt to real-time changes in the communication network. Although a higher packet sending frequency helps to reduce the time deviation between master and slave nodes, it will consume more link bandwidth and internal processing resources of the device, resulting in performance waste. In addition, different vehicle models require continuous adjustment of values during parameter tuning, compilation, and testing to achieve the specified time accuracy. It is difficult to use a universal formula to calculate the packet sending frequency for different vehicle models, resulting in high labor costs.
[0078] 2. If the intermediate master node in a distributed time network fails, all its subordinate nodes will be unable to synchronize their base time. The intermediate master node is defined as one that acts as a slave node to the upper-level master node, receiving time synchronization messages and correcting its local time, and also as a master node to one or more slave nodes, sending time synchronization messages. Therefore, if the time synchronization module of such a node malfunctions, all its subordinate nodes will effectively lose connection with the global time master node, leading to synchronization failure between the sub-time domains and the global time master node.
[0079] In view of this, the embodiments of this application provide a time synchronization scheme that can adaptively adjust the packet sending frequency of the master node, thereby taking into account the utilization rate of communication network resources; in addition, when the intermediate master node fails in the distributed time network, the time synchronization of the slave nodes under the failed intermediate master node can be completed through the global time master node control, which helps to reduce the probability of vehicle time synchronization failure.
[0080] The technical solutions in this application will now be described with reference to the accompanying drawings.
[0081] Figure 1 shows a schematic block diagram of the distributed time network architecture involved in the embodiments of this application. As shown in Figure 1, the distributed time network includes a global time master node and multiple time slave nodes, wherein the multiple time slave nodes include time slave nodes 1 to 6, time slave node 3-1, time slave node 3-2, time slave node 6-1, and time slave node 6-2. More specifically, time slave nodes 1, 2, 3, and the global time master node belong to the same time domain. The global time master node sends time synchronization messages to time slave nodes 1 to 3 through communication protocol 1 to complete time synchronization within time domain 1; time slave nodes 4, 5, and 6 belong to the same time domain as the global time master node. The global time master node sends time synchronization messages to time slave nodes 4 to 6 through communication protocol 2 to complete time synchronization within time domain 2; time slave nodes 3, 3-1, and 3-2 belong to the same time domain as the global time master node. Within the same time domain, time slave node 3 acts as the master node of time slave nodes 3-1 and 3-2, sending time synchronization messages to them via communication protocol 3 to complete time synchronization within time domain 3. Time slave nodes 6, 6-1, and 6-2 belong to the same time domain. Time slave node 6 acts as the master node of time slave nodes 6-1 and 6-2, sending time synchronization messages to them via communication protocol 4 to complete time synchronization within time domain 4. It can be understood that time slave nodes 3 and 6 can be considered as an example of the aforementioned intermediate master nodes, time slave nodes 3-1 and 3-2 can be considered as subordinate nodes (i.e., slave nodes) of time slave node 3, and time slave nodes 6-1 and 6-2 can be considered as subordinate nodes of time slave node 6.
[0082] It should be noted that the architecture shown in Figure 1 is merely an illustrative example. In actual implementation, each master node (such as a global time master node or an intermediate master node) can also be associated with one or more other time domains, and each time domain includes at least one slave node. Associating a master node with a time domain can be understood as the master node sending time synchronization messages to one or more slave nodes in that time domain through a communication link, enabling one or more slave nodes in the time domain to synchronize their time based on the local time of that slave node. For example, the relationship between the global time master node and time domain 1 and time domain 2 can be described as: the global time master node is associated with time domain 1, and the global time master node is associated with time domain 2. For example, an intermediate master node can also be associated with one or more time domains. Taking time slave node 3 as an example, in addition to time domain 3, time slave node 3 is also associated with time domain 3'. When time slave node 3 sends time synchronization messages to other slave nodes in time domain 3 (such as time slave node 3-1 and time slave node 3-2) through the communication link corresponding to communication protocol 3, time slave node 3 also sends time synchronization messages to other slave nodes in time domain 3' (such as time slave node n) through other communication links. In this case, the relationship between time slave node 3 and time domains 3 and 3' can be described as: time slave node 3 is associated with time domain 3, and time slave node 3 is associated with time domain 3'. Furthermore, the time domain to which one or more slave nodes belong can be understood as: these one or more slave nodes receive time synchronization messages from a master node (such as a global time master node or an intermediate master node) based on the same communication protocol to complete time synchronization; wherein, the master node broadcasts time synchronization messages to the aforementioned one or more slave nodes at a certain packet transmission frequency. For example, time domain 3' for time slave node n is: time domain 3' to which time slave node n belongs; and time domain 1 for time slave node 1, time slave node 2, and time slave node 3 is: time domain 1 to which time slave node 1 belongs, time domain 1 to which time slave node 2 belongs, and time domain 1 to which time slave node 3 belongs.
[0083] It should also be noted that the aforementioned communication protocols may include, but are not limited to, vehicle communication protocols such as Controller Area Network (CAN) communication protocol, Ethernet (ETH) communication protocol, and Frame Relay (FR) communication protocol. In addition, any two or more of the aforementioned communication protocols 1 to 4 may be the same communication protocol, or the aforementioned communication protocols 1 to 4 may all be different communication protocols.
[0084] In some implementations, the aforementioned global time master node can determine a time reference based on the global navigation satellite system (GNSS) time, the vehicle's total operating time, ECU startup time, etc., and then achieve time synchronization based on this time reference. For example, the global time master node can be a device in the vehicle, such as a telematics box (T-box), used for vehicle-to-external communication. The aforementioned intermediate master node can be located in a computing platform, which can be any of the domain controllers in the cockpit domain controller (CDC), vehicle domain controller (VDC), and advanced driving domain controller (ADC), or mobile data center (MDC). The CDC (Cockpit Control Unit) is used to implement intelligent cockpit functions such as human-machine interaction. In practice, CDC may also be called other names, such as Media Graphics Unit (MGU), Intelligent Cockpit Server ICAS3, Cockpit Super Core (CSC), etc. The VDC (Vehicle Control Unit) is used to implement vehicle control functions. VDC can be seen as an integration of the power domain, chassis domain, and body domain. In practice, VDC may also be called other names, such as Body Domain Controller (BDC), Vehicle Control Server ICAS1, Body Super Core (BSC), etc. The ADC (Action Control Unit) or MDC (Mechanical Control Unit) is used to implement perception, decision-making, and control functions related to intelligent driving. In practice, ADC or MDC may also be called other names, such as Special Equipment System (SAS), Intelligent Driving Server ICAS2, ADAS Super Core, etc. ICAS stands for In-Car Application Server (ICAS). Alternatively, the computing platform can also include the Vehicle Central Computer (VCC). The time can be set in the ECUs connected to or managed by the aforementioned domain controllers.
[0085] Based on the distributed time network architecture shown in Figure 1, Figure 2 illustrates a schematic block diagram of the time synchronization system architecture provided in this application embodiment. As shown in Figure 2, the system includes a master node device 110 and slave node devices 120. The master node device 110 is the intermediate master node in the aforementioned embodiments; that is, the master node device 110 is not the global time master node. The master node device 110 includes a synchronized time-base manager (StbM) 111 and a bus time synchronization unit (bus time synchronizer). <bus>TSyn)112; Slave node device 120 includes StbM 121 and <bus>TSyn 122. StbM 111 and StbM 121 are responsible for determining the clock reference and clock skew correction. More specifically, StbM 111 can determine the clock reference through different time synchronization protocols and distribute the clock reference to at least one slave node. StbM 111 and StbM 112 can also adjust the frequency and phase of the local clock according to the difference between the local clock and the clock reference to reduce clock skew. <bus>TSyn 111 and <bus>TSyn 122 is responsible for protocol processing between time synchronization.
[0086] For example, <bus>The TSyn 112 includes an adaptive adjustment unit, a frequency processing unit, a network status acquisition unit, and a fault handling unit. <bus>The TSyn 122 includes a deviation feedback unit and a fault feedback unit. The functions of each unit are as follows:
[0087] The adaptive adjustment unit is used to: adjust the packet transmission frequency of time synchronization messages based on the deviation feedback messages of slave nodes during the startup phase of the distributed time network system; and to stop / retransmit time synchronization messages or adjust the packet transmission frequency of time synchronization messages based on the fault feedback message information of slave nodes during the operation phase of the distributed time network system.
[0088] The frequency processing unit is used to store the optimal frequency for each time interval, so that this frequency can be used as the initial reference frequency for sending time synchronization messages during the next system startup. In addition, the frequency processing unit is also used to send the optimal frequency to an upper-layer node, which can be the global time master node, or an intermediate master node between the global time master node and master node device 110.
[0089] The network status acquisition unit is used to acquire the status of the sending network corresponding to the time synchronization message.
[0090] The fault handling unit is used to send the deviation feedback message from the node to the upper-layer node when a fault occurs in StbM 111.
[0091] The deviation feedback unit is used to feed back the calculated time deviation to the master node.
[0092] The fault feedback unit is used to: report the out-of-synchronization status of this slave node to the master node. Out-of-synchronization status refers to the failure of slave node time synchronization. The reasons for the failure of slave node time synchronization include, but are not limited to: network abnormality of the slave node's upper-layer node (such as master node device 110) causing the slave node to not receive time synchronization messages for a long time; abnormality of the time management module of the slave node's upper-layer node (such as master node device 110) preventing it from sending time synchronization messages to the slave node, resulting in the slave node's time synchronization message receiving timeout; or, the slave node's time jumps.
[0093] In some implementations, the master node device 110 and the slave node device 120 also include modules for managing the driver hardware structure, providing services such as sending information, receiving information, and controller mode control.
[0094] For example, the master node device 110 can be the time slave node 3 shown in FIG1, and the slave node device 120 can be the time slave node 3-1 or the time slave node 3-2 shown in FIG1; or, the master node device 110 can be the time slave node 6 shown in FIG1, and the slave node device 120 can be the time slave node 6-1 or the time slave node 6-2 shown in FIG1.
[0095] The above describes the time synchronization system architecture provided by the embodiments of this application. The following details the process of implementing the time synchronization method provided by the embodiments of this application based on the system shown in Figure 2.
[0096] Figure 3 shows a schematic flowchart of a time synchronization method provided in an embodiment of this application. This method 300 can be applied to the distributed time network shown in Figure 1, and can be executed by the system shown in Figure 2. This method 300 may include some or all of the following steps S301 to S312, wherein S301 to S305 are the initialization phase of the time synchronization system, and S306 to S312 are the operation phase of the time synchronization system. It should be noted that the initialization phase involved in this application refers to the phase of determining the optimal packet sending frequency, and the operation phase refers to the phase in which the time synchronization system performs time synchronization after determining the optimal packet sending frequency. In both the initialization phase and the operation phase, slave nodes perform time synchronization. In actual implementation, the division between the initialization phase and the operation phase may not be necessary, or the initialization phase and the operation phase may have other division methods. More specifically:
[0097] S301, Master Node 1 sends a time synchronization message to Slave Node 1.
[0098] For example, the master node 1 can be the aforementioned intermediate master node, such as the master node device 110 shown in FIG2; the slave node 1 can be a slave node attached to the master node 1, such as the slave node device 120 shown in FIG2.
[0099] For example, the time synchronization message carries the local time T1 of master node 1, which can be determined based on the time reference sent by the global master node (i.e., the global time master node in Figure 1). More specifically, master node 1 sends the time synchronization message to slave node 1 based on an initial reference frequency F0, which can be manually configured or the optimal frequency determined during the last initialization of the time synchronization system.
[0100] S302, parse the time synchronization message from node 1 to determine the time deviation.
[0101] For example, the slave node 1 parses the time synchronization message, determines the local time T1 of the master node 1, and determines the time deviation based on the slave node 1's own local time T0. The time deviation is the difference between the local time T1 and the local time T0.
[0102] S303, send a deviation feedback message from node 1 to master node 1.
[0103] For example, the deviation feedback message indicates the aforementioned time deviation. In one example, the deviation feedback message carries the time deviation; in another example, the value offset is obtained by subtracting the time deviation from the deviation threshold Thre from node 1, and this value offset is carried in the deviation feedback message. The value offset satisfies the following formula: offset = Thre - |T1 - T0|.
[0104] S304, Master node 1 determines the optimal frequency of time domain a to which slave node 1 belongs based on the deviation feedback message.
[0105] For example, if the offset value indicated by the deviation feedback message is greater than 0, and the offset values indicated by the deviation feedback messages transmitted in all packet transmission cycles prior to this packet transmission cycle in the current time synchronization process are all greater than 0, the current packet transmission frequency F can be adjusted by a linear coefficient. cur (Initial value is F0) to obtain F′ cur And update the saved packet sending frequency F from the previous packet sending cycle. latest (Initial value is 0, due to the absence of a previous packet sending cycle) is F. cur For example, adjust the current packet sending frequency F by a linear coefficient. cur It can be: The current packet sending frequency F is adjusted according to a linear coefficient. cur Decrease to obtain F′ cur It should be noted that the current packet sending frequency before the adjustment (i.e., F) cur ) represents the frequency at which time synchronization messages are sent during the current packet sending cycle, and the adjusted current packet sending frequency (i.e., F′) cur This refers to the frequency at which time synchronization messages are sent in the next packet transmission cycle. It can be understood that the current packet transmission cycle is the period during which the master node receives an offset feedback message with an indication value offset greater than 0.
[0106] Furthermore, if the offset value indicated by the deviation feedback message is less than 0, and this is the first time in this time synchronization process that the offset value indicated by the deviation feedback message is less than 0, then let F... lower =F cur F upper =F latest , in [F lower ,F upper The range is calculated using the sliding window algorithm to determine the new packet frequency F′. cur And master node 1 will use the packet sending frequency F′ in the next packet sending cycle. cur Send a time synchronization message; if the offset value indicated by the deviation feedback message is less than 0, and this is not the first time in this time synchronization process that the offset indicated by the deviation feedback message has been less than 0, update F. lower =F cur F upper Keep the F recorded in the system upper The value, and continue in [F lower ,F upper ] Calculate the new packet frequency F′ within the range cur And master node 1 will use the packet sending frequency F′ in the next packet sending cycle. cur Send a time synchronization message; if the offset value indicated by the deviation feedback message is greater than 0, and the offset value indicated by the deviation feedback message transmitted in a previous packet transmission cycle during this time synchronization process is less than 0, update F. upper =F cur F lower Keep the F recorded in the system lower The value, and continue in [F lower ,F upper ] Calculate the new packet frequency F′ within the range cur And master node 1 will use the packet sending frequency F′ in the next packet sending cycle. cur Send a time synchronization message. Repeat the above process until F. cur Convergence yields the optimal frequency F. opt F cur Convergence (or packet frequency convergence) can be defined as the value offset corresponding to more than or equal to m packet transmission cycles being greater than or equal to 0 and less than a certain threshold, where m can be a value from 3 to 5, or m can be other values.
[0107] It should be noted that "optimal" in "optimal frequency" refers to the value that can be obtained through the process in this step to achieve convergence of the packet transmission frequency. This optimal frequency value may vary depending on the support of different hardware resources.
[0108] In some implementations, time domain a includes other slave nodes besides slave node 1. In this case, master node 1 sends time synchronization messages to multiple slave nodes in time domain a at the same sending frequency during each packet transmission cycle. Furthermore, master node 1 can determine the optimal sending frequency based on the deviation feedback messages reported by multiple slave nodes. This optimal sending frequency is the frequency that makes the numerical offset of all slave nodes less than or equal to a certain threshold. It is understandable that different slave nodes in a time domain may have different tolerances for time deviations; that is, the deviation threshold Thre may be different for different slave nodes.
[0109] As mentioned earlier, different slave nodes in a time domain may have different tolerances for time deviations. To ensure that the packet transmission frequency can meet the tolerances of all slave nodes in a time domain, the initial packet transmission frequency is generally set to be relatively high. However, such a packet transmission frequency may lead to a waste of communication resources. The method in this step can reduce the packet transmission frequency, thereby reducing the occupation of link bandwidth.
[0110] S305, Master Node 1 sends the optimal frequency of time domain a to the global master node.
[0111] It is understandable that when master node 1 is also responsible for time synchronization of time domains other than time domain a, after determining the optimal frequency of other time domains, master node 1 also sends the optimal frequency of other time domains to the global master node.
[0112] S306, Global Master Node generates frequency-network mapping table.
[0113] The global master node also receives information from other intermediate master nodes indicating the optimal frequency for one or more time domains. Furthermore, the global master node generates a frequency-network mapping table that indicates the optimal frequency for each of the multiple time domains in the time synchronization system.
[0114] S307, determine the current network state when node 1 is out of sync.
[0115] In one example, when the number of times that slave node 1 fails to receive a time synchronization message exceeds a preset number, it is determined that slave node 1 is out of sync. The preset number can be one of 3 to 5 times, or it can be any other number.
[0116] In another example, when the time of slave node 1 jumps, causing the time deviation between the local time of slave node 1 and the local time of master node 1 to exceed the deviation threshold, it is determined that slave node 1 is out of sync.
[0117] For example, the current network status indicates whether the network used for transmitting time synchronization messages between master node 1 and slave node 1 is functioning normally. Further, slave node 1 assembles a fault feedback message 1 based on the current network status and sends this fault feedback message 1 to master node 1.
[0118] For example, Figure 4 illustrates an example of the frame structure of a fault feedback message (such as fault feedback message 1) provided in an embodiment of this application. Specifically, the frame structure includes five fields, namely:
[0119] (1) Message type field (occupies 1 byte), used to indicate the type of the current frame message.
[0120] (2) The control identifier (CTID) field (occupies 1 byte) is used to indicate the physical channel identifier of the network used to transmit time synchronization messages between the current slave node and the master node.
[0121] (3) Network Status field (occupying 1 byte), used to indicate the current network status between the slave node and the master node. For example, if the network status is normal, this field is set to 0; if the network status is abnormal, this field is set to 1.
[0122] (4) Auxiliary information field (occupying 1 byte), which can carry information indicating the fault type (e.g., occupying 2 bits); when carrying the numerical offset in the fault feedback message, this field can also carry information indicating whether the numerical offset is positive or negative (e.g., occupying 1 bit); or, this field can also carry the value of the second part of the numerical offset (e.g., occupying 4 bits).
[0123] (5) Time offset value field (4 bytes) is used to carry the nanosecond part of the numerical offset.
[0124] It should be noted that the frame structure of the deviation feedback message in the aforementioned steps can also be as shown in Figure 4. Furthermore, the message type field of the fault feedback message is set to 1 for all fields; the message type field of the deviation feedback message is set to 0 for all fields.
[0125] It should also be noted that when slave node 1 loses synchronization due to not receiving a time synchronization message, the time offset value field of the fault feedback message can be set to the default value (such as all zeros); when slave node 1 loses synchronization due to a time jump, the time offset value field of the fault feedback message can carry information indicating the time offset between slave node 1 and master node 1, such as the offset value.
[0126] In some implementations, the aforementioned fault feedback messages and deviation feedback messages can be transmitted based on the CAN time synchronization (CANTSyn) protocol and / or the ETH time synchronization (ETHTSyn) protocol.
[0127] S308, Node 1 sends fault feedback message 1 to Master Node 1.
[0128] S309, Master Node 1 determines whether the time management module is running normally.
[0129] For example, if the time management module is unable to send time synchronization messages to the slave nodes, it is determined that the time management module is not functioning properly.
[0130] Specifically, when the time management module fails to function properly, and the communication link between master node 1 and slave node 1 is normal, execute S310.
[0131] S310, Master Node 1 sends a fault feedback message 2 to the global master node.
[0132] For example, fault feedback message 2 indicates that the time management module of master node 1 is abnormal.
[0133] In some implementations, fault feedback message 1 and fault feedback message 2 are the same message. That is, when the time management module of master node 1 is abnormal, master node 1 routes fault feedback message 1 to the global master node.
[0134] S311, the global master node determines the optimal frequency of at least one time domain associated with master node 1 based on the frequency-network mapping table.
[0135] It is understandable that at least one time domain includes time domain a. Furthermore, when the time management module of master node 1 malfunctions, it is unable to send time synchronization messages to slave nodes in all its associated time domains.
[0136] S312, the global master node sends a time synchronization message to slave node 1 based on the optimal frequency corresponding to time domain a.
[0137] It should be noted that when time domain a includes other slave nodes besides slave node 1, the global master node can also send time synchronization messages to other slave nodes based on the optimal frequency corresponding to time domain a. The time synchronization message in S312 differs from the time synchronization message sent by master node 1 to slave node 1 mentioned above in that the time synchronization message in S312 carries the time base or the local time of the global master node, but does not carry the local time of master node 1.
[0138] Method 300 mainly describes how to restore the slave node's time synchronization capability when the slave node loses synchronization, provided that the communication link between the slave node and the intermediate master node for transmitting time synchronization messages is normal, but the intermediate master node's time management module is malfunctioning. The following, with reference to the schematic flowchart of the time synchronization method shown in Figure 5, describes how to restore the slave node's time synchronization capability when the intermediate master node's time management module is normal. Specifically, method 400 shown in Figure 5 is executed by the intermediate master node (such as the aforementioned master node 1) and includes some or all of the following steps S401 to S407:
[0139] S401, receive fault feedback message 1.
[0140] For example, the fault feedback message 1 can be from slave node 1, or the fault feedback message 1 can be from other slave nodes in the time domain associated with master node 1.
[0141] Understandably, the fault feedback message 1 indicates that its sender is out of step (or that there is a loss of step).
[0142] S402, determine if there is an anomaly in the network.
[0143] Specifically, determining whether a network anomaly exists can be achieved by the intermediate master node determining whether the network between itself and the sender of fault feedback message 1 is abnormal. In one example, the intermediate master node can determine whether the network is abnormal based on the network status field in fault feedback message 1; in another example, the network status acquisition unit of the intermediate master node determines whether the network is abnormal. Network anomalies can include one or more reasons that prevent the transmission of time synchronization messages.
[0144] Furthermore, if there are no network anomalies, execute S403; otherwise, execute S403'.
[0145] S403, determine the time deviation indicated by fault feedback message 1.
[0146] For example, when the fault feedback message 1 carries a numerical offset, the intermediate master node reads the value of the numerical offset from the time offset value field. The value of the numerical offset indicates the time offset between the local time of the intermediate master node and the local time of the sender of the fault feedback message 1.
[0147] S403' suspends the transmission of time synchronization messages to monitor network status; and after the network anomaly is cleared, it transmits time synchronization messages at the initial reference frequency.
[0148] The initial reference frequency is the initial reference frequency associated with the time domain of the sender of fault feedback message 1 in S401.
[0149] S404, determine whether the value offset≥0 is true.
[0150] If the value offset < 0, execute S405; otherwise, execute S407.
[0151] S405, send time synchronization messages to slave nodes at the initial reference frequency.
[0152] Similarly, the initial reference frequency is the initial reference frequency associated with the time domain of the sender of fault feedback message 1 in S401. More specifically, the slave nodes involved in S405 may include all or some of the slave nodes in the aforementioned time domain of the sender.
[0153] S406, receive the deviation feedback message and determine the time deviation indicated by the deviation feedback message.
[0154] It is understandable that the deviation feedback message can originate from the sender of fault feedback message 1 in S401. When the deviation feedback message carries a numerical offset, the intermediate master node reads the value of the numerical offset from the time offset value field. This numerical offset value indicates the time deviation between the local time of the intermediate master node and the local time of the sender of fault feedback message 1.
[0155] Furthermore, after executing S406, S404 is executed.
[0156] S407 sends time synchronization messages to slave nodes at the optimal frequency.
[0157] The optimal frequency is the optimal frequency associated with the time domain of the sender of fault feedback message 1 in S401. The method for determining this optimal frequency can be referred to the description in S304, and will not be repeated here. More specifically, the slave nodes involved in S407 may include all or some of the slave nodes in the aforementioned time domain of the sender.
[0158] The time synchronization method provided in this application embodiment allows the intermediate master node to adjust the packet sending frequency of time synchronization messages based on the time deviation reported by the slave node when the slave node loses synchronization and the time management module of the intermediate master node does not fail. This helps the first slave node to recover time synchronization as soon as possible and improves the self-healing capability of the entire time synchronization network.
[0159] Figure 6 shows another schematic flowchart of the time synchronization method provided in this application embodiment. This method 600 can be applied to the distributed time network shown in Figure 1, and can be executed by the system shown in Figure 2. Specifically, the method includes:
[0160] S610, the first master node sends a first-time synchronization message to the first slave node at the first frequency.
[0161] Specifically, the first synchronization message can carry the local time of the first master node, which can be determined based on the time base of the global master node.
[0162] For example, the first-time synchronization message can be the message transmitted between the intermediate master node and the slave node in the aforementioned embodiments.
[0163] S620, the first slave node determines the time deviation between the first local time of the first master node and the second local time of the first slave node based on the first time synchronization message.
[0164] It should be noted that the first local time and the second local time can change as the time synchronization process proceeds.
[0165] S630, the first slave node sends a deviation feedback message indicating the time deviation to the first master node.
[0166] In one example, the deviation feedback message carries the numerical offset from method 300, which indicates the time deviation.
[0167] For example, the first master node can be an intermediate master node in the foregoing embodiments, such as master node 1 in method 300; the first slave node can be a slave node in the time domain associated with the first master node. For example, when the first master node is master node 1 in the foregoing embodiments, the first slave node can be slave node 1 in the foregoing embodiments.
[0168] In one example, the first frequency can be the initial reference frequency in the aforementioned embodiments, or the first frequency can be an intermediate frequency obtained in the process of determining the optimal frequency based on the initial reference frequency.
[0169] S640, the first master node determines the second frequency based on the time deviation.
[0170] In some scenarios, when the time deviation is less than the deviation threshold, the first time synchronization message is still sent based on the first frequency. In other words, there is no need to determine the second frequency at this time, or the second frequency can be considered to be the same as the first frequency.
[0171] In some implementations, the second frequency is the optimal frequency in method 300; or, the second frequency may be an intermediate frequency obtained in the process of determining the optimal frequency based on the initial reference frequency.
[0172] More specifically, when the time deviation is less than the deviation threshold, and all time deviations indicated by deviation feedback messages received from the first slave node before the deviation feedback message is received in this time synchronization process are less than the deviation threshold, the second frequency is determined to be less than the first frequency; or, when the time deviation is greater than the deviation threshold for the first time in this time synchronization process, the second frequency is determined to be greater than the first frequency, and the second frequency is less than the third frequency. The third frequency is the packet sending frequency of the first master node sending the first time synchronization message to the first slave node in the first time period. The first time period is before the second time period, and the time interval between the end time of the first time period and the start time of the second time period is less than or equal to the duration threshold. The second time period is the time period in which the first master node sends the first time synchronization message to the first slave node at the first frequency.
[0173] In some implementations, if the time deviation is less than the deviation threshold, and among all the deviation feedback messages received from the first slave node before receiving the deviation feedback message in the current time synchronization process, there is a deviation feedback message indicating a time deviation greater than the deviation threshold, then it is determined that the second frequency is less than the first frequency and greater than the fourth frequency. The fourth frequency can be the packet transmission frequency recorded in the system for the previous packet transmission cycle.
[0174] In some implementations, during the current time synchronization process, if a time deviation exceeds a threshold (not the first time), the second frequency is determined to be greater than the first frequency and less than the fifth frequency. The fifth frequency can be the packet transmission frequency recorded in the system for the previous packet transmission cycle.
[0175] For example, the first frequency is F in method 300. cur The second frequency is F′ in method 300. cur The third frequency is F in method 300. latest The fourth frequency is the F frequency recorded by the system in method 300. upper The fifth frequency is the F frequency recorded by the system in method 300. lower A more detailed method for determining the second frequency can be found in the description in S304, and will not be repeated here.
[0176] S650: The first master node sends a first-time synchronization message to the first slave node at the second frequency.
[0177] In some implementations, when the second frequency is the optimal frequency in the first time domain to which the first slave node belongs, S660 is executed: the first master node sends the second frequency to the global master node. In this scenario, the time deviation corresponding to the second frequency is less than or equal to the deviation threshold.
[0178] In some implementations, the global master node receives multiple frequency information messages, each indicating a packet transmission frequency in a time domain associated with an intermediate master node. These multiple frequency information messages may include information indicating a second frequency.
[0179] In some implementations, the method further includes: creating and saving frequency network mapping information based on multiple frequency information, wherein the frequency network mapping information indicates the packet transmission frequency of a time domain associated with each of the multiple intermediate master nodes, including a first master node; and sending a second time synchronization message to a first time domain associated with the first master node based on a second fault feedback message, including: determining a second frequency corresponding to the first time domain based on the second fault feedback message and the frequency network mapping information; and sending the second time synchronization message to the first master node based on the second frequency.
[0180] For example, the frequency network mapping information can be the frequency-network mapping table in method 300, or the frequency network mapping information can be other forms of information.
[0181] In some implementations, when the first slave node sends a synchronization failure message, the following process can also be executed between the first slave node, the first master node, and the global master node:
[0182] S670, the first slave node sends the first fault feedback message to the first master node.
[0183] Specifically, the first fault feedback message indicates that the first slave node has lost synchronization. The reason for the first slave node losing synchronization can be referred to the description in the foregoing embodiments, and will not be repeated here.
[0184] In some implementations, the first fault feedback message also includes the time deviation between the second local time and the first local time. A more detailed description of the frame structure and information carried by the first fault feedback message can be found in the corresponding section of Figure 4 above, and will not be repeated here.
[0185] S680: When the time management module of the first master node fails, the first master node sends a second fault feedback message to the global master node.
[0186] The second fault feedback message indicates an anomaly in the time management module of the first master node. The time management module is used to send first time synchronization messages to slave nodes within the first time domain to which the first slave node belongs. Furthermore, when the time management module malfunctions or malfunctions, it is unable to send the first time synchronization message.
[0187] S690, the global master node sends a second time synchronization message to the first slave node at a second frequency.
[0188] Specifically, the second time synchronization message can carry a time reference.
[0189] In some implementations, when the first master node receives a first fault feedback message from the first slave node, and the first fault feedback message also includes the time deviation between the second local time and the first local time, and the communication link between the first slave node and the first master node is normal, the first master node determines the packet sending frequency of the first time synchronization message based on the time deviation.
[0190] In some implementations, the frequency of sending the first time synchronization message is determined based on the time deviation, including: sending the first time synchronization message based on the initial reference frequency when the deviation threshold is less than the time deviation.
[0191] If the first slave node loses synchronization while the time management module of the first master node is functioning normally, a more specific implementation of restoring the time synchronization capability of the first slave node can be found in the description in method 400, which will not be repeated here.
[0192] In the time synchronization method provided in this application embodiment, the intermediate master node can adjust the packet sending frequency of time synchronization messages based on the time deviation reported by the slave nodes, thereby reducing the time deviation between the intermediate master node and the slave nodes. This helps improve the usability of the time synchronization function, reduces the occupation of link bandwidth and device processing resources while achieving the time synchronization accuracy target, saves the manpower cost required for debugging the packet sending frequency, and avoids performance waste. Furthermore, when the intermediate master node itself malfunctions and is unable to send time synchronization messages to the slave nodes, the intermediate master node sends a second fault feedback message to the global master node, so that the global master node directly sends time synchronization messages to the relevant slave nodes, thereby avoiding time synchronization failure between the time domain of the relevant slave nodes and the intermediate master node and / or the global master node, which helps improve the time synchronization success rate and robustness of the time synchronization system.
[0193] In the various embodiments of this application, unless otherwise specified or in case of logical conflict, the terminology and / or descriptions between the various embodiments are consistent and can be referenced by each other. Technical features in different embodiments can be combined to form new embodiments according to their inherent logical relationships.
[0194] The methods provided by the embodiments of this application have been described in detail above with reference to Figures 1 to 6. The apparatus provided by the embodiments of this application will now be described in detail below with reference to Figures 7 and 8. It should be understood that the descriptions of the apparatus embodiments correspond to the descriptions of the method embodiments; therefore, any content not described in detail can be found in the method embodiments above, and for the sake of brevity, will not be repeated here.
[0195] Figure 7 shows a schematic block diagram of a time synchronization device 2000 provided in an embodiment of this application. The device 2000 may include units for executing the embodiments described in the foregoing method. Furthermore, each unit in the device 2000 implements a corresponding process of the above-described method embodiments. The device 2000 includes a transceiver unit 2010, which can be used to implement corresponding data acquisition or transmission / reception functions. The device 2000 also includes a processing unit 2020, which can be used to implement corresponding processing functions.
[0196] Optionally, the device 2000 further includes a storage unit, which can be used to store instructions and / or data. The processing unit 2020 can read the instructions and / or data in the storage unit so that the device can perform the relevant actions in the aforementioned method embodiments.
[0197] It should be understood that the specific process of each unit performing the above-mentioned corresponding steps has been described in detail in the above method embodiments, and will not be repeated here for the sake of brevity.
[0198] It should also be understood that the device 2000 described herein is embodied in the form of a functional unit. The terms "module" or "unit" may refer to application-specific ASICs, electronic circuits, processors (e.g., shared processors, proprietary processors, or group processors, etc.) and memory for executing one or more software or firmware programs, integrated logic circuits, and / or other suitable components that support the described functions.
[0199] The apparatuses described above can be applied to the global master node, intermediate master node, or slave node in the foregoing embodiments, and have the function of implementing the corresponding steps performed by each node in the above methods. These functions can be implemented in hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions; for example, the transceiver unit 2010 can be replaced by a transceiver, and other units, such as the processing unit 2020, can be replaced by a processor, used to execute the relevant processing operations in each method embodiment.
[0200] For example, the operations performed by the transceiver unit 2010 and the processing unit 2020 can be executed by a single processor, or by different processors. In specific implementations, the one or more processors can be processors configured in the time synchronization system of the foregoing embodiments; or, the device 2000 can be a chip configured in the time synchronization system of the foregoing embodiments.
[0201] In the specific implementation process, the units in the above device can be fully or partially integrated together, or they can be implemented independently. In one implementation, these units are integrated together and implemented in the form of a system-on-a-chip (SoC).
[0202] Figure 8 is another schematic block diagram of the time synchronization device provided in the embodiments of this application. The device 2100 shown in Figure 8 may include: a processor 2110, a transceiver 2120, and a memory 2130. The processor 2110, transceiver 2120, and memory 2130 are connected via internal interconnection paths. The memory 2130 is used to store instructions, and the processor 2110 is used to execute the instructions stored in the memory 2130 to implement the methods in the above embodiments. Optionally, the memory 2130 may be coupled to the processor 2110 via an interface or integrated with the processor 2110.
[0203] It should be noted that the transceiver 2120 mentioned above may include, but is not limited to, transceiver devices such as input / output interfaces, to realize communication between device 2100 and other devices or communication networks.
[0204] Memory 2130 can be volatile memory and / or non-volatile memory. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM). For example, RAM can be used as an external cache. By way of example and not limitation, RAM includes various forms such as: static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).
[0205] Transceiver 2120 uses transceiver devices, such as but not limited to transceivers, to enable communication between device 2100 and other devices or communication networks to receive / send data / information for implementing the methods in the above embodiments.
[0206] This application also provides an intelligent driving device, which includes the device 2000 or device 2100 in the above embodiments.
[0207] This application also provides a computer program product, which includes computer program code. When the computer program code is run on a computer, it causes the computer to implement the methods described in the above embodiments of this application.
[0208] This application also provides a computer-readable storage medium storing computer instructions that, when executed on a computer, cause the computer to implement the methods described in the above embodiments of this application.
[0209] This application also provides a chip, including circuitry, for performing the methods described in the above embodiments of this application.
[0210] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0211] In the description of the embodiments of this application, unless otherwise stated, " / " means "or", for example, A / B can mean A or B; "and / or" in this document describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. In this application, "at least one" means one or more, and "more" means two or more. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or multiple items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.
[0212] The use of prefixes such as "first" and "second" in the embodiments of this application is solely for distinguishing different descriptive objects and does not limit the position, order, priority, quantity, or content of the described objects. The use of ordinal numbers and other prefixes used to distinguish descriptive objects in the embodiments of this application does not constitute a limitation on the described objects. The description of the described objects is found in the claims or the context of the embodiments, and the use of such prefixes should not constitute an unnecessary limitation.
[0213] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0214] In the various embodiments of this application, unless otherwise specified or in case of logical conflict, the terminology and / or descriptions between the various embodiments are consistent and can be referenced by each other. Technical features in different embodiments can be combined to form new embodiments according to their inherent logical relationships.
[0215] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0216] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0217] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.< / bus> < / bus> < / bus> < / bus> < / bus> < / bus>
Claims
1. A time synchronization method, characterized in that, Applied to the first master node, including: A first time synchronization message is sent to the first slave node based on a first frequency, and the first time synchronization message includes the first local time of the first master node. Receive a deviation feedback message from the first slave node, the deviation feedback message indicating the time deviation between the second local time and the first local time of the first slave node; Based on the time deviation, a second frequency for sending the first time synchronization message is determined; The first time synchronization message is sent to the first slave node based on the second frequency.
2. The method according to claim 1, characterized in that, Determining the second frequency for sending the first time synchronization message based on the time deviation includes: When the time deviation is less than the deviation threshold, the second frequency is determined to be less than the first frequency; or, When the time deviation is greater than the deviation threshold, it is determined that the second frequency is greater than the first frequency and the second frequency is less than the third frequency. The third frequency is the packet sending frequency of the first master node sending the first time synchronization message to the first slave node in the first time period. The first time period is before the second time period, and the time interval between the end time of the first time period and the start time of the second time period is less than or equal to the duration threshold. The second time period is the time period in which the first master node sends the first time synchronization message to the first slave node at the first frequency.
3. The method according to claim 1 or 2, characterized in that, The method further includes: A second frequency is sent to the global master node so that the global master node can obtain the packet transmission frequency corresponding to the first time domain to which the first slave node belongs.
4. The method according to claim 2 or 3, characterized in that, The time deviation corresponding to the second frequency is less than or equal to the deviation threshold.
5. The method according to any one of claims 1 to 4, characterized in that, The method further includes: Receive a first fault feedback message from the first slave node, the first fault feedback message indicating that the first slave node has lost synchronization; When the time management module of the first master node malfunctions, a second fault feedback message is sent to the global master node. The second fault feedback message indicates that the time management module of the first master node is malfunctioning. The time management module is used to send the first time synchronization message to the first slave node.
6. The method according to any one of claims 1 to 4, characterized in that, The method further includes: Receive a first fault feedback message from the first slave node, the first fault feedback message indicating that the first slave node has lost synchronization, and the first fault feedback message also includes the time deviation between the second local time and the first local time; When the communication link between the first slave node and the first master node is normal, the packet sending frequency for sending the first time synchronization message is determined based on the time deviation.
7. The method according to claim 6, characterized in that, The step of adjusting the frequency of sending the first time synchronization message according to the time deviation includes: When the deviation threshold is less than the time deviation, the first time synchronization message is sent based on the initial reference frequency.
8. A time synchronization method, characterized in that, Applied to the first slave node, including: Receive a first time synchronization message from the first master node, the first time synchronization message including the first local time of the first master node; Based on the first time synchronization message, determine the time deviation between the second local time and the first local time of the first slave node; A deviation feedback message is sent to the first master node, the deviation feedback message indicating the time deviation.
9. The method according to claim 8, characterized in that, The method further includes: A first fault feedback message is sent to the first master node, indicating that the first slave node has lost synchronization.
10. The method according to claim 9, characterized in that, The first fault feedback message also includes the time deviation between the second local time and the first local time.
11. The method according to any one of claims 8 to 10, characterized in that, The method further includes: Receive a second time synchronization message from the global master node, the second time synchronization message including a clock reference.
12. The method according to any one of claims 8 to 11, characterized in that, The receiving of the first time synchronization message from the first master node includes: The first time synchronization message is received based on the second frequency.
13. A time synchronization method, characterized in that, Applied to the global master node, including: Receive a second fault feedback message from the first master node. The second fault feedback message indicates that the time management module of the first master node is abnormal. The time management module is used to send a first time synchronization message. The first time synchronization message carries the first local time of the first master node. Based on the second fault feedback message, a second time synchronization message is sent to the slave node in the first time domain associated with the first master node. The second time synchronization message carries a time reference.
14. The method according to claim 13, characterized in that, The method further includes: Receive multiple frequency information, each of which indicates a time-domain packet transmission frequency associated with an intermediate master node, and the intermediate master node corresponding to the multiple frequency information includes the first master node.
15. The method according to claim 14, characterized in that, The method further includes: Based on the multiple frequency information, frequency network mapping information is created and saved, wherein the frequency network mapping information indicates the packet transmission frequency in a time domain associated with each of the multiple intermediate master nodes; The step of sending a second time synchronization message to the first time domain associated with the first master node according to the second fault feedback message includes: Based on the second fault feedback message and the frequency network mapping information, determine the second frequency corresponding to the first time domain; The second time synchronization message is sent to the first master node based on the second frequency.
16. A time synchronization device, characterized in that, Configured on the first master node, including: The transceiver unit is configured to send a first time synchronization message to a first slave node based on a first frequency, wherein the first time synchronization message includes the first local time of the first master node. The transceiver unit is further configured to: receive a deviation feedback message from the first slave node, the deviation feedback message indicating the time deviation between the second local time and the first local time of the first slave node; The processing unit is configured to: determine a second frequency for sending the first time synchronization message based on the time deviation; The transceiver unit is further configured to: send the first time synchronization message to the first slave node based on the second frequency.
17. The apparatus according to claim 16, characterized in that, The processing unit is used for: When the time deviation is less than the deviation threshold, the second frequency is determined to be less than the first frequency; or, When the time deviation is greater than the deviation threshold, it is determined that the second frequency is greater than the first frequency and the second frequency is less than the third frequency. The third frequency is the packet sending frequency of the first master node sending the first time synchronization message to the first slave node in the first time period. The first time period is before the second time period, and the time interval between the end time of the first time period and the start time of the second time period is less than or equal to the duration threshold. The second time period is the time period in which the first master node sends the first time synchronization message to the first slave node at the first frequency.
18. The apparatus according to claim 16 or 17, characterized in that, The transceiver unit is also used for: A second frequency is sent to the global master node so that the global master node can obtain the packet transmission frequency corresponding to the first time domain to which the first slave node belongs.
19. The apparatus according to claim 17 or 18, characterized in that, The time deviation corresponding to the second frequency is less than or equal to the deviation threshold.
20. The apparatus according to any one of claims 16 to 19, characterized in that, The transceiver unit is also used for: Receive a first fault feedback message from the first slave node, the first fault feedback message indicating that the first slave node has lost synchronization; When the time management module of the first master node malfunctions, a second fault feedback message is sent to the global master node. The second fault feedback message indicates that the time management module of the first master node is malfunctioning. The time management module is used to send the first time synchronization message to the first slave node.
21. The apparatus according to any one of claims 16 to 20, characterized in that, The transceiver unit is also used for: Receive a first fault feedback message from the first slave node, the first fault feedback message indicating that the first slave node has lost synchronization, and the first fault feedback message also includes the time deviation between the second local time and the first local time; When the communication link between the first slave node and the first master node is normal, the packet sending frequency for sending the first time synchronization message is determined based on the time deviation.
22. The apparatus according to claim 21, characterized in that, The transceiver unit is used for: When the deviation threshold is less than the time deviation, the first time synchronization message is sent based on the initial reference frequency.
23. A time synchronization device, characterized in that, Configured on the first slave node, including: The transceiver unit is used to receive a first time synchronization message from the first master node, wherein the first time synchronization message includes the first local time of the first master node. The processing unit is configured to determine the time deviation between the second local time and the first local time of the first slave node based on the first time synchronization message; The transceiver unit is further configured to: send a deviation feedback message to the first master node, the deviation feedback message indicating the time deviation.
24. The apparatus according to claim 23, characterized in that, The transceiver unit is also used for: A first fault feedback message is sent to the first master node, indicating that the first slave node has lost synchronization.
25. The apparatus according to claim 24, characterized in that, The first fault feedback message also includes the time deviation between the second local time and the first local time.
26. The apparatus according to any one of claims 23 to 25, characterized in that, The transceiver unit is also used for: Receive a second time synchronization message from the global master node, the second time synchronization message including a clock reference.
27. The apparatus according to any one of claims 23 to 26, characterized in that, The transceiver unit is used for: The first time synchronization message is received based on the second frequency.
28. A time synchronization device, characterized in that, Settings are configured on the global master node, including: The transceiver unit is used to receive a second fault feedback message from the first master node. The second fault feedback message indicates that the time management module of the first master node is abnormal. The time management module is used to send a first time synchronization message. The first time synchronization message carries the first local time of the first master node. The processing unit is configured to control the transceiver unit to send a second time synchronization message to the slave node in the first time domain associated with the first master node, based on the second fault feedback message. The second time synchronization message carries a time reference.
29. The apparatus according to claim 28, characterized in that, The transceiver unit is also used for: Receive multiple frequency information, each of which indicates a time-domain packet transmission frequency associated with an intermediate master node; the intermediate master node corresponding to the multiple frequency information includes the first master node.
30. The apparatus according to claim 29, characterized in that, The processing unit is also used for: Based on the multiple frequency information, frequency network mapping information is created and saved, wherein the frequency network mapping information indicates the packet transmission frequency in a time domain associated with each of the multiple intermediate master nodes; Based on the second fault feedback message and the frequency network mapping information, determine the second frequency corresponding to the first time domain; The second time synchronization message is sent to the first master node based on the second frequency.
31. A time synchronization device, characterized in that, include: A processor for executing a computer program stored in a memory to cause the apparatus to perform the method as claimed in any one of claims 1 to 7, or to cause the apparatus to perform the method as claimed in any one of claims 8 to 12, or to cause the apparatus to perform the method as claimed in any one of claims 13 to 15.
32. A computer-readable storage medium, characterized in that, It stores instructions that, when executed by a processor, implement the method as described in any one of claims 1 to 7, or the method as described in any one of claims 8 to 12, or the method as described in any one of claims 13 to 15.
33. A chip, characterized in that, The chip includes circuitry for performing the method as described in any one of claims 1 to 7, or for performing the method as described in any one of claims 8 to 12, or for performing the method as described in any one of claims 13 to 15.
34. A computer program product, characterized in that, The computer program product includes: computer program code, which, when executed by a processor, implements the method as described in any one of claims 1 to 7, or implements the method as described in any one of claims 8 to 12, or implements the method as described in any one of claims 13 to 15.
35. A vehicle, characterized in that, Includes the apparatus as described in any one of claims 16 to 31, or the computer-readable storage medium as described in claim 32, or the chip as described in claim 33, or the vehicle is equipped with the computer program product as described in claim 34.