Synchronous communication method and system and vehicle

By realizing clock synchronization between the first controller and the second controller in the vehicle control system, and generating and sending instruction messages using the desired issuance time and nominal sending time, the problem of synchronous communication of actuators in different CAN/LIN networks managed by multiple area controllers is solved, and the synchronization and robustness of instructions are achieved.

CN120074977APending Publication Date: 2025-05-30NIO TECH ANHUI CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510244362.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-28
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

In different CAN/LIN networks managed by multiple regional controllers, synchronous communication of actuators is difficult to achieve, especially when the data volume is large, many actuators cannot be deployed on the same network, making it difficult to ensure synchronization.

Method used

By completing clock synchronization between the first controller and the second controller, the command to be sent is generated using the expected issuance time and the system synchronization time, and the command message is sent to the second network at the nominal transmission time, combined with the dead zone protection area to improve robustness, synchronous writing and sending of instructions is realized.

Benefits of technology

It effectively realizes the synchronization of instructions reaching different executors through different paths, improves the synchronous communication capabilities of actuators in different CAN/LIN networks managed by multiple regional controllers, and enhances the robustness of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120074977A_ABST
    Figure CN120074977A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of vehicle control, in particular to a synchronous communication method and system and a vehicle, and aims to solve the technical problem of how to realize the synchronism of an instruction reaching different actuators through different transmission paths. In order to achieve the purpose, the method comprises the steps that on the basis of the same expected issuing moment, each second controller synchronously writes a to-be-sent instruction into a communication protocol stack; and then based on the pre-agreed and same nominal sending time, each second controller synchronously sends the instruction message corresponding to the instruction to be sent to the second network, and through the two-stage synchronization mechanism, the synchronism that the instruction reaches different third controllers through different paths is well realized. Moreover, in the process of writing the instruction to be sent into the communication protocol stack based on the release moment, a dead zone protection interval is introduced, and the robustness of synchronous communication is further improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of vehicle control, and particularly to a synchronous communication method, system and vehicle. Background Art

[0002] With the popularization and development of new energy vehicles, the functions of vehicles are becoming more and more abundant, and the number of controllers performing different functions in vehicles is also increasing. From the perspective of cost, the vehicle electronic and electrical architecture expects more controllers to be connected to the regional controller nearby, replacing the previous architecture in which controllers performing the same function are connected to the corresponding functional domain controller. That is to say, the vehicle electronic and electrical architecture is developing in the direction of regional integration. The above regional integration solution makes the deployment of controllers more decentralized, and there are more and more scenarios where different controllers need to execute the same instruction synchronously.

[0003] In the data communication between vehicle controllers, CAN / LIN buses are mainly used for controllers with low communication bandwidth and rate requirements and single functions, such as controllers for controlling the electric air outlet of the air conditioner, controllers for controlling the ambient light, etc. The CAN / LIN communication protocol itself does not have a relevant synchronization mechanism. Therefore, currently, it is usually adopted to place the relevant controllers under the same CAN / LIN network or the management of one controller, and to alleviate the problem of asynchronization through a high frame scheduling frequency. However, when the data volume of CAN / LIN nodes (actuators) is large, resulting in many actuators unable to be deployed in the same CAN / LIN network and needing to be deployed in different CAN / LIN networks managed by multiple regional controllers, due to the differences in data transmission paths and the instruction processing time of regional controllers, the above technical solutions cannot well solve the synchronous communication problem of many actuators in different CAN / LIN networks managed by multiple regional controllers. Therefore, how to achieve the synchronous communication of actuators in different CAN / LIN networks managed by multiple regional controllers has become an urgent problem to be solved.

[0004] Correspondingly, there is a need in the art for a new synchronous communication solution to solve the above problems. Summary of the Invention

[0005] In order to overcome the above defects, the present application is proposed to solve or at least partially solve the technical problem of how to achieve the synchronization of instructions reaching different actuators through different paths.

[0006] In a first aspect, a synchronous communication method is provided, which is applied to a synchronous communication system. The synchronous communication system includes a first controller, a second controller and a third controller. The second controller and the third controller perform data communication through a second network. After the first controller and the second controller complete clock synchronization, it is applied to the second controller. The method includes: Receive the first instruction message and the expected release time sent by the first controller, where the expected release time is generated based on the system synchronization time; Based on the expected release time and the system synchronization time, write the instruction to be sent into the communication protocol stack corresponding to the second network, where the instruction to be sent is generated based on the first instruction message; Based on the nominal transmission time, send the second instruction message corresponding to the instruction to be sent to the second network, where the nominal transmission time is determined based on the synchronization time epoch and a preset message transmission period.

[0007] In a technical solution of the above synchronous communication method, "Based on the expected release time and the system synchronization time, write the instruction to be sent into the communication protocol stack corresponding to the second network" includes: Directly based on the expected release time, write the instruction to be sent into the communication protocol stack corresponding to the second network; or, Determine the actual release time based on the expected release time and a preset dead zone protection interval, and write the instruction to be sent into the communication protocol stack corresponding to the second network based on the actual release time.

