Vehicle diagnosis message routing method, gateway, vehicle communication control system and vehicle
The Ethernet gateway converts DOIP to CAN protocol messages with timers and logical processing to enhance diagnostic message routing efficiency and security in automotive systems.
Patent Information
- Application Number
- CN202411254616.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-09
- Publication Date
- 2024-12-20
AI Technical Summary
The existing CAN protocol in automotive electrical systems is inadequate for complex controllers, leading to low diagnostic message routing flexibility and efficiency, delayed forwarding of DOIP protocol messages, and security issues with diagnostic equipment directly accessing in-vehicle controllers.
A vehicle diagnostic message routing method using an Ethernet gateway that converts DOIP protocol messages to CAN protocol messages, employs timers to manage message conversion and forwarding, and uses logical processing to ensure secure communication by isolating external diagnostic devices from in-vehicle controllers.
Improves diagnostic message routing efficiency and security by preventing direct access of diagnostic devices to in-vehicle controllers, ensuring timely message forwarding and reducing diagnostic failures.
Smart Images

Figure CN119172308A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of vehicle technology, and in particular to a vehicle diagnostic message routing method, an Ethernet gateway, a non-volatile readable storage medium, a vehicle communication control system and a vehicle. Background Art
[0002] In the related technologies, with the intelligence of automotive electrical systems, the traditional CAN (Controller Area Network) protocol can no longer meet the diagnostic flashing needs of complex controllers, and high-bandwidth transmission protocols such as the Ethernet protocol are gradually introduced. However, the traditional CAN protocol still exists. The diagnostic message routing flexibility and efficiency of the architecture with multiple protocols coexisting are low. The diagnostic equipment is directly routed to the in-vehicle controller, and the diagnostic flashing security is low. In addition, the diagnostic equipment has a large number of DOIP protocol diagnostic messages and there is delayed forwarding, which causes the diagnostic equipment to timeout and cause diagnostic failure. Summary of the invention
[0003] The present invention aims to solve at least one of the technical problems existing in the prior art. To this end, one object of the present invention is to provide a vehicle diagnostic message routing method, which can improve the flexibility and efficiency of diagnosis and enhance the security of diagnostic flashing.
[0004] The second objective of the present invention is to provide an Ethernet gateway.
[0005] The third object of the present invention is to provide a non-volatile readable storage medium.
[0006] A fourth objective of the present invention is to provide a vehicle communication control system.
[0007] A fifth object of the present invention is to provide a vehicle.
[0008] In order to solve the above problems, an embodiment of the first aspect of the present invention provides a vehicle diagnostic message routing method for an Ethernet gateway of a vehicle, the vehicle diagnostic message routing method comprising: receiving a diagnostic request, determining a target addressing mode and a target controller according to the diagnostic request; sending a diagnostic message to the target controller according to the target addressing mode, wherein the target controller comprises a CAN protocol communication controller, converting a DOIP protocol diagnostic message of the diagnostic device into a CAN protocol diagnostic message, and sending the CAN protocol diagnostic message to the CAN protocol communication controller; wherein, when converting the DOIP protocol diagnostic message of the diagnostic device into a CAN protocol diagnostic message, performing logical processing of sending NRC78 information on behalf of the vehicle, the logical processing of sending NRC78 information on behalf of the vehicle comprises: starting a first timer, a second timer and a third timer; three timers, the timing duration of the first timer is less than the timing duration of the second timer is less than the timing duration of the third timer, and the timing duration of the first timer, the timing duration of the second timer and the timing duration of the third timer are all less than the timeout time for the diagnostic device to wait for a response; when the first timer times out and the conversion of the DOIP protocol diagnostic message to the CAN protocol diagnostic message has not been completed, a first frame of NRC78 information is sent, and the NRC78 information is sent once every preset period, wherein the source logical address of the first frame of NRC78 information is the logical address of the target controller, and the sending status of the NRC78 information is controlled according to the timing time of the second timer and the timing time of the third timer and the completion status of the conversion of the DOIP protocol diagnostic message to the CAN protocol diagnostic message.
[0009] According to the vehicle diagnostic message routing method of the embodiment of the present invention, the Ethernet gateway is used for forwarding between the diagnostic device and each vehicle-mounted controller. After receiving the diagnostic request of the diagnostic device, the target addressing mode and the target controller are determined. After converting the DOIP protocol diagnostic message into a CAN protocol diagnostic message, the Ethernet gateway communicates with the communication controller through the CAN protocol. The diagnostic device cannot directly access the target controller, and determines whether the diagnosis has timed out through a timer. When the first timer times out and the diagnostic message has not been forwarded, the first frame of NRC78 information is sent to the diagnostic device. When the second timer times out and the diagnostic message forwarding has not been completed, the diagnostic mode is exited. After the diagnostic message is forwarded successfully, the third timer times out, and the gateway does not receive a diagnostic response from the target control, so the diagnostic mode is exited, thereby improving the efficiency of the diagnosis and the security of the diagnostic flashing.
[0010] In some embodiments, the target addressing mode is a physical addressing mode, and the target controller is the CAN protocol communication controller corresponding to the target logical address; or, the target addressing mode is a functional addressing mode. In the functional addressing mode, the diagnostic message is sent to the DOIP protocol communication controller and the CAN protocol communication controller connected to the Ethernet gateway respectively, and the target controller includes the CAN protocol communication controller corresponding to the logical address of the functional addressing.
[0011] In some embodiments, the target addressing mode is a physical addressing mode; the target controller also includes a DOIP protocol communication controller corresponding to the target logical address; sending a diagnostic message to the target controller according to the target addressing mode also includes: sending the DOIP protocol diagnostic message of the diagnostic device to the DOIP protocol communication controller corresponding to the target logical address.
[0012] In some embodiments, the logical processing of sending NRC78 information on behalf of others also includes: when the second timer times out and the conversion of the DOIP protocol diagnostic message to the CAN protocol diagnostic message has not been completed, stopping sending NRC78 information and exiting the diagnostic mode.
[0013] In some embodiments, the logical processing of sending NRC78 information on behalf of others also includes: when the third timer times out after the conversion of the DOIP protocol diagnostic message to the CAN protocol diagnostic message is completed and no diagnostic response from the target controller is received, stopping sending NRC78 information and exiting the diagnostic mode; or, when a diagnostic response from the target controller is received before the third timer times out, sending the diagnostic response to the diagnostic device.
[0014] A second aspect of the present invention provides an Ethernet gateway, comprising: at least one processor; a memory communicatively connected to the at least one processor; the memory storing a computer program executable by the at least one processor, wherein the at least one processor implements the vehicle diagnostic message routing method described in the above embodiment when executing the computer program.
[0015] According to the Ethernet gateway of the embodiment of the present invention, the corresponding vehicle diagnostic message routing program can be stored in the memory. When the vehicle diagnostic message routing method is implemented, the processor runs the program in the memory and routes with the target controller through the Ethernet gateway. The diagnostic device cannot directly access the target controller, thereby improving the security of diagnostic flashing.
[0016] A third aspect of the present invention provides a non-volatile readable storage medium having a computer program stored thereon, wherein the computer program implements the vehicle diagnostic message routing method described in the above embodiment when executed.
[0017] A fourth aspect of the present invention provides a vehicle communication control system, comprising: a CAN protocol communication controller and a DOIP protocol communication controller; an Ethernet gateway, wherein the Ethernet gateway communicates with the CAN protocol communication controller via the CAN protocol, and the Ethernet gateway communicates with the DOIP protocol communication controller via the DOIP protocol, and the Ethernet gateway is suitable for communicating with the diagnostic device via the DOIP protocol, and is used to implement the vehicle diagnostic message routing method described in the above embodiment.
[0018] According to the vehicle communication control system of an embodiment of the present invention, the Ethernet gateway communicates with the CAN protocol communication controller and the DOIP protocol communication controller through different protocols, and the diagnostic equipment cannot directly access the CAN protocol communication controller and the DOIP protocol communication controller, thereby improving the security of diagnostic flashing.
[0019] In some embodiments, the DOIP protocol communication controller includes an Ethernet controller; the CAN protocol communication controller includes at least one of a CAN controller and a CANFD controller.
[0020] A fifth aspect of the present invention provides a vehicle, comprising the vehicle communication control system described in the above embodiment.
[0021] According to the vehicle of the embodiment of the present invention, when routing diagnostic messages, the Ethernet gateway in the vehicle communication control system serves as a communication medium, and communicates with the CAN protocol communication controller and the DOIP protocol communication controller through different protocols, thereby improving the security of diagnostic flashing.
[0022] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0024] Figure 1 is a flow chart of a vehicle diagnostic message routing method according to an embodiment of the present invention;
[0025] Figure 2 is a flow chart of Ethernet gateway processing logic according to one embodiment of the present invention;
[0026] Figure 3is a structural block diagram of an Ethernet gateway according to an embodiment of the present invention;
[0027] Figure 4 is a structural block diagram of a vehicle communication control system according to an embodiment of the present invention;
[0028] Figure 5 is a structural block diagram of a CAN protocol communication controller according to an embodiment of the present invention;
[0029] Figure 6 is a structural block diagram of a vehicle according to an embodiment of the present invention.
[0030] Reference numerals:
[0031] Vehicles 300;
[0032] Vehicle communication control system 200;
[0033] Ethernet gateway 100; CAN protocol communication controller 210; DOIP protocol communication controller 220;
[0034] Processor 101 ; memory 102 ; CAN controller 211 ; CAN FD controller 212 . DETAILED DESCRIPTION
[0035] Embodiments of the present invention are described in detail below. The embodiments described with reference to the accompanying drawings are exemplary. Embodiments of the present invention are described in detail below.
[0036] The first aspect of the present invention provides a vehicle diagnostic message routing method. After receiving a diagnostic request, the method can determine the target addressing mode and the target controller, convert the DOIP protocol diagnostic message into a CAN protocol diagnostic message and then communicate with the CAN protocol communication controller, and determine whether the diagnosis has timed out through a timer, thereby improving the efficiency of the diagnosis and the security of the diagnostic flashing.
[0037] Reference below Figure 1 A vehicle diagnostic message routing method according to an embodiment of the first aspect of the present invention is described. Figure 1 As shown, the method at least includes step S1 to step S2.
[0038] Step S1, receiving a diagnostic request, and determining a target addressing mode and a target controller according to the diagnostic request.
[0039] Specifically, during vehicle diagnosis, the diagnostic device is connected to the vehicle, receives and processes diagnostic requests from the diagnostic device through the Ethernet gateway, and forwards these requests to the target controller in the vehicle; the diagnostic device first communicates with the Ethernet gateway, and the diagnostic device sends a diagnostic request to the Ethernet gateway, thereby determining the target addressing mode and target controller based on the diagnostic request.
[0040] Step S2, sending a diagnostic message to a target controller according to a target addressing mode, wherein the target controller includes a CAN protocol communication controller, converting a DOIP protocol diagnostic message of the diagnostic device into a CAN protocol diagnostic message, and sending the CAN protocol diagnostic message to the CAN protocol communication controller;
[0041] When the DOIP protocol diagnostic message of the diagnostic device is converted into the CAN protocol diagnostic message, the logical processing of sending the NRC78 information is performed.
[0042] The logical processing of sending NRC78 information on behalf of others includes: starting a first timer, a second timer and a third timer, the timing duration of the first timer is less than the timing duration of the second timer and less than the timing duration of the third timer, and the timing duration of the first timer, the timing duration of the second timer and the timing duration of the third timer are all less than the timeout time for the diagnostic device to wait for a response; when the first timer times out and the conversion of the DOIP protocol diagnostic message to the CAN protocol diagnostic message has not been completed, sending a first frame of NRC78 information, and sending the NRC78 information once every preset period, wherein the source logical address of the first frame of NRC78 information is the logical address of the target controller, and controlling the sending status of the NRC78 information according to the timing time of the second timer and the timing time of the third timer and the completion of the conversion of the DOIP protocol diagnostic message to the CAN protocol diagnostic message.
[0043] Specifically, the addressing mode can be physical addressing or functional addressing. After determining the addressing mode, the Ethernet gateway sends the diagnostic message to the target controller; when the target controller includes a CAN protocol communication controller corresponding to the target logical address, the Ethernet gateway first receives the DOIP protocol diagnostic message sent by the diagnostic device, and the target logical address of the target controller specified in the received DOIP protocol diagnostic message, and the target controller is the CAN protocol communication controller corresponding to the target logical address. The DOIP protocol diagnostic message received from the diagnostic device is converted into a CAN protocol diagnostic message, and the CAN protocol diagnostic message is sent to the CAN protocol communication controller corresponding to the target logical address for communication.
[0044] For the conversion of the DOIP protocol diagnostic message of the diagnostic equipment into the CAN protocol diagnostic message, due to the large number of DOIP diagnostic messages, there is a delay in forwarding. The long forwarding time will cause the diagnostic equipment to time out and cause the diagnosis to fail. In order to solve this problem, the Ethernet gateway performs logical processing on behalf of the NRC78 message; the NRC78 message response code indicates that the request message is correctly received by the controller, and all parameters in the request message are valid, but the controller has not completed the requested operation, so the final response message cannot be sent temporarily. The timing duration of the first timer is represented by T1, the timing duration of the second timer is represented by T2, the timing duration of the third timer is represented by T3, and the preset period is represented by T4. The timing duration of the first timer can be 10ms, the timing duration of the second timer can be 20ms, and the timing duration of the third timer can be 30ms. The preset period is 1ms. The Ethernet gateway receives the DOIP diagnostic request and determines that the target logical address is a CAN / CANFD node. The Ethernet gateway performs protocol forwarding and starts the first timer, the second timer and the third timer at the same time. If the first timer exceeds 10ms and the Ethernet gateway has not completed the conversion of the DOIP protocol diagnostic message to the CAN protocol diagnostic message, the Ethernet gateway sends the first frame NRC78 to the diagnostic device, with the source logical address being the logical address of the target controller, and then sends NRC78 information every 1ms of the preset period; if the second timer also times out, stop sending NRC78 information and exit the diagnostic mode; if the conversion of the DOIP protocol diagnostic message to the CAN protocol diagnostic message is completed, the third timer exceeds 30ms, and the Ethernet gateway has not received a diagnostic response from the target controller, stop sending NRC78 information and exit the diagnostic mode.
[0045] For example, when the gateway receives a diagnostic request, the source IP address of the diagnostic request is the IP address of the diagnostic device, and the target IP address of the diagnostic request is the IP address of the Ethernet gateway; when the gateway sends a diagnostic message to the target controller, the source IP address of the diagnostic message is the IP address of the Ethernet gateway, and the target IP address of the diagnostic message is the IP address of the target controller.
[0046] The source IP address of the diagnostic request is the IP address of the diagnostic device, and the target IP address of the diagnostic request is the IP address of the Ethernet gateway; the source IP address of the diagnostic request can be understood as the IP address of the device sending the diagnostic request, and the target IP address can be understood as the IP address of the device receiving the diagnostic request.
[0047] The addressing mode can be physical addressing or functional addressing. After determining the addressing mode, the Ethernet gateway sends the diagnostic message to the target controller. When the Ethernet gateway sends the diagnostic message, the source IP address of the diagnostic message is the IP address of the Ethernet gateway, and the target IP address of the diagnostic message is the IP address of the target controller. The Ethernet gateway parses the target controller to be accessed and the addressing mode to be used based on the received diagnostic request. After determining the target controller and addressing mode, the Ethernet gateway sends a new diagnostic message. The source IP address of this message is the IP address of the Ethernet gateway, and the target IP address is the IP address of the target controller, thereby isolating the external diagnostic device from the in-vehicle controller to ensure communication security.
[0048] According to the vehicle diagnostic message routing method of the embodiment of the present invention, the Ethernet gateway is used for forwarding between the diagnostic device and each vehicle-mounted controller. After receiving the diagnostic request of the diagnostic device, the target addressing mode and the target controller are determined. After converting the DOIP protocol diagnostic message into a CAN protocol diagnostic message, the Ethernet gateway communicates with the communication controller through the CAN protocol. The diagnostic device cannot directly access the target controller, and determines whether the diagnosis has timed out through a timer. When the first timer times out and the diagnostic message has not been forwarded, the first frame of NRC78 information is sent to the diagnostic device. When the second timer times out and the diagnostic message forwarding has not been completed, the diagnostic mode is exited. After the diagnostic message is forwarded successfully, the third timer times out, and the gateway does not receive a diagnostic response from the target control, so the diagnostic mode is exited, thereby improving the efficiency of the diagnosis and the security of the diagnostic flashing.
[0049] In some embodiments, the target addressing mode is a physical addressing mode; the target controller is a CAN protocol communication controller corresponding to the target logical address; or, the target addressing mode is a functional addressing mode. In the functional addressing mode, the diagnostic message is sent to the DOIP protocol communication controller and the CAN protocol communication controller connected to the Ethernet gateway respectively, and the target controller includes a CAN protocol communication controller corresponding to the logical address of the functional addressing.
[0050] Specifically, the physical addressing mode focuses on the identity and location of hardware devices, uniquely identifies and addresses network devices through physical addresses, relies on the physical addresses of hardware devices for data forwarding, and can communicate with the corresponding controller through physical addressing by looking up the physical address table in the data link layer and sending data to a specific interface; the logical address, also known as the relative address, is the address of a memory unit, storage unit or network host seen from the application's perspective in the computer architecture. The logical address is mainly converted by the operating system to convert the logical address into an actual physical address. This process is called address mapping; the target logical address can be understood as the logical address corresponding to the controller that interacts with the Ethernet gateway.
[0051] Functional addressing focuses on identifying and locating logical entities or services on the network. It uniquely identifies and addresses hosts, routers, applications or network services through logical addresses. Functional addressing is often performed in higher-level network protocols. It uses a multi-level logical structure to divide the network into subnets and hosts, and uses logical addresses for addressing. The logical addresses of functional addressing can be changed or remapped as needed. When the target addressing mode is the functional addressing mode, after the Ethernet gateway receives the diagnostic request sent by the diagnostic device, the Ethernet gateway can send the diagnostic message to all DOIP protocol communication controllers and CAN protocol communication controllers connected to the Ethernet gateway, so as to realize the communication between the Ethernet gateway and multiple controllers.
[0052] For example, the diagnostic device sends a diagnostic request, and the Ethernet gateway recognizes that it is functional addressing after receiving the diagnostic request. At this time, the source logical address is the logical address of the diagnostic device, the target logical address is the logical address of the controller connected to each Ethernet gateway, the source IP address is the IP address of the diagnostic device, and the target IP address is the IP address of the Ethernet gateway. The Ethernet gateway receives the DOIP protocol diagnostic message of the diagnostic device and parses it to the DOIP layer, and sends the diagnostic message to all DOIP protocol communication controllers in the car. The logical address after routing remains unchanged, the source IP address is replaced with the IP address of the Ethernet gateway, and the target IP address is the IP address of the target controller. At the same time, the Ethernet gateway converts the DOIP protocol diagnostic message sent by the diagnostic device into a CAN protocol diagnostic message, and sends the CAN protocol diagnostic message to the CAN protocol communication controller corresponding to the logical address of the functional addressing. This diagnostic message routing scheme ensures that during diagnosis, the external device and the internal controller are isolated by address, and cannot be directly accessed for diagnosis, thereby ensuring diagnostic security.
[0053] In some embodiments, the target addressing mode is a physical addressing mode; the target controller also includes a DOIP protocol communication controller corresponding to the target logical address; sending a diagnostic message to the target controller according to the target addressing mode also includes: sending a DOIP protocol diagnostic message of the diagnostic device to the DOIP protocol communication controller corresponding to the target logical address.
[0054] Specifically, when the target addressing mode is the physical addressing mode and the target controller includes a DOIP protocol communication controller corresponding to the target logical address, the diagnostic device sends a diagnostic request, the source logical address is the logical address of the diagnostic device, the target logical address is the logical address of the target controller, the source IP address is the IP address of the diagnostic device, and the target IP address is the IP address of the Ethernet gateway; the Ethernet gateway locates the DOIP protocol communication controller in the vehicle based on the target logical address, the logical address of the Ethernet gateway remains unchanged after routing, the source IP address is replaced with the IP address of the Ethernet gateway, and the target IP address is replaced with the IP address of the DOIP protocol communication controller.
[0055] In some embodiments, when the second timer times out and the conversion of the DOIP protocol diagnostic message into the CAN protocol diagnostic message has not yet been completed, the sending of the NRC78 information is stopped and the diagnostic mode is exited.
[0056] Specifically, after the first timer exceeds 10ms, NRC78 information is sent to the diagnostic device every preset period of 1ms. If the second timer also times out, the sending of NRC78 information is stopped and the diagnostic mode is exited. After exiting the diagnostic mode, no diagnosis is performed. To diagnose again, the diagnostic device needs to resend the diagnostic request.
[0057] In some embodiments, when the third timer times out after the conversion of the DOIP protocol diagnostic message to the CAN protocol diagnostic message is completed and no diagnostic response is received from the target controller, the NRC78 information is stopped from being sent and the diagnostic mode is exited; alternatively, when a diagnostic response from the target controller is received before the third timer times out, the diagnostic response is sent to the diagnostic device.
[0058] Specifically, if the conversion of the DOIP protocol diagnostic message into the CAN protocol diagnostic message is completed, the third timer has exceeded 30ms, and the Ethernet gateway has not received a diagnostic response from the target controller, it stops sending the NRC78 information and exits the diagnostic mode. After exiting the diagnostic mode, no diagnosis will be performed. Re-diagnosis requires the diagnostic device to resend the diagnostic request; if the Ethernet gateway receives a diagnostic response from the target controller before the third timer expires, the Ethernet controller sends a response message to the diagnostic device.
[0059] Reference below Figure 2 The Ethernet gateway processing logic is described, including steps S3 to S16.
[0060] Step S3, start.
[0061] Step S4: The Ethernet gateway receives a device DOIP diagnostic request.
[0062] Step S5, whether the target logical address is a CAN / CANFD controller, if so, execute step S6, otherwise, execute step S7.
[0063] Step S6, DOIP to CAN / CANFD diagnostic message routing, start timer T1, start timer T2, start timer T3.
[0064] Step S7: DOIP to DOIP diagnostic message routing
[0065] Step S8, whether the Ethernet gateway forwarding is completed, if yes, execute step S14, otherwise, execute step S9.
[0066] Step S9, whether T1 times out, if yes, execute step S10, otherwise, execute step S8.
[0067] Step S10, sending the first frame NRC78.
[0068] Step S11, NRC78 is sent with a period of T4.
[0069] Step S12, whether T2 times out, if yes, execute step S13, otherwise, execute step S11.
[0070] Step S13, stop sending NRC78 and exit the diagnostic service.
[0071] Step S14, whether T3 times out, if yes, execute step S13, otherwise, execute step S15.
[0072] Step S15, whether a CAN / CANFD diagnostic response is received, if yes, execute step S16, otherwise, execute step S14.
[0073] Step S16, forwarding the CAN / CANFD response message to the diagnostic device.
[0074] A second aspect of the present invention provides an Ethernet gateway, such as Figure 3 As shown, the Ethernet gateway 100 includes: at least one processor 101 and a memory 102 .
[0075] The memory 102 stores a computer program that can be executed by at least one processor 101 , and the at least one processor 101 implements the vehicle diagnostic message routing method when executing the computer program.
[0076] According to the Ethernet gateway of the embodiment of the present invention, the corresponding vehicle diagnostic message routing program can be stored in the memory. When the vehicle diagnostic message routing method is implemented, the processor runs the program in the memory and routes with the target controller through the Ethernet gateway. The diagnostic device cannot directly access the target controller, thereby improving the security of diagnostic flashing.
[0077] A third aspect of the present invention provides a non-volatile readable storage medium having a computer program stored thereon, which implements a vehicle diagnostic message routing method when the computer program is executed.
[0078] A fourth aspect of the present invention provides a vehicle communication control system, such as Figure 4 As shown, the vehicle communication control system 200 includes: an Ethernet gateway 100 , a CAN protocol communication controller 210 and a DOIP protocol communication controller 220 .
[0079] Among them, the Ethernet gateway 100 communicates with the CAN protocol communication controller 210 via the CAN protocol, the Ethernet gateway 100 communicates with the DOIP protocol communication controller 220 via the DOIP protocol, and the Ethernet gateway 100 is suitable for communicating with the diagnostic equipment via the DOIP protocol to implement the vehicle diagnostic message routing method.
[0080] According to the vehicle communication control system of an embodiment of the present invention, the Ethernet gateway communicates with the CAN protocol communication controller and the DOIP protocol communication controller through different protocols, and the diagnostic equipment cannot directly access the CAN protocol communication controller and the DOIP protocol communication controller, thereby improving the security of diagnostic flashing.
[0081] In some embodiments, the DOIP protocol communication controller includes an Ethernet controller; the CAN protocol communication controller includes at least one of a CAN controller and a CANFD controller.
[0082] Specifically, the DOIP protocol communication controller 220 includes an Ethernet controller; Figure 5 As shown, the CAN protocol communication controller 210 includes at least one of a CAN controller 211 and a CANFD controller 212; the Ethernet gateway 100 is connected to the diagnostic device, and is also connected to the in-vehicle CAN controller 211, the CANFD controller 212 and the Ethernet controller 221. The diagnostic device adopts the Ethernet diagnostic protocol. For the in-vehicle Ethernet controller 221, the Ethernet gateway 100 performs DOIP to DOIP diagnostic routing. For the in-vehicle CAN controller 211 and the CANFD controller 212, the Ethernet gateway 100 performs protocol conversion, DOIP to CAN / CANFD diagnostic routing, and the Ethernet gateway needs to parse to the DOIP layer.
[0083] A fifth aspect of the present invention provides a vehicle, such as Figure 6 As shown, the vehicle 300 includes: a vehicle communication control system 200 .
[0084] According to the vehicle of the embodiment of the present invention, when routing diagnostic messages, the Ethernet gateway in the vehicle communication control system serves as a communication medium, and communicates with the CAN protocol communication controller and the DOIP protocol communication controller through different protocols, thereby improving the security of diagnostic flashing.
[0085] In the description of this specification, any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code including one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present invention belong.
[0086] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute the instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.
[0087] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0088] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0089] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0090] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present invention have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present invention. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present invention.
[0091] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples" means that the specific features, substrates, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example.
[0092] Although the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.
Claims
1. A vehicle diagnostic message routing method, characterized in that: An Ethernet gateway for a vehicle, the vehicle diagnostic message routing method comprising: receiving a diagnostic request, and determining a target addressing mode and a target controller according to the diagnostic request; Sending a diagnostic message to the target controller according to the target addressing mode, wherein the target controller includes a CAN protocol communication controller, converting the DOIP protocol diagnostic message of the diagnostic device into a CAN protocol diagnostic message, and sending the CAN protocol diagnostic message to the CAN protocol communication controller; Wherein, when converting the DOIP protocol diagnostic message of the diagnostic device into the CAN protocol diagnostic message, the logical processing of sending the NRC78 information on behalf of the diagnostic device is performed, and the logical processing of sending the NRC78 information on behalf of the diagnostic device includes: Starting a first timer, a second timer and a third timer, wherein the timing duration of the first timer is less than the timing duration of the second timer and less than the timing duration of the third timer, and the timing durations of the first timer, the second timer and the third timer are all less than the timeout period for the diagnostic device to wait for a response; When the first timer times out and the conversion of the DOIP protocol diagnostic message to the CAN protocol diagnostic message has not been completed, a first frame of NRC78 information is sent, and the NRC78 information is sent once every preset period, wherein the source logical address of the first frame of NRC78 information is the logical address of the target controller, and the sending status of the NRC78 information is controlled according to the timing of the second timer and the timing of the third timer and the completion of the conversion of the DOIP protocol diagnostic message to the CAN protocol diagnostic message.
2. The vehicle diagnostic message routing method according to claim 1, characterized in that: The target addressing mode is a physical addressing mode, and the target controller is the CAN protocol communication controller corresponding to the target logical address; Alternatively, the target addressing mode is a functional addressing mode. In the functional addressing mode, the diagnostic message is sent to the DOIP protocol communication controller and the CAN protocol communication controller connected to the Ethernet gateway respectively, and the target controller includes the CAN protocol communication controller corresponding to the logical address of the functional addressing.
3. The vehicle diagnostic message routing method according to claim 2, characterized in that: The target addressing mode is a physical addressing mode; The target controller also includes a DOIP protocol communication controller corresponding to the target logical address; Sending a diagnostic message to the target controller according to the target addressing mode also includes: The DOIP protocol diagnostic message of the diagnostic device is sent to the DOIP protocol communication controller corresponding to the target logical address.
4. The vehicle diagnostic message routing method according to claim 1, characterized in that: The logic processing of sending NRC78 information on behalf of others also includes: When the second timer times out and the conversion of the DOIP protocol diagnostic message into the CAN protocol diagnostic message has not been completed, stop sending the NRC78 information and exit the diagnostic mode.
5. The vehicle diagnostic message routing method according to claim 4, characterized in that: The logic processing of sending NRC78 information on behalf of others also includes: After the conversion of the DOIP protocol diagnostic message into the CAN protocol diagnostic message is completed, when the third timer times out and no diagnostic response from the target controller is received, stop sending the NRC78 information and exit the diagnostic mode; Alternatively, if a diagnostic response from the target controller is received before the third timer times out, the diagnostic response is sent to the diagnostic device.
6. An Ethernet gateway, characterized in that: include: at least one processor; a memory communicatively coupled to the at least one processor; The memory stores a computer program that can be executed by the at least one processor, and when the at least one processor executes the computer program, the vehicle diagnostic message routing method according to any one of claims 1 to 5 is implemented.
7. A non-volatile readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed, the vehicle diagnostic message routing method according to any one of claims 1 to 5 is implemented.
8. A vehicle communication control system, characterized in that: include: CAN protocol communication controller and DOIP protocol communication controller; An Ethernet gateway, wherein the Ethernet gateway communicates with the CAN protocol communication controller via the CAN protocol, the Ethernet gateway communicates with the DOIP protocol communication controller via the DOIP protocol, and the Ethernet gateway is suitable for communicating with the diagnostic device via the DOIP protocol, and is used to implement the vehicle diagnostic message routing method described in any one of claims 1-5.
9. The vehicle communication control system according to claim 8, characterized in that: The DOIP protocol communication controller includes an Ethernet controller; The CAN protocol communication controller includes at least one of a CAN controller and a CANFD controller.
10. A vehicle, characterized in that: Includes the vehicle communication control system as described in claim 8 or 9.
