Communication control device, communication control method, and communication control program
The communication control device measures and corrects frame transmission times in vehicles by comparing reception intervals with specified schedules, addressing inaccuracies caused by clock errors in existing systems to ensure precise communication.
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- AUTONETWORKS TECH LTD
- Filing Date
- 2024-12-27
- Publication Date
- 2026-07-09
AI Technical Summary
Existing communication control systems in vehicles rely on the clock of a relay device to determine packet transmission timing, which can lead to inaccuracies if the clock is not precise, affecting the correct determination of packet transmission times.
A communication control device that measures reception intervals between frames from different in-vehicle devices, acquires specified intervals based on frame transmission schedules, and determines whether to correct frame transmission times by comparing these intervals, sending correction requests if necessary, thereby ensuring accurate timing regardless of the relay device's clock accuracy.
This approach allows for precise determination of frame transmission times, correcting any discrepancies to ensure accurate communication within the in-vehicle network, independent of the relay device's clock accuracy.
Smart Images

Figure 2026115671000001_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to a communication control device, a communication control method, and a communication control program.
Background Art
[0002] Vehicles are equipped with various in-vehicle devices such as a control system ECU (Electronic Control Unit) that controls an engine, a transmission, etc., a body system ECU that controls a headlight, a power window, etc., and an information system ECU such as a navigation device and a multimedia device. Each in-vehicle device is connected to an in-vehicle network and can communicate with each other.
[0003] In Patent Document 1, in an in-vehicle system in which an information processing device, which is an in-vehicle device, is connected by an in-vehicle LAN (Local Area Network) using Ethernet (registered trademark) via a relay device, which is an in-vehicle relay device, a technique is disclosed in which the relay device corrects the transmission timing of packets by the information processing device. The relay device disclosed in Patent Document 1 receives a packet transmitted from the information processing device, acquires the transmission timing of the packet by the information processing device by referring to scheduling data, calculates the difference between the acquired transmission timing and the reception timing of the packet, and when the absolute value of the calculated difference is equal to or greater than a threshold value, transmits a correction request for correcting the subsequent transmission timing by the calculated difference to the information processing device.
Prior Art Documents
Patent Documents
[0004]
Patent Document 1
Summary of the Invention
Problems to be Solved by the Invention
[0005] The technology disclosed in Patent Document 1 uses the clock of a relay device to obtain the timing of packet reception. Therefore, if the clock of the relay device is inaccurate, the correct packet transmission timing may be incorrectly determined to be inaccurate. [Means for solving the problem]
[0006] A communication control device according to one aspect of the present disclosure is a communication control device that controls communication in an in-vehicle network to which a plurality of in-vehicle devices are connected, and comprises a processor, the processor performing operations including: a measurement process that measures a reception interval which is the difference between a first reception time when a frame transmitted from a first in-vehicle device is received and a second reception time when a frame transmitted from a second in-vehicle device is received; an acquisition process that acquires a specified interval which is the difference between a first specified time when frame transmission from the first in-vehicle device is specified and a second specified time when frame transmission from the second in-vehicle device is specified; a first determination process that determines whether or not to correct the frame transmission time of at least one of the first in-vehicle device and the second in-vehicle device based on a comparison of the measured reception interval and the acquired specified interval; and a transmission process that, if it is determined that the frame transmission time of at least one of the first in-vehicle device and the second in-vehicle device should be corrected, transmits a request for correction of the frame transmission time to at least one of the first in-vehicle device and the second in-vehicle device that was determined to have its frame transmission time corrected. [Effects of the Invention]
[0007] According to this disclosure, it is possible to correctly determine whether the timing of frame transmission from the in-vehicle device is accurate, regardless of the accuracy of the clock in the communication control device. [Brief explanation of the drawing]
[0008] [Figure 1] Figure 1 is a block diagram showing an example of the configuration of an in-vehicle system according to the first embodiment. [Figure 2] Figure 2 is a block diagram showing an example of the hardware configuration of a relay ECU according to the first embodiment. [Figure 3] Figure 3 is a diagram illustrating the transmission period of the frame. [Figure 4] Figure 4 shows an example of the configuration of a management table. [Figure 5] Figure 5 shows an example of a frame transmission schedule table. [Figure 6] Figure 6 is a diagram illustrating the anomaly in the frame transmission time. [Figure 7] Figure 7 is a flowchart showing an example of communication control processing by the relay ECU according to the first embodiment. [Figure 8] Figure 8 is a diagram illustrating the correction of the frame transmission time according to the first embodiment. [Figure 9] Figure 9 is a diagram illustrating the anomaly in the frame transmission time. [Figure 10] Figure 10 is a block diagram showing an example of the hardware configuration of a relay ECU according to the second embodiment. [Figure 11] Figure 11 shows an example of the first schedule table for each group. [Figure 12] Figure 12 is a diagram illustrating the anomaly in the frame transmission time. [Figure 13] Figure 13 is a diagram illustrating the prescribed intervals for each group. [Figure 14] Figure 14 shows an example of a second schedule table. [Figure 15] Figure 15 is a flowchart showing an example of initial processing by the relay ECU according to the second embodiment. [Figure 16] Figure 16 is a flowchart showing an example of the first communication control processing by the relay ECU according to the second embodiment. [Figure 17] Figure 17 is a flowchart showing an example of the second communication control process by the relay ECU according to the second embodiment. [Modes for carrying out the invention]
[0009] <Summary of the embodiments of this disclosure> The embodiments of this disclosure are outlined below.
[0010] (1) The communication control device according to this embodiment is a communication control device that controls communication in an in-vehicle network to which a plurality of in-vehicle devices are connected, and comprises a processor, the processor performing operations including: a measurement process that measures a reception interval which is the difference between a first reception time when a frame transmitted from a first in-vehicle device is received and a second reception time when a frame transmitted from a second in-vehicle device is received; an acquisition process that acquires a specified interval which is the difference between a first specified time when frame transmission from the first in-vehicle device is specified and a second specified time when frame transmission from the second in-vehicle device is specified; a first determination process that determines whether or not to correct the frame transmission time of at least one of the first in-vehicle device and the second in-vehicle device based on a comparison of the measured reception interval and the acquired specified interval; and a transmission process that, if it is determined that the frame transmission time of at least one of the first in-vehicle device and the second in-vehicle device should be corrected, transmits a request for correction of the frame transmission time to at least one of the first in-vehicle device and the second in-vehicle device that was determined to have its frame transmission time corrected. This makes it possible to correctly determine whether the transmission time of frames from the in-vehicle device is accurate, regardless of the accuracy of the communication control device's clock.
[0011] (2) In the above (1), the measurement process includes measuring a first reception interval, which is the difference between the first reception time and the second reception time, and measuring a second reception interval, which is the difference between the second reception time and a third reception time at which a frame transmitted from a third in-vehicle device is received. The acquisition process includes acquiring a first specified interval, which is the difference between the first specified time and the second specified time, and acquiring a second specified interval, which is the difference between the second specified time and a third specified time at which frame transmission from the third in-vehicle device is specified. The first determination process may include determining, based on comparison between the first reception interval and the first specified interval and comparison between the second reception interval and the second specified interval, a correction target for the frame transmission time to any one of the first in-vehicle device, the second in-vehicle device, and the third in-vehicle device. Thereby, based on the relative intervals of the frame reception times from each of the first in-vehicle device, the second in-vehicle device, and the third in-vehicle device, it is possible to determine one in-vehicle device among the first in-vehicle device, the second in-vehicle device, and the third in-vehicle device whose frame transmission time is inaccurate.
[0012] (3) In the above (1) or (2), the acquisition process may include determining a frame transmission schedule including the frame transmission cycles of the plurality of in-vehicle devices and a specified interval, which is the difference between the frame transmission times from the reference time in the frame transmission cycle, based on the frame transmission order of the plurality of in-vehicle devices and the difference between adjacent frame transmission times, and acquiring the specified interval from the frame transmission schedule. Thereby, it is possible to acquire the specified interval of the frame transmission time from the frame transmission schedule.
[0013] (4) In any one of the above (1) to (3), the frame transmission cycles of the first in-vehicle device and the second in-vehicle device may be the same. Thereby, it is possible to determine whether there is a deviation in the frame transmission time in at least any one of two in-vehicle devices having the same frame transmission cycle.
[0014] (5) In any one of (1) to (3) above, the first frame transmission period of the first in-vehicle device and the second frame transmission period of the second in-vehicle device may be different from each other. This makes it possible to determine whether or not there is a discrepancy in the frame transmission time between at least one of the two in-vehicle devices whose frame transmission periods are different from each other.
[0015] (6) In (4) above, the in-vehicle system includes a first representative in-vehicle device that transmits a first representative frame at the same first frame transmission cycle as the first in-vehicle device, and the operation further includes a second determination process that determines whether or not to correct the transmission time of the first representative frame based on the interval between a first representative reception time, which is the reception time of the first representative frame, and a reference time, and the transmission process may include sending a request to correct the transmission time of the first representative frame to the first representative in-vehicle device if it is determined that the transmission time of the first representative frame should be corrected. This makes it possible to correct the frame transmission time of the first representative in-vehicle device when there is a discrepancy in the frame transmission times of the first representative in-vehicle device that represents multiple in-vehicle devices that transmit frames at the first frame transmission cycle.
[0016] (7) In (6) above, the in-vehicle system further includes a second representative in-vehicle device that transmits a second representative frame in a second frame transmission cycle different from the first frame transmission cycle, wherein the reference time is a time that repeatedly occurs in each reference cycle which is the least common multiple of the first frame transmission cycle and the second frame transmission cycle, and the second determination process may include determining whether or not to correct the transmission time of the second representative frame based on the interval between the second representative reception time, which is the reception time of the second representative frame, and the reference time. This makes it possible to correct the frame transmission time of the second representative in-vehicle device when there is a discrepancy in the frame transmission time of the second representative in-vehicle device which represents a plurality of in-vehicle devices that transmit frames in the second frame transmission cycle.
[0017] (8) The communication control method according to this embodiment is a communication control method for controlling communication in an in-vehicle network to which a plurality of in-vehicle devices are connected, and includes the steps of: measuring a reception interval which is the difference between a first reception time when a frame transmitted from a first in-vehicle device is received and a second reception time when a frame transmitted from a second in-vehicle device is received; acquiring a specified interval which is the difference between a first specified time when frame transmission from the first in-vehicle device is specified and a second specified time when frame transmission from the second in-vehicle device is specified; determining whether or not to correct the frame transmission time of at least one of the first in-vehicle device and the second in-vehicle device based on a comparison of the measured reception interval and the acquired specified interval; and, if it is determined that the frame transmission time of at least one of the first in-vehicle device and the second in-vehicle device should be corrected, sending a frame transmission time correction request to at least one of the first in-vehicle device and the second in-vehicle device that was determined to correct the frame transmission time. This makes it possible to correctly determine whether or not the frame transmission time from the in-vehicle device is accurate, regardless of the accuracy of the clock.
[0018] (9) The communication control program according to this embodiment is a communication control program for controlling communication in an in-vehicle network to which a plurality of in-vehicle devices are connected, and causes a computer to perform the following steps: measure a reception interval which is the difference between a first reception time when a frame transmitted from a first in-vehicle device is received and a second reception time when a frame transmitted from a second in-vehicle device is received; acquire a specified interval which is the difference between a first specified time when frame transmission from the first in-vehicle device is specified and a second specified time when frame transmission from the second in-vehicle device is specified; determine whether or not to correct the frame transmission time of at least one of the first in-vehicle device and the second in-vehicle device based on a comparison of the measured reception interval and the acquired specified interval; and, if it is determined that the frame transmission time of at least one of the first in-vehicle device and the second in-vehicle device should be corrected, send a frame transmission time correction request to at least one of the first in-vehicle device and the second in-vehicle device to which it was determined that the frame transmission time should be corrected. This makes it possible to correctly determine whether the transmission time of frames from the in-vehicle device is accurate, regardless of the accuracy of the communication control device's clock.
[0019] This disclosure can be implemented not only as a relay device having the characteristic configuration described above, a communication control method using characteristic processing in the relay device as a step, and a communication control program that causes the relay device to execute characteristic processing, but also as an in-vehicle system including the relay device, or as part or all of the relay device being implemented as a semiconductor integrated circuit.
[0020] <Details of the embodiments of this disclosure> The embodiments of the present invention will be described in detail below with reference to the drawings. At least some of the embodiments described below may be combined in any way.
[0021] [1. First Embodiment] [1-1. In-vehicle systems] Figure 1 is a block diagram showing an example of the configuration of an in-vehicle system according to the first embodiment. The in-vehicle system 100 is mounted on a vehicle.
[0022] The in-vehicle system 100 relating to this implementation includes a relay ECU 200 and ECUs 310A, 320B, 320C, 310D, 320E, 330F, 330G, 310H, and 330I. The in-vehicle system 100 also includes an in-vehicle network consisting of the relay ECU 200, ECUs 310A, 320B, 320C, 310D, 320E, 330F, 330G, 310H, and 330I, and communication lines (communication buses) 400A, 400B, and 400C connecting them.
[0023] Multiple ECUs (Electric Control Units) 310A, 320B, 320C, 310D, 320E, 330F, 330G, 310H, and 330I are located in various parts of the vehicle. These ECUs individually control the hardware of each part of the vehicle and monitor the status of the hardware of each part of the vehicle. For example, ECUs 310A, 320B, 320C, 310D, 320E, 330F, 330G, 310H, and 330I are control system, body system, and information system ECUs. ECUs 310A, 320B, 320C, 310D, 320E, 330F, 330G, 310H, and 330I are examples of "in-vehicle devices".
[0024] The relay ECU 200 is connected to ECUs 310A, 320B, 320C, 310D, 320E, 330F, 330G, 310H, and 330I respectively via communication buses 400A, 400B, and 400C. Communication buses 400A, 400B, and 400C are, for example, CAN buses. Specifically, ECUs 310A, 320B, and 320C are connected to communication bus 400A. ECUs 310D, 320E, and 330F are connected to communication bus 400B. ECUs 330G, 310H, and 330I are connected to communication bus 400C. Each of the ECUs 310A, 320B, and 320C connected to communication bus 400A can communicate with each other via communication bus 400A. ECUs 310D, 320E, and 330F, each connected to communication bus 400B, can communicate with each other via communication bus 400B. ECUs 330G, 310H, and 330I, each connected to communication bus 400C, can communicate with each other via communication bus 400C.
[0025] Each of the relay ECUs, ECUs 200, 310A, 320B, 320C, 310D, 320E, 330F, 330G, 310H, and 330I, uses a communication protocol for periodically or aperiodically sending and receiving frames. The communication protocol is, for example, CAN. The communication protocol may be CAN FD (CAN with Flexible Data Rate) or CAN XL. The communication protocol may also be Ethernet. If Ethernet is used, the in-vehicle network may be configured in a star network topology.
[0026] The relay ECU 200 functions as a gateway that relays communication between ECUs 310A, 320B, 320C, 310D, 320E, 330F, 330G, 310H, and 330I. The relay ECU 200 relays frames between ECUs connected to different buses. That is, ECUs 310A, 320B, and 320C connected to communication bus 400A, ECUs 310D, 320E, and 330F connected to communication bus 400B, and ECUs 330G, 310H, and 330I connected to communication bus 400C can communicate with each other via the relay ECU 200. In a specific example, the relay ECU 200 can relay frames between ECU 310A connected to bus 400A and ECU 310D connected to bus 400B, between ECU 320E connected to bus 400B and ECU 330G connected to bus 400C, and between ECU 320B connected to bus 400A and ECU 310H connected to bus 400C. Hereafter, ECU 310A, 320B, 320C, 310D, 320E, 330F, 330G, 310H, and 330I will be collectively referred to as "ECU 310, 320, and 330".
[0027] [1-2. Hardware configuration of the relay ECU] Figure 2 is a block diagram showing an example of the hardware configuration of a relay ECU according to the first embodiment. The relay ECU 200 includes a processor 201, a non-volatile memory 202, a volatile memory 203, and communication interfaces (hereinafter also referred to as "communication I / F") 204A, 204B, and 204C. The relay ECU 200 is an example of a "communication control device". The processor 201, the non-volatile memory 202, the volatile memory 203, and the communication I / F 204A, 204B, and 204C are each connected to a data bus 205.
[0028] The volatile memory 203 is a semiconductor memory such as SRAM (Static Random Access Memory) or DRAM (Dynamic Random Access Memory). The non-volatile memory 202 is a flash memory, hard disk, or ROM (Read Only Memory). The non-volatile memory 202 stores the communication control program 210, which is a computer program, and the data used to execute the communication control program 210. The functions of the relay ECU 200, which will be described later, are performed when the communication control program 210 is executed by the processor 201.
[0029] The processor 201 is, for example, a CPU (Central Processing Unit). However, the processor 201 is not limited to a CPU. The processor 201 may also be a GPU (Graphics Processing Unit). In a specific example, the processor 201 is a multi-core processor. The processor 201 may also be a single-core processor. The processor 201 is configured to execute computer programs. However, the processor 201 may also be, for example, an ASIC (Application Specific Integrated Circuit), or programmable hardware such as an FPGA (Field Programmable Gate Array) or a CPLD (Complex Programmable Logic Device). In this case, the ASIC or programmable hardware is configured to execute the same functions as the communication control program 210.
[0030] Communication interfaces 204A, 204B, and 204C are communication interfaces that conform to the communication protocols described above. Communication interfaces 204A, 204B, and 204C are, for example, CAN interfaces.
[0031] Communication I / F204A is connected to bus 400A. Communication I / F204B is connected to bus 400B. Communication I / F204C is connected to bus 400C. Relay ECU200 can communicate with ECU310A, 320B, and 320C via communication I / F204A. Relay ECU200 can communicate with ECU310D, 320E, and 330F via communication I / F204B. Relay ECU200 can communicate with ECU330G, 310H, and 330I via communication I / F204C.
[0032] The non-volatile memory 202 stores the management table 220. The management table 220 is used by the communication control program 210. The management table 220 will be described later.
[0033] [1-3. Frame transmission]
[0034] Each of the ECUs, ECU310A, 310D, and 310H, transmits frames at the same period. Each of the ECUs, ECU320B, 320C, and 320E, transmits frames at the same period. Each of the ECUs, ECU330F, 330G, and 330I, transmits frames at the same period. The frame transmission period for ECUs 310A, 310D, and 310H is, for example, 50ms, the frame transmission period for ECUs 320B, 320C, and 320E is, for example, 100ms, and the frame transmission period for ECUs 330F, 330G, and 330I is, for example, 150ms.
[0035] Figure 3 is a diagram illustrating the transmission period of a frame. The transmission period P_T of a frame is defined by periodically occurring reference times t0, t1, t2, t3, ... These reference times t0, t1, t2, t3, ... repeat at regular time intervals. One transmission period P_T is the period from one reference time (e.g., t0) to the next reference time (e.g., t1).
[0036] Each of the ECUs 310, 320, and 330 has an offset OF set individually for frame transmission. The offset OF is the period from the reference time t0, t1, t2, t3, ... to the time when ECUs 310 and 320 transmit a frame (hereinafter also referred to as the "frame transmission time") tr. The offset OF is a period shorter than one transmission cycle P_T. The offset OFs of each of the ECUs 310, 320, and 330 are set so that multiple frame transmissions are not concentrated in a short period but are distributed within the frame transmission cycle.
[0037] Figure 4 shows an example of the configuration of the management table. Figure 4 shows an example of the offset settings for ECU310, 320, and 330. In the example in Figure 4, the offset for ECU310A is set to "2ms", the offset for ECU320B is set to "20ms", the offset for ECU320C is set to "22ms", the offset for ECU310D is set to "4ms", the offset for ECU320E is set to "24ms", the offset for ECU330F is set to "30ms", the offset for ECU330G is set to "32ms", the offset for ECU310H is set to "6ms", and the offset for ECU330I is set to "34ms".
[0038] [1-4. Functions of the Relay ECU] Returning to Figure 2, the communication control program 210 includes several codes that can be executed by the processor 201. The processor 201 executes the relay process 211, the measurement process 212, the acquisition process 213, the determination process 214, and the transmission process 215 based on the communication control program 210.
[0039] Relay processing 211 is the process of relaying frames between buses 400A, 400B, and 400C. Each of the ECUs 310, 320, and 330 is individually assigned a CAN ID, which is identification information. When relay processing 211 receives a frame sent from an ECU connected to the first bus of buses 400A, 400B, and 400C (the relay source ECU), relay ECU 200 refers to the CAN ID stored in the frame. Relay ECU 200 determines the destination ECU (the relay destination ECU) from the CAN ID and sends the frame to the second bus of buses 400A, 400B, and 400C to which the determined destination ECU is connected.
[0040] Measurement process 212 is a process that measures the reception interval, which is the difference between the first reception time when a frame transmitted from the first ECU is received and the second reception time when a frame transmitted from the second ECU is received. In the in-vehicle system 100, frames are transmitted one after another from ECUs 310, 320, and 330. The relay ECU 200 sequentially receives the frames transmitted from ECUs 310, 320, and 330 and measures the reception interval of adjacent frames in the reception order.
[0041] Referring to Figure 4, the transmission period of ECU310A, 310D, and 310H is 50 ms. The offset of ECU310A is 2 ms, the offset of ECU310D is 4 ms, and the offset of ECU310H is 6 ms. For example, if ECU310A, 310D, and 310H transmit frames at the correct transmission timing, ECU310A will transmit a frame, 2 ms later ECU310D will transmit a frame, and 2 ms later ECU310H will transmit a frame. The relay ECU200 measures the reception interval (2 ms), which is the difference between the reception time of the frame from ECU310A and the reception time of the frame from ECU310D, and measures the reception interval (2 ms), which is the difference between the reception time of the frame from ECU310D and the reception time of the frame from ECU310H.
[0042] Returning to Figure 2, acquisition process 213 is the process of acquiring the specified interval, which is the difference between the first specified time when frame transmission from the first ECU is specified and the second specified time when frame transmission from the second ECU is specified. The specified time for frame transmission is the scheduled time for frame transmission, and is the time after an offset has elapsed from the start time (reference time) of the frame transmission cycle. In the example in Figure 4, the specified time for frame transmission of ECU310A is 2ms after the reference time, the specified time for frame transmission of ECU310D is 4ms after the reference time, and the specified time for frame transmission of ECU310H is 6ms after the reference time. Therefore, the specified interval for frame transmission between ECU310A and ECU310D is 2ms, and the specified interval for frame transmission between ECU310D and ECU310H is 2ms.
[0043] In the acquisition process 213, the relay ECU 200 determines the frame transmission schedule based on the management table 220. The frame transmission schedule includes the order of frame transmission and the specified intervals.
[0044] In the first embodiment, the relay ECU 200 creates a frame transmission schedule table. Figure 5 shows an example of a frame transmission schedule table. The frame transmission schedule table includes the order of frame transmission, the CAN ID, a specified time, and a specified interval.
[0045] Figure 5 shows the frame transmission schedule table created from the management table 220 shown in Figure 4. The transmission cycles of ECUs 310, 320, and 330 start simultaneously. That is, from a single reference time, the 50ms transmission cycle of ECUs 310A, 310D, and 310H (hereinafter also referred to as "transmission cycle A"), the 100ms transmission cycle of ECUs 320B, 320C, and 320E (hereinafter also referred to as "transmission cycle B"), and the transmission cycle of ECUs 330F, 330G, and 330I (hereinafter also referred to as "transmission cycle C") all begin.
[0046] Frame transmission order "1" is ECU310A (CAN ID: 0x100) with a specified time of "2ms". Frame transmission order "2" is ECU310D (CAN ID: 0x101) with a specified time of "4ms" and a specified interval (i.e., elapsed time since the specified time of the previous ECU310A) of "2ms". Frame transmission order "3" is ECU310H (CAN ID: 0x102) with a specified time of "6ms" and a specified interval (i.e., elapsed time since the specified time of the previous ECU310D) of "2ms".
[0047] Frame transmission order "4" is ECU320B (CAN ID: 0x200), with a specified time of "20ms" and a specified interval (i.e., elapsed time since the specified time of the previous ECU310H) of "14ms". Frame transmission order "5" is ECU320C (CAN ID: 0x201), with a specified time of "22ms" and a specified interval (i.e., elapsed time since the specified time of the previous ECU320B) of "2ms". Frame transmission order "6" is ECU320E (CAN ID: 0x202), with a specified time of "24ms" and a specified interval (i.e., elapsed time since the specified time of the previous ECU320C) of "2ms".
[0048] Frame transmission sequence "7" is ECU330F (CAN ID: 0x300), with a specified time of "30ms" and a specified interval (i.e., elapsed time since the specified time of the previous ECU320E) of "6ms". Frame transmission sequence "8" is ECU330G (CAN ID: 0x301), with a specified time of "32ms" and a specified interval (i.e., elapsed time since the specified time of the previous ECU330F) of "2ms". Frame transmission sequence "9" is ECU330I (CAN ID: 0x302), with a specified time of "34ms" and a specified interval (i.e., elapsed time since the specified time of the previous ECU330G) of "2ms".
[0049] Frame transmission sequence "10" is ECU310A (CAN ID: 0x100), with a specified time of "52ms" and a specified interval (i.e., elapsed time since the specified time of the previous ECU330I) of "18ms". Frame transmission sequence "11" is ECU310D (CAN ID: 0x101), with a specified time of "54ms" and a specified interval (i.e., elapsed time since the specified time of the previous ECU310A) of "2ms". Frame transmission sequence "12" is ECU310H (CAN ID: 0x102), with a specified time of "56ms" and a specified interval (i.e., elapsed time since the specified time of the previous ECU310D) of "2ms".
[0050] Frame transmission sequence "13" is ECU310A (CAN ID: 0x100), with a specified time of "102ms" and a specified interval (i.e., elapsed time since the specified time of the previous ECU310H) of "46ms". Frame transmission sequence "14" is ECU310D (CAN ID: 0x101), with a specified time of "104ms" and a specified interval (i.e., elapsed time since the specified time of the previous ECU310A) of "2ms". Frame transmission sequence "15" is ECU310H (CAN ID: 0x102), with a specified time of "106ms" and a specified interval (i.e., elapsed time since the specified time of the previous ECU310D) of "2ms".
[0051] In this embodiment, transmission period A is 50ms, transmission period B is 100ms, and transmission period C is 150ms. The least common multiple of transmission periods A, B, and C is 300ms, and the frame transmission schedule of ECUs 310, 320, and 330 is repeated with 300ms as one period (hereinafter also referred to as the "common period"). Therefore, the frame transmission schedule table only needs to specify the frame transmission schedule from the start time (a common reference time for transmission periods A, B, and C; hereinafter also referred to as the "common reference time") up to 300ms, which is the least common multiple of transmission periods A, B, and C (i.e., the frame transmission schedule for one common period).
[0052] Returning to Figure 2, in acquisition process 213, the relay ECU 200 obtains the specified time from the created frame transmission schedule table.
[0053] The determination process 214 is a process that determines whether or not to correct the frame transmission time of at least one of the first ECU and the second ECU, based on a comparison between the reception interval measured in the measurement process 212 and the specified interval acquired in the acquisition process 213. In a specific example, the relay ECU 200 determines in the determination process 214 whether or not to correct the frame transmission time of the second ECU, which transmitted a frame after the first ECU.
[0054] Specifically, the relay ECU 200 calculates the absolute value of the difference between the reception interval and the corresponding specified interval (hereinafter also referred to as the "evaluation value"), and compares the evaluation value with a threshold. If the frame transmission time of either the first ECU, which transmitted the frame first, or the second ECU, which transmitted the frame later, deviates from the specified time by more than the allowable range, the evaluation value exceeds the threshold. Hereinafter, if the frame transmission time does not deviate from the specified time by more than the allowable range, it is said that the frame transmission time is normal, and if the frame transmission time deviates from the specified time by more than the allowable range, it is said that the frame transmission time is abnormal.
[0055] Figure 6 illustrates the abnormality in frame transmission time. When the frame transmission times of ECU310A, 310D, 310H, and 320B are normal, ECU310A transmits a frame 2ms after the reference time, ECU310D transmits a frame 4ms after the reference time, ECU310H transmits a frame 6ms after the reference time, and ECU320B transmits a frame 20ms after the reference time. The frame transmission time interval between ECU310A and ECU310D is 2ms, the frame transmission time interval between ECU310D and ECU310H is 2ms, and the frame transmission time interval between ECU310H and ECU320B is 14ms.
[0056] Let's consider the case where the frame transmission time of ECU310D (reception time at relay ECU200) is abnormal (Case 1). If the frame transmission time of ECU310D is 1 ms later than the specified time, ECU310D will transmit the frame 5 ms after the reference time. In this case, the frame transmission time interval between ECU310A and ECU310D will be 3 ms. The frame transmission time interval between ECU310D and ECU310H will be 1 ms. The frame transmission time interval between ECU310H and ECU320B will be 14 ms.
[0057] In the above case, the frame transmission time interval between ECU310A and ECU310D is 3ms. In the first embodiment, the relay ECU200 determines whether the frame transmission time of ECU310D is normal or abnormal by comparing the frame reception interval between ECU310A and ECU310D with a predetermined interval.
[0058] Specifically, the relay ECU 200 compares the evaluation value of the frame transmission time between ECU 310A and ECU 310D with a threshold. If the evaluation value exceeds the threshold, the relay ECU 200 determines that the frame transmission time of ECU 310D is abnormal.
[0059] In the determination process 214, the relay ECU 200 determines that it will correct the frame transmission time of any ECU whose frame transmission time is abnormal. In other words, the relay ECU 200 determines that any ECU whose frame transmission time is abnormal is subject to frame transmission time correction. For example, the relay ECU 200 determines that an ECU is subject to frame transmission time correction if it has been determined that the frame transmission time of the same ECU is abnormal for a specified number of consecutive times. This eliminates frame transmission time discrepancies caused by sudden or accidental reasons, and allows for accurate determination of which ECUs are subject to frame transmission time correction.
[0060] Returning to Figure 2, the transmission process 215 is the process of sending a frame transmission time correction request to the ECU that has been determined to be subject to frame transmission time correction. The relay ECU 200 sends the correction request frame to the ECU that is subject to frame transmission time correction.
[0061] The correction request frame includes the CAN ID of the ECU to be corrected and the correction time. For example, if ECU310D, whose frame transmission time is 1ms later than the specified time, is to be corrected, the correction request frame will include the CAN ID "0x101" and the correction time "-1". For example, if ECU310H, whose frame transmission time is 1ms earlier than the specified time, is to be corrected, the correction request frame will include the CAN ID "0x102" and the correction time "+1". Here, a positive correction time indicates a correction request to delay the frame transmission time, and a negative correction time indicates a correction request to advance the frame transmission time.
[0062] The CAN ID is not only an identification information for the ECU, but also an identification information for the type of data contained in the frame. For example, if one ECU transmits multiple types of data, multiple CAN IDs may be assigned to that ECU. In this case, by specifying the CAN ID of the frame to be corrected in the correction request frame, it is possible to specify the correction target for each type of data transmitted from a single ECU.
[0063] When an ECU to be corrected receives a correction request frame, it corrects the frame transmission time by the specified correction time. For example, if ECU310D receives a correction request frame with a correction time of "-1", ECU310D will advance its frame transmission time by 1 ms. For example, if ECU310H receives a correction request frame with a correction time of "+1", ECU310H will delay its frame transmission time by 1 ms.
[0064] [1-5. Operation of the relay ECU] The operation of the relay ECU 200 according to the first embodiment will be described below. Figure 7 is a flowchart showing an example of communication control processing by the relay ECU according to the first embodiment.
[0065] The processor 201 uses the management table 220 to create a frame transmission schedule table (step S101).
[0066] The processor 201 sets the variable i, which indicates the transmission order of the frames, to its initial value of "1" (step S102). However, i is a natural number variable.
[0067] When the i-th frame is sent from the ECU, the processor 201 relays the frame (step S103). That is, the processor 201 refers to the CAN ID of the frame received from one bus (first bus) and determines the destination ECU. The processor 201 sends the frame to the bus to which the destination ECU is connected (second bus).
[0068] The processor 201 measures the reception interval, which is the difference between the reception time of the frame relayed this time and the reception time of the frame relayed last time (step S104). That is, the reception interval is the time from when the (i-1)th frame is received until when the (i)th frame is received. However, when i=1, it is not the (i-1)th frame, but the last frame in the frame transmission order in the frame transmission schedule table (hereinafter referred to as the Nth frame).
[0069] The processor 201 obtains a specified interval from the frame transmission schedule table, which is the difference between the specified transmission time of the frame currently relayed and the specified transmission time of the frame previously relayed (step S105). That is, the specified interval is the time from the specified transmission time of the (i-1)th frame to the specified transmission time of the (i)th frame. However, if i=1, it is the Nth frame, not the (i-1)th frame.
[0070] The processor 201 calculates an evaluation value F(i), which is the absolute value of the difference between the reception interval and the specified interval (step S106).
[0071] The processor 201 determines whether the evaluation value F(i) is less than or equal to the threshold Th (step S107), where Th is a fixed real number. If the evaluation value F(i) is less than or equal to the threshold Th (YES in step S107), the processor 201 determines that the transmission time of the i-th frame is normal. If the evaluation value F(i) is greater than the threshold Th (NO in step S107), the processor 201 determines that the transmission time of the i-th frame is abnormal.
[0072] If the evaluation value F(i) is less than or equal to the threshold Th and the transmission time of the i-th frame is normal (YES in step S107), the processor 201 does not send a correction request frame. The processor 201 sets the variable cnt(i), which indicates the number of consecutive times the transmission time of the i-th frame has been determined to be abnormal, to "0" (step S108). However, cnt(i) is a variable that can be 0 or a natural number.
[0073] If the evaluation value F(i) is greater than the threshold Th and the transmission time of the i-th frame is abnormal (NO in step S107), the processor 201 increments cnt(i) (step S109).
[0074] The processor 201 determines whether cnt(i) has reached a specified value n (step S110). The specified value n is, for example, "5". If cnt(i) has not reached the specified value n (NO in step S110), the processor 201 proceeds to step S114.
[0075] If cnt(i) reaches a specified value n (YES in step S110), the processor 201 calculates the correction time (step S111). The correction time is the difference between the reception interval and the specified interval. The processor 201 creates a correction request frame containing the CAN ID of the ECU that sent the i-th frame and the calculated correction time, and sends the created correction request frame (step S112). Furthermore, the processor 201 resets cnt(i) to "0" (step S113).
[0076] The processor 201 determines whether i=N, that is, whether the last transmission order in the frame transmission schedule table has been reached (step S114).
[0077] If i is not N (NO in step S114), the processor 201 increments i (step S115) and returns to step S103.
[0078] If i=N (YES in step S114), the processor 201 returns to step S102.
[0079] [1-6. Variations] [1-6-1. First variation] Figure 8 is a diagram illustrating the correction of frame transmission time according to the first embodiment. Consider the case where ECU310A transmits a frame at time tr1, 2ms after the reference time; ECU310D transmits a frame at time tr2, 5ms after the reference time; ECU310H transmits a frame at time tr3, 6ms after the reference time; and ECU320B transmits a frame at time tr4, 20ms after the reference time.
[0080] Since the offset of ECU310D is 4ms, the frame transmission time tr2 of ECU310D is 1ms later than the specified time. The frame transmission times of ECU310A, 310H, and 320B are normal.
[0081] The specified frame transmission interval between ECU310A and ECU310D is 2ms, and the frame reception interval between ECU310A and ECU310D is 3ms. Therefore, the evaluation value is "1", and if the threshold Th is, for example, "0.5", the frame transmission time tr2 of ECU310D is determined to be abnormal. The correction time is "-1", and the frame transmission time tr2 of ECU310D is corrected to tr2'.
[0082] On the other hand, the specified frame transmission interval between ECU310D and ECU310H is 2ms, and the frame reception interval between ECU310D and ECU310H is 1ms. Therefore, the evaluation value is "1", and if the threshold Th is, for example, "0.5", the frame transmission time of ECU310H is determined to be abnormal. The correction time is "+1", and the frame transmission time tr3 of ECU310H is corrected to tr3'.
[0083] As described above, the normal frame transmission time tr3 of the ECU310H is corrected. To prevent such unnecessary corrections, if the transmission time of the i-th frame is corrected, even if the transmission time of the (i+1)th frame is determined to be abnormal, the transmission time of the (i+1)th frame does not need to be corrected.
[0084] [1-6-2. Second variation] Figure 9 illustrates the abnormality in frame transmission time. The upper diagram in Figure 9 shows the first case described above. In the first case, the frame transmission time of ECU310D is 1 ms later than the specified time, and U310D transmits the frame 5 ms after the reference time. At this time, the frame transmission time interval between ECU310A and ECU310D is 3 ms, and the frame transmission time interval between ECU310D and ECU310H is 1 ms. The frame transmission time interval between ECU310H and ECU320B is 14 ms.
[0085] Let's consider the case (second case) where the frame transmission time of ECU310H (reception time at relay ECU200) is abnormal. The lower diagram in Figure 9 shows the second case. If the frame transmission time of ECU310H is 1 ms earlier than the specified time, ECU310H will transmit the frame 5 ms after the reference time. In this case, the frame transmission time interval between ECU310A and ECU310D is 2 ms. The frame transmission time interval between ECU310D and ECU310H is 1 ms. The frame transmission time interval between ECU310H and ECU320B is 15 ms.
[0086] In both the first and second cases, the frame transmission time interval between ECU310D and ECU310H is 1 ms. Therefore, simply comparing the frame reception interval between ECU310D and ECU310H with a specified interval does not allow for the identification of whether an abnormality in frame transmission time has occurred in either ECU310D or ECU310H. Thus, in the second modified example, the relay ECU200 determines whether the frame transmission time of ECU310D is normal or abnormal by comparing the frame reception interval between ECU310A and ECU310D with a specified interval, and by comparing the frame reception interval between ECU310D and ECU310H with a specified interval. It also determines whether the frame transmission time of ECU310H is normal or abnormal by comparing the frame reception interval between ECU310D and ECU310H with a specified interval, and by comparing the frame reception interval between ECU310H and ECU320B with a specified interval.
[0087] Specifically, the relay ECU 200 compares a first evaluation value of the frame transmission time between ECU 310A and ECU 310D with a threshold, and compares a second evaluation value of the frame transmission time between ECU 310A and ECU 310D with the threshold. If both the first evaluation value and the second evaluation value exceed the threshold, the relay ECU 200 determines that the frame transmission time of ECU 310D, which is related to both the first and second evaluation values, is abnormal. In the first case, as a result of ECU 310D's frame transmission time being 1 ms later than the specified time, the frame transmission time interval of 3 ms between ECU 310A and ECU 310D is greater than the specified interval of 2 ms, and the frame transmission time interval of 1 ms between ECU 310D and ECU 310H is less than the specified interval of 2 ms. Therefore, the above determination process can correctly determine that the frame transmission time of ECU 310D is abnormal.
[0088] The relay ECU 200 compares a first evaluation value of the frame transmission time between ECU 310D and ECU 310H with a threshold, and compares a second evaluation value of the frame transmission time between ECU 310H and ECU 320B with a threshold. If both the first evaluation value and the second evaluation value exceed the threshold, the relay ECU 200 determines that the frame transmission time of ECU 310H, which is related to both the first and second evaluation values, is abnormal. In the second case, the frame transmission time of ECU 310H is 1 ms earlier than the specified time, resulting in a frame transmission time interval of 3 ms between ECU 310D and ECU 310H that is greater than the specified interval of 2 ms, and a frame transmission time interval of 15 ms between ECU 310H and ECU 320B that is smaller than the specified interval of 16 ms. Therefore, the above determination process can correctly determine that the frame transmission time of ECU 310H is abnormal.
[0089] [2. Second Embodiment] [2-1. Functions of the relay ECU] Figure 10 is a block diagram showing an example of the hardware configuration of a relay ECU according to the second embodiment. The hardware configuration of the relay ECU 200 according to the second embodiment is the same as that of the relay ECU 200 according to the first embodiment, except for the communication control program 210, so a description is omitted.
[0090] The communication control program 210 includes multiple codes that can be executed by the processor 201. The processor 201 executes the relay process 231, the first measurement process 232, the first acquisition process 233, the first determination process 234, the second measurement process 235, the second acquisition process 236, the second determination process 237, and the transmission process 238 based on the communication control program 210.
[0091] The relay process 231 is the same as the relay process 211 according to the first embodiment.
[0092] In the second embodiment, ECUs 310, 320, and 330 are grouped by frame transmission period. For example, ECUs 310A, 310D, and 310H, which have a frame transmission period of 50ms, constitute group A. ECUs 320B, 320C, and 320E, which have a frame transmission period of 100ms, constitute group B. ECUs 330F, 330G, and 330I, which have a frame transmission period of 150ms, constitute group C.
[0093] In each group, one ECU acts as the representative ECU. For example, the representative ECU for Group A is ECU310D, the representative ECU for Group B is ECU320C, and the representative ECU for Group C is ECU330G. Hereafter, the frame transmitted by the representative ECU will also be referred to as the "representative frame."
[0094] The first measurement process 232 measures the reception interval, which is the difference between the first reception time when a frame transmitted from the first ECU is received and the second reception time when a frame transmitted from the second ECU, which has the same frame transmission period as the first ECU, is received. In other words, the first measurement process 232 measures the frame reception interval between ECUs in the same group.
[0095] The first acquisition process 233 is a process that acquires a specified interval, which is the difference between the first specified time when frame transmission from the first ECU is specified and the second specified time when frame transmission from the second ECU, which has the same frame transmission period as the first ECU, is specified. In other words, the first acquisition process 233 acquires the specified frame interval between ECUs in the same group.
[0096] In the first acquisition process 233, the relay ECU 200 determines the frame transmission schedule for each group based on the management table 220.
[0097] In the second embodiment, the relay ECU 200 creates a first schedule table for each group that shows the frame transmission schedule. Figure 11 shows an example of the first schedule table for each group. In the example in Figure 11, the first schedule table 500A for group A, the first schedule table 500B for group B, and the first schedule table 500C for group C are shown.
[0098] Each of the first schedule tables 500A, 500B, and 500C includes the transmission order, CAN ID, and specified interval.
[0099] In the first schedule table 500A, transmission order "1" is associated with the CAN ID "0x100" of ECU310A and the specified interval "46ms". The specified interval of 46ms is the interval between the specified time of frame transmission by ECU310H, which transmitted the frame immediately before (at the end of the previous cycle), and the specified time of frame transmission by ECU310A. Furthermore, in the first schedule table 500A, transmission order "2" is associated with the CAN ID "0x101" of ECU310D and the specified interval "2ms". The specified interval of 2ms is the interval between the specified time of frame transmission by ECU310A, which transmitted the frame immediately before, and the specified time of frame transmission by ECU310D. Furthermore, in the first schedule table 500A, transmission order "3" is associated with the CAN ID "0x102" of ECU310H and the specified interval "2ms". The specified interval of 2ms is the interval between the specified time of frame transmission by ECU310D, which transmitted the frame immediately before, and the specified time of frame transmission by ECU310H.
[0100] In the first schedule table 500B, transmission order "1" is associated with the CAN ID "0x200" of ECU320B and the specified interval "96ms". The specified interval of 96ms is the interval between the specified time of frame transmission by ECU320E, which transmitted the frame immediately before (at the end of the previous cycle), and the specified time of frame transmission by ECU320B. Furthermore, in the first schedule table 500B, transmission order "2" is associated with the CAN ID "0x201" of ECU320C and the specified interval "2ms". The specified interval of 2ms is the interval between the specified time of frame transmission by ECU320B, which transmitted the frame immediately before, and the specified time of frame transmission by ECU320C. Furthermore, in the first schedule table 500B, transmission order "3" is associated with the CAN ID "0x202" of ECU320E and the specified interval "2ms". The specified interval of 2ms is the interval between the specified time of frame transmission by ECU320C, which transmitted the frame immediately before, and the specified time of frame transmission by ECU320E.
[0101] In the first schedule table 500C, transmission order "1" is associated with the CAN ID "0x300" of ECU330F and the specified interval "146ms". The specified interval of 146ms is the interval between the specified time of frame transmission by ECU330I, which transmitted the frame immediately before (at the end of the previous cycle), and the specified time of frame transmission by ECU330F. Furthermore, in the first schedule table 500C, transmission order "2" is associated with the CAN ID "0x301" of ECU330G and the specified interval "2ms". The specified interval of 2ms is the interval between the specified time of frame transmission by ECU330F, which transmitted the frame immediately before, and the specified time of frame transmission by ECU330G. Furthermore, in the first schedule table 500C, transmission order "3" is associated with the CAN ID "0x302" of ECU330I and the specified interval "2ms". The specified interval of 2ms is the interval between the specified time of frame transmission by ECU330G, which transmitted the frame immediately before, and the specified time of frame transmission by ECU330I.
[0102] Returning to Figure 10, in the first acquisition process 233, the relay ECU 200 obtains a specified time from the created first schedule tables 500A, 500B, and 500C. Specifically, the relay ECU 200 obtains a specified time corresponding to the CAN ID stored in the received frame from the first schedule table of the group to which the ECU that sent the received frame belongs.
[0103] The first determination process 234 is a process that determines whether or not to correct the frame transmission time of at least one of the first ECU and the second ECU, based on a comparison between the reception interval measured in the first measurement process 232 and the specified interval acquired in the first acquisition process 233. In a specific example, the relay ECU 200 determines in the first determination process 234 whether or not to correct the frame transmission time of the second ECU, which transmitted a frame after the first ECU.
[0104] Specifically, the relay ECU 200 calculates an evaluation value, which is the absolute value of the difference between the reception interval and the corresponding specified interval, and compares the evaluation value with a threshold. If the frame transmission time of either the first ECU, which transmitted the frame first, or the second ECU, which transmitted the frame later, deviates from the specified time by more than the allowable range, the evaluation value exceeds the threshold.
[0105] Figure 12 illustrates the abnormality in frame transmission time. When the frame transmission times of ECU310A, 310D, and 310H are normal, the specified interval for frame transmission time between ECU310A and ECU310D is 2ms, the specified interval for frame transmission time between ECU310D and ECU310H is 2ms, and the specified interval for frame transmission time between ECU310H and ECU310A is 46ms.
[0106] Let's consider the case where the frame transmission time of ECU310H (reception time at relay ECU200) is abnormal. If the frame transmission time of ECU310H is 1ms later than the specified time, the frame transmission time interval between ECU310D and ECU310H will be 3ms, and the frame transmission time interval between ECU310H and ECU310A will be 45ms.
[0107] In the second embodiment, the relay ECU 200 determines whether the frame transmission time of ECU 310H is normal or abnormal by comparing the frame reception interval between ECU 310D and ECU 310H with a predetermined interval.
[0108] Specifically, the relay ECU 200 compares the evaluation value of the frame transmission time between ECU 310D and ECU 310H with a threshold. If the evaluation value exceeds the threshold, the relay ECU 200 determines that the frame transmission time of ECU 310H is abnormal.
[0109] In the first determination process 234, the relay ECU 200 determines that it will correct the frame transmission time of an ECU whose frame transmission time is abnormal. That is, the relay ECU 200 determines that an ECU whose frame transmission time is abnormal is subject to frame transmission time correction. For example, the relay ECU 200 determines that an ECU is subject to frame transmission time correction if it has been determined that the frame transmission time of the same ECU is abnormal for a specified number of consecutive times. This makes it possible to eliminate frame transmission time discrepancies caused by sudden or accidental reasons and to accurately determine which ECUs are subject to frame transmission time correction.
[0110] Returning to Figure 10, the transmission process 238 is the process of sending a frame transmission time correction request to the ECU that has been determined to be subject to frame transmission time correction. The relay ECU 200 sends the correction request frame to the ECU whose frame transmission time is subject to correction. The correction request frame is the same as the correction request frame described in the first embodiment, so its description is omitted.
[0111] The second measurement process 235 measures the interval between the reception time of the first representative frame transmitted from the first representative ECU, which transmits frames at the first frame transmission cycle, and the reference time. Furthermore, the second measurement process 235 measures the interval between the reception time of the second representative frame transmitted from the second representative ECU, which transmits frames at a second frame transmission cycle different from the first frame transmission cycle, and the reference time.
[0112] The above reference time is the time that repeatedly occurs with each reference period, which is the least common multiple of the first frame transmission period and the second frame transmission period. In the second embodiment, the frame transmission period of group A is 50 ms, the frame transmission period of group B is 100 ms, and the frame transmission period of group C is 150 ms. The least common multiple of the frame transmission periods is 300 ms, and this 300 ms is the reference period. Hereinafter, the reference time that repeatedly occurs with each reference period will also be called the "common reference time". The common reference time is the reference time common to group A, group B, and group C.
[0113] Specifically, the relay ECU 200 measures the reception interval, which is the difference between the reception time of a frame (representative frame) transmitted from ECU 310D, the representative ECU of Group A, and the common reference time. The relay ECU 200 also measures the reception interval, which is the difference between the reception time of a frame (representative frame) transmitted from ECU 320C, the representative ECU of Group B, and the common reference time. The relay ECU 200 also measures the reception interval, which is the difference between the reception time of a frame (representative frame) transmitted from ECU 330G, the representative ECU of Group C, and the common reference time.
[0114] The second acquisition process 236 is a process that acquires a specified interval, which is the interval between the specified time when the first representative frame is transmitted from the first representative ECU and the common reference time. Furthermore, the second acquisition process 236 acquires a specified interval, which is the interval between the specified time when the second representative frame is transmitted from the second representative ECU and the common reference time.
[0115] Specifically, the relay ECU 200 obtains a specified interval, which is the difference between the specified time when a frame (representative frame) is transmitted from ECU 310D, the representative ECU of Group A, and the common reference time. The relay ECU 200 obtains a specified interval, which is the difference between the specified time when a frame (representative frame) is transmitted from ECU 320C, the representative ECU of Group B, and the common reference time. The relay ECU 200 measures a specified interval, which is the difference between the specified time when a frame (representative frame) is transmitted from ECU 330G, the representative ECU of Group C, and the common reference time.
[0116] Figure 13 is a diagram illustrating the prescribed intervals for each group. The transmission periods A, B, and C for groups A, B, and C start simultaneously. Therefore, every 300ms, which is the common reference period, transmission periods A, B, and C end and start simultaneously. The time when transmission periods A, B, and C start (end) simultaneously is the common reference time.
[0117] ECU310D, the representative ECU for Group A, has a 4ms offset set. ECU310D transmits a frame 4ms after the common reference time. Furthermore, ECU310D transmits frames 54ms, 104ms, 154ms, 204ms, and 254ms after the common reference time.
[0118] ECU320C, the representative ECU for Group B, has a 22ms offset set. ECU320C transmits a frame 22ms after the common reference time. Furthermore, ECU320C transmits frames 122ms after the common reference time and 222ms after the common reference time.
[0119] ECU330G, the representative ECU for Group C, has a 32ms offset set. ECU330G transmits a frame 32ms after the common reference time. Furthermore, ECU330G transmits a frame 182ms after the common reference time.
[0120] Returning to Figure 10, the relay ECU 200 determines the transmission schedule for the representative frame based on the management table 220 in the second acquisition process 236.
[0121] In the second embodiment, the relay ECU 200 creates a second schedule table that shows the transmission schedule for representative frames. Figure 14 shows an example of the second schedule table. In the example in Figure 14, the second schedule table includes the transmission order, the CAN ID, and the specified interval.
[0122] In Figure 14, "Transmission Order" refers to the order in which representative frames are transmitted within a common reference period. Frame transmission order "1" is ECU310D (CAN ID: 0x101), with a specified interval of "4ms". Frame transmission order "2" is ECU320C (CAN ID: 0x201), with a specified interval of "22ms". Frame transmission order "3" is ECU330G (CAN ID: 0x301), with a specified interval of "32ms". Frame transmission order "4" is ECU310D (CAN ID: 0x101), with a specified interval of "54ms". Frame transmission order "5" is ECU310D (CAN ID: 0x101), with a specified interval of "104ms". Frame transmission order "6" is ECU320C (CAN ID: 0x201), with a specified interval of "122ms". Frame transmission sequence "7" is ECU310D (CAN ID: 0x101), with a specified interval of "154ms". Frame transmission sequence "8" is ECU330G (CAN ID: 0x301), with a specified interval of "182ms". Frame transmission sequence "9" is ECU310D (CAN ID: 0x101), with a specified interval of "204ms". Frame transmission sequence "10" is ECU320C (CAN ID: 0x201), with a specified interval of "222ms". Frame transmission sequence "11" is ECU310D (CAN ID: 0x101), with a specified interval of "254ms".
[0123] Returning to Figure 10, in the second acquisition process 236, the relay ECU 200 acquires the specified interval from the created second schedule table.
[0124] The second determination process 237 is a process that determines whether or not to correct the frame transmission time of the representative ECU based on a comparison between the reception interval measured in the second measurement process 235 and the specified interval acquired in the second acquisition process 236.
[0125] Specifically, the relay ECU 200 calculates an evaluation value, which is the absolute difference between the reception interval and the corresponding specified interval, and compares the evaluation value with a threshold. If the frame transmission time from the representative ECU deviates from the specified time by more than an acceptable range, the evaluation value exceeds the threshold. The first determination process described above can determine if there is a relative discrepancy in frame transmission times between ECUs within the group. Even if the frame transmission time is corrected and the relative discrepancy in frame transmission times determined by the first determination process is resolved, there is still a possibility that the frame transmission time of the entire group is out of sync with the common reference time. The second determination process 237 can determine if there is a discrepancy (i.e., an absolute discrepancy) in the transmission time of the representative frame with respect to the common reference time.
[0126] In the second determination process 237, the relay ECU 200 determines that it will correct the frame transmission time of the representative ECU. That is, the relay ECU 200 determines that a representative ECU whose frame transmission time is abnormal is subject to frame transmission time correction. For example, if the relay ECU 200 determines that the frame transmission time of the same representative ECU is abnormal for a specified number of consecutive times, it determines that the representative ECU is subject to frame transmission time correction.
[0127] Transmission process 238 is the process of sending a frame transmission time correction request to the representative ECU that has been determined to be subject to frame transmission time correction. The relay ECU 200 sends the correction request frame to the representative ECU that is subject to frame transmission time correction. As described above, even if the frame transmission times of the entire group are out of sync, the absolute discrepancy in the representative frame is resolved, so that the frame transmission times within the group are corrected to match the representative frame, and the frame transmission times of the entire group can be normalized.
[0128] [2-2. Operation of the relay ECU] The operation of the relay ECU 200 according to the second embodiment will be described below. Figure 15 is a flowchart showing an example of initial processing by the relay ECU according to the second embodiment. Figure 16 is a flowchart showing an example of first communication control processing by the relay ECU according to the second embodiment. Figure 17 is a flowchart showing an example of second communication control processing by the relay ECU according to the second embodiment.
[0129] Refer to Figure 15 to explain the initial processing. Initial processing is performed before the first and second communication control processing, and is a process for preparing the first and second communication control processing.
[0130] Processor 201 creates a first schedule table using management table 220 (step S201). Processor 201 then creates a second schedule table using management table 220 (step S202). This completes the initial processing.
[0131] Referring to Figure 16, the first communication control process will be explained. The first communication control process is a process for correcting the relative difference in frame transmission times within a group. Processor 201 executes the first communication control process for each group of frame transmission cycles. That is, processor 201 executes the first communication control process individually for each of groups A, B, and C. The first communication control process for one group will be explained below.
[0132] The processor 201 sets the variable j, which indicates the transmission order of the frames, to its initial value of "1" (step S211). Here, j is a natural number variable.
[0133] When processor 201 receives a frame, it refers to the CAN ID of the received frame and compares it with the CAN ID corresponding to the transmission order j in the first schedule table. If the two CAN IDs match, processor 201 relays the frame (step S212).
[0134] The processor 201 measures the reception interval, which is the difference between the reception time of the frame currently relayed and the reception time of the frame previously relayed within the same group (step S213). That is, the reception interval is the time from the reception of the (j-1)th frame to the reception of the (j)th frame. However, if j=1, it is not the (j-1)th frame, but the last frame in the transmission order of the frames in the first schedule table (hereinafter referred to as the Mth frame).
[0135] The processor 201 obtains a specified interval from the first schedule table (step S214) which is the difference between the specified transmission time of the frame currently relayed and the specified transmission time of the frame previously relayed within the same group. That is, the specified interval is the time from the specified transmission time of the (j-1)th frame to the specified transmission time of the (j)th frame. However, if j=1, it is the Mth frame instead of the (j-1)th frame.
[0136] The processor 201 calculates an evaluation value F1(j), which is the absolute value of the difference between the reception interval and the specified interval (step S215).
[0137] The processor 201 determines whether the evaluation value F1(j) is less than or equal to the threshold Th1 (step S216). However, Th1 is a fixed real number. If the evaluation value F1(j) is less than or equal to the threshold Th1 (YES in step S216), the processor 201 determines that the transmission time of the j-th frame is normal. If the evaluation value F1(j) is greater than the threshold Th1 (NO in step S216), the processor 201 determines that the transmission time of the j-th frame is abnormal.
[0138] If the evaluation value F1(j) is less than or equal to the threshold Th1 and the transmission time of the j-th frame is normal (YES in step S216), the processor 201 does not send a correction request frame. The processor 201 sets the variable cnt1 to "0" (step S217). However, cnt1 is a variable that indicates the number of consecutive times the transmission time of the frame of the CAN ID corresponding to the transmission order "j" in the first schedule table has been determined to be abnormal, and is a variable of 0 and a natural number. That is, cnt1 is a variable assigned to each CAN ID. For example, the variable cnt1 corresponding to CAN ID "0x100" and the variable cnt1 corresponding to CAN ID "0x101" are different from each other and are stored in, for example, non-volatile memory 202. The variable cnt1 that is set to "0" in step S217 is the variable cnt1 assigned to the CAN ID corresponding to the transmission order j in the first schedule table.
[0139] If the evaluation value F1(j) is greater than the threshold Th1 and the transmission time of the j-th frame is abnormal (NO in step S216), the processor 201 increments cnt1 (cnt1 assigned to the CAN ID corresponding to the transmission sequence "j") (step S218).
[0140] The processor 201 determines whether cnt1 has reached a specified value m (step S219). The specified value m is, for example, "5". If cnt1 has not reached the specified value m (NO in step S219), the processor 201 proceeds to step S223.
[0141] If cnt1 reaches a specified value m (YES in step S219), the processor 201 calculates the correction time (step S220). The correction time is the difference between the reception interval and the specified interval. The processor 201 creates a correction request frame containing the CAN ID of the ECU that sent the j-th frame and the calculated correction time, and sends the created correction request frame (step S221). Furthermore, the processor 201 resets cnt1 to "0" (step S222).
[0142] The processor 201 determines whether j=M, that is, whether the last transmission order has been reached in the first schedule table (step S223).
[0143] If j is not M (NO in step S223), the processor 201 increments j (step S224) and returns to step S212.
[0144] If j=M (YES in step S223), processor 201 returns to step S211.
[0145] Referring to Figure 17, the second communication control process will be explained. The second communication control process is a process for correcting the absolute discrepancy in the transmission time of the representative frame. The second communication control process is executed in parallel with the first communication control process (i.e., the execution periods of the first communication control process and the second communication control process overlap).
[0146] The processor 201 sets the variable k, which indicates the transmission order of the representative frame, to its initial value of "1" (step S231). Here, k is a natural number variable.
[0147] When processor 201 receives a frame, it determines whether the received frame is a representative frame (step S232). Specifically, processor 201 refers to the CAN ID of the received frame and compares it with the CAN ID corresponding to the transmission order k in the second schedule table. If the two CAN IDs do not match, processor 201 determines that the received frame is not a representative frame; if the two CAN IDs match, it determines that the received frame is a representative frame. If the received frame is not a representative frame (NO in step S232), processor 201 executes step S232 again.
[0148] If the received frame is a representative frame (YES in step S232), the processor 201 measures the reception interval, which is the difference between the reception time of the representative frame and the common reference time (step S233). That is, the reception interval is the time from the common reference time until the kth representative frame is received.
[0149] The processor 201 obtains a specified interval from the second schedule table, which is the difference between the specified time for transmission of the k-th representative frame within the same group and the common reference time (step S234). That is, the specified interval is the time from the common reference time to the specified time for transmission of the k-th frame.
[0150] The processor 201 calculates an evaluation value F2(k), which is the absolute value of the difference between the reception interval and the specified interval (step S235).
[0151] The processor 201 determines whether the evaluation value F2(k) is less than or equal to the threshold Th2 (step S236). However, Th2 is a fixed real number. If the evaluation value F2(k) is less than or equal to the threshold Th2 (YES in step S236), the processor 201 determines that the transmission time of the k-th representative frame is normal. If the evaluation value F2(k) is greater than the threshold Th2 (NO in step S236), the processor 201 determines that the transmission time of the k-th representative frame is abnormal.
[0152] If the evaluation value F2(k) is less than or equal to the threshold Th2 and the transmission time of the k-th representative frame is normal (YES in step S236), the processor 201 does not send a correction request frame. The processor 201 sets the variable cnt2 to "0" (step S237). However, cnt2 is a variable that indicates the number of consecutive times the transmission time of the representative frame of the CAN ID corresponding to the transmission order "k" in the second schedule table has been determined to be abnormal, and is a variable of 0 and a natural number. That is, cnt2 is a variable assigned to each CAN ID of the representative ECU. For example, the variable cnt2 corresponding to CAN ID "0x101" and the variable cnt2 corresponding to CAN ID "0x201" are different from each other, and each is stored in, for example, non-volatile memory 202. The variable cnt2 that is set to "0" in step S237 is the variable cnt2 assigned to the CAN ID corresponding to the transmission order k in the second schedule table.
[0153] If the evaluation value F2(k) is greater than the threshold Th2 and the transmission time of the k-th frame is abnormal (NO in step S236), the processor 201 increments cnt2 (cnt2 assigned to the CAN ID corresponding to the transmission sequence "k") (step S238).
[0154] The processor 201 determines whether cnt2 has reached a specified value l (step S239). The specified value l is, for example, "5". If cnt2 has not reached the specified value l (NO in step S239), the processor 201 proceeds to step S243.
[0155] If cnt2 reaches a specified value l (YES in step S239), the processor 201 calculates the correction time (step S240). The correction time is the difference between the reception interval and the specified interval. The processor 201 creates a correction request frame containing the CAN ID of the representative ECU that sent the k-th representative frame and the calculated correction time, and sends the created correction request frame (step S241). Furthermore, the processor 201 resets cnt2 to "0" (step S242).
[0156] The processor 201 determines whether k=L or not (step S243). Here, L is the total number of representative frames transmitted in the common reference period and is the last transmission order in the second schedule table. In other words, the processor 201 determines whether or not the last transmission order in the second schedule table has been reached.
[0157] If k is not L (NO in step S243), the processor 201 increments k (step S244) and returns to step S232.
[0158] If k=L (YES in step S243), the processor 201 returns to step S231.
[0159] [3. Other Embodiments] In the above embodiment, the communication control device is the relay ECU 200, but it is not limited to this. An ECU other than the relay ECU 200 may be used as the communication control device. For example, an ECU that functions as a communication control device may be provided for each of the buses 400A, 400B, and 400C.
[0160] [4. Supplementary Notes] The embodiments disclosed herein are illustrative in all respects and are not restrictive. The scope of the present invention is indicated by the claims rather than by the embodiments described above, and includes all modifications within the meaning and scope of the equivalents of the claims. [Explanation of Symbols]
[0161] 100 In-vehicle systems 200 Relay ECU 201 Processor 202 Non-volatile memory 203 Volatile memory 204A, 204B, 204C Communication Interface (Communication I / F) 205 Data Bus 210 Communication control program 211 Relay Processing 212 Measurement process 213 Acquisition process 214 Judgment Processing 215 Transmission process 220 Management Tables 231 Relay Processing 232 First Measurement Process 233 First acquisition process 234 First determination process 235 Second measurement process 236 Second acquisition process 237 Second determination process 238 Transmission process 310A,320B,320C,310D,320E,330F,330G,310H,330I ECU 400A, 400B, 400C communication bus 500A, 500B, 500C First Schedule Table
Claims
1. A communication control device that controls communication in an in-vehicle network to which multiple in-vehicle devices are connected, Equipped with a processor, The aforementioned processor, A measurement process that measures the reception interval, which is the difference between the first reception time when a frame transmitted from the first in-vehicle device is received and the second reception time when a frame transmitted from the second in-vehicle device is received. An acquisition process to acquire a specified interval which is the difference between a first specified time when frame transmission from the first in-vehicle device is specified and a second specified time when frame transmission from the second in-vehicle device is specified, A first determination process that determines whether or not to correct the frame transmission time of at least one of the first and second in-vehicle devices based on a comparison between the measured reception interval and the acquired specified interval, If it is determined that the frame transmission time of at least one of the first and second in-vehicle devices should be corrected, a transmission process is performed to send a frame transmission time correction request to at least one of the first and second in-vehicle devices that was determined to require correction of the frame transmission time. Perform an action that includes Communication control device.
2. The measurement process includes measuring a first reception interval, which is the difference between the first reception time and the second reception time, and measuring a second reception interval, which is the difference between the second reception time and the third reception time when a frame transmitted from the third in-vehicle device was received. The acquisition process includes acquiring a first specified interval, which is the difference between the first specified time and the second specified time, and acquiring a second specified interval, which is the difference between the second specified time and the third specified time, in which frame transmission from the third in-vehicle device is specified. The first determination process includes determining which of the first, second, and third on-board devices is the target for correction of the frame transmission time, based on a comparison of the first reception interval and the first specified interval, and a comparison of the second reception interval and the second specified interval. The communication control device according to claim 1.
3. The acquisition process includes determining a frame transmission schedule that includes the order of frame transmissions of the multiple in-vehicle devices and a specified interval that is the difference between adjacent frame transmission times, based on the frame transmission cycles of the multiple in-vehicle devices and the frame transmission offset, which is the interval from a reference time to a frame transmission time in the frame transmission cycle; and acquiring the specified interval from the frame transmission schedule. The communication control device according to claim 1.
4. The frame transmission period of the first in-vehicle device and the frame transmission period of the second in-vehicle device are the same. A communication control device according to any one of claims 1 to 3.
5. The first frame transmission period of the first in-vehicle device and the second frame transmission period of the second in-vehicle device are different from each other. A communication control device according to any one of claims 1 to 3.
6. The in-vehicle system includes a first representative in-vehicle device that transmits a first representative frame with the same first frame transmission cycle as the first in-vehicle device, The aforementioned operation is, A second determination process determines whether or not to correct the transmission time of the first representative frame based on the interval between the first representative reception time, which is the reception time of the first representative frame, and the reference time. It further includes, The transmission process includes, when it is determined that the transmission time of the first representative frame should be corrected, sending a request to correct the transmission time of the first representative frame to the first representative in-vehicle device. The communication control device according to claim 4.
7. The in-vehicle system further includes a second representative in-vehicle device that transmits a second representative frame at a second frame transmission cycle different from the first frame transmission cycle. The aforementioned reference time is a time that repeatedly occurs at each reference period which is the least common multiple of the first frame transmission period and the second frame transmission period. The second determination process includes determining whether or not to correct the transmission time of the second representative frame based on the interval between the second representative reception time, which is the reception time of the second representative frame, and the reference time. The communication control device according to claim 6.
8. A communication control method for controlling communication in an in-vehicle network to which multiple in-vehicle devices are connected, A step of measuring the reception interval, which is the difference between the first reception time when a frame transmitted from the first in-vehicle device is received and the second reception time when a frame transmitted from the second in-vehicle device is received. A step of obtaining a specified interval which is the difference between a first specified time for which frame transmission from the first in-vehicle device is specified and a second specified time for which frame transmission from the second in-vehicle device is specified, A step of determining whether or not to correct the frame transmission time of at least one of the first and second in-vehicle devices based on a comparison between the measured reception interval and the acquired specified interval, If it is determined that the frame transmission time of at least one of the first and second in-vehicle devices should be corrected, the step of sending a frame transmission time correction request to at least one of the first and second in-vehicle devices that was determined to require correction of the frame transmission time, including, Communication control method.
9. A communication control program for controlling communication in an in-vehicle network to which multiple in-vehicle devices are connected, On the computer, A step of measuring the reception interval, which is the difference between the first reception time when a frame transmitted from the first in-vehicle device is received and the second reception time when a frame transmitted from the second in-vehicle device is received. A step of obtaining a specified interval which is the difference between a first specified time for which frame transmission from the first in-vehicle device is specified and a second specified time for which frame transmission from the second in-vehicle device is specified, A step of determining whether or not to correct the frame transmission time of at least one of the first and second in-vehicle devices based on a comparison between the measured reception interval and the acquired specified interval, If it is determined that the frame transmission time of at least one of the first and second in-vehicle devices should be corrected, the step of sending a frame transmission time correction request to at least one of the first and second in-vehicle devices that was determined to require correction of the frame transmission time, To execute Communication control program.