[0008] In a technical solution of the above synchronous communication method, "Determine the actual release time based on the expected release time and a preset dead zone protection interval" includes: Obtain the expected nominal transmission time based on the expected release time, where the expected nominal transmission time is the nominal transmission time closest to the expected release time; Determine whether the difference between the expected release time and the expected nominal transmission time belongs to the dead zone protection interval; In response to the difference belonging to the dead zone protection interval, determine the actual release time based on the expected release time and the right endpoint of the dead zone protection interval; In response to the difference not belonging to the dead zone protection interval, the expected release time is the actual release time.

[0009] In a technical solution of the above synchronous communication method, when the second network is a LIN bus network, the duration of the message transmission period is the scheduling table duration of a preset LIN communication scheduling table. "Based on the nominal transmission time, send the second instruction message corresponding to the instruction to be sent to the second network" includes: Determine the nominal transmission time based on the synchronization time epoch and the scheduling table duration; At the nominal transmission time, send the first frame of message data in the second instruction message to the LIN bus network; Based on the LIN communication schedule and the system synchronization time, sequentially send the frame message data after the first frame message data in the second instruction message to the LIN bus network.

[0010] In a technical solution of the above synchronous communication method, when the second network is a CAN bus network, the duration of the message sending period is the sending period duration of a preset CAN communication frame. "Based on the nominal sending moment, send the second instruction message corresponding to the instruction to be sent to the second network" includes: Based on the synchronization time epoch and the sending period duration of the CAN communication frame, determine the nominal sending moment; At the nominal sending moment, sequentially send each frame message data in the second instruction message to the CAN bus network.

[0011] In a technical solution of the above synchronous communication method, the method further includes: In response to the alternating mode of the diagnostic service, based on the second controller hardware clock, send the second instruction message and diagnostic service data, where the diagnostic service data is sent between two adjacent message sending periods; In response to terminating the alternating mode, continue to send the second instruction message based on the second controller hardware clock, At the next nominal sending moment adjacent to the termination moment of the alternating mode, send the second instruction message based on the system synchronization time.

[0012] In a technical solution of the above synchronous communication method, the method further includes: In response to the exclusive mode of the diagnostic service, based on the second controller hardware clock, send diagnostic service data; In response to terminating the exclusive mode, continue to send the second instruction message based on the second controller hardware clock; At the next nominal sending moment adjacent to the termination moment of the exclusive mode, send the second instruction message based on the system synchronization time.

[0013] In a technical solution of the above synchronous communication method, when applied to the first controller, the method further includes: Obtain the longest instruction transmission time for the first instruction message to be transmitted between the first controller and each second controller; Obtain the longest instruction processing time among the controller processing times required by each second controller from receiving the first instruction message to writing the instruction to be sent into the communication protocol stack corresponding to the second network; Obtain the system synchronization time; Determine the expected release moment based on the system synchronization time, the longest instruction transmission time, and the longest instruction processing time.

[0014] In a second aspect, a synchronous communication system is provided. The system includes a first controller, a second controller, and a third controller. The second controller and the third controller perform data communication through a second network. The first controller and the second controller are configured to perform clock synchronization. After the first controller and the second controller complete clock synchronization, When the first controller is configured to execute, it implements the synchronous communication method described in any one of the above technical solutions applicable to the first controller. When the second controller is configured to execute, it implements the synchronous communication method described in any one of the above technical solutions applicable to the second controller.

[0015] In a third aspect, a vehicle is provided, and the vehicle includes the synchronous communication system described in any one of the above technical solutions.

[0016] One or more of the above technical solutions of the present application have at least one or more of the following beneficial effects: Based on the same expected release moment, each second controller synchronously writes the instruction to be sent into the communication protocol stack, and then synchronously sends the second instruction message corresponding to the instruction to be sent to the second network based on the pre-agreed and same nominal sending moment. Through the above two-level synchronization mechanism, the synchronization of the instructions reaching different third controllers through different paths is well achieved. And, during the process of writing the instruction to be sent into the communication protocol stack based on the expected release moment, a dead zone protection interval is introduced, further improving the robustness of synchronous communication. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Referring to the accompanying drawings, the disclosure of the present application will become more readily understood. It is easy for those skilled in the art to understand that these drawings are only for illustrative purposes and are not intended to limit the protection scope of the present application.

[0018] Figure 1 is a schematic diagram of a synchronous communication system according to an embodiment of the present application.

[0019] Figure 2 is a schematic flow chart of the main steps of a synchronous communication method according to an embodiment of the present application.

[0020] Figure 3 is a schematic flow chart of the main steps for a first controller to generate an expected release moment according to an embodiment of the present application.

[0021] Figure 4It is a schematic diagram of the problem that multiple second controllers cannot synchronously send second instruction messages without introducing a dead zone protection interval.

[0022] Figure 5 It is a schematic diagram of multiple second controllers synchronously sending second instruction messages after introducing a dead zone protection interval according to another embodiment of the present application.

