Relay device, communication network system and communication control method

By setting up an inherent data area in the vehicle network system and using DLC ​​to identify CAN frames, the problem of misidentification of data frames between different communication protocols is solved, and the correct identification and transmission of frames is achieved.

CN114667716BActive Publication Date: 2024-09-13NISSAN MOTOR CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202080053939.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-19
Publication Date
2024-09-13
Estimated Expiration
2040-10-19

AI Technical Summary

Technical Problem

In vehicle network systems, data frames using different communication protocols are easily misidentified during the relay process, leading to frame misidentification problems.

Method used

By setting the inherent data area in the storage area of ​​the data frame, the DLC of the data frame is used to identify the CAN frame, and the inherent data area is avoided to be processed during frame recognition processing to ensure the correct identification of the frame.

Benefits of technology

It effectively prevents misidentification of frames and ensures the correct transmission and processing of data frames between different communication protocols.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114667716B
    Figure CN114667716B
Patent Text Reader

Abstract

A repeater is provided which is connected between a first communication network and a second communication network whose communication protocol is different from that of the first communication network, and which receives and stores a second frame having at least one first frame. The first frame is sent over the first communication network, and has a first payload including control information, a first data ID for identifying the control information, and a data length code indicating the data length of the first payload. The second frame is sent over the second communication network, and has the first frame, a second data ID indicating that the first frame is included, and inherent data stored in a specified storage area located at a position later than the first frame. When the repeater identifies the first frame in the second frame based on the data length code, it identifies the first frame in a manner that does not perform frame identification processing on the data in the specified storage area.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a relay device for communicating data via a communication network, a communication network system, and a communication control method. Background Art

[0002] Patent document 1 discloses an in-vehicle network system, which includes a plurality of ECUs (Electronic Control Units) for controlling in-vehicle devices, an in-vehicle network such as CAN (Controller Area Network) that connects the ECUs so that they can communicate with each other, and a gateway device that relays communication between the ECUs. The gateway device stores a plurality of CAN data frames in the payload of Ethernet (registered trademark) data frames to send data frames from an ECU connected to the CAN to an ECU connected to the Ethernet using a communication protocol different from that of the CAN.

[0003] Prior art literature

[0004] Patent Literature

[0005] Patent Document 1: International Publication No. 2017 / 203902 Summary of the invention

[0006] Problem that the invention aims to solve

[0007] In the in-vehicle network system described in Patent Document 1, a plurality of CAN data frames stored in a payload include a DLC indicating the length of the data in each CAN frame. The gateway device is capable of receiving Ethernet data frames, and determining the separation of the plurality of CAN data frames according to the DLC in the payload of the Ethernet data frame, thereby identifying the CAN data frames one by one. However, there is a concern that the data arranged at the rear position in the Ethernet data frame may be mistakenly identified as a CAN data frame.

[0008] The problem to be solved by the present invention is to provide a relay device, a communication network system and a communication control method for preventing misidentification of frames when communicating data between communication networks using different communication protocols.

[0009] Solutions for solving problems

[0010] The present invention solves the above-mentioned problem by the following method: the second frame has the first frame, the first data ID and the inherent data stored in the prescribed storage area located at the rear of the first frame, and when the repeater performs the frame identification processing to identify the first frame in the second frame based on the data length of the payload of the first frame, the repeater identifies the first frame by not performing the frame identification processing on the data in the storage area.

[0011] Effects of the Invention

[0012] According to the present invention, it is possible to prevent erroneous recognition of frames. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1 It is a structural diagram of an in-vehicle communication network system to which the relay device, communication network system, and communication control method involved in the present invention are applied.

[0014] Figure 2 This is an explanatory diagram showing the structure of a CAN data frame.

[0015] Figure 3 It is an explanatory diagram showing the structure of a CAN FD data frame.

[0016] Figure 4 It is the structural diagram of DM.

[0017] Figure 5 It is an explanatory diagram showing the structure of a CAN FD data frame.

[0018] Figure 6 It is an explanatory diagram showing the structure of a CAN FD data frame.

[0019] Figure 7 1 is a timing chart showing a process of transmitting a CAN frame from a communication network connected to the CAN bus to a communication network connected to the CAN bus.

[0020] Figure 8 It is an explanatory diagram showing a process of transmitting a CAN frame from a communication network connected to the CAN bus to a communication network connected to the CAN bus. DETAILED DESCRIPTION

[0021] Hereinafter, embodiments of the present invention will be described based on the drawings.

[0022] In this embodiment, an example of applying the relay device, communication network system, and communication control method involved in the present invention to an on-board network system installed in an automobile (also referred to as a vehicle) is used for explanation. The on-board communication network system CNW involved in this embodiment is a network system that is a mixture of multiple communication networks using different communication protocols such as CAN, CAN FD, and Ethernet. CAN FD is a communication protocol that is upwardly compatible with CAN, and has a larger data communication volume (communication speed) per unit time than CAN. Ethernet is a communication network used in LAN (Local Area Network) and the like, and has a larger data communication volume per unit time than CAN FD.

