Time Synchronization Method, System, Device and a Computer-Readable Medium
By using the Master node to send specific messages in the angle radar system and calculate the time difference of Ready messages, the problem of insufficient time synchronization accuracy in the angle radar system is solved, and higher accuracy time synchronization is achieved, meeting the needs of the 77GHZ angle radar system.
Patent Information
- Application Number
- CN202210914082.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-01
- Publication Date
- 2025-06-20
- Estimated Expiration
- 2042-08-01
AI Technical Summary
The time points of target detection and target output in the angle radar system are uncertain, resulting in insufficient time synchronization accuracy and cannot meet the high-precision time synchronization requirements of the 77GHZ angle radar system.
Sync, FollowUp and Ready messages are sent through the Master node, and the Slave node receives and responds, and calculates the time difference of Ready messages to regulate radar sequencing and target output. Add gateway SDE to forward time synchronization packets on the CAN bus and perform time compensation.
Time calibration between multiple angle radars is realized to ensure that the radar measurement timing points are triggered based on the expected time point, meeting the higher accuracy time synchronization requirements of the 77GHZ angle radar system.
Smart Images

Figure CN115276873B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technologies, and in particular, to a time synchronization method, system, device, and a computer-readable medium. Background Art
[0002] Time synchronization means that the time of each device is kept consistent. If the time of each device cannot be kept consistent, some problems may occur. In the field of autonomous driving technology, multi-sensor data collection such as cameras, radars, and GPS provides very important information for autonomous driving decision-making. As the visual nervous system of the entire autonomous driving, environmental perception needs to fuse multi-sensor data for calculation and recognition, and then make appropriate decisions on the corresponding environment and deliver them to the actuator for vehicle control. How to accurately fuse the information of numerous sensors plays a crucial role in the system's real-time and accurate acquisition of information such as the spatial target position, attitude, and movement direction.
[0003] Multi-sensor time synchronization is to adjust the time bases of each sensing unit in the system to a unified reference time through some methods, and then mark according to the environmental information collected by itself and combined with the local time, and then send it to the master control. When the master control receives the messages sent by each sensor, it classifies them according to the time stamps and generates the entire environmental state at a certain time point. Therefore, only by ensuring the consistency of the local time of multi-sensors can the reliability and accuracy of the data fusion information be ensured.
[0004] Time synchronization is mostly applied to make the time bases of all Slave nodes follow the time base of the Master node. In most cases, such time synchronization synchronizes all nodes at a certain period. Under the reference time, each radar system will operate based on its own frequency. Considering the differences in the operating states and functions of different angular radars, usually there are differences in the autonomous driving functions between the front angular radar and the rear angular radar, such as forward passing warning and rear collision warning. Therefore, for a single angular radar in the angular radar system, the detection of the target (the wave emission and reception of the angular radar) and the time point of the target output are uncertain. In addition, in the 77GHZ angular radar system, the wave emission and reception speed of the angular radar is very fast, and the data volume of the message transmission is very large, which requires a faster period to process. Therefore, the angular radar system urgently needs a higher-precision time synchronization. Summary of the Invention
[0005] This application provides a time synchronization method to solve the technical problem of how to obtain higher-precision time synchronization for an angular radar system when the detection of the target and the time point of the target output are uncertain.
[0006] To solve the above technical problem, this application provides a time synchronization method, including:
[0007] The Master node sends Sync messages, which are received by multiple Slave nodes;
[0008] The Master node sends FollowUp messages, which are received by multiple Slave nodes;
[0009] The Master node and multiple Slave nodes send Ready messages, and the Ready messages are received by other nodes except the sending node. The received Ready messages are used as the input for the time slot allocation of the next Ready message transmission;
[0010] The radar sequencing and target output are regulated by calculating the time difference of the Ready messages of each corner radar.
[0011] Further, a gateway SDE is added to the CAN bus to forward the time synchronization messages of the CAN bus, and time compensation is added during the forwarding process.
[0012] Further, the period of the Sync message is 1 s.
[0013] Further, the period of the Ready message is 50 ms.
[0014] Further, the time synchronization Sync message includes the number of transmissions and the start flag of each synchronization. The FollowUp message includes long-period global synchronization time parameters, and the long-period global synchronization time parameters are the FollowUp message synchronization period plus the compensation time for SDE forwarding. The Ready message includes short-period synchronization time parameters, and the short-period synchronization time parameters are the long-period time plus the offset time for requesting the transmission of the Ready message.
[0015] Further, if the number of corner radars is four, it is dynamically allocated in an offset manner, including:
[0016] The first offset: The main corner radar S0 is allocated the first time slot Slot_1, the first corner radar S1 is allocated the second time slot Slot_2, the second corner radar S2 is allocated the third time slot Slot_3, and the third corner radar S3 is allocated the main time slot Slot_0;
[0017] The second offset: The main corner radar S0 is allocated the second time slot Slot_2, the first corner radar S1 is allocated the third time slot Slot_3, the second corner radar S2 is allocated the main time slot Slot_0, and the third corner radar S3 is allocated the first time slot Slot_1;
[0018] The third shift: the main angle radar S0 is allocated the second time slot Slot_3, the first angle radar S1 is allocated the third time slot Slot_0, the second angle radar S2 is allocated the main time slot Slot_1, and the third angle radar S3 is allocated the first time slot Slot_2;
[0019] The first shift, the second shift and the third shift are performed in a cycle in sequence until the time synchronization message is normally communicated between the corner radars.
[0020] In a second aspect, the present invention further provides a time synchronization system, comprising:
[0021] The processing unit includes: a Master node sending a Sync message, which is received by multiple Slave nodes; the Master node sending a FollowUp message, which is received by multiple Slave nodes; the Master node and multiple Slave nodes sending a Ready message, which is received by other nodes except the sending node, and the received Ready message is used as an input for allocating a time slot for sending a Ready message next time;
[0022] The calculation and comparison unit adjusts radar sequencing and target output by calculating the time difference of the Ready messages of each corner radar.
[0023] In a third aspect, the present invention provides a device, comprising: a processor and a memory; the memory is used to store instructions or computer programs; the processor is used to execute the instructions or computer programs to perform the above time synchronization method.
[0024] In a fourth aspect, the present invention provides a computer-readable storage medium, comprising instructions or a computer program, which, when executed on a computer, enables the computer to execute the above time synchronization method.
[0025] The technical solution of the present application includes at least the following advantages: by using the time synchronization method provided by the present invention, the time calibration of all corner radars is completed based on the time reference of the Master corner radar among multiple corner radars, so that the starting time point of the corner radar measurement is triggered based on the expected time point. In the cycle of sending the Sync message and the FollowUp message, each node corresponding to the corner radar also sends an additional Ready message to meet the higher precision time synchronization requirements in the 77GHZ corner radar system. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] To more clearly illustrate the specific embodiments of the present application or the technical solutions in the prior art, the following will briefly introduce the drawings required for the description of the specific embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0027] Figure 1 Schematic structural diagram of time synchronization provided by an embodiment of the present invention;
[0028] Figure 2 Schematic diagram of the corner radar installed on a vehicle provided by Embodiment 1 of the present invention;
[0029] Figure 3 Analysis diagram of interference waveforms in the corner radar system provided by Embodiment 1 of the present invention;
[0030] Figure 4 Schematic diagram of the periodic offset between radars provided by Embodiment 1 of the present invention;
[0031] Figure 5a Communication schematic diagram of Sync and FollowUp messages provided by Embodiment 1 of the present invention;
[0032] Figure 5b Communication schematic diagram of the Ready message provided by Embodiment 1 of the present invention;
[0033] Figure 6 Synchronization relationship diagram of four corner radars provided by Embodiment 1 of the present invention;
[0034] Figure 7 Synchronization timing diagram with gateway SDE provided by Embodiment 1 of the present invention. Specific embodiments
[0035] The following will clearly and completely describe the technical solutions in the present application in conjunction with the drawings. Obviously, the described embodiments are some embodiments of the present application, rather than all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present application.
[0036] In the description of the present application, it should be noted that the orientation or positional relationship indicated by the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc. is based on the orientation or positional relationship shown in the drawings. It is only for the convenience of describing the present application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation. Therefore, it should not be construed as a limitation to the present application. In addition, the terms "first", "second", "third" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance.
[0037] In the description of the present application, it should be noted that unless otherwise clearly specified and limited, the terms "installed", "connected", "connected" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be directly connected or indirectly connected through an intermediate medium, and it can also be the communication inside two elements. It can be a wireless connection or a wired connection. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood according to specific circumstances.
[0038] In addition, the technical features involved in different embodiments of the present application described below can be combined with each other as long as they do not conflict with each other.
[0039] Figure 1 It is a schematic flowchart of time synchronization provided for the embodiments of the present invention. Referring to Figure 1 , the present invention provides a time synchronization method, including:
[0040] S11. The Master node sends a Sync message and is received by multiple Slave nodes;
[0041] S12. The Master node sends a FollowUp message and is received by multiple Slave nodes;
[0042] S13. The Master node and multiple Slave nodes send Ready messages, and the Ready messages are received by other nodes except the sending node. The received Ready messages are used as the input for the time slot allocation of the next Ready message sending;
[0043] S14. Regulate the radar sequencing and target output by calculating the time difference of the Ready messages of each corner radar.
[0044] When multiple corner radars transmit message information to multiple CAN buses, a gateway SDE needs to be added at this time to forward Sync messages, FollowUp messages, and Ready messages of the CAN bus. One of the corner radars is set as the Master node, and the others are Slave nodes. Long-period time synchronization is achieved by the Master node sending Sync messages and Follow messages. At the same time, each corner radar sends its own Ready time message and receives the Ready messages of other corner radars to achieve short-period high-precision Ready time synchronization. In the embodiment of the present invention, the period of the Sync message is 1 s, and the period of the Ready message is 50 ms.
[0045] The Sync message includes the number of transmissions and the start flag for each synchronization. The FollowUp message includes long-period global synchronization time parameters. The Ready message includes short-period synchronization time parameters. The short-period synchronization time parameters are the long-period global synchronization time parameters plus the offset time for requesting the transmission of the Ready message.
[0046] When the gateway SDE is added to the CAN bus, the long-period global synchronization time parameters also include the compensation time for the gateway SDE to forward.
[0047] In the embodiment of the present invention, the Master node is the main corner radar, and the Slave nodes are other corner radars except the main corner radar.
[0048] When the Sync message cannot communicate normally between corner radars, the corner radars reallocate time operations and dynamically allocate them in an offset manner.
[0049] If the number of corner radars is four, it is dynamically allocated in an offset manner, including:
[0050] The first offset: The main corner radar S0 allocates the first time slot Slot_1, the first corner radar S1 allocates the second time slot Slot_2, the second corner radar S2 allocates the third time slot Slot_3, and the third corner radar S3 allocates the main time slot Slot_0;
[0051] The second offset: The main corner radar S0 allocates the second time slot Slot_2, the first corner radar S1 allocates the third time slot Slot_3, the second corner radar S2 allocates the main time slot Slot_0, and the third corner radar S3 allocates the first time slot Slot_1;
[0052] The third offset: The main corner radar S0 allocates the third time slot Slot_3, the first corner radar S1 allocates the main time slot Slot_0, the second corner radar S2 allocates the first time slot Slot_1, and the third corner radar S3 allocates the second time slot Slot_2;
[0053] Perform the first offset, the second offset, and the third offset in sequence and loop until the Sync message can communicate normally between the corner radars.
[0054] If the number of corner radars is six, perform dynamic allocation by means of offset, including:
[0055] First offset: The main corner radar S0 is allocated the first time slot Slot_1, the first corner radar S1 is allocated the second time slot Slot_2, the second corner radar S2 is allocated the third time slot Slot_3, the third corner radar S3 is allocated the fourth time slot main time slot Slot_4, the fourth corner radar S4 is allocated the fifth time slot Slot_5, and the fifth corner radar S5 is allocated the main time slot Slot_0;
[0056] Second offset: The main corner radar S0 is allocated the second time slot Slot_2, the first corner radar S1 is allocated the third time slot Slot_3, the second corner radar S2 is allocated the fourth time slot Slot_4, the third corner radar S3 is allocated the fifth time slot Slot_5, the fourth corner radar S4 is allocated the main time slot Slot_0, and the fifth corner radar S5 is allocated the first time slot Slot_1;
[0057] Third offset: The main corner radar S0 is allocated the third time slot Slot_3, the first corner radar S1 is allocated the fourth time slot Slot_4, the second corner radar S2 is allocated the fifth time slot Slot_5, the third corner radar S3 is allocated the main time slot Slot_0, the fourth corner radar S4 is allocated the first time slot Slot_1, and the fifth corner radar S5 is allocated the second time slot Slot_2;
[0058] Fourth offset: The main corner radar S0 is allocated the fourth time slot Slot_4, the first corner radar S1 is allocated the fifth time slot Slot_5, the second corner radar S2 is allocated the main time slot Slot_0, the third corner radar S3 is allocated the first time slot Slot_1, the fourth corner radar S4 is allocated the second time slot Slot_2, and the fifth corner radar S5 is allocated the third time slot Slot_3;
[0059] Fifth offset: The main corner radar S0 is allocated the fifth time slot Slot_5, the first corner radar S1 is allocated the main time slot Slot_0, the second corner radar S2 is allocated the first time slot Slot_1, the third corner radar S3 is allocated the second time slot Slot_2, the fourth corner radar S4 is allocated the third time slot Slot_3, and the fifth corner radar S5 is allocated the fourth time slot Slot_4;
[0060] Perform the first offset, the second offset, the third offset, the fourth offset, and the fifth offset in sequence and loop until the Sync message can be normally communicated between the corner radars.
[0061] If the number of corner radars is eight, the dynamic allocation is also performed in the above offset manner, which will not be elaborated here.
[0062] The embodiment of the present invention also provides a time synchronization system, including:
[0063] A processing unit that sends a Sync message from the Master node and is received by multiple Slave nodes; the Master node sends a FollowUp message and is received by multiple Slave nodes; the Master node and multiple Slave nodes send a Ready message, and the Ready message contains transmission count information;
[0064] A judgment unit that confirms successful synchronization when the Ready message is received by other nodes except the sending node and the transmission count information in the Ready messages received by the other nodes is consistent; the period of the Sync message is greater than the period of the Ready message;
[0065] When the Ready message is successfully received by other nodes except the sending node and the transmission count information in the Ready messages received by the other nodes is inconsistent, reset the transmission count stored in the message of the node whose transmission count information is inconsistent with that of other nodes.
[0066] In the 77GHZ corner radar system, the wave - sending and wave - receiving speed of the corner radar is very fast, and the data volume transmitted by the message is very large, requiring a faster period for processing. In the first embodiment of the present invention, the vehicle system is provided with four corner radars. During the cycle of sending the Sync message and the FollowUp message, each node corresponding to the corner radar also additionally sends a Ready message to meet the higher - precision time synchronization requirements in the 77GHZ corner radar system.
[0067] In the first embodiment of the present invention, the Sync message contains the transmission count and the start flag of synchronization per 1 second. The FollowUp contains long - period global synchronization time parameters, and the long - period global synchronization time parameters are the accumulated time of 1 second and the compensation time. The Ready_Sx contains short - period synchronization time parameters, and the short - period synchronization time parameters are the long - period time plus the offset time of the Ready_Sx requested to be sent by itself. In the embodiment of the present invention, x takes 0, 1, 2, and 3 respectively.
[0068] Figure 2 This is a schematic diagram of the corner radar installed on the vehicle provided by the first embodiment of the present invention. Refer to Figure 2, in the construction of the vehicle corner radar system, the corner radars are respectively installed at the left rear, right rear, left front and right front positions of the vehicle. S0 (left rear) is used as the Master node to send Sync, FollowUp, and Ready_S0 messages. S1 (right rear), S2 (left front), and S3 (right front) respectively send Ready_S1, Ready_S2, and Ready_S3 messages. The above messages are all transmitted through the CAN bus.
[0069] For some special cases, such as a relatively large bus load and the front and rear radars not using the same CAN bus, a gateway SDE needs to be added to forward the Sync, FollowUp, and Ready messages of the front and rear radar CAN buses. The CAN bus configures two CANs for the gateway SDE to be used for corner radar interaction. One CAN is used for the head communication between S0 and S1, and the other CAN is used for the tail communication between S2 and S3. The SDE exchanges the time synchronization messages on the head and tail. S0 sends long-period Sync / FollowUp messages to the head end. After the SDE head end receives the Sync / FollowUp messages, it forwards the messages to the tail end. S2 and S3 successfully receive the long-period time information from S0. Similarly, S2 sends Ready_S2 and S3 sends Ready_S3 to the tail end. After the SDE tail end receives Ready_S2 and Ready_S3, it forwards them to the head end. S0 and S1 successfully receive the high-precision short-period time parameter information from S2 and S3.
[0070] In addition, a cyclic redundancy check CRC (Cyclic redundancy check) and a count Cnt (Count) signal are added to each message to implement the end-to-end E2E function.
[0071] For high-precision Ready time synchronization, anti-interference can be achieved by changing the time schedule through time offset. Figure 3 This is the interference waveform analysis diagram in the corner radar system provided by Embodiment 1 of the present invention. Refer to Figure 3 , in the n-1 cycle, it is a normal interference-free scenario. In the n cycle, interference with a similar frequency appears. In Figure 3The interference wave is represented by a bold wavy line in the figure. In the subsequent n+1, n+2, n+3... cycles, two aspects of adjustment are made for the interference. One is hardware modulation to change the wave transmission frequency, that is, to increase or decrease the frequency to avoid interference waves with similar frequencies. The other is software adjustment of the wave transmission cycle, that is, to increase or decrease the wave transmission cycle to avoid interference waves with similar time offset points. After the adjustment, the corner radar will avoid the interference waves that appear in the nth cycle. In complex actual application scenarios, such as enclosed garages and congested intersections, complex reflection situations and a large number of radar interferences from other vehicles will occur in this scenario. If the interference waves cannot be avoided through repeated adjustments, at this time, the radar will report an interference DTC (Diagnostic Trouble Code). For the time offset made using time synchronization information and the frequency conversion of the hardware, both are to increase the anti-interference ability rather than completely block the interference.
[0072] Figure 4 It is a schematic diagram of the cycle offset between radars provided by the first embodiment of the present invention. Refer to Figure 4 , the cycle of the Ready message is 50ms, and the cycle offset is the scheduling deviation of each corner radar. The scheduling deviation is 0-50ms. In the first embodiment of the present invention, there are four radars, and the cycle offset between each radar is 12.5ms to ensure that each corner radar can allocate its own time slot. This time slot is used for the wave transmission and reception of each of the four corner radars. The radar wave of the front radar will also be received by the rear radar on the same side after being reflected by an obstacle. Therefore, in the system built by the four corner radars, it is also necessary to avoid the interference of other radars in the system.
[0073] Figure 5a It is a communication schematic diagram of the Sync and FollowUp messages provided by the first embodiment of the present invention; Figure 5b It is a communication schematic diagram of the Ready message provided by the first embodiment of the present invention. Refer to Figure 5a and Figure 5b , for the long-cycle time synchronization of Sync / Follow, generally set S0 as the Master node, and the other three as Slave nodes; for the short-cycle high-precision Ready time synchronization, each corner radar sends its own Ready_Sx time message and receives the Ready_Sx messages of other corner radars, and regulates the radar sequencing and target output by calculating and comparing the Ready_Sx time differences of each corner radar. Figure 5a and Figure 5b The gateway SDE is added in the figure. Without the gateway SDE, there is a single CAN bus before and after. If the SDE exists, time compensation during the forwarding process needs to be added for the SDE forwarding message.
[0074] In the embodiments of the present invention, the Sync message consists of a 2-byte TimeSyncNumber signal, a 2-byte CRC signal, and a 1-byte CNT signal. The FollowUp message is of the Multiplexor type. Multi_0 contains a 2-byte SyncMsgCounter signal, a 4-byte LowPrecisionTimeStamp signal, Multi_1 contains a 4-byte HighPrecisionTimeStamp signal, Multi_2 contains a 4-byte CorrectionField signal, and Multi_3 contains a 2-byte CRC signal and a 1-byte CNT signal. The Ready_Sx message is also of the Multiplexor type. Multi_0 contains a 4-byte EarliestStartTime signal and a 1-byte Radar_Slot signal, and Multi_1 contains a 4-byte CurrentCycleCount, a 2-byte CRC signal, and a 1-byte CNT signal. The length of each frame of the message is 8 bytes. Among them, TimeSyncNumber represents the number of times the Sync message is sent, SyncMsgCounter represents the number of times the FollowUp message is sent, and this signal value is the same as the TimeSyncNumber value. LowPrecisionTimeStamp represents the current second-precision timestamp (Master radar timestamp) when the FollowUp message is sent, HighPrecisionTimeStamp represents the current nanosecond-precision timestamp (Master radar timestamp) when the FollowUp message is sent, CorrectionField represents the compensation time, and when there is an SDE, this information is filled by the SDE, which is the time from when the SDE successfully receives the FollowUp to when the SDE successfully forwards the FollowUp to another CAN line. EarliestStartTime represents the current radar timestamp when the Ready_Sx is sent, CurrentCycleCount represents the number of times the Ready_Sx message is sent, and when the synchronization is successful, this signal value is the same in the Ready_Sx message. Radar_Slot represents the currently allocated transmission time slot of the radar, CRC represents the filling bit of the E2E encryption Crc calculation result, and CNT represents the count of the number of times the E2E encrypted message is sent, and this signal also participates in the Crc calculation.
[0075] Regarding the relationship between messages, under unrestricted conditions, after CAN initialization is completed, the Sync message is sent on Master node S0 at a 1-second interval. The FollowUp is a trigger message. After the Sync message is successfully sent, that is, after receiving the ACK response indicating successful bus transmission, the Master node is triggered to send the FollowUp message. After the Slave node successfully receives the Sync / FollowUp message, it sends the Ready_Sx message at a 50-millisecond interval. When adding a gateway, the time parameter in the FollowUp message will increase the forwarding compensation time, that is, the time for the gateway to successfully receive and forward to another CAN line. Since the time parameter in Ready_Sx is used to calculate the time slots for wave transmission, reception, and target output, the time parameter in Ready_Sx does not need to increase the compensation time.
[0076] In the corner radar system of the embodiment of the present invention, the task of processing time synchronization information is defined as 10 milliseconds. The number of time slots matches the number of radars, so that each corner radar is assigned one to ensure that they do not interfere with each other. Therefore, four corner radar time slots Slot_x are defined, and these time slots are used for wave reception, transmission, and target output. In each Ready_Sx time synchronization, each corner radar successfully receiving the Ready_Sx messages of the other three corner radars is regarded as successful synchronization and serves as the input for the next time slot allocation.
[0077] Under normal operating conditions, the Sync message communicates normally among the corner radars, and the corner radars normally perform antenna wave transmission, reception, and target output after the algorithm according to the allocated time slots. In case of anomalies, such as communication anomalies (messages not being normally sent or received), time synchronization anomalies, failure to obtain correct time parameters, and failure of time slot allocation, the radar detection function is turned off during this period and waits for successful synchronization, or interference from external radar waves (other vehicles equipped with the same corner radars). The corner radar will reallocate time operations and dynamically allocate them in an offset manner. Under normal circumstances, S0->Slot_0, S1->Slot_1, S2->Slot_2, S3->Slot_3, and dynamically allocate in an offset manner: the first adjustment: S0->Slot_1, S1->Slot_2, S2->Slot_3, S3->Slot_0, the second adjustment: S0->Slot_2, S1->Slot_3, S2->Slot_0, S3->Slot_1, the third adjustment: S0->Slot_3, S1->Slot_0, S2->Slot_1, S3->Slot_2, and adjust in this way in a loop until the time synchronization message can communicate normally among the corner radars.
[0078] E2E encryption. The message length of this application is 8 bytes. The value obtained by performing CRC8 calculation on the message information and the custom DataID (2 bytes) is filled into the CRC bit. For Cnt, it is incremented by 1 each time a frame is successfully sent.
[0079] First, the Sync message needs to be successfully sent on the CAN bus for time synchronization. Then, the FollowUp message (containing long-period time parameters) is triggered for transmission. Only the radar configured as the Master sends Sync / FollowUp. After the Sync / FollowUp is correctly received by the Slave node, the short-period high-precision Ready message starts to be sent. The period of Sync / FollowUp is 1 second, and the period of Ready_Sx is 50 mS.
[0080] Figure 6 It is the synchronization relationship diagram of the four-corner radars provided in the first embodiment of the present invention. Refer to Figure 6 In the case of no gateway SDE, the four-corner radar nodes are connected to a single CAN bus. When the Master node S0 is successfully configured in the corner radar system, the Sync message is sent from the Master node to the bus. The arrow indicates that the message is sent from S0 to S1, S2, S3. There is no prior or subsequent relationship for the time point when the Slave node successfully receives it. After the Master node S0 successfully sends the Sync message, Δt SF equals 5 milliseconds to trigger the sending of the FollowUp message to the bus. Similarly, the arrow indicates that the message is sent from S0 to the Slave nodes S1, S2, S3. The periods of the Sync and FollowUp messages are T S equals 1 second, that is, the interval between Sync n and Sync n+1 is 1 second. After S0 successfully sends the Sync and FollowUp messages, and S1, S2, S3 successfully receive the Sync and FollowUp messages, the four-corner radars S0, S1, S2, S3 trigger the sending of the Ready message to the bus. Figure 6 The arrows of Ready_Sx shown represent that each corner radar sends its own Ready message to the other three corner radars, and at the same time, it also represents that each corner radar needs to receive the Ready messages of the other three corner radars. High-precision short-period synchronization requires combining the time parameters of the four Ready messages as input. Figure 6 The Ready message transmission timing in is S0->S1->S2->S3. This order is not fixed, and there are no requirements for the order or interval. The period of the Ready message is 50 milliseconds, that is, high-precision time synchronization of the Ready message is completed within 50 mS. Figure 6The specific time sequence includes: S0 sends a Sync message, which is successfully sent and received by other nodes; 5 milliseconds later, S0 sends a FollowUp message, which is successfully sent and received by other nodes; S0, S1, S2, and S3 all send Ready messages, which are successfully sent and received by other nodes; S0 sends a Sync message, with an interval of 1 second from the last successful sending of the Sync message; 5 milliseconds later, S0 sends a FollowUp message; S0, S1, S2, and S3 send Ready messages, with an interval of 50 milliseconds from the last successful sending of the Ready message.
[0081] Figure 7 This is the synchronization timing diagram of the SDE with a gateway provided in the first embodiment of the present invention. Figure 7 A gateway SDE is added. Without the SDE, the front and back are a single CAN bus. Refer to Figure 7 , BUS1 represents the rear corner radar bus, that is, the CAN bus between S0 and S1, and BUS2 represents the front corner radar bus, that is, the CAN bus between S2 and S3. The function of the gateway SDE is to forward Sync, FollowUp, Ready_S0, and Ready_S1 on BUS1 to BUS2, and to forward Ready_S2 and Ready_S3 on BUS2 to BUS1. Among them, the transmission time Δt of FollowUp F and the transmission time Δt of the Ready_Sx message R The maximum forwarding time does not exceed 3 milliseconds. Specifically, S0 sends a Sync message, which is successfully sent to BUS1 and received by S1 and the SDE; the SDE forwards the Sync message, which is successfully forwarded to BUS2 and received by S2 and S3; a FollowUp message is sent 5 milliseconds after the Sync message, which is successfully sent to BUS1 and received by S1 and the SDE; the SDE forwards the FollowUp message and fills the CorrectionField signal, which is successfully forwarded to BUS2 and received by S2 and S3; S0 and S1 send Ready messages, which are successfully sent to BUS1 and received by the opposite side and the SDE; the SDE forwards the Ready message on BUS1, which is successfully forwarded to BUS2 and received by S2 and S3; S2 and S3 send Ready messages, which are successfully sent to BUS2 and received by the opposite side and the SDE; the SDE forwards the Ready message on BUS2, which is successfully forwarded to BUS1 and received by S0 and S1; compared with the previous Sync and FollowUp messages, the same steps are repeated after a 1-second cycle.
[0082] When the gateway SDE forwards messages, all signals except the CorrectionField signal remain unchanged. The CorrectionField signal is included in the FollowUp message and sent by S0. The default value of the CorrectionField signal sent by S0 to BUS1 is 0. In the absence of the gateway SDE, this signal value is always 0. When the gateway SDE successfully receives the FollowUp Multi_0 on BUS1, it records the current time T1. When it successfully sends the FollowUp Multi_0 to BUS2, it records the current time T2. The value of the CorrectionField is T2 - T1, which is the time consumed by the gateway SDE to forward the message.
[0083] Among them, T S is the Sync / FollowUp message period, which is 1 second in the first embodiment of the present invention. Δt SF is the interval time between the Sync message and the FollowUp message. This time parameter indicates that after the Sync message is successfully sent, the FollowUp message should also be successfully sent within Δt SF . In the first embodiment of the present invention, it is 5 milliseconds. Δt SR is the interval time between the Sync message and the Ready_Sx message; Δt RR is the interval time between the Ready_Sx and Ready_Sy messages; Δt S is the Sync message transmission time, which needs to be successfully sent to the CAN bus within 3 milliseconds; Δt F is the FollowUp transmission time, which needs to be successfully sent to the CAN bus within 3 milliseconds; Δt R is the Ready_Sx message transmission time, which needs to be successfully sent to the CAN bus within 3 milliseconds; T R is the Ready_Sx message period, and the typical value is 50 milliseconds.
[0084] In addition, the present invention also provides a computer device. The computer device includes a memory and a processor. The memory can be used to store a computer program. The processor runs the computer program, so that the computer device executes the above time synchronization method or the functions of each module in the time synchronization system.
[0085] The present invention provides a computer-readable storage medium, including instructions or a computer program. When it runs on a computer, it enables the computer to execute the above time synchronization method.
[0086] The memory may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, application programs required for at least one function (such as a sound playback function, an image playback function, etc.). The data storage area may store data created according to the use of the mobile terminal (such as audio data, phone book, etc.). In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0087] This embodiment also provides a computer storage medium for storing the computer program used in the above computer device.
[0088] In several embodiments provided by this application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architectures, functions, and operations of devices, methods, and computer program products according to multiple embodiments of this application. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, and a module, a program segment, or a part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and the combination of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.
[0089] In addition, in each embodiment of this application, each functional module may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0090] If a function is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods in various embodiments of this application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs.
[0091] Obviously, the above embodiments are merely examples given for clear illustration and are not limitations on the implementation manners. For those of ordinary skill in the art, other different forms of changes or alterations can be made based on the above description. It is not necessary and impossible to enumerate all the implementation manners here. And the obvious changes or alterations derived therefrom still fall within the protection scope of the creation of this application.
Claims
1. A time synchronization method, characterized in that, Including: The Master node sends Sync messages, which are received by multiple Slave nodes; The Master node sends FollowUp messages, which are received by multiple Slave nodes; The Master node and multiple Slave nodes send Ready messages, and the Ready messages contain transmission count information; When the Ready message is received by nodes other than the sending node and the transmission count information in the Ready messages received by the other nodes is consistent, it is confirmed that the synchronization is successful; When the Ready message is successfully received by nodes other than the sending node and the transmission count information in the Ready messages received by the other nodes is inconsistent, reset the transmission count stored in the message for the nodes with inconsistent transmission count information with other nodes; The period of the Sync message is greater than the period of the Ready message; The Sync message contains the transmission count and the start flag for each synchronization. The FollowUp message contains long-period global synchronization time parameters. The Ready message contains short-period synchronization time parameters, and the short-period synchronization time parameters are the long-period global synchronization time parameters plus the offset time for requesting the sending of the Ready message; If the number of corner radars is four, they are dynamically allocated in an offset manner, including: The first offset: The main corner radar S0 is allocated the first time slot Slot_1, the first corner radar S1 is allocated the second time slot Slot_2, the second corner radar S2 is allocated the third time slot Slot_3, and the third corner radar S3 is allocated the main time slot Slot_0; The second offset: The main corner radar S0 is allocated the second time slot Slot_2, the first corner radar S1 is allocated the third time slot Slot_3, the second corner radar S2 is allocated the main time slot Slot_0, and the third corner radar S3 is allocated the first time slot Slot_1; The third offset: The main corner radar S0 is allocated the third time slot Slot_3, the first corner radar S1 is allocated the main time slot Slot_0, the second corner radar S2 is allocated the first time slot Slot_1, and the third corner radar S3 is allocated the second time slot Slot_2; Perform the first offset, the second offset, and the third offset in sequence until the Sync message communicates normally among the corner radars; the main corner radar is the Master node, and the other corner radars are the Slave nodes.
2. The time synchronization method according to claim 1, characterized in that, When the Ready message fails to be received by nodes other than the sending node, transmit the synchronization failure information to the DDC controller.
3. The time synchronization method according to claim 1, characterized in that, The Sync message, the FollowUp message, and the Ready message are sent to the CAN bus. If the number of CAN buses is greater than 1, a gateway SDE is added to the CAN bus. The gateway SDE forwards the Sync message, the FollowUp message, and the Ready message on the CAN bus and adds time compensation during the forwarding process.
4. The time synchronization method according to claim 1, characterized in that, The period of the Sync message is 1 s.
5. The time synchronization method according to claim 1, characterized in that, The period of the Ready message is 50 ms.
6. The time synchronization method according to claim 3, characterized in that, The long-period global synchronization time parameter further includes a compensation time for the gateway SDE forwarding.
7. A time synchronization system, characterized in that, It includes: A processing unit, where the Master node sends a Sync message and is received by multiple Slave nodes; the Master node sends a FollowUp message and is received by multiple Slave nodes; the Master node and multiple Slave nodes send a Ready message, and the Ready message contains transmission count information. A judgment unit, when the Ready message is received by other nodes except the sending node and the transmission count information in the Ready messages received by the other nodes is consistent, it is confirmed that the synchronization is successful. The period of the Sync message is greater than the period of the Ready message. When the Ready message is successfully received by other nodes except the sending node and the transmission count information in the Ready messages received by the other nodes is inconsistent, reset the transmission count stored in the message of the node whose transmission count information is inconsistent with other transmission count information. The Sync message contains the transmission count and the start flag of each synchronization, the FollowUp message contains the long-period global synchronization time parameter, the Ready message contains the short-period synchronization time parameter, and the short-period synchronization time parameter is the long-period global synchronization time parameter plus the offset time for requesting to send the Ready message. If the number of corner radars is four, it is dynamically allocated in an offset manner, including: The first offset: the main corner radar S0 is allocated the first time slot Slot_1, the first corner radar S1 is allocated the second time slot Slot_2, the second corner radar S2 is allocated the third time slot Slot_3, and the third corner radar S3 is allocated the main time slot Slot_0. The second offset: the main corner radar S0 is allocated the second time slot Slot_2, the first corner radar S1 is allocated the third time slot Slot_3, the second corner radar S2 is allocated the main time slot Slot_0, and the third corner radar S3 is allocated the first time slot Slot_1. The third offset: the main corner radar S0 is allocated the third time slot Slot_3, the first corner radar S1 is allocated the main time slot Slot_0, the second corner radar S2 is allocated the first time slot Slot_1, and the third corner radar S3 is allocated the second time slot Slot_2. Perform the first offset, the second offset, and the third offset in sequence until the Sync message can communicate normally among the corner radars; the main corner radar is the Master node, and other corner radars are Slave nodes.
8. A time synchronization device, characterized in that, It includes: A processor and a memory; The memory is used to store instructions or computer programs. The processor is used to execute the instructions or computer programs and execute the method according to any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, It includes instructions or computer programs, which when running on a computer, cause the computer to execute the method according to any one of claims 1-6 above.
Citation Information
Patent Citations
Time synchronization method and system, salve timing device and main timing device
CN102013931A
Time synchronization method, device and system, terminal equipment and storage medium
CN109981206A