Relay device and program
The relay device optimizes communication by converting protocols and selecting routes based on message and line status, addressing inefficiencies in conventional technologies and enhancing communication reliability and efficiency.
Patent Information
- Application Number
- JP2024053294
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-03-28
- Publication Date
- 2025-10-09
AI Technical Summary
Conventional technologies struggle with efficiently utilizing multiple transmission lines with different protocols due to fixed protocol usage on each line, limiting their application in networks with varying communication speeds.
A relay device equipped with a protocol conversion unit and a route selection unit that converts between different protocols and selects optimal routes based on message characteristics and line status to efficiently utilize multiple transmission lines.
The relay device efficiently performs diagnostic communication by selecting appropriate routes, improving communication reliability and efficiency by handling large and small messages, and ensuring seamless communication even when lines become unavailable.
Smart Images

Figure 2025151731000001_ABST
Abstract
Description
[Technical Field]
[0001] The present disclosure relates to a technique for relaying between networks with different protocols. [Background technology]
[0002] In an in-vehicle system, Ethernet is used to connect an external tool such as a diagnostic device to a relay device, and Ethernet and CAN may be used together to connect multiple electronic control units (hereinafter referred to as ECUs) to the relay device. CAN and Ethernet are registered trademarks. For example, DoIP is known as an example of diagnostic communication over Ethernet, and DoCAN is known as an example of diagnostic communication over CAN.
[0003] DoIP can send large amounts of data at high speed, but has the advantage of slow response when sent via TCP / IP. On the other hand, DoCAN can send small amounts of data at a time, but has the advantage of fast response.
[0004] When using an external tool to perform diagnostic communication with an ECU connected to CAN, it is necessary to convert between DoIP and DoCAN, and due to the speed difference between DoIP and CAN, DoCAN is limited by the CAN communication speed.
[0005] The following Patent Document 1 describes a technology that has a plurality of communication paths including CAN and Ethernet, and switches the communication paths depending on the security required for communication. [Prior art documents] [Patent documents]
[0006] [Patent Document 1] Japanese Patent Application Laid-Open No. 2015-50775 Summary of the Invention [Problem to be solved by the invention]
[0007] However, after detailed investigation by the inventors, it was found that the conventional technology involves switching between multiple types of communication paths with different protocols set up on the same transmission line, and therefore cannot be applied to networks in which the protocol used for each transmission line is fixed.
[0008] One aspect of the present disclosure provides a technique for efficiently utilizing each transmission line in a relay device to which a plurality of transmission lines using different protocols are connected. [Means for solving the problem]
[0009] One aspect of the present disclosure is a relay device that relays data between multiple electronic devices, and includes a protocol conversion unit (21) and a route selection unit (23). The protocol conversion unit is configured to convert between a first protocol used for communication with a first electronic device (4) and a second protocol used for communication with a second electronic device (3). The route selection unit relays a communication message from the first electronic device, the destination of which is a second electronic device connected via multiple physical or logical routes. During the relay, the route selection unit is configured to select one of multiple routes to use based on at least one of the characteristics of the communication message and the status of the multiple routes, and to transmit the message to the second electronic device using the selected route.
[0010] With this configuration, it is possible to efficiently utilize a plurality of transmission lines using different protocols. One aspect of the present disclosure is a program for causing a computer to function as a relay device (2) that relays data between multiple electronic devices. The relay device includes a protocol conversion unit (21) and a path selection unit (23).
[0011] By executing such a program, it is possible to obtain the same effect as the relay device described above. [Brief explanation of the drawings]
[0012] [Figure 1]FIG. 1 is a block diagram showing a configuration of an in-vehicle system. [Figure 2] FIG. 2 is an explanatory diagram showing a protocol configuration. [Figure 3] 4 is a flowchart of a route selection process in the first embodiment. [Figure 4] 10 is a flowchart of a delayed transmission process. [Figure 5] FIG. 10 is a sequence diagram showing an operation when a diagnostic message is transmitted from an external tool to an ECU. [Figure 6] 10 is a flowchart of a route selection process in the second embodiment. [Figure 7] FIG. 11 is an explanatory diagram illustrating the contents of a determination condition table used in the third embodiment. [Figure 8] 10 is a flowchart of a route selection process in the third embodiment. DETAILED DESCRIPTION OF THE INVENTION
[0013] Hereinafter, embodiments of the present disclosure will be described with reference to the drawings. [1. First embodiment] [1-1.Configuration] The in-vehicle system 1 of this embodiment is mounted on a vehicle. The vehicle may have an automatic driving function in addition to a manual driving function. The vehicle may be a hybrid vehicle having an engine and an electric motor as a driving source. The vehicle is not limited to a vehicle having an automatic driving function or a hybrid vehicle, but may be a vehicle having only a manual driving function, or a vehicle having only an engine or only an electric motor as a driving source. Hereinafter, a vehicle equipped with the in-vehicle system 1 will be simply referred to as a vehicle.
[0014] 1, the in-vehicle system 1 includes a relay device 2 and a plurality of electronic control units (hereinafter referred to as ECUs) 3. ECU is an abbreviation for Electronic Control Unit. The relay device 2 has an external connection terminal T0 to which an external tool 4 is attached or detached. The relay device 2 is connected to a plurality of ECUs 3 via two physical transmission lines B1 and B2, respectively. The transmission lines B1 and B2 use different protocols for communication.
[0015] In the following, the protocol used for communication between the relay device 2 and the external tool 4 is referred to as a first protocol, and the protocol used for communication between the relay device 2 and the ECU 3 is referred to as a second protocol. That is, in this embodiment, there are two types of second protocols.
[0016] Furthermore, a protocol used for diagnostic communication between the relay device 2 and the external tool 4, and between the relay device 2 and the ECU 3, is called an upper protocol. A protocol at a layer below the upper protocol, which is used for connection to enable communication by the upper protocol between the relay device 2 and the external tool 4, and between the relay device 2 and the ECU 3, is called a lower protocol.
[0017] As shown in Fig. 2, in this embodiment, the first upper protocol is UDS and DoIP, and the first lower protocol is TCP, IP, and Ethernet. Ethernet is a registered trademark. UDS is an abbreviation for Unified Diagnostic Services, which is a unified diagnostic service for automobiles standardized by ISO14229. DoIP is an abbreviation for Diagnostics over Internet Protocol, which is an Ethernet-based diagnostic protocol standardized by ISO13400.
[0018] The second protocol used in the transmission line B1 connecting the relay device 2 and each ECU 3 has a lower protocol of TCP / UDP, IP, and Ethernet, and an upper protocol of UDS and any other protocol. Hereinafter, the transmission line B1 will also be referred to as a UDS / Ethernet bus.
[0019] The second protocol used in the transmission line B2 connecting the relay device 2 and each ECU 3 has an upper protocol of UDS and DoCAN, and a lower protocol of CAN. CAN is an abbreviation for Controller Area Network and is a registered trademark. DoCAN is an abbreviation for Diagnostic communication over Controller Area Network and is a CAN-based diagnostic protocol standardized by ISO15765. Hereinafter, the transmission line B2 will also be referred to as a DoCAN bus.
[0020] The term "any" in the context of the upper protocol of the UDS / Ethernet bus B1 means that any protocol can be used as the protocol connecting the UDS and the lower protocol. In this embodiment, one or more UDS messages are packaged in data transmitted and received in frames of the lower protocol transmitted and received via the UDS / Ethernet bus B1.
[0021] Returning to FIG. 1, the relay device 2 is an electronic control device mainly configured with a microcomputer including a CPU 2a, a ROM 2b, a RAM 2c, etc. Various functions of the microcomputer are realized by the CPU 2a executing a program stored in a non-transitory tangible recording medium. In this example, the ROM 2b corresponds to the non-transitory tangible recording medium storing the program. Furthermore, the execution of this program executes a method corresponding to the program. Note that some or all of the functions executed by the CPU 2a may be configured as hardware using one or more ICs, etc. Furthermore, the number of microcomputers constituting the relay device 2 may be one or more.
[0022] [1-2. Functional configuration of relay device] The functional configuration of the relay device 2 will be described. Each of the ECUs 3 is assigned a logical address LA for identifying the device that is the target of diagnostic communication in the upper protocol. In this embodiment, one of the two ECUs 3 is assigned LA=AA, and the other is assigned LA=BB.
[0023] The relay device 2 includes a protocol conversion unit 21, a message storage unit 22, and a route selection unit 23 as functional blocks that are realized by the CPU 2a or the like executing a program stored in the ROM 2b or the like.
[0024] The protocol conversion unit 21 performs protocol conversion on a diagnostic message transmitted and received between the external tool 4 and the ECU 3. The protocol conversion unit 21 includes a first conversion unit 211 and a second conversion unit 212.
[0025] The first conversion unit 211 generates one or more UDS messages from a DoIP message received from the external tool 4. The first conversion unit 211 further generates a UDS / Ethernet message by combining one or more UDS messages into one message within the data length allowed by the UDS / Ethernet bus B1, and transmits the UDS / Ethernet message to the ECU 3 via the UDS / Ethernet bus B1. The first conversion unit 211 also generates a DoIP message to be transmitted to the external tool 4 from the UDS / Ethernet message received from the ECU 3 via the UDS / Ethernet bus B1.
[0026] The second conversion unit 212 generates one or more DoCAN messages from the DoIP messages received from the external tool 4 and transmits them to the ECU 3 via the DoCAN bus B2. The second conversion unit 212 also generates a DoIP message to be transmitted to the external tool 4 from the DoCAN message received from the ECU 3 via the DoCAN bus B2. The reason the second conversion unit 212 generates one or more DoCAN messages from the DoIP messages is that the amount of data that can be transmitted in one frame is smaller in DoCAN messages than in DoIP messages. The data length of one frame is up to 8 bytes in CAN, which is a lower-level protocol of DoCAN, and up to 1500 bytes in Ethernet, which is a lower-level protocol of DoIP. If Ethernet supports jumbo frames, the data length of one frame is up to 9216 bytes.
[0027] The message storage unit 22 temporarily stores a diagnostic message (i.e., a DoIP message) received from the external tool 4. The stored diagnostic message is transmitted to the ECU 3 via the protocol conversion unit 21 when a preset transmission condition is met.
[0028] The route selection unit 23 selects the route to be used for transmitting the diagnostic message depending on the characteristics of the DoIP message received from the external tool 4 and the communication status of the UDS / Ethernet bus B1 and the DoCAN bus B2, and performs route selection processing to transmit the message to the ECU 3 using the selected route.
[0029] There are first to third routes R1 to R3 as selectable routes. The first route R1 is a route in which the DoIP message is converted into a UDS / Ethernet message by the first conversion unit 211 and transmitted to the ECU 3 via the UDS / Ethernet bus B1. The second route R2 is a route in which the DoIP message is converted into a series of DoCAN messages by the second conversion unit 212 and transmitted sequentially to the ECU 3 via the DoCAN bus B2. The third route R3 is a route in which the DoIP message is temporarily stored in the message storage unit 22, and when a transmission condition is met, the stored DoIP message is converted into a series of DoCAN messages by the second conversion unit 212 and transmitted sequentially to the ECU 3 via the DoCAN bus B2. In other words, the third route R3 is a route in which transmission to the ECU 3 is delayed by passing through the message storage unit 22.
[0030] Regardless of which of the first to third routes R1 to R3 is used, the same logical address LA is set as the destination address of a diagnostic message addressed to the same ECU 3. In other words, each ECU 3 does not need to prepare a different logical address LA for each route.
[0031] The transmission condition may be, for example, input of a command by the vehicle user to turn off the power supply of the vehicle, and therefore the power supply of the relay device 2. In this case, before the power supply is actually turned off, the diagnostic message stored in the message storage unit 22 is transmitted. Alternatively, the transmission condition may be detection of a situation in which there is a low possibility of communication requiring real-time performance.
[0032] [1-2. Route selection process] Next, the route selection process executed by the route selection unit 23 will be described with reference to the flowchart of FIG.
[0033] The route selection process is initiated when the relay device 2 receives a DoIP message from the external tool 4. In S110, the route selection unit 23 determines whether the message length ML of the DoIP message received from the external tool 4 is greater than the first specified length L1 and less than or equal to the second specified length L2, i.e., whether L2≧ML>L1. If the route selection unit 23 determines yes, it proceeds to S130, and if it determines no, it proceeds to S120.
[0034] In S120, the route selection unit 23 determines whether the message length ML is equal to or less than the first specified length L1, i.e., whether ML≦L1. If the route selection unit 23 determines yes, the process proceeds to S140, and if the route selection unit 23 determines no, i.e., if ML>L2, the process proceeds to S150.
[0035] The first specified length L1 is set to a value such that the time required to transfer a DoIP message having a data length of L1 or more to an ECU 3 is shorter when using the first route R1 than when using the second route R2. The second specified length L2 is set to a value such that when transfer of a DoIP message having a data length of L2 or more is started via the first route R1, a delay exceeding an allowable value may occur in diagnostic communication with another ECU 3.
[0036] In S130, the route selection unit 23 selects the first route R1 as the transmission route for the DoIP message, executes protocol conversion and transmission using the first route R1, and ends the process. In S140, the route selection unit 23 selects the second route R2 as the transmission route for the DoIP message, executes protocol conversion and transmission using the second route R2, and ends the process.
[0037] In S150, the route selection unit 23 selects the third route R3 as the transmission route for the DoIP message. The route selection unit 23 temporarily stores the DoIP message in the message storage unit 22 so that transmission is performed using the third route R3, and transmits a response message to the external tool 4 instead of the destination ECU 3, and then ends the process.
[0038] [1-3.Delayed transmission processing] The delayed transmission process executed by the route selection unit 23 will be described with reference to the flowchart shown in Fig. 4. The delayed transmission process is repeatedly executed while the message storage unit 22 stores an unsent DoIP message.
[0039] In S210, the route selection unit 23 determines whether or not the transmission condition is met, and if the transmission condition is met, the process proceeds to S220, and if the transmission condition is not met, the process ends.
[0040] In S220, the path selection unit 23 reads out the DoIP message temporarily stored in the message storage unit 22, converts it into a series of DoCAN messages in the second conversion unit 212, and sequentially transmits them to the ECU 3 using the DoCAN bus B2, thereby completing the processing.
[0041] [1-4. Operation] The operation when transmitting a diagnostic message from the external tool 4 to the ECU 3 will be described with reference to the sequence diagram shown in FIG.
[0042] In S10, the external tool 4 transmits to the relay device 2 a request message, which is a diagnostic message conforming to DoIP. Upon receiving the request message, the relay device 2 executes a route selection process in S11.
[0043] If the first route R1 is selected as a result of the route selection process, in S11, the relay device 2 executes protocol conversion in the first conversion unit 211 to generate a UDS / Ethernet message (hereinafter, a protocol-converted request message). Then, in S13, the relay device 2 transmits the protocol-converted request message to the ECU 3 via the UDS / Ethernet bus B1. In this case, one or more UDS messages are packaged in the request message.
[0044] In step S14, the ECU 3 receives the request message via the UDS / Ethernet bus B1 and transmits a response message to the request message to the relay device 2 via the UDS / Ethernet bus B1.
[0045] In S15, the relay device 2, which has received the response message from the ECU 3, converts the protocol of the received response message from UDS / Ethernet format to DoIP format. Then, in S16, the relay device 2 transmits the protocol-converted response message to the external tool 4.
[0046] If the second route R2 is selected as a result of the previous route selection process, in S17 the relay device 2 performs protocol conversion in the second conversion unit 212 to generate a series of DoCAN messages (hereinafter referred to as protocol-converted request messages). Then, in S18, the relay device 2 transmits the protocol-converted request messages to the ECU 3 via the DoCAN bus B2.
[0047] In S19, the ECU 3 receives the request message via the DoCAN bus B2 and transmits a response message to the request message to the relay device 2 via the DoCAN bus B2.
[0048] In step S20, the relay device 2 converts the protocol of the received response message from the ECU 3 from the DoCAN format to the DoIP format. Then, in step S21, the relay device 2 transmits the protocol-converted response message to the external tool 4.
[0049] The processes of S18 to S21 are repeatedly executed the same number of times as the number of DoCAN messages generated in S17. If the third route R3 is selected as a result of the previous route selection process, the relay device 2 temporarily stores the received request message (i.e., DoIP message) in the message storage unit 22 in S22. Furthermore, the relay device 2 transmits a DoIP format response message to the external tool 4 on behalf of the destination ECU 3 in S23. Thereafter, the relay device 2 waits in S24 until the transmission condition is met.
[0050] When the transmission condition is met, the relay device 2 performs protocol conversion in the second conversion unit 212 in S25 to generate a series of DoCAN messages (hereinafter, protocol-converted request messages). Then, in S26, the relay device 2 transmits the protocol-converted request messages to the ECU 3 via the DoCAN bus B2.
[0051] In S27, the ECU 3 receives the request message via the DoCAN bus B2 and transmits a response message to the request message to the relay device 2 via the DoCAN bus B2.
[0052] In this case, the relay device 2 that received the response message does not transfer the response message to the external tool 4 because it has already transmitted the response message to the external tool 4 by proxy in S23.
[0053] The processes of S25 to S27 are repeated the same number of times as the number of DoCAN messages generated in S25. [1-5. Terminology] In this embodiment, the external tool 4 corresponds to the first electronic device of the present disclosure, and the ECU 3 corresponds to the second electronic device of the present disclosure. In this embodiment, the first path R1 and the second path R2 correspond to the physical path of the present disclosure, and the third path R3 corresponds to the logical path and delay path of the present disclosure. In this embodiment, the diagnostic messages (i.e., DoIP messages and DoCAN messages) correspond to the communication messages of the present disclosure. In this embodiment, the second designated length L2 corresponds to the designated length of the present disclosure, and the DoCAN bus B2 corresponds to the designated bus of the present disclosure.
[0054] [1-6.Effects] According to the first embodiment described above in detail, the following effects are achieved. (1a) When relaying a diagnostic message from the external tool 4 to the ECU 3, the relay device 2 selects the first route R1 using the UDS / Ethernet bus B1 if the message is large, with the message length ML being L2≧ML>L1. Also, if the message is small, with the message length ML being ML≦L1, the relay device 2 selects the second route R2 using the DoCAN bus B2. Therefore, the relay device 2 can efficiently perform diagnostic communication between the external tool 4 and the ECU 3.
[0055] (1b) In the case of a large-scale message (i.e., ML>L2) that may affect other communications, the relay device 2 selects the third route R3 for temporarily storing the diagnostic message. Then, when a situation is detected in which the possibility of affecting other communications is low, the relay device 2 transmits the diagnostic message to the ECU 3. Therefore, the relay device 2 can improve the reliability of communications.
[0056] (1c) When the third route R3 is used, the relay device 2 returns a response message to the external tool 4 instead of the destination ECU 3. Therefore, when communication via the third route R3 is selected, the relay device 2 can prevent the external tool 4 from waiting for a response from the ECU 3, which would disable communication with other ECUs 3, thereby improving communication efficiency.
[0057] [2. Second Embodiment] [2-1. Differences from the first embodiment] The second embodiment has the same basic configuration as the first embodiment, so differences will be described below. Note that the same reference numerals as those in the first embodiment indicate the same configuration, and reference will be made to the preceding description.
[0058] In the first embodiment described above, route selection is performed according to the message length ML of the DoIP message received from the external tool 4. In contrast, the second embodiment differs from the first embodiment in that route selection is performed according to the status of the transmission lines B1 and B2 connecting the relay device 2 and the ECU 3.
[0059] [2-2. Processing] Next, a route selection process that the route selection unit 23 of the second embodiment executes in place of the route selection process of the first embodiment shown in FIG. 3 will be described with reference to the flowchart of FIG.
[0060] The route selection process is initiated when the relay device 2 receives a DoIP message from the external tool 4, as in the first embodiment. In S310, the path selection unit 23 determines whether the UDS / Ethernet bus B1 is capable of communication, and if so, proceeds to S330. If not, proceeds to S320. The determination of whether the UDS / Ethernet bus B1 is capable of communication may be made using, for example, link down, which is one type of information provided by an Ethernet driver. Alternatively, ICMP, a protocol used to check the communication status in a network using TCP / IP, may be used. ICMP stands for Internet Control Message Protocol.
[0061] In S320, the path selection unit 23 determines whether the DoCAN bus B2 is available for communication, and if so, proceeds to S340. If not, proceeds to S350. To determine whether the DoCAN bus B2 is available for communication, for example, bus off, which is one of the pieces of information provided by the CAN driver, may be used.
[0062] In S330, the route selection unit 23 selects the first route R1 as the transmission route for the DoIP message, executes protocol conversion and transmission using the first route R1, and ends the process. In S340, the route selection unit 23 selects the second route R2 as the transmission route for the DoIP message, executes protocol conversion and transmission using the second route R2, and ends the process.
[0063] In S350, the route selection unit 23 executes an abnormality measure, such as notifying the external tool 4 that communication with the ECU 3 is not possible, and then ends the process. The abnormality measure may include a process of temporarily storing the DoIP message in the message storage unit 22 so that the DoIP message can be transmitted via the third route R3.
[0064] 4, the transmission condition may include that either the UDS / Ethernet bus B1 or the DoCAN bus B2, which are physical paths, becomes communicable. In this case, the DoIP message stored in the message storage unit 22 is transmitted to the ECU 3 using the physical path that has become communicable, after converting the protocol according to the path to be used.
[0065] [2-3. Effects] According to the second embodiment described above in detail, the effect (1c) of the first embodiment described above is achieved, and further, the following effect is achieved.
[0066] (2a) According to this embodiment, even if either the UDS / Ethernet bus B1 or the DoCAN bus B2 becomes unable to communicate, communication with the ECU 3 can still be performed, thereby improving the reliability of communication.
[0067] 3. Third Embodiment [3-1. Differences from the first embodiment] The second embodiment has the same basic configuration as the first embodiment, so differences will be described below. Note that the same reference numerals as those in the first embodiment indicate the same configuration, and reference will be made to the preceding description.
[0068] In the first and second embodiments described above, route selection is performed based on a single condition, namely, the data length or the state of the transmission lines B1 and B2. In contrast, the third embodiment differs from the first and second embodiments in that route selection is performed based on a combination of multiple conditions.
[0069] [3-2. Processing] The route selection process that the route selection unit 23 of the third embodiment executes in place of the route selection process of the first embodiment shown in FIG. 3 will be described with reference to the condition determination table of FIG. 7 and the flowchart of FIG.
[0070] As shown in Figure 7, the condition determination table shows, linked to a case number, the conditions used for route selection and route priority information indicating the priority of the first route R1, the second route R2, and the third route R3 when the conditions are met.
[0071] In this embodiment, a case where seven conditions are used will be described. The condition in Case 1 is that the specific identifier is A. The specific identifier may be, for example, an SID used to identify services in UDS, or a DID used to identify data in UDS. In addition to SID and DID, the specific identifier may be a logical address used to identify devices in UDS, a TCP / UDP port number, an IP address, a MAC address, etc. When the condition in Case 1 is met, the first route R1 is assigned medium priority, the second route R2 is assigned high priority, and the third route R3 is assigned on hold.
[0072] The condition in case 2 is that the specific identifier is B. When the condition in case 2 is met, the first route R1 is assigned high priority, the second route R2 is assigned medium priority, and the third route R3 is assigned on hold. The condition for Case 3 is that the CAN bus utilization rate is below a specified value, i.e., the CAN bus is not congested. If the condition for Case 3 is met, the first route R1 is assigned medium priority, the second route R2 is assigned high priority, and the third route R3 is assigned on hold.
[0073] The condition in Case 4 is that the message length ML of the DoIP message received from the external tool 4 is greater than the first specified length L1. L1 is the same as in the first embodiment. If the condition in Case 4 is met, the first route R1 is assigned high priority, the second route R2 is assigned medium priority, and the third route R3 is assigned on hold.
[0074] The condition in Case 5 is that the message length of the DoIP message received from the external tool 4 is greater than the second specified length L2. L2 is the same as in the first embodiment. If the condition in Case 5 is met, the first route R1 has a medium priority, the second route R2 has a low priority, and the third route R3 has a high priority.
[0075] The condition in Case 6 is that the UDS / Ethernet bus B1 is in a state where communication is not possible. The determination of whether the UDS / Ethernet bus B1 is in a state where communication is not possible is the same as that described in the second embodiment. When the condition in Case 6 is met, the first route R1 is not available, and the second route R2 and the third route R3 are on hold.
[0076] The condition in Case 7 is that the DoCAN bus B2 is in a state where communication is not possible. The determination of whether the DoCAN bus B2 is in a state where communication is not possible is the same as that described in the second embodiment. When the condition in Case 7 is met, the first route R1 and the third route R3 are reserved, and the second route R2 is not available.
[0077] The conditions of cases 1 to 7 are arranged so that the smaller the case number, the lower the importance, and the larger the case number, the higher the importance. Each condition is judged in the order of cases 1 to 7, and if a condition is met, the route priority information associated with the met condition is overwritten in the priority information register. However, for routes whose priority is reserved, the information already written is not overwritten and the information is maintained.
[0078] After all cases 1 to 7 have been determined, one of the first route R1, the second route R2, and the third route R3 is selected according to the information finally indicated in the priority information register. Note that routes that remain reserved until the end are deemed unusable. Then, the route indicated as having the highest priority is selected.
[0079] For example, if Case 4 and Case 6 are true, the final values of the priority information register will be such that the first route R1 is unavailable, the second route R2 is medium priority, and the third route R3 is unavailable due to being reserved until the end, so the second route R2 will be selected.
[0080] The route selection process using the condition determination table will be explained with reference to the flowchart of FIG. In S410, the route selection unit 23 sets the parameter m indicating the case number to 1, and initializes the contents of the priority information register to a value indicating suspension for all routes.
[0081] In S420, the path selection unit 23 refers to the condition determination table and determines whether the condition of case m is met. If the path selection unit 23 determines that the condition of case m is met, the process proceeds to S430, and if the path selection unit 23 determines that the condition is not met, the process proceeds to S440.
[0082] In S430, the route selection unit 23 overwrites the route priority information of case m in the priority information register. In S440, the parameter m indicating the case number is incremented by one.
[0083] In S450, the path selection unit 23 determines whether m exceeds the upper limit value M of the case number shown in the condition determination table (i.e., M=7 in this embodiment), and if m>M, proceeds to S460, and if m≦M, returns to S420.
[0084] In S460, the route selection unit 23 refers to the priority information register and determines whether the first route R1 is set to the highest priority, and if the determination is affirmative, the processing proceeds to S490, and if the determination is negative, the processing proceeds to S370.
[0085] In S470, the route selection unit 23 refers to the priority information register and determines whether the second route R2 is set to the highest priority, and if the determination is affirmative, the processing proceeds to S500, and if the determination is negative, the processing proceeds to S480.
[0086] In S480, the route selection unit 23 refers to the priority information register and determines whether the third route R3 is set to the highest priority, and if the determination is affirmative, the processing proceeds to S510, and if the determination is negative, the processing proceeds to S520.
[0087] In S490, the route selection unit 23 selects the first route R1 as the transmission route for the DoIP message, executes protocol conversion and transmission using the first route R1, and ends the process. In S500, the route selection unit 23 selects the second route R2 as the transmission route for the DoIP message, executes protocol conversion and transmission using the second route R2, and ends the process.
[0088] In S510, the route selection unit 23 selects the third route R3 as the transmission route for the DoIP message. The route selection unit 23 further temporarily stores the DoIP message in the message storage unit 22 so that transmission using the third route R3 is executed, and then ends the process.
[0089] In S520, the path selection unit 23 takes an abnormality measure, such as notifying the external tool 4 that communication with the ECU 3 is not possible, and then ends the process. [3-3. Effects] According to the third embodiment described above in detail, the effects (1a) to (1c) of the first embodiment and the effect (2a) of the second embodiment are achieved, and further, the following effect is achieved.
[0090] (3a) Route selection is performed by combining multiple conditions, making it possible to select the optimal route for various situations. 4. Other Embodiments Although the embodiments of the present disclosure have been described above, the present disclosure is not limited to the above-described embodiments and can be implemented in various modified forms.
[0091] (4a) In the above embodiment, frames containing one or more UDS messages are transmitted and received on the UDS / Ethernet bus B1, but the bus may be configured to store and transmit and receive one or more messages conforming to a protocol not used in normal Ethernet (e.g., DoCAN).
[0092] (4b) In the above embodiment, the third route R3 transmits the diagnostic messages stored in the message storage unit 22 to the ECU 3 via the DoCAN bus B2. However, the third route R3 may be configured to transmit the diagnostic messages to the ECU 3 via the UDS / Ethernet bus B1. The route R3 may also be configured to switch between the buses B1 and B2 depending on the situation.
[0093] (4c) The relay device 2 and the method described herein may be implemented by a special-purpose computer configured by configuring a processor and memory programmed to execute one or more functions embodied in a computer program. Alternatively, the relay device 2 and the method described herein may be implemented by a special-purpose computer configured by configuring a processor with one or more dedicated hardware logic circuits. Alternatively, the relay device 2 and the method described herein may be implemented by one or more special-purpose computers configured by combining a processor and memory programmed to execute one or more functions with a processor configured with one or more hardware logic circuits. Furthermore, the computer program may be stored on a computer-readable non-transitory tangible recording medium as instructions to be executed by a computer. The method for implementing the functions of each unit included in the relay device 2 does not necessarily need to include software; all of the functions may be implemented using one or more hardware components.
[0094] (4d) Multiple functions possessed by one component in the above embodiments may be realized by multiple components, or one function possessed by one component may be realized by multiple components. Also, multiple functions possessed by multiple components may be realized by one component, or one function realized by multiple components may be realized by one component. Also, part of the configuration of the above embodiments may be omitted. Also, at least part of the configuration of the above embodiments may be added to or substituted for the configuration of another of the above embodiments.
[0095] (4e) In addition to the relay device 2 described above, the present disclosure can also be realized in various forms, such as a system including the relay device 2 as a component, a program for causing a computer to function as the relay device 2, a non-transient physical recording medium such as a semiconductor memory on which this program is recorded, and a data relay method.
[0096] [5. Technical Ideas Disclosed in the Present Specification] [Item 1] A relay device that relays data between a plurality of electronic devices, a protocol conversion unit (21) configured to convert between a first protocol used for communication with the first electronic device (4) and a second protocol used for communication with the second electronic device (3); a route selection unit (23) configured to, when relaying a communication message from the first electronic device to the second electronic device connected via a plurality of physical or logical routes, select one of the plurality of routes to use in accordance with at least one of the characteristics of the communication message and the status of the plurality of routes, and execute transmission to the second electronic device using the selected route; A relay device comprising:
[0097] [Item 2] The relay device according to item 1, the relay device and the second electronic device are connected by a first transmission line (B1) and a second transmission line (B2) having a communication speed slower than that of the first transmission line; the plurality of paths include a first path (R1) that uses the first transmission line and a second path (R2) that uses the second transmission line (B2); the route selection unit is configured to select the first route when a message length of the communication message is equal to or greater than a designated length, and to select the second route when the message length of the communication message is shorter than the designated length; Relay device.
[0098] [Item 3] Item 2. The relay device according to item 2, the second protocol applied to the first transmission line includes UDS and Ethernet; The second protocol applied to the second transmission line is configured to include DoCAN. Relay device.
[0099] [Item 4] The relay device according to any one of items 1 to 3, The path selection unit is configured to determine whether communication is possible for each of a plurality of transmission lines connected to the second electronic device as the status of the plurality of paths, and to select the path using the transmission line determined to be communication possible from among the plurality of paths. Relay device.
[0100] [Item 5] Item 4. The relay device according to item 4, The path selection unit is configured to use any one of Ethernet link down, ICMP, and CAN bus off to determine whether the plurality of transmission lines are capable of communication. Relay device.
[0101] [Item 6] Item 5. The relay device according to any one of items 1 to 5, a message storage unit (22) for temporarily storing the communication message; the plurality of routes includes a logical delay route (R3) that passes through the message storage unit; The route selection unit is configured to select the delay route when there is a possibility that delay of other communication messages will exceed a tolerance value when relaying of the communication message is started, store the communication message in the message storage unit, and transmit the communication message stored in the message storage unit to the second electronic device that is a relay destination at a timing when a transmission condition is satisfied. Relay device.
[0102] [Item 7] Item 6. The relay device according to item 6, The transmission condition is that the relay device receives a command to turn off the power. Relay device.
[0103] [Item 8] The relay device according to item 6 or 7, The route selection unit is configured to, when selecting the delayed route, execute a response to the first electronic device instead of the second electronic device that is a relay destination. Relay device.
[0104] [Item 9] Item 8: A relay device according to any one of items 1 to 8, the first protocol is set to include DoIP and TCP / IP, or is set to include any one of information of an SID used to identify a service in a UDS, a DID used to identify data in the UDS, a logical address used to identify a device in the UDS, a TCP / UDP port number, an IP address, and a MAC address; Relay device. [Explanation of symbols]
[0105] 1...In-vehicle system, 2...Relay device, 3...ECU, 4...External tool, 21...Protocol conversion unit, 22...Message storage unit, 23...Route selection unit, 211...First conversion unit, 212...Second conversion unit, B1...UDS / Ethernet bus, B2...DoCAN bus, R1...First route, R2...Second route, R3...Third route, T0...External connection terminal.
Claims
1. A relay device that relays data between a plurality of electronic devices, a protocol conversion unit (21) configured to convert between a first protocol used for communication with the first electronic device (4) and a second protocol used for communication with the second electronic device (3); a route selection unit (23) configured to select one of the routes to be used in accordance with at least one of the characteristics of the communication message and the status of the routes when relaying a communication message from the first electronic device, the communication message being destined for the second electronic device connected via a plurality of physical or logical routes, and to execute transmission to the second electronic device using the selected route; A relay device comprising:
2. The relay device according to claim 1, the relay device and the second electronic device are connected by a first transmission line (B1) and a second transmission line (B2) having a communication speed slower than that of the first transmission line, the plurality of paths include a first path (R1) using the first transmission line and a second path (R2) using the second transmission line (B2); the route selection unit is configured to select the first route when a message length of the communication message is equal to or greater than a designated length, and to select the second route when the message length of the communication message is shorter than the designated length; Relay device.
3. The relay device according to claim 2, the second protocol applied to the first transmission line includes UDS and Ethernet; The second protocol applied to the second transmission line is configured to include DoCAN. Relay device.
4. The relay device according to claim 1, The path selection unit is configured to determine whether communication is possible for each of a plurality of transmission lines connected to the second electronic device as the status of the plurality of paths, and to select the path using the transmission line determined to be communication possible from among the plurality of paths. Relay device.
5. The relay device according to claim 4, The path selection unit is configured to use any one of Ethernet link down, ICMP, or CAN bus off to determine whether the plurality of transmission lines are capable of communication. Relay device.
6. The relay device according to claim 1, a message storage unit (22) for temporarily storing the communication message; the plurality of routes includes a logical delay route (R3) that passes through the message storage unit; The route selection unit is configured to select the delay route when there is a possibility that delay of other communication messages will exceed an allowable value when relaying of the communication message is started, store the communication message in the message storage unit, and transmit the communication message stored in the message storage unit to the second electronic device that is a relay destination at a timing when a transmission condition is satisfied. Relay device.
7. The relay device according to claim 6, The transmission condition is that the relay device receives a command to turn off the power. Relay device.
8. The relay device according to claim 6, The route selection unit is configured to, when selecting the delayed route, execute a response to the first electronic device instead of the second electronic device that is a relay destination. Relay device.
9. The relay device according to claim 1, the first protocol is set to include DoIP and TCP / IP, or is set to include any one of information of an SID used to identify a service in a UDS, a DID used to identify data in the UDS, a logical address used to identify a device in the UDS, a TCP / UDP port number, an IP address, and a MAC address; Relay device.
10. A program for causing a computer to function as a relay device (2) that relays data between multiple electronic devices, The relay device a protocol conversion unit (21) configured to convert between a first protocol used for communication with the first electronic device (4) and a second protocol used for communication with the second electronic device (3); a route selection unit (23) configured to select which of the plurality of routes to use in accordance with at least one of the characteristics of the communication message and the status of the plurality of routes when relaying a communication message from the first electronic device to the second electronic device connected via a plurality of physical or logical routes (R1 to R3) as a destination, and to execute transmission to the second electronic device using the selected route; A program that includes:
Citation Information
Patent Citations
Providing various data rates and redundancy by using physical transmission channels together or independently in vehicle
JP2015050775A