[0023] Figure 6 It is a flowchart of the main steps for obtaining the actual release time after introducing a dead zone protection interval according to another embodiment of the present application.

[0024] Figure 7 It is a schematic diagram of an alternating mode for responding to a diagnostic service during a synchronous communication process according to an embodiment of the present application.

[0025] Figure 8 It is a schematic diagram of an exclusive mode for responding to a diagnostic service during a synchronous communication process according to an embodiment of the present application.

[0026] Figure 9 It is a schematic diagram of a synchronous communication system according to another embodiment of the present application. Detailed implementation manners

[0027] The following describes some implementation manners of the present application with reference to the accompanying drawings. Those skilled in the art should understand that these implementation manners are only used to explain the technical principle of the present application and are not intended to limit the protection scope of the present application.

[0028] In the description of the present application, "module" and "processor" may include hardware, software, or a combination of both. A module may include a hardware circuit, various suitable sensors, communication ports, a memory, and may also include a software part, such as program code, and may also be a combination of software and hardware. The processor may be a central processing unit, a microprocessor, an image processor, a digital signal processor, or any other suitable processor. The processor has data and / or signal processing functions. The processor may be implemented in software, in hardware, or in a combination of both. The computer-readable storage medium includes any suitable medium for storing program code, such as a magnetic disk, a hard disk, an optical disk, a flash memory, a read-only memory, a random access memory, and so on. The term "A and / or B" represents all possible combinations of A and B, such as only A, only B, or A and B. The term "at least one A or B" or "at least one of A and B" has a meaning similar to "A and / or B" and may include only A, only B, or A and B. The singular terms "a" and "this" may also include the plural form.

[0029] Refer to the attached Figure 1 , Figure 1Schematic diagram of a synchronous communication system according to an embodiment of the present application. The synchronous communication system of the present application includes: a first controller 1, a second controller 2, and a third controller 3.

[0030] The first controller 1 and the second controller 2 (including multiple second controllers) perform data communication through a first network 4. As an example, the first network is an Ethernet and / or Wi-Fi network. The bandwidth and data transmission rate of the first network are higher than those of the second network.

[0031] The second controller 2 and the third controller 3 perform data communication through a second network 5. As an example, the second network is a LIN bus network, a CAN bus network, or other networks. Each second controller can support one or more second networks simultaneously, and the number of third controllers connected to each second network can be one or more.

[0032] As Figure 1 shown, the second controller a supports both the CAN bus network and the LIN bus network simultaneously. The second controller a and the third controllers (ECU1-1, ECU1-2,..., ECU1-n) form a second network based on the CAN bus, and the second controller a and the third controllers (ECU2-1, ECU2-2,..., ECU2-n) form a second network based on the LIN bus. The second controller b only supports the CAN bus network, and the second controller b and the third controller (ECU3-1) form a second network based on the CAN bus.

[0033] To facilitate understanding of the technical solution of the present application, the instruction sending process of the second controller will be described first. The instruction sending process of the second controller includes two steps: first, write the received instruction to be sent into the communication protocol stack corresponding to the second network according to the expected release time; then, according to the preset second bus sending period (nominal sending time), send the instruction message corresponding to the instruction to be sent to the physical transmission line of the second network. Among them, The expected release time represents the time when the second controller writes the instruction to be sent into the communication protocol stack corresponding to the second network in the second controller. The nominal sending time represents the time when the second controller sends the instruction message corresponding to the instruction to be sent to the second bus according to the preset second bus sending period.

[0034] Continue to refer to the appendix Figure 2 , Figure 2 Schematic diagram of the main steps of a synchronous communication method according to an embodiment of the present application. After the first controller 1 and the second controller 2 complete clock synchronization and apply it to the second controller 2, the synchronous communication method in the embodiment of the present application includes: Step S201: Receive the first instruction message and the expected release time sent by the first controller. Step S202: Based on the expected release time and the system synchronization time, write the instruction to be sent into the communication protocol stack corresponding to the second network. Step S203: Based on the nominal transmission time, send the second instruction message corresponding to the instruction to be sent to the second network.

[0035] In an embodiment of the present application, a certain new energy vehicle includes Figure 1 the synchronous communication system shown in the figure. Among them, the first controller 1 is a central domain controller; the second controller a is a left body area controller, the second controller b is a front area controller, and the second controller n is a right body area controller; ECU2-1, ECU2-2,..., ECU2-n are third controllers that control the body atmosphere lights and are connected by the second controller a through the LIN bus network (the second network), and ECUn-1, ECUn-2,..., ECUn-n are third controllers that control the body atmosphere lights and are connected by the second controller n through the LIN bus network (the second network).

[0036] Before executing step S201, it is necessary to complete the clock synchronization between the first controller 1 and the second controller 2 (including the second controller a, the second controller b,..., the second controller n).

[0037] It should be noted that the present application does not limit the method for clock synchronization between the first controller 1 and the second controller 2. As an example, the PTP protocol (Precision Time Protocol), NTP protocol (Network Time Protocol), IRIG standard (Inter Range Instrumentation Group), etc. can be used for clock synchronization.