[0023] Figure 1 It is a block diagram showing the structure of the vehicle-mounted communication network system CNW involved in this embodiment. The vehicle-mounted communication network system CNW has a first communication network 1, a second communication network 2, a third communication network 3, a fourth communication network 4, a fifth communication network 5, a sixth communication network 6, and a CGW (Central Gateway) 7 connected to the first communication network 1 to the sixth communication network 6. The first communication network 1 to the sixth communication network 6 constitute a plurality of control groups divided according to the basic structure of the vehicle. The control group is also called a domain. In the domain, in addition to the multimedia domain that controls the information presentation in the vehicle, there is also a power transmission domain that controls the engine, etc., a chassis domain that controls the steering mechanism, etc., a body domain that controls the electric windows, etc., and an ADAS (Advanced Driver-Assistance System: Advanced Driving Assistance System) domain that performs autonomous driving control. The first communication network 1 to the sixth communication network 6 are equivalent to an example of the first communication network and the second communication network of the present invention. In addition, the number of communication networks that constitute the vehicle-mounted communication network system CNW is not limited to 6.

[0024] The first communication network 1 includes ECU 11, ECU 12, and ECU 13. ECU 11 to 13 are connected to CGW 7 via CAN bus 14 that performs data communication according to the CAN communication protocol. ECU 11 to 13 are electronic control devices that control vehicle-mounted devices installed in the vehicle. ECU 11 to 13 include a controller and a communication circuit, the details of which are not shown in the figure. The controller includes a CPU, a ROM that stores a control program executed by the CPU, and a RAM used as a work area for the control program. The controller functions as an ECU by executing the control program by the CPU. The communication circuit is controlled by the controller to perform communication between the controller and the CAN bus 14.

[0025] ECUs 11 to 13 are connected to vehicle-mounted devices such as sensors or actuators not shown in the figure. ECUs 11 to 13 obtain sensor information indicating the detection results of the sensors from the connected sensors, and generate CAN data frames (hereinafter also referred to as CAN frames, equivalent to the "first frame" of the present invention) storing control information including the acquired sensor information. The CAN frames generated by ECUs 11 to 13 are sent to CGW 7 via CAN bus 14. In addition, each ECU 11 to 13 receives CAN frames from CGW 7 via CAN bus 14, and controls vehicle-mounted devices such as actuators based on the control information stored in the received CAN frames. ECUs 11 to 13 are equivalent to an example of the first electronic control unit and the second electronic control unit of the present invention.

[0026] The second communication network 2 includes ECU 21, ECU 22, and ECU 23. ECU 21-23 are connected to CGW 7 via CAN bus 24 that performs data communication according to the CAN communication protocol. In addition, ECU 21-23 and CAN bus 24 of the second communication network 2 have the same structure as ECU 11-13 and CAN bus 14 of the first communication network 1, so detailed description is omitted.

[0027] The third communication network 3 includes a DM (Domain Master) 31, an ECU 32, an ECU 33, and an ECU 34. The DM 31 is connected to the CGW 7 via an FD bus 35 that performs data communication in accordance with the communication protocol of CAN FD. In addition, the ECUs 32 to 34 are connected to the DM 31 via an FD bus 36 that performs data communication in accordance with the communication protocol of CAN FD.

[0028] ECU 32-34 is an electronic control device that controls the vehicle-mounted equipment installed in the vehicle, similar to ECU 11-13 of the first communication network 1, and ECU 32-34 has a controller and a communication circuit. ECU 32-34 obtains sensor information representing the detection results of the sensor from the connected sensor, and generates a CAN FD data frame (hereinafter also referred to as an FD frame, equivalent to the "second frame" of the present invention) that stores control information including the acquired sensor information. The FD frame generated by ECU 32-34 is sent to DM 31 via FD bus 36. In addition, each ECU 32-34 receives the FD frame from DM 31 via FD bus 36, and controls the vehicle-mounted equipment such as the actuator based on the control information stored in the received FD frame. ECU 32-34 is equivalent to an example of the first electronic control device and the second electronic control device of the present invention.

[0029] DM 31 is a repeater that relays the communication between CGW 7 and ECUs 32 to 34. DM 31 has a controller and a communication circuit similar to ECU. DM 31 communicates FD frames with ECUs 32 to 34 via FD bus 36. In addition, DM 31 communicates FD frames with CGW 7 via FD bus 35. DM 31 is an example of a repeater of the present invention.

[0030] The fourth communication network 4 includes a DM 41, an ECU 42, an ECU 43, and an ECU 44. The DM 41 is connected to the CGW 7 via an FD bus 45 that performs data communication in accordance with the communication protocol of CAN FD. In addition, the ECUs 42 to 44 are connected to the DM 41 via an FD bus 46 that performs data communication in accordance with the communication protocol of CAN FD. In addition, the DM 41, the ECUs 42 to 44, and the FD buses 45 and 46 of the fourth communication network 4 have the same structure as the DM 31, the ECUs 32 to 34, and the FD buses 35 and 36 of the third communication network 3, and therefore a detailed description thereof will be omitted.

[0031] The fifth communication network 5 includes a DM 51, an ECU 52, an ECU 53, and an ECU 54. The DM 51 is connected to the CGW 7 via an FD bus 55 that performs data communication according to the CAN FD communication protocol. The ECUs 52 to 54 are connected to the DM 51 via a CAN bus 56 that performs data communication according to the CAN communication protocol.

