WO2024037303A1 - 车辆诊断方法、装置、设备、可读存储介质及程序产品 - Google Patents

车辆诊断方法、装置、设备、可读存储介质及程序产品 Download PDF

Info

Publication number
WO2024037303A1
WO2024037303A1 PCT/CN2023/109475 CN2023109475W WO2024037303A1 WO 2024037303 A1 WO2024037303 A1 WO 2024037303A1 CN 2023109475 W CN2023109475 W CN 2023109475W WO 2024037303 A1 WO2024037303 A1 WO 2024037303A1
Authority
WO
WIPO (PCT)
Prior art keywords
diagnostic
canfd
node
request message
response message
Prior art date
Application number
PCT/CN2023/109475
Other languages
English (en)
French (fr)
Inventor
杨东耳
Original Assignee
北京经纬恒润科技股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京经纬恒润科技股份有限公司 filed Critical 北京经纬恒润科技股份有限公司
Publication of WO2024037303A1 publication Critical patent/WO2024037303A1/zh

Links

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B23/00Testing or monitoring of control systems or parts thereof
    • G05B23/02Electric testing or monitoring
    • G05B23/0205Electric testing or monitoring by means of a monitoring system capable of detecting and responding to faults
    • G05B23/0208Electric testing or monitoring by means of a monitoring system capable of detecting and responding to faults characterized by the configuration of the monitoring system
    • G05B23/0213Modular or universal configuration of the monitoring system, e.g. monitoring system having modules that may be combined to build monitoring program; monitoring system that can be applied to legacy systems; adaptable monitoring system; using different communication protocols