[0038] In an embodiment of the present application, after the first controller and the second controller complete clock synchronization based on the PTP protocol, the first controller responds to the operation of the user to turn on the body atmosphere lights of the new energy vehicle, and generates the first instruction message for controlling the body atmosphere lights applicable to each relevant second controller and a unified expected release time according to the corresponding relationship between the third controller for controlling the body atmosphere lights pre-stored in the first controller and the second controller, and the type of the first network. The instruction data content of the first instruction message corresponding to each second controller can be the same or different. As an example, when the first network is an Ethernet network, the first instruction message is a UDP instruction message or a TCP instruction message.

[0039] Next, refer to the appendix Figure 3 , and combine Figure 3 to illustrate the technical solution for the first controller to generate the expected release time.Figure 3 It is a schematic flowchart of the main steps for a first controller according to an embodiment of the present application to generate an expected release time.

[0040] In step S301, obtain the longest instruction transmission time for the first instruction message transmitted between the first controller and each second controller.

[0041] Specifically, after the first controller determines each second controller to which the first instruction message needs to be sent, according to the network structure diagram of the first network between the first controller and the second controller pre-stored in the first controller, the instruction transmission time of the network physical layer required for the first instruction message to be transmitted from the first controller to each second controller can be calculated.

[0042] Considering that the second controller that receives the first instruction message earlier (with a short instruction transmission time) can achieve synchronous processing of the first instruction message with the second controller that receives the first instruction message later (with a long instruction transmission time) through delay waiting, therefore, the longest instruction transmission time is selected as the instruction transmission time of the first network to be considered.

[0043] In the first controller, hardware-related parameters of all second controllers are also pre-stored, such as the processor core model, the number of cores, the cache size, the main frequency, etc. Through the hardware-related parameters, the first controller can calculate the controller processing time required for operations such as internal transmission and application software processing of the first instruction message in the second controller.

[0044] Similarly, only consider the longest controller processing time among each second controller. In step S302, the first controller can calculate the longest instruction processing time among the controller processing times required for each second controller from receiving the first instruction message to writing the instruction to be sent into the communication protocol stack corresponding to the second network.

[0045] Wherein, the instruction to be sent is the instruction carried by the first instruction message and needs to be sent to the third controller through the second bus, and the second instruction message is a bus message that conforms to the second network protocol specification generated based on the instruction to be sent and the type of the second network. As an example, when the second network is a LIN network, the second instruction message is to convert the instruction to be sent into a LIN bus instruction message that conforms to the LIN bus protocol specification.

[0046] It should be noted that in some embodiments, the first controller and the second controller can be the same controller. At this time, this controller has both the functions of the first controller in the present application and the functions of the second controller in the present application. Correspondingly, the internal data transmission channel between the functional units of the first controller and the functional units of the first controller of this controller is equivalent to the first network.

[0047] In step S303, the first controller reads the current PTP time of the local machine to obtain the current system synchronization time (Current PTP Time1).

[0048] In step S304, based on the system synchronization time, the longest instruction transmission time, and the longest instruction processing time, the expected presentation time is determined. The expected presentation time can be expressed as: Presentation Time = CurrentPTP Time1 + Max Delay Time where Max Delay Time (the maximum delay time) is the sum of the longest instruction transmission time and the longest instruction processing time.

[0049] Considering factors such as the first network transmission and the uncertainty during the execution of the application software, the synchronization of each second controller can be further enhanced by adding redundancy time. At this time, the expected presentation time can be expressed as: PresentationTime = Current PTP Time1 + Max Delay Time + Redundancy Time.

[0050] As an example, the first controller needs to send instructions to the third controller connected to the LIN bus network of the second controller a and the second controller n. The instruction transmission time of the first instruction packet from the first controller to the Ethernet of the second controller a is 2 ms, and the instruction transmission time of the first instruction packet from the first controller to the Ethernet of the second controller n is 1.9 ms. At this time, the longest instruction transmission time is 2 ms.

[0051] The controller processing time of the second controller a for processing the first instruction packet is 9 ms, and the controller processing time of the second controller a for processing the first instruction packet is 10 ms. At this time, the longest instruction processing time is 10 ms. The maximum delay time calculated from the longest instruction transmission time and the longest instruction processing time is: Max Delay Time = 2 + 10 = 12 ms.

[0052] The configurable redundancy time (Redundancy Time) is 5 ms. After reading the system synchronization time (Current PTPTime1), the expected presentation time (Presentation Time) of the first instruction packet can be obtained by combining the maximum delay time (Max Delay Time).

[0053] After the first controller calculates the expected release time of the first instruction message, it sends the first instruction message and the expected release time to the second controllers corresponding to each first instruction message through the first network. In step S201, the second controller receives the first instruction message and the expected release time sent by the first controller.

[0054] In the embodiment of the present application, for step S202, the second controller directly writes the instruction to be sent into the communication protocol stack corresponding to the second network based on the expected release time.