[0032] ECU 52-54 is an electronic control device that controls the vehicle-mounted equipment installed in the vehicle, similar to ECU 11-13 of the first communication network 1, and ECU 52-54 has a controller and a communication circuit. ECU 52-54 obtains sensor information representing the detection results of the sensor from the connected sensor, and generates a CAN frame that stores control information including the acquired sensor information. The CAN frame generated by ECU 52-54 is sent to DM 51 via CAN bus 56. In addition, each ECU 52-54 receives a CAN frame from DM 51 via CAN bus 56, and controls the vehicle-mounted equipment such as the actuator based on the control information stored in the received CAN frame. ECU 52-54 is equivalent to an example of the first electronic control device and the second electronic control device of the present invention.

[0033] DM51 is a repeater that relays the communication between CGW7 and ECU52-54, and has a controller and a communication circuit similar to DM31 of the third communication network 3. DM51 communicates CAN frames with ECU52-54 via CAN bus 56. In addition, DM51 communicates FD frames with CGW7 via FD bus 55. When DM51 sends a CAN frame generated by ECU52-54 to the first communication network 1 or the second communication network 2, it saves at least one CAN frame in the FD frame and sends it to CGW7. DM51 is an example of a repeater of the present invention.

[0034] The sixth communication network 6 includes a DM 61, an ECU 62, an ECU 63, and an ECU 64. The DM 61 is connected to the CGW 7 via an FD bus 65 that performs data communication in accordance with the communication protocol of CAN FD. In addition, the ECUs 62 to 64 are connected to the DM 61 via a CAN bus 66 that performs data communication in accordance with the communication protocol of CAN. In addition, the DM 61, the ECUs 62 to 64, the FD bus 65, and the CAN bus 66 of the sixth communication network 6 have the same structure as the DM 51, the ECUs 52 to 54, the FD bus 55, and the CAN bus 56 of the fifth communication network 5, and therefore detailed description thereof is omitted.

[0035] CGW 7 is a repeater that relays data frames between the first communication network 1 to the sixth communication network 6, and has a controller and a communication circuit similar to DM 31. CGW 7 communicates CAN frames with ECUs 11 to 13 via the CAN bus 14 of the first communication network 1. In addition, CGW 7 communicates CAN frames with ECUs 21 to 23 via the CAN bus 24 of the second communication network 2. CGW 7 communicates FD frames with DM 31 via the FD bus 35 of the third communication network 3. In addition, CGW 7 communicates FD frames with DM 41 via the FD bus 45 of the fourth communication network 4. Furthermore, CGW 7 communicates FD frames with DM 51 via the FD bus 55 of the fifth communication network 5. CGW 7 communicates FD frames with DM 61 via the FD bus 65 of the sixth communication network 6. When receiving the FD frame storing the CAN frame from the DM 51 or 61 , the CGW 7 acquires the CAN frame from the FD frame and transmits the acquired CAN frame to the ECUs 11 to 13 of the first communication network 1 or the ECUs 21 to 23 of the second communication network 2 .

[0036] Next, the structure of the CAN frame is described. Figure 2As shown, the CAN frame consists of a SOF (Start Of Frame) segment, an ID (Identifier) ​​segment, an RTR (Remote Transmission Request) segment, a DLC (Data Length Code) segment, a data segment (data field), a CRC segment, an ACK segment, and an EOF (End of Frame) segment. Figure 2 The numerical value recorded in each segment represents the number of bits that constitute each segment.

[0037] The SOF segment indicates the beginning of the CAN frame. The ID segment stores the CAN ID, which is an identifier indicating the type of data stored in the data segment. The CAN ID is also called a message ID. In addition, in CAN, when multiple ECUs start sending CAN frames at the same time, communication arbitration is performed to give priority to the communication of CAN frames with a smaller value of the CAN ID. The DLC segment stores information indicating the size (data length) of the data in the subsequent data segment. The CRC segment stores a cyclic redundancy check code for detecting communication errors in the CAN frame.

[0038] The format of the data stored in the data segment is not specified in the CAN communication protocol. In the vehicle-mounted communication network system CNW involved in this embodiment, the control information CD containing the sensor information obtained from the sensor connected to the ECU is stored in the data segment. In addition, the information contained in the control information CD is not limited to the sensor information, for example, it can also be the operation information required by the driver. The data segment can also contain not only the control information CD, but also the error detection code EC calculated by each ECU that generates the CAN frame based on the CAN ID and the control information CD.

[0039] Next, the structure of the FD frame is described. Figure 3 As shown, the FD frame is composed of a SOF segment, an ID segment, an EDL (Extended Data Length) segment, a BRS (Bit Rate Switch) segment, an ESI (Error State Indicator) segment, a DLC segment, a data segment, a CRC segment, an ACK segment, and an EOF segment. Figure 3 The numerical values ​​recorded in each segment indicate the number of bits constituting each segment. The FD frame adds EDL bits, BRS bits, and ESI bits to the CAN frame, and the data segment is expanded to 64 bytes. In addition, the ID segment stores an identifier indicating the type of data stored in the data segment, namely the CAN FD ID. The CAN FD ID is equivalent to the "second data ID" of the present invention.