Definitions

  • This application belongs to the field of vehicle diagnosis technology, and specifically relates to a vehicle diagnosis method, device, equipment, readable storage medium and program product.
  • CANFD Controller Area Network with Flexible Data rate
  • CAN Controller Area Network
  • CANFD Controller Area Network with Flexible Data rate
  • OEMs only open one diagnostic CAN interface for the vehicle's On Board Diagnostic (OBD) diagnostic interface to connect to an external diagnostic instrument.
  • OBD On Board Diagnostic
  • the external diagnostic instrument accesses the nodes in the vehicle's CAN network and CANFD network through the OBD diagnostic CAN interface.
  • embodiments of the present application provide a vehicle diagnosis method, applied to vehicles, including:
  • diagnostic request message sent by the diagnostic instrument, where the diagnostic request message is a variable rate controller area network CANFD diagnostic request message or a controller area network CAN diagnostic request message,
  • the target node is a CAN node or CANFD node
  • the data length code DLC of the diagnostic request message is 8
  • the target node is a variable rate controller LAN CANFD node
  • the DLC of the diagnostic response message is 8.
  • the diagnostic instrument and target node satisfy any of the following:
  • the diagnostic instrument supports the CANFD communication protocol, and the target node is the CANFD node.
  • the diagnostic instrument supports CANFD communication protocol, and the target node is a CAN node.
  • the diagnostic instrument supports CAN communication protocol, and the target node is a CAN node.
  • the diagnostic instrument supports CAN communication protocol, and the target node is the CANFD node.
  • the diagnostic request message is a CANFD diagnostic request message.
  • forwarding the diagnostic request message to the target node includes:
  • the target node is a CANFD node
  • the CANFD diagnostic request message is converted into a CAN request message and sent to the CAN node.
  • the diagnostic response message is sent to the diagnostic instrument as a CAN diagnostic response message, including:
  • the target node is a CANFD node and the diagnostic request message is a CANFD diagnostic response message
  • the CANFD diagnostic response message is converted into a CAN diagnostic request message and sent to the diagnostic instrument.
  • the target node is a CAN node and the diagnostic request message is a CAN diagnostic response message
  • the CAN diagnostic response message is sent directly to the diagnostic instrument.
  • performing data link layer routing on the diagnostic response message and forwarding the diagnostic request message to the target node includes:
  • the diagnostic request message is forwarded to the target node, and the data link layer routing is performed on the diagnostic response message.
  • the minimum depth of the first FIFO mechanism is determined based on the following parameters: the number of nodes in each network in the vehicle, the first time required for the vehicle's gateway to receive all CANFD diagnostic response messages, and the time required for the gateway to receive all CANFD diagnostic response messages.
  • the second time the minimum time required for the CAN network to send 8 bytes, and the maximum number of CAN messages corresponding to the diagnostic response message.
  • the method before performing data link layer routing on the diagnostic response message according to the first first-in-first-out FIFO mechanism, the method further includes:
  • D1 is the minimum depth of the first FIFO mechanism
  • P is the sum of the number of nodes in each network in the vehicle
  • Z1 is the number of CAN messages corresponding to the maximum diagnostic response message
  • Tmax is the maximum value of the first time and the second time
  • Tcan is the minimum time required to send 8 bytes over the CAN network.
  • data link layer routing is performed on the diagnostic request message, and the diagnostic response message is sent to the diagnostic instrument as a CAN diagnostic response message, including:
  • data link layer routing is performed on the diagnostic request message, and the diagnostic response message is sent to the diagnostic instrument as a CAN diagnostic response message.
  • the minimum depth of the second FIFO mechanism is level 8
  • the first diagnosis scenario is any of the following:
  • the diagnostic instrument supports the CANFD communication protocol, and the target node is the CANFD node.
  • the diagnostic instrument supports CAN communication protocol, and the target node is a CAN node.
  • the diagnostic instrument supports CAN communication protocol, and the target node is CANFD node.
  • the minimum depth of the second FIFO mechanism is 333 levels.
  • the method before receiving the diagnosis request message sent by the diagnostic instrument, the method further includes:
  • the baud rate of the CAN working mode is consistent with the baud rate of the vehicle CAN, and the baud rate of the CANFD working mode is the same as the baud rate of the vehicle CANFD. Rate is consistent.
  • the method before receiving the diagnosis request message sent by the diagnostic instrument, the method further includes:
  • diagnostic routing table perform data link layer routing on the diagnostic request message and forward the diagnostic request message to the target node.
  • diagnostic routing table data link layer routing is performed on the diagnostic response message, and the diagnostic response message is sent to the diagnostic instrument as a CAN diagnostic response message.
  • the method before receiving the diagnosis request message sent by the diagnostic instrument, the method further includes:
  • the diagnostic instrument sends a diagnostic request message to the vehicle
  • the method After sending the diagnostic response message to the diagnostic instrument as a CAN diagnostic response message, the method also includes:
  • the diagnostic instrument receives the CAN diagnostic response message sent by the vehicle.
  • a vehicle diagnostic device which includes:
  • the first receiving module is used to receive a diagnostic request message sent by the diagnostic instrument, where the diagnostic request message is a variable rate controller LAN CANFD diagnostic request message or a controller LAN CAN diagnostic request message,
  • the first sending module is used to perform data link layer routing on the diagnosis request message, and forward the diagnosis request message to the target node, where the target node is a CAN node or a CANFD node,
  • the second sending module is used to perform data link layer routing on the diagnostic response message sent by the target node, and send the diagnostic response message to the diagnostic instrument in the form of a CAN diagnostic response message.
  • the data length code DLC of the diagnostic request message is 8
  • the DLC of the diagnostic response message is 8.
  • the diagnostic instrument and target node satisfy any of the following:
  • the diagnostic instrument supports the CANFD communication protocol, and the target node is the CANFD node.
  • the diagnostic instrument supports CANFD communication protocol, and the target node is a CAN node.
  • the diagnostic instrument supports CAN communication protocol, and the target node is a CAN node.
  • the diagnostic instrument supports CAN communication protocol, and the target node is the CANFD node.
  • the diagnostic request message is a CANFD diagnostic request message.
  • the first sending module is specifically used to:
  • the target node is a CANFD node
  • the CANFD diagnostic request message is converted into a CAN request message and sent to the CAN node.
  • the second sending module is specifically used to:
  • the target node is a CANFD node and the diagnostic request message is a CANFD diagnostic response message
  • the CANFD diagnostic response message is converted into a CAN diagnostic request message and sent to the diagnostic instrument.
  • the target node is a CAN node and the diagnostic request message is a CAN diagnostic response message
  • the CAN diagnostic response message is sent directly to the diagnostic instrument.
  • the first sending module is specifically used to:
  • the diagnostic request message is forwarded to the target node, and the data link layer routing is performed on the diagnostic response message.
  • the minimum depth of the first FIFO mechanism is determined based on the following parameters: the number of nodes in each network in the vehicle, the first time required for the vehicle's gateway to receive all CANFD diagnostic response messages, and the time required for the gateway to receive all CANFD diagnostic response messages.
  • the second time the minimum time required for the CAN network to send 8 bytes, and the maximum number of CAN messages corresponding to the diagnostic response message.
  • the device further includes:
  • the calculation module is used to calculate the minimum depth of the first FIFO mechanism through the first calculation formula.
  • D1 is the minimum depth of the first FIFO mechanism
  • P is the sum of the number of nodes in each network in the vehicle
  • Z1 is the number of CAN messages corresponding to the maximum diagnostic response message
  • Tmax is the maximum value of the first time and the second time
  • Tcan is the minimum time required to send 8 bytes over the CAN network.
  • the second sending module is specifically used to:
  • data link layer routing is performed on the diagnostic request message, and the diagnostic response message is sent to the diagnostic instrument as a CAN diagnostic response message.
  • the minimum depth of the second FIFO mechanism is level 8
  • the first diagnosis scenario is any of the following:
  • the diagnostic instrument supports the CANFD communication protocol, and the target node is the CANFD node.
  • the diagnostic instrument supports CAN communication protocol, and the target node is a CAN node.
  • the diagnostic instrument supports CAN communication protocol, and the target node is CANFD node.
  • the minimum depth of the second FIFO mechanism is 333 levels.
  • the device further includes:
  • the configuration module is used to configure the OBD diagnostic interface of the vehicle to be compatible with the CAN working mode and the CANFD working mode.
  • the baud rate of the CAN working mode is consistent with the baud rate of the vehicle CAN
  • the baud rate of the CANFD working mode is consistent with the whole vehicle CAN baud rate.
  • the baud rate of the car CANFD is consistent.
  • the device further includes:
  • Generating module used to: generate a diagnostic routing table according to the type of each node in the vehicle,
  • the first sending module is specifically used for:
  • diagnostic routing table perform data link layer routing on the diagnostic request message and forward the diagnostic request message to the target node.
  • the second sending module is specifically used for:
  • diagnostic routing table data link layer routing is performed on the diagnostic response message, and the diagnostic response message is sent to the diagnostic instrument as a CAN diagnostic response message.
  • inventions of the present application provide a vehicle diagnostic device.
  • the device includes: a processor and a memory storing computer program instructions.
  • the processor executes the computer program instructions, the vehicle diagnostic method of the first aspect is implemented.
  • embodiments of the present application provide a computer storage medium.
  • Computer program instructions are stored on the computer-readable storage medium.
  • the implementation of the first aspect is implemented. vehicle diagnostic methods.
  • embodiments of the present application provide a computer program product, wherein when instructions in the computer program product are executed by a processor of an electronic device, the electronic device causes the electronic device to perform the vehicle diagnosis method as in the first aspect.
  • FIG. 1 is a schematic diagram of the vehicle network architecture provided by the embodiment of this application.
  • FIG. 2 is one of the schematic flow diagrams of the vehicle diagnosis method provided by the embodiment of the present application.
  • FIG. 3 is the second schematic flowchart of the vehicle diagnosis method provided by the embodiment of the present application.
  • Figure 4 is a schematic structural diagram of a vehicle diagnostic device provided by an embodiment of the present application.
  • Figure 5 is a schematic structural diagram of a vehicle diagnostic device provided by an embodiment of the present application.
  • CAN communication protocol The baud rate supports a maximum of 1 megabit per second (Mbps).
  • a CAN message at the data link layer can carry up to 8 bytes of data, which is the data of a CAN message at the data link layer.
  • the length code (Data Length Code, DLC) is 8 bytes.
  • CANFD communication protocol The baud rate supports a maximum of 5Mbps, and a CANFD message at the data link layer can carry up to 64 bytes of data. That is, the DLC of a CAN message at the data link layer is 64 bytes.
  • the diagnostic transmission protocol used by CAN and the diagnostic transmission protocol used by CANFD are also different: in the CAN transmission protocol, the maximum length of a single frame, the first frame and consecutive frames is 8 bytes. CANFD transmission protocol, the maximum length of a single frame, the first frame and consecutive frames is 64 bytes.
  • the gateway needs to perform protocol conversion between CAN and CANFD (baud rate conversion and data format conversion). This protocol conversion takes a certain amount of time, so when performing a CANFD network node software update, although the CANFD transmission rate is higher than CAN, the update speed is slower than that of the CAN node.
  • protocol conversion takes a certain amount of time, so when performing a CANFD network node software update, although the CANFD transmission rate is higher than CAN, the update speed is slower than that of the CAN node.
  • Diagnostic instrument also called diagnostic equipment or testing equipment.
  • the vehicle manufacturer's diagnostic instrument can be updated immediately as the vehicle design develops, and can support the CANFD communication protocol.
  • the largest data flow scenario is that the diagnostic instrument sends functional addressing, and all CAN and CANFD nodes send multi-frame response data to the diagnostic instrument.
  • the amount of data is not large.
  • the data sent by each node is generally no more than 100 bytes. Even if there are 100 nodes on the vehicle, the time required to transmit data is less than 0.5s to complete the diagnosis.
  • the diagnostic instrument will transmit a large amount of data to the CAN and CANFD nodes.
  • the data can range from 100,000 bytes to tens of millions of bytes. Therefore, it is necessary to give full play to the CANFD bandwidth performance of the OBD diagnostic CAN interface in the refresh scenario to improve refresh efficiency and shorten refresh time.
  • a vehicle may include at least one CAN network and at least one CANFD network. Further, each CAN network may include at least one CAN node, and the number of CAN nodes included in different CAN networks may be equal or unequal. Each CANFD network may include at least one CANFD node, and the number of CANFD nodes included in different CANFD networks may be equal or unequal.
  • the vehicle network design can be expressed as:
  • All CAN networks communicate at the same rate (such as 500 kilobits per second (Kbps)).
  • the communication rate of all CANFD networks is the same.
  • the CANFD communication protocol distinguishes the communication rate of the data domain (such as 2Mbps) and the communication rate of the non-data domain (500Kbps).
  • the communication rate of the non-data domain can be the same as that of traditional CAN.
  • the gateway since the communication rates of all CAN networks are the same, the gateway does not need to convert the communication rate when communicating with the nodes of each CAN network. Similarly, since the communication rates of all CANFD networks are the same, the gateway communicates with the nodes of each CAN network. CANFD network nodes do not need to convert the communication rate when communicating, which can reduce the complexity of the gateway software and thus reduce the cost of gateway development.
  • vehicle network can also be any vehicle network.
  • vehicle network can also be any vehicle network.
  • the communication rates can be different, or for different CANFD networks, the communication rates can be designed to be different.
  • the transmission path is: diagnostic instrument ⁇ vehicle's OBD diagnostic interface ⁇ vehicle gateway ⁇ vehicle node (CAN node or CANFD node), that is, the diagnostic instrument sends a diagnostic request message, after the vehicle's OBD diagnostic interface receives the diagnosis request message sent by the diagnostic instrument, it transmits it to the vehicle's gateway, and then the vehicle's gateway forwards it to the vehicle's node.
  • diagnostic instrument ⁇ vehicle's OBD diagnostic interface ⁇ vehicle gateway ⁇ vehicle node (CAN node or CANFD node), that is, the diagnostic instrument sends a diagnostic request message, after the vehicle's OBD diagnostic interface receives the diagnosis request message sent by the diagnostic instrument, it transmits it to the vehicle's gateway, and then the vehicle's gateway forwards it to the vehicle's node.
  • vehicle node CAN node or CANFD node
  • the transmission path is: vehicle node (CAN node and CANFD node) ⁇ vehicle gateway ⁇ vehicle OBD diagnostic interface ⁇ diagnostic instrument, that is, the vehicle node responds to the diagnostic request message and sends a diagnostic response message. It is transmitted to the vehicle's gateway, which then sends it to the diagnostic instrument through the vehicle's OBD diagnostic interface.
  • vehicle node CAN node and CANFD node
  • vehicle gateway ⁇ vehicle OBD diagnostic interface
  • diagnostic instrument that is, the vehicle node responds to the diagnostic request message and sends a diagnostic response message. It is transmitted to the vehicle's gateway, which then sends it to the diagnostic instrument through the vehicle's OBD diagnostic interface.
  • the vehicle communicates with the diagnostic instrument through the OBD diagnostic interface.
  • the OBD diagnostic CAN interface can be compatible with the CAN communication protocol and the CANFD communication protocol.
  • the current diagnostic solution is: in a common diagnostic scenario, when the diagnostic instrument accesses the CAN node, it sends a CAN message, the gateway performs CAN-CAN data link layer routing, and the diagnostic instrument accesses the CANFD node. When, a CANFD message is sent, the gateway performs CANFD-CANFD data link layer routing. In the diagnostic refresh scenario, the diagnostic instrument sends a CANFD message. If the target is a CAN node, the gateway performs transport layer routing. If the target is a CANFD node, the gateway performs data link layer routing.
  • the above diagnostic solution can make full use of the CANFD bandwidth of the OBD diagnostic interface, significantly improving the diagnostic refresh efficiency.
  • the gateway needs to distinguish different diagnostic scenarios to perform different routing on the packets, resulting in high software complexity and high research and development costs for the gateway.
  • embodiments of the present application provide a vehicle diagnosis method, device, equipment, readable storage medium and program product, which can solve the problem in the existing technology that gateways need to distinguish different diagnosis scenarios to perform different routing on messages. , resulting in high complexity of gateway software and high research and development costs.
  • the gateway can perform data link layer routing for both the diagnostic request message and the diagnostic response message, without Differentiate diagnostic scenarios, thereby reducing the software complexity of the gateway.
  • the gateway will send the diagnostic response message sent by the target node to the diagnostic instrument in the form of a CAN diagnostic response message. This can not only reduce the software complexity of the gateway, but also enable the vehicle to support CAN communication.
  • the diagnostic instrument of any communication protocol among the protocol and CANFD communication protocol can perform vehicle diagnosis and has good scalability. It can be seen that the vehicle diagnosis method of the embodiment of the present application has good scalability and can reduce the software complexity of the gateway, thereby reducing the research and development cost of the gateway.
  • Figure 2 is a flow chart of a vehicle diagnosis method provided by an embodiment of the present application.
  • the vehicle diagnosis method shown in Figure 2 can be applied to the vehicle. Specifically, each step in the vehicle diagnosis method shown in Figure 2 can be performed by the gateway of the vehicle.
  • the vehicle diagnosis method may include the following steps:
  • Step 201 Receive a diagnosis request message sent by the diagnostic instrument, where the diagnosis request message is a variable rate controller area network CANFD diagnosis request message or a controller area network CAN diagnosis request message.
  • the vehicle's gateway can receive the diagnostic request message sent by the diagnostic instrument through the OBD diagnostic interface.
  • step 201 the diagnostic instrument sends a diagnostic request message to the vehicle.
  • the diagnostic instrument may be a diagnostic instrument that supports the CAN communication protocol (hereinafter referred to as a CAN diagnostic instrument).
  • the diagnostic request message sent by the CAN diagnostic instrument is a CAN diagnostic request message.
  • step 201 is specifically expressed as: receiving a CAN diagnosis request message sent by the CAN diagnostic instrument.
  • the diagnostic instrument may be a diagnostic instrument that supports CANFD communication protocol (hereinafter referred to as CANFD diagnostic instrument).
  • the diagnosis request message sent by the CANFD diagnostic instrument can be a CAN diagnosis request message or a CANFD diagnosis request message, which can be determined according to actual needs. This is not limited in the embodiments of this application.
  • step 201 is specifically expressed as: receiving a CAN diagnosis request message or a CANFD diagnosis request message sent by the CANFD diagnostic instrument.
  • the diagnostic request message is a CANFD diagnostic request message.
  • step 201 is specifically expressed as: receiving the CANFD diagnosis request message sent by the CANFD diagnostic instrument.
  • the diagnostic instrument there is no need to pay attention to whether the receiving node of the diagnostic request message is CAN
  • the node is still a CANFD node, and the diagnostic request message sent is always a CANFD diagnostic request message.
  • the CANFD diagnostic instrument does not need to distinguish between diagnostic scenarios and directly sends the CANFD diagnostic request message, thereby reducing the software complexity of the diagnostic instrument and reducing the development cost of the diagnostic instrument.
  • Step 202 Perform data link layer routing on the diagnosis request message, and forward the diagnosis request message to a target node, where the target node is a CAN node or a CANFD node.
  • the gateway may perform data link layer routing on the diagnosis request message and forward the diagnosis request message to the target node.
  • the data length code (Data Length Code, DLC) of the diagnosis request message is 8, and the unit of DLC can be bytes, that is, the DLC of the diagnosis request message
  • the limit is 8 bytes, which is the same as the DLC limit of a frame of CAN messages at the data link layer in the CAN communication protocol.
  • the DLC itself is 8.
  • the embodiment of the present application may limit its DLC to 8.
  • the target node is a CAN node
  • the DLC of the diagnostic request message is different from the CAN frame of the data link layer in the CAN communication protocol,
  • the DLC of the message is the same.
  • the gateway can perform data link layer routing on the diagnostic request message and forward it to the target node without performing transport layer conversion, which can improve the routing efficiency of the diagnostic request message.
  • the DLC of a frame of CAN message at the data link layer in the CAN communication protocol is changed to another value, the above-mentioned DLC restriction on the diagnostic request message may be changed accordingly. That is, in the embodiment of the present application, when the target node is a CAN node, the DLC of the diagnosis request message may be equal to the DLC of a CAN message of the data link layer in the CAN communication protocol.
  • the DLC of the diagnostic request message may be smaller than the DLC of a CAN message of the data link layer in the CAN communication protocol.
  • the gateway can also perform data link layer routing on the diagnostic request message and forward it to Target node, but compared to the case where DLC is equal, the diagnostic efficiency will be reduced.
  • the gateway can perform data link layer routing on the diagnosis request message, and It is forwarded to the target node without transport layer conversion, which can improve the routing efficiency of diagnostic request messages.
  • Step 203 Perform data link layer routing on the diagnostic response message sent by the target node, and send the diagnostic response message to the diagnostic instrument as a CAN diagnostic response message.
  • the diagnostic instrument receives the CAN diagnostic response message sent by the vehicle.
  • the target node after receiving the diagnostic request message, the target node can respond to the diagnostic request message, generate a diagnostic response message, and send the diagnostic response message to the gateway.
  • the type of the diagnostic response message sent by the target node is consistent with the type of the target node. That is, for the CAN node, the diagnostic response message sent by it is the CAN diagnostic response message. For a CANFD node, the diagnostic response message it sends is a CANFD diagnostic response message.
  • the DLC of the diagnostic response message when the target node is a CANFD node, the DLC of the diagnostic response message is 8, and the unit of DLC can be bytes, that is, the DLC of the diagnostic response message is limited to 8 bytes, which is the same as CAN
  • the DLC restrictions of a CAN message at the data link layer in the communication protocol are the same.
  • the DLC itself is 8.
  • the embodiment of the present application may limit its DLC to 8.
  • the target node is a CAN node
  • the diagnostic response message is a CANFD diagnostic response message or a CAN diagnostic response message
  • the DLC of the message is the same.
  • the gateway can perform data link layer routing on the diagnostic response message and send it to the diagnostic instrument without performing transmission layer conversion, which can improve the routing efficiency of the diagnostic response message.
  • the DLC of a CAN message at the data link layer in the CAN communication protocol If changed to other values, the above DLC restrictions on diagnostic response messages can be changed accordingly. That is, in the embodiment of the present application, when the target node is a CAN node, the DLC of the diagnostic response message may be equal to the DLC of a CAN message of the data link layer in the CAN communication protocol.
  • the DLC of the diagnostic response message may be smaller than or equal to the DLC of a CAN message of the data link layer in the CAN communication protocol.
  • the gateway can also perform data link layer routing on the diagnostic response message and forward it to the target node. However, compared with the case where the DLCs are equal, the diagnostic efficiency will be reduced.
  • the gateway can perform data link layer routing on the diagnostic response message, and It is sent to the diagnostic instrument without conversion at the transport layer, which can improve the routing efficiency of diagnostic response messages.
  • the gateway can send the diagnostic response message to the diagnostic instrument in the form of a CAN diagnostic response message.
  • any type of diagnostic instrument such as CAN diagnostic instrument and CANFD diagnostic instrument
  • the gateway does not need to pay attention to the type of diagnostic instrument and all send the same diagnostic instrument. type of diagnostic response message.
  • the software complexity of the gateway can be further reduced, and at the same time, the vehicle diagnosis method of the embodiment of the present application can be applied to any type of diagnostic instrument, and has good expansibility.
  • the vehicle diagnosis method of this embodiment on the one hand, by limiting the DLC of the diagnosis request message and the diagnosis response message to 8, the gateway can perform data link layer routing for both the diagnosis request message and the diagnosis response message. There is no need to differentiate between diagnostic scenarios, thus reducing the software complexity of the gateway.
  • the gateway will send the diagnostic response message sent by the target node to the diagnostic instrument in the form of a CAN diagnostic response message. This can not only reduce the software complexity of the gateway, but also enable the vehicle to support vehicle diagnosis using a diagnostic instrument using either CAN communication protocol or CANFD communication protocol, which has good scalability. It can be seen that the vehicle diagnosis method of the embodiment of the present application has good scalability and can reduce the software complexity of the gateway, thereby reducing the research and development cost of the gateway.
  • the diagnostic instrument and the target node can satisfy any of the following:
  • the diagnostic instrument supports the CANFD communication protocol, and the target node is the CANFD node.
  • the diagnostic instrument supports CANFD communication protocol, and the target node is a CAN node.
  • the diagnostic instrument supports CAN communication protocol, and the target node is a CAN node.
  • the diagnostic instrument supports CAN communication protocol, and the target node is the CANFD node.
  • Diagnosis scenario A The diagnostic instrument supports the CANFD communication protocol, and the target node is the CANFD node, that is, the CANFD diagnostic instrument accesses the CANFD node.
  • Diagnosis scenario B The diagnostic instrument supports the CANFD communication protocol, and the target node is the CAN node, that is, the CANFD diagnostic instrument accesses the CAN node.
  • Diagnosis scenario C The diagnostic instrument supports the CAN communication protocol, and the target node is the CAN node, that is, the CAN diagnostic instrument accesses the CAN node.
  • Diagnosis scenario D The diagnostic instrument supports the CAN communication protocol, and the target node is the CANFD node, that is, the CAN diagnostic instrument accesses the CANFD node.
  • the CANFD diagnostic instrument can send CANFD diagnostic request messages and limit the number of CANFD diagnostic request messages to 8.
  • forwarding the diagnostic request message to the target node includes:
  • the target node is a CANFD node
  • the CANFD diagnostic request message is converted into a CAN request message and sent to the CAN node.
  • the gateway can directly perform CANFD-CANFD data link layer routing and send the CANFD diagnostic request message directly to the CANFD node.
  • the gateway can first perform CANFD-CAN conversion to obtain the CAN diagnostic request message, and then perform CAN-CAN data link layer routing to convert the CAN Diagnostic request messages are sent directly to the CAN node.
  • the gateway can perform data link layer routing on the diagnostic request message, and the target node can also receive the diagnostic request message consistent with its type, thereby improving the reliability of vehicle diagnosis.
  • the diagnostic response message is sent to the diagnostic instrument as a CAN diagnostic response message, including:
  • the target node is a CANFD node and the diagnostic request message is a CANFD diagnostic response message
  • the CANFD diagnostic response message is converted into a CAN diagnostic request message and sent to the diagnostic instrument.
  • the target node is a CAN node and the diagnostic request message is a CAN diagnostic response message
  • the CAN diagnostic response message is sent directly to the diagnostic instrument.
  • the target node is a CANFD node
  • the diagnostic response message it sends is a CANFD diagnostic response message
  • its DLC is limited to 8. Since the diagnostic response messages returned by the gateway in the embodiment of the present application to the diagnostic instrument are all CAN diagnostic response messages, the gateway can perform CANFD-CAN conversion after performing data link layer routing on the CANFD diagnostic response message, and the conversion is The CAN diagnostic response message is then returned to the diagnostic instrument.
  • the target node is a CAN node
  • the diagnostic response message it sends is a CAN diagnostic response message. Since the diagnostic response messages returned by the gateway in the embodiment of the present application to the diagnostic instrument are all CAN diagnostic response messages, the gateway can directly return the CAN diagnostic response message to the diagnostic instrument after performing data link layer routing.
  • the diagnostic response message returned by the vehicle to the diagnostic instrument can be a CAN diagnostic response message, which can not only simplify the processing mechanism of the sent diagnostic response message by the gateway, but also enable various types of diagnostic instruments to receive the diagnosis. Respond to messages to ensure the reliability of vehicle diagnosis.
  • a first-in-first-out (FIFO) mechanism in order to prevent the gateway from losing frames when performing data link layer routing on diagnostic messages, a first-in-first-out (FIFO) mechanism can be introduced, so that the gateway can process diagnostic reports based on the FIFO mechanism.
  • the document performs routing at the data link layer.
  • data link layer routing is performed on the diagnostic response message, and the diagnostic request message is The text is forwarded to the target node, which may include:
  • the diagnostic request message is forwarded to the target node, and the data link layer routing is performed on the diagnostic response message.
  • the minimum depth of the first FIFO mechanism is determined based on the following parameters: the number of nodes in each network in the vehicle, the first time required for the vehicle's gateway to receive all CANFD diagnostic response messages, and the time required for the gateway to receive all CANFD diagnostic response messages.
  • the second time the minimum time required for the CAN network to send 8 bytes, and the maximum number of CAN messages corresponding to the diagnostic response message.
  • the first FIFO mechanism can be understood as the gateway's sending FIFO mechanism on the OBD side, which is used to store diagnostic response messages.
  • the information in this case can be used to calculate the minimum depth of the first FIFO mechanism. It can be understood that in other embodiments, information from other situations can also be used to calculate the minimum depth of the first FIFO mechanism, which is not limited in the embodiments of the present application.
  • the maximum length of the diagnostic response message of a node is z.
  • the number of CAN messages corresponding to the maximum diagnostic response message can be calculated through z.
  • z can be divided by 7, rounded, and 1 Calculate the number of CAN messages Z1 corresponding to the maximum diagnostic response message.
  • X1, X2...Xx X1, X2...Xx
  • Ymax Y1, Y2...Yx
  • Tx is the first time required for the gateway to receive all CANFD diagnostic response messages
  • Tcanfd is the minimum time required to send 8 bytes in the CANFD network.
  • Ty is the second time required for the gateway to receive all CAN diagnostic response messages
  • Tcan is the minimum time required to send 8 bytes in the CAN network.
  • the method before performing data link layer routing on the diagnostic response message according to the first-in-first-out FIFO mechanism, the method also includes:
  • D1 is the minimum depth of the first FIFO mechanism
  • P is the sum of the number of nodes in each network in the vehicle
  • P X1+X2+...+Xx+Y1+Y2+...+Yy
  • Z1 is the CAN report corresponding to the maximum diagnostic response message.
  • the number of messages, Tmax is the maximum value of the first time and the second time
  • Tcan is the minimum time required for the CAN network to send 8 bytes.
  • the larger of Tx and Ty can be chosen to calculate the minimum depth of the first FIFO mechanism.
  • the smaller one of Tx and Ty can be selected to calculate the minimum depth of the first FIFO mechanism, which can be determined according to actual needs, and is not limited in the embodiments of this application.
  • D1 is the minimum depth of the first FIFO mechanism.
  • the depth of the first FIFO mechanism may be greater than or equal to D1.
  • the depth unit of the FIFO mechanism can be a set.
  • each level requires at least 13 bytes of cache.
  • the gateway when the gateway performs data link layer routing according to the FIFO mechanism, in the previous sending interrupt, it sends the recently sent data stored in the FIFO queue until the data in the FIFO queue is empty.
  • the minimum depth of the first FIFO mechanism calculated through the above method can prevent the gateway from losing frames when performing data link layer routing on diagnostic response messages, thereby improving the reliability of vehicle diagnosis.
  • data link layer routing is performed on the diagnostic request message, and the diagnostic response message is The message is sent to the diagnostic instrument as a CAN diagnostic response message, including:
  • data link layer routing is performed on the diagnostic request message, and the diagnostic response message is sent to the diagnostic instrument as a CAN diagnostic response message.
  • the minimum depth of the second FIFO mechanism is level 8
  • the first diagnosis scenario is any of the following:
  • the diagnostic instrument supports the CANFD communication protocol, and the target node is the CANFD node.
  • the diagnostic instrument supports CAN communication protocol, and the target node is a CAN node.
  • the diagnostic instrument supports CAN communication protocol, and the target node is CANFD node.
  • the minimum depth of the second FIFO mechanism is 333 levels.
  • the second FIFO mechanism can be understood as the gateway's sending FIFO mechanism on the network side, which is used to store diagnostic request messages.
  • the second FIFO mechanism can be understood as the gateway's sending FIFO mechanism in the CANFD network.
  • the second FIFO mechanism can be understood as the gateway's sending FIFO mechanism in the CAN network.
  • the minimum depth of the second FIFO mechanism is limited to 8
  • the minimum depth of the second FIFO mechanism is limited to 333.
  • each level requires at least 13 bytes of cache. In this way, the gateway will not lose frames when performing data link layer routing on the diagnostic request message, thereby improving the reliability of vehicle diagnosis.
  • the minimum depth of the second FIFO mechanism is an empirical value.
  • the minimum depth of the second FIFO mechanism is determined as follows:
  • the method before receiving the diagnosis request message sent by the diagnostic instrument, the method may further include:
  • the baud rate of the CAN working mode is consistent with the baud rate of the vehicle CAN, and the baud rate of the CANFD working mode is the same as the baud rate of the vehicle CANFD. The rate is consistent.
  • the OBD diagnostic interface can be configured to be compatible with the CAN communication protocol and the CANFD communication protocol.
  • the vehicle can support the CAN diagnostic instrument and the CANFD diagnostic instrument to diagnose the vehicle, thereby improving the scalability of vehicle diagnosis.
  • the method before receiving the diagnosis request message sent by the diagnostic instrument, the method further includes:
  • diagnostic routing table perform data link layer routing on the diagnostic request message and forward the diagnostic request message to the target node.
  • diagnostic routing table data link layer routing is performed on the diagnostic response message, and the diagnostic response message is sent to the diagnostic instrument as a CAN diagnostic response message.
  • CANFD diagnostic instrument
  • CANFD diagnostic instrument
  • CANFD diagnostic instrument
  • CANFD diagnostic instrument
  • CANFD diagnostic instrument
  • CANFD diagnostic instrument
  • CANFD diagnostic instrument
  • CANFD diagnostic instrument
  • the above routing relationship can be used to generate a diagnostic routing table, and then data link layer routing can be performed based on the diagnostic routing table, thereby improving routing efficiency.
  • the diagnostic instrument supports CANFD communication protocol and accesses CANFD nodes.
  • the diagnostic instrument supports CANFD communication protocol and accesses CAN nodes.
  • the diagnostic instrument supports CAN communication protocol and accesses CAN nodes.
  • the diagnostic instrument supports CAN communication protocol and accesses CANFD nodes.
  • the communication speed of all CAN networks is the same (such as 500Kbps).
  • the communication rate of all CANFD networks is the same.
  • the CANFD protocol distinguishes between the communication rate of the data domain (such as 2Mbps) and the communication rate of the non-data domain (500Kbps).
  • the communication rate of the non-data domain is the same as that of traditional CAN.
  • the CANFD communication interface is the interface through which the CANFD network connects to the network.
  • the CANFD communication interface is compatible with traditional CAN communication interfaces. In this way, the CANFD communication interface can receive and send traditional CAN messages.
  • the diagnostic instrument can send CAN diagnostic request messages.
  • the diagnostic instrument supports the CANFD communication protocol.
  • the node When accessing the CANFD node, the node is restricted to only send diagnostic response messages with a DLC of 8.
  • the gateway For the CANFD message of the diagnostic instrument, the gateway performs message routing at the data link layer, forwards the request message from the diagnostic instrument directly to the CANFD network, and forwards the CANFD diagnostic response message of the node in the CANFD network, and the gateway performs the data link layer Message routing, CANFD messages are converted into traditional CAN messages and sent to the OBD diagnostic interface.
  • the gateway's sending FIFO mechanism on the OBD side, and the depth calculation of FIFO Assume there are x CANFD networks, the number of nodes in each network is X1, X2...Xx, and y CAN networks, and the number of nodes in each network is Y1, Y2...Yy . In the case of functional addressing, the maximum length of a node's response message is z. Calculate the number of CAN messages required to send the data by dividing z by 7 and adding 1 to Z1.
  • Tcanfd is the minimum time required to send 8 bytes in the CANFD network
  • Tcan is the minimum time required to send 8 bytes in the CAN network
  • Tmax is the largest of Ty and Tx. number
  • the minimum depth of FIFO is (X1+X2+...+Xx+Y1+Y2+...+Yy)*Z1-Trmax/Tcan.
  • Each level requires at least 13 bytes of cache. In the last send interrupt, the most recently sent data stored in the FIFO is sent until the data in the FIFO is empty.
  • the FIFO depth of the gateway in the CANFD network is not less than 8 levels.
  • Each level requires at least 13 bytes of cache.
  • the diagnostic instrument supports the CANFD communication protocol, and the node accessing CAN: the diagnostic instrument can send CANFD diagnostic request messages with a DLC of 8 (actually the diagnostic instrument can send CANFD messages with a DLC greater than 8, but the gateway needs to perform TP layer conversion , the routing efficiency is relatively low, so it is restricted in this patent to improve efficiency).
  • the gateway performs message routing at the data link layer, forwards the request message of the diagnostic instrument directly to the CAN network, and routes the nodes in the CAN network The CAN diagnostic response message is directly forwarded to the OBD diagnostic interface.
  • the gateway sends FIFO mechanism in the CAN network, and the FIFO depth is at least 333 levels. Each level requires at least 13 bytes of cache. In the last send interrupt, the most recently sent data stored in the FIFO is sent until the data in the FIFO is empty.
  • the transmit FIFO of the gateway on the OBD side reuses the FIFO of scenario A.
  • the diagnostic instrument supports the CAN communication protocol and accesses the CAN node: the diagnostic instrument sends a traditional CAN diagnostic request message, and the gateway performs message routing at the data link layer, forwards the diagnostic instrument's request message directly to the CAN network, and converts the CAN CAN diagnostic response messages from nodes in the network are directly forwarded to the OBD diagnostic interface.
  • the transmit FIFO of the gateway on the OBD side reuses the FIFO of scenario A.
  • the gateway's sending FIFO depth in the CAN network is not less than 8 levels. Each level requires at least 13 bytes of cache.
  • the diagnostic instrument supports the CAN communication protocol, accesses the CANFD node, and restricts the node to only send diagnostic response messages with a DLC of 8.
  • the diagnostic instrument sends a traditional CAN diagnostic request message, the gateway performs routing at the data link layer, converts the received message into a CANFD message and sends it to the target network, and sends the CANFD diagnostic response message of the node in the CANFD network, and the gateway executes the data link Message routing at the road layer converts CANFD messages into traditional CAN messages and sends them to the OBD diagnostic interface.
  • the transmit FIFO of the gateway on the OBD side reuses the FIFO of scenario A.
  • the depth of the FIFO of the gateway in the CANFD network is not less than 8 levels. Each level requires at least 13 bytes of cache.
  • Step 301 According to the vehicle network design, preset the routing table between CANFD-CANFD, the routing table between CAN-CAN and the routing table between CAN-CANFD.
  • Routing table between diagnostic interface and CANFD network There are four routing relationships between the diagnostic instrument and the CANFD node: CANFD (diagnostic instrument) ⁇ CANFD (node), CAN (diagnostic instrument) ⁇ CANFD (node), CANFD (node) ⁇ CAN (diagnostic instrument), CANFD (node) ⁇ CANFD (diagnostic instrument).
  • Routing table between diagnostic interface and CAN network There are four routing relationships between diagnostic instruments and CAN nodes: CANFD (diagnostic instrument) ⁇ CAN (node), CAN (diagnostic instrument) ⁇ CAN (node), CAN (node) ⁇ CAN (diagnostic instrument), CAN (node) ⁇ CANFD (diagnostic instrument).
  • Step 302 Configure the gateway OBD diagnostic CAN interface according to the vehicle network design.
  • the gateway OBD diagnostic CAN interface can be configured to work in a manner compatible with CAN and CANFD based on the CAN baud rate and CANFD baud rate designed for the vehicle network. Its baud rate is consistent with the vehicle's CAN and CANFD baud rates. The special rates are the same.
  • Step 303 The diagnostic instrument sends request messages that are all CANFD messages. If the target node is a CAN node, the DLC limit is 8, and the response message received is a CAN message.
  • the diagnostic instrument in step 303 is a vehicle diagnostic instrument and supports the CANFD communication protocol.
  • a diagnosis request whether the target is a CAN node or a CANFD node, it sends a CANFD message.
  • the target node is a CAN node
  • the DLC limit of the request message is 8.
  • Step 304 The target node, if it is a CANFD node, the DLC limit of the diagnostic response message is 8.
  • Step 305 The gateway combines the FIFO mechanism to perform data link layer routing for the diagnostic message.
  • the diagnostic messages (requests and responses) received by the gateway are used with the FIFO mechanism to perform data link layer routing based on the routing table in S001.
  • the system has good scalability and can adapt to the new vehicle communication technology CANFD.
  • the CANFD baud rate of OBD's CAN is fully utilized to transmit update data, and parallel refresh is supported. This improves the efficiency of updating CAN nodes without reducing the efficiency of CANFD node update, thereby improving the efficiency of vehicle software refresh.
  • this application also provides a specific implementation of the vehicle diagnosis device. See the examples below.
  • the vehicle diagnostic device provided by the embodiment of the present application may include:
  • the first receiving module 401 is used to receive a diagnosis request message sent by the diagnostic instrument, where the diagnosis request message is a variable rate controller area network CANFD diagnosis request message or a controller area network CAN diagnosis request message,
  • the first sending module 402 is used to perform data link layer routing on the diagnosis request message, and forward the diagnosis request message to the target node, where the target node is a CAN node or a CANFD node,
  • the second sending module 403 is used to perform data link layer routing on the diagnostic response message sent by the target node, and send the diagnostic response message to the diagnostic instrument in the form of a CAN diagnostic response message.
  • the data length code DLC of the diagnostic request message is 8
  • the target node is a variable rate controller LAN CANFD node
  • the DLC of the diagnostic response message is 8.
  • the diagnostic instrument and target node satisfy any of the following:
  • the diagnostic instrument supports the CANFD communication protocol, and the target node is the CANFD node.
  • the diagnostic instrument supports CANFD communication protocol, and the target node is a CAN node.
  • the diagnostic instrument supports CAN communication protocol, and the target node is a CAN node.
  • the diagnostic instrument supports CAN communication protocol, and the target node is the CANFD node.
  • the diagnostic request message is a CANFD diagnostic request message.
  • the first sending module 402 is specifically used to:
  • the target node is a CANFD node
  • the CANFD diagnostic request message is converted into a CAN request message and sent to the CAN node.
  • the second sending module 403 is specifically used to:
  • the target node is a CANFD node and the diagnostic request message is a CANFD diagnostic response message
  • the CANFD diagnostic response message is converted into a CAN diagnostic request message and sent to the diagnostic instrument.
  • the target node is a CAN node and the diagnostic request message is a CAN diagnostic response message
  • the CAN diagnostic response message is sent directly to the diagnostic instrument.
  • the first sending module 402 is specifically used to:
  • the diagnostic request message is forwarded to the target node, and the data link layer routing is performed on the diagnostic response message.
  • the minimum depth of the first FIFO mechanism is determined based on the following parameters: the number of nodes in each network in the vehicle, the first time required for the vehicle's gateway to receive all CANFD diagnostic response messages, and the time required for the gateway to receive all CANFD diagnostic response messages.
  • the second time the minimum time required for the CAN network to send 8 bytes, and the maximum number of CAN messages corresponding to the diagnostic response message.
  • the device further includes:
  • the calculation module is used to calculate the minimum depth of the first FIFO mechanism through the first calculation formula.
  • D1 is the minimum depth of the first FIFO mechanism
  • P is the sum of the number of nodes in each network in the vehicle
  • Z1 is the number of CAN messages corresponding to the maximum diagnostic response message
  • Tmax is the maximum value of the first time and the second time
  • Tcan is the minimum time required to send 8 bytes over the CAN network.
  • the second sending module 403 is specifically used to:
  • data link layer routing is performed on the diagnostic request message, and the diagnostic response
  • the response message is sent to the diagnostic instrument in the form of a CAN diagnostic response message.
  • the minimum depth of the second FIFO mechanism is level 8
  • the first diagnosis scenario is any of the following:
  • the diagnostic instrument supports the CANFD communication protocol, and the target node is the CANFD node.
  • the diagnostic instrument supports CAN communication protocol, and the target node is a CAN node.
  • the diagnostic instrument supports CAN communication protocol, and the target node is CANFD node.
  • the minimum depth of the second FIFO mechanism is 333 levels.
  • the device further includes:
  • the configuration module is used to configure the OBD diagnostic interface of the vehicle to be compatible with the CAN working mode and the CANFD working mode.
  • the baud rate of the CAN working mode is consistent with the baud rate of the vehicle CAN
  • the baud rate of the CANFD working mode is consistent with the whole vehicle CAN baud rate.
  • the baud rate of the car CANFD is consistent.
  • the device further includes:
  • Generating module used to: generate a diagnostic routing table according to the type of each node in the vehicle,
  • the first sending module 402 is specifically used for:
  • diagnostic routing table perform data link layer routing on the diagnostic request message and forward the diagnostic request message to the target node.
  • the second sending module 403 is specifically used for:
  • diagnostic routing table data link layer routing is performed on the diagnostic response message, and the diagnostic response message is sent to the diagnostic instrument as a CAN diagnostic response message.
  • the vehicle diagnostic device provided by the embodiment of the present application can implement each process in the method embodiment of Figure 2. To avoid duplication, the details will not be described here.
  • FIG. 5 shows a schematic diagram of the hardware structure of vehicle diagnosis provided by the embodiment of the present application.
  • the vehicle diagnostic device may include a processor 501 and a memory 502 storing computer program instructions.
  • the above-mentioned processor 501 may include a central processing unit (CPU), or a specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits that can be configured to implement embodiments of the present application.
  • CPU central processing unit
  • ASIC Application Specific Integrated Circuit
  • Memory 502 may include bulk storage for data or instructions.
  • the memory 502 may include a hard disk drive (HDD), a floppy disk drive, flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a Universal Serial Bus (USB) drive or two or more A combination of many of the above.
  • Memory 502 may include removable or non-removable (or fixed) media, where appropriate.
  • the memory 502 may be internal or external to the integrated gateway disaster recovery device.
  • memory 502 is non-volatile solid-state memory.
  • Memory may include read-only memory (ROM), random access memory (Random Access Memory, RAM), magnetic disk storage media devices, optical storage media devices, flash memory devices, electrical, optical or other physical/tangible memories storage device.
  • ROM read-only memory
  • RAM random access memory
  • magnetic disk storage media devices e.g., magnetic disks
  • optical storage media devices e.g., magnetic disks
  • flash memory devices e.g., electrical, optical or other physical/tangible memories storage device.
  • memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or multiple processors) operable to perform the operations described with reference to a method according to an aspect of the present disclosure.
  • the processor 501 reads and executes the computer program instructions stored in the memory 502 to implement any of the vehicle diagnosis methods in the above embodiments.
  • the vehicle diagnostic device may also include communication interface 505 and bus 510 .
  • the processor 501, the memory 502, and the communication interface 505 are connected through the bus 510 and complete communication with each other.
  • the communication interface 505 is mainly used to implement communication between modules, devices, units and/or equipment in the embodiments of this application.
  • Bus 510 includes hardware, software, or both, coupling the components of the vehicle diagnostic equipment to one another.
  • the bus may include Accelerated Graphics Port (AGP) or other graphics bus, Enhanced Industry Standard Architecture (EISA) bus, Front Side Bus (FSB), HyperTransport (HT) interconnect, Industry Standard Architecture (ISA) buses, infinite bandwidth interconnects, low pin count (LPC) buses, memory buses, Micro Channel Architecture (MCA) bus, Peripheral Component Interconnect (PCI) bus, PCI-Express (PCI-X) bus, Serial Advanced Technology Attachment (SATA) bus, Video Electronics Standards Association Local (VLB) bus, or other suitable bus or a combination of two or more of these.
  • bus 510 may include one or more buses.
  • the embodiment of the present application may provide a computer storage medium for implementation.
  • the computer storage medium stores computer program instructions.
  • the computer program instructions are executed by the processor, any one of the vehicle diagnosis methods in the above embodiments is implemented.
  • the functional blocks shown in the above structural block diagram can be implemented as hardware, software, firmware or a combination thereof.
  • it may be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, or the like.
  • ASIC application specific integrated circuit
  • elements of the application are programs or code segments that are used to perform the required tasks.
  • the program or code segments may be stored in a machine-readable medium or transmitted over a transmission medium or communications link via a data signal carried in a carrier wave.
  • "Machine-readable medium” may include any medium capable of storing or transmitting information.
  • machine-readable media examples include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, and the like.
  • Code segments may be downloaded via computer networks such as the Internet, intranets, and the like.
  • Such a processor may be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It will also be understood that each block in the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can also be implemented by special purpose hardware that performs the specified functions or actions, or can be implemented by special purpose hardware and A combination of computer instructions.

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Automation & Control Theory (AREA)
  • Vehicle Cleaning, Maintenance, Repair, Refitting, And Outriggers (AREA)
  • Small-Scale Networks (AREA)