[0055] The second controller reads the current PTP time of the local machine, that is, the current system synchronization time (Current PTPTime2), and sets the difference between the expected release time (Presentation Time) and Current PTP Time2 to the timer. When the timer overflows (i.e., the time reaches the expected release time), the second controller writes the instruction to be sent into the communication protocol stack corresponding to the second network.

[0056] It should be noted that for the instructions to be sent that need to be synchronously transmitted / executed, since the expected release times of each second controller are the same, the synchronous writing of the instructions to be sent into the communication protocol stack is realized. That is to say, although the times when each second controller receives the first instruction message are different, by writing the instructions to be sent into the communication protocol stack based on the same expected release time, each second controller realizes the continued synchronous transmission of the instructions to be sent to the next-level controller.

[0057] In practical applications, although each second controller has completed time synchronization and each preset message sending period is the same, due to factors such as the error of the synchronous clock and the difference in controller processing performance, inevitably, there will still be occasional small differences in the bus sending times of the Nth sending periods of each second controller.

[0058] Such as Figure 4 shown, for the bus sending time of the Nth sending period of the second controller a (second network 1) is t 1 , for the bus sending time of the Nth sending period of the second controller n (second network 2) is t 2 , t 2 and t 1 have small differences.

[0059] In some extreme working conditions, if the expected release time t 0 happens to be between t 2 and t 1 , according to the technical solution of the foregoing embodiment, the instruction to be sent will be directly written into the communication protocol stack corresponding to the second network based on the expected release time t 0 .

[0060] At this time, for the second controller a, the instruction to be sent will be written into the communication protocol stack in the Nth sending cycle; for the second controller n, the instruction to be sent will be written into the communication protocol stack in the (N - 1)th sending cycle.

[0061] The second controller a will send the second instruction packet corresponding to the instruction to be sent through the physical bus of the second network 1 at time t 3 (the (N + 1)th sending cycle); the second controller n will send the second instruction packet corresponding to the instruction to be sent through the physical bus of the second network 2 at time t 2 (the Nth sending cycle).

[0062] At this time, for the second instruction packets that need to be sent simultaneously by the second controller a and the second controller n, the situation occurs that they are dispersed into two adjacent cycles during sending, resulting in an out-of-sync problem.

[0063] To solve Figure 4 the problem that multiple second controllers sometimes cannot send synchronously for the second instruction packets that need to be sent simultaneously as shown, in another embodiment of the present application, a dead zone protection interval is introduced, that is, in step S202, the second controller can first determine the actual release time based on the expected release time and the preset dead zone protection interval, and then write the instruction to be sent into the communication protocol stack corresponding to the second network based on the actual release time.

[0064] Continue to refer to Figure 5 and Figure 6 , to illustrate the technical solution of how to solve the problem that multiple second controllers cannot send the second instruction packets synchronously by introducing the dead zone protection interval. Figure 5 and Figure 6

[0065] Figure 5 FIG. is a schematic diagram of multiple second controllers synchronously sending second instruction packets after introducing the dead zone protection interval according to another embodiment of the present application. As Figure 5 shown, for the nominal sending time (the preset sending time of the second controller a) of the Nth sending cycle of the second controller a (second network 1) is t 1 , for the nominal sending time (the preset sending time of the second controller n) of the Nth sending cycle of the second controller n (second network 2) is t 2 , there is a difference between t 2 and t 1 , and the expected release time t 0 is between t 2 and t 1 , that is, facing the same situation as Figure 4 .

[0066] After introducing the dead zone protection interval, the time range determined by the expected release time t 0 and the dead zone protection interval is from t 4 to t 5 in between.

[0067] For the second controller a, the nominal transmission time t 1 belongs to the range from t 4 to t 5 In this case, the second controller a writes the instruction to be sent into the communication protocol stack corresponding to the second network at time t 5 (determined by the expected release time t 0 and the right endpoint of the dead zone protection interval), and sends the second instruction message through the physical bus of the second network 1 at time t 3 (the (N + 1)th cycle).

[0068] For the second controller n, the nominal transmission time t 2 also belongs to the range from t 4 to t 5 In this case, the second controller n also writes the instruction to be sent into the communication protocol stack corresponding to the second network at time t 5 and sends the second instruction message through the physical bus of the second network 2 at time t 31 (the (N + 1)th cycle).

[0069] It can be seen that by introducing the dead zone protection interval, the problem that multiple second controllers cannot synchronously send the second instruction message when the expected release time t 0 is in the extreme working condition is solved, and the robustness of synchronous communication is improved.

[0070] It should be noted that although an occasional synchronization deviation in the Nth cycle occurs at time t 2 and t 1 , since the second instruction message is sent to the second network based on the nominal transmission time, therefore, synchronous message sending can still be re - achieved in the next (N + 1)th cycle (the time at t 3 is the same as the time at t 31 ), that is, the synchronization deviation at a certain moment will not accumulate and be transmitted.

[0071] Figure 6 is the main step flowchart for obtaining the actual release time after introducing the dead zone protection interval according to another embodiment of the present application.