[0040] Regarding the FD frame, for example, when communication is performed between ECUs connected to the FD bus, control information is stored in the data segment, similar to the CAN frame. Specifically, for example, when the FD frame is generated by the ECUs 32 to 34 connected to the FD bus 36 of the third communication network 3 and sent to the ECUs 42 to 44 connected to the FD bus 46 of the fourth communication network 4, the control information is stored in the data segment of the FD frame, similar to the CAN frame. In this case, an ID indicating the type of control information, such as "001", is given to the CAN FD ID.

[0041] In addition, regarding the FD frame, for example, when the ECU connected to the CAN bus is transmitted to the ECU via the FD bus, at least one CAN frame is stored in the data segment. Specifically, for example, when the ECUs 11 to 13 connected to the CAN bus 14 of the first communication network 1 generate a CAN frame and transmit it to the ECUs 52 to 54 of the fifth communication network 5, the CGW 7 stores at least one CAN frame in the data segment of the FD frame and transmits it to the DM 51. In this case, the CAN FD ID is given an ID indicating that the CAN frame is stored in the data frame, for example, "002".

[0042] Next, refer to Figure 4 Various functional units for generating FD frames in DM 51 will be described. Figure 4 The various functional units of DM 51 are shown, which are configured by the CPU operating based on the control program. DM 51 includes a storage unit 510, a communication unit 520, a counter 530, a data acquisition unit 540, a frame generation unit 550, a MAC verification unit 560, a count value verification unit 570, and a frame recognition unit 580. In addition, other DMs 31, 41, and 61 also have the same structure, and the basic structure of CGW 7 is also the same as that of DM 51, and the details are not described.

[0043] The storage unit 510 is composed of a memory such as a ROM, and stores a count value 511 and a public key 512 for responding to replay attacks on the vehicle network system. Here, a replay attack is explained. CGW 7 is connected to an external device in a state that can communicate. Therefore, in the vehicle communication network system CNW involved in this embodiment, in order to respond to replay attacks from the outside, a message authentication code (Message Authentication Code, hereinafter also referred to as "MAC") is used to verify the legitimacy of the data frame. A replay attack refers to the following network attack: eavesdropping on data frames circulating on the network and storing their contents in advance, sending the stored data frames or modified data frames to the network, thereby causing the devices in the network to perform illegal actions. The replay attack is carried out by an external device connected to CGW 7 via the network.

[0044] The communication unit 520 communicates with other ECUs and / or other DMs via the CAN and the CGW 7. When receiving a data frame transmitted from the CGW 7, the communication unit 520 checks the ID of the data frame and receives only a data frame having a predetermined ID, that is, a data frame associated with the DM 51 in which the communication unit 520 is installed. In addition, the communication unit 520 receives data frames transmitted by the ECUs 52 to 54. Furthermore, the communication unit 520 transmits the data frame generated by the frame generation unit 550 to the ECUs 52 to 54 or the CGW 7.

[0045] The counter 530 counts the number of times the data frame is sent to the CAN, and adds 1 to the count value. The count value is a value used to ensure the continuity of sending and receiving data (messages), and is used to verify the legitimacy of the data to discard fake data and tampered data from a third party. The counter 530 counts the number of times the data frame is sent by the ECU 11, etc., DM 31, etc., and CGW 7 in the vehicle network system. Therefore, the counts for the ECU 11, etc., DM 31, etc., and CGW 7 are the same count value. The count value counted by the counter 530 is stored in the storage unit 510.

[0046] The data acquisition unit 540 acquires information from the vehicle-mounted devices such as sensors connected to the DM 51. The frame generation unit 550 generates control information including the information acquired by the data acquisition unit 540, and generates a data frame to be transmitted by the communication unit 520 based on the generated control information. Specifically, the frame generation unit 550 sets the ID according to the type of information acquired by the data acquisition unit 540. The frame generation unit 550 stores, for example, a table that associates sensor information with CAN FD IDs in advance, and sets the CAN FD ID based on the table. In addition, other DM 31 or the ECU 11 etc. give an ID for a CAN frame in order to generate a CAN frame.

[0047] In addition, when DM 51 sends an FD frame containing at least one CAN frame from ECU 52 to 54 to CGW 7 via the FD bus 55, the frame generation unit 550 saves the CAN frame received by the communication unit 520 from ECU 52 to 54 into the data segment of the FD frame, and assigns a CAN FD ID indicating that the CAN frame is included in the data segment.

[0048] In addition, in order to cope with the above-mentioned replay attack, the frame generation unit 550 generates a MAC based on the CAN FD ID, the data included in the CAN FD data segment, and the count value 511 stored in the storage unit 510 using the common key 512 stored in the storage unit 510. Regarding the common key 512, a common common key is used in each ECU 11, each DM31, and the CGW 7. In addition, in order to calculate the MAC, a method using a hash function (HMAC), a method using a block cipher algorithm (CMAC, etc.), etc. is adopted. The frame generation unit 550 generates a data frame based on the set CAN FD ID, the control information including the information acquired by the data acquisition unit 540 and / or the data frame received by the communication unit 520, the count value 511 stored in the storage unit 510, and the generated MAC.