Abstract

提供了一种车辆诊断方法、装置、设备、可读存储介质及程序产品。方法包括:接收诊断仪发送的诊断请求报文,诊断请求报文为可变速率控制器局域网CANFD诊断请求报文或控制器局域网CAN诊断请求报文(201);对诊断请求报文执行数据链路层的路由,转发至目标节点,目标节点为CAN节点或CANFD节点(202);对诊断响应报文执行数据链路层的路由,以CAN诊断响应报文发送至诊断仪(203),在目标节点为CAN节点的情况下,诊断请求报文的DLC为8,在目标节点为CANFD节点的情况下,诊断响应报文的DLC为8。

Description

车辆诊断方法、装置、设备、可读存储介质及程序产品
相关申请的交叉引用
本申请要求享有于2022年08月16日提交的名称为“车辆诊断方法、装置、设备、可读存储介质及程序产品”的中国专利申请202210982180.2的优先权,该申请的全部内容通过引用并入本文中。
技术领域
本申请属于车辆诊断技术领域,具体涉及一种车辆诊断方法、装置、设备、可读存储介质及程序产品。
背景技术
随着汽车通信技术的发展,在整车网络中出现了新的通信技术:可变速率控制器局域网(Controller Area Network with Flexible Data rate,CANFD)。如图1所示,出现了控制器局域网(Controller Area Network,CAN)和CANFD两种总线通信技术并存的整车网络架构。通常整车厂出于安全考虑,车辆的车载诊断系统(On Board Diagnostic,OBD)诊断接口,仅开放一路诊断CAN的接口连接外部诊断仪。外部诊断仪通过OBD诊断CAN接口,访问车辆内CAN网络和CANFD网络中的节点。
申请内容
第一方面,本申请实施例提供一种车辆诊断方法,应用于车辆,包括:
接收诊断仪发送的诊断请求报文,其中,诊断请求报文为可变速率控制器局域网CANFD诊断请求报文或控制器局域网CAN诊断请求报文,
对诊断请求报文执行数据链路层的路由,将诊断请求报文转发至目标节点,其中,目标节点为CAN节点或CANFD节点,
对目标节点发送的诊断响应报文执行数据链路层的路由,将诊断响应报文以CAN诊断响应报文发送至诊断仪,
其中,在目标节点为CAN节点的情况下,诊断请求报文的数据长度代码DLC为8,在目标节点为可变速率控制器局域网CANFD节点的情况下,诊断响应报文的DLC为8。
在一些实施例中,诊断仪和目标节点满足以下任一项:
诊断仪支持CANFD通信协议,目标节点为CANFD节点,
诊断仪支持CANFD通信协议,目标节点为CAN节点,
诊断仪支持CAN通信协议,目标节点为CAN节点,
诊断仪支持CAN通信协议,目标节点为CANFD节点。
在一些实施例中,在诊断仪支持CANFD通信协议的情况下,诊断请求报文为CANFD诊断请求报文。
在一些实施例中,将诊断请求报文转发至目标节点,包括:
在目标节点为CANFD节点的情况下,将CANFD诊断请求报文直接发送至CANFD节点,
在目标节点为CAN节点的情况下,将CANFD诊断请求报文转换为CAN请求报文发送至CAN节点。
在一些实施例中,将诊断响应报文以CAN诊断响应报文发送至诊断仪,包括:
在目标节点为CANFD节点,诊断请求报文为CANFD诊断响应报文的情况下,将CANFD诊断响应报文转换为CAN诊断请求报文发送至诊断仪,
在目标节点为CAN节点,诊断请求报文为CAN诊断响应报文的情况下,将CAN诊断响应报文直接发送至诊断仪。
在一些实施例中,对诊断响应报文执行数据链路层的路由,将诊断请求报文转发至目标节点,包括:
根据第一先入先出FIFO机制,将诊断请求报文转发至目标节点,对诊断响应报文执行数据链路层的路由,
其中,第一FIFO机制的最小深度基于以下参数确定:车辆中各网络的节点数量,车辆的网关接收全部CANFD诊断响应报文所需的第一时间,网关接收全部CAN诊断响应报文所需的第二时间,CAN网络发送8个字节所需要的最小时间,以及最大诊断响应消息对应的CAN报文数量。
在一些实施例中,根据第一先入先出FIFO机制,对诊断响应报文执行数据链路层的路由之前,方法还包括:
通过第一计算公式,计算第一FIFO机制的最小深度,第一计算公式为:
D1=P×Z1-Tmax-Tcan
其中,D1为第一FIFO机制的最小深度,P为车辆中各网络的节点数量的总和,Z1为最大诊断响应消息对应的CAN报文数量,Tmax为第一时间和第二时间的最大值,Tcan为CAN网络发送8个字节所需要的最小时间。
在一些实施例中,对诊断请求报文执行数据链路层的路由,将诊断响应报文以CAN诊断响应报文发送至诊断仪,包括:
根据第二FIFO机制,对诊断请求报文执行数据链路层的路由,将诊断响应报文以CAN诊断响应报文发送至诊断仪,
其中,在第一诊断场景下,第二FIFO机制的最小深度为8级,第一诊断场景为以下任一项:
诊断仪支持CANFD通信协议,目标节点为CANFD节点,
诊断仪支持CAN通信协议,目标节点为CAN节点,
诊断仪支持CAN通信协议,目标节点为CANFD节点,
在诊断仪支持CANFD通信协议,目标节点为CAN节点的诊断场景下,第二FIFO机制的最小深度为333级。
在一些实施例中,接收诊断仪发送的诊断请求报文之前,方法还包括:
将车辆的OBD诊断接口配置为兼容CAN工作方式和CANFD工作方式,其中,CAN工作方式的波特率与整车CAN的波特率一致,CANFD工作方式的波特率与整车CANFD的波特率一致。
在一些实施例中,接收诊断仪发送的诊断请求报文之前,方法还包括:
根据车辆中各节点的类型,生成诊断路由表,
对诊断请求报文执行数据链路层的路由,将诊断请求报文转发至目标节点,包括:
根据诊断路由表,对诊断请求报文执行数据链路层的路由,将诊断请求报文转发至目标节点,
对诊断响应报文执行数据链路层的路由,将诊断响应报文以CAN诊断响应报文发送至诊断仪,包括:
根据诊断路由表,对诊断响应报文执行数据链路层的路由,将诊断响应报文以CAN诊断响应报文发送至诊断仪。
在一些实施例中,接收诊断仪发送的诊断请求报文之前,方法还包括:
诊断仪向车辆发送诊断请求报文,
将诊断响应报文以CAN诊断响应报文发送至诊断仪之后,方法还包括:
诊断仪接收车辆发送的CAN诊断响应报文。
第二方面,本申请实施例提供了一种车辆诊断装置,装置包括:
第一接收模块,用于接收诊断仪发送的诊断请求报文,其中,诊断请求报文为可变速率控制器局域网CANFD诊断请求报文或控制器局域网CAN诊断请求报文,
第一发送模块,用于对诊断请求报文执行数据链路层的路由,将诊断请求报文转发至目标节点,其中,目标节点为CAN节点或CANFD节点,
第二发送模块,用于对目标节点发送的诊断响应报文执行数据链路层的路由,将诊断响应报文以CAN诊断响应报文发送至诊断仪,
其中,在目标节点为CAN节点的情况下,诊断请求报文的数据长度代码DLC为8,在目标节点为CANFD节点的情况下,诊断响应报文的DLC为8。
在一些实施例中,诊断仪和目标节点满足以下任一项:
诊断仪支持CANFD通信协议,目标节点为CANFD节点,
诊断仪支持CANFD通信协议,目标节点为CAN节点,
诊断仪支持CAN通信协议,目标节点为CAN节点,
诊断仪支持CAN通信协议,目标节点为CANFD节点。
在一些实施例中,在诊断仪支持CANFD通信协议的情况下,诊断请求报文为CANFD诊断请求报文。
在一些实施例中,第一发送模块具体用于:
在目标节点为CANFD节点的情况下,将CANFD诊断请求报文直接发送至CANFD节点,
在目标节点为CAN节点的情况下,将CANFD诊断请求报文转换为CAN请求报文发送至CAN节点。
在一些实施例中,第二发送模块具体用于:
在目标节点为CANFD节点,诊断请求报文为CANFD诊断响应报文的情况下,将CANFD诊断响应报文转换为CAN诊断请求报文发送至诊断仪,
在目标节点为CAN节点,诊断请求报文为CAN诊断响应报文的情况下,将CAN诊断响应报文直接发送至诊断仪。
在一些实施例中,第一发送模块具体用于:
根据第一先入先出FIFO机制,将诊断请求报文转发至目标节点,对诊断响应报文执行数据链路层的路由,
其中,第一FIFO机制的最小深度基于以下参数确定:车辆中各网络的节点数量,车辆的网关接收全部CANFD诊断响应报文所需的第一时间,网关接收全部CAN诊断响应报文所需的第二时间,CAN网络发送8个字节所需要的最小时间,以及最大诊断响应消息对应的CAN报文数量。
在一些实施例中,装置还包括:
计算模块,用于通过第一计算公式,计算第一FIFO机制的最小深度,第一计算公式为:
D1=P×Z1-Tmax-Tcan
其中,D1为第一FIFO机制的最小深度,P为车辆中各网络的节点数量的总和,Z1为最大诊断响应消息对应的CAN报文数量,Tmax为第一时间和第二时间的最大值,Tcan为CAN网络发送8个字节所需要的最小时间。
在一些实施例中,第二发送模块具体用于:
根据第二FIFO机制,对诊断请求报文执行数据链路层的路由,将诊断响应报文以CAN诊断响应报文发送至诊断仪,
其中,在第一诊断场景下,第二FIFO机制的最小深度为8级,第一诊断场景为以下任一项:
诊断仪支持CANFD通信协议,目标节点为CANFD节点,
诊断仪支持CAN通信协议,目标节点为CAN节点,
诊断仪支持CAN通信协议,目标节点为CANFD节点,
在诊断仪支持CANFD通信协议,目标节点为CAN节点的诊断场景下,第二FIFO机制的最小深度为333级。
在一些实施例中,装置还包括:
配置模块,用于将车辆的OBD诊断接口配置为兼容CAN工作方式和CANFD工作方式,其中,CAN工作方式的波特率与整车CAN的波特率一致,CANFD工作方式的波特率与整车CANFD的波特率一致。
在一些实施例中,装置还包括:
生成模块,用于:根据车辆中各节点的类型,生成诊断路由表,
第一发送模块具体用于:
根据诊断路由表,对诊断请求报文执行数据链路层的路由,将诊断请求报文转发至目标节点,
第二发送模块具体用于:
根据诊断路由表,对诊断响应报文执行数据链路层的路由,将诊断响应报文以CAN诊断响应报文发送至诊断仪。
第三方面,本申请实施例提供了一种车辆诊断设备,设备包括:处理器以及存储有计算机程序指令的存储器,处理器执行计算机程序指令时实现如第一方面的车辆诊断方法。
第四方面,本申请实施例提供了一种计算机存储介质,计算机可读存储介质上存储有计算机程序指令,计算机程序指令被处理器执行时实现如第一方面 的车辆诊断方法。
第五方面,本申请实施例提供了一种计算机程序产品,其中,计算机程序产品中的指令由电子设备的处理器执行时,使得电子设备执行如第一方面的车辆诊断方法。
附图说明
图1是本申请实施例提供的整车网络架构的示意图,
图2是本申请实施例提供的车辆诊断方法的流程示意图之一,
图3是本申请实施例提供的车辆诊断方法的流程示意图之二,
图4是本申请实施例提供的车辆诊断装置的结构示意图,
图5是本申请实施例提供的车辆诊断设备的结构示意图。
具体实施方式
下面将详细描述本申请的各个方面的特征和示例性实施例,为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及具体实施例,对本申请进行进一步详细描述。应理解,此处所描述的具体实施例仅意在解释本申请,而不是限定本申请。对于本领域技术人员来说,本申请可以在不需要这些具体细节中的一些细节的情况下实施。下面对实施例的描述仅仅是为了通过示出本申请的示例来提供对本申请更好的理解。
需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括……”限定的要素,并不排除在包括要素的过程、方法、物品或者设备中还存在另外的相同要素。
为了方便理解,以下对本申请实施例涉及的一些内容进行说明:
一、通信协议。
CAN通信协议:波特率最大支持1兆比特每秒(Mbps),一帧数据链路层的CAN报文最大携带8个字节的数据,即一帧数据链路层的CAN报文的数据长度代码(Data Length Code,DLC)为8个字节。
CANFD通信协议:波特率最大支持5Mbps,一帧数据链路层的CANFD报文最大携带64个字节的数据,即一帧数据链路层的CAN报文的DLC为64个字节。
在诊断过程中,CAN使用的诊断传输协议和CANFD使用的诊断传输协议也存在不同:CAN的传输协议,单帧、第一帧和连续帧的最大长度是8个字节。CANFD的传输协议,单帧、第一帧和连续帧的最大长度是64个字节。
在诊断仪通过OBD诊断CAN接口访问CANFD网络的节点时,网关需要执行CAN和CANFD的协议转换(波特率转换和数据格式的转换)。这种协议转换需要一定的时间,因此在执行CANFD网络节点软件更新时,尽管CANFD传输速率高于CAN,反而更新速度慢于CAN节点。
二、诊断仪(也可以称为诊断设备或检测设备)。
本申请实施例的车辆诊断方法可以适用于以下两种类型的诊断仪:
A、政府检测设备,目前仅支持CAN通信协议。
B、整车厂的诊断仪,可随着其整车设计发展即时更新,可以支持CANFD通信协议。
三、诊断场景。
在普通的诊断场景,最大的数据流场景是诊断仪发送功能寻址,所有的CAN和CANFD节点给诊断仪发送多帧响应数据。这种情况下,数据量也不大,每个节点发送的数据一般不大于100个字节,即使车上有100个节点,传输数据所需的时间不到0.5s即可完成诊断。
在刷新场景下,诊断仪会大量给CAN和CANFD节点传输数据,一个节 点少的也有10万个字节的数,多则上千万个字节的数据。因此需要在刷新场景充分发挥OBD诊断CAN接口的CANFD带宽性能,以提高刷新效率,缩短刷新时间。
四、整车网络设计。
如图1所示,车辆可以包括至少一个CAN网络和至少一个CANFD网络。进一步地,各CAN网络可以包括至少一个CAN节点,且不同CAN网络包括的CAN节点的数量可以相等或不等。各CANFD网络可以包括至少一个CANFD节点,且不同CANFD网络包括的CANFD节点的数量可以相等或不等。
在一些实施例中,整车网络设计可以表现为:
所有CAN网络的通信速率一样(如500千位节每秒(Kbps))。
所有CANFD网络的通信速率一样,CANFD通信协议区分数据域的通信速率(如2Mbps)和非数据域的通信速率(500Kbps),非数据域的通信速率和传统CAN的通信速率可以一样。
对于该整车网络设计,由于所有CAN网络的通信速率一样,网关在与各CAN网络的节点进行通信时无需进行通信速率的转换,同样地,由于所有CANFD网络的通信速率一样,网关在与各CANFD网络的节点进行通信时无需进行通信速率的转换,从而可以降低网关软件的复杂度,进而降低网关开发成本。
当然,可以理解地是,在其他实施例中,也可以对整车网络进
行其他适用的设计,本申请对此不进行限定。如:对于不同的CAN网络,其通信速率可以不一样,或者,对于不同的CANFD网络,其通信速率可以设计为不一样。
五、报文的传输路径。
对于诊断请求报文,其传输路径为:诊断仪→车辆的OBD诊断接口→车辆的网关→车辆的节点(CAN节点或CANFD节点),即诊断仪发送诊断请求 报文,车辆的OBD诊断接口接收到诊断仪发送的诊断请求报文之后,将其传输至车辆的网关,之后,由车辆的网关将其转发至车辆的节点。
对于诊断响应报文,其传输路径为:车辆的节点(CAN节点和CANFD节点)→车辆的网关→车辆的OBD诊断接口→诊断仪,即车辆的节点响应诊断请求报文发送诊断响应报文,将其传输至车辆的网关,之后,由车辆的网关将其通过车辆的OBD诊断接口发送至诊断仪。
可见,车辆通过OBD诊断接口与诊断仪进行通信。
为了支持使用CANFD通信协议的诊断仪进行诊断,OBD诊断CAN接口可以兼容CAN通信协议和CANFD通信协议。对于支持CANFD通信协议的诊断仪,目前的诊断方案是:在普通诊断场景下,诊断仪访问CAN节点时,发送CAN报文,网关执行CAN-CAN的数据链路层路由,诊断仪访问CANFD节点时,发送CANFD报文,网关执行CANFD-CANFD的数据链路层路由。在诊断刷新的场景下,诊断仪发送CANFD报文,如果目标是CAN节点,网关执传输层的路由,如果目标是CANFD节点,网关执行数据链路层的路由。
上述诊断方案可以充分利用OBD诊断接口的CANFD带宽,使诊断刷新效率明显提升。然而,在上述方案中,网关需要区分不同的诊断场景,以对报文执行不同的路由,导致网关的软件复杂度高,研发成本高。
基于此,本申请实施例提供一种在车辆诊断方法、装置、设备、可读存储介质及程序产品,能够解决现有技术中因网关需要区分不同的诊断场景,以对报文执行不同的路由,导致网关的软件复杂度高,研发成本高。
在本申请实施例中,一方面,通过将诊断请求报文和诊断响应报文的DLC限制为8,对于诊断请求报文和诊断响应报文,网关可以均执行数据链路层的路由,无需区分诊断场景,从而可以降低网关的软件复杂度。另一方面,无论目标节点支持何种通信协议,无论发送诊断请求报文的诊断仪支持何种通信协议,网关均将目标节点发送的诊断响应报文以CAN诊断响应报文发送至诊断仪,从而既可以降低网关的软件复杂度,也可以使得车辆支持使用CAN通信 协议和CANFD通信协议中的任一种通信协议的诊断仪进行车辆诊断,拓展性好。可见,本申请实施例的车辆诊断方法的拓展性好,且可以降低网关的软件复杂度,进而降低网关的研发成本。
下面结合附图,通过一些实施例及其应用场景对本申请实施例提供的车辆诊断方法进行详细地说明。
参见图2,图2是本申请实施例提供的车辆诊断方法的流程图。图2所示的车辆诊断方法可以应用于车辆,具体地,图2所示的车辆诊断方法中的各步骤可以由车辆的网关执行。
如图2所示,车辆诊断方法可以包括以下步骤:
步骤201、接收诊断仪发送的诊断请求报文,其中,诊断请求报文为可变速率控制器局域网CANFD诊断请求报文或控制器局域网CAN诊断请求报文。
具体实现时,车辆的网关可以通过OBD诊断接口接收诊断仪发送的诊断请求报文。
可以理解地是,在步骤201之前,诊断仪向车辆发送诊断请求报文。
在一些实施例中,诊断仪可为支持CAN通信协议的诊断仪(以下称为CAN诊断仪)。CAN诊断仪发送的诊断请求报文为CAN诊断请求报文。在此实施例中,步骤201具体表现为:接收CAN诊断仪发送的CAN诊断请求报文。
在另一些实施例中,诊断仪可为支持CANFD通信协议的诊断仪(以下称为CANFD诊断仪)。CANFD诊断仪发送的诊断请求报文可以为CAN诊断请求报文或CANFD诊断请求报文,具体可根据实际需求决定,本申请实施例对此不作限定。在此实施例中,步骤201具体表现为:接收CANFD诊断仪发送的CAN诊断请求报文或CANFD诊断请求报文。
一些可选实现方式中,在诊断仪支持CANFD通信协议的情况下,诊断请求报文为CANFD诊断请求报文。在此实现方式中,步骤201具体表现为:接收CANFD诊断仪发送的CANFD诊断请求报文。
在此实现方式中,对于诊断仪,无需关注诊断请求报文的接收节点是CAN 节点还是CANFD节点,发送的诊断请求报文始终为CANFD诊断请求报文。这样,CANFD诊断仪无需区分诊断场景,直接发送CANFD诊断请求报文,从而可以降低诊断仪的软件复杂度,降低诊断仪的开发成本。
步骤202、对诊断请求报文执行数据链路层的路由,将诊断请求报文转发至目标节点,其中,目标节点为CAN节点或CANFD节点。
在本申请实施例中,网关在接收到诊断请求报文之后,可以对诊断请求报文执行数据链路层的路由,将诊断请求报文转发至目标节点。
在本申请实施例中,在目标节点为CAN节点的情况下,诊断请求报文的数据长度代码(Data Length Code,DLC)为8,DLC的单位可以为字节,即将诊断请求报文的DLC限制为8个字节,与CAN通信协议中一帧数据链路层的CAN报文的DLC限制相同。
对于诊断仪发送的CAN诊断请求报文,其DLC本身即为8。对于诊断仪发送的CANFD诊断请求报文,在目标节点为CAN节点的情况下,本申请实施例可以限定其DLC为8。
这样,在目标节点为CAN节点的情况下,无论诊断请求报文是CANFD诊断请求报文还是CAN诊断请求报文,由于诊断请求报文的DLC与CAN通信协议中一帧数据链路层的CAN报文的DLC相同,网关都可以对诊断请求报文执行数据链路层的路由,将其转发至目标节点,无需做传输层的转换,从而可以提高诊断请求报文的路由效率。
可以理解地是,若CAN通信协议中一帧数据链路层的CAN报文的DLC变更为其他值,上述对诊断请求报文的DLC限制可以随之发生变更。即在本申请实施例中,在目标节点为CAN节点的情况下,诊断请求报文的DLC可以与CAN通信协议中一帧数据链路层的CAN报文的DLC相等。
另外,在某些实施例中,在目标节点为CAN节点的情况下,诊断请求报文的DLC可以小于CAN通信协议中一帧数据链路层的CAN报文的DLC。在此实施例中,网关同样可对诊断请求报文执行数据链路层的路由,将其转发至 目标节点,但相比于DLC相等的情况,会降低诊断效率。
可见,在本申请实施例中,无论诊断请求报文是何种类型的诊断请求报文,目标节点是何种类型的节点,网关均可以对诊断请求报文执行数据链路层的路由,将其转发至目标节点,无需做传输层的转换,从而可以提高诊断请求报文的路由效率。
步骤203、对目标节点发送的诊断响应报文执行数据链路层的路由,将诊断响应报文以CAN诊断响应报文发送至诊断仪。
可以理解地是,在步骤203之后,诊断仪接收车辆发送的CAN诊断响应报文。
具体实现时,目标节点在接收到诊断请求报文之后,可以响应该诊断请求报文,生成诊断响应报文,并向网关发送该诊断响应报文。
可以理解地是,目标节点发送的诊断响应报文的类型与目标节点的类型一致。即对于CAN节点,其发送的诊断响应报文为CAN诊断响应报文。对于CANFD节点,其发送的诊断响应报文为CANFD诊断响应报文。
在本申请实施例中,在目标节点为CANFD节点的情况下,诊断响应报文的DLC为8,DLC的单位可以为字节,即将诊断响应报文的DLC限制为8个字节,与CAN通信协议中一帧数据链路层的CAN报文的DLC限制相同。
对于目标节点发送的CAN诊断响应报文,其DLC本身即为8。对于目标节点发送的CANFD诊断响应报文,在目标节点为CAN节点的情况下,本申请实施例可以限定其DLC为8。
这样,在目标节点为CAN节点的情况下,无论诊断响应报文是CANFD诊断响应报文还是CAN诊断响应报文,由于诊断响应报文的DLC与CAN通信协议中一帧数据链路层的CAN报文的DLC相同,网关都可以对诊断响应报文执行数据链路层的路由,将其发送至诊断仪,无需做传输层的转换,从而可以提高诊断响应报文的路由效率。
可以理解地是,若CAN通信协议中一帧数据链路层的CAN报文的DLC 变更为其他值,上述对诊断响应报文的DLC限制可以随之发生变更。即在本申请实施例中,在目标节点为CAN节点的情况下,诊断响应报文的DLC可以与CAN通信协议中一帧数据链路层的CAN报文的DLC相等。
另外,在某些实施例中,在目标节点为CAN节点的情况下,诊断响应报文的DLC可以小于CAN通信协议中一帧数据链路层的CAN报文的DLC相等。在此实施例中,网关同样可以对诊断响应报文执行数据链路层的路由,将其转发至目标节点,但相比于DLC相等的情况,会降低诊断效率。
可见,在本申请实施例中,无论诊断响应报文是何种类型的诊断响应报文,目标节点是何种类型的节点,网关均可以对诊断响应报文执行数据链路层的路由,将其发送至诊断仪,无需做传输层的转换,从而可以提高诊断响应报文的路由效率。
另一方面,值得注意地是,在本申请实施例中,网关可以将诊断响应报文以CAN诊断响应报文发送至诊断仪。这样,既可以保证CAN诊断仪和CANFD诊断仪中的任一种类型的诊断仪,均可以接收诊断响应报文,也可以简化网关软件复杂度,即网关无需关注诊断仪的类型,均发送同样类型的诊断响应报文。如此,可以进一步降低网关的软件复杂图,同时可以使得本申请实施例的车辆诊断方法适用于任意类型的诊断仪,拓展性好。
本实施例的车辆诊断方法,一方面,通过将诊断请求报文和诊断响应报文的DLC限制为8,对于诊断请求报文和诊断响应报文,网关可以均执行数据链路层的路由,无需区分诊断场景,从而可以降低网关的软件复杂度。另一方面,无论目标节点支持何种通信协议,无论发送诊断请求报文的诊断仪支持何种通信协议,网关均将目标节点发送的诊断响应报文以CAN诊断响应报文发送至诊断仪,从而既可以降低网关的软件复杂度,也可以使得车辆支持使用CAN通信协议和CANFD通信协议中的任一种通信协议的诊断仪进行车辆诊断,拓展性好。可见,本申请实施例的车辆诊断方法的拓展性好,且可降低网关的软件复杂度,进而降低网关的研发成本。
在本申请实施例中,诊断仪和目标节点可以满足以下任一项:
诊断仪支持CANFD通信协议,目标节点为CANFD节点,
诊断仪支持CANFD通信协议,目标节点为CAN节点,
诊断仪支持CAN通信协议,目标节点为CAN节点,
诊断仪支持CAN通信协议,目标节点为CANFD节点。
即本申请实施例可以适用于以下任一项诊断场景:
诊断场景A:诊断仪支持CANFD通信协议,目标节点为CANFD节点,即CANFD诊断仪访问CANFD节点。
诊断场景B:诊断仪支持CANFD通信协议,目标节点为CAN节点,即CANFD诊断仪访问CAN节点。
诊断场景C:诊断仪支持CAN通信协议,目标节点为CAN节点,即CAN诊断仪访问CAN节点。
诊断场景D:诊断仪支持CAN通信协议,目标节点为CANFD节点,即CAN诊断仪访问CANFD节点。
对于诊断场景A和B,CANFD诊断仪可发送CANFD诊断请求报文,并限制CANFD诊断请求报文为8。在一些实施例中,将诊断请求报文转发至目标节点,包括:
在目标节点为CANFD节点的情况下,将CANFD诊断请求报文直接发送至CANFD节点,
在目标节点为CAN节点的情况下,将CANFD诊断请求报文转换为CAN请求报文发送至CAN节点。
具体实现时,在目标节点为CANFD节点的情况下,网关可以直接执行CANFD-CANFD的数据链层路由,将CANFD诊断请求报文直接发送至CANFD节点。
在目标节点为CAN节点的情况下,网关可以先执行CANFD-CAN的转换,转换得到CAN诊断请求报文,之后,执行CAN-CAN的数据链层路由,将CAN 诊断请求报文直接发送至CAN节点。
如此,既可以使得网关对诊断请求报文执行数据链层路由,也可以使得目标节点接收到与其类型一致的诊断请求报文,从而可以提高车辆诊断的可靠性。
在一些实施例中,将诊断响应报文以CAN诊断响应报文发送至诊断仪,包括:
在目标节点为CANFD节点,诊断请求报文为CANFD诊断响应报文的情况下,将CANFD诊断响应报文转换为CAN诊断请求报文发送至诊断仪,
在目标节点为CAN节点,诊断请求报文为CAN诊断响应报文的情况下,将CAN诊断响应报文直接发送至诊断仪。
对于诊断场景A和断场景D,目标节点为CANFD节点,其发送的诊断响应报文为CANFD诊断响应报文,限定其DLC为8。由于本申请实施例的网关返回诊断仪的诊断响应报文均为CAN诊断响应报文,网关可以在对CANFD诊断响应报文执行数据链路层的路由之后,执行CANFD-CAN的转换,转换得到CAN诊断响应报文,之后,将其返回给诊断仪。
对于诊断场景B和断场景C,目标节点为CAN节点,其发送的诊断响应报文为CAN诊断响应报文。由于本申请实施例的网关返回诊断仪的诊断响应报文均为CAN诊断响应报文,网关可以在对CAN诊断响应报文执行数据链路层的路由之后,直接将其返回给诊断仪。
如此,可以使得车辆返回给诊断仪的诊断响应报文为CAN诊断响应报文,既可以简化网关对发送的诊断响应报文的处理机制,也可以使得各种类型的诊断仪均能接收到诊断响应报文,保证车辆诊断的可靠性。
在本申请实施例中,为避免网关在对诊断报文执行数据链路层的路由时丢帧,可以引入先入先出(First In First Out,FIFO)机制,使得网关基于FIFO机制,对诊断报文执行数据链路层的路由。
在一些实施例中,对诊断响应报文执行数据链路层的路由,将诊断请求报 文转发至目标节点,可以包括:
根据第一先入先出FIFO机制,将诊断请求报文转发至目标节点,对诊断响应报文执行数据链路层的路由,
其中,第一FIFO机制的最小深度基于以下参数确定:车辆中各网络的节点数量,车辆的网关接收全部CANFD诊断响应报文所需的第一时间,网关接收全部CAN诊断响应报文所需的第二时间,CAN网络发送8个字节所需要的最小时间,以及最大诊断响应消息对应的CAN报文数量。
在本实施例,第一FIFO机制可以理解为网关在OBD端的发送FIFO机制,用于存储诊断响应报文。
由于功能寻址情况下节点响应报文数量最多,可以选用该情况下的信息计算第一FIFO机制的最小深度。可以理解地是,在其他实施例中,也可以采用其他情况的信息计算第一FIFO机制的最小深度,本申请实施例对此不作限定。
假设功能寻址情况下,一个节点最大诊断响应报文的长度为z。可以通过z计算最大诊断响应报文对应的CAN报文数量。一种可选实现方式中,考虑到统一诊断服务(Unified Diagnostic Services,UDS)报文的传输层协议最大可携带7个字节的有效数据,因此,可以将z除以7取整,再加1计算得到最大诊断响应报文对应的CAN报文数量Z1。
假设车辆有x个CANFD网络,每个CANFD网络的节点数量分别为X1、X2…Xx,有y个CAN网络,每个CAN网络的节点数量分别为Y1、Y2…Yy。Xmax为X1、X2…Xx中最大的那个数,Ymax为Y1、Y2…Yx中最大的那个数。
由于各CANFD节点可以并行发送CANFD诊断响应报文,网关接收全部CANFD诊断响应报文所需的第一时间可以通过公式(1)计算得到:
Tx=Xmax×Tcanfd        (1)
其中,Tx为网关接收全部CANFD诊断响应报文所需的第一时间,Tcanfd为在CANFD网络中发送8个字节所需要的最小时间。
由于各CAN节点可以并行发送CAN诊断响应报文,网关接收全部CAN诊断响应报文所需的第二时间可以通过公式(2)计算得到:
Ty=Ymax×Tcan           (2)
其中,Ty为网关接收全部CAN诊断响应报文所需的第二时间,Tcan为在CAN网络中发送8个字节所需要的最小时间。
一种可选实现方式中,根据第一先入先出FIFO机制,对诊断响应报文执行数据链路层的路由之前,方法还包括:
通过第一计算公式,计算第一FIFO机制的最小深度,第一计算公式为:
D1=P×Z1-Tmax-Tcan
其中,D1为第一FIFO机制的最小深度,P为车辆中各网络的节点数量的总和,P=X1+X2+…+Xx+Y1+Y2+…+Yy,Z1为最大诊断响应消息对应的CAN报文数量,Tmax为第一时间和第二时间的最大值,Tcan为CAN网络发送8个字节所需要的最小时间。
在此实现方式中,可以选择Tx和Ty中的较大者计算第一FIFO机制的最小深度。在其他实现方式中,可以选择Tx和Ty中的较小者计算第一FIFO机制的最小深度,具体可根据实际需求决定,本申请实施例对此不作限定。
可以理解地是,D1为第一FIFO机制的最小深度,在实际应用中,第一FIFO机制的深度可以大于或等于D1。FIFO机制的深度的单位可以为集,进一步地,每级至少需要13个字节的缓存。
具体实现时,网关在根据FIFO机制执行数据链路层的路由时,在上一个发送中断中,发送存储在FIFO队列最近要发送的数据,直到FIFO队列的数据为空。
通过上述方式计算得到的第一FIFO机制的最小深度,可以使得网关在对诊断响应报文执行数据链路层的路由时不会丢帧,从而可以提高车辆诊断的可靠性。
在一些实施例中,对诊断请求报文执行数据链路层的路由,将诊断响应报 文以CAN诊断响应报文发送至诊断仪,包括:
根据第二FIFO机制,对诊断请求报文执行数据链路层的路由,将诊断响应报文以CAN诊断响应报文发送至诊断仪,
其中,在第一诊断场景下,第二FIFO机制的最小深度为8级,第一诊断场景为以下任一项:
诊断仪支持CANFD通信协议,目标节点为CANFD节点,
诊断仪支持CAN通信协议,目标节点为CAN节点,
诊断仪支持CAN通信协议,目标节点为CANFD节点,
在诊断仪支持CANFD通信协议,目标节点为CAN节点的诊断场景下,第二FIFO机制的最小深度为333级。
在本实施例中,第二FIFO机制可以理解为网关在网络端的发送FIFO机制,用于存储诊断请求报文。
具体地,在目标节点为CANFD节点的情况下,第二FIFO机制可以理解为网关在CANFD网络的发送FIFO机制。在目标节点为CAN节点的情况下,第二FIFO机制可以理解为网关在CAN网络的发送FIFO机制。
在本实施例中,考虑到网关电子控制单元(Electronic Control Unit,ECU)在系统负载比较高的情况下,还未转发上一条报文时,下一条报文需要转发的报文已经接收,因此,可以通过设置一定深度的第二FIFO机制避免在这种情况下丢帧,从而导致诊断通信失败。
具体地,针对前述的诊断场景A、C和D,限定第二FIFO机制的最小深度为8,针对前述的诊断场景B,限定第二FIFO机制的最小深度为333。进一步地,每级至少需要13个字节的缓存。如此,可以使得网关在对诊断请求报文执行数据链路层的路由时不会丢帧,从而可以提高车辆诊断的可靠性。
对于诊断场景A、C和D,第二FIFO机制的最小深度为经验值。
对于诊断场景B,第二FIFO机制的最小深度的确定原理如下:
假设CAN通信速率为500Kbps,CANFD的通信波特率为2Mbps。因为 CAN的传输层,传输的一个请求报文长度最长为4095个字节,将4095除以7取整,加1,可以算出一个请求报文需要586条报文才能传输完成。CANFD传输586条报文,需要的时间为75ms,而75ms,CAN(500bps)只能传输约253条报文,还剩余586-253=333条报文未发送。因此需要设置至少333的FIFO深度。
在本申请的一些实施例中,接收诊断仪发送的诊断请求报文之前,方法还可以包括:
将车辆的OBD诊断接口配置为兼容CAN工作方式和CANFD工作方式,其中,CAN工作方式的波特率与整车CAN的波特率一致,CANFD工作方式的波特率与整车CANFD的波特率一致。
即配置OBD诊断接口可以兼容CAN通信协议和CANFD通信协议,如此,可以使得车辆支持CAN诊断仪和CANFD诊断仪对车辆进行诊断,从而可以提高车辆诊断的扩展性。
在本申请的一些实施例中,接收诊断仪发送的诊断请求报文之前,方法还包括:
根据车辆中各节点的类型,生成诊断路由表,
对诊断请求报文执行数据链路层的路由,将诊断请求报文转发至目标节点,包括:
根据诊断路由表,对诊断请求报文执行数据链路层的路由,将诊断请求报文转发至目标节点,
对诊断响应报文执行数据链路层的路由,将诊断响应报文以CAN诊断响应报文发送至诊断仪,包括:
根据诊断路由表,对诊断响应报文执行数据链路层的路由,将诊断响应报文以CAN诊断响应报文发送至诊断仪。
具体实现时,可以先确定网关哪些网络是工作在传统CAN方式,哪些是工作在CANFD方式,以及哪些节点是工作在CAN方式,哪些是工作在CANFD 方式,从而可以生成诊断路由表。具体地,可以生成CANFD-CANFD之间路由表、CAN-CAN之间路由表和CAN-CANFD之间路由表。
诊断仪和CANFD节点存在四种路由关系:CANFD(诊断仪)→CANFD(节点),CAN(诊断仪)→CANFD(节点),CANFD(节点)→CAN(诊断仪),CANFD(节点)→CANFD(诊断仪)。
诊断仪和CAN节点存在四种路由关系:CANFD(诊断仪)→CAN(节点),CAN(诊断仪)→CAN(节点),CAN(节点)→CAN(诊断仪),CAN(节点)→CANFD(诊断仪)。
可以利用上述路由关系生成诊断路由表,之后,可以基于诊断路由表执行数据链路层的路由,从而可以提高路由效率。
需要说明的是,本申请实施例中介绍的多种可选的实施方式,在彼此不冲突的情况下可以相互结合实现,也可以单独实现,对此本申请实施例不作限定。
为方便理解,以下结合一个具体实施场景进行示例说明:
一、区分四种诊断场景:
A、诊断仪支持CANFD通信协议,访问CANFD的节点。
B、诊断仪支持CANFD通信协议,访问CAN的节点。
C、诊断仪支持CAN通信协议,访问CAN节点。
D、诊断仪支持CAN通信协议,访问CANFD节点。
二、限制整车网络设计(推荐是这样的,如果不用这个设计,也是可以的,但是需要在网关中增加一些网络适配的功能。会增加网关软件的复杂度,增加开发周期和成本):
1、所有CAN网络的通信速率一样(如500Kbps)。
2、所有CANFD网络的通信速率一样,CANFD协议区分数据域的通信速率(如2Mbps)和非数据域的通信速率(500Kbps),非数据域的通信速率和传统CAN的通信速率一样。
三、限制OBD诊断CAN接口,支持CANFD通信协议。
四、关键技术说明
1、CANFD通信接口为CANFD网络连接网络的接口。CANFD通信接口可以兼容传统CAN通信接口,如此,CANFD通信接口能够接收和发送传统CAN报文,在目标节点为CANFD节点时,诊断仪可以发送CAN诊断请求报文。
2、考虑四种诊断场景:
A、诊断仪支持CANFD通信协议,访问CANFD的节点,限制节点仅发送DLC为8的诊断响应报文。诊断仪的CANFD报文,网关执行数据链路层的报文路由,将诊断仪的请求报文直接转发至CANFD网络,且将CANFD网络中节点的CANFD诊断响应报文,网关执行数据链路层的报文路由,将CANFD报文转为传统CAN报文发至OBD诊断接口。
网关在OBD端的发送FIFO机制,FIFO的深度计算:假设有x个CANFD网络,每个网络的节点数量为X1、X2…Xx,y个CAN网络,每个网络的节点数量为Y1、Y2…Yy。功能寻址情况下,一个节点最大响应报文的长度为z。通过z除以7,再加1计算发送该数据所需的CAN报文数量为Z1。Xmax为X1、X2…Xx中最大的那个数,Ymax为Y1、Y2…Yx中最大的那个数,网关接收全部CANFD诊断数据的时间为Tx=Xmax*Tcanfd,网关接收全部CAN诊断数据的时间为Ty=Ymax*Tcan,其中Tcanfd为在CANFD网络中发送8个字节所需要的最小时间,Tcan为在CAN网络中发送8个字节所需要的最小时间,Tmax为Ty和Tx中最大的那个数,则FIFO的最小深度为(X1+X2+…+Xx+Y1+Y2+…+Yy)*Z1-Trmax/Tcan。每级至少需要13个字节的缓存。在上一个发送中断中,发送存储在FIFO最近要发送的数据,直到FIFO的数据为空。
网关在CANFD网络的FIFO深度不小8级。
每级至少需要13个字节的缓存。
B、诊断仪支持CANFD通信协议,访问CAN的节点:诊断仪可发送DLC为8的CANFD诊断请求报文(实际上诊断仪可以发送DLC大于8的CANFD报文,但是需要网关做TP层的转换,路由效率就比较低了,所以本专利中加以限制,以提高效率),网关执行数据链路层的报文路由,将诊断仪的请求报文直接转发至CAN网络,且将CAN网络中节点的CAN诊断响应报文直接转发至OBD诊断接口。
网关在CAN网络的发送FIFO机制,FIFO的深度至少为333级。每级至少需要13个字节的缓存。在上一个发送中断中,发送存储在FIFO最近要发送的数据,直到FIFO的数据为空。
网关在OBD端的发送FIFO复用场景A的FIFO。
C、诊断仪支持CAN通信协议,访问CAN节点:诊断仪发送传统CAN诊断请求报文,网关执行数据链路层的报文路由,将诊断仪的请求报文直接转发至CAN网络,且将CAN网络中节点的CAN诊断响应报文直接转发至OBD诊断接口。
网关在OBD端的发送FIFO复用场景A的FIFO。网关在CAN网络的发送FIFO深度不小8级。每级至少需要13个字节的缓存。
D、诊断仪支持CAN通信协议,访问CANFD节点,限制节点仅发送DLC为8的诊断响应报文。诊断仪发送传统CAN诊断请求报文,网关执行数据链路层的路由,将接收的报文转为CANFD报文发送至目标网络,且将CANFD网络中节点的CANFD诊断响应报,网关执行数据链路层的报文路由,将CANFD报文转为传统CAN报文发至OBD诊断接口。
网关在OBD端的发送FIFO复用场景A的FIFO,网关在CANFD网络的FIFO深度不小8级。每级至少需要13个字节的缓存。
如图3所示:
步骤301、根据整车网络设计,预置CANFD-CANFD之间路由表、CAN-CAN之间路由表和CAN-CANFD之间路由表。
具体实现时,确定网关哪些网络是工作在传统CAN方式,哪些是工作在CANFD方式,及哪些节点(对应的诊断请求报文、响应报文)是工作在CAN方式,哪些是工作在CANFD方式,从而确认网关的诊断路由表:
诊断接口和CANFD网络之间的路由表。诊断仪和CANFD节点存在四种路由关系:CANFD(诊断仪)→CANFD(节点),CAN(诊断仪)→CANFD(节点),CANFD(节点)→CAN(诊断仪),CANFD(节点)→CANFD(诊断仪)。
诊断接口和CAN网络之间的路由表。诊断仪和CAN节点存在四种路由关系:CANFD(诊断仪)→CAN(节点),CAN(诊断仪)→CAN(节点),CAN(节点)→CAN(诊断仪),CAN(节点)→CANFD(诊断仪)。
步骤302、根据整车网络设计,配置网关OBD诊断CAN接口。
具体实现时,可以根据整车网络设计的CAN的波特率和CANFD的波特率,配置网关OBD诊断CAN接口的工作方式兼容CAN和CANFD,其波特率和整车的CAN和CANFD的波特率一样。
步骤303、诊断仪,发送的请求报文全都为CANFD报文,如果目标节点为CAN节点,限制DLC为8,接收的响应报文为CAN报文。
步骤303中的诊断仪为整车诊断仪,支持CANFD通信协议,发送诊断请求时,目标无论是CAN节点还是CANFD节点,均发送CANFD报文。目标节点为CAN节点时,请求报文的DLC限制为8。
步骤304、目标节点,如果是CANFD的节点,诊断响应报文的DLC限制为8。
步骤305、网关结合FIFO机制,对于诊断报文,执行数据链路层的路由。
具体实现时,网关接收的诊断报文(请求和响应),根据S001中的路由表,搭配FIFO机制,执行数据链路层的路由。
本场景实施例具有如下有益效果:
系统扩展性好,适应新的整车通信技术CANFD。
兼容传统整车通信技术CAN。
提高整车软件更新的效率。在刷新场景下,充分利用OBD的CAN的CANFD波特率传输更新数据,支持并行刷写,在不降低CANFD节点更新效率的情况下,提高更新CAN节点效率,从而提高整车软件刷新的效率。
节约研发成本。车内其他节点的软件无需变更,仅需要CANFD节点配置其发送的响应报文的DLC限制为8即可,降低网关、诊断仪的软件复杂度,缩短研发周期,从而降低研发成本。
基于上述实施例提供的车辆诊断方法,相应地,本申请还提供了车辆诊断装置的具体实现方式。请参见以下实施例。
参见图4,本申请实施例提供的车辆诊断装置可以包括:
第一接收模块401,用于接收诊断仪发送的诊断请求报文,其中,诊断请求报文为可变速率控制器局域网CANFD诊断请求报文或控制器局域网CAN诊断请求报文,
第一发送模块402,用于对诊断请求报文执行数据链路层的路由,将诊断请求报文转发至目标节点,其中,目标节点为CAN节点或CANFD节点,
第二发送模块403,用于对目标节点发送的诊断响应报文执行数据链路层的路由,将诊断响应报文以CAN诊断响应报文发送至诊断仪,
其中,在目标节点为CAN节点的情况下,诊断请求报文的数据长度代码DLC为8,在目标节点为可变速率控制器局域网CANFD节点的情况下,诊断响应报文的DLC为8。
在一些实施例中,诊断仪和目标节点满足以下任一项:
诊断仪支持CANFD通信协议,目标节点为CANFD节点,
诊断仪支持CANFD通信协议,目标节点为CAN节点,
诊断仪支持CAN通信协议,目标节点为CAN节点,
诊断仪支持CAN通信协议,目标节点为CANFD节点。
在一些实施例中,在诊断仪支持CANFD通信协议的情况下,诊断请求报文为CANFD诊断请求报文。
在一些实施例中,第一发送模块402具体用于:
在目标节点为CANFD节点的情况下,将CANFD诊断请求报文直接发送至CANFD节点,
在目标节点为CAN节点的情况下,将CANFD诊断请求报文转换为CAN请求报文发送至CAN节点。
在一些实施例中,第二发送模块403具体用于:
在目标节点为CANFD节点,诊断请求报文为CANFD诊断响应报文的情况下,将CANFD诊断响应报文转换为CAN诊断请求报文发送至诊断仪,
在目标节点为CAN节点,诊断请求报文为CAN诊断响应报文的情况下,将CAN诊断响应报文直接发送至诊断仪。
在一些实施例中,第一发送模块402具体用于:
根据第一先入先出FIFO机制,将诊断请求报文转发至目标节点,对诊断响应报文执行数据链路层的路由,
其中,第一FIFO机制的最小深度基于以下参数确定:车辆中各网络的节点数量,车辆的网关接收全部CANFD诊断响应报文所需的第一时间,网关接收全部CAN诊断响应报文所需的第二时间,CAN网络发送8个字节所需要的最小时间,以及最大诊断响应消息对应的CAN报文数量。
在一些实施例中,装置还包括:
计算模块,用于通过第一计算公式,计算第一FIFO机制的最小深度,第一计算公式为:
D1=P×Z1-Tmax-Tcan
其中,D1为第一FIFO机制的最小深度,P为车辆中各网络的节点数量的总和,Z1为最大诊断响应消息对应的CAN报文数量,Tmax为第一时间和第二时间的最大值,Tcan为CAN网络发送8个字节所需要的最小时间。
在一些实施例中,第二发送模块403具体用于:
根据第二FIFO机制,对诊断请求报文执行数据链路层的路由,将诊断响 应报文以CAN诊断响应报文发送至诊断仪,
其中,在第一诊断场景下,第二FIFO机制的最小深度为8级,第一诊断场景为以下任一项:
诊断仪支持CANFD通信协议,目标节点为CANFD节点,
诊断仪支持CAN通信协议,目标节点为CAN节点,
诊断仪支持CAN通信协议,目标节点为CANFD节点,
在诊断仪支持CANFD通信协议,目标节点为CAN节点的诊断场景下,第二FIFO机制的最小深度为333级。
在一些实施例中,装置还包括:
配置模块,用于将车辆的OBD诊断接口配置为兼容CAN工作方式和CANFD工作方式,其中,CAN工作方式的波特率与整车CAN的波特率一致,CANFD工作方式的波特率与整车CANFD的波特率一致。
在一些实施例中,装置还包括:
生成模块,用于:根据车辆中各节点的类型,生成诊断路由表,
第一发送模块402具体用于:
根据诊断路由表,对诊断请求报文执行数据链路层的路由,将诊断请求报文转发至目标节点,
第二发送模块403具体用于:
根据诊断路由表,对诊断响应报文执行数据链路层的路由,将诊断响应报文以CAN诊断响应报文发送至诊断仪。
本申请实施例提供的车辆诊断装置能够实现图2的方法实施例中的各个过程,为避免重复,这里不再赘述。
图5示出了本申请实施例提供的车辆诊断的硬件结构示意图。
在车辆诊断设备可以包括处理器501以及存储有计算机程序指令的存储器502。
具体地,上述处理器501可以包括中央处理器(CPU),或者特定集成电 路(Application Specific Integrated Circuit,ASIC),或者可以被配置成实施本申请实施例的一个或多个集成电路。
存储器502可以包括用于数据或指令的大容量存储器。举例来说而非限制,存储器502可包括硬盘驱动器(Hard Disk Drive,HDD)、软盘驱动器、闪存、光盘、磁光盘、磁带或通用串行总线(Universal Serial Bus,USB)驱动器或者两个或更多个以上这些的组合。在合适的情况下,存储器502可包括可移除或不可移除(或固定)的介质。在合适的情况下,存储器502可在综合网关容灾设备的内部或外部。在特定实施例中,存储器502是非易失性固态存储器。
存储器可包括只读存储器(Read-Only Memory,ROM),随机存取存储器(Random Access Memory,RAM),磁盘存储介质设备,光存储介质设备,闪存设备,电气、光学或其他物理/有形的存储器存储设备。因此,通常,存储器包括一个或多个编码有包括计算机可执行指令的软件的有形(非暂态)计算机可读存储介质(例如,存储器设备),并且当该软件被执行(例如,由一个或多个处理器)时,其可操作来执行参考根据本公开的一方面的方法所描述的操作。
处理器501通过读取并执行存储器502中存储的计算机程序指令,以实现上述实施例中的任意一种车辆诊断方法。
在一个示例中,车辆诊断设备还可包括通信接口505和总线510。其中,如图5所示,处理器501、存储器502、通信接口505通过总线510连接并完成相互间的通信。
通信接口505,主要用于实现本申请实施例中各模块、装置、单元和/或设备之间的通信。
总线510包括硬件、软件或两者,将车辆诊断设备的部件彼此耦接在一起。举例来说而非限制,总线可包括加速图形端口(AGP)或其他图形总线、增强工业标准架构(EISA)总线、前端总线(FSB)、超传输(HT)互连、工业标准架构(ISA)总线、无限带宽互连、低引脚数(LPC)总线、存储器总线、 微信道架构(MCA)总线、外围组件互连(PCI)总线、PCI-Express(PCI-X)总线、串行高级技术附件(SATA)总线、视频电子标准协会局部(VLB)总线或其他合适的总线或者两个或更多个以上这些的组合。在合适的情况下,总线510可包括一个或多个总线。尽管本申请实施例描述和示出了特定的总线,但本申请考虑任何合适的总线或互连。
另外,结合上述实施例中的车辆诊断方法,本申请实施例可提供一种计算机存储介质来实现。该计算机存储介质上存储有计算机程序指令,该计算机程序指令被处理器执行时实现上述实施例中的任意一种车辆诊断方法。
需要明确的是,本申请并不局限于上文所描述并在图中示出的特定配置和处理。为了简明起见,这里省略了对已知方法的详细描述。在上述实施例中,描述和示出了若干具体的步骤作为示例。但是,本申请的方法过程并不限于所描述和示出的具体步骤,本领域的技术人员可以在领会本申请的精神后,作出各种改变、修改和添加,或者改变步骤之间的顺序。
以上的结构框图中所示的功能块可以实现为硬件、软件、固件或者它们的组合。当以硬件方式实现时,其可以例如是电子电路、专用集成电路(ASIC)、适当的固件、插件、功能卡等等。当以软件方式实现时,本申请的元素是被用于执行所需任务的程序或者代码段。程序或者代码段可以存储在机器可读介质中,或者通过载波中携带的数据信号在传输介质或者通信链路上传送。“机器可读介质”可以包括能够存储或传输信息的任何介质。机器可读介质的例子包括电子电路、半导体存储器设备、ROM、闪存、可擦除ROM(EROM)、软盘、CD-ROM、光盘、硬盘、光纤介质、射频(RF)链路,等等。代码段可以经由诸如因特网、内联网等的计算机网络被下载。
还需要说明的是,本申请中提及的示例性实施例,基于一系列的步骤或者装置描述一些方法或系统。但是,本申请不局限于上述步骤的顺序,也就是说,可以按照实施例中提及的顺序执行步骤,也可以不同于实施例中的顺序,或者若干步骤同时执行。
上面参考根据本公开的实施例的方法、装置(系统)和计算机程序产品的流程图和/或框图描述了本公开的各方面。应当理解,流程图和/或框图中的每个方框以及流程图和/或框图中各方框的组合可以由计算机程序指令实现。这些计算机程序指令可被提供给通用计算机、专用计算机、或其它可编程数据处理装置的处理器,以产生一种机器,使得经由计算机或其它可编程数据处理装置的处理器执行的这些指令使能对流程图和/或框图的一个或多个方框中指定的功能/动作的实现。这种处理器可以是但不限于是通用处理器、专用处理器、特殊应用处理器或者现场可编程逻辑电路。还可理解,框图和/或流程图中的每个方框以及框图和/或流程图中的方框的组合,也可以由执行指定的功能或动作的专用硬件来实现,或可由专用硬件和计算机指令的组合来实现。
以上,仅为本申请的具体实施方式,所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,上述描述的系统、模块和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。应理解,本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。