[0072] In step 601, the expected nominal transmission time is obtained based on the expected release time. Among them, the expected nominal transmission time is the nominal transmission time closest to the expected release time, and the nominal transmission time is determined based on the message sending cycle.

[0073] The expression of the nominal transmission time is as follows: T_ScheduleTable = PTP_EPOCH + offset + N * Instruction_Cycle Where, T_ScheduleTable is the nominal transmission time, PTP_EPOCH is the synchronization time epoch, offset is the preset offset time, Instruction_Cycle is the duration of the message transmission period, and N is an integer greater than or equal to 0.

[0074] In the embodiments of the present application, since the PTP protocol is used for clock synchronization, correspondingly, PTP_EPOCH is the PTP time epoch, that is, the starting point of the PTP time. Similarly, when other time synchronization protocols / standards are used for clock synchronization, the synchronization time epoch is correspondingly the synchronization time epoch (the starting point of the synchronization time) corresponding to the time synchronization protocol / standard.

[0075] For the offset time offset, those skilled in the art can set it according to the actual situation. As an example, offset can be ignored (equivalent to setting offset to 0), or the value of offset can be set according to the corresponding relationship between the UTC (Coordinated Universal Time) time and the PTP time (system synchronization time) when the first controller and the second controller complete clock synchronization.

[0076] In step S602, it is judged whether the difference between the expected release time and the expected nominal transmission time belongs to a preset dead zone protection interval.

[0077] Those skilled in the art can set the range of the dead zone protection interval according to the actual situation. As an example, it can be set according to the data transmission rate of the second bus. The lower the data transmission rate, the larger the duration range of the dead zone protection interval is usually. For example, the dead zone protection interval of the LIN bus network can be set to (-5ms, 5ms).

[0078] It should be noted that when there is a difference in the timing method of the synchronization time of the expected release time and the synchronization time of the nominal transmission time, the expected release time needs to be converted to the synchronization time corresponding to the nominal transmission time, and then the difference calculation is performed. As an example, the synchronization time conversion can be performed according to the difference between the system synchronization clock after completing clock synchronization and the initial value of the nominal transmission time.

[0079] In step S603, in response to the difference belonging to the dead zone protection interval, based on the expected release time and the right endpoint of the dead zone protection interval, determine the actual release time, that is, the actual release time is the expected release time plus the right endpoint of the dead zone protection interval (5 ms), and then write the instruction to be sent into the communication protocol stack corresponding to the second network at the actual release time.

[0080] As an example, in Figure 5 , for the second controller n (second network 2), t 0 is the expected release time, t 2 is the expected nominal transmission time, the dead zone protection interval is set to (-5 ms, 5 ms), its left endpoint of the interval is -5 ms, the right endpoint of the interval is 5 ms, t 4 is the time determined by the expected release time and the left endpoint of the interval, t 5 is the time determined by the expected release time and the right endpoint of the interval.

[0081] t 2 and t 0 The difference is 1 ms, and this difference belongs to the dead zone protection interval. At this time, the second controller n will write the instruction to be sent into the communication protocol stack corresponding to the second network at the t 5 time (actual release time) determined by the expected release time and the right endpoint of the interval.

[0082] In step S604, in response to the difference not belonging to the dead zone protection interval, the expected release time is the actual release time. That is to say, write the instruction to be sent into the communication protocol stack corresponding to the second network at the expected release time.

[0083] In step S203, when the second network is a LIN bus network, LIN bus communication performs data transmission according to the preset LIN communication schedule in the second controller. At this time, the duration of the message sending period is the schedule duration of the preset LIN communication schedule. Since the LIN communication schedule can include one or more frames of data, the nominal transmission time determined based on the synchronous time epoch and the schedule duration is actually the bus transmission time of the first frame of message data in the LIN communication schedule.

[0084] That is to say, at the nominal transmission time, send the first frame of message data in the second instruction message (LIN bus instruction message) to the LIN bus network; for the other frames of message data after the first frame of message data in the second instruction message, they can be sent to the LIN bus network in sequence based on the LIN communication schedule, and the transmission of the other frames of message data is also based on the PTP time (system synchronous time) for data transmission.

[0085] After receiving the second instruction message, the third controller immediately executes the instruction, thus achieving synchronous execution of each third controller.

[0086] In another embodiment, for step S203, the second network is a CAN bus network. CAN bus communication usually transfers data in units of frames. At this time, the duration of the message sending period is the preset sending period duration of the CAN communication frame. After determining the nominal sending time based on the synchronous time epoch and the sending period duration of the CAN communication frame, at each nominal sending time, each frame of message data in the second instruction message (CAN bus instruction message) is sequentially sent to the CAN bus network.

[0087] It should be noted that the nominal sending time is the time when each second controller agrees to send the second instruction message to the second network. Since the message sending periods of each second controller are the same, when N is the same, the nominal sending times of each second controller are also the same, thus achieving synchronous sending of message instructions by the second controllers to the second network.

