The present invention relates to a communication device and to a data communication method for transmitting and receiving data among electronic control units mounted on a vehicle.
Data transmitted and received among electronic control units is provided with identification information for identifying, for example, data contents and transmitting nodes. Due to improved functionality, etc., of on-board systems, identification information attached to data transmitted and received among electronic control units is increasing. In addition, there is a restriction that the totality of identification information that each channel forming a node can receive is limited in a communication device built into the electronic control unit. Thus, as described in Patent Document 1, a technique for integrally using multiple channels provided in a communications interface to receive data including a number of pieces of identification information that cannot be received on a single channel has been proposed.
Data transmitted from one channel of the communications interface flows through a communication bus forming an in-vehicle network and is communicated to all channels connected to the communication bus. For example, for mirroring, a communication device needs to receive and process data from the communication bus, as it is transmitted to the communication bus by the communication device. However, there are cases in which the communication device receives data provided with the same identification information as that of the data transmitted to the communication bus, from other communication devices. Whether the data is one that has been transmitted to the communication bus or one that has been transmitted from other communication devices cannot be distinguished, thereby making it difficult to process the data appropriately.
An object of the present invention is thus to provide a communication device and a data communication method that, with respect to data provided with the same identification information, can identify whether the data has been transmitted from the node of the communication device or has been transmitted from the node of another communication device.
A communication device includes at least one transmission buffer and at least one reception buffer. The communication device transmits data provided with identification information from the transmission buffer to a communication bus, receives the data flowing through the communication bus, and stores the data in the reception buffer. With respect to the data stored in the reception buffer, the communication device recognizes, and processes accordingly, the data transmitted from its own node.
According to the present invention, the communication device can identify whether data provided with the same identification information has been transmitted from its own node or has been transmitted from the node of another device.
Hereinafter, an embodiment for implementing the present invention will be described in detail with reference to the accompanying drawings.
Here, CAN bus 200 is an example of a communication bus. However, the communication bus is not limited to CAN bus 200, and may also be any well-known bus such as Local Interconnect Network (LIN) bus and FlexRay® bus. In the example of the in-vehicle network shown in
As an example of data provided with identification information, a data frame DF or a remote frame RF used in a CAN protocol is transmitted and received among multiple electronic control units 100.
As shown in
SOF indicates the start of data frame DF. ID is used to identify data contents and transmitting nodes and to indicate a priority of communication arbitration. RTR is used to distinguish data frame DF and remote frame RF. The control field includes Identifier Extension (IDE), reserved bit r, and Data Length Code (DLC) that indicates how many bytes of data are transmitted in the data field. The data field is used to store the body of data transmitted. CRC field includes a CRC sequence to determine whether the data was successfully received and a CRC delimiter that indicates the end of the CRC sequence. ACK field includes an ACK slot and an ACK delimiter that indicates the end of the ACK slot. EOF field indicates the end of data frame DF. Data frame DF shown in
Remote frame RF is used to request data frame DF and includes SOF, ID, RTR, a control field, a CRC field, an ACK field, and EOF, as shown in
As shown in
Microcontroller 140 includes a buffer module 140A, a non-volatile memory 140B, a volatile memory 140C, and an internal bus 140D for connecting them in a mutually communicable manner.
The communications interface of buffer module 140A has a plurality of channels CH_1 to CH_N (N: two or more natural numbers) that function as a node. Here, the number of channels incorporated in buffer module 140A can be set appropriately, taking into consideration, for example, devices to be controlled by electronic control unit 100 and the number of electronic control units 100 mounted on the vehicle.
Channel CH_1 has at least one transmission buffer Tx and at least one reception buffer Rx. In addition, channels CH_2 to CH_N each have at least one reception buffer Rx. In the example shown in
In channel CH_i, an ID attached to data to be received by each reception buffer Rxi j) is predefined according to a reception rule table RTBL (details of which will be described below) that is associated with channel CH_i in a one-to-one manner. That is, reception buffers Rxi (j) are each allocated to respective ID of data. Here, at least some of reception buffers Rxi (j) of channel CH_i may be configured to receive multiple data with different IDs exceeding the number of reception buffers Rxi ( ) by a mask process using a wildcard.
Nonvolatile memory 140B includes, for example, flash Read Only Memory (ROM) or Electrically Erasable Programmable Read Only Memory (EEPROM) that can retain data even when the power supply is cut off, and stores one configuration table CTBL and a plurality of reception rule tables RTBLs. Here, configuration table CTBL and each reception rule table RTBL stored in nonvolatile memory 140B are respectively examples of a second table and a first table.
Volatile memory 140C includes, for example, Dynamic Random Access Memory (DRAM) or Static Random Access Memory (SRAM) that loses data when the power supply is cut off, and stores buffers A and B and a First In, First Out (FIFO) buffer which transfer and temporarily store the data stored in reception buffers Rxi of buffer module 140A. Here, the number of the buffers and FIFO buffers stored in volatile memory 140C can be changed appropriately according, for example, to the control content of the control target device.
CAN transceiver 160, which is a bus interface Integrated Circuit (IC) used to connect microcontroller 140 to other microcontrollers, for example, generates and adjusts bus transmission voltage, ensures an operating current, and protects a wiring. A data input port of CAN transceiver 160 is connected to transmission buffer Tx1 of channel CH_1 in buffer module 140A. A data output port of CAN transceiver 160 is connected to all reception buffers Rx1 to RxN of channels CH_1 to CH_N in buffer module 140A. Two ports for serial communication of CAN transceiver 160 are respectively connected to communication lines CAN_H and CAN_L of CAN bus 200.
Accordingly, by integrally using reception buffers Rx1 to RxN of multiple channels CH_1 to CH_N, buffer module 140A can receive data including a number of IDs that cannot be received on a single channel CH_i. For example, if one channel CH_i can receive data including 128 IDs, data with 128×N different IDs can be received by integrally using N channels.
Reception rule tables RTBLs stored in non-volatile memory 140B are each provided for corresponding channel CH_i of buffer module 140A. In each reception rule table RTBL, as shown in
The reception rule table RTBL shown in
Configuration table CTBL stored in non-volatile memory 140B is used to enable data provided with the same ID as that of the transmitted data to be recognized, for mirroring or other purposes. In configuration table CTBL, as shown in
In the first record of configuration table CTBL shown in
Communication device 120 of electronic control unit 100 sets reception rule table RTBL by referring to configuration table CTBL at the time of initialization when communication device 120 is started up.
How communication device 120 sets reception rule table RTBL using configuration table CTBL shown in
In such a communication device 120, when, for example, transmitting data provided with ID “0x100” from electronic control unit 100 to CAN bus 200, a microcomputer, which is not shown in the drawings, stores the data in transmission buffer Tx1 of channel CH_1 of buffer module 140A. Once the data is stored in transmission buffer Tx1, buffer module 140A sends the data in transmission buffer Tx1 out to the data input port of CAN transceiver 160 and clears transmission buffer Tx1 through a hardware process. After receiving the data, CAN transceiver 160 sends the data received from microcontroller 140 out to CAN bus 200 through the two ports for serial communication while converting the data into a protocol compatible with CAN bus 200.
The data sent out to CAN bus 200 flows through CAN bus 200 and is communicated to communication devices 120 of all electronic control units 100 connected to CAN bus 200. Specifically, CAN transceiver 160 connected to CAN bus 200 sends out, from the data output port, the data received from CAN bus 200 to all reception buffers Rx1 to RxN of channels CH_1 to CH_N while converting the data to a protocol compatible with microcontroller 140.
Buffer module 140A refers to the multiple reception rule tables RTBLs stored in non-volatile memory 140B and stores data into the corresponding reception buffer Rx according to the reception rules defined therein. This process will be described using a specific example. When the ID of the received data is “0x100”, referring to reception rule tables RTBLs shown in
At this time, buffer module 140A can identify whether the received has been transmitted from the node of the communication device or has been transmitted from the node of another communication device by referring to the reception ID and the transmitting node in the reception rule tables RTBLs shown in
Identification process will be described using the reception rule tables RTBLs shown in
Therefore, when having received data provided with the same ID as that of the transmitted data, communication device 120 can identify whether the received data has been transmitted from the node of the communication device or has been transmitted from the node of another communication device by referring to reception rule tables RTBLs. Communication device 120 can thus process the received data appropriately according to the identification result.
When no mirroring is required in electronic control unit 100, even if communication device 120 receives data provided with the same ID as that of the data transmitted therefrom, the received data is not used for controlling the control target device, and accordingly, the resources may not be utilized effectively. Therefore, as shown in FIG. 8, a data discard circuit 180 that discards data from CAN transceiver 160 during data transmission may be disposed on the two lines connecting buffer module 140A of microcontroller 140 and CAN transceiver 160. That is, data discard circuit 180 may be disposed between transmission buffer Tx1 and reception buffers Rx1 to RxN, and CAN bus 200. Desirably, data discard circuit 180 is, for example, a dedicated IC to reduce the processing load on the microcomputer of electronic control unit 100.
As shown in
By adding data discard circuit 180, the data, which is to be transmitted from CAN transceiver 160 to reception buffers Rx1 to RxN of channels CH_1 to CH_N, is discarded while data is being transmitted from transmission buffer Tx1 of channel CH_1 in buffer module 140A. Thus, when no mirroring is required, communication device 120 does not receive data for mirroring that is not subject to the processing, and thereby reception buffers Rx1 to RxN of buffer module 140A can be used effectively. In order to switch data discard circuit 180 to be effective or ineffective, a switching function such as a mechanical or software switch, for example, may be provided.
When multiple data have been stored in the FIFO buffer by a mask process and certain data is to be used, the microcomputer of electronic control unit 100 needs to scan the FIFO buffer and select data by an application program. In addition, the microcomputer of electronic control unit 100 needs to scan data at a certain period to avoid the FIFO buffer becoming full and being unable to store data. Thus, the processing load required for scanning the FIFO buffer is further applied to the microcomputer of electronic control unit 100. Buffer unit 120A of communication device 120 may transfer the data stored in reception buffer Rx to a virtual storage using Direct Memory Access (DMA); however, the same problem as with the FIFO buffer occurs.
Therefore, as shown in
This makes it possible to optimize the data scanning frequency and scanning target by, for example, shortening the FIFO buffer scanning cycle for data with a short reception cycle and lengthening the FIFO buffer scanning cycle for data with a long reception cycle. In addition, as for data used for a specific function, scanning of irrelevant data not used for that function can be avoided by scanning the FIFO buffer at a cycle set in consideration of the function of the data, etc. The scanning frequency and scanning target can thereby be optimized. Optimizing the data scanning frequency and scanning target can make it possible to avoid the FIFO buffer becoming full and unable to store data and to reduce the processing load on the microcomputer of electronic control unit 100.
Therefore, according to communication device 120 of the present embodiment, microcontroller 140 itself does not necessarily have to be one having high functionality and surplus resources, but resources of microcontroller 140 can be utilized to increase the number of IDs that can be received.
One skilled in the art would readily understand that a new embodiment can be made by omitting, appropriately combining, or replacing a part of a variety of technical ideas of the above embodiment.
As an example, not only buffer module 140A, but each channel CH_1 to CH_N having received data may store the received data into the buffers or the FIFO buffer.
In addition, buffer module 140A may refer to configuration table CTBL shown in
Furthermore, reception rule tables RTBLs shown in
Number | Date | Country | Kind |
---|---|---|---|
2021-097917 | Jun 2021 | JP | national |
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/JP2022/020722 | 5/18/2022 | WO |