Claims (15)

  1. 一种车辆诊断方法,应用于车辆,包括:
    步骤201、接收诊断仪发送的诊断请求报文,其中,所述诊断请求报文为可变速率控制器局域网CANFD诊断请求报文或控制器局域网CAN诊断请求报文,
    步骤202、对所述诊断请求报文执行数据链路层的路由,将所述诊断请求报文转发至目标节点,其中,所述目标节点为CAN节点或CANFD节点,
    步骤203、对所述目标节点发送的诊断响应报文执行数据链路层的路由,将所述诊断响应报文以CAN诊断响应报文发送至所述诊断仪,
    其中,在所述目标节点为CAN节点的情况下,所述诊断请求报文的数据长度代码DLC为8,在所述目标节点为CANFD节点的情况下,所述诊断响应报文的DLC为8。
  2. 根据权利要求1所述的方法,其中,所述诊断仪和所述目标节点满足以下任一项:
    所述诊断仪支持CANFD通信协议,所述目标节点为CANFD节点,
    所述诊断仪支持CANFD通信协议,所述目标节点为CAN节点,
    所述诊断仪支持CAN通信协议,所述目标节点为CAN节点,
    所述诊断仪支持CAN通信协议,所述目标节点为CANFD节点。
  3. 根据权利要求1所述的方法,其中,在所述诊断仪支持CANFD通信协议的情况下,所述诊断请求报文为CANFD诊断请求报文。
  4. 根据权利要求3所述的方法,其中,所述将所述诊断请求报文转发至目标节点,包括:
    在所述目标节点为CANFD节点的情况下,将所述CANFD诊断请求报文直接发送至所述CANFD节点,
    在所述目标节点为CAN节点的情况下,将所述CANFD诊断请求报文转换为CAN请求报文发送至所述CAN节点。
  5. 根据权利要求1至4中任一项所述的方法,其中,所述将所述诊断响应报文以CAN诊断响应报文发送至所述诊断仪,包括:
    在所述目标节点为CANFD节点,所述诊断请求报文为CANFD诊断响应报文的情况下,将所述CANFD诊断响应报文转换为CAN诊断请求报文发送至所述诊断仪,
    在所述目标节点为CAN节点,所述诊断请求报文为CAN诊断响应报文的情况下,将所述CAN诊断响应报文直接发送至所述诊断仪。
  6. 根据权利要求1至5中任一项所述的方法,其中,所述对所述诊断响应报文执行数据链路层的路由,将所述诊断请求报文转发至目标节点,包括:
    根据第一先入先出FIFO机制,将所述诊断请求报文转发至目标节点,对所述诊断响应报文执行数据链路层的路由,
    其中,所述第一FIFO机制的最小深度基于以下参数确定:所述车辆中各网络的节点数量,所述车辆的网关接收全部CANFD诊断响应报文所需的第一时间,所述网关接收全部CAN诊断响应报文所需的第二时间,CAN网络发送8个字节所需要的最小时间,以及最大诊断响应消息对应的CAN报文数量。
  7. 根据权利要求6所述的方法,其中,所述根据第一先入先出FIFO机制,对所述诊断响应报文执行数据链路层的路由之前,所述方法还包括:
    通过第一计算公式,计算所述第一FIFO机制的最小深度,所述第一计算公式为:
    D1=P×Z1-Tmax-Tcan
    其中,D1为所述第一FIFO机制的最小深度,P为所述车辆中各网络的节点数量的总和,Z1为最大诊断响应消息对应的CAN报文数量,Tmax为所述第一时间和所述第二时间的最大值,Tcan为CAN网络发送8个字节所需要的最小时间。
  8. 根据权利要求1至5中任一项所述的方法,其中,所述对所述诊断请求报文执行数据链路层的路由,将所述诊断响应报文以CAN诊断响应报文发送至所述诊断仪,包括:
    根据第二FIFO机制,对所述诊断请求报文执行数据链路层的路由,将所述诊断响应报文以CAN诊断响应报文发送至所述诊断仪,
    其中,在第一诊断场景下,所述第二FIFO机制的最小深度为8级,所述第一诊断场景为以下任一项:
    所述诊断仪支持CANFD通信协议,所述目标节点为CANFD节点,
    所述诊断仪支持CAN通信协议,所述目标节点为CAN节点,
    所述诊断仪支持CAN通信协议,所述目标节点为CANFD节点,
    在所述诊断仪支持CANFD通信协议,所述目标节点为CAN节点的诊断场景下,所述第二FIFO机制的最小深度为333级。
  9. 根据权利要求1至8中任一项所述的方法,其中,所述接收诊断仪发送的诊断请求报文之前,所述方法还包括:
    将所述车辆的OBD诊断接口配置为兼容CAN工作方式和CANFD工作方式,其中,所述CAN工作方式的波特率与整车CAN的波特率一致,所述CANFD工作方式的波特率与整车CANFD的波特率一致。
  10. 根据权利要求1至9中任一项所述的方法,其中,所述接收诊断仪发送的诊断请求报文之前,所述方法还包括:
    根据所述车辆中各节点的类型,生成诊断路由表,
    所述对所述诊断请求报文执行数据链路层的路由,将所述诊断请求报文转发至目标节点,包括:
    根据所述诊断路由表,对所述诊断请求报文执行数据链路层的路由,将所述诊断请求报文转发至目标节点,
    所述对所述诊断响应报文执行数据链路层的路由,将所述诊断响应报文以CAN诊断响应报文发送至所述诊断仪,包括:
    根据所述诊断路由表,对所述诊断响应报文执行数据链路层的路由,将所述诊断响应报文以CAN诊断响应报文发送至所述诊断仪。
  11. 根据权利要求1所述的车辆诊断方法,其中,所述接收诊断仪发送的诊断请求报文之前,所述方法还包括:
    所述诊断仪向所述车辆发送所述诊断请求报文,
    所述将所述诊断响应报文以CAN诊断响应报文发送至所述诊断仪之后,所述方法还包括:
    所述诊断仪接收所述车辆发送的所述CAN诊断响应报文。
  12. 一种车辆诊断装置,所述装置包括:
    第一接收模块401,用于接收诊断仪发送的诊断请求报文,其中,所述诊断请求报文为可变速率控制器局域网CANFD诊断请求报文或控制器局域网CAN诊断请求报文,
    第一发送模块402,用于对所述诊断请求报文执行数据链路层的路由,将所述诊断请求报文转发至目标节点,其中,所述目标节点为CAN节点或CANFD节点,
    第二发送模块403,用于对所述目标节点发送的诊断响应报文执行数据链路层的路由,将所述诊断响应报文以CAN诊断响应报文发送至所述诊断仪,
    其中,在所述目标节点为CAN节点的情况下,所述诊断请求报文的数据长度代码DLC为8,在所述目标节点为CANFD节点的情况下,所述诊断响应报文的DLC为8。
  13. 一种车辆诊断设备,所述设备包括:处理器以及存储有计算机程序指令的存储器,所述处理器执行所述计算机程序指令时实现如权利要求1至11中任一项所述的车辆诊断方法。
  14. 一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现如权利要求1至11中任一项所述的车辆诊断方法。
  15. 一种计算机程序产品,所述计算机程序产品中的指令由电子设备的处理器执行时,使得所述电子设备执行如权利要求1至11中任一项所述的车辆诊断方法。
