Control system, clock synchronization method, controller, node device, and vehicle
The control system achieves accurate and reliable clock synchronization among multiple ECUs by using a ring network with a primary controller transmitting reference clock signals, addressing the limitations of existing methods and enhancing synchronization precision and reliability.
Patent Information
- Application Number
- JP2023526155
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2020-10-29
- Publication Date
- 2025-08-21
- Estimated Expiration
- 2040-10-29
AI Technical Summary
Existing clock synchronization methods in vehicle control systems, such as Precision Time Protocol (PTP) and Ethernet control automation technology (EtherCAT), suffer from low synchronization accuracy and reliability due to the primary ECU sending and receiving data frames, which limits the precision of clock synchronization among multiple ECUs.
A control system utilizing a ring network with a primary controller that directly transmits a reference clock signal to node devices, ensuring accurate clock synchronization by adjusting local clock frequencies and providing redundant signal paths, thereby improving synchronization accuracy and reliability.
The direct transmission of reference clock signals enhances synchronization accuracy to the pulse width of the signal and ensures reliable signal transmission through redundant paths, improving the precision and reliability of clock synchronization in vehicle control systems.
Smart Images

Figure 0007715799000002 
Figure 0007715799000003 
Figure 0007715799000004
Abstract
Description
[Technical Field]
[0001] This application relates to the field of electronic technology in the automotive field, and in particular to a control system, a clock synchronization method, a controller, a node device, and a vehicle. [Background technology]
[0002] With the development of vehicle intelligence, the number of electronic control units (ECUs) included in vehicle control systems is increasing. ECUs can be connected to sensors and executives. ECUs can process data collected by sensors and control the executives to perform corresponding actions.
[0003] To achieve high-precision control of a vehicle, clock synchronization must be ensured among multiple ECUs. Related technologies include the Precision Time Protocol (PTP) and Ethernet control automation technology (EtherCAT) to achieve clock synchronization among multiple ECUs.
[0004] However, when PTP or EtherCAT is used for clock synchronization, a primary ECU among multiple ECUs may send data frames to other ECUs and receive data frames returned by the other ECUs. The primary ECU may determine clock errors between the local clocks of the multiple ECUs based on the data frames returned by the other ECUs, and then perform clock synchronization for the local clocks of the ECUs. This synchronization method has low synchronization accuracy. Summary of the Invention
[0005] This application provides a control system, a clock synchronization method, a controller, a node device, and a vehicle for solving the problem of low synchronization accuracy in clock synchronization among multiple control devices in the control system and configured to control sensors and execution units.
[0006] According to one aspect, this application provides a control system. The control system includes a ring network. The ring network includes a primary controller and at least one node device. The primary controller is configured to perform time adjustment and execute tasks based on a frequency of a local clock signal of the primary controller and is also configured to transmit a reference clock signal to the at least one node device using the ring network. The reference clock signal is obtained based on the local clock signal of the primary controller. The at least one node device is configured to perform time adjustment and execute tasks based on the frequency of the reference clock signal.
[0007] In the solution provided in this application, the primary controller directly transmits a reference clock signal to perform time synchronization, thereby improving the accuracy of clock synchronization between the primary controller and the node device to an accuracy equal to the pulse width of the reference clock signal. This effectively improves the accuracy of clock synchronization. In addition, the primary controller and at least one node device in the control system can be sequentially connected to form a ring network, ensuring that there is a redundant signal exchange path when signals are exchanged between the primary controller and at least one node device, thereby ensuring the reliability of signal transmission.
[0008] Optionally, the reference clock signal may be a local clock signal of the primary controller, that is, the primary controller may directly transmit the local clock signal of the primary controller to at least one node device.
[0009] Optionally, the reference clock signal may be a clock signal obtained by performing frequency division of the local clock signal of the primary controller. Because the frequency of the local clock signal of the primary controller is generally high, the primary controller may perform frequency division of the local clock signal of the primary controller to obtain the reference clock signal to ensure that the node device can support the frequency of the reference clock signal.
[0010] Optionally, at least one node device may include a phase-locked loop. The at least one node device may be configured to utilize the phase-locked loop to modify the frequency of the local clock signal of the node device based on the frequency of the reference clock signal to maintain a target ratio between the frequency of the local clock signal of the node device and the frequency of the reference clock signal, and to perform time adjustment based on the frequency of the local clock signal of the node device.
[0011] The target ratio may be a fixed value preset in the node device, and the target ratio is a ratio of two positive integers. The node device uses a phase-locked loop to modify the frequency of the local clock signal of the node device, so that the frequency of the local clock signal of the node device and the frequency of the reference clock signal can achieve pulse level synchronization.
[0012] Optionally, at least one node device may be configured to perform time adjustment based on the frequency of the reference clock signal. In other words, the node device can directly perform tasks based on the beat of the reference clock signal, without needing to modify the frequency of the node device's local clock signal.
[0013] Optionally, the primary controller may be further configured to adjust the frequency of the local clock signal of the primary controller within a target frequency range, i.e., the primary controller may perform frequency modulation of the local clock signal of the primary controller to achieve frequency modulation of the reference clock signal.
[0014] By implementing frequency modulation of the reference clock signal, the electromagnetic compatibility (EMC) performance of frequency-sensitive circuits in the control system can be effectively improved in the task execution process.
[0015] Optionally, the primary controller may be further configured to transmit a synchronization signal to at least one node device using the ring network. The at least one node device is further configured to correct the time of a local clock of the node device based on the received synchronization signal. In this way, not only frequency synchronization of the clocks but also time synchronization can be achieved between the primary controller and the at least one node device.
[0016] Optionally, the primary controller may be connected to the at least one node device using a clock signal cable. The primary controller is configured to transmit a synchronization signal and a reference clock signal to the at least one node device using the clock signal cable. The at least one node device is configured to individually derive the synchronization signal and the reference clock signal from the received signals based on the amplitude and / or pulse width of the received signals.
[0017] The primary controller uses one clock signal cable to transmit the synchronization signal and the reference clock signal, which prevents an increase in the number of signal cables between the primary controller and the node devices in the control system and simplifies the structure of the control system.
[0018] Optionally, the primary controller may be connected to at least one node device using a clock signal cable and a synchronization signal cable, wherein the primary controller is configured to transmit a reference clock signal to the at least one node device using the clock signal cable and to transmit a synchronization signal to the at least one node device using the synchronization signal cable.
[0019] The primary controller transmits the synchronization signal and the reference clock signal separately using different signal cables, so that the node device does not need to parse the synchronization signal and the reference clock signal from the composite signal, thereby reducing the complexity of receiving the synchronization signal and the reference clock signal by the node device.
[0020] Optionally, the at least one node device may be at least one secondary controller. The control system may further include at least one sensor and at least one execution unit. The at least one sensor is connected to the primary controller or the at least one secondary controller, and the at least one execution unit is connected to the primary controller or the at least one secondary controller. The tasks that need to be performed by the primary controller and the tasks that need to be performed by the at least one secondary controller each include one or more of the following tasks: a data transmission task, a data processing task, a command transmission task, and a drive signal output task. The command is used to instruct the at least one sensor to collect data or to output a drive signal to the at least one execution unit.
[0021] In the solution provided in this application, a primary controller may cooperate with at least one secondary controller to control at least one sensor and at least one execution unit in a control system.
[0022] Optionally, the primary controller may be further configured to determine tasks that need to be executed by the primary controller and execution times for the tasks, determine tasks that need to be executed by at least one secondary controller and execution times for the tasks, execute the tasks at the execution times for the tasks that need to be executed by the primary controller, and send the task scheduling table to the at least one secondary controller. The task scheduling table received by the at least one secondary controller includes tasks that need to be executed by the at least one secondary controller and execution times for the tasks. Correspondingly, the at least one secondary controller may be configured to execute the tasks at the execution times for the tasks that need to be executed by the at least one secondary controller based on the task scheduling table.
[0023] Because the primary controller can schedule tasks in a unified manner, the primary controller and at least one secondary controller can execute tasks in an orderly and efficient manner to prevent problems such as resource preemption or contention that occur when multiple tasks are executed simultaneously.
[0024] Optionally, the primary controller may be further configured to divide a general data processing task into multiple data processing tasks, and determine, based on the load of the primary controller and the load of the at least one secondary controller, the data processing task that needs to be executed by the primary controller and the data processing task that needs to be executed by the at least one secondary controller. In this way, the multiple controllers included in the ring network can realize distributed execution of data processing tasks, and further improve the utilization rate of the computing resources of the controllers based on improved task execution efficiency.
[0025] Optionally, the at least one secondary controller may further maintain a priority list, where the priority list includes a priority of the at least one secondary controller. The at least one secondary controller may be further configured to determine a new primary controller from the at least one secondary controller based on the priority list when it is determined that the primary controller is faulty or any signal cable connected to the primary controller is faulty. The new primary controller may then implement unified scheduling management of multiple controllers in the control system, and specifically, may ensure that primary control of the control system is handed over to the new primary controller and that the control system can still operate normally.
[0026] Optionally, the primary controller and at least one secondary controller may be further configured to transmit target data to other controllers in the control system using the ring network, and to perform fault detection on the ring network and / or retransmit the target data if the target data transmitted using the ring network is not received or if the received target data transmitted using the ring network does not match the transmitted target data.
[0027] The target data may be data that has high requirements for security and needs to be shared by multiple controllers in the ring network. By using the above method, it can be guaranteed that the target data can be reliably transmitted to the receiver.
[0028] Optionally, the control system may further include at least one first router. A first port of the at least one first router is connected to the primary controller or at least one secondary controller, and a second port of the at least one first router is connected to at least one sensor and / or at least one execution unit. A data transmission rate of the first port is lower than that of the ring network, and a data transmission rate of the second port is lower than that of the first port. A controller connected to the at least one first router may be further configured to perform frequency division of the frequency of a reference clock signal and transmit the frequency-divided reference clock signal to the at least one first router. The at least one first router may be configured to perform time adjustment based on the frequency of the received reference clock signal to perform tasks. The tasks performed by the first router may include at least exchanging data with a controller connected to the first router via the first port and exchanging data with at least one sensor and / or at least one execution unit connected to the first router via the second port.
[0029] In the solution provided in this application, sensors and / or execution units with high requirements for data transmission rate may be directly connected to a controller (which may be a primary controller or a secondary controller) in the control system, which sends instructions at a higher reference clock signal frequency and transmits data at a higher data transmission rate. Sensors and / or execution units with general requirements for data transmission rate may be connected to a first router, which sends instructions at an intermediate reference clock signal frequency and transmits data at an intermediate data transmission rate. In this way, the control system can adapt to different types of sensors and execution units, which effectively improves the application flexibility of the control system.
[0030] Optionally, the control system may further include at least one second router. A third port of the at least one second router is connected to a second port of the at least one first router, and a fourth port of the at least one second router is connected to at least one sensor and / or at least one execution unit. The data transmission rate of the third port is equal to the data transmission rate of the second port, and the data transmission rate of the fourth port is lower than the data transmission rate of the third port. The at least one first router may be further configured to perform frequency division of the frequency of the received reference clock signal and send the frequency-divided reference clock signal to the at least one second router. The at least one second router is configured to perform time adjustment based on the frequency of the received reference clock signal to execute a task. The tasks performed by the at least one second router include at least exchanging data with the at least one first router via the third port, and exchanging data with at least one sensor and / or at least one execution unit connected to the at least one second router via the fourth port.
[0031] According to the control system provided in this application, the first router and the second router may be used to gradually reduce the data transmission rate and the frequency of the reference clock signal by level, so that the controller, the first router, and the second router can execute instructions based on reference clock signals with different frequencies. In this way, the application flexibility and compatibility of the control system are effectively improved. In addition, multiple routers with different levels are arranged, which can ensure smooth transmission of the data transmission rate and the frequency of the reference clock signal and further ensure the stability of data transmission.
[0032] Optionally, the at least one node device may be at least one first router. The control system may further include at least one sensor and at least one execution unit. The at least one sensor is connected to the primary controller or the at least one first router, and the at least one execution unit is connected to the primary controller or the at least one first router. Tasks that need to be performed by the primary controller include one or more of the following tasks: a data transmission task, a data processing task, a command transmission task, and a drive signal output task. Tasks that need to be performed by the at least one first router include one or more of the following tasks: a data transmission task, a command transmission task, and a drive signal output task. The command is used to instruct the at least one sensor to collect data or to output a drive signal to the at least one execution unit.
[0033] In the solution provided in this application, a ring network may include only one primary controller, which may exercise centralized control over at least one first router, at least one sensor, and at least one execution unit in the control system.
[0034] Optionally, a first port of the at least one first router is connected to the primary controller, and specifically, the at least one first router accesses the ring network via its first port. The control system may further include at least one second router. A third port of the at least one second router is connected to a second port of the at least one first router, and a fourth port of the at least one second router is connected to at least one sensor and / or at least one execution unit. A data transmission rate of the first port is equal to a data transmission rate of the ring network, a data transmission rate of the second port is lower than the data transmission rate of the first port, a data transmission rate of the third port is equal to the data transmission rate of the second port, and a data transmission rate of the fourth port is lower than the data transmission rate of the third port. The at least one first router is further configured to perform frequency division of the frequency of the received reference clock signal and transmit the frequency-divided reference clock signal to the at least one second router. The at least one second router is configured to perform time adjustment based on the frequency of the received reference clock signal and execute tasks, the tasks executed by the at least one second router including at least exchanging data with the at least one first router via the third port and exchanging data with at least one sensor and / or at least one execution unit connected to the at least one second router via the fourth port.
[0035] In a scenario where the node device is a first router, a second router may be utilized to reduce the data transmission rate and the frequency of the reference clock signal, so that the devices in the ring network (including the primary controller and at least one first router) and the second router may execute instructions at different frequencies of the reference clock signal, thereby effectively improving the application flexibility and compatibility of the control system.
[0036] Optionally, the primary controller may include a primary control module and a secondary control module connected to the primary control module. At least one node device may include a primary node module and a secondary node module connected to the primary node module. The ring network includes a first ring subnet and a second ring subnet. The first ring subnet includes the primary control module and a primary node module in at least one node device, and the second ring subnet includes the secondary control module and a secondary node module in at least one node device. The reference clock signal is obtained based on a local clock signal of the primary control module. The primary control module is configured to individually transmit the reference clock signal to the secondary control module and the primary node module in the at least one node device. The secondary control module is configured to transmit the reference clock signal to the secondary node module in the at least one node device. Alternatively, the primary node module in the at least one node device is configured to transmit the reference clock signal to a secondary node module connected to the primary node module.
[0037] In this application, the secondary control module may have the same function as the primary control module included in the primary controller. Therefore, the secondary control module may also be referred to as a redundant control module. The primary node module may have the same function as the secondary node module included in the node device. Therefore, the secondary node module may also be referred to as a redundant node module. The redundant control module and the redundant node module are arranged to ensure the reliability of the primary controller and the node device during operation, thereby improving the reliability of the entire control system.
[0038] Optionally, the at least one sensor in the control system may include a first type sensor and a second type sensor, and a functional safety integrity level (SIL) of the first type sensor is higher than the functional safety integrity level of the second type sensor. The at least one execution unit in the control system may include a first type execution unit and a second type execution unit, and a functional safety integrity level of the first type execution unit is higher than the functional safety integrity level of the second type execution unit. The first type sensor is connected to the primary control module and the secondary control module individually, or to the primary node module and the secondary node module individually. The second type sensor is connected to one of the primary control module, the secondary control module, the primary node module, and the secondary node module. The first type execution unit is connected to the primary control module and the secondary control module individually, or to the primary node module and the secondary node module individually. The second type execution unit is connected to one of the primary control module, the secondary control module, the primary node module, and the secondary node module.
[0039] According to the solution provided in this application, a device with a higher functional safety integrity level is connected to both control modules of the primary controller or both node modules of the node device. This ensures the reliability of data collection and command execution, thereby improving the security of the control system. However, for a device with a lower functional safety integrity level, the device is connected to only one control module or node device in the primary controller. This simplifies the architecture of the control system and reduces system complexity.
[0040] Optionally, the control system may further include a first power supply and a second power supply, the first power supply being individually connected to the primary control module and the primary node module in the at least one node device, and configured to supply power to the primary control module and the primary node module in the at least one node device, and a second power supply being individually connected to the secondary control module and the secondary node module in the at least one node device, and configured to supply power to the secondary control module and the secondary node module in the at least one node device.
[0041] A redundant second power supply is arranged to supply power to the secondary control module and the secondary node module, thereby ensuring that the two ring subnets in the control system can operate independently and further ensuring the functional safety and reliability of the control system.
[0042] Optionally, the primary controller may be further configured to perform a failure response action when it is detected that any task is not executed at the execution time of the task. The failure response action may include one or more of the following actions: restarting a device for executing any of the tasks, where the device is the primary controller or at least one node device; restarting sensors and / or execution units connected to the device for executing any of the tasks; and executing a security task configured in the primary controller.
[0043] When detecting that an error occurs during task execution, the primary controller can timely implement failure response operations to effectively ensure the security and reliability of the control system.
[0044] Optionally, the control system may further include a gateway. The gateway is connected to the primary controller or at least one node device. The gateway is configured to transmit data from devices connected to the gateway to external devices, and to transmit data from external devices to devices connected to the gateway. The external device is a device independent of the control system.
[0045] In the control system provided in this application, the primary controller or at least one node device may further communicate with external devices using a gateway, thereby enhancing the functionality of the control system and improving the flexibility of the control system in operation.
[0046] Optionally, the gateway may include a primary communication module and a secondary communication module connected to the primary communication module. The two redundant communication modules are designed to ensure functional safety and reliability when the primary controller or at least one node device exchanges data with an external device.
[0047] Optionally, the control system may be a vehicle control system.
[0048] In another aspect, a clock synchronization method is provided. The method may be applied to a primary controller in a control system. The control system includes a ring network, the ring network including the primary controller and at least one node device. The method includes the steps of: performing time adjustment and executing tasks based on a frequency of a local clock signal of the primary controller; and transmitting a reference clock signal to the at least one node device using the ring network. The reference clock signal is obtained based on the local clock signal of the primary controller, and the reference clock signal is used by the at least one node device to perform time adjustment and execute tasks based on the frequency of the reference clock signal.
[0049] Optionally, the reference clock signal is a local clock signal of the primary controller. Alternatively, the reference clock signal is a clock signal obtained by performing frequency division of the local clock signal of the primary controller.
[0050] Optionally, the method further comprises adjusting the frequency of the local clock signal of the primary controller within the target frequency range.
[0051] Optionally, the method further includes utilizing the ring network to transmit a synchronization signal to the at least one node device, the synchronization signal being utilized by the at least one node device to correct a time of a local clock of the at least one node device.
[0052] Optionally, the primary controller is connected to the at least one node device using a clock signal cable. The process of transmitting a reference clock signal and a synchronization signal to the at least one node device using a ring network may include transmitting the reference clock signal and the synchronization signal to the at least one node device using a clock signal cable.
[0053] Optionally, the primary controller is connected to the at least one node device using a clock signal cable and a synchronization signal cable. The process of transmitting a reference clock signal to the at least one node device using a ring network may include transmitting the reference clock signal to the at least one node device using a clock signal cable. The process of transmitting a synchronization signal to the at least one node device using a ring network may include transmitting the synchronization signal to the at least one node device using a synchronization signal cable.
[0054] Optionally, the at least one node device is at least one secondary controller. The control system further includes at least one sensor and at least one execution unit. The at least one sensor is connected to the primary controller or the at least one secondary controller, and the at least one execution unit is connected to the primary controller or the at least one secondary controller. The tasks that need to be performed by the primary controller and the tasks that need to be performed by the at least one secondary controller each include one or more of the following tasks: a data transmission task, a data processing task, a command transmission task, and a drive signal output task. The command is used to instruct the at least one sensor to collect data or to output a drive signal to the at least one execution unit.
[0055] Optionally, the method may further include determining tasks that need to be executed by the primary controller and execution times of the tasks, determining tasks that need to be executed by at least one secondary controller and execution times of the tasks, and transmitting a task scheduling table to the at least one secondary controller. The task scheduling table includes tasks that need to be executed by the at least one secondary controller and execution times of the tasks. Correspondingly, the process of performing time adjustment based on the frequency of the local clock signal of the primary controller and executing the tasks may include performing time adjustment based on the frequency of the local clock signal of the primary controller and executing the tasks at the execution times of the tasks that need to be executed by the primary controller.
[0056] Optionally, the method may further include the steps of dividing a general data processing task into multiple data processing tasks, and determining, based on a load of the primary controller and a load of the at least one secondary controller, a data processing task that needs to be performed by the primary controller and a data processing task that needs to be performed by the at least one secondary controller.
[0057] Optionally, the method may further include transmitting target data to at least one secondary controller using the ring network, and performing fault detection on the ring network and / or retransmitting the target data if the target data transmitted using the ring network is not received or the received target data transmitted using the ring network does not match the transmitted target data.
[0058] Optionally, the control system may further include at least one first router. A first port of the at least one first router is connected to the primary controller, and a second port of the at least one first router is connected to at least one sensor and / or at least one execution unit. A data transmission rate of the first port is lower than a data transmission rate of the ring network, and a data transmission rate of the second port is lower than a data transmission rate of the first port. The method may further include performing frequency division of a frequency of the reference clock signal and transmitting the frequency-divided reference clock signal to the at least one first router.
[0059] Optionally, the primary controller includes a primary control module and a secondary control module connected to the primary control module. At least one node device includes a primary node module and a secondary node module connected to the primary node module. The ring network includes a first ring subnet and a second ring subnet. The first ring subnet includes the primary control module and a primary node module in at least one node device, and the second ring subnet includes the secondary control module and a secondary node module in at least one node device. The reference clock signal is obtained based on a local clock signal of the primary control module. The process of transmitting a reference clock signal to at least one node device using the ring network may include the primary control module individually transmitting the reference clock signal to the secondary control module and the primary node module in the at least one node device. The reference clock signal is transmitted by the primary node module to the secondary node module. Alternatively, the step of transmitting a reference clock signal to at least one node device using the ring network further includes the secondary control module transmitting the reference clock signal to the secondary node module in the at least one node device.
[0060] Optionally, the method may further include performing a failure response action when it is detected that any task is not executed at the execution time of the task, wherein the failure response action includes one or more of the following actions: restarting a device for executing any of the tasks, where the device is the primary controller or at least one node device; restarting sensors and / or execution units connected to the device for executing any of the tasks; and executing a security task set in the primary controller.
[0061] According to yet another aspect, a clock synchronization method is provided. The method is applied to a node device in a control system. The control system includes a ring network, the ring network including a primary controller and at least one node device. The method may include receiving, using the ring network, a reference clock signal transmitted by the primary controller, where the reference clock signal is obtained based on a local clock signal of the primary controller, and performing time adjustment and executing a task based on a frequency of the reference clock signal.
[0062] Optionally, the node device may include a phase-locked loop. A process in which the node device performs time adjustment based on the frequency of the reference clock signal may include: utilizing the phase-locked loop to modify the frequency of the local clock signal of the node device based on the frequency of the reference clock signal to maintain a target ratio between the frequency of the local clock signal of the node device and the frequency of the reference clock signal; and performing the time adjustment based on the frequency of the local clock signal of the node device.
[0063] Optionally, the process in which the node device performs the time adjustment based on the frequency of the reference clock signal may include a step of performing the time adjustment based on the frequency of the reference clock signal.
[0064] Optionally, the method may further include receiving, using the ring network, a synchronization signal transmitted by the primary controller, and correcting the time of a local clock of the node device based on the synchronization signal.
[0065] Optionally, the node device is connected to the primary controller using a clock signal cable. A process of receiving the reference clock signal and the synchronization signal transmitted by the primary controller using the ring network may include receiving the signal transmitted by the primary controller using the clock signal cable, and individually deriving the synchronization signal and the reference clock signal from the received signal based on the amplitude and / or pulse width of the received signal.
[0066] Optionally, the node device is connected to the primary controller using a clock signal cable and a synchronization signal cable. The process of receiving a reference clock signal transmitted by the primary controller using the ring network may include receiving the reference clock signal transmitted by the primary controller using the clock signal cable. The process of receiving a synchronization signal transmitted by the primary controller using the ring network may include receiving the synchronization signal transmitted by the primary controller using the synchronization signal cable.
[0067] Optionally, the node device is a secondary controller. The control system further includes at least one sensor and at least one execution unit. The at least one sensor is connected to the primary controller or the secondary controller, and the at least one execution unit is connected to the primary controller or the secondary controller. The tasks that need to be performed by the primary controller and the tasks that need to be performed by the secondary controller each include one or more of the following tasks: a data transmission task, a data processing task, a command transmission task, and a drive signal output task. The command is used to instruct the at least one sensor to collect data or to instruct the at least one execution unit to output a drive signal.
[0068] Optionally, the method may further include receiving, via the ring network, a task scheduling table transmitted by the primary controller. The task scheduling table includes tasks that need to be executed by the secondary controller and execution times of the tasks. The process of performing time adjustment based on the frequency of the reference clock signal and executing the tasks may include performing time adjustment based on the frequency of the reference clock signal, and executing the tasks at the execution times of the tasks that need to be executed by the secondary controller.
[0069] Optionally, the secondary controller further maintains a priority list, the priority list including a priority of at least one secondary controller included in the control system. The method may further include, when it is determined that the primary controller is faulty or any signal cable connected to the primary controller is faulty, determining a new primary controller from the at least one secondary controller based on the priority list.
[0070] Optionally, the method may further include transmitting target data to other controllers in the control system using the ring network, and performing fault detection on the ring network and / or retransmitting the target data if the target data transmitted using the ring network is not received or if the received target data transmitted using the ring network does not match the transmitted target data.
[0071] Optionally, the control system may further include at least one first router. A first port of the at least one first router is connected to the secondary controller, and a second port of the at least one first router is connected to the at least one sensor and / or the at least one execution unit. A data transmission rate of the first port is lower than a data transmission rate of the ring network, and a data transmission rate of the second port is lower than a data transmission rate of the first port. The method may further include performing frequency division of the frequency of the reference clock signal and sending the frequency-divided reference clock signal to the at least one first router.
[0072] Optionally, the node device is a first router. The control system further includes at least one sensor and at least one execution unit. The at least one sensor is connected to the primary controller or the first router, and the at least one execution unit is connected to the primary controller or the first router. Tasks that need to be performed by the primary controller include one or more of the following tasks: a data transmission task, a data processing task, a command transmission task, and a drive signal output task. Tasks that need to be performed by the first router include one or more of the following tasks: a data transmission task, a command transmission task, and a drive signal output task. The command is used to instruct the at least one sensor to collect data or to instruct the at least one execution unit to output a drive signal.
[0073] Optionally, the first port of the first router is connected to the primary controller. The control system further includes at least one second router. A third port of the at least one second router is connected to the second port of the first router, and a fourth port of the at least one second router is connected to at least one sensor and / or at least one execution unit. A data transmission rate of the first port is equal to a data transmission rate of the ring network, a data transmission rate of the second port is lower than the data transmission rate of the first port, a data transmission rate of the third port is equal to the data transmission rate of the second port, and a data transmission rate of the fourth port is lower than the data transmission rate of the third port. The method may further include performing frequency division of the frequency of the received reference clock signal and transmitting the frequency-divided reference clock signal to the at least one second router.
[0074] For the advantageous effects of the clock synchronization method provided in the above aspects, please refer to the effect description of the corresponding features of the control system, and the details will not be described again in this application.
[0075] According to yet another aspect, a primary controller is provided. The primary controller may be applied to the control system provided in the above aspect. In addition, the primary controller may include a programmable logic circuit and / or program instructions, and the primary controller is configured to implement the method provided in the above aspect and applied to the primary controller.
[0076] According to yet another aspect, a node device is provided. The node device may be applied to the control system provided in the above aspect. In addition, the node device may include a programmable logic circuit and / or program instructions, and the node device is configured to implement the method provided in the above aspect and applied to the node device.
[0077] According to yet another aspect, a vehicle is provided. The vehicle includes the control system provided in the above aspect. The vehicle may be an electric vehicle. Additionally, the vehicle may be an autonomous vehicle, a remotely operated vehicle, an airborne vehicle, or the like.
[0078] The technical solutions provided in this application include at least the following advantageous effects:
[0079] This application provides a control system, a clock synchronization method, a controller, a node device, and a vehicle. A primary controller in the control system may use a ring network to directly transmit a reference clock signal to at least one node device, allowing the at least one node device to perform time adjustment based on the frequency of the reference clock signal. In this manner, clock synchronization between the primary controller and the at least one node device is achieved. Compared with transmitting data frames, directly transmitting the reference clock signal may improve the accuracy of clock synchronization between the primary controller and the at least one node device to an accuracy equal to the pulse width of the reference clock signal, thereby effectively improving the accuracy of clock synchronization. In addition, the primary controller and the at least one node device in the control system may be sequentially connected to form a ring network, ensuring the existence of a redundant signal exchange path when signals are exchanged between the primary controller and the at least one node device, thereby ensuring the reliability of signal transmission. [Brief explanation of the drawings]
[0080] [Figure 1] FIG. 1 is a schematic diagram of the structure of a control system according to an embodiment of the present application. [Figure 2] FIG. 10 is a schematic diagram of a synchronization error between a primary controller and a node device according to an embodiment of the present application; [Figure 3]1 is a schematic diagram illustrating the amplitude of a conducted or radiated signal generated by a frequency-sensitive circuit varying with frequency, according to an embodiment of the present application; [Figure 4] 2 is a schematic diagram of a reference clock signal, a synchronization signal, and a composite signal according to an embodiment of the present application; [Figure 5] FIG. 10 is a schematic diagram of another reference clock signal, a synchronization signal, and a composite signal according to an embodiment of the present application. [Figure 6] FIG. 10 is a schematic diagram of yet another reference clock signal, a synchronization signal, and a composite signal according to an embodiment of the present application. [Figure 7] FIG. 2 is a schematic diagram of a reference clock signal and a synchronization signal according to an embodiment of the present application. [Figure 8] FIG. 1 is a schematic diagram of the structure of another control system according to an embodiment of the present application. [Figure 9] FIG. 10 is a schematic diagram of the structure of yet another control system according to an embodiment of the present application. [Figure 10] FIG. 2 is a schematic diagram of the frequency of a reference clock signal according to an embodiment of the present application; [Figure 11] FIG. 2 is a schematic diagram of the frequency of a reference clock signal and tasks at different rates according to an embodiment of the present application; [Figure 12] FIG. 10 is a schematic diagram of the structure of yet another control system according to an embodiment of the present application. [Figure 13] FIG. 10 is a schematic diagram of the structure of yet another control system according to an embodiment of the present application. [Figure 14] FIG. 10 is a schematic diagram of the structure of yet another control system according to an embodiment of the present application. [Figure 15] FIG. 2 is a schematic diagram of a clock synchronization path according to an embodiment of the present application. [Figure 16] FIG. 1 is a schematic diagram of a local structure of a control system according to an embodiment of the present application. [Figure 17] FIG. 10 is a schematic diagram of another clock synchronization path according to an embodiment of the present application. [Figure 18]FIG. 10 is a schematic diagram of the structure of yet another control system according to an embodiment of the present application. [Figure 19] FIG. 10 is a schematic diagram of the structure of yet another control system according to an embodiment of the present application. [Figure 20] FIG. 10 is a schematic diagram of the structure of yet another control system according to an embodiment of the present application. [Figure 21] 1 is a flowchart of a clock synchronization method according to an embodiment of the present application; [Figure 22] 4 is a flowchart of another clock synchronization method according to an embodiment of the present application. [Figure 23] 10 is a flowchart of yet another clock synchronization method according to an embodiment of the present application; [Figure 24] FIG. 2 is a schematic diagram of the structure of a primary controller according to an embodiment of the present application; DETAILED DESCRIPTION OF THE INVENTION
[0081] In order to make the objectives, technical solutions and advantages of this application more apparent, the following will describe in more detail the implementation of this application with reference to the accompanying drawings.
[0082] An embodiment of this application provides a control system. As shown in Fig. 1, the control system includes a ring network, which includes a primary controller 01 (sometimes referred to as a central controller) and at least one node device 02. For example, Fig. 1 shows three node devices 02. The node device 02 may be a secondary controller or a first router. Both the primary controller 01 and the secondary controller may be control devices including one or more processing chips. The first router may be a forwarding device including one or more forwarding chips.
[0083] The primary controller 01 is configured to perform time adjustment and execute tasks based on the frequency of the local clock signal of the primary controller 01, and to transmit a reference clock signal to at least one node device 02 using the ring network. The reference clock signal is obtained based on the local clock signal of the primary controller 01.
[0084] At least one node device 02 is configured to perform time adjustment and execute tasks based on the frequency of the reference clock signal. For example, the node device 02 may modify the frequency of its local clock signal based on the frequency of the reference clock signal and perform the time adjustment based on the modified frequency of the local clock signal. Alternatively, the node device 02 may directly perform the time adjustment based on the frequency of the reference clock signal. In this manner, clock synchronization between the primary controller 01 and the at least one node device 02 may be achieved.
[0085] The primary controller 01 and at least one node device 02 can form a ring network, thereby ensuring the existence of a redundant signal exchange path when exchanging signals between the primary controller 01 and at least one node device 02. For example, assume that a first interface of the primary controller 01 is connected to one node device 02, and a second interface of the primary controller 01 is connected to the other node device 02. If a signal cable connected to the first interface of the primary controller 01 is faulty, the primary controller 01 may further transmit data to the ring network via the second interface of the primary controller 01, thereby enabling data to be transmitted to the node device 02 connected to the first interface of the primary controller 01 using the ring network.
[0086] It should be understood that clock synchronization between the primary controller 01 and the node device 02 may mean that the ratio of the frequencies of the clock signals referenced when the primary controller 01 and the node device 02 execute tasks is a target ratio. That is, the primary controller 01 and the node device 02 may execute tasks based on beats at a fixed ratio. For example, if the target ratio is 1, it indicates that the frequencies of the clock signals referenced when the primary controller 01 and the node device 02 execute tasks are the same. If the target ratio is n, n is a ratio of two positive integers, and n is not 1, it indicates that the frequency of the clock signal referenced when the primary controller 01 executes a task is n times the frequency of the clock signal referenced when the node device 02 executes a task.
[0087] It should be further understood that, as shown in FIG. 1 , the primary controller 01 may be individually connected to two node devices 02. When transmitting a reference clock signal, the primary controller 01 may transmit the reference clock signal to only one node device 02 connected to the primary controller 01, and then the node device 02 sequentially transmits the reference clock signal to the other node devices 02. In other words, the reference clock signal in the ring network may be transmitted unidirectionally in a clockwise or counterclockwise direction. Alternatively, the primary controller 01 may individually transmit the reference clock signal to the two node devices 02 connected to the primary controller 01, and then the two node devices 02 forward the reference clock signal to the other node devices 02. In other words, the reference clock signal in the ring network may be transmitted bidirectionally in parallel in a clockwise and counterclockwise direction.
[0088] In this embodiment of the present application, in the ring network, not only the primary controller 01 and the node device 02, but also two adjacent node devices 02 may be connected using a signal cable (sometimes referred to as a signal link). Therefore, the primary controller 01 may use the signal cable to transmit a reference clock signal to at least one node device 02. The method in which the primary controller 01 transmits the reference clock signal to at least one node device 02 using the signal cable to achieve clock synchronization may be sometimes referred to as hardware synchronization.
[0089] FIG. 2 is a schematic diagram of a synchronization error between a primary controller and a node device according to an embodiment of this application. As shown in FIG. 2, the primary controller 01 may directly send a reference clock signal to the node device 02, thereby ensuring that the synchronization cycle of the clock synchronization implemented between the primary controller 01 and the node device 02 is the cycle of the reference clock signal. Correspondingly, it is possible to ensure that the error between the time of the primary controller 01 and the time of the node device 02 (i.e., the synchronization error) can be reduced to a level equal to the pulse width of the reference clock signal; in other words, it is possible to ensure that pulse-level clock synchronization can be achieved. For example, assume that the frequency of the reference clock signal is 1 gigahertz (GHz), that is, one clock cycle of the reference clock signal is 1 nanosecond (ns). In this case, the reference clock signal sent by the primary controller 01 every 1 ns can guide the node device 02 to correct its local clock, thereby making the synchronization error less than 1 ns. An ns-level synchronization error can meet the requirements of most real-time control scenarios.
[0090] In summary, an embodiment of this application provides a control system. A primary controller in the control system may use a ring network to directly transmit a reference clock signal to at least one node device, allowing the at least one node device to perform time adjustment based on the frequency of the reference clock signal. In this manner, clock synchronization between the primary controller and the at least one node device is achieved. Compared with transmitting data frames, directly transmitting the reference clock signal may improve the accuracy of clock synchronization between the primary controller and the at least one node device to an accuracy equal to the pulse width of the reference clock signal, thereby effectively improving the accuracy of clock synchronization. In addition, the primary controller and the at least one node device in the control system may be sequentially connected to form a ring network, thereby ensuring the existence of a redundant signal exchange path when exchanging signals between the primary controller and the at least one node device and ensuring the reliability of signal transmission.
[0091] In addition, in the control system provided in this embodiment of the present application, the time synchronization between the primary controller and at least one node device is highly accurate. Therefore, the ECU can ensure that all time-sensitive tasks can be transferred to the primary controller or the node device for execution. This effectively reduces the number of ECUs in the control system and simplifies the function of the ECU (for example, the ECU can be as simple as a router). The control system has lower complexity and higher flexibility.
[0092] Optionally, the reference clock signal may be a local clock signal of the primary controller 01, that is, the primary controller 01 may directly transmit the local clock signal of the primary controller 01 to at least one node device 02 as a reference clock signal.
[0093] Alternatively, the reference clock signal may be a clock signal obtained by performing frequency division on the local clock signal of the primary controller 01. That is, the primary controller 01 may first perform frequency division on the local clock signal of the primary controller 01 to obtain a reference clock signal, and then send the reference clock signal to at least one node device 02.
[0094] Because the frequency of the source clock signal generated by the crystal oscillator in the primary controller 01 is generally within the intermediate frequency range, the local clock signal of the primary controller 01 may be generated after a phase-locked loop (PLL) in the primary controller 01 performs frequency multiplication on the source clock signal based on a preset frequency multiplication value. In addition, because the frequency of the local clock signal generated by the PLL in the primary controller 01 is generally high, to ensure that the node device 02 can support the frequency of the reference clock signal, the primary controller 01 may perform frequency division on the local clock signal of the primary controller 01 to obtain the reference clock signal.
[0095] In an optional implementation, at least one node device 02 may include a PLL. The at least one node device 02 may use the PLL to modify the frequency of the node device 02's local clock signal based on the frequency of the reference clock signal to maintain a target ratio between the frequency of the node device 02's local clock signal and the frequency of the reference clock signal. The at least one node device 02 may then perform time adjustment based on the modified frequency of the at least one node device 02's local clock signal. The node device 02 may use a phase-locked loop to modify the frequency of the node device 02's local clock signal, thereby enabling the frequency of the node device 02's local clock signal and the frequency of the reference clock signal to achieve pulse level synchronization.
[0096] The target ratio may be a fixed value preset in the node device 02, and may be a ratio of two positive integers. For example, if the target ratio is 1, the node device 02 may use a PLL to trace and lock the frequency of the reference clock signal, so that the frequency of the node device 02's local clock signal is equal to the frequency of the reference clock signal.
[0097] In another optional implementation, the node device 02 may alternatively directly perform time adjustment based on the frequency of the reference clock signal. In other words, the node device 02 can perform tasks based on the beat of the reference clock signal without needing to modify the frequency of the node device 02's local clock signal.
[0098] In this embodiment of the application, in a scenario in which node device 02 is a secondary controller, the secondary controller may include a processor and at least one peripheral device connected to the processor. The at least one peripheral device may include an analog-to-digital converter (ADC), a timer, a pulse width modulation (PWM) circuit, a communication interface, etc. The processor may be connected to the at least one peripheral device using a frequency bus and can control the at least one peripheral device to perform tasks. Correspondingly, in this implementation, the processor in the secondary controller can directly control the peripheral device to perform tasks based on the frequency of the reference clock signal. In this way, peripheral bus task synchronization of the at least one secondary controller can be implemented. This synchronization method is sometimes referred to as peripheral hardware synchronization (PHS).
[0099] Optionally, the primary controller 01 may be further configured to adjust the frequency of the local clock signal of the primary controller 01 within a target frequency range. In other words, the primary controller 01 may perform frequency modulation (FM) on the local clock signal of the primary controller 01. Correspondingly, the reference clock signal transmitted by the primary controller 01 to the at least one node device 02 is also the clock signal obtained after frequency modulation. The target frequency range may be a fixed frequency range pre-stored in the primary controller 01.
[0100] Frequency modulation is performed on the local clock signal of the primary controller 01, thereby effectively improving the EMC performance of frequency-sensitive circuits (abbreviated as frequency-sensitive circuits) in the control system during the task execution process. The frequency-sensitive circuits may include communication circuits, drive circuits (sometimes referred to as power output circuits), etc. For example, assume that the drive circuit is a PWM circuit. Since a PWM circuit outputs a PWM signal based on the frequency of a reference clock signal, after the primary controller 01 performs frequency modulation on the local clock signal of the primary controller 01, frequency modulation is also performed on the PWM signal. This effectively improves the EMC performance of the PWM circuit.
[0101] FIG. 3 is a schematic diagram illustrating how the amplitude of a conducted or radiated signal generated by a frequency-sensitive circuit varies with frequency f according to an embodiment of this application. The unit of amplitude is decibel-millivolt (dBmv). Referring to FIG. 3, it can be seen that before the primary controller 01 performs frequency modulation on the local clock signal of the primary controller 01, the conducted or radiated signal generated by the frequency-sensitive circuit has a high amplitude and a narrow spectrum. After performing frequency modulation on the local clock signal of the primary controller 01, the primary controller 01 can reduce the amplitude and widen the spectrum of the conducted or radiated signal generated by the frequency-sensitive circuit, thereby effectively improving the EMC performance of the frequency-sensitive circuit.
[0102] Optionally, the primary controller 01 may be further configured to transmit a synchronization signal to the at least one node device 02 using the ring network. Correspondingly, the at least one node device 02 may be further configured to correct the time of the local clock of the node device 02 based on the received synchronization signal. In other words, based on the solution provided in this embodiment of the present application, the primary controller 01 and the at least one node device 02 can perform not only clock frequency synchronization but also time synchronization. The frequency of the synchronization signal may be significantly lower than the frequency of the reference clock signal, and the frequency of the reference clock signal may be an integer multiple of the frequency of the synchronization signal. For example, the frequency of the reference clock signal may be 1 GHz, and the frequency of the synchronization signal may be 1 kilohertz (kHz).
[0103] For example, assume that the frequency of the synchronization signal is 1 kHz, that is, the primary controller 01 transmits a pulse of the synchronization signal every 1 ms. After receiving each pulse of the synchronization signal, the node device 02 may correct the time of its local clock to a value that is closest to the current time and is an integer multiple of ms. For example, assume that when the node device 02 receives a pulse of the synchronization signal and the time of the node device 02's local clock is 100.001 ms, the node device 02 may correct the time of its local clock to 100 ms.
[0104] In an optional implementation, the primary controller 01 in the ring network may be connected to at least one node device 02 using a clock signal cable. That is, not only the primary controller 01 and the node device 02, but also two adjacent node devices 02 are connected using a clock signal cable. In this implementation, the primary controller 01 may be configured to transmit a synchronization signal and a reference clock signal to at least one node device 02 using the clock signal cable. In other words, the primary controller 01 may transmit a combined signal (sometimes referred to as a superimposed signal) of the synchronization signal and the reference clock signal to at least one node device 02 using one clock signal cable.
[0105] Correspondingly, at least one node device 02 may be configured to separately derive a synchronization signal and a reference clock signal from the received signal based on the amplitude and / or pulse width of the received signal.
[0106] For example, see Figure 4. The pulse width of the synchronization signal may be the same as the pulse width of the reference clock signal, and the primary controller 01 may add the amplitude of the reference clock signal and the amplitude of the synchronization signal to generate a composite signal. Correspondingly, in the process of at least one node device 02 receiving the composite signal, if a pulse whose amplitude is greater than the amplitude of the reference clock signal is detected, it may be determined that a pulse of the synchronization signal is received.
[0107] Alternatively, see Figure 5. The pulse width of the synchronization signal may be the same as the pulse width of the reference clock signal, and the primary controller 01 may subtract the amplitude of the reference clock signal from the amplitude of the synchronization signal to generate a composite signal. Correspondingly, in the process of at least one node device 02 receiving the composite signal, if a pulse whose amplitude is smaller than the amplitude of the reference clock signal is detected, or if no pulse is detected within a clock cycle, it may be determined that the synchronization signal is received.
[0108] In other words, in a scenario where the primary controller 01 generates a composite signal after adding or subtracting the amplitudes of the reference clock signal and the synchronization signal, at least one node device 02 may separate the reference clock signal and the synchronization signal from the composite signal based on the amplitude of the composite signal.
[0109] Optionally, refer to FIG. 6. The pulse width of the synchronization signal may be larger than the pulse width of the reference clock signal. For example, the pulse width of the synchronization signal may be an integer multiple of the pulse width of the reference clock signal. The primary controller 01 may add the reference clock signal and the synchronization signal in the time domain to generate a composite signal. Correspondingly, in the process of at least one node device 02 receiving the composite signal, if a pulse width within a specific pulse cycle and larger than the pulse width of the reference clock signal is detected, it may be determined that a pulse of the synchronization signal is received. In other words, the at least one node device 02 may separate the reference clock signal and the synchronization signal from the composite signal based on the pulse width of the composite signal.
[0110] In the above implementation, the primary controller 01 transmits a composite signal of the synchronization signal and the reference clock signal using a single clock signal cable, which prevents an increase in the number of signal cables between adjacent devices in the ring network and simplifies the structure of the control system.
[0111] It should be understood that in the above implementation, the clock signal cable connected between two adjacent devices in the ring network may be a signal cable capable of transmitting both data and clock signals. For example, the signal cable may be an Ethernet cable. Alternatively, for a time sensitive network (TSN), two adjacent devices in the ring network may be connected to both a data signal cable for transmitting data and a dedicated clock signal cable for transmitting a reference clock signal.
[0112] In another optional implementation, the primary controller 01 in the ring network may be connected to at least one node device 02 using a clock signal cable and a synchronization signal cable. That is, not only the primary controller 01 and the node device 02, but also two adjacent node devices 02 are connected using a clock signal cable and a synchronization signal cable. See FIG. 7. In this implementation, the primary controller 01 may be configured to transmit a reference clock signal to at least one node device 02 using the clock signal cable and to transmit a synchronization signal to at least one node device 02 using the synchronization signal cable. At least one node device 02 may receive the reference clock signal using the clock signal cable and receive the synchronization signal using the synchronization signal cable.
[0113] The primary controller 01 transmits the synchronization signal and the reference clock signal separately using different signal cables, so that at least one node device 02 does not need to parse the synchronization signal and the reference clock signal from the received composite signal, thereby reducing the complexity of receiving the synchronization signal and the reference clock signal by the node device 02.
[0114] Optionally, as shown in Fig. 8, the control system may further include at least one sensor 03 and at least one execution unit 04. The at least one sensor 03 may be connected to the primary controller 01 or the node device 02, and the at least one execution unit 04 may be connected to the primary controller 01 or the node device 02. The sensor 03 may be an image sensor, a speed sensor, a temperature sensor, a barometric pressure sensor, a laser radar, an ultrasonic radar, or the like. The execution unit 04 may be a motor, a valve, a switch, a relay, or the like.
[0115] In a scenario where at least one node device 02 is at least one secondary controller, the tasks that need to be performed by the primary controller 01 and the tasks that need to be performed by the at least one secondary controller 02 may each include one or more of the following tasks: a data transmission task, a data processing task, a command transmission task, and a drive signal output task. The command may be used to instruct the sensor 03 to collect data or to output a drive signal to the execution unit 04. Correspondingly, the data transmission may be transmitting data collected by the sensor 03. The data processing may be processing the data collected by the sensor 03.
[0116] In this embodiment of the application, a controller in the control system (which may be a primary controller 01 or a secondary controller 02) may directly generate a drive signal and output the drive signal to an executive unit 04 connected to the controller to drive the executive unit 04 to operate. Alternatively, the controller may be connected to the executive unit 04 using a drive circuit. When the controller needs to drive the executive unit 04 to operate, the controller may send an instruction to the drive circuit, which is used to instruct the drive circuit to output a drive signal. The drive circuit may further output a drive signal to the executive unit 04 based on the instruction to drive the executive unit 04 to operate.
[0117] Optionally, the primary controller 01 may be further configured to determine tasks that need to be executed by the primary controller 01 and execution times for the tasks, determine tasks that need to be executed by at least one secondary controller 02 and execution times for the tasks, execute the tasks at the execution times for the tasks that need to be executed by the primary controller 01, and transmit a task scheduling table to the at least one secondary controller 02 using the ring network. The task scheduling table received by the at least one secondary controller 02 may include tasks that need to be executed by the at least one secondary controller 02 and execution times for the tasks.
[0118] Correspondingly, the at least one secondary controller 02 may execute the task at the execution time corresponding to the task that needs to be executed by the at least one secondary controller 02 based on the task scheduling table.
[0119] In this embodiment of the present application, the primary controller 01 may use a time division task (TDT) technique to unify and schedule tasks that need to be executed by the primary controller 01 and at least one secondary controller 02. Tasks that need to be executed by different controllers are assigned to different time slots. In this way, the primary controller 01 and at least one secondary controller 02 may execute each task in an orderly manner based on a pre-configured task scheduling table, preventing problems such as resource preemption or contention that occur when multiple tasks are executed simultaneously, and ensuring that each task can be executed in an orderly and efficient manner.
[0120] For example, assume that tasks to be executed by a specific controller (which may be the primary controller 01 or the secondary controller 02) include a command transmission task and a data transmission task, and the command is used to instruct a sensor 03 to collect data. In this case, the execution time of the command transmission task recorded in the task scheduling table is the collection time, and the execution time of the data transmission task is the data transmission time. Correspondingly, when the controller detects that the collection time has arrived, it may automatically transmit a command to the sensor 03 connected to it, instructing the sensor 03 to collect data. In addition, after obtaining the data collected by the sensor 03, the controller may automatically transmit the data when it detects that the transmission time has arrived.
[0121] It should be understood that if the control system includes multiple different types of sensors 03 that need to collect data synchronously, the primary controller 01 may set the execution times of tasks used to instruct the sensors 03 to collect data at the same time. In other words, the controllers in the ring network may send commands used to instruct the sensors 03 to collect data at the same time.
[0122] For example, sensors that need to collect data synchronously within a control system may include a sensor that collects rotor position and a sensor that collects phase current physics-dependent signals during field-oriented control (FOC) of a permanent-magnet synchronous motor (PMSM), or may include sensors for collecting intensive data such as laser radar, ultrasonic radar, and visible light image sensors, or may include multiple sensors for redundancy checking.
[0123] Optionally, the primary controller 01 may be further configured to generate a general task scheduling table. The general task scheduling table may include tasks that need to be executed by the primary controller 01 and their execution times, and tasks that need to be executed by at least one secondary controller 02 and their execution times. In addition, the task scheduling table sent by the primary controller 01 to each secondary controller 02 may be a general task scheduling table. In a scenario in which the primary controller 01 directly sends the general task scheduling table to each secondary controller 02, each secondary controller 02 can obtain the tasks that need to be executed by the other secondary controllers 02 and their execution times. This allows any secondary controller 02 to unify and manage the tasks that need to be executed by the controllers in the control system based on the general task scheduling table when the primary controller 01 fails, ensuring that any secondary controller 02 can quickly take over the operation of the primary controller 01 based on the general task scheduling table.
[0124] Alternatively, the task scheduling table sent by the primary controller 01 to each secondary controller 02 may include only the tasks that need to be executed by the secondary controller 02 and the execution times of those tasks, and need not include the tasks that need to be executed by other secondary controllers 02. In this way, when the secondary controller 02 determines the execution times of the tasks that need to be executed by it from the task scheduling table, interference by tasks that need to be executed by other controllers is prevented.
[0125] For example, assume that a control system includes a primary controller E5 and four secondary controllers E1 to E4, as shown in FIG. 9 . A general task scheduling table generated by the primary controller E5 may be shown in Table 1. It can be seen from Table 1 that the secondary controller E1 needs to execute task 1 at time t1, the secondary controller E3 needs to execute task 4 at time t4, and the secondary controller E3 needs to execute task 5 at time t5. In this case, the primary controller E5 may transmit the general task scheduling table shown in Table 1 to the secondary controllers E1 to E4 individually, or the primary controller E5 may specifically transmit only a portion of the contents of Table 1 to each secondary controller. For example, the task scheduling table transmitted by the primary controller E5 to the secondary controller E1 may include only task 1 and the execution time t1 of task 1. The task scheduling table transmitted by the primary controller E5 to the secondary controller E4 may include only task 6 and the execution time t6 of task 6.
[0126] [Table 1]
[0127] Optionally, each of the primary controller 01 and at least one secondary controller 02 in the control system may be connected to sensors 03 and / or an execution unit 04 that are physically close to the primary controller 01 and at least one secondary controller 02. Different controllers may have different software modules and operating systems loaded on them, but the communication interfaces of the different controllers may be the same and the computing resources of the different controllers may be shared.
[0128] Correspondingly, the primary controller 01 may be further configured to divide a general data processing task into multiple data processing tasks and determine, based on the load of the primary controller 01 and the load of the at least one secondary controller 02, the data processing tasks that need to be performed by the primary controller 01 and the data processing tasks that need to be performed by the at least one secondary controller 02.
[0129] In other words, for a general data processing task that requires a large amount of computing resources, the primary controller 01 can schedule multiple controllers in the ring network to cooperatively execute the general data processing task, thereby realizing distributed execution of the data processing task and further improving the utilization rate of the computing resources of the controllers based on the improved task execution efficiency.
[0130] In addition, in this embodiment of the present application, the primary controller 01 may further dynamically allocate data processing tasks based on the importance, function requirements, security requirements, and performance impact of each data processing task, which effectively improves the flexibility of task scheduling and realizes appropriate utilization of the computing resources of each controller.
[0131] Optionally, the secondary controllers 02 in the control system may further maintain a priority list, the priority list including the priority of the at least one secondary controller 02. The at least one secondary controller 02 may be further configured to determine a new primary controller from the at least one secondary controller 02 based on the priority list when it is determined that the primary controller 01 is faulty or any signal cable connected to the primary controller 01 is faulty. The new primary controller may then implement unified scheduling management for the multiple controllers in the control system, and in particular, may ensure that primary control of the control system is handed over to the new primary controller to ensure that the control system can still operate properly.
[0132] For example, with reference to FIG. 9, assume that the priorities of the four secondary controllers E1-E4 in the priority list are E4>E3>E2>E1, and that when the primary controller E5 fails, the secondary controller E4 can operate in place of the primary controller E5.
[0133] It should be understood that the primary controller 01 may also maintain a priority list. Additionally, in addition to the priority of the at least one secondary controller 02, the priority list may further record the priority of the primary controller 01, and the priority of the primary controller 01 may be higher than the priority of the at least one secondary controller 02. In this way, it can be ensured that the primary controller 01 can regain primary control of the control system after the primary controller 01 recovers from a faulty state.
[0134] Optionally, a failure detection algorithm is configured in both the primary controller 01 and the at least one secondary controller 02. The primary controller 01 and the at least one secondary controller 02 may detect whether the primary controller 01 is faulty or whether a signal cable connected to the primary controller 01 is faulty based on the failure detection algorithm. For example, the primary controller 01 may periodically send a heartbeat message to the at least one secondary controller 02 based on a preset period. If none of the at least one secondary controller 02 receives a heartbeat message within a specific period, the at least one secondary controller 02 may determine that the primary controller 01 is faulty. If some secondary controllers 02 do not receive a heartbeat message within a specific period, but the remaining secondary controllers 02 receive a heartbeat message, the at least one secondary controller 02 may determine that the primary controller 01 is not faulty, but the signal cable between the primary controller 01 and some of the secondary controllers 02 is faulty.
[0135] In this embodiment of the application, after receiving data transmitted by another controller, a controller in the control system (which may be the primary controller 01 or the secondary controller 02) may compare the identifier (ID) of the received data with the ID of the controller. If the ID of the data is the same as the ID of the controller, the controller may perform reception processing on the received data. If the ID of the data is different from the ID of the controller, the controller may forward the received data. In addition, to ensure that the data can be effectively transmitted to the receiving end, the controller may drive (e.g., shape and amplify) the data before forwarding it.
[0136] Optionally, the ring network may transmit data via a shared bus. That is, at any given time, only one of the primary controller 01 and the at least one secondary controller 02 may be used as a transmitting end to transmit data, and the remaining controllers may be used as receiving ends to receive data. For example, only the secondary controller E1 may transmit data at a particular time, while the secondary controllers E2 to E4 and the primary controller E5 all receive data. Alternatively, the ring network may be a packet network. That is, the primary controller 01 and at least one secondary controller 02 included in the control system may be divided into multiple groups, each group including at least two controllers. At each time, controllers in different groups may exchange data simultaneously. For example, assume that the secondary controller E1 and the secondary controller E2 form a group, and the secondary controller E3 and the secondary controller E4 form a group. At a particular time, the secondary controller E1 may send data to the secondary controller E2, and the secondary controller E3 may send data to the secondary controller E4.
[0137] Optionally, a controller in the control system (which may be the primary controller 01 or the secondary controller 02) may be further configured to transmit target data to other controllers using the ring network, and to perform fault detection on the ring network and / or retransmit the target data if the target data transmitted using the ring network is not received or the received target data transmitted using the ring network does not match the target data transmitted by the controller.
[0138] The target data may be data that has high security requirements and needs to be shared by multiple controllers included in the ring network. For example, the target data may include vehicle speed. In other words, after transmitting the target data with high security requirements using the ring network, the primary controller 01 or the secondary controller 02 may detect whether other controllers in the ring network have correctly received the target data. In this way, it is possible to ensure that the target data can be reliably transmitted to the receiver.
[0139] For example, assume that a ring network includes a primary controller 01 and m-1 secondary controllers 02, i.e., the ring network includes a total of m controllers. In this case, all target data sent by a controller in the ring network needs to be forwarded m times before being sent back to the controller again, where m is an integer greater than 1. If the period for transmitting target data between two adjacent controllers is n clock cycles, after sending the target data, the controller in the ring network may verify data integrity by detecting whether the data received after n x m clock cycles matches the target data. If the controller does not receive data after n x m clock cycles or the received data does not match the target data, the controller may perform fault detection on the ring network and / or resend the target data.
[0140] The process by which a controller performs fault detection on a ring network may include the controller sending detection data to other controllers in the ring network, and after receiving the detection data, the other controllers in the ring network feeding back response data to the sender of the detection data, and finally, the sender of the detection data may determine that the controller or signal cable is faulty based on the received response data.
[0141] In a scenario where at least one node device 02 is a secondary controller, the control system may further include at least one first router 05, as shown in Figure 8. A first port 051 of the first router 05 is connected to the primary controller 01 or the secondary controller 02. A second port 052 of the first router 05 is connected to at least one sensor 03 and / or at least one execution unit 04. The data transmission rate of the first port 051 is lower than the data transmission rate of the ring network, and the data transmission rate of the second port 052 is lower than the data transmission rate of the first port 051.
[0142] The controller connected to the at least one first router 05 is further configured to perform frequency division on the frequency of the reference clock signal transmitted within the ring network and transmit the frequency-divided reference clock signal to the at least one first router 05.
[0143] The at least one first router 05 may be configured to perform time adjustments and execute tasks based on the frequency of the received frequency-divided reference clock signal. The tasks executed by the at least one first router 05 may include at least exchanging data with a controller connected to the at least one first router 05 via a first port 051, and exchanging data with at least one sensor 03 and / or at least one execution unit 04 connected to the at least one first router 05 via a second port 052.
[0144] Based on the above description, it can be understood that in the ring network, the primary controller 01 and the secondary controller 02 may transmit data at a higher data transmission rate and perform time adjustment at a higher frequency. In addition, the primary controller 01 or the secondary controller 02 connected to the first router 05 may reduce the data transmission rate before transmitting data to the first router 05, and may reduce the frequency of the reference clock signal before transmitting the reference clock signal to the first router 05. Similarly, the first router 05 may increase the data transmission rate before transmitting data to the controller connected to the first router 05.
[0145] Therefore, in this embodiment of the present application, sensors 03 (e.g., image sensors) and / or execution units 04 having high requirements for data transmission rate may be directly connected to the controller in the ring network. The controller sends commands at a higher reference clock signal frequency and transmits data at a higher data transmission rate. Sensors 03 (e.g., sound sensors) and / or execution units 04 having general requirements for data transmission rate may be connected to the first router 05. The first router 05 sends commands at an intermediate reference clock signal frequency and transmits data at an intermediate data transmission rate. Therefore, the control system provided in this embodiment of the present application may be compatible with different types of sensors and execution units, which effectively improves the application flexibility of the control system.
[0146] Further referring to Figure 8, the control system may further include at least one second router 06. A third port 061 of the second router 06 is connected to a second port 052 of the first router 05. A fourth port 062 of the second router 06 is connected to at least one sensor 03 and / or at least one execution unit 04. The data transmission rate of the third port 061 may be equal to the data transmission rate of the second port 052, and the data transmission rate of the fourth port 062 may be lower than the data transmission rate of the third port 061.
[0147] The first router 05 connected to the second router 06 may be further configured to perform frequency division on the frequency of the reference clock signal received via the first port 051 and transmit the frequency-divided reference clock signal to the second router 06 connected to the first router 05 via the second port 052.
[0148] The at least one second router 06 may be configured to perform time adjustments and execute tasks based on the frequency of the reference clock signal transmitted by the first router 05. The tasks executed by the second router 06 may include at least exchanging data with the at least one first router 05 via the third port 061 and exchanging data with the at least one sensor 03 and / or at least one execution unit 04 connected to the second router 06 via the fourth port 062.
[0149] Based on the above description, it can be understood that the first router 05 may reduce the data transmission rate before transmitting data to the second router 06, and may reduce the frequency of the reference clock signal before transmitting the reference clock signal to the second router 06. Similarly, the second router 06 may increase the data transmission rate before transmitting data to the first router 05. Therefore, in the control system, sensors 03 (e.g., water temperature sensors) and / or execution units 04 that have low requirements for data transmission rate may be connected to the second router 06. The second router 06 transmits commands at a lower frequency of the reference clock signal and transmits data at a lower data transmission rate.
[0150] Based on the above value relationship between the data transmission rate and the frequency of the reference clock signal, it can be understood that the ring network may be referred to as a high-speed ring network, the first router 05 may be referred to as a medium-speed router, and the second router 06 may be referred to as a low-speed router. In other words, the control system uses the primary controller 01 and at least one secondary controller 02 in the ring network as root nodes to form a tree structure through a combination of various levels of cascaded routers. It can be understood that the control system may further include more other lower-level routers connected to the second router 06. This is not limited in this embodiment of the present application.
[0151] According to the control system provided in this embodiment of the present application, the first router 05 and the second router 06 may be used to gradually reduce the data transmission rate and the frequency of the reference clock signal, so that the controllers (including the primary controller 01 and the secondary controller 02) in the ring network, the first router 05, and the second router 06 can execute instructions based on reference clock signals with different frequencies. In this way, the application flexibility and compatibility of the control system are effectively improved. In addition, multiple routers at different levels are arranged. This can ensure smooth transitions of the data transmission rate and the frequency of the reference clock signal, and further ensure the stability of data transmission.
[0152] It should be understood that in the control system, the primary controller 01, the secondary controller 02, and the first router 05 may all perform frequency division on the reference clock signal based on a preset frequency division value. For example, see FIG. 10. Assume that the frequency of the reference clock signal transmitted by the primary controller 01 in the ring network to at least one secondary controller 02 is F1, the frequency F2 of the reference clock signal transmitted by any controller in the ring network to the first router 05 connected to that controller may satisfy F2 = F1 / N1, and the frequency F3 of the reference clock signal transmitted by the first router 05 to the second router 06 may satisfy F3 = F2 / N2. Both N1 and N2 may be integers greater than 1, and N1 and N2 may or may not be equal. For example, the value range of frequency F1 may be 1 GHz to 10 GHz, the value range of frequency F2 may be 100 megahertz (MHz) to 500 MHz, and the value range of frequency F3 may be 10 MHz to 20 MHz.
[0153] 11, the primary controller 01 and at least one secondary controller 02 in the ring network may execute high-speed tasks based on a reference clock signal whose frequency is F1. At least one first router 05 may execute medium-speed tasks based on a reference clock signal whose frequency is F2. At least one second router 06 may execute low-speed tasks based on a reference clock signal whose frequency is F3.
[0154] It should further be understood that the frequency division value set in the primary controller 01, the frequency division value set in the at least one secondary controller 02, and the frequency division value set in the first router 05 may all be dynamically set by the primary controller 01 based on the rate requirements of the tasks to be executed.
[0155] In this embodiment of the present application, the primary controller 01 may assign tasks with different rate requirements to devices at different levels (including the primary controller, the secondary controller, the first router, and the second router) for execution based on the rate requirements of the tasks to be executed. In addition, the execution time slots (i.e., execution times) of the tasks may be dynamically allocated by the primary controller 01, which effectively improves the flexibility of task execution. In addition, in the task execution process, the secondary controller 02, the first router 05, and the second router 06 may further monitor the execution times of the tasks and report the monitoring results to the primary controller 01. When the primary controller 01 needs to assign a new task, the primary controller 01 may determine the controller for executing the new task and the execution time of the new task based on the time series in the general task scheduling table, the monitoring results of the received tasks, and the load of each controller in the ring network. In this way, dynamic allocation of computing resources and communication resources in the control system can be realized.
[0156] It should be further understood that for any one of the at least one first router 05 and the at least one second router 06, if the instruction received by the router is an instruction used to instruct the router to collect data, the router may forward the instruction directly to the sensor 03 connected to the router to instruct the sensor 03 to collect data. If the instruction received by the router is an instruction used to instruct the router to output a drive signal and the router includes a drive circuit, the router may directly execute the instruction. That is, the router may output the drive signal to the execution unit 04 connected to the router based on the frequency of the received reference clock signal. If the instruction received by the router is an instruction used to instruct the router to output a drive signal and the router does not include a drive circuit, the router may forward the instruction directly to the drive circuit of the execution unit 04. After receiving the instruction, the drive circuit may generate a drive signal and output the drive signal to the execution unit 04.
[0157] It should be understood that in this embodiment of the present application, both the primary controller 01 and the secondary controller 02 may be connected to one or more first routers 05, and each first router 05 may also be connected to one or more second routers 06. For example, see FIG. 12. Each of the secondary controllers E1 to E4 is connected to two first routers. For example, the secondary controller E1 is connected to two first routers M1, and the secondary controller E2 is connected to two first routers M2. The primary controller E5 is connected to the first router M5. In addition, each of the first routers M1 to M4 is connected to three second routers. For example, the first router M1 is connected to three second routers L1, and the first router M4 is connected to three second routers L4. The first router M5 is not connected to any second routers.
[0158] See Figure 13. In a scenario where at least one node device 02 is at least one first router 02, at least one sensor 03 in the control system may be connected to the primary controller 01 or the at least one first router 02. At least one executive unit 04 in the control system may be connected to the primary controller 01 or the at least one first router 02.
[0159] The tasks that need to be performed by the primary controller 01 include one or more of the following tasks: data transmission tasks, data processing tasks, command transmission tasks, and drive signal output tasks. The tasks that need to be performed by the at least one first router 02 may include one or more of the following tasks: data transmission tasks, command transmission tasks, and drive signal output tasks. The commands may be used to instruct the sensors 03 to collect data or to output drive signals to the execution unit 04.
[0160] In a scenario where at least one node device 02 is at least one first router 02, the primary controller 01 can perform centralized control of devices in the control system. Since most software functions can be moved to the primary controller 01, a conventional ECU can be transformed into the first router 02. The first router 02 only needs to collect data and output drive signals or forward instructions according to the primary controller 01's instructions and strict time sequence. Therefore, compared with a conventional ECU, the hardware structure of the first router 02 can be effectively simplified and the cost can be significantly reduced. For example, the first router 02 only needs to include circuits such as an analog amplifier circuit, an ADC, a timer, a PWM circuit, and a communication interface, and does not need to include circuits for performing data processing, such as a processor.
[0161] Optionally, as shown in Figure 13, the first router 02 may be connected to the primary controller 01 via a first port 021 of the first router 02, and in particular, the first router 02 may access the ring network via the first port 021 of the first router 02. In addition, the control system may further include at least one second router 06. A third port 061 of the second router 06 is connected to a second port 022 of the first router 02, and a fourth port 062 of the second router is connected to at least one sensor 03 and / or at least one execution unit 04. The data transmission rate of the first port 021 is equal to the data transmission rate of the ring network, the data transmission rate of the second port 022 is lower than the data transmission rate of the first port 021, the data transmission rate of the third port 061 is equal to the data transmission rate of the second port 022, and the data transmission rate of the fourth port 062 is lower than the data transmission rate of the third port 061.
[0162] In addition, the first router 02 connected to the second router 06 may be further configured to perform frequency division on the frequency of the reference clock signal and transmit the frequency-divided reference clock signal to the second router 06.
[0163] The at least one second router 06 may be configured to perform time adjustment and execute tasks based on the frequency of the reference clock signal transmitted by the first router 02. The tasks executed by the at least one second router 06 may include at least exchanging data with the at least one first router 02 via the third port 061 and exchanging data with the at least one sensor 03 and / or at least one execution unit 04 connected to the at least one second router 06 via the fourth port 062.
[0164] For example, as shown in Figure 14, the control system may include a primary controller E5 and a total of four first routers H1 to H4. Each first router is further connected to two second routers. For example, the first router H1 is connected to two second routers M1, and the first router H3 is connected to two second routers M3.
[0165] In a scenario where at least one node device 01 is a first router, it should be understood that the control system may further include at least one third router connected to the second router 06. Correspondingly, the second router 06 may perform frequency division on the frequency of the reference clock signal transmitted by the first router 02 and transmit the frequency-divided reference clock signal to the third router. The third router may further perform time adjustment and perform tasks based on the frequency of the reference clock signal transmitted by the second router 06.
[0166] For example, see Figure 14. Each second router is connected to three third routers. For example, the second router M2 is connected to three third routers L2, and the second router M4 is connected to three third routers L4. It can be understood that the control system may further include more other lower-level routers connected to the third routers. This is not limited in this embodiment of the present application.
[0167] Based on the above-mentioned value relationship between the data transmission rate and the frequency of the reference clock signal, it can be understood that the first router 02 in the control system may be referred to as a high-speed router, the second router 06 may be referred to as a medium-speed router, and the third router may be referred to as a low-speed router. In other words, the control system may use the primary controller 01 as a centralized controller, and use the primary controller 01 and at least one first router 02 as a root node to form a tree structure through a combination of other lower-level routers such as second routers and third routers.
[0168] Optionally, in this embodiment of the application, the primary controller 01 may further monitor the execution time of the primary controller 01 to execute a task and monitor the execution time of the node device 02 to execute a task. For example, the primary controller 01 may monitor the execution time of a task using a watchdog timer. The primary controller 01 may be further configured to perform a failure response action when it is detected that any task is not executed at the execution time of the task. The failure response action may include one or more of the following actions: restarting a device for executing any of the tasks, which may be the primary controller 01 or at least one node device 02; restarting a sensor 03 and / or an execution unit 04 connected to a device for executing any of the tasks; and executing a security task configured in the primary controller 01.
[0169] A security task is a task that can enable a control system to enter a safe state. The type of security task varies based on different application scenarios. For example, in a vehicle control system, the security task may be a redundancy switch task, a deceleration task, or a pull-over task. In other types of control systems, the security task may be a redundancy switch task, a system diagnostic and protection task, etc.
[0170] The redundancy switching task may be to assign a task that needs to be performed by a device for performing any of the above tasks to another device. For example, if the primary controller 01 determines that a secondary controller for performing any of the above tasks is a faulty controller, the primary controller 01 may instruct another secondary controller to perform the associated task of the faulty secondary controller. Optionally, the primary controller 01 may further determine whether to instruct the restarted device to perform any of the above tasks again based on the status of the restarted device, or the status of the restarted sensor 03 and / or the status of the restarted execution unit 04.
[0171] For example, assume that t6>t5 in the general task scheduling table shown in Table 1. If the primary controller 01 detects that task 6 is executed before task 5 due to an execution timing error, the secondary controller E4 may be restarted. Alternatively, the sensor 03 and the execution unit 04 connected to the secondary controller E4 may be restarted. In the control system provided in this embodiment of the present application, the primary controller 01 performs a failure response action in a timely manner when it detects that an error occurs in the task execution timing, thereby effectively ensuring the security and reliability of the control system.
[0172] Optionally, in the control system provided in this embodiment of the present application, the primary controller 01 may include a primary control module and a secondary control module connected to the primary control module. At least one node device 02 may include a primary node module and a secondary node module connected to the primary node module. In addition, the ring network may include a first ring subnet and a second ring subnet. The first ring subnet includes the primary control module and a primary node module in at least one node device 02, and the second ring subnet includes a secondary control module and a secondary node module in at least one node device 02. In other words, the primary control module and the primary node module in at least one node device 02 may be sequentially connected to form a first ring subnet in the ring network. The secondary control module and the secondary node module in at least one node device 02 may be sequentially connected to form a second ring subnet in the ring subnet.
[0173] The functions of the primary control module and the secondary control module may be the same, and the two control modules may operate in parallel. In addition, each of the primary control module and the secondary control module may be a processing chip. Similarly, the functions of the primary node module and the secondary node module may be the same, and the two node modules may operate in parallel. In addition, if the node device 02 is a secondary controller, each of the primary node module and the secondary node module may be a processing chip. If the node device 02 is a first router, each of the primary node module and the secondary node module may be a forwarding chip.
[0174] For example, see FIGS. 9, 12, and 14. The primary controller E5 includes a primary control module E5(A) and a secondary control module E5(B). In a scenario in which the node device 02 is the secondary controller, as shown in FIGS. 9 and 12, in the secondary controllers E1 to E4, the secondary controller Em includes a primary node module Em(A) and a secondary node module Em(B). In a scenario in which the node device 02 is the first router, as shown in FIG. 14, in the first routers H1 to H4, the first router Hm includes a primary node module Hm(A) and a secondary node module Hm(B). m represents the serial numbers of the four node devices 02, that is, m is an integer greater than or equal to 1 and less than or equal to 4. For example, the secondary controller E1 includes a primary node module E1(A) and a secondary node module E1(B).
[0175] See FIG. 9. For example, node device 02 is a secondary controller. Primary control module E5(A) and the primary node modules of the four secondary controllers may be sequentially connected using signal cables X15(A), X12(A), X23(A), X34(A), and X45(A) to form a first ring subnet in the ring network. Secondary control module E5(B) and the secondary node modules of the four secondary controllers may be sequentially connected using signal cables X15(B), X12(B), X23(B), X34(B), and X45(B) to form a second ring subnet in the ring network.
[0176] In the control system provided in this embodiment of the present application, the functions of the secondary control module and the primary control module may be the same, and the functions of the secondary node module and the primary node module may also be the same. Therefore, the secondary control module may also be referred to as a redundant control module, and the secondary node module may also be referred to as a redundant node module. Correspondingly, both the signal cable between the secondary control module and the primary control module and the signal cable between the primary node module and the secondary node module may also be referred to as a redundant signal cable. The redundant control module and the redundant node module are utilized to ensure the reliability of the primary controller and node devices during operation, thereby improving the reliability of the entire control system.
[0177] It should be understood that each of the primary control module and secondary control module in the primary controller 01 has a local clock signal, and the reference clock signal can be obtained based on the local clock signal of the primary control module in the primary controller 01. In other words, the local clock signal of the primary control module in the primary controller 01 can be used as a clock reference for the entire control system. For example, the reference clock signal can be the local clock signal of the primary control module in the primary controller 01, or the reference clock signal can be a clock signal obtained by performing frequency division on the local clock signal of the primary control module in the primary controller 01.
[0178] Correspondingly, the primary control module in the primary controller 01 may be configured to use the first ring subnet to transmit a reference clock signal to a primary node module in at least one node device 02, and to transmit the reference clock signal to a secondary control module in the primary controller 01.
[0179] The secondary control module in the primary controller 01 is configured to transmit a reference clock signal to a secondary node module in at least one node device 02 using the second ring subnetwork. Alternatively, the primary node module in at least one node device 02 may be configured to transmit a reference clock signal to a secondary node module connected to the primary node module. In other words, the reference clock signal received by the secondary node module in the node device 02 may be transmitted by the primary node module connected to the secondary node module, or may be transmitted by the secondary control module in the primary controller 01 using the second ring subnetwork.
[0180] For example, FIG. 15 is a schematic diagram of a clock synchronization path. See FIG. 15. The primary control module E5(A) of the primary controller E5 may individually transmit a reference clock signal to the secondary control module E5(B), the primary node module E1(A) of the secondary controller E1, and the primary node module E4(A) of the secondary controller E4. Then, the primary node module E1(A) of the secondary controller E1 may individually transmit a reference clock signal to the secondary node module E1(B) and the primary node module E2(A) of the secondary controller E2. Similarly, the primary node module E4(A) of the secondary controller E4 may individually transmit a reference clock signal to the secondary node module E4(B) and the primary node module E3(A) of the secondary controller E3. Finally, the primary node module E2(A) of the secondary controller E2 may send a reference clock signal to the secondary node module E2(B), and the primary node module E3(A) of the secondary controller E3 may send a reference clock signal to the secondary node module E3(B). In this way, clock synchronization of the entire control system can be achieved.
[0181] It should be understood that the transmission directions of signals (including reference clock signals, data, instructions, etc.) transmitted in the first ring subnet and the second ring subnet may be the same or different. For example, the transmission direction of signals transmitted in the first ring subnet may be clockwise, and the transmission direction of signals transmitted in the second ring subnet may be counterclockwise.
[0182] 15 , it can be seen that in the control system, when a control module (which may be a primary control module or a secondary control module) in the primary controller 01 transmits a signal, there may be three transmission directions: clockwise transmission on the ring subnet, counterclockwise transmission on the ring subnet, and transmission to other control modules. When a node module (which may be a primary node module or a secondary node module) in the node device 02 transmits a signal, there may also be three transmission directions: clockwise transmission on the ring subnet, counterclockwise transmission on the ring subnet, and transmission to other node modules. The transmission direction in which the control module and node module actually transmit signals may be controlled by the primary control module in the primary controller 01. Alternatively, in a scenario in which the node device 02 is a secondary controller, the transmission method in which the node module transmits a signal may be determined by the node module based on a fault condition detected by the node module. For example, when detecting that the interface of the node module is faulty or the signal cable connected to the interface is faulty, the node module may disable the interface, for example, set the interface to an inactive (down) state, and transmit the signal through another interface.
[0183] In this embodiment of the present application, at least one sensor 03 included in the control system may be classified into a first type sensor and a second type sensor. The functional safety level of the first type sensor may be higher than the functional safety level of the second type sensor. The first type sensor may be individually connected to a primary control module and a secondary control module in the primary controller 01, or may be individually connected to a primary node module and a secondary node module in the node device 02. The second type sensor may be connected to one of the primary control module, the secondary control module, the primary node module, and the secondary node module.
[0184] In other words, a first type of sensor having a higher functional safety level may be connected to both control modules in the primary controller 01 or to both node modules in the node device 02. However, a second type of sensor having a lower functional safety level may be connected to only one module in the primary controller 01 or the node device 02.
[0185] Similarly, the at least one execution unit 04 may include a first type execution unit and a second type execution unit. The functional safety level of the first type execution unit is higher than the functional safety level of the second type execution unit. The first type execution unit may be individually connected to the primary control module and the secondary control module, or individually connected to the primary node module and the secondary node module. The second type execution unit may be connected to one of the primary control module, the secondary control module, the primary node module, and the secondary node module.
[0186] In other words, a first type of execution unit with a higher functional safety level may be connected to both control modules in the primary controller 01 or to both node modules in the node device 02. A second type of execution unit with a lower functional safety level may be connected to only one module in the primary controller 01 or the node device 02.
[0187] For example, in a vehicle control system, the first type of sensors may include a speed sensor, a brake sensor, a steering sensor, an image sensor, an airbag sensor, etc., and the second type of sensors may include a temperature sensor, etc. The first type of execution unit may include a brake system motor, a steering system motor, etc., and the second type of execution unit may include a window lift motor, a sound box drive circuit, etc.
[0188] According to the solution provided in this embodiment of the present application, a device with a higher functional safety level is connected to both control modules of the primary controller 01 or to both node modules of the node device 02. This ensures the reliability of data collection and command execution, thereby improving the security of the control system. However, for a device with a lower functional safety level, the device is connected to only one module in the primary controller 01 or the node device 02. This simplifies the architecture of the control system and reduces the complexity of the system.
[0189] Optionally, see Figures 9 and 15. The control system may further include a first power supply A0(A) and a second power supply A0(B). The first power supply A0(A) may be individually connected to the primary control module in the primary controller 01 and the primary node module in the at least one node device 02, and is configured to supply power to the primary control module and the primary node module in the at least one node device 02. The second power supply A0(B) may be individually connected to the secondary control module in the primary controller 01 and the secondary node module in the at least one node device 02, and is configured to supply power to the secondary control module and the secondary node module in the at least one node device 02.
[0190] A redundant second power supply A0(B) is arranged to supply power to the secondary control module and the secondary node module, thereby ensuring that the two ring subnets in the control system can operate independently and further ensuring the functional safety and reliability of the control system.
[0191] It should be understood that in addition to providing power to the primary control module and the primary node module, the first power source A0(A) may also provide power to other devices (such as sensors and executives) connected to the primary control module and other devices connected to the primary node module. Similarly, the second power source A0(B) may provide power to other devices connected to the secondary control module and other devices connected to the secondary node module.
[0192] As shown in Figures 9, 12, 14, and 15, the control system provided in this embodiment of the present application may further include a gateway W0. The gateway W0 is connected to the primary controller 01 or at least one node device 02. For example, see Figures 9, 12, 14, and 15. The gateway W0 may be connected to the primary controller E5.
[0193] The gateway W0 may be configured to transmit data from the primary controller 01 or at least one node device 02 connected to the gateway W0 to an external device, and to transmit data from the external device to the primary controller 01 or at least one node device 02 connected to the gateway W0. In other words, the gateway W0 may be configured to exchange data between the external device and the primary controller 01, or between the external device and at least one node device 02. The external device may be a device independent of the control system. For example, in a vehicle control system, the external device may include a mobile terminal such as a mobile phone, a communication base station, a roadside data base station, another vehicle, etc.
[0194] In the control system provided in this embodiment of the present application, the primary controller 01 or at least one node device 02 may further communicate with external devices using a gateway, which enhances the functionality of the control system and improves the flexibility of the control system in operation.
[0195] Optionally, refer to FIGS. 9, 12, 14, and 15. It can be understood that the gateway W0 may include a primary communication module W0(A) and a secondary communication module W0(B) connected to the primary communication module W0(A). The primary communication module W0(A) may be connected to a primary control module or a primary node module and may establish a communication connection with an external device via a primary channel D0(A). The secondary communication module W0(B) may be connected to a secondary control module or a secondary node module and may establish a communication connection with an external device via a secondary channel D0(B). In addition, as shown in FIGS. 9, 12, 14, and 15, the primary communication module W0(A) may be connected to a first power source A0(A) and may be powered by the first power source A0(A). The secondary communication module W0(B) may be connected to a second power source A0(B) and may be powered by the second power source A0(B).
[0196] Two communication modules are designed and powered independently by different power sources, which can ensure functional safety and reliability when the primary controller 01 or the node device 02 exchanges data with external devices.
[0197] In this embodiment of the present application, when data is exchanged between two devices in a ring network (for example, between a primary controller and a node device, or between different node devices), and when a device in the ring network exchanges data with an external device, the sender of the data may add a timestamp to the data based on coordinated universal time (UTC). In this way, it can be ensured that the receiver of the data can reconstruct and check the data time series based on the timestamp. In addition, adding a timestamp can further enable the receiver to determine the transmission delay of the data and perform delay correction, thereby ensuring that the receiver has good automatic control performance for the received data.
[0198] Optionally, in this embodiment of the present application, each of the first router and the second router may include a primary routing module and a redundant secondary routing module connected to the primary routing module. The functions of the primary routing module and the secondary routing module may be the same, and each of the primary routing module and the secondary routing module may be a chip with a forwarding function. The primary routing module in the first router may be connected to the primary routing module in the second router, and may be connected to the primary control module in the primary controller 01 or the primary node module in the node device 02. The secondary routing module in the first router may be connected to the secondary routing module in the second router, and may be connected to the secondary control module in the primary controller 01 or the secondary node module in the node device 02.
[0199] For example, see Figure 16. A first router M1 in the control system includes a primary routing module M1(A) and a secondary routing module M1(B), and a second router L1 includes a primary routing module L1(A) and a secondary routing module L1(B). The primary routing module M1(A) is individually connected to the primary node module E1(A) of the secondary controller E1 and the primary routing module L1(A) in the second router L1. The secondary routing module M1(B) is individually connected to the secondary node module E1(B) of the secondary controller E1 and the secondary routing module L1(B) in the second router L1.
[0200] 16, it can be further understood that both the primary and secondary routing modules in the router can be powered by independent power sources. For example, all primary routing modules are connected to and powered by a first power source A0(A). All secondary routing modules are connected to and powered by a second power source A0(B).
[0201] In a scenario in which a router in a control system includes a primary routing module and a secondary routing module, the primary control module in the primary controller 01 or the primary node module in the node device 02 may transmit a reference clock signal to the primary routing module. The primary routing module may further transmit the received reference clock signal to the secondary routing module. Alternatively, the secondary control module in the primary controller 01 or the secondary node module in the node device 02 may transmit the reference clock signal to the secondary routing module.
[0202] FIG. 17 is a schematic diagram of another clock synchronization path in a control system according to an embodiment of the present application. Please refer to FIG. 17. It can be understood that the primary control module E5(A) in the primary controller E5 may send a reference clock signal to the primary routing module E1(A) in the first router E1 to perform clock synchronization. Furthermore, the primary routing module E1(A) in the first router E1 may individually send a reference clock signal to the secondary routing module E1(B) and the primary routing module M1(A) in the second router M1 to perform clock synchronization. Finally, the primary routing module M1(A) in the second router M1 may send a reference clock signal to the secondary routing module M1(B) to perform clock synchronization.
[0203] In this embodiment of the present application, a first type of sensor with a high security level may be connected to both routing modules in a router, and a second type of sensor with a low security level may be connected to only one routing module in the router. Similarly, a first type of execution unit with a high security level may be connected to both routing modules in a router, and a second type of execution unit with a low security level may be connected to only one routing module in the router.
[0204] For example, see FIG. 16. The first type sensor S1 may include a primary sensor module S1(A) and a secondary sensor module S1(B). The primary sensor module S1(A) may be connected to a primary routing module, a primary control module, or a primary node module. The secondary sensor module S1(B) may be connected to a secondary routing module, a secondary control module, or a secondary node module. The first type execution unit P1 may include a primary execution module P1(A) and a secondary execution module P1(B). The primary execution module P1(A) may be connected to a primary routing module, a primary control module, or a primary node module. The secondary execution module P1(B) may be connected to a secondary routing module, a secondary control module, or a secondary node module.
[0205] In the control system provided in this embodiment of this application, both the controller and the router have redundant function modules and redundant signal links, and can be powered by redundant power supplies, thus effectively improving the functional safety and reliability of the control system.
[0206] Optionally, the number of controllers included in the control system provided in this embodiment of the present application may be flexibly adjusted based on the requirements of the application scenario. For example, the number of controllers included in the control system may be comprehensively determined based on factors such as controller performance, communication rate requirements of the ring network, the number of sensors and execution units included in the control system, functional complexity, and cost. An on-board control system is used as an example. See FIGS. 9, 12, and 15. The on-board control system may include a total of five controllers, namely, E1 to E5, where E5 is the primary controller and E1 to E4 are secondary controllers. In addition, based on the setting direction of each secondary controller, the secondary controller E1 may be referred to as the left forward controller, the secondary controller E2 may be referred to as the left rearward controller, the secondary controller E3 may be referred to as the right rearward controller, and the secondary controller E4 may be referred to as the right forward controller.
[0207] Alternatively, refer to FIG. 18. The control system may include a total of four controllers, i.e., E1 to E4, where one of the four controllers is a primary controller and the other three controllers are secondary controllers. Alternatively, refer to FIG. 19. The control system may include a total of three controllers, i.e., E1 to E3, where E1 is a left front controller, E2 is a rear controller, and E3 is a right front controller. In addition, one of the three controllers is a primary controller and the other two controllers are secondary controllers. Alternatively, refer to FIG. 20. The control system may include two controllers, i.e., E1 and E2, where E1 is a front controller and E2 is a rear controller. In addition, one of the two controllers is a primary controller and the other is a secondary controller.
[0208] It can be understood that the control system provided in this embodiment of the present application may be other types of control systems in addition to being a vehicle control system. For example, the control system may be a system with high requirements for real-time control or a control system with high requirements for functional safety. Systems with high requirements for real-time control may include aircraft power systems, steering systems, telex systems, industrial control servo systems, cyclotrons, electromagnetic radiation systems, and electromagnetic gun systems, etc. Systems with high requirements for functional safety may include surgical robot control systems, remote control systems, and rail transport drive systems in the medical field, and may further include operation and control systems for autonomous vehicles, remotely operated driving vehicles, and airborne vehicles. In addition, the control system provided in this embodiment of the present application may be further applied to automation industry fields with high requirements for security. For example, the control system may be a remote or remote control system for the chemical industry, nuclear energy, coal mines, or wharves, or a fault location and range determination system for the power industry.
[0209] The control system provided in this embodiment of this application further has the following functions and advantageous effects:
[0210] 1. All software functions are transferred to the controller within the ring network, realizing the separation of software and hardware, enhancing the flexibility of the control system, reducing the complexity of testing the sensor and execution unit, ensuring the quality of the test, reducing the joint commissioning time of the control system, and easing the difficulty of development.
[0211] 2. The signal transmission direction (i.e., communication route) can be dynamically adjusted based on the fault condition. In addition, the execution timing of tasks, the physical carrier on which the software module operates (e.g., the primary controller or the secondary controller), and the function of each software module can all be dynamically scheduled by the primary controller, which can improve the reliability and application flexibility of the control system.
[0212] 3. For vehicle control systems, based on the clock synchronization and task scheduling functions of the primary controller at the vehicle system level, the implementation of traditional ECU functions such as sensor control and execution unit control can be replaced with the implementation of a controller, which can effectively reduce the number of ECUs in the vehicle and reduce the costs of the vehicle's ECUs and harnesses.
[0213] 4. High-level functional safety algorithms (e.g., microsecond high-speed functional safety protection overcurrent) and potential fault detection can be realized by the controller at the top layer. Functional safety checks and model checks at the top layer can effectively enhance the security of the entire control system and reduce the hardware and software overhead costs caused by functional safety mechanisms at the bottom layer.
[0214] 5. Each device in the control system employs a redundant structure. This allows the functional safety integrity level to be reduced at the system level. For example, in a vehicle control system, the automotive safety integration level (ASIL) can be reduced from level D to level B or below.
[0215] 6. The EMC performance of the entire control system is improved through frequency modulation of the reference clock signal.
[0216] 7. The primary controller schedules tasks in a unified manner, prevents resource preemption and contention issues that arise among tasks within the control system, and ensures that tasks are executed in an orderly manner.
[0217] 8. The primary / secondary controller is dynamically adjusted based on the operational status detection mechanism and the fault detection mechanism for multiple controllers in the ring network. The adjustment principle includes the priority and fault status of the controller.
[0218] 9. The operations of related registers in the control system are performed synchronously based on the frequency of the reference clock signal. In addition, in the primary controller, the codes used to perform different tasks are stored in different areas, which are chronologically independent of each other and do not interfere with each other.
[0219] In summary, an embodiment of this application provides a control system. A primary controller in the control system may use a ring network to directly transmit a reference clock signal to at least one node device, allowing the at least one node device to perform time adjustment based on the frequency of the reference clock signal. In this manner, clock synchronization between the primary controller and the at least one node device is achieved. Compared with transmitting data frames, direct transmission of the reference clock signal may improve the accuracy of clock synchronization between the primary controller and the at least one node device to an accuracy equal to the pulse width of the reference clock signal, thereby effectively improving the accuracy of clock synchronization. In addition, the primary controller and the at least one node device in the control system may be sequentially connected to form a ring network, ensuring the existence of a redundant signal exchange path when signals are exchanged between the primary controller and the at least one node device, thereby ensuring the reliability of signal transmission.
[0220] In addition, the control system provided in this embodiment of the present application has high accuracy of time synchronization between the primary controller and at least one node device. Therefore, it is ensured that all time-sensitive tasks can be transferred to the primary controller or the node device for execution by the ECU, thereby effectively reducing the number of ECUs in the control system and simplifying the function of the ECU (for example, the ECU can be simplified like a router). The control system has lower complexity and higher flexibility.
[0221] An embodiment of this application further provides a clock synchronization method, which can be applied to the control system provided in the above embodiments. See Figure 21. The method may include the following steps:
[0222] Step 101: The primary controller performs time adjustment based on the frequency of the local clock signal of the primary controller and executes the task.
[0223] The local clock signal of the primary controller may be generated after a PLL in the primary controller performs frequency multiplication on a source clock signal generated by a crystal oscillator in the primary controller based on a preset frequency multiplication value.
[0224] The tasks performed by the primary controller may include one or more of the following tasks: data transmission tasks, data processing tasks, command transmission tasks, and drive signal output tasks. The commands may be used to instruct the sensors to collect data or to output drive signals to the executive unit.
[0225] Step 102: The primary controller uses the ring network to transmit a reference clock signal to at least one node device.
[0226] The reference clock signal is obtained based on the local clock signal of the primary controller, and the reference clock signal is utilized by at least one node device to perform time adjustments and execute tasks based on the frequency of the reference clock signal. The reference clock signal is the local clock signal of the primary controller. Alternatively, the reference clock signal is a clock signal obtained by performing frequency division on the local clock signal of the primary controller.
[0227] Optionally, the primary controller may include a primary control module and a secondary control module connected to the primary control module. At least one node device may include a primary node module and a secondary node module connected to the primary node module. The ring network includes a first ring subnet and a second ring subnet. The first ring subnet includes a primary control module and a primary node module in at least one node device, and the second ring subnet includes a secondary control module and a secondary node module in at least one node device. In a scenario where the primary controller includes two control modules, the reference clock signal may be obtained based on a local clock signal of the primary control module.
[0228] Correspondingly, in step 102, the primary control module may transmit a reference clock signal separately to the secondary control modules and to the primary node module in at least one node device.
[0229] The primary node module in the node device may then transmit the received reference clock signal to a secondary node module connected to the primary node module. Alternatively, the secondary control module in the primary controller may transmit the reference clock signal to a secondary node module in at least one node device using the second ring subnetwork.
[0230] Step 103: The primary controller sends a synchronization signal to at least one node device using the ring network.
[0231] The synchronization signal is utilized by at least one node device to correct the time of the node device's local clock.
[0232] In an optional implementation, the primary controller is connected to at least one node device using a clock signal cable. In this implementation, the primary controller may transmit a composite signal of the reference clock signal and the synchronization signal to the at least one node device using the clock signal cable.
[0233] In another optional implementation, the primary controller is connected to at least one node device using a clock signal cable and a synchronization signal cable. In this implementation, the primary controller may send a reference clock signal to the at least one node device using the clock signal cable, and may send a synchronization signal to the at least one node device using the synchronization signal cable.
[0234] Step 104: The node device corrects the time of the local clock of the node device based on the synchronization signal.
[0235] After receiving the synchronization signal, the node device may correct the time of the node device's local clock based on the synchronization signal to ensure time synchronization with the primary controller.
[0236] In a scenario in which the primary controller transmits a composite signal of a reference clock signal and a synchronization signal using a clock signal cable, the node device may individually derive the synchronization signal and the reference clock signal from the received composite signal based on the amplitude and / or pulse width of the received composite signal.
[0237] In a scenario in which the primary controller transmits a reference clock signal using a clock signal cable and a synchronization signal using a synchronization signal cable, the node device may receive the reference clock signal transmitted by the primary controller using the clock signal cable and may receive the synchronization signal transmitted by the primary controller using the synchronization signal cable. In other words, the node device does not need to parse the synchronization signal and the reference clock signal from the composite signal. This reduces the complexity of receiving the synchronization signal and the reference clock signal by the node device.
[0238] Step 105: The node device performs time adjustment based on the frequency of the reference clock signal and executes the task.
[0239] In an optional implementation, the node device may include a PLL. The node device may utilize the PLL to modify the frequency of the node device's local clock signal based on the frequency of the reference clock signal to maintain a target ratio between the frequency of the node device's local clock signal and the frequency of the reference clock signal. The node device may then perform time adjustments and execute tasks based on the frequency of the node device's modified local clock signal.
[0240] In another optional implementation, the node device may directly perform time adjustments and execute tasks based on the frequency of the reference clock signal. In other words, the node device may not need to modify the frequency of the node device's local clock signal.
[0241] Step 106: The primary controller adjusts the frequency of the local clock signal of the primary controller to be within the target frequency range.
[0242] In this embodiment of the present application, the primary controller may further implement frequency modulation on the local clock signal of the primary controller, which can effectively improve the EMC performance of frequency-sensitive circuits in the control system in the task execution process.
[0243] Step 107: The primary controller performs a failure response action when it detects that any task is not executed at the execution time of the task.
[0244] The primary controller may further monitor the execution status of tasks in the control system. If the primary controller detects that any task is not executed at the time of execution of the task, the primary controller may perform a failure response action. The failure response action may include one or more of the following actions: restarting a device that executes any of the tasks, where the device is the primary controller or at least one node device; restarting sensors and / or execution units connected to the device that executes any of the tasks; and executing a security task set in the primary controller.
[0245] Optionally, at least one node device in the control system may be at least one secondary controller. The control system may further include at least one sensor and at least one execution unit. The at least one sensor is connected to the primary controller or the at least one secondary controller, and the at least one execution unit is connected to the primary controller or the at least one secondary controller. The tasks that need to be performed by the primary controller and the tasks that need to be performed by the at least one secondary controller each include one or more of the following tasks: a data transmission task, a data processing task, a command transmission task, and a drive signal output task. The command is used to instruct the at least one sensor to collect data or to output a drive signal to the at least one execution unit.
[0246] See Figure 22. In a scenario where at least one node device is at least one secondary controller, the method may further include the following steps.
[0247] Step 108a: The primary controller determines the tasks that need to be performed by the primary controller and the execution time of the tasks, and the tasks that need to be performed by at least one secondary controller and the execution time of the tasks.
[0248] In this embodiment of the present application, the primary controller may determine the tasks that need to be performed by multiple controllers (including the primary controller and the secondary controllers) in the ring network and when to perform the tasks. In other words, the primary controller may perform unified scheduling and management of the tasks to ensure the orderly execution of the tasks.
[0249] If the task to be executed includes a general data processing task and the general data processing task requires a large amount of computing resources, the primary controller may divide the general data processing task into multiple data processing tasks. In addition, the primary controller determines the data processing tasks that need to be executed by the primary controller and the data processing tasks that need to be executed by at least one secondary controller based on the load of the primary controller and the load of the at least one secondary controller. This can realize distributed execution of data processing tasks, and can further improve the utilization rate of the computing resources of the controllers based on improved task execution efficiency.
[0250] Step 109a: The primary controller sends the task scheduling table to at least one secondary controller.
[0251] The task scheduling table may include tasks that need to be executed by at least one secondary controller and the execution times of the tasks. After receiving the task scheduling table sent by the primary controller using the ring network, the secondary controller may execute the tasks based on the execution times of the tasks recorded in the task scheduling table. In other words, in step 105, the secondary controller may perform time adjustment based on the frequency of the reference clock signal and execute the tasks at the execution times of the tasks that need to be executed by the secondary controller.
[0252] At the same time, in step 101, the primary controller may perform time adjustment based on the frequency of the local clock signal of the primary controller, and execute tasks at the execution time of the tasks that need to be executed by the primary controller.
[0253] Step 110a: The primary controller uses the ring network to send the target data to at least one secondary controller.
[0254] The target data may be data that has high security requirements and needs to be shared by multiple controllers included in the ring network, for example, the target data may include vehicle speed.
[0255] Step 111a: If the target data transmitted using the ring network is not received, or the received target data transmitted using the ring network does not match the transmitted target data, the primary controller performs fault detection on the ring network and / or retransmits the target data.
[0256] In this embodiment of the present application, after using the ring network to transmit target data with high security requirements, the primary controller can detect whether the secondary controller in the ring network correctly receives the target data, thereby ensuring that the target data can be reliably transmitted to the secondary controller.
[0257] It should be understood that a secondary controller in the control system may also perform the methods illustrated in steps 110a and 111a. In other words, the secondary controller may also transmit target data using the ring network, and may perform fault detection on the ring network and / or retransmit the target data when it detects that other controllers in the ring network are not correctly receiving the target data.
[0258] Step 112a: If the secondary controller determines that the primary controller is faulty or any signal cable connected to the primary controller is faulty, the secondary controller determines a new primary controller from at least one secondary controller based on the priority list.
[0259] The secondary controller may further maintain a priority list, which includes a priority of at least one secondary controller included in the control system. If the secondary controller determines that the primary controller is faulty or any signal cable connected to the primary controller is faulty, the secondary controller may determine a new primary controller from at least one secondary controller included in the control system based on the priority list. The new primary controller may then implement unified scheduling management for multiple controllers in the control system, and specifically, may ensure that primary control of the control system is handed over to the new primary controller to ensure that the control system can still operate properly.
[0260] Optionally, the control system may further include at least one router. A first port of the at least one first router is connected to the primary controller, and a second port of the at least one first router is connected to at least one sensor and / or at least one execution unit. A data transmission rate of the first port is lower than that of the ring network, and a data transmission rate of the second port is lower than that of the first port. Further refer to FIG. 22. The method may further include the following steps:
[0261] Step 113a: The primary controller performs frequency division on the frequency of the reference clock signal.
[0262] The primary controller may perform frequency division on the frequency of the reference clock signal based on a preset frequency division value.
[0263] Step 114a: The primary controller sends a frequency-divided reference clock signal to at least one first router.
[0264] Step 115a: The first router performs time adjustment based on the frequency of the received reference clock signal and executes the task.
[0265] After receiving the frequency-divided reference clock signal sent by the primary controller, the first router may perform time adjustment based on the frequency of the frequency-divided reference clock signal to perform tasks.
[0266] It should be understood that a secondary controller in the control system may also be connected to the first port of the first router. When the secondary controller is also connected to the first router, the secondary controller may also perform the methods shown in steps 113a and 114a. In other words, the secondary controller may perform frequency division on the frequency of the reference clock signal transmitted by the primary controller and transmit the frequency-divided reference clock signal to the first router connected to the secondary controller.
[0267] In a scenario where at least one node device is at least one first router, at least one sensor in the control system may be connected to the primary controller or the first router, and at least one execution unit in the control system may be connected to the primary controller or the first router. Tasks that need to be performed by the primary controller include one or more of the following tasks: a data transmission task, a data processing task, a command transmission task, and a drive signal output task. Tasks that need to be performed by the first router include one or more of the following tasks: a data transmission task, a command transmission task, and a drive signal output task. The command is used to instruct the at least one sensor to collect data or to output a drive signal to the at least one execution unit.
[0268] A first port of the first router is connected to the primary controller. The control system may further include at least one second router. A third port of the at least one second router is connected to the second port of the first router, and a fourth port of the at least one second router is connected to at least one sensor and / or at least one execution unit. A data transmission rate of the first port is equal to a data transmission rate of the ring network, a data transmission rate of the second port is lower than the data transmission rate of the first port, a data transmission rate of the third port is equal to the data transmission rate of the second port, and a data transmission rate of the fourth port is lower than the data transmission rate of the third port.
[0269] In a scenario where at least one node device is at least one first router, as shown in FIG. 23, the clock synchronization method may further include the following steps:
[0270] Step 108b: The first router performs frequency division on the frequency of the received reference clock signal.
[0271] After receiving the reference clock signal sent by the primary controller, the first router may perform frequency division on the frequency of the reference clock signal based on a preset frequency division value.
[0272] Step 109b: The first router sends the frequency-divided reference clock signal to at least one second router.
[0273] Step 110b: The second router performs time adjustment based on the frequency of the received reference clock signal and executes the task.
[0274] After receiving the frequency-divided reference clock signal transmitted by the first router, the second router may perform time adjustment based on the frequency of the frequency-divided reference clock signal to perform the task.
[0275] It should be understood that the order of steps in the clock synchronization method provided in this embodiment of the present application may be appropriately adjusted, or steps may be added or deleted correspondingly based on circumstances. For example, in the embodiment shown in FIG. 21, step 103 may be performed before step 102, step 106 may be performed before step 103, and step 107 may be performed before step 106. Alternatively, steps 103 and 104 may be deleted based on circumstances, and steps 106 and 107 may also be deleted based on circumstances. In the embodiment shown in FIG. 22, steps 110a and 111a may be deleted based on circumstances, step 112a may be deleted based on circumstances, and steps 113a to 115a may also be deleted based on circumstances. In addition, in the embodiment shown in FIG. 22, the first router may also perform the method shown in steps 108b and 109b in the embodiment shown in FIG. 23.
[0276] In summary, the embodiments of this application provide a clock synchronization method. The primary controller may use a ring network to directly transmit a reference clock signal to at least one node device, so that the at least one node device can perform time adjustment based on the frequency of the reference clock signal. In this way, clock synchronization between the primary controller and the at least one node device is realized. Compared with transmitting data frames, the direct transmission of the reference clock signal improves the accuracy of clock synchronization between the primary controller and the at least one node device to an accuracy equal to the pulse width of the reference clock signal, thereby effectively improving the accuracy of clock synchronization.
[0277] For the purpose of convenient and concise description, the specific operation process of the clock synchronization method described above may be referred to the relevant description in the above system embodiment, and the details will not be described again here, which can be clearly understood by those skilled in the art.
[0278] An embodiment of the present application further provides a primary controller, which may be applied to the control system provided in the above embodiment. The primary controller may include a programmable logic circuit and / or program instructions, and the primary controller is configured to perform the steps performed by the primary controller in the above method embodiment.
[0279] FIG. 24 is a schematic diagram of the structure of a primary controller according to an embodiment of this application. Please refer to FIG. 24. The primary controller may include a processor 2101, a memory 2102, a network interface 2103, and a bus 2104. The bus 2104 is configured to connect the processor 2101, the memory 2102, and the network interface 2103. A communication connection to other devices may be implemented via the network interface 2103 (which may be wired or wireless). The memory 2102 stores a computer program 21021. The computer program 21021 is used to implement various application functions.
[0280] It should be understood that in this embodiment of this application, the processor 2101 may be a CPU, or the processor 2101 may be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), GPUs or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware assemblies, etc. The general-purpose processor may be a microprocessor, or any existing processor, etc.
[0281] The memory 2102 may be volatile or nonvolatile memory, or may include both volatile and nonvolatile memory. Nonvolatile memory may 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 may be random access memory (RAM), and may be used as an external cache. By way of example and not limitation, many forms of RAM may be utilized, such as static random access memory (static RAM, SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (double data rate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (synchlink DRAM, SLDRAM), and direct rambus random access memory (direct rambus RAM, DR RAM).
[0282] In addition to a data bus, the bus 2104 may further include a power bus, a control bus, a status signal bus, etc. However, for clarity of description, the various buses are marked as bus 2104 in the figures.
[0283] The processor 2101 is configured to execute a computer program stored in the memory 2102, and the processor 2101 executes the computer program 21021 to implement the above-mentioned functions of the primary controller.
[0284] An embodiment of the present application further provides a node device. The node device may be applied to the control system provided in the above-described embodiment. The node device may include a programmable logic circuit and / or program instructions, and the node device may be configured to implement the steps performed by the node device in the above-described method embodiment.
[0285] It should be understood that both the primary controller and the node devices in the control system provided in this embodiment of this application can be implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof. Of course, the functions of the primary controller and the secondary controller may also be implemented using software. When the functions of the primary controller and the secondary controller are implemented using software, the modules within the primary controller and the secondary controller may be software modules.
[0286] An embodiment of the present application further provides a vehicle. The vehicle may include the control system provided in the above-described embodiment. For example, the vehicle may include the control system shown in any one of Figures 1, 8, 9, and 12 to 20.
[0287] Optionally, the vehicle may be an electric vehicle. Additionally, the vehicle may be an autonomous vehicle, a remotely operated vehicle, an airborne vehicle, or the like.
[0288] All or part of the above-described embodiments may be implemented using software, hardware, firmware, or any combination thereof. When software is used for implementation, all or part of the above-described embodiments may be implemented in the form of a computer program product. The computer program product includes at least one computer instruction. When the computer program instruction is loaded or executed on a computer, all or part of the procedures or functions according to the embodiments of this application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another; for example, the computer instructions may be transmitted from a website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, optical fiber, or digital subscriber line (DSL)) or wireless (e.g., infrared, radio wave, or microwave) transmission. The computer-readable storage medium may be any available medium accessible by a computer, or a data storage device such as a server or data center that includes at least one set of available media. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, or a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium. The semiconductor medium may be a solid state drive (SSD).
[0289] In this application, terms such as “first” and “second” are used to distinguish between the same item or similar items having essentially the same effect and function. It should be understood that there is no logical or chronological order dependency between “first,” “second,” and “nth.” Quantity and execution order are not limited. Although terms such as “first” and “second” are used in the following description to describe various elements, it should also be understood that these elements should not be limited to these terms. These terms are used only to distinguish one element from another. For example, a first power source may be referred to as a second power source, and similarly, a second power source may be referred to as a first power source, without departing from the scope of the various examples described. Both the first power source and the second power source may be power sources, and in some cases, may be separate or different power sources.
[0290] In this application, the term "at least one" means at least one, and the term "plurality" means two or more. The terms "system" and "network" are sometimes used interchangeably in this specification. "And / or" as used in this specification should be understood to indicate that three relationships may exist. For example, A and / or B may indicate that only A is present, that both A and B are present, and that only B is present. The symbol " / " generally indicates an "or" relationship between related objects.
[0291] The above description is only about optional implementations of this application, and the protection scope of this application is not limited thereto. Any equivalent modifications or replacements that are readily understood by those skilled in the art within the technical scope disclosed in this application should fall within the protection scope of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.
Claims
1. A control system, the control system including a ring network, the ring network including a primary controller and at least one node device; The primary controller is configured to perform time adjustments based on a frequency of a local clock signal of the primary controller to execute tasks, and to transmit a reference clock signal and a synchronization signal to the at least one node device using the ring network, wherein the reference clock signal is obtained based on the local clock signal of the primary controller; the at least one node device includes a phase-locked loop, and the at least one node device is configured to modify a time of a local clock signal of the node device based on the synchronization signal, utilize the phase-locked loop to modify a frequency of the local clock signal of the node device based on a frequency of the reference clock signal to maintain a target ratio between the frequency of the local clock signal of the node device and the frequency of the reference clock signal, and perform time adjustments based on the frequency of the local clock signal of the node device to perform a task. Control system.
2. the at least one node device is at least one secondary controller, and the control system further includes at least one sensor and at least one execution unit, the at least one sensor being connected to the primary controller or the at least one secondary controller, and the at least one execution unit being connected to the primary controller or the at least one secondary controller; The tasks that need to be performed by the primary controller and the tasks that need to be performed by the at least one secondary controller each include one or more of the following tasks: a data transmission task, a data processing task, a command transmission task, and a drive signal output task; the instructions are utilized to instruct the at least one sensor to collect data or to output the drive signal to the at least one execution unit. The control system of claim 1 .
3. A control system, the control system including a ring network, the ring network including a primary controller and at least one node device; The primary controller is configured to perform time adjustments based on a frequency of a local clock signal of the primary controller to execute tasks, and to transmit a reference clock signal to the at least one node device using the ring network, the reference clock signal being obtained based on the local clock signal of the primary controller; The at least one node device is configured to perform time adjustments based on a frequency of the reference clock signal to execute tasks; the at least one node device is at least one secondary controller; The primary controller determining the tasks that need to be executed by the primary controller and execution times for the tasks; determining the tasks that need to be executed by the at least one secondary controller and execution times for the tasks; executing the tasks at the execution times for the tasks that need to be executed by the primary controller; and sending a task scheduling table to the at least one secondary controller, wherein the task scheduling table received by the at least one secondary controller includes the tasks that need to be executed by the at least one secondary controller and the execution times for the tasks; the at least one secondary controller is configured to execute the task at the execution time of the task that needs to be executed by the at least one secondary controller based on the task scheduling table; Control system.
4. A control system, the control system including a ring network, the ring network including a primary controller and at least one node device; The primary controller is configured to perform time adjustments based on a frequency of a local clock signal of the primary controller to execute tasks, and to transmit a reference clock signal to the at least one node device using the ring network, the reference clock signal being obtained based on the local clock signal of the primary controller; The at least one node device is configured to perform time adjustments based on a frequency of the reference clock signal to execute tasks; the at least one node device is at least one secondary controller; The primary controller further configured to divide a general data processing task into a plurality of data processing tasks, and determine, based on a load of the primary controller and a load of the at least one secondary controller, a data processing task that needs to be executed by the primary controller and a data processing task that needs to be executed by the at least one secondary controller. Control system.
5. A control system, the control system including a ring network, the ring network including a primary controller and at least one node device; The primary controller is configured to perform time adjustments based on a frequency of a local clock signal of the primary controller to execute tasks, and to transmit a reference clock signal to the at least one node device using the ring network, the reference clock signal being obtained based on the local clock signal of the primary controller; The at least one node device is configured to perform time adjustments based on a frequency of the reference clock signal to execute tasks; the at least one node device is at least one secondary controller; The at least one secondary controller further maintains a priority list, the priority list including a priority of the at least one secondary controller, and the at least one secondary controller: and further configured to determine a new primary controller from the at least one secondary controller based on the priority list when it is determined that the primary controller is faulty or any signal cable connected to the primary controller is faulty. Control system.
6. A control system, the control system including a ring network, the ring network including a primary controller and at least one node device; The primary controller is configured to perform time adjustments based on a frequency of a local clock signal of the primary controller to execute tasks, and to transmit a reference clock signal to the at least one node device using the ring network, the reference clock signal being obtained based on the local clock signal of the primary controller; The at least one node device is configured to perform time adjustments based on a frequency of the reference clock signal to execute tasks; the at least one node device is at least one secondary controller; The primary controller and the at least one secondary controller utilizing the ring network to transmit target data to other controllers in the control system; If the target data transmitted over the ring network is not received or if the received target data transmitted over the ring network does not match the transmitted target data, performing fault detection on the ring network and / or retransmitting the target data. further configured as follows: Control system.
7. The control system further includes a gateway, the gateway being connected to the primary controller or the at least one node device, and the gateway: configured to transmit data from a device connected to the gateway to an external device, and to transmit data from the external device to the device connected to the gateway; The external device is a device independent of the control system. A control system according to any one of claims 1 to 6.
8. A clock synchronization method applied to a control system, the control system including a ring network, the ring network including a primary controller and at least one node device, the at least one node device including a phase-locked loop, the method comprising: performing, by the primary controller, time adjustments based on the frequency of the primary controller's local clock signal to execute tasks; and transmitting, by the primary controller, a reference clock signal and a synchronization signal to the at least one node device using the ring network, wherein the reference clock signal is obtained based on the local clock signal of the primary controller, the method comprising: and further comprising: modifying, by the at least one node device, a time of a local clock signal of the node device based on the synchronization signal; utilizing the phase-locked loop to modify a frequency of the local clock signal of the node device based on a frequency of the reference clock signal to maintain a target ratio between the frequency of the local clock signal of the node device and the frequency of the reference clock signal; and performing time adjustment based on the frequency of the local clock signal of the node device to perform a task. Clock synchronization method.
9. A vehicle, said vehicle including a control system according to any one of claims 1 to 7.
10. A clock synchronization method applied to a primary controller in a control system, the control system including a ring network, the ring network including the primary controller and at least one node device, the at least one node device being at least one secondary controller, the method comprising: performing time adjustment based on a frequency of a local clock signal of the primary controller, executing tasks, and transmitting a reference clock signal to the at least one node device using the ring network, wherein the reference clock signal is obtained based on the local clock signal of the primary controller, and the method includes: determining the tasks that need to be executed by the primary controller and the execution times of the tasks; determining the tasks that need to be executed by the at least one secondary controller and the execution times of the tasks; executing the tasks at the execution times of the tasks that need to be executed by the primary controller; and transmitting a task scheduling table to the at least one secondary controller, wherein the task scheduling table received by the at least one secondary controller includes the tasks that need to be executed by the at least one secondary controller and the execution times of the tasks. Clock synchronization method.
11. A clock synchronization method applied to a primary controller in a control system, the control system including a ring network, the ring network including the primary controller and at least one node device, the at least one node device being at least one secondary controller, the method comprising: performing time adjustment based on a frequency of a local clock signal of the primary controller, executing tasks, and transmitting a reference clock signal to the at least one node device using the ring network, wherein the reference clock signal is obtained based on the local clock signal of the primary controller, and the method includes: further comprising dividing a general data processing task into a plurality of data processing tasks, and determining, based on a load of the primary controller and a load of the at least one secondary controller, a data processing task that needs to be executed by the primary controller and a data processing task that needs to be executed by the at least one secondary controller; Clock synchronization method.
12. A clock synchronization method applied to a control system, the control system including a ring network, the ring network including a primary controller and at least one node device, the at least one node device being at least one secondary controller, the method comprising: The method includes a step of: performing time adjustment and executing tasks by the primary controller based on a frequency of a local clock signal of the primary controller; and transmitting a reference clock signal to the at least one node device using the ring network, wherein the reference clock signal is obtained based on the local clock signal of the primary controller; maintaining, by the at least one secondary controller, a priority list, the priority list including a priority of the at least one secondary controller; determining, by the at least one secondary controller, a new primary controller from the at least one secondary controller based on the priority list, if it is determined that the primary controller is faulty or any signal cable connected to the primary controller is faulty; The clock synchronization method further includes:
13. A clock synchronization method applied to a control system, the control system including a ring network, the ring network including a primary controller and at least one node device, the at least one node device being at least one secondary controller, the method comprising: The method includes a step of: performing time adjustment and executing tasks by the primary controller based on a frequency of a local clock signal of the primary controller; and transmitting a reference clock signal to the at least one node device using the ring network, wherein the reference clock signal is obtained based on the local clock signal of the primary controller; transmitting, by the primary controller and the at least one secondary controller, target data to other controllers in the control system using the ring network; performing, by the primary controller and the at least one secondary controller, fault detection on the ring network and / or retransmitting the target data if the target data transmitted over the ring network is not received or if the received target data transmitted over the ring network does not match the transmitted target data; The clock synchronization method further includes:
Citation Information
Patent Citations
Dynamically configurable high-precision and high-reliability clock network
CN110865962A
Data communication system
JP2002077196A
Distributed computing environment with real-time scheduling logic and time-deterministic architecture
JP2002517035A
Dual loop PLL and multiplication clock generation apparatus
JP2006191372A
Node device, and clock switching method
JP2008118680A