[0088] During the process of executing the above synchronous communication method of the present application, there are sometimes scenarios of diagnostic service requests. Diagnostic services usually include an Interleave Mode and a Diag Only Mode.

[0089] In response to the Interleave Mode of the diagnostic service, the foregoing synchronous communication method is suspended, and based on the hardware clock of the second controller, the second instruction message is sent according to the LIN communication schedule of the second instruction message, and diagnostic service data is sent according to the LIN communication schedule of the diagnostic service, where the diagnostic service data is sent between two adjacent message sending periods.

[0090] In response to terminating the Interleave Mode, first continue to send the second instruction message based on the hardware clock of the second controller; at the next nominal sending time adjacent to the termination time of the Interleave Mode, send the second instruction message based on the system synchronous time.

[0091] As Figure 7 shown, when the second controller has no diagnostic service (synchronous communication), the second instruction message will be sent based on the nominal sending time. Figure 7 It is a schematic diagram of responding to the Interleave Mode of the diagnostic service during the synchronous communication process according to an embodiment of the present application.

[0092] In response to the alternating mode of the diagnostic service (message transmission + alternating mode), the second controller pauses the synchronous communication method based on the system synchronization time and instead, based on its own hardware clock, alternately sends the second instruction message and diagnostic service data. That is, after sending the second instruction message 1 based on the LIN communication schedule corresponding to the second instruction message, diagnostic service data Req is sent based on the LIN communication schedule corresponding to the diagnostic service, and then the second instruction message 2 is sent based on the LIN communication schedule corresponding to the second instruction message. That is to say, the diagnostic service data is sent between two adjacent message transmission cycles.

[0093] In response to terminating the alternating mode (termination time is t 6 ), continue to send the second instruction message 4 based on the hardware clock of the second controller, that is, between t 6 and t 7 , continue to send the second instruction message based on the hardware clock of the second controller.

[0094] At the next new nominal transmission time t 6 adjacent to the termination time t of the alternating mode 7 , interrupt the transmission of the current second instruction message 4, and at time t 7 , switch back to synchronous communication based on the system synchronization time, send the next second instruction message (second instruction message 5) of the current second instruction message (second instruction message 4), and continue to send the first instruction message from the first controller based on the system synchronization time, expected release time, and nominal transmission time (that is, the synchronous communication method in steps S201 to S203 described in the above embodiment).

[0095] As Figure 8 shown, when the second controller has no diagnostic service (synchronous communication), the second instruction message will be continuously sent based on the nominal transmission time. Figure 8 is a schematic diagram of the exclusive mode in response to the diagnostic service during the synchronous communication process according to an embodiment of the present application.

[0096] In response to the exclusive mode of the diagnostic service (message transmission + exclusive mode), the second controller continuously sends diagnostic service data based on its own hardware clock. That is, after sending the second instruction message 1 based on the LIN communication schedule corresponding to the second instruction message, the diagnostic service data Req is continuously sent based on the LIN communication schedule corresponding to the diagnostic service until the diagnostic service terminates.

[0097] In response to terminating the exclusive mode (termination time is t 8 ), first continue to send the second instruction message 4 based on the hardware clock of the second controller, that is, between t 8 and t 9 , continue to send the second instruction message based on the hardware clock of the second controller.

[0098] At the termination time t of the alternating mode 8 for the next newly arriving nominal transmission time t adjacent thereto 9 , interrupt the transmission of the current second instruction message 4, and at the nominal transmission time t 9 switch back to synchronous communication based on the system synchronization time, send the next second instruction message (second instruction message 5) of the current second instruction message (second instruction message 4), and continue to send the first instruction message from the first controller based on the system synchronization time, the desired release time, and the nominal transmission time (i.e., the synchronous communication method of steps S201 to S203 described in the above embodiments).

[0099] As Figure 9 shown, in another embodiment, during the process of the first instruction message being transmitted from the first controller 1 to the second controller b, it also passes through the forwarding of the second controller m. Among them, the first controller 1 and the second controller m are connected through a first network, and the second controller b and the second controller m are also connected through the first network.

[0100] At this time, when calculating the longest transmission time of the instruction, it is necessary to consider the instruction transmission time of the physical layer of two parts of the network (the first network between the first controller 1 and the second controller m, and the first network between the second controller b and the second controller m); at the same time, it is also necessary to consider the controller processing time required for the second controller m to forward the first instruction message.

[0101] It should be noted that although the above embodiments describe the steps in a specific order, those skilled in the art can understand that in order to achieve the effects of the present application, different steps do not necessarily have to be executed in such an order, and they can be executed simultaneously (in parallel) or in other orders. These adjusted solutions are equivalent technical solutions to the technical solutions described in the present application, and therefore will also fall within the protection scope of the present application.

[0102] Those skilled in the art can understand that all or part of the processes in the method of the above embodiments of the present application can also be completed by instructing relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file, or some intermediate form, etc. The computer-readable storage medium can include: any entity or device, medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory, random access memory, electrical carrier signal, telecommunication signal, and software distribution medium that can carry the computer program code.