PCT/CN2023/109475 2022-08-16 2023-07-27 车辆诊断方法、装置、设备、可读存储介质及程序产品 WO2024037303A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210982180.2A CN115390545A (zh) 2022-08-16 2022-08-16 车辆诊断方法、装置、设备、可读存储介质及程序产品
CN202210982180.2 2022-08-16

Publications (1)

Publication Number Publication Date
WO2024037303A1 true WO2024037303A1 (zh) 2024-02-22

Family

ID=84120553

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/109475 WO2024037303A1 (zh) 2022-08-16 2023-07-27 车辆诊断方法、装置、设备、可读存储介质及程序产品

Country Status (2)

Country Link
CN (1) CN115390545A (zh)
WO (1) WO2024037303A1 (zh)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115390545A (zh) * 2022-08-16 2022-11-25 北京经纬恒润科技股份有限公司 车辆诊断方法、装置、设备、可读存储介质及程序产品
CN115933615B (zh) * 2023-01-03 2024-06-14 重庆长安汽车股份有限公司 车辆控制器测试方法、装置、电子设备及存储介质
CN116800557B (zh) * 2023-08-21 2023-12-29 成都炎兴自动化技术有限公司 一种基于CANOpen应用协议的CAN总线融合通信系统

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101923511B1 (ko) * 2018-03-27 2018-11-29 콘티넨탈 오토모티브 게엠베하 차량 진단 통신 장치 및 그 방법
KR20190046477A (ko) * 2017-10-26 2019-05-07 엘에스오토모티브테크놀로지스 주식회사 게이트웨이에서의 메시지 처리 방법 및 게이트웨이
CN110661847A (zh) * 2019-08-28 2020-01-07 北京经纬恒润科技有限公司 车辆诊断方法以及装置
CN110912992A (zh) * 2019-11-22 2020-03-24 深圳市元征科技股份有限公司 诊断数据的传输方法、装置、设备及系统
CN111427335A (zh) * 2020-04-22 2020-07-17 深圳市元征科技股份有限公司 一种车辆远程诊断方法、设备连接器及车辆连接器
CN112099465A (zh) * 2019-06-17 2020-12-18 现代自动车株式会社 车辆诊断通信装置及方法、包括车辆诊断通信装置的系统
CN113204226A (zh) * 2021-04-25 2021-08-03 重庆长安汽车股份有限公司 整车诊断系统及方法
CN115390545A (zh) * 2022-08-16 2022-11-25 北京经纬恒润科技股份有限公司 车辆诊断方法、装置、设备、可读存储介质及程序产品

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20190046477A (ko) * 2017-10-26 2019-05-07 엘에스오토모티브테크놀로지스 주식회사 게이트웨이에서의 메시지 처리 방법 및 게이트웨이
KR101923511B1 (ko) * 2018-03-27 2018-11-29 콘티넨탈 오토모티브 게엠베하 차량 진단 통신 장치 및 그 방법
CN112099465A (zh) * 2019-06-17 2020-12-18 现代自动车株式会社 车辆诊断通信装置及方法、包括车辆诊断通信装置的系统
CN110661847A (zh) * 2019-08-28 2020-01-07 北京经纬恒润科技有限公司 车辆诊断方法以及装置
CN110912992A (zh) * 2019-11-22 2020-03-24 深圳市元征科技股份有限公司 诊断数据的传输方法、装置、设备及系统
CN111427335A (zh) * 2020-04-22 2020-07-17 深圳市元征科技股份有限公司 一种车辆远程诊断方法、设备连接器及车辆连接器
CN113204226A (zh) * 2021-04-25 2021-08-03 重庆长安汽车股份有限公司 整车诊断系统及方法
CN115390545A (zh) * 2022-08-16 2022-11-25 北京经纬恒润科技股份有限公司 车辆诊断方法、装置、设备、可读存储介质及程序产品

