In-vehicle system, relay device, and relay method
Patent Information
- Application Number
- PCT/JP2024/032368
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-09-21
- Filing Date
- 2024-09-10
- Publication Date
- 2025-03-27
Smart Images

Figure JP2024032368_27032025_PF_FP_ABST
Abstract
Description
In-vehicle system, relay device, and relay method
[0001] This application claims priority to Japanese Patent Application No. 2023-155576, filed September 21, 2023, and incorporates by reference the entire contents of that application.
[0002] A vehicle is equipped with a variety of on-board devices, such as control system ECUs (Electronic Control Units) that control the engine, transmission, etc., body system ECUs that control headlights, power windows, etc., and information system ECUs for navigation devices, multimedia devices, etc. Each on-board device is connected to an on-board network and can communicate with each other.
[0003] In an in-vehicle system in which in-vehicle devices are connected via an in-vehicle network, multiple in-vehicle devices may be required to receive frames simultaneously. For example, when unlocking doors, the two in-vehicle devices that control the left and right door locks must simultaneously receive a frame instructing them to unlock the doors. If the number of relay devices (i.e., the number of relay stages) on each communication path from the frame sender to the two in-vehicle devices that control the door locks is different, the frame will not arrive at the two in-vehicle devices simultaneously due to the delay time required for frame forwarding at each relay device.
[0004] Patent Literature 1 discloses a relay system in which, when one relay device transmits data (frames) to another relay device, it transmits time information indicating the time at which the data should be transmitted to the other relay device. The other relay device transmits the data at the time specified by the time information, thereby enabling multiple in-vehicle devices to receive the data simultaneously.
[0005] Japanese Patent Application Laid-Open No. 2020-205573
[0006] An in-vehicle system according to one aspect of the present disclosure comprises a first in-vehicle device, a second in-vehicle device, and a plurality of relay devices that relay frames to the first in-vehicle device and the second in-vehicle device, and when the number of relay devices in a first communication path from the sender of the frame to the first in-vehicle device is different from the number of relay devices in a second communication path from the sender of the frame to the second in-vehicle device, at least one of the relay devices included in the first communication path and the second communication path waits for a waiting time based on the difference between the number of relay devices in the first communication path and the number of relay devices in the second communication path, and then relays the frame.
[0007] FIG. 1 is a block diagram showing an example of the configuration of an in-vehicle system according to an embodiment. FIG. 2 is a block diagram showing an example of the hardware configuration of a relay device according to an embodiment. FIG. 3A is a diagram showing a first example of frame transmission in an in-vehicle system according to an embodiment. FIG. 3B is a diagram showing a second example of frame transmission in an in-vehicle system according to an embodiment. FIG. 3B is a diagram showing a relay table. FIG. 3C is a diagram showing a relay table. FIG. 3D is a diagram showing a relay table. FIG. 4 is a diagram showing a relay table. FIG. 5 is a functional block diagram showing an example of the functions of a relay device according to an embodiment. FIG. 6 is a flowchart showing an example of a frame relay operation in a relay device according to an embodiment. FIG. 7 is a block diagram showing a modified example of the configuration of an in-vehicle system according to an embodiment.
[0008] However, in the relay system disclosed in Patent Document 1, time synchronization must be performed using time information, which makes the configuration and control of each relay device complex. In addition, because time information is transmitted together with data, there is also the problem of reduced data transmission efficiency.
[0009] <Effects of the Present Disclosure> According to the present disclosure, it is possible to ensure the simultaneity of frame reception among a plurality of in-vehicle devices without requiring complex control and without reducing data transmission efficiency.
[0010] <Outline of Embodiments of the Present Disclosure> Below, an outline of embodiments of the present disclosure will be listed and described.
[0011] (1) An in-vehicle system according to this embodiment includes a first in-vehicle device, a second in-vehicle device, and a plurality of relay devices that relay frames to the first in-vehicle device and the second in-vehicle device. When the number of relay devices on a first communication path from a frame sender to the first in-vehicle device differs from the number of relay devices on a second communication path from the frame sender to the second in-vehicle device, at least one of the relay devices included on the first communication path and the second communication path relays the frame after waiting for a waiting time based on the difference between the number of relay devices on the first communication path and the number of relay devices on the second communication path. This ensures simultaneous frame reception by the first in-vehicle device and the second in-vehicle device without requiring complex processing such as time synchronization. Furthermore, there is no need to transmit additional information such as time information along with the frame, which prevents a decrease in frame transmission efficiency.
[0012] (2) In the above (1), when the number of the relay devices on the first communication path is smaller than the number of the relay devices on the second communication path, the relay devices included in the first communication path may wait for the waiting time to relay the frame. This ensures that at least the relay devices included in the first communication path wait, thereby ensuring simultaneity of frame reception.
[0013] (3) In the above (2), the relay device included in the second communication path may relay the frame without waiting, thereby limiting waiting relay devices to relay devices included in the first communication path.
[0014] (4) In any one of (1) to (3) above, the relay device included between the source of the frame and the first branch of the communication path may relay the frame without waiting. This makes it possible to exclude relay devices included between the source of the frame and the first branch of the communication path from being subject to waiting, thereby limiting the relay devices that are in standby.
[0015] (5) In any one of (1) to (4) above, when the number of the relay devices on the first communication path is smaller than the number of the relay devices on the second communication path and when there are multiple relay devices included on the first communication path downstream of a branch of an initial communication path from the source, each of the multiple relay devices included on the first communication path downstream of the branch may wait for the same wait time before relaying the frame. This allows the wait time to be common to the multiple relay devices included on the first communication path downstream of the branch, making it easy to set the wait time.
[0016] (6) In any one of (1) to (5) above, when the number of the relay devices on the first communication path is smaller than the number of the relay devices on the second communication path, the relay devices included in the first communication path may correct the standby time based on a communication state of at least one of the communication lines upstream and downstream of the relay device, thereby allowing the relay device to wait for an appropriate time frame to relay based on the communication state of at least one of the communication lines upstream and downstream of the relay device.
[0017] (7) In the above (6), the communication state may be a time period during which a non-target frame, which is a frame different from a target frame to be transmitted to the second in-vehicle device, occupies at least one of the upstream and downstream communication lines. Thus, when a communication line is occupied by the non-target frame, relaying of the frame is delayed according to the time period during which the non-target frame occupies the communication line. With the above configuration, the standby time can be appropriately corrected based on the time period during which the non-target frame occupies the communication line.
[0018] (8) In the above (7), the correction of the standby time may be performed by subtracting the occupancy time from the standby time. By subtracting the occupancy time of the communication line by the non-target frame from the standby time, the standby time can be appropriately corrected.
[0019] (9) In the above (7) or (8), the non-target frame may be a frame with a higher priority than the target frame. While a frame with a higher priority than the target frame is being transmitted through a communication line, the target frame is not transmitted through the communication line. As a result, the relay of the frame is delayed according to the occupancy time of the non-target frame with a higher priority. Therefore, the waiting time can be appropriately corrected based on the occupancy time of the communication line by the non-target frame with a higher priority than the target frame.
[0020] (10) A relay device according to this embodiment is a relay device that relays a frame to an in-vehicle device. The relay device includes: a determination unit that determines whether the relay device is included in a first communication path when the number of relay devices on a second communication path from a source of the frame to a first in-vehicle device is greater than the number of relay devices on a first communication path from the source of the frame to a second in-vehicle device; and a control unit that, when the determination unit determines that the relay device is included in the first communication path, executes a standby process to relay the frame for a standby time based on the difference between the number of relay devices on the first communication path and the number of relay devices on the second communication path. This ensures simultaneous frame reception by the first in-vehicle device and the second in-vehicle device without requiring complex processing such as time synchronization. Furthermore, there is no need to transmit additional information such as time information along with the frame, and frame transmission efficiency is not reduced.
[0021] (11) A relay method according to this embodiment is a relay method for relaying frames in an in-vehicle system including a first in-vehicle device, a second in-vehicle device, and multiple relay devices that relay frames to the first in-vehicle device and the second in-vehicle device. When the number of relay devices on a first communication path from a source of the frame to the first in-vehicle device is different from the number of relay devices on a second communication path from the source of the frame to the second in-vehicle device, at least one of the relay devices included in the first communication path and the second communication path waits for a waiting time based on the difference between the number of relay devices on the first communication path and the number of relay devices on the second communication path before relaying the frame. This ensures simultaneous frame reception at the first in-vehicle device and the second in-vehicle device without requiring complex processing such as time synchronization. Furthermore, it is not necessary to transmit additional information such as time information along with the frame, and frame transmission efficiency is not reduced.
[0022] The present disclosure can be realized not only as an in-vehicle system having the above-described characteristic configuration, a relay device included in the in-vehicle system, and a relay method including characteristic steps executed in the in-vehicle system, but also as a relay program for causing the relay device to execute characteristic processing, or as a semiconductor integrated circuit in which part or all of the relay device is implemented.
[0023] <Details of the embodiments of the present disclosure> Hereinafter, the details of the embodiments of the present disclosure will be described with reference to the drawings. Note that at least some of the embodiments described below may be combined in any manner.
[0024] 1. In-Vehicle System FIG. 1 is a block diagram showing an example of the configuration of an in-vehicle system according to an embodiment.
[0025] The in-vehicle system 10 is mounted on a vehicle and includes ECUs 100_1, 100_2, 100_3, 100_4, and 100_5, and relay devices 200_1, 200_2, 200_3, 200_4, 200_5, 200_6, 200_7, 200_8, and 200_9.
[0026] Communication lines 300_1, 300_2, 300_3, 300_4, 300_5, 300_6, 300_7, 300_8, 300_9, 300_10, and 300_11 are connected to relay devices 200_1, 200_2, 200_3, 200_4, 200_5, 200_6, 200_7, 200_8, and 200_9 to form an in-vehicle network. The in-vehicle network according to this embodiment is a Controller Area Network (CAN) network with a bus-type network topology. Each of communication lines 300_1, 300_2, 300_3, 300_4, 300_5, 300_6, 300_7, 300_8, 300_9, 300_10, and 300_11 is a communication bus (CAN bus). The ECUs 100_1, 100_2, 100_3, 100_4, and 100_5 are communicably connected via an in-vehicle network.
[0027] In the following description, ECUs 100_1, 100_2, 100_3, 100_4, and 100_5 are collectively referred to as "ECUs 100," relay devices 200_1, 200_2, 200_3, 200_4, 200_5, 200_6, 200_7, 200_8, and 200_9 are collectively referred to as "relay devices 200," and communication lines 300_1, 300_2, 300_3, 300_4, 300_5, 300_6, 300_7, 300_8, 300_9, 300_10, and 300_11 are collectively referred to as "communication lines 300."
[0028] The relay device 200 includes multiple communication channels (communication ports) and relays frames between the communication channels. Each of the relay devices 200_1, 200_2, 200_3, 200_5, 200_6, 200_7, 200_8, and 200_9 has two communication channels, 0ch and 1ch. Each of the relay devices 200_1, 200_2, 200_3, 200_5, 200_6, 200_7, 200_8, and 200_9 has two communication channels, 0ch and 1ch. The relay device 200_4 has three communication channels, 0ch, 1ch, and 2ch. In FIG. 1, the numbers "0," "1," and "2" on the left and right of the blocks (rectangular shapes) representing each relay device indicate the communication channel numbers.
[0029] ECU 100_1 is connected to communication channel "0" of relay device 200_1 via communication line 300_1. Communication line 300_2 is connected to communication channel "1" of relay device 200_1. Communication line 300_2 branches at branch point 310_1 along the way, with a first branch destination connected to communication channel "0" of relay device 200_2 and a second branch destination connected to communication channel "0" of relay device 200_4.
[0030] The communication channel "1" of the relay device 200_2 is connected to the communication channel "0" of the relay device 200_3 via a communication line 300_3. The communication channel "1" of the relay device 200_3 is connected to the ECU 100_3 via a communication line 300_4.
[0031] ECU 100_2 is connected to communication channel "2" of relay device 200_4 via communication line 300_5. Communication line 300_6 is connected to communication channel "1" of relay device 200_4. Communication line 300_6 branches at branch point 310_2 along the way, with a first branch connected to communication channel "0" of relay device 200_5 and a second branch connected to communication channel "0" of relay device 200_7.
[0032] The communication channel "1" of the relay device 200_5 is connected to the communication channel "0" of the relay device 200_6 via a communication line 300_7. The communication channel "1" of the relay device 200_6 is connected to the ECU 100_4 via a communication line 300_8.
[0033] The communication channel "1" of the relay device 200_7 is connected to the communication channel "0" of the relay device 200_8 via a communication line 300_9. The communication channel "1" of the relay device 200_8 is connected to the communication channel "0" of the relay device 200_9 via a communication line 300_10. The communication channel "1" of the relay device 200_9 is connected to the ECU 100_5 via a communication line 300_11.
[0034] Each of the ECUs 100_1, 100_2, 100_3, 100_4, and 100_5 is disposed in a respective part of the vehicle. The ECUs 100_1, 100_2, 100_3, 100_4, and 100_5 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, the ECUs 100_1, 100_2, 100_3, 100_4, and 100_5 are ECUs for a control system, a body system, and an information system. The ECU 100 is an example of an "on-vehicle device."
[0035] The relay device 200 and the ECU 100 use a communication protocol for periodically or non-periodically transmitting and receiving messages. In this embodiment, the communication protocol is CAN or CAN FD (CAN with Flexible Data Rate).
[0036] The relay device 200 functions as a gateway that relays communications between a plurality of ECUs 100. The ECUs 100 can transmit frames. The frames are messages that comply with the CAN.
[0037] The ECUs 100 are connected to one another via a plurality of relay devices 200. That is, a frame transmitted from an ECU 100 is relayed in multiple stages by the plurality of relay devices 200.
[0038] 2 is a block diagram showing an example of the hardware configuration of a relay device according to this embodiment. The relay device 200 includes a processor 201, a nonvolatile memory 202, a volatile memory 203, and communication interfaces (hereinafter also referred to as "communication I / F") 204A, 204B, and 204C. The processor 201, the nonvolatile memory 202, the volatile memory 203, and the communication I / Fs 204A, 204B, and 204C are connected to one another by a bus 206.
[0039] The volatile memory 203 is, for example, a semiconductor memory such as an SRAM (Static Random Access Memory) or a DRAM (Dynamic Random Access Memory). The non-volatile memory 202 is, for example, a flash memory, a hard disk, or a ROM (Read Only Memory). The non-volatile memory 202 stores a relay program 210, which is a computer program, and data used to execute the relay program 210. The functions of the relay device 200, which will be described later, are realized when the processor 201 executes the relay program 210.
[0040] 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 be a GPU (Graphics Processing Unit). In a specific example, the processor 201 is a multi-core processor. The processor 201 may be a single-core processor. The processor 201 is configured to be able to execute a computer program. However, the processor 201 may be, for example, an ASIC (Application Specific Integrated Circuit) or a programmable logic device such as an FPGA (Field Programmable Gate Array). In this case, the ASIC or programmable logic device is configured to be able to execute the same function as the relay program 210.
[0041] The communication I / Fs 204A, 204B, and 204C are CAN-compliant communication interfaces (CAN interfaces). Each of the communication I / Fs 204A, 204B, and 204C includes a communication port, which is a communication channel. For example, the communication I / F 204A corresponds to communication channel "0," the communication I / F 204B corresponds to communication channel "1," and the communication I / F 204C corresponds to communication channel "2." FIG. 2 shows the configuration of the relay device 200_4, which has three communication channels "0," "1," and "2." In the relay devices 200_1, 200_2, 200_3, 200_5, 200_6, 200_7, 200_8, and 200_9, which have two communication channels "0" and "1," the communication I / F 204C can be omitted.
[0042] A relay table 211 used for relaying frames is stored in the nonvolatile memory 202. The relay table 211 will be described later.
[0043] A buffer 205 is configured from a partial area of the volatile memory 203. The buffer 205 temporarily stores frames to be relayed.
[0044] 3. Standby for Frame Relay Hereinafter, the standby for frame relay in this embodiment will be described.
[0045] The in-vehicle system 10 according to this embodiment relays frames transmitted from a source to a plurality of ECUs 100 through a plurality of relay devices 200, so that the frames arrive at the plurality of destination ECUs 100 simultaneously.
[0046] FIG. 3A is a diagram illustrating a first example of frame transmission in the in-vehicle system according to the embodiment.
[0047] In the first example, ECU 100_1 transmits a frame with a CAN ID (hereinafter simply referred to as "ID") of 100 (hereinafter, a frame that is to be held in relay is also referred to as a "target frame"), and ECUs 100_3, 100_4, and 100_5 receive the target frame. In Figure 3A, dashed arrows indicate the communication path of the target frame.
[0048] The target frame transmitted from the ECU 100_1 to the communication line 300_1 is received by the relay device 200_1 via communication channel "0." The relay device 200_1 transmits the target frame via communication channel "1."
[0049] The communication line 300_2 branches at a branch point 310_1. The target frame is received via the communication line 300_2 by the communication channel "0" of the relay device 200_2 and the communication channel "0" of the relay device 200_4.
[0050] The relay device 200_2 transmits the received target frame from communication channel "1" to communication line 300_3. The target frame is received by communication channel "0" of the relay device 200_3 via communication line 300_3. The relay device 200_3 transmits the received target frame from communication channel "1" to communication line 300_4. The target frame transmitted on communication line 300_4 is received by the ECU 100_3.
[0051] The relay device 200_4 transmits the received target frame from communication channel "1" to communication line 300_6. The communication line 300_6 branches at branch point 310_2. The target frame is received by communication channel "0" of the relay device 200_5 and communication channel "0" of the relay device 200_7 via communication line 300_6.
[0052] Here, the relay device 200_4 does not transmit the target frame from the communication channel "2." Therefore, the target frame is not transmitted to the ECU 100_2.
[0053] The relay device 200_5 transmits the received target frame from communication channel "1" to communication line 300_7. The target frame is received by communication channel "0" of the relay device 200_6 via communication line 300_7. The relay device 200_6 transmits the received target frame from communication channel "1" to communication line 300_8. The target frame transmitted on communication line 300_8 is received by the ECU 100_4.
[0054] The relay device 200_7 transmits the received target frame from communication channel "1" to communication line 300_9. The target frame is received by communication channel "0" of the relay device 200_8 via communication line 300_9. The relay device 200_8 transmits the received target frame from communication channel "1" to communication line 300_10. The target frame is received by communication channel "0" of the relay device 200_9 via communication line 300_10. The relay device 200_9 transmits the received target frame from communication channel "1" to communication line 300_11. The target frame transmitted on communication line 300_11 is received by the ECU 100_5.
[0055] As described above, the target frame with ID=100 transmitted from ECU 100_1 is transmitted to ECU 100_3 via a communication path including communication line 300_1, relay device 200_1, communication line 300_2, relay device 200_2, communication line 300_3, relay device 200_3, and communication line 300_4 (hereinafter referred to as "communication path A1"). The target frame with ID=100 is transmitted to ECU 100_4 via a communication path including communication line 300_1, relay device 200_1, communication line 300_2, relay device 200_4, communication line 300_6, relay device 200_5, communication line 300_7, relay device 200_6, and communication line 300_8 (hereinafter referred to as "communication path B1"). Furthermore, the target frame with ID=100 is transmitted to ECU 100_5 via a communication path (hereinafter referred to as "communication path C1") including communication line 300_1, relay device 200_1, communication line 300_2, relay device 200_4, communication line 300_6, relay device 200_7, communication line 300_9, relay device 200_8, communication line 300_10, relay device 200_9, and communication line 300_11.
[0056] In order to ensure the simultaneity of frame reception at the ECUs 100_3, 100_4, and 100_5, which are the destinations of the target frame, the in-vehicle system 10 transmits the target frame according to the following rules: (1) The relay device 200 waits to relay the target frame and adjusts the delay time for relaying the target frame. (2) Each relay device 200 included in the communication path of the target frame with the largest number of relay devices (hereinafter also referred to as the "deepest path") relays the target frame without waiting. (3) A relay device 200 located upstream of the first branch in all communication paths of the target frame relays the target frame without waiting. (4) In communication paths other than the deepest path, a relay device 200 that does not fall under the above-described (2) and (3) waits for a waiting time based on the difference between the number of relay devices 200 in the communication path and the number of relay devices 200 in the deepest path, and then relays the target frame. (5) When there are multiple relay devices waiting to relay the target frame on a communication path other than the deepest path, the standby time of each relay device waiting to relay the target frame is set to be the same.
[0057] In the first example, the deepest route is the communication route C1, and the first branch in the communication routes A1, B1, and C1 is the branch point 310_1. Therefore, the relay devices 200_1, 200_4, 200_7, 200_8, and 200_9 do not wait to relay the target frame.
[0058] 3A, the numbers written under the blocks representing relay devices indicate the delay time (ms) of the relay of the target frame at that relay device. Here, it is assumed that each relay device 200 requires 100 ms to relay the frame. In other words, the reference delay time at the relay device 200 is 100 ms.
[0059] Therefore, the delay time in each of the relay devices 200_1, 200_4, 200_7, 200_8, and 200_9 is 100 ms.
[0060] The number of relay devices 200 on the deepest route (communication route C1) is 5. Therefore, the total delay time on the deepest route is 500 ms.
[0061] The number of relay devices 200 in communication path A1 is "3." Therefore, the sum of the reference delay times in communication path A1 is 300 ms. The difference between the number of relay devices 200 in the deepest path ("5") and the number of relay devices 200 in communication path A1 ("3") is "2." If each relay device 200 in communication path A1 relays the target frame without waiting, the delay time will be 200 ms (100 ms x 2) shorter than that in the deepest path. Therefore, this 200 ms difference in delay time needs to be absorbed in communication path A1. For this reason, a waiting time of 200 ms is provided throughout communication path A1. In this case, ECU 100_1 corresponds to the "source," ECU 100_3 corresponds to the "first in-vehicle device," and communication path A1 corresponds to the "first communication path." ECU 100_5 corresponds to the "second in-vehicle device," and communication path C1 corresponds to the "second communication path."
[0062] Of the relay devices 200_1, 200_2, and 200_3 included in communication path A1, the relay device 200_1 is included in the deepest path. Furthermore, the relay device 200_1 is located upstream of the branch point 310_1, which is the first branch. Therefore, the relay device 200_1 corresponds to the above-mentioned (2) and (3). Of the relay devices 200_1, 200_2, and 200_3 included in communication path A1, the relay devices 200_2 and 200_3 do not correspond to (2) and (3). Therefore, in communication path A1, a standby time is set in the relay devices 200_2 and 200_3.
[0063] In order to satisfy the condition (5), the standby times of the relay devices 200_2 and 200_3 are set to 100 ms, respectively, so that the delay times of the relay devices 200_2 and 200_3 are 200 ms.
[0064] The number of relay devices 200 in communication path B1 is "4." Therefore, the sum of the reference delay times in communication path B1 is 400 ms. The difference between the number of relay devices 200 in the deepest path ("5") and the number of relay devices 200 in communication path B1 ("4") is "1." If each relay device 200 in communication path B1 relays a target frame without waiting, the delay time will be 100 ms (100 ms x 1) shorter than that in the deepest path. Therefore, this 100 ms difference in delay time needs to be absorbed in communication path B1. For this reason, a waiting time of 100 ms is provided throughout communication path B1. In this case, ECU 100_1 corresponds to the "source," ECU 100_3 corresponds to the "first in-vehicle device," and communication path A1 corresponds to the "first communication path." ECU 100_4 corresponds to the "second in-vehicle device," and communication path B1 corresponds to the "second communication path."
[0065] Of the relay devices 200_1, 200_4, 200_5, and 200_6 included in communication path B1, the relay devices 200_1 and 200_4 are included in the deepest path. Furthermore, the relay device 200_1 is located upstream of the branch point 310_1, which is the first branch. Therefore, the relay device 200_1 corresponds to the above-mentioned (2) and (3), and the relay device 200_4 corresponds to (2). Of the relay devices 200_1, 200_4, 200_5, and 200_6 included in communication path B1, the relay devices 200_5 and 200_6 do not correspond to (2) and (3). Therefore, in communication path B1, a standby time is set in the relay devices 200_5 and 200_6.
[0066] In order to satisfy the condition (5), the standby time of each of the relay devices 200_5 and 200_6 is set to 50 ms, so that the delay time of the relay devices 200_5 and 200_6 is 150 ms.
[0067] FIG. 3B is a diagram illustrating a second example of frame transmission in the in-vehicle system according to the embodiment.
[0068] In the second example, the ECU 100_2 transmits a target frame with an ID of 200, and the target frame is received by the ECUs 100_4 and 100_5. In Fig. 3B, the dashed arrow indicates the communication path of the target frame.
[0069] The target frame transmitted from the ECU 100_2 to the communication line 300_5 is received by the relay device 200_4 via the communication channel "2." The relay device 200_4 transmits the target frame via the communication channel "1."
[0070] The communication line 300_6 branches at a branch point 310_2. The target frame is received via the communication line 300_6 by the communication channel "0" of the relay device 200_5 and the communication channel "0" of the relay device 200_7.
[0071] Here, the relay device 200_4 does not transmit the target frame from the communication channel "0." Therefore, the target frame is not transmitted to the ECUs 100_1 and 100_3.
[0072] The relay device 200_5 transmits the received target frame from communication channel "1" to communication line 300_7. The target frame is received by communication channel "0" of the relay device 200_6 via communication line 300_7. The relay device 200_6 transmits the received target frame from communication channel "1" to communication line 300_8. The target frame transmitted on communication line 300_8 is received by the ECU 100_4.
[0073] The relay device 200_7 transmits the received target frame from communication channel "1" to communication line 300_9. The target frame is received by communication channel "0" of the relay device 200_8 via communication line 300_9. The relay device 200_8 transmits the received target frame from communication channel "1" to communication line 300_10. The target frame is received by communication channel "0" of the relay device 200_9 via communication line 300_10. The relay device 200_9 transmits the received target frame from communication channel "1" to communication line 300_11. The target frame transmitted on communication line 300_11 is received by the ECU 100_5.
[0074] As described above, the target frame with ID=200 transmitted from ECU 100_2 is transmitted to ECU 100_4 via a communication path including communication line 300_5, relay device 200_4, communication line 300_6, relay device 200_5, communication line 300_7, relay device 200_6, and communication line 300_8 (hereinafter referred to as "communication path A2"). Furthermore, the target frame with ID=200 is transmitted to ECU 100_5 via a communication path including communication line 300_5, relay device 200_4, communication line 300_6, relay device 200_7, communication line 300_9, relay device 200_8, communication line 300_10, relay device 200_9, and communication line 300_11 (hereinafter referred to as "communication path B2").
[0075] In the second example, the deepest route is the communication route B2, and the first branch in the communication routes A2 and B2 is the branch point 310_2. Therefore, the relay devices 200_4, 200_7, 200_8, and 200_9 do not wait to relay the target frame.
[0076] Therefore, the delay time in each of the relay devices 200_4, 200_7, 200_8, and 200_9 is 100 ms.
[0077] The number of relay devices 200 on the deepest route (communication route B2) is 4. Therefore, the total delay time on the deepest route is 400 ms.
[0078] The number of relay devices 200 in communication path A2 is "3." Therefore, the sum of the reference delay times in communication path A2 is 300 ms. The difference between the number of relay devices 200 in the deepest path ("4") and the number of relay devices 200 in communication path A2 ("3") is "1." If each relay device 200 in communication path A2 relays the target frame without waiting, the delay time will be 100 ms (100 ms x 1) shorter than that in the deepest path. Therefore, this 100 ms difference in delay time needs to be absorbed in communication path A2. For this reason, a waiting time of 100 ms is provided throughout communication path A2. In this case, ECU 100_2 corresponds to the "sender," ECU 100_4 corresponds to the "first in-vehicle device," and communication path A2 corresponds to the "first communication path." ECU 100_5 corresponds to the "second in-vehicle device," and communication path B2 corresponds to the "second communication path."
[0079] Of the relay devices 200_4, 200_5, and 200_6 included in communication path A2, the relay device 200_4 is included in the deepest path. Furthermore, the relay device 200_4 is located upstream of the branch point 310_2, which is the first branch. Therefore, the relay device 200_4 corresponds to the above-mentioned (2) and (3). Of the relay devices 200_4, 200_5, and 200_6 included in communication path A2, the relay devices 200_5 and 200_6 do not correspond to (2) and (3). Therefore, in communication path A2, a standby time is set in the relay devices 200_5 and 200_6.
[0080] In order to satisfy the condition (5), the standby time of each of the relay devices 200_5 and 200_6 is set to 50 ms, so that the delay time of the relay devices 200_5 and 200_6 is 150 ms.
[0081] The relay table 211 (see FIG. 2) is used to set the standby time in the relay device 200. Figures 4A to 4F are diagrams for explaining the relay table.
[0082] 4A shows the relay table 211_1 of the relay device 200_1. The relay table 211_1 defines setting values for the first example. In the second example, the relay device 200_1 is not used, so the relay table 211_1 does not include setting values for the second example.
[0083] The relay table 211_1 (211) includes the following setting items: the ID of the target frame (message ID), the communication channel receiving the target frame (receiving ch), the communication channel transmitting the target frame (transmitting ch), the communication protocol used in the receiving ch (receiving protocol), the communication protocol used in the transmitting ch (transmitting protocol), whether the device itself is included in the deepest route (deepest route), the maximum number of relay stages in all communication routes (deepest stage number), the number of relay stages in the communication route including the device itself (route stage number), the number of relay devices for which a standby time is set in the communication route including the device itself (standby stage number), the number of stages in the communication route of the device itself (device itself stage number), whether correction on the upstream side of the device itself is enabled or disabled (upstream correction), whether correction on the downstream side of the device itself is enabled or disabled (downstream correction), whether the device itself is located before the first branch or after the first branch (before or after branch), and the standard standby time.
[0084] 3A, in the first example, the ID of the target frame is 100. In the relay device 200_1, the communication channel "0" is the receiving channel of the target frame, and the communication channel "1" is the transmitting channel of the target frame. Therefore, in the relay table 211_1, the receiving channel is set to "0" and the transmitting channel is set to "1" in correspondence with the message ID "100."
[0085] In the first and second examples, communication is performed between the relay device 200_2 and the relay device 200_3, i.e., on the communication line 300_3, using CAN FD. Communication is performed on the communication lines 300 other than the communication line 300_3 using CAN.
[0086] The communication channel "0" on the upstream side of the relay device 200_1 uses CAN as the communication protocol. The communication channel "1" on the downstream side of the relay device 200_1 uses CAN as the communication protocol. Therefore, in the relay table 211_1, the receiving protocol and the transmitting protocol are both set to "CAN" in correspondence with the message ID "100."
[0087] In the first example, the deepest route is communication route C1, and relay device 200_1 is included in communication route C1. The number of relay stages of communication route C1 is "5." Therefore, in relay table 211_1, the deepest route is set to "YES," the deepest stage is set to "5," and the number of route stages is set to "5" in correspondence with message ID "100." Furthermore, all relay devices 200_1, 200_4, 200_7, 200_8, and 200_9 included in communication route C1, which is the deepest route, do not wait in relaying the target frame. Therefore, in relay table 211_1, the number of standby stages is not set in correspondence with message ID "100."
[0088] In the communication path C1 (and the communication paths A1 and B1), the stage number of the relay device 200_1 is "1" (i.e., the relay device on the most upstream side). Therefore, in the relay table 211_1, the stage number of the own device is set to "1" in correspondence with the message ID "100".
[0089] In the first example, the relay device 200_1 is included in the deepest route. Furthermore, the relay device 200_1 is located upstream of the first branch point 310_1. Therefore, the relay device 200_1 does not wait to relay the target frame. Therefore, a wait time is not set in the relay device 200_1, and correction of the wait time is not necessary. Therefore, in the relay table 211_1, corresponding to the message ID "100", the upstream correction is set to "disabled", the downstream correction is set to "disabled", the before and after branching is set to "before", and the reference wait time is set to "0".
[0090] 4B shows the relay table 211_2 of the relay device 200_2. The relay table 211_2 defines setting values for the first example. In the second example, the relay device 200_2 is not used, so the relay table 211_2 does not include setting values for the second example.
[0091] 3A, in the first example, in relay device 200_2, communication channel "0" is the receiving channel for the target frame with ID=100, and communication channel "1" is the transmitting channel for the target frame. Therefore, in relay table 211_2, the receiving channel is set to "0" and the transmitting channel is set to "1" in correspondence with message ID "100."
[0092] The communication channel "0" on the upstream side of the relay device 200_2 uses CAN as the communication protocol. The communication channel "1" on the downstream side of the relay device 200_2 uses CAN FD as the communication protocol. Therefore, in the relay table 211_2, the receiving protocol is set to "CAN" and the transmitting protocol is set to "CAN FD" in correspondence with the message ID "100".
[0093] In the first example, the deepest route is communication route C1, and relay device 200_2 is included in communication route A1, which is different from the deepest route. The number of relay stages of communication route A1 is "3". Therefore, in relay table 211_2, the deepest route is set to "NO", the deepest stage is set to "5", and the number of route stages is set to "3" in correspondence with message ID "100". In communication route A1, a standby time is set in relay devices 200_2 and 200_3. Therefore, in relay table 211_2, the number of standby stages is set to "2" in correspondence with message ID "100".
[0094] In the communication path A1, the stage number of the relay device 200_2 is "2" (i.e., the second most upstream relay device). Therefore, in the relay table 211_2, the stage number of the own device is set to "2" in correspondence with the message ID "100".
[0095] In the first example, a standby time is set for the relay device 200_2. When correcting the standby time based on the communication status between the relay device 200_1 and the relay device 200_2, either one of the relay device 200_1 or the relay device 200_2 must correct the standby time. Here, as described above, the relay device 200_1 does not correct the standby time, so the relay device 200_2 corrects the standby time based on the communication status of the upstream communication channel "0" (enabled). When correcting the standby time based on the communication status between the relay device 200_2 and the relay device 200_3, either one of the relay device 200_2 or the relay device 200_3 must correct the standby time. Here, in this embodiment, when multiple relay devices 200 are connected in series, each relay device 200 corrects its own standby time based on the communication status of the upstream communication channel. This prevents the same correction from being made twice between two adjacent relay devices. According to this rule, the relay device 200_2 does not correct (disable) the standby time based on the communication state of the downstream communication channel "1." Therefore, in the relay table 211_2, the upstream correction is set to "enabled" and the downstream correction is set to "disabled" in correspondence with the message ID "100."
[0096] In the first example, the relay device 200_2 is located downstream of the first branch point 310_1. Therefore, in the relay table 211_2, the before and after branch are set to "after" in correspondence with the message ID "100." Furthermore, as described above, in the first example, the reference waiting time for the relay device 200_2 is 100 ms. Therefore, in the relay table 211_2, the reference waiting time is set to "100" in correspondence with the message ID "100."
[0097] 4C shows the relay table 211_3 of the relay device 200_3. The relay table 211_3 defines setting values for the first example. In the second example, the relay device 200_3 is not used, so the relay table 211_3 does not include the setting values for the second example.
[0098] 3A, in the first example, in relay device 200_3, communication channel "0" is the receiving channel for the target frame with ID=100, and communication channel "1" is the transmitting channel for the target frame. Therefore, in relay table 211_3, the receiving ch is set to "0" and the transmitting ch is set to "1" in correspondence with message ID "100."
[0099] The communication channel "0" on the upstream side of the relay device 200_3 uses CAN FD as the communication protocol. The communication channel "1" on the downstream side of the relay device 200_3 uses CAN as the communication protocol. Therefore, in the relay table 211_3, the receiving protocol is set to "CAN FD" and the transmitting protocol is set to "CAN" in correspondence with the message ID "100".
[0100] In the first example, the relay device 200_3 is included in a communication path A1 that is different from the deepest path. The number of relay stages of the communication path A1 is "3." Therefore, in the relay table 211_3, corresponding to the message ID "100," the deepest path is set to "NO," the deepest stage is set to "5," the path stage number is set to "3," and the standby stage number is set to "2."
[0101] In the communication path A1, the stage number of the relay device 200_3 is "3" (i.e., the third relay device from the most upstream). Therefore, in the relay table 211_3, the stage number of the own device is set to "3" in correspondence with the message ID "100".
[0102] In the first example, a standby time is set for the relay device 200_3. According to the above-described rule, the relay device 200_2 corrects the standby time based on the communication state of the upstream communication channel "0" (enabled). On the other hand, only the relay device 200_3 can correct the standby time based on the communication state between the relay device 200_3 and the ECU 100_3. Therefore, the relay device 200_3 also corrects the standby time based on the communication state of the downstream communication channel "1" (enabled). Therefore, in the relay table 211_3, both the upstream correction and the downstream correction are set to "enabled" in correspondence with the message ID "100."
[0103] In the first example, the relay device 200_3 is located downstream of the first branch point 310_1. Therefore, in the relay table 211_3, the before and after branch are set to "after" in correspondence with the message ID "100." Furthermore, as described above, in the first example, the reference standby time of the relay device 200_3 is 100 ms. Therefore, in the relay table 211_3, the reference standby time is set to "100" in correspondence with the message ID "100."
[0104] 4D shows the relay table 211_4 of the relay device 200_4. In the first and second examples, the relay device 200_4 relays the target frame. Therefore, the relay table 211_4 includes setting values for the first example and setting values for the second example. In FIG. 4D, the first row shows the setting values for the first example, and the second row shows the setting values for the second example.
[0105] 3A, in the first example, in relay device 200_4, communication channel "0" is the receiving channel for the target frame with ID=100, and communication channel "1" is the transmitting channel for the target frame. Therefore, in relay table 211_4, the receiving ch is set to "0" and the transmitting ch is set to "1" in correspondence with message ID "100."
[0106] The communication channel "0" upstream of the relay device 200_4 uses CAN as the communication protocol. The communication channel "1" downstream of the relay device 200_4 uses CAN as the communication protocol. Therefore, in the relay table 211_4, the receiving protocol and the transmitting protocol are both set to "CAN" in correspondence with the message ID "100."
[0107] In the first example, the relay device 200_4 is included in the communication path C1, which is the deepest path. Therefore, in the relay table 211_4, corresponding to the message ID "100", the deepest path is set to "YES", the deepest step number is set to "5", the path step number is set to "5", and the standby step number is not set.
[0108] In the communication path C1, the relay device 200_4 has a stage number of "2" (i.e., the second most upstream relay device). Therefore, in the relay table 211_4, the own device stage number is set to "2" in correspondence with the message ID "100".
[0109] In the first example, the relay device 200_4 is included in the deepest route. Therefore, the relay device 200_4 does not wait in relaying the target frame. Therefore, a wait time is not set in the relay device 200_4, and correction of the wait time is not necessary. The relay device 200_4 is located downstream of the branch point 310_1. Therefore, in the relay table 211_4, corresponding to the message ID "100", the upstream correction is set to "disabled", the downstream correction is set to "disabled", the before and after branching is set to "after", and the reference wait time is set to "0".
[0110] 3B, in the second example, in the relay device 200_4, the communication channel "2" is the receiving channel for the target frame with ID=200, and the communication channel "1" is the transmitting channel for the target frame. Therefore, in the relay table 211_4, the receiving ch is set to "2" and the transmitting ch is set to "1" in correspondence with the message ID "200."
[0111] The communication channel "2" on the upstream side of the relay device 200_4 uses CAN as the communication protocol. The communication channel "1" on the downstream side of the relay device 200_4 uses CAN as the communication protocol. Therefore, in the relay table 211_4, the receiving protocol and the transmitting protocol are both set to "CAN" in correspondence with the message ID "200."
[0112] In the second example, the deepest route is communication route B2, and relay device 200_4 is included in communication route B1. The number of relay stages of communication route B1 is "4." Therefore, in relay table 211_4, the deepest route is set to "YES," the deepest number of stages is set to "4," and the number of route stages is set to "4" in correspondence with message ID "200." Furthermore, all relay devices 200_4, 200_7, 200_8, and 200_9 included in communication route B2, which is the deepest route, do not wait in relaying the target frame. Therefore, in relay table 211_4, the number of standby stages is not set in correspondence with message ID "200."
[0113] In the communication path B2, the relay device 200_4 has a stage number of "1" (i.e., the most upstream relay device). Therefore, in the relay table 211_4, the own device stage number is set to "1" in correspondence with the message ID "200".
[0114] In the second example, the relay device 200_4 does not wait while relaying the target frame. Therefore, a wait time is not set in the relay device 200_4, and there is no need to correct the wait time. The relay device 200_4 is located upstream of the branch point 310_2, which is the first branch. Therefore, in the relay table 211_4, corresponding to the message ID "200", the upstream correction is set to "disabled", the downstream correction is set to "disabled", the before and after branch are set to "before", and the reference wait time is set to "0".
[0115] 4E shows the relay table 211_5 of the relay device 200_5. In the first and second examples, the relay device 200_5 relays the target frame. Therefore, the relay table 211_5 includes setting values for the first example and setting values for the second example. In FIG. 4E, the first row shows the setting values for the first example, and the second row shows the setting values for the second example.
[0116] 3A, in the first example, in the relay device 200_5, the communication channel "0" is the receiving channel for the target frame with ID=100, and the communication channel "1" is the transmitting channel for the target frame. Therefore, in the relay table 211_5, the receiving channel is set to "0" and the transmitting channel is set to "1" in correspondence with the message ID "100."
[0117] The communication channel "0" upstream of the relay device 200_5 uses CAN as the communication protocol. The communication channel "1" downstream of the relay device 200_5 uses CAN as the communication protocol. Therefore, in the relay table 211_5, the receiving protocol and the transmitting protocol are both set to "CAN" in correspondence with the message ID "100."
[0118] In the first example, the relay device 200_3 is included in a communication path B1 that is different from the deepest path. The number of relay stages of the communication path B1 is "4". Therefore, in the relay table 211_5, the deepest path is set to "NO", the deepest stage is set to "5", and the number of path stages is set to "4" in correspondence with the message ID "100". In the communication path B1, a standby time is set in the relay devices 200_5 and 200_6. Therefore, in the relay table 211_5, the number of standby stages is set to "2" in correspondence with the message ID "100".
[0119] In the communication path B1, the stage number of the relay device 200_5 is "3" (i.e., the third relay device from the most upstream). Therefore, in the relay table 211_5, the stage number of the own device is set to "3" in correspondence with the message ID "100".
[0120] In the first example, a standby time is set for the relay device 200_5. According to the above-described rule, the relay device 200_5 corrects the standby time based on the communication state of the upstream communication channel "0" (enabled), but does not correct the standby time based on the communication state of the downstream communication channel "0" (disabled). Therefore, in the relay table 211_5, the upstream correction is set to "enabled" and the downstream correction is set to "disabled" in correspondence with the message ID "100."
[0121] In the first example, the relay device 200_5 is located downstream of the first branch point 310_1. Therefore, in the relay table 211_5, the before and after branch are set to "after" in correspondence with the message ID "100." Furthermore, as described above, in the first example, the reference waiting time for the relay device 200_5 is 50 ms. Therefore, in the relay table 211_5, the reference waiting time is set to "50" in correspondence with the message ID "100."
[0122] 3B , in the second example, in the relay device 200_5, the communication channel "0" is the receiving channel for the target frame with ID=200, and the communication channel "1" is the transmitting channel for the target frame. Therefore, in the relay table 211_5, the receiving channel is set to "0" and the transmitting channel is set to "1" in correspondence with the message ID "200."
[0123] The communication channel "0" upstream of the relay device 200_5 uses CAN as the communication protocol. The communication channel "1" downstream of the relay device 200_5 uses CAN as the communication protocol. Therefore, in the relay table 211_5, the receiving protocol and the transmitting protocol are both set to "CAN" in correspondence with the message ID "200."
[0124] In the second example, the relay device 200_5 is included in a communication path A2 that is different from the deepest path. The number of relay stages of the communication path A2 is "3". Therefore, in the relay table 211_5, the deepest path is set to "NO", the deepest stage is set to "4", and the number of path stages is set to "3" in correspondence with the message ID "200". In the communication path A2, a standby time is set in the relay devices 200_5 and 200_6. Therefore, in the relay table 211_5, the number of standby stages is set to "2" in correspondence with the message ID "200".
[0125] In the communication path A2, the stage number of the relay device 200_5 is "2" (i.e., the second most upstream relay device). Therefore, in the relay table 211_5, the stage number of the own device is set to "2" in correspondence with the message ID "200".
[0126] In the second example, a standby time is set for the relay device 200_5. According to the above-described rule, the relay device 200_5 corrects the standby time based on the communication state of the upstream communication channel "0" (enabled), but does not correct the standby time based on the communication state of the downstream communication channel "0" (disabled). Therefore, in the relay table 211_5, the upstream correction is set to "enabled" and the downstream correction is set to "disabled" in correspondence with the message ID "200."
[0127] In the second example, the relay device 200_5 is located downstream of the first branch point 310_2. Therefore, in the relay table 211_5, the before and after branch are set to "after" in correspondence with the message ID "200." Furthermore, as described above, in the second example, the reference waiting time for the relay device 200_5 is 50 ms. Therefore, in the relay table 211_5, the reference waiting time is set to "50" in correspondence with the message ID "200."
[0128] 4F shows the relay table 211_7 of the relay device 200_7. In the first and second examples, the relay device 200_7 relays the target frame. Therefore, the relay table 211_7 includes setting values for the first example and setting values for the second example. In FIG. 4F, the first row shows the setting values for the first example, and the second row shows the setting values for the second example.
[0129] 3A, in the first example, in the relay device 200_7, the communication channel "0" is the receiving channel of the target frame with ID=100, and the communication channel "1" is the transmitting channel of the target frame. Therefore, in the relay table 211_7, the receiving channel is set to "0" and the transmitting channel is set to "1" in correspondence with the message ID "100."
[0130] The communication channel "0" upstream of the relay device 200_7 uses CAN as the communication protocol. The communication channel "1" downstream of the relay device 200_7 uses CAN as the communication protocol. Therefore, in the relay table 211_7, the receiving protocol and the transmitting protocol are both set to "CAN" in correspondence with the message ID "100."
[0131] In the first example, the relay device 200_7 is included in the communication path C1, which is the deepest path. Therefore, in the relay table 211_7, corresponding to the message ID "100", the deepest path is set to "YES", the deepest step number is set to "5", the path step number is set to "5", and the standby step number is not set.
[0132] In the communication path C1, the relay device 200_7 has a stage number of "3" (i.e., the third relay device from the most upstream). Therefore, in the relay table 211_7, the own device stage number is set to "3" in correspondence with the message ID "100".
[0133] In the first example, the relay device 200_7 does not wait while relaying the target frame. Therefore, a wait time is not set in the relay device 200_7, and correction of the wait time is not necessary. The relay device 200_7 is located downstream of the branch point 310_1. Therefore, in the relay table 211_7, corresponding to the message ID "100", the upstream correction is set to "disabled", the downstream correction is set to "disabled", the before and after branching is set to "after", and the reference wait time is set to "0".
[0134] 3B , in the second example, in the relay device 200_7, the communication channel "0" is the receiving channel of the target frame with ID=100, and the communication channel "1" is the transmitting channel of the target frame. Therefore, in the relay table 211_7, the receiving channel is set to "0" and the transmitting channel is set to "1" in correspondence with the message ID "200."
[0135] The communication channel "0" upstream of the relay device 200_7 uses CAN as the communication protocol. The communication channel "1" downstream of the relay device 200_7 uses CAN as the communication protocol. Therefore, in the relay table 211_7, the receiving protocol and the transmitting protocol are both set to "CAN" in correspondence with the message ID "200."
[0136] In the second example, the relay device 200_7 is included in the communication route B2, which is the deepest route. Therefore, in the relay table 211_7, corresponding to the message ID "200", the deepest route is set to "YES", the deepest step number is set to "4", the route step number is set to "4", and the standby step number is not set.
[0137] In the communication path B2, the relay device 200_7 has a stage number of "2" (i.e., the second most upstream relay device). Therefore, in the relay table 211_7, the own device stage number is set to "2" in correspondence with the message ID "200".
[0138] In the second example, the relay device 200_7 does not wait while relaying the target frame. Therefore, a wait time is not set in the relay device 200_7, and correction of the wait time is not necessary. The relay device 200_7 is located downstream of the branch point 310_2. Therefore, in the relay table 211_7, corresponding to the message ID "200", the upstream correction is set to "disabled", the downstream correction is set to "disabled", the before and after branching is set to "after", and the reference wait time is set to "0".
[0139] 4. Functions of the Relay Device FIG. 5 is a functional block diagram showing an example of functions of the relay device according to the embodiment.
[0140] When the processor 201 of the relay device 200 executes the relay program 210, the functions of a determination unit 221, a decision unit 222, a correction unit 223, a monitoring unit 224, and a control unit 225 are realized.
[0141] The determination unit 221 determines whether the own device is a target for waiting in relaying the target frame.
[0142] A more specific explanation will be given below. When a target frame is received by relay device 200, the target frame is written to buffer 205. When the target frame is written to buffer 205, determination unit 221 acquires an ID from the target frame and determines whether or not the relay device itself is a target for waiting in relaying the target frame.
[0143] The determination unit 221 determines whether the relay device 200 is located upstream of the first branch. As described above, the relay device 200 located before the first branch does not wait in relaying the target frame. Therefore, if the relay device 200 is located upstream of the first branch, the relay device 200 can determine that the relay device 200 is not a target for waiting in relaying the target frame.
[0144] Furthermore, when the number of relay devices 200 on a communication path (second communication path) from the source of the target frame to a destination ECU 100 different from the ECU 100 is greater than the number of relay devices 200 on a communication path (first communication path) from the source of the target frame to the destination ECU 100, the determination unit 221 determines whether the own device is included in the second communication path. That is, the determination unit 221 determines whether the communication path including the own device is the deepest path. As described above, a relay device 200 included in the deepest path does not wait in relaying the target frame. Therefore, when the communication path including the own device is the deepest path, the relay device 200 can determine that the own device is not a target for waiting in relaying the target frame. When the relay device 200 is located downstream of the first branch and the communication path including the own device is not the deepest path, the relay device 200 can determine that the own device is a target for waiting in relaying the target frame.
[0145] In a specific example, the judgment unit 221 refers to the relay table 211 to determine whether the device itself is located upstream of the first branch, and determines whether the communication path including the device itself is the deepest path.
[0146] When the judgment unit 221 determines that the communication path including the device is not the deepest path, the determination unit 222 determines a waiting time based on the difference between the number of relay devices in the communication path including the device and the number of relay devices in the deepest path (second communication path).
[0147] The difference between the number of relay devices (relay stages) in a communication path that includes the own device and the number of relay devices (relay stages) in the deepest path is related to the total waiting time in the entire communication path that includes the own device. For example, in the first example, consider determining the waiting time for relay device 200_2. In the first example, the deepest path is communication path C1, and the number of stages is "5." On the other hand, the number of stages in communication path A1 is "3." Therefore, the difference between the number of stages "5" in communication path C1 and the number of stages "3" in communication path A1 is "2."
[0148] In communication path C1, the number of relay stages is two more than in communication path A1, and therefore a longer delay occurs than in communication path A1 by the time equivalent to the number of stages "2" (i.e., 100 ms x 2 delay time in each relay device 200). In other words, by providing a waiting time of 200 ms in communication path A1, the communication time in communication path C1 can be made equal to the communication time in communication path A1.
[0149] The determination unit 222 determines the number of relay devices 200 (number of standby stages) that are targets for standby in relaying the target frame on the communication path that includes the own device. The targets for standby in relaying the target frame are relay devices that are downstream of the first branch and are not included in the deepest path. On communication path A1, the targets for standby in relaying the target frame are two relay devices, 200_2 and 200_3.
[0150] The determination unit 222 determines the result of dividing the sum of the standby times in the communication paths including the relay device 200_2 by the number of standby stages as the reference standby time of the relay device 200_2. In the first example, the standby time of the relay device 200_2 is 200 ms / 2=100 ms.
[0151] In a specific example, the determination unit 222 can determine the standard standby time specified in the relay table 211 as the standby time of the own device.
[0152] The correction unit 223 corrects the standby time based on the communication state of at least one of the communication lines 300 on the upstream and downstream sides of the device itself.
[0153] The monitor 224 monitors the communication state of at least one of the communication lines 300 on the upstream and downstream sides of the relay device 200. The corrector 223 corrects the standby time based on the communication state monitored by the monitor 224. This will be described in detail below.
[0154] The correction unit 223 determines whether to enable or disable correction on the upstream side of the own device. When the correction on the upstream side of the own device is enabled, the correction unit 223 determines a first correction value based on the communication state of the communication line 300 on the upstream side of the own device. When the correction on the upstream side of the own device is disabled, the correction unit 223 does not determine the first correction value.
[0155] The correction unit 223 determines whether to enable or disable correction on the downstream side of the own device. When the correction on the downstream side of the own device is enabled, the correction unit 223 determines a second correction value based on the communication state of the communication line 300 on the downstream side of the own device. When the correction on the downstream side of the own device is disabled, the correction unit 223 does not determine the second correction value.
[0156] For example, the correction unit 223 can determine whether to enable or disable correction on the upstream and downstream sides of the device by referring to the setting values for upstream correction and downstream correction in the relay table 211.
[0157] In a specific example, the communication state on the upstream communication line 300 is the occupancy time on the upstream communication line 300 of a non-target frame, which is a frame different from the target frame.
[0158] In a CAN frame, the CAN ID indicates priority, and the smaller the CAN ID, the higher the priority of the frame. For example, a frame with a CAN ID of "99" has a higher priority than a frame with a CAN ID of "100." In other words, frames with a CAN ID of "99" or less are non-target frames. While a non-target frame is being transmitted on a communication line 300, a target frame cannot be transmitted on that communication line 300. Therefore, while a non-target frame is occupying the communication line 300, the transmission of the target frame is delayed.
[0159] Now, consider correction of the target time in relay device 200_2 in the first example. In the first example, the CAN ID of the target frame is "100." Therefore, monitor 224 monitors the occupied time of frames with CAN IDs of 99 or less on upstream communication line 300_2 (communication channel "0"). Similarly, monitor 224 monitors the occupied time of frames with CAN IDs of 99 or less on downstream communication line 300_3 (communication channel "1").
[0160] For example, when upstream correction is enabled, the correction unit 223 determines, as the first correction value, the occupation time of the non-target frame on the upstream communication line 300_2 for the same time as the reference wait time. As a specific example, if the reference wait time is 100 ms and the occupation time of the non-target frame on the communication line 300_2 for 100 ms is 20 ms, the first correction value is 20 ms. Similarly, when downstream correction is enabled, the correction unit 223 determines, as the second correction value, the occupation time of the non-target frame on the downstream communication line 300_3 for the same time as the reference wait time.
[0161] The correction unit 223 corrects the wait time by subtracting the first correction value and the second correction value from the reference wait time. As a specific example, if the reference wait time is 100 ms, the first correction value is 20 ms, and the second correction value is 10 ms, the corrected wait time is 70 ms. The wait time obtained in this manner excludes delays caused by the non-target frame occupying the communication line 300. Therefore, even if the non-target frame occupies the communication line 300, the relay device 200 can wait for the corrected wait time before relaying the target frame, thereby ensuring the simultaneity of frames arriving at the destination ECU 100.
[0162] When the corrected waiting time has elapsed since the reception of the target frame, control unit 225 transmits the target frame to the subsequent device (relay device 200 or ECU 100). In a specific example, when the waiting time has elapsed since the writing of the target frame to buffer 205, control unit 225 reads the target frame from buffer 205 and transmits it to the subsequent device.
[0163] In the first example, the relay device 200_3 is included in a communication path A1 that is different from the deepest path. The number of relay stages of the communication path A1 is "3." Therefore, in the relay table 211_3, corresponding to the message ID "100," the deepest path is set to "NO," the deepest stage is set to "5," the path stage number is set to "3," and the standby stage number is set to "2."
[0164] In the communication path A1, the stage number of the relay device 200_2 is "3" (i.e., the third relay device from the most upstream). Therefore, in the relay table 211_3, the stage number of the own device is set to "3" in correspondence with the message ID "100".
[0165] In the first example, a standby time is set for the relay device 200_3. According to the above-described rule, the relay device 200_2 corrects the standby time based on the communication state of the upstream communication channel "0" (enabled). On the other hand, only the relay device 200_3 can correct the standby time based on the communication state between the relay device 200_3 and the ECU 100_3. Therefore, the relay device 200_3 also corrects the standby time based on the communication state of the downstream communication channel "1" (enabled). Therefore, in the relay table 211_3, both the upstream correction and the downstream correction are set to "enabled" in correspondence with the message ID "100."
[0166] In the first example, the relay device 200_3 is located downstream of the first branch point 310_1. Therefore, in the relay table 211_3, the before and after branch are set to "after" in correspondence with the message ID "100." Furthermore, as described above, in the first example, the reference standby time of the relay device 200_3 is 100 ms. Therefore, in the relay table 211_3, the reference standby time is set to "100" in correspondence with the message ID "100."
[0167] 5. Operation of Relay Device Next, a description will be given of the operation of the relay device 200. Fig. 6 is a flowchart showing an example of a frame relay operation in the relay device according to the embodiment.
[0168] When the processor 201 receives a target frame (step S101 ), the processor 201 writes the received target frame into the buffer 205 .
[0169] The processor 201 acquires the ID of the target frame and acquires the setting value corresponding to the acquired ID in the relay table 211. From the acquired setting value, the processor 201 determines whether the own device is located upstream of the first branch (before branching) or downstream (after branching) (step S102).
[0170] If the own device is on the upstream side of the first branch (YES in step S102), the processor 201 reads the target frame from the buffer 205 and transmits it downstream (step S111). In this case, the frame relay operation ends here.
[0171] If the own device is located downstream of the first branch (NO in step S102), the processor 201 determines whether the own device is included in the deepest route (step S103).
[0172] If the own device is included in the deepest route (YES in step S103), the processor 201 reads the target frame from the buffer 205 and transmits it downstream (step S111). In this case, the frame relay operation ends here.
[0173] If the own device is not included in the deepest route (NO in step S103), the processor 201 determines the waiting time to be the reference waiting time (step S104).
[0174] The processor 201 determines whether upstream correction is enabled (step S105). If upstream correction is enabled (YES in step S105), the processor 201 acquires the upstream communication state (occupancy time of the asymmetric frame) and determines a first correction value based on the acquired communication state (step S106). If upstream correction is disabled (NO in step S105), the processor 201 proceeds to step S107 without determining the first correction value.
[0175] The processor 201 determines whether downstream correction is enabled (step S107). If downstream correction is enabled (YES in step S107), the processor 201 acquires the downstream communication state (occupancy time of the asymmetric frame) and determines a second correction value based on the acquired communication state (step S108). If downstream correction is disabled (NO in step S107), the processor 201 proceeds to step S109 without determining the second correction value.
[0176] The processor 201 corrects the target time using the first and second correction values (step S109). Here, if the first correction value is determined but the second correction value is not determined, only the first correction value is used to correct the target time. If the first correction value is not determined but the second correction value is determined, only the second correction value is used to correct the target time. If neither the first correction value nor the second correction value is determined, the target time is not corrected.
[0177] The processor 201 determines whether the waiting time has elapsed since the target frame was written to the buffer 205 (step S110). If the waiting time has not elapsed since the target frame was written to the buffer 205 (NO in step S110), the processor 201 repeats step S110. If the waiting time has elapsed since the target frame was written to the buffer 205 (YES in step S110), the processor 201 reads the target frame from the buffer 205 and transmits it downstream (step S111). This completes the frame relay operation.
[0178] 6. Modifications In the above-described embodiment, the in-vehicle system 10 is configured using a CAN network, but is not limited to this. The in-vehicle system may also be configured using an Ethernet network ("Ethernet" is a registered trademark).
[0179] 7 is a block diagram showing a modified example of the configuration of the in-vehicle system according to the embodiment. In an Ethernet network having a star topology, the communication line 300 is not a bus but a LAN (Local Area Network) cable with no branches.
[0180] Relay device 200_1 has three communication ports (communication channels), and ECU 100_1 is connected to the first communication port via communication line 300_1, relay device 200_2 is connected to the second communication port via communication line 300_21, and relay device 200_4 is connected to the third communication port via communication line 300_22. Relay device 200_4 has four communication ports, and relay device 200_1 is connected to the first communication port via communication line 300_22, ECU 100_2 is connected to the second communication port via communication line 300_5, relay device 200_5 is connected to the third communication port via communication line 300_61, and relay device 200_7 is connected to the fourth communication port via communication line 300_62.
[0181] For example, when ECU 100_1 transmits an Ethernet frame to ECUs 100_3, 100_4, and 100_5 by multicast, a problem occurs in that the frame does not arrive at ECUs 100_3, 100_4, and 100_5 simultaneously, as in the above-described embodiment. Therefore, in the in-vehicle system 11 according to the modified example, the relay device 200 waits to relay the frame, as in the in-vehicle system 10 according to the embodiment. This ensures that the frames arrive simultaneously.
[0182] In addition, when multiple frames are transmitted to multiple destinations by unicast, the waiting time can be set in the relay device 200 in the same manner, thereby ensuring that the frames arrive simultaneously.
[0183] In the above-described embodiment, the "first in-vehicle device" and the "second in-vehicle device" are exemplified by ECUs, but are not limited thereto. For example, either or both of the "first in-vehicle device" and the "second in-vehicle device" may be a sensor or an actuator.
[0184] [7. Supplementary Notes] [Supplementary Note 1] A relay program used by a relay device that relays a frame to an in-vehicle device, the relay program causing a computer to execute the following steps: when the number of relay devices on a second communication path from a source of a frame to a second in-vehicle device is greater than the number of relay devices on a first communication path from the source of the frame to a first in-vehicle device, determining whether or not the device itself is included in the second communication path; and when it is determined that the device itself is not included in the second communication path, executing a standby process to relay the frame for a standby time based on a difference between the number of relay devices on the first communication path and the number of relay devices on the second communication path.
[0185] [8. Supplementary Note] The embodiments disclosed herein are illustrative in all respects and are not restrictive. The scope of the present invention is defined by the claims, not the above-described embodiments, and includes meanings equivalent to the claims and all modifications within the scope thereof.
[0186] 10, 11 In-vehicle system 200, 200_1, 200_2, 200_3, 200_4, 200_5, 200_6, 200_7, 200_8, 200_9 Relay device 300, 300_1, 300_2, 300_3, 300_4, 300_5, 300_6, 300_7, 300_8, 300_9, 300_10, 300_11, 300_21, 300_22, 300_61, 300_62 Communication line 310_1, 310_2 Branch point 201 Processor 202 Non-volatile memory 203 Volatile memory 204A, 204B, 204C Communication interface 205 Buffer 206 Bus 210 Relay programs 211, 211_1, 211_2, 211_3, 211_4, 211_5, 211_7 Relay table 221 Determination unit 222 Decision unit 223 Correction unit 224 Monitoring unit 225 Control unit
Claims
1. An in-vehicle system comprising: a first in-vehicle device; a second in-vehicle device; and a plurality of relay devices that relay frames to the first in-vehicle device and the second in-vehicle device, wherein when the number of relay devices in a first communication path from a sender of the frame to the first in-vehicle device is different from the number of relay devices in a second communication path from the sender of the frame to the second in-vehicle device, at least one of the relay devices included in the first communication path and the second communication path waits for a waiting time based on the difference between the number of relay devices in the first communication path and the number of relay devices in the second communication path, and then relays the frame.
2. The in-vehicle system according to claim 1, wherein, when the number of relay devices in the first communication path is smaller than the number of relay devices in the second communication path, the relay device included in the first communication path waits for the waiting time and relays the frame.
3. The in-vehicle system according to claim 2, wherein the relay device included in the second communication path relays the frame without waiting.
4. The in-vehicle system according to any one of claims 1 to 3, wherein the relay device included between the source of the frame and the first branch of the communication path relays the frame without waiting.
5. An in-vehicle system as described in any one of claims 1 to 4, wherein, when the number of relay devices in the first communication path is smaller than the number of relay devices in the second communication path and there are multiple relay devices included in the first communication path downstream of the branch of an initial communication path from the source, each of the multiple relay devices included in the first communication path downstream of the branch waits for the same waiting time before relaying the frame.
6. An in-vehicle system as described in any one of claims 1 to 5, wherein when the number of relay devices in the first communication path is smaller than the number of relay devices in the second communication path, the relay device included in the first communication path corrects the waiting time based on the communication state of at least one of the communication lines upstream and downstream of the relay device.
7. The in-vehicle system according to claim 6, wherein the communication state is a time during which a non-target frame, which is a frame different from a target frame to be transmitted to the second in-vehicle device, occupies at least one of the upstream and downstream communication lines.
8. The in-vehicle system according to claim 7, wherein the correction of the waiting time is performed by subtracting the occupancy time from the waiting time.
9. The in-vehicle system according to claim 7 or 8, wherein the non-target frame is a frame having a higher priority than the target frame.
10. A relay device that relays a frame to an in-vehicle device, comprising: a determination unit that, when the number of relay devices on a second communication path from a source of the frame to a second in-vehicle device is greater than the number of relay devices on a first communication path from the source of the frame to a first in-vehicle device, determines whether the relay device itself is included in the second communication path; and a control unit that, when the determination unit determines that the relay device itself is not included in the second communication path, waits for a waiting time based on the difference between the number of relay devices on the first communication path and the number of relay devices on the second communication path, and executes a waiting process to relay the frame.
11. A relay method for relaying frames in an in-vehicle system including a first in-vehicle device, a second in-vehicle device, and a plurality of relay devices that relay frames to the first in-vehicle device and the second in-vehicle device, comprising, when the number of relay devices in a first communication path from a source of the frame to the first in-vehicle device is different from the number of relay devices in a second communication path from the source of the frame to the second in-vehicle device, at least one of the relay devices included in the first communication path and the second communication path waits for a waiting time based on the difference between the number of relay devices in the first communication path and the number of relay devices in the second communication path, and then relays the frame.
Citation Information
Patent Citations
Multi-hop radio communication network, and radio communication terminal
JP2009033516A
Data communication method
JP2009260594A
Relay device, master relay device, and relay system
JP2020205573A