[0103] So far, the technical solution of the present application has been described in conjunction with an embodiment shown in the accompanying drawings. However, it is easily understood by those skilled in the art that the protection scope of the present application is obviously not limited to these specific embodiments. Without departing from the principle of the present application, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will all fall within the protection scope of the present application.

Claims

1. A synchronous communication method, applied to a synchronous communication system, wherein the synchronous communication system comprises a first controller, a second controller and a third controller, wherein: The second controller and the third controller perform data communication via a second network, and after the first controller and the second controller complete clock synchronization, the method is applied to the second controller, and includes: Receiving a first instruction message and an expected release time sent by the first controller, wherein the expected release time is generated based on a system synchronization time; Based on the expected publishing time and the system synchronization time, writing the to-be-sent instruction into a communication protocol stack corresponding to the second network, wherein the to-be-sent instruction is generated based on the first instruction message; Based on a nominal sending time, a second instruction message corresponding to the to-be-sent instruction is sent to the second network, wherein the nominal sending time is determined based on a synchronization time epoch and a preset message sending cycle.

2. The synchronous communication method according to claim 1, characterized in that: “Based on the expected release time and the system synchronization time, writing the to-be-sent instruction into the communication protocol stack corresponding to the second network” includes: directly writing the to-be-sent instruction into a communication protocol stack corresponding to the second network based on the expected publishing time; or, An actual publishing time is determined based on the expected publishing time and a preset dead zone protection interval, and the to-be-sent instruction is written into a communication protocol stack corresponding to the second network based on the actual publishing time.

3. The synchronous communication method according to claim 2, characterized in that: “Determining the actual publishing time based on the expected publishing time and the preset dead zone protection interval” includes: Acquire an expected nominal sending time based on the expected publishing time, wherein the expected nominal sending time is the nominal sending time that is closest to the expected publishing time; Determining whether a difference between the expected publishing time and the expected nominal sending time belongs to the dead zone protection interval; In response to the difference belonging to the dead zone protection interval, determining the actual release time based on the expected release time and the right endpoint of the interval of the dead zone protection interval; In response to the difference not belonging to the dead zone protection interval, the expected release time is the actual release time.

4. The synchronous communication method according to claim 1, characterized in that: When the second network is a LIN bus network, the duration of the message sending cycle is the duration of a preset LIN communication scheduling table, and "sending the second instruction message corresponding to the instruction to be sent to the second network based on the nominal sending time" includes: Determining the nominal sending time based on the synchronization time epoch and the schedule duration; At the nominal sending time, sending the first frame message data in the second instruction message to the LIN bus network; Based on the LIN communication scheduling table and the system synchronization time, other frame message data after the first frame message data in the second instruction message are sent to the LIN bus network in sequence.

5. The synchronous communication method according to claim 1, characterized in that: When the second network is a CAN bus network, the duration of the message sending cycle is the preset duration of the sending cycle of the CAN communication frame, and "sending the second instruction message corresponding to the instruction to be sent to the second network based on the nominal sending time" includes: Determining the nominal sending time based on the synchronization time epoch and the sending cycle duration of the CAN communication frame; At the nominal sending time, each frame message data in the second instruction message is sent to the CAN bus network in sequence.

6. The synchronous communication method according to claim 1, characterized in that: The method further comprises: In response to the alternating mode of the diagnostic service, based on the second controller hardware clock, sending the second instruction message and the diagnostic service data, wherein the diagnostic service data is sent between two adjacent message sending cycles; In response to terminating the alternating mode, continuing to send the second instruction message based on the second controller hardware clock, At the next nominal sending time adjacent to the termination time of the alternating mode, the second instruction message is sent based on the system synchronization time.

7. The synchronous communication method according to claim 1, characterized in that: The method further comprises: In response to the exclusive mode of the diagnostic service, based on the second controller hardware clock, sending the diagnostic service data; In response to terminating the exclusive mode, continuing to send the second instruction message based on the second controller hardware clock; At the next nominal sending time adjacent to the termination time of the exclusive mode, the second instruction message is sent based on the system synchronization time.

8. The synchronous communication method according to claim 1, characterized in that: Applied to the first controller, the method further includes: Acquire a maximum transmission time of the first instruction message transmitted between the first controller and each of the second controllers; Obtaining the longest instruction processing time among the controller processing times required by each of the second controllers from the time when the first instruction message is received to the time when the instruction to be sent is written into the communication protocol stack corresponding to the second network; Obtaining the system synchronization time; The expected release time is determined based on the system synchronization time, the longest instruction transmission time and the longest instruction processing time.

9. A synchronous communication system, characterized in that: The system includes a first controller, a second controller and a third controller, wherein the second controller and the third controller perform data communication via a second network; The first controller and the second controller are configured to perform clock synchronization; When the first controller and the second controller complete clock synchronization, The first controller is configured to implement the synchronous communication method of claim 8 when executed; The second controller is configured to implement the synchronous communication method according to any one of claims 1 to 7 when executed.

10. A vehicle, characterized in that: The vehicle comprises the synchronous communication system of claim 9.