Also Published As

Publication number Publication date
CN115390545A (zh) 2022-11-25

Similar Documents

Publication Publication Date Title
WO2024037303A1 (zh) 车辆诊断方法、装置、设备、可读存储介质及程序产品
US11146420B2 (en) Method for transmitting data via a serial communication bus, bus interface, and computer program
US20160182341A1 (en) Switching over the Mode of a Control Unit Between a Diagnostic Bus and an External Ethernet Connection
CN110661847A (zh) 车辆诊断方法以及装置
TWI535251B (zh) 低延遲聯網方法及系統
US20160224501A1 (en) Adaptation device for a bus system, and method for operating a can subscriber station and a can fd subscriber station in a bus system
US20220294663A1 (en) Data transmission method, device, and system
US10389553B2 (en) Communication bridge between bus networks
WO2021139714A1 (zh) 数据传输方法、设备及系统
US20230396464A1 (en) Data Transmission Method and Communication Apparatus
CN116821042A (zh) 基于多分区的fc设备dma通信方法
CN112134800A (zh) 一种数据的路由方法、网关、网络路由系统及车辆
JP6593230B2 (ja) 通信システム
CN114338556A (zh) 一种can网络和车载以太网间的报文转发方法及网关系统
US10171157B2 (en) Repeater
JP2018032934A (ja) 通信装置及び再送制御方法
US20240214304A1 (en) Communication interface and method for seamless data communication over multilane communication link
WO2023231864A1 (zh) 一种时效保证方法、装置及系统
CN113196255B (zh) 基于内部集成电路协议的数据传输方法和传输装置
JP7371589B2 (ja) 中継装置
WO2024029195A1 (ja) 中継装置、通信制御方法および通信制御プログラム
US10084624B2 (en) Repeater
CN116633716A (zh) 一种面向服务的CAN XL与Ethernet桥接器芯片
CN111885030A (zh) CANFD总线与FlexRay总线的协议转换方法
CN111885029A (zh) CANFD总线与FlexRay总线的协议转换装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23854207

Country of ref document: EP

Kind code of ref document: A1