[0049] Figure 5 FIG. 2 shows an example of the structure of a data frame generated by the frame generation unit 550. The data frame includes an ID segment 91 for storing a CAN FD ID and a data segment 92 for storing a CAN frame. The data segment 92 stores a CAN frame, a count value, and a MAC. Figure 5 An example of an FD frame including three CAN frames in the data segment is shown. Figure 5 The frame structure shown is Figure 3 The frame with the ID "002" in the FD frame shows the frame structure when a MAC is assigned to part of the data segment. Figure 5 Omitted Figure 3 An illustration of the EOF and other segments is shown in FIG.

[0050] ID segment 91 includes CAN FD ID and DLC, etc. DLC included in ID segment 91 shows the data length of data segment 92, indicating how many bytes of data are sent in the frame. DLC is 1 byte for both CAN and CAN FD. The setting range of DLC is 0 to 8 bytes in the case of CAN, and 12, 16, 20, 24, 32, 48 or 64 bytes when CAN FD is 8 bits or more. In addition, ID segment 91 does not contain information indicating the number of CAN frames included in data segment 92. Therefore, the number of CAN frames included in data segment 92 cannot be grasped by ID segment 91 alone.

[0051] Data segment 92 contains multiple CAN frames, count values, and MAC. Figure 5In the example, three CAN frames are stored in data segment 92. The CAN frame includes an ID segment 101 and a data segment 102, and the ID segment 101 includes a CAN ID and a DLC. The IDs of the three CAN frames are assigned "100", "200" and "300", and the three CAN frames are stored in the order of "100", "200" and "300" in the data segment 92. In addition, in the data segment 92, a count value and a MAC are stored at a position behind the multiple CAN frames. The count value and the MAC are data used to verify the legitimacy of the data frame, and are frame-specific data (inherent data). In addition, the data capacity of the CAN frame is limited to a maximum of 8 bytes, so the data frame of the CAN frame cannot store all the control information, the count value and the MAC. On the other hand, in the FD frame, the maximum data capacity is 64 bytes, so the data frame of the FD frame can store the count value and the MAC in addition to the control information and multiple CAN frames.

[0052] The MAC verification unit 560 verifies the legitimacy of the data frame based on the MAC of the data frame received by the communication unit 520, that is, whether the received data frame is sent from other ECUs 11, DMs 31, etc., and CGW 7 in the vehicle network system. Specifically, the MAC verification unit 560 obtains the ID, control information, count value, and MAC from the received data frame. The MAC verification unit 560 generates a MAC for verification using the public key 512 stored in the storage unit 510 based on the obtained ID, control information, and count value.

[0053] Next, the MAC verification unit 560 compares the MAC obtained from the received data frame with the MAC used for verification, and when the obtained MAC is consistent with the MAC used for verification, it determines that the received data frame is legal data. When the MAC verification unit 560 determines that the received data frame is legal data, it outputs the received data frame to the count value verification unit 570. In addition, when the MAC verification unit 560 determines that the received data frame is illegal data, it discards the received data frame. In this way, MAC can be used to detect and discard illegal data frames, thereby preventing replay attacks on the vehicle network system. In addition, CAN ID, control information and count value are used to generate MAC, but any one or a combination of any two of these three data can also be used to generate MAC.

[0054] The count value verification unit 570 obtains the count value from the received data frame and determines whether the continuity of the count value is guaranteed. When the count value verification unit 570 determines that the continuity is not guaranteed, the received data frame is discarded. Then, after the MAC verification unit 560 and the count value verification unit 570 determine that the received data frame is legal data, the DM 51 processes the data contained in the data frame. For example, when receiving Figure 5 In the case of the FD frame including a plurality of CAN frames shown, the DM 51 performs frame recognition processing for each CAN frame, and transmits the recognized CAN frame to each ECU 52 to 54 under the CAN communication protocol.

[0055] When the communication unit 520 receives an FD frame storing at least one CAN frame, the frame identification unit 580 identifies the CAN frame in the data segment of the FD frame. For authentication of the CAN frame, each frame stored in the data segment 92 is identified.

[0056] Reference Figure 6 The frame authentication process performed by the frame identification unit 580 will be described. Figure 6 An example of the structure of a CAN FD data frame is shown, and it is also a diagram for explaining frame authentication. Figure 6 The data frame with Figure 5 The data frame is similarly.

[0057] The frame identification unit 580 identifies the ID "002" from the ID segment 101 and identifies that at least one CAN frame is stored in the data segment. The frame identification unit 580 reads data from the beginning of the CAN frame and identifies the CAN ID and DLC contained in the ID segment. The frame identification unit 580 can identify that a CAN frame is stored in the FD frame based on the CAN ID. Figure 6 In the example, the frame identification unit 580 determines that a CAN frame assigned with ID "100" and a DLC stored in the ID segment are stored. The data length of the data segment of the CAN frame can be set within the range of 0 to 8 bytes, but the frame identification unit 580 can determine the data length of the data segment based on the DLC. The frame identification unit 580 can determine the frame delimiter as the end of the CAN frame with ID "100" based on the data length shown in the DLC (refer to Figure 6 As a result, the frame identification unit 580 can authenticate the CAN frame of ID "100" in the data segment of the FD frame.

[0058] After identifying the delimiter of the CAN frame of ID "100", the frame identification unit 580 reads the data stored after the identified delimiter (the data located immediately after the delimiter of the frame in terms of data structure). Figure 6In the example, the frame recognition unit 580 reads the data after the delimiter of the CAN frame with ID "100", thereby determining that the CAN frame assigned with ID "200" and the DLC stored in the ID segment of the CAN frame with ID "200" are stored. Then, the frame recognition unit 580 determines the delimiter of the frame that is the end of the CAN frame with ID "200" based on the DLC in the same way as the CAN frame with ID "100", thereby authenticating the CAN frame with ID "200". In addition, the frame recognition unit 580 determines the delimiter of the frame that is the end of the CAN frame with ID "300" based on the DLC in the same way as the CAN frames with ID "100" and "200", thereby authenticating the CAN frame with ID "300".

[0059] Next, the frame identification unit 580 reads the data stored in the partition after the CAN frame of ID "300". Figure 6 In the example, no new CAN frame is stored behind the CAN frame with ID "300", but the count value and MAC are stored. Figure 6 As shown by arrow B, the data at the location where the count value and MAC are stored is read.

[0060] The data length of the CAN frame can be set to any value within the range of 0 to 8 bytes. In order to improve data efficiency, the position of the CAN frame in the data segment of the FD frame is not fixed, but can be arbitrarily changed according to the amount of data. As described above, the frame identification unit 580 can determine that the CAN ID exists in the data ahead of the length of the data length indicated by the DLC by using the DLC of the CAN frame. For example, if the DLC included in the CAN frame of ID "100" shows 4 bytes, the frame identification unit 580 can grasp the storage position of the ID (3 bytes) of the next CAN frame in front of the data length (4 bytes) of the payload of the CAN frame of ID "100" offset.

[0061] However, there is a concern that if the count value and / or MAC is stored at the storage location of the ID of the next CAN frame, the count value and / or MAC will be mistakenly recognized as another CAN frame. In other words, the count value and MAC are not inherent values, but can take any value, so the count value and MAC value sometimes coincide with the value of the ID used for the CAN frame occasionally. In addition, the data volume of the count value and MAC is 10 bytes, which is larger than the data volume of 1 CAN frame. Therefore, there is a concern that the frame recognition unit 580 mistakenly recognizes that a CAN frame is stored at the storage location of the count value and MAC.

[0062] In this embodiment, in order to prevent such misrecognition of frames, the frame recognition unit 580 recognizes CAN frames by not performing frame recognition processing on the data in the storage area for storing the counter value and / or MAC and other inherent data. The storage area in the data segment for the counter value and / or MAC and other inherent data is predetermined, and the storage area is from the end of the data segment of the FD frame to the specified data length ( Figure 6 In the example, 10 bytes) is the storage area. In addition, the data length of the storage area is set to a length greater than the data length of the inherent data. However, the positional relationship between the CAN FD ID and the storage area changes dynamically within the frame according to the number of CAN frames contained in the data segment, the amount of data in the CAN frame, and the like. The frame identification unit 580 determines the end of the data segment based on the DLC of the FD frame, thereby being able to grasp the storage area for the inherent data including the count value and MAC. Then, during the above-mentioned frame authentication process, the frame identification unit 580 does not perform frame identification processing on the data in the storage area, but instead performs frame identification processing on the data in the area outside the storage area in the data segment. Figure 6 In the example, the frame recognition processing is not performed on the data assigned with the count value and MAC located after the CAD frame of ID "300". In other words, the frame recognition unit 580 performs the frame recognition processing by ignoring the 10 bytes of data before the end of the data segment (the data assigned with the count value and MAC).

[0063] exist Figure 6 In the example of , the frame recognition unit 580 determines the location of the storage area of ​​the inherent data in the data segment and then performs frame recognition processing, and recognizes each frame in the order of the CAN frame of ID "100", the CAN frame of ID "200", and the CAN frame of ID "300". Then, the position of the ID indicated by the DLC of the CAD frame of ID "300" is included in the storage area of ​​the inherent data, so the frame recognition unit 580 ends the frame recognition processing after determining the CAN frame of ID "300". In this way, it is possible to prevent misidentification of frames and recognize CAN frames.

[0064] Next, refer to Figure 7 The timing diagram and Figure 8 The process of sending the CAN frames generated by the ECUs 11 to 13 of the first communication network 1 to the ECUs 52 to 54 of the fifth communication network 5 is described with reference to the following diagram. Figure 7As shown in step S1 of the first communication network 1, the ECUs 11 to 13 acquire sensor information from sensors, for example, generating CAN frames C1 to CN. Specifically, the ECUs 11 to 13 generate control information CD containing sensor information based on the acquired sensor information, and set the CAN ID based on the type of sensor information, etc. In the figure, "100" and "200" represent CAN IDs. The ECUs 11 to 13 store the control information CD in the data segment of the generated CAN frames C1 to CN, and send the generated CAN frames C1 to CN to the CGW 7 via the CAN bus 14.

[0065] CGW 7 receives CAN frames C1 to CN from the first communication network 1 via the CAN bus 14, and in step S2, generates an FD frame F1 in which the received CAN frames C1 to CN are stored in the data segment. Specifically, CGW 7 assigns "002" to the FD frame F1 as a CAN FD ID indicating that at least one CAN frame is stored in the data segment. In addition, CGW 7 groups multiple CAN frames C1 to CN based on the ECU of the destination of the CAN frames C1 to CN, the type of the stored control information CD, the transmission cycle of the CAN frames C1 to CN, etc., and generates FD frames F1 according to the grouped multiple CAN frames. In addition, CGW 7 sends the generated FD frame F1 to DM 51 via the FD bus 55 of the fifth communication network 5.

[0066] The type of control information CD refers to whether the control contents using the control information CD are common or related. For example, when the CAN frames C1 to CN are grouped according to the acceleration and deceleration control of the vehicle, the control of the power transmission system such as the engine, the brake, etc. are common or related control contents, and the CAN frames C1 to CN are grouped according to the control information CD used for these controls. In addition, the transmission cycle of the CAN frames C1 to CN refers to, for example, the transmission cycle when the sensor information acquired from the sensor is transmitted at a predetermined time interval, and the CAN frames C1 to CN are grouped according to the control information CD with the same or similar transmission cycle. In this way, by grouping the CAN frames C1 to CN according to the ECU of the transmission destination, the type of control information CD, the transmission cycle, etc., and then transmitting them, the transmission load of the vehicle communication network system CNW can be suppressed. In addition, the related control information CD can be transmitted together, so the control in the ECU of the transmission destination can be performed appropriately and efficiently.

[0067] In addition, CGW 7 obtains only the "data segment" from each of the CAN frames C1 to CN and stores it in the data segment of the FD frame F1. "DLC" is used to determine the separation of multiple CAN frames C1 to CN stored in the data segment. In this way, only the data required by the ECU of the transmission destination among the large amount of data constituting the CAN frames C1 to CN is stored in the FD frame F1 and transmitted, thereby suppressing the transmission load of the vehicle communication network system CNW.

[0068] When the DM 51 of the fifth communication network 5 receives the FD frame F1 via the FD bus 55, it determines that at least one CAN frame is stored in the data segment based on the CAN FD ID. In step S3, the DM 51 obtains the CAN frames C1 to CN from the received FD frame F1. As described above, when a plurality of CAN frames C1 to CN are obtained from the data segment of the FD frame F1 through frame authentication, the "DLC" can be used to determine the separation between CAN frames, so that the plurality of CAN frames C1 to CN can be appropriately obtained. In addition, when the DM 51 identifies the plurality of CAN frames C1 to CN in the FD frame F1 based on the DLC, the data in the storage area containing the inherent data of the count value and the MAC is not subjected to frame identification processing. As a result, it is possible to prevent erroneous identification of frames and appropriately obtain the plurality of CAN frames C1 to CN. Then, the DM 51 sends the obtained plurality of CAN frames C1 to CN to the CAN bus 56 of the fifth communication network 5.

[0069] The ECUs 52 to 54 of the fifth communication network 5 receive the CAN frames C1 to CN necessary for controlling the vehicle-mounted devices based on the CAN IDs of the CAN frames C1 to CN. The ECUs 52 to 54 control the vehicle-mounted devices based on the control signals CD of the received CAN frames C1 to CN in step S4.

[0070] As described above, according to the in-vehicle communication network system CNW of the present embodiment, the FD frame includes the CAN frame, the CAN ID, and the inherent data stored in the predetermined storage area located behind the CAN frame, and the repeater such as DM31 to 61 or CGW 7 recognizes the CAN frame by not performing the frame recognition process on the data in the storage area when performing the frame recognition process of recognizing the CAN frame in the FD frame based on the data length of the payload of the CAN frame. Thus, it is possible to prevent the inherent data stored in the storage area from being mistakenly determined as the CAN ID, and to prevent the CAN frame from being mistakenly recognized.

[0071] In addition, according to the in-vehicle communication network system CNW of this embodiment, the storage area of ​​the unique data is set to the area from the end of the data segment including the CAN frame and the unique data to the predetermined data length, thereby preventing erroneous recognition of the CAN frame.

[0072] In addition, according to the vehicle communication network system CNW involved in this embodiment, the above-mentioned prescribed data length is set to a length greater than the data length of the inherent data. As a result, the area where the data value may be consistent with the value of the CAN ID can be excluded from the area where the frame authentication process is performed, and as a result, the misrecognition of the CAN frame can be prevented.

[0073] In addition, according to the vehicle communication network system CNW involved in this embodiment, the inherent data is data indicating the legitimacy of the data, and can be set to any value. As a result, data whose data value may be consistent with the value of the CAN ID can be excluded from the execution object of the frame authentication process, and as a result, the misrecognition of the CAN frame can be prevented.

[0074] In addition, as a variation of the present embodiment, the DM 51 may insert padding data having a data length greater than the data length of the CAN ID between the CAN frame and the inherent data when storing the CAN frame in the FD frame. Figure 6 In the data structure of the FD frame shown, padding data having a data length of more than 3 bytes is inserted between the CAN frame of ID "300" and the inherent data. Padding data is data without meaning. In addition, padding data is usually inserted when the data is to be operated as a fixed length, but in the modified example, it is fixed data that must be inserted. Therefore, in the data segment, when the total data amount exceeds the first fixed length predefined by the FD frame by inserting padding data between the CAN frame and the inherent data, the data amount is adjusted to the total data amount in the data segment by lengthening the data length of the padding data or saving other CAN frames. In addition, the first fixed length and the second fixed length show the fixed length defined for the data segment of the FD frame, and the second fixed length is longer than the first fixed length. Thus, it is also possible that, when receiving an FD frame storing a CAN frame, when the CGW 7 performs frame recognition processing based on the DLC of the CAN frame in the FD frame, the data processing such as "recognizing the CAN frame in a manner that does not perform frame recognition processing on the data in the storage area" is not performed. As a result, it is possible to prevent the misrecognition of the CAN frame.

[0075] However, in the data processing as in the above-mentioned modification, the data efficiency will decrease corresponding to the insertion of the padding data, so from the aspect of data efficiency, the data processing of "identifying the CAN frame by not performing the frame identification processing on the data in the storage area" is more preferable. In addition, the data of the number of stored CAN frames can also be assigned to the CAN FD ID, but the data volume of the CAN FD ID will increase and the data efficiency will decrease, so from the aspect of data efficiency, the data processing of "identifying the CAN frame by not performing the frame identification processing on the data in the storage area" is more preferable.

[0076] Description of Reference Numerals

[0077] CNW: In-vehicle communication network system; 1: First communication network; 11-13: ECU (Electronic ControlUnit: Electronic Control Unit); 2: Second Communication Network; 21-23: ECU; 3: Third Communication Network; 31: DM (DomainMaster); 32-34: ECU; 35, 36: FD Bus; 4: Fourth Communication Network; 41: DM; 42-44: ECU; 45, 46: FD Bus; 5: Fifth Communication Network; 51: DM; 510: Storage Unit; 511: Count Value; 512: Public Key; 520: Communication Unit; 530: Counter; 540: Data Acquisition Unit; 550: Frame Generation Unit; 560: MAC Verification Unit; 570: Count Value Verification Unit; 580: Frame Identification Unit; 52-54: ECU; 55: FD Bus; 56: CAN Bus; 6: Sixth Communication Network; 61: DM; 62-64: ECU; 65: FD Bus; 66: CAN Bus; 7: CGW (Central Gateway) Gateway: central gateway); C1~CN: CAN frame; F1: FD frame; E1: Ethernet frame.

Claims

1. A relay device connected between a first communication network and a second communication network having a communication protocol different from that of the first communication network, The relay device includes a relay receiving a second frame storing at least one first frame, The first frame is sent under the first communication network, The first frame has a first payload including control information, a first data ID for identifying the control information, and a data length code indicating a data length of the first payload, The second frame is sent under the second communication network, The second frame includes a plurality of the first frames, a second data ID indicating that the first frames are included, a data length code indicating the data length of the second frame, and inherent data stored in a predetermined storage area located behind the first frame. The repeater determines the end of the data segment of the second frame based on the data length code of the second frame, thereby determining the prescribed storage area of ​​the inherent data. When the repeater identifies the first frame in the second frame based on the data length code, the repeater identifies the first frame by not performing frame identification processing on data in the predetermined storage area but performing frame identification processing on data outside the predetermined storage area.

2. The relay device according to claim 1, wherein: The predetermined storage area is an area from the end of the data segment including the first frame and the inherent data to a predetermined data length.

3. The relay device according to claim 2, wherein: The predetermined data length is a length greater than or equal to the data length of the inherent data.

4. The relay device according to any one of claims 1 to 3, wherein: The inherent data is data indicating the validity of data, and can be set to any numerical value.

5. A communication network system comprising: A first electronic control device connected to a first communication network; a second electronic control device connected to a second communication network using a communication protocol different from that of the first communication network; and a relay device connected to the first communication network and the second communication network, receiving a second frame storing at least one first frame, The first frame is sent under the first communication network, The first frame has a first payload including control information, a first data ID for identifying the control information, and a data length code indicating a data length of the first payload, The second frame is sent under the second communication network, The second frame includes a plurality of the first frames, a second data ID indicating that the first frames are included, a data length code indicating the data length of the second frame, and inherent data stored in a predetermined storage area located behind the first frame. The relay device determines the end of the data segment of the second frame based on the data length code of the second frame, thereby determining the prescribed storage area for the inherent data. When the relay device identifies the first frame in the second frame based on the data length code, the relay device identifies the first frame by not performing frame identification processing on data in the predetermined storage area but performing frame identification processing on data outside the predetermined storage area.

6. A communication control method, performed by a relay device connected between a first communication network and a second communication network having a communication protocol different from that of the first communication network, wherein: receiving a second frame from the second communication network, the second frame having a plurality of first frames, a second data ID indicating the inclusion of the first frames, a data length code indicating the data length of the second frame, and inherent data stored in a prescribed storage area located at a position later than the first frame, the first frame having a first payload including control information, a first data ID for identifying the control information, and a data length code indicating the data length of the first payload, determining the end of the data segment of the second frame based on the data length code of the second frame, thereby determining the prescribed storage area of ​​the inherent data, When identifying the first frame in the second frame based on the data length code, the first frame is identified by not performing frame identification processing on data in the prescribed storage area but performing frame identification processing on data outside the prescribed storage area, The identified first frame is sent to the first communication network.