Diagnostic message adaptive forwarding method and system, vehicle and storage medium

By converting the data length and format of diagnostic request information, communication problems caused by inconsistent support features of different diagnostic equipment and ECUs are solved, enabling communication capabilities between diagnostic equipment and multiple ECUs, and improving the adaptability of vehicle diagnosis.

CN118803077APending Publication Date: 2024-10-18CHONGQING CHANGAN AUTOMOBILE CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410833414.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-26
Publication Date
2024-10-18

AI Technical Summary

Technical Problem

During the vehicle diagnosis process, different diagnostic equipment and ECUs have different support features for CAN/CAN FD, causing diagnostic equipment that supports a single feature to be unable to communicate with some ECUs.

Method used

By receiving the diagnostic request information sent by the diagnostic device, comparing it with the message data length and format of the target ECU, and performing format conversion processing to ensure that the diagnostic request information can be successfully received by the target ECU through the target transmission channel, and in response Corresponding format conversion is performed in the data to make it consistent with the diagnostic equipment.

Benefits of technology

The adaptability of the gateway controller to diagnostic routing scenarios is improved, enabling diagnostic devices to communicate and diagnose with different target ECUs when UDS on CAN or UDS on CAN FD support features are limited.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118803077A_ABST
    Figure CN118803077A_ABST
Patent Text Reader

Abstract

The invention discloses an adaptive forwarding method and system of a diagnosis message, a vehicle and a storage medium, and the method comprises the steps: obtaining diagnosis request message information sent by diagnosis equipment, and when the diagnosis request message information is judged to be different from a message data length and a message format corresponding to a target ECU, sending the diagnosis request message information to the target ECU; if yes, performing format conversion processing on the diagnosis request message information to obtain target diagnosis request message information; determining a target transmission channel, and sending the target diagnosis request message information to the target ECU; obtaining diagnosis response data collected by the target ECU, and when it is judged that the diagnosis response data is different from the message data length and the message format corresponding to the diagnosis equipment, performing format conversion processing on the diagnosis response data to obtain multi-frame message information; and when the flow control frame information sent by the diagnosis equipment is received, sending the multi-frame message information to the diagnosis equipment. According to the invention, smooth implementation of communication diagnosis of different ECUs by the diagnosis equipment is effectively ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of intelligent driving technology, and in particular to a method, system, vehicle and computer-readable storage medium for adaptively forwarding diagnostic messages. Background Art

[0002] After decades of development, accumulation and application of CAN (Controller Area Network) and CAN FD (Controller Area Network with Flexible Data rate), CAN network has become an important choice for major OEMs around the world when designing vehicle communication networks. More and more functions related to driving, safety, entertainment, comfort, etc. are added to cars, and more and more ECUs (Electronic Control Units) are integrated into cars to meet the needs of these functions. Although domain control and central control computers are gradually replacing traditional distributed electronic and electrical architectures, there are still many types of ECUs on the whole vehicle. Therefore, the communication network layout of the whole vehicle will have several different, isolated and independent local communication networks due to various design considerations.

[0003] In the current vehicle communication network dominated by CAN, there are situations where CAN and CAN FD exist at the same time. GW (GateWay, gateway controller) plays a very important role in the current vehicle communication network, but in the vehicle diagnosis process, different diagnostic devices and ECUs have different support characteristics for CAN / CAN FD, which results in the inability of diagnostic devices that support only one characteristic to communicate with some ECUs after accessing the network.

[0004] Therefore, the prior art still needs to be improved and developed. Summary of the invention

[0005] The main purpose of this application is to provide an adaptive forwarding method, system, vehicle and computer-readable storage medium for diagnostic messages, aiming to solve the problem in the prior art that during the whole vehicle diagnosis process, different diagnostic devices and ECUs have different support characteristics for CAN / CANFD, resulting in a diagnostic device with a single support characteristic being unable to communicate with some ECUs after being connected to the network.

[0006] The first aspect of the present application provides an adaptive forwarding method for diagnostic messages, comprising the following steps: obtaining diagnostic request message information sent by a diagnostic device, and when it is determined that the message data length and message format corresponding to the target ECU are different from those of the diagnostic request message information, performing format conversion processing on the diagnostic request message information to obtain target diagnostic request message information; determining a target transmission channel corresponding to the target ECU, and sending the target diagnostic request message information to the target ECU through the target transmission channel; obtaining diagnostic response data collected by the target ECU according to the target diagnostic request message information, and when it is determined that the diagnostic response data are different from those of the message data length and message format corresponding to the diagnostic device, performing format conversion processing on the diagnostic response data to obtain multi-frame message information; and when the flow control frame information sent by the diagnostic device is received, sending the multi-frame message information to the diagnostic device.

[0007] According to the above technical means, the embodiment of the present application receives the diagnostic request information sent by the diagnostic device, and compares the diagnostic request information with the message data length and message format corresponding to the target ECU. When there is inconsistency, the diagnostic request information is format converted, which can effectively ensure that the diagnostic request information is successfully received by the target ECU through the target transmission channel. Similarly, when the target ECU receives the diagnostic request information and uploads the diagnostic response data, it also needs to be converted into a message data length and message format consistent with the diagnostic device for the diagnostic device to receive, thereby effectively improving the adaptability of the gateway controller to the diagnostic routing scenario. At the same time, it also enables the diagnostic device to communicate and diagnose with different target ECUs distributed in various network segments even when the support features for UDS on CAN or UDS on CAN FD are limited.

[0008] Optionally, in one embodiment of the present application, the diagnostic request message information sent by the diagnostic device is obtained, and when it is determined that the message data length and the message format corresponding to the target ECU are different, the diagnostic request message information is format converted to obtain the target diagnostic request message information, specifically including: when a diagnostic request for the target ECU is received from the diagnostic device, the diagnostic request message information of the diagnostic device is obtained according to the diagnostic request; it is determined whether the message data length of the diagnostic request message information is consistent with that of the target ECU, if not, the diagnostic request message information is format converted to obtain the first diagnostic request message information; it is determined whether the first diagnostic request message information is formatted consistently with that of the target ECU, if not, the first diagnostic request message information is format converted to obtain the target diagnostic request message information.

[0009] According to the above-mentioned technical means, the embodiment of the present application can quickly and accurately obtain the target diagnostic request message information by comparing the received diagnostic request message information with the message data length and message format supported by the target ECU, and converting the inconsistent message data length and message format, thereby ensuring the effective issuance of the diagnostic request information.

[0010] Optionally, in one embodiment of the present application, the obtaining of the diagnostic request message information sent by the diagnostic device further includes: when it is determined that the message data length and the message format corresponding to the target ECU are the same, the diagnostic request message information is used as the target diagnostic request message information; when it is determined that the message data length corresponding to the target ECU is different from the message data length corresponding to the target ECU and the message format is the same, the diagnostic request message information is converted into a first format to obtain the first diagnostic request message information, and the first diagnostic request message information is used as the target diagnostic request message information; when it is determined that the message data length corresponding to the target ECU is the same as the message data length corresponding to the target ECU and the message format is different, the diagnostic request message information is converted into a second format, and the diagnostic request message information after the second format conversion is used as the target diagnostic request message information.

[0011] According to the above technical means, the embodiment of the present application compares the diagnostic request message information with the message data length and message format corresponding to the target ECU respectively. When the diagnostic request message information is inconsistent with the message data length or message format corresponding to the target ECU, the diagnostic request message information format is converted to be consistent with the target ECU. Of course, in this process, if the message data length and message format corresponding to the diagnostic request message information and the target ECU are consistent, there is no need to convert, and the diagnostic request message information can be directly sent to the target ECU through the gateway controller, which can effectively convert the diagnostic request message information sent by the diagnostic device to ensure the effective delivery of the diagnostic request message information.

[0012] Optionally, in one embodiment of the present application, the determining whether the diagnostic request message information is consistent with the message data length corresponding to the target ECU, if not, performing a first format conversion process on the diagnostic request message information to obtain first diagnostic request message information, specifically including: when the CDD module receives the diagnostic request message information, determining whether the diagnostic request message information is consistent with the message data length corresponding to the target ECU; if not, sending the diagnostic request message information to the CAN TP module, and converting the message data length corresponding to the diagnostic request message information to be consistent with the message data length corresponding to the target ECU through the CAN TP module, to obtain the first diagnostic request message information.

[0013] According to the above-mentioned technical means, the embodiment of the present application introduces a CDD module to identify the diagnostic request message information, and can accurately determine whether the diagnostic request message information is consistent with the message data length corresponding to the target ECU. When it is inconsistent, the diagnostic request message information will be sent to the CAN TP module, and the diagnostic request message information will be converted into a first format through the CAN TP module, and the message data length of the diagnostic request message information will be adjusted to be consistent with the message data length corresponding to the target ECU, which can ensure that the diagnostic request message information meets the receiving requirements of the target ECU.

[0014] Optionally, in one embodiment of the present application, the determining whether the first diagnostic request message information is consistent with the message format corresponding to the target ECU, if not, performing a second format conversion process on the first diagnostic request message information to obtain the target diagnostic request message information, specifically includes: the CDD module determining whether the first diagnostic request message information is consistent with the message format corresponding to the target ECU; if not, converting the message format corresponding to the first diagnostic request message information into a message format consistent with the target ECU through the CAN TP module to obtain the target diagnostic request message information.

[0015] According to the above-mentioned technical means, the embodiment of the present application introduces a CDD module to identify the diagnostic request message information. After adjusting the message data length of the diagnostic request message information to be consistent with the message data length corresponding to the target ECU, the message format of the first diagnostic request message information will continue to be identified. When it is determined that the message format of the first diagnostic request message information is inconsistent with the message format corresponding to the target ECU, the message format corresponding to the first diagnostic request message information can also be converted and processed through the CAN TP module, so that the message format corresponding to the first diagnostic request message information is consistent with the message format corresponding to the target ECU, thereby ensuring that the diagnostic request message information meets the receiving requirements of the target ECU.

[0016] Optionally, in one embodiment of the present application, determining the target transmission channel corresponding to the target ECU and sending the target diagnostic request message information to the target ECU through the target transmission channel specifically includes: obtaining a diagnostic routing table, and determining the target transmission channel between the diagnostic device and the target ECU according to the diagnostic routing table; after obtaining the target diagnostic request message information, the CAN TP module sends the target diagnostic request message information to the PDUR module, and the PDUR module sends the target diagnostic request message information to the target ECU through the target transmission channel to complete the diagnostic message routing request.

[0017] According to the above technical means, the embodiment of the present application can find the target transmission channel between the diagnostic device and the target ECU through the pre-set diagnostic routing table. When the message data length and message format between the diagnostic device and the target ECU are consistent, the target diagnostic request message information can be sent to the PDUR module through the CDD module, and the PDUR module sends the target diagnostic request message information through the target transmission channel to the network segment where the corresponding target ECU is located to complete the diagnostic message routing request.

[0018] Optionally, in one embodiment of the present application, the diagnostic response data collected by the target ECU according to the target diagnostic request message information is obtained. When it is determined that the diagnostic response data is different from the message data length and message format corresponding to the diagnostic device, the diagnostic response data is format converted to obtain multi-frame message information, specifically including: when the target ECU receives the target diagnostic request message information, diagnostic data is collected according to the target diagnostic request message information to obtain the diagnostic response data; it is determined whether the diagnostic response data is consistent with the message data length corresponding to the diagnostic device, if not, the diagnostic response data is converted into a third format to obtain first diagnostic response message information; it is determined whether the first diagnostic response message information is consistent with the message format corresponding to the diagnostic device, if not, the first diagnostic response message information is converted into a fourth format to obtain multi-frame message information.

[0019] According to the above-mentioned technical means, in the embodiment of the present application, when the target ECU receives the target diagnostic request message information sent from the diagnostic device, it will search for the corresponding diagnostic data according to the target diagnostic request message information to obtain the corresponding diagnostic response data. In order to return the diagnostic response data to the diagnostic device, it is necessary to consider whether the message data length and message format currently corresponding to the diagnostic response data are consistent with the diagnostic device. If they are inconsistent, it is necessary to convert the format to ensure that the diagnostic response data can be successfully received by the diagnostic device.

[0020] Optionally, in one embodiment of the present application, the determining whether the diagnostic response data is consistent with the message data length corresponding to the diagnostic device, if not, performing a third format conversion process on the diagnostic response data to obtain first diagnostic response message information, specifically includes: when the CDD module receives the diagnostic response data, determining whether the diagnostic response data is consistent with the message data length corresponding to the diagnostic device; if not, sending the diagnostic response data to the CAN TP module, and converting the message data length corresponding to the diagnostic response data to be consistent with the message data length corresponding to the diagnostic device through the CAN TP module, to obtain the first diagnostic response message information.

[0021] According to the above-mentioned technical means, the embodiment of the present application uses the CDD module to identify the diagnostic response data sent by the target ECU, so as to determine whether the diagnostic response data is consistent with the message data length corresponding to the diagnostic device. When it is inconsistent, the diagnostic response data will be sent to the CAN TP module for format conversion, and the message data length corresponding to the diagnostic response data will be set to be consistent with the message data length corresponding to the diagnostic device, which can ensure that the diagnostic response data is successfully received by the diagnostic device and the diagnostic data response is completed.

[0022] Optionally, in one embodiment of the present application, the determining whether the first diagnostic response message information is consistent with the message format corresponding to the diagnostic device, and if not, performing a fourth format conversion process on the first diagnostic response message information to obtain multi-frame message information, specifically includes: the CDD module determining whether the first diagnostic response message information is consistent with the message format corresponding to the diagnostic device; if not, sending the first diagnostic response message information to the CAN TP module, and converting the message format corresponding to the first diagnostic response message information into a message format consistent with the diagnostic device through the CAN TP module, to obtain the multi-frame message information.

[0023] According to the above-mentioned technical means, after ensuring that the diagnostic response data is consistent with the message data length corresponding to the diagnostic device, the embodiment of the present application will further identify the message format of the diagnostic response data through the CDD module, and adjust the message format of the diagnostic response data to be consistent with the message format corresponding to the diagnostic device, which can effectively ensure that the diagnostic response data corresponding to the target ECU is smoothly received by the diagnostic device to complete the diagnostic message response.

[0024] Optionally, in one embodiment of the present application, when the flow control frame information sent by the diagnostic device is received, the multi-frame message information is sent to the diagnostic device, specifically including: obtaining the first frame message information in the multi-frame message information, and sending the first frame message information to the diagnostic device; when the flow control frame information sent by the diagnostic device is received, the remaining message information in the multi-frame message information is sent to the diagnostic device in sequence to complete the diagnostic message routing response.

[0025] According to the above-mentioned technical means, after the diagnostic response data sent by the target ECU is received by the gateway controller and converted into multi-frame message information, the embodiment of the present application will first send out the first frame message information for the diagnostic device to receive. After the diagnostic device successfully receives it and returns the flow control frame information, the remaining message information will be sent to the diagnostic device in sequence, thereby ensuring that the diagnostic device successfully receives the multi-frame message information.

[0026] The second aspect of the present application provides an adaptive forwarding system for diagnostic messages, the adaptive forwarding system for diagnostic messages comprising: a target diagnostic request message information generation module, used to obtain diagnostic request message information sent by a diagnostic device, when it is determined that the diagnostic request message information is different from the message data length and message format corresponding to the target ECU, the diagnostic request message information is format converted to obtain the target diagnostic request message information; a target diagnostic request message information transmission module, used to determine the target transmission channel corresponding to the target ECU, and send the target diagnostic request message information to the target ECU through the target transmission channel; a multi-frame message information generation module, used to obtain the diagnostic response data collected by the target ECU according to the target diagnostic request message information, when it is determined that the diagnostic response data is different from the message data length and message format corresponding to the diagnostic device, the diagnostic response data is format converted to obtain multi-frame message information; a multi-frame message information transmission module, used to send the multi-frame message information to the diagnostic device when receiving the flow control frame information sent by the diagnostic device.

[0027] Optionally, in one embodiment of the present application, the target diagnostic request message information generation module includes: a diagnostic request message information acquisition unit, which is used to obtain the diagnostic request message information of the diagnostic device according to the diagnostic request when a diagnostic request for the target ECU is received from the diagnostic device; a message data length judgment unit, which is used to judge whether the diagnostic request message information is consistent with the message data length corresponding to the target ECU, if not, performing a first format conversion processing on the diagnostic request message information to obtain first diagnostic request message information; a message format judgment unit, which is used to judge whether the first diagnostic request message information is consistent with the message format corresponding to the target ECU, if not, performing a second format conversion processing on the first diagnostic request message information to obtain target diagnostic request message information.

[0028] Optionally, in one embodiment of the present application, the target diagnostic request message information generation module also includes: a first message type judgment unit, which is used to use the diagnostic request message information as the target diagnostic request message information when it is determined that the message data length and message format corresponding to the diagnostic request message information are the same as those corresponding to the target ECU; a second message type judgment unit, which is used to perform a first format conversion process on the diagnostic request message information when it is determined that the message data length corresponding to the diagnostic request message information is different from that corresponding to the target ECU and the message format is the same, to obtain the first diagnostic request message information, and use the first diagnostic request message information as the target diagnostic request message information; a third message type judgment unit, which is used to perform a second format conversion process on the diagnostic request message information when it is determined that the message data length corresponding to the diagnostic request message information is the same as that corresponding to the target ECU and the message format is different, and use the diagnostic request message information after the second format conversion process as the target diagnostic request message information.

[0029] Optionally, in one embodiment of the present application, the message data length judgment unit includes: a diagnostic request message information receiving subunit, which is used to determine whether the diagnostic request message information is consistent with the message data length corresponding to the target ECU when the CDD module receives the diagnostic request message information; a first diagnostic request message information generating subunit, which is used to send the diagnostic request message information to the CAN TP module if not, and convert the message data length corresponding to the diagnostic request message information to be consistent with the message data length corresponding to the target ECU through the CAN TP module, so as to obtain the first diagnostic request message information.

[0030] Optionally, in one embodiment of the present application, the message format judgment unit includes: a first diagnostic request message information judgment subunit, used by the CDD module to determine whether the first diagnostic request message information is consistent with the message format corresponding to the target ECU; a message format conversion subunit, used to, if not, convert the message format corresponding to the first diagnostic request message information into a message format consistent with the target ECU through the CAN TP module to obtain the target diagnostic request message information.

[0031] Optionally, in one embodiment of the present application, the target diagnostic request message information transmission module includes: a target transmission channel acquisition unit, used to acquire a diagnostic routing table and determine the target transmission channel between the diagnostic device and the target ECU according to the diagnostic routing table; a target diagnostic request message information sending unit, used to, after obtaining the target diagnostic request message information, the CAN TP module sends the target diagnostic request message information to the PDUR module, and the PDUR module sends the target diagnostic request message information to the target ECU through the target transmission channel to complete the diagnostic message routing request.

[0032] Optionally, in one embodiment of the present application, the multi-frame message information generation module includes: a diagnostic response data acquisition unit, which is used to collect diagnostic data according to the target diagnostic request message information when the target ECU receives the target diagnostic request message information to obtain the diagnostic response data; a first diagnostic response message information generation unit, which is used to determine whether the diagnostic response data is consistent with the message data length corresponding to the diagnostic device, and if not, the diagnostic response data is converted to a third format to obtain first diagnostic response message information; a multi-frame message information acquisition unit, which is used to determine whether the first diagnostic response message information is consistent with the message format corresponding to the diagnostic device, and if not, the first diagnostic response message information is converted to a fourth format to obtain multi-frame message information.

[0033] Optionally, in one embodiment of the present application, the first diagnostic response message information generation unit includes: a diagnostic response data judgment subunit, used to determine whether the diagnostic response data is consistent with the message data length corresponding to the diagnostic device when the CDD module receives the diagnostic response data; a message data length conversion subunit, used to send the diagnostic response data to the CAN TP module if not, and convert the message data length corresponding to the diagnostic response data to be consistent with the message data length corresponding to the diagnostic device through the CAN TP module, so as to obtain the first diagnostic response message information.

[0034] Optionally, in one embodiment of the present application, the multi-frame message information acquisition unit includes: a first diagnostic response message information judgment subunit, used by the CDD module to judge whether the first diagnostic response message information is consistent with the message format corresponding to the diagnostic device; a message format conversion subunit, used to send the first diagnostic response message information to the CAN TP module if not, and convert the message format corresponding to the first diagnostic response message information into a message format consistent with the diagnostic device through the CAN TP module to obtain the multi-frame message information.

[0035] Optionally, in one embodiment of the present application, the multi-frame message information transmission module includes: a first-frame message information sending unit, used to obtain the first-frame message information in the multi-frame message information, and send the first-frame message information to the diagnostic device; a diagnostic message routing response unit, used to send the remaining message information in the multi-frame message information to the diagnostic device in sequence when receiving the flow control frame information sent by the diagnostic device, so as to complete the diagnostic message routing response.

[0036] A third aspect of the present application provides a vehicle, comprising: a memory, a processor, and an adaptive forwarding program for diagnostic messages stored in the memory and executable on the processor, wherein the adaptive forwarding program for diagnostic messages, when executed by the processor, implements the steps of the adaptive forwarding method for diagnostic messages as described in the above embodiment.

[0037] The fourth aspect of the present application provides a computer-readable storage medium, which stores an adaptive forwarding program for diagnostic messages. When the adaptive forwarding program for diagnostic messages is executed by a processor, the steps of the adaptive forwarding method for diagnostic messages as described in the above embodiments are implemented.

[0038] Beneficial effects of this application:

[0039] (1) The embodiment of the present application receives the diagnostic request information sent by the diagnostic device, and compares the diagnostic request information with the message data length and message format corresponding to the target ECU. When there is inconsistency, the diagnostic request information is format converted, which can effectively ensure that the diagnostic request information is successfully received by the target ECU through the target transmission channel. Similarly, when the target ECU receives the diagnostic request information and uploads the diagnostic response data, it also needs to be converted into a message data length and message format consistent with the diagnostic device for reception by the diagnostic device, thereby effectively improving the adaptability of the gateway controller to the diagnostic routing scenario. At the same time, it also enables the diagnostic device to communicate and diagnose with different target ECUs distributed in various network segments even when the support features for UDS on CAN or UDS on CAN FD are limited.

[0040] (2) The embodiment of the present application compares the diagnostic request message information with the message data length and message format corresponding to the target ECU. When the message data length or message format of the diagnostic request message information is inconsistent with that of the target ECU, the format of the diagnostic request message information is converted to be consistent with that of the target ECU. Of course, in this process, if the message data length and message format of the diagnostic request message information are consistent with those of the target ECU, no conversion is required, and the diagnostic request message information can be directly sent to the target ECU through the gateway controller, which can effectively convert the diagnostic request message information sent by the diagnostic device to ensure the effective delivery of the diagnostic request message information.

[0041] (3) The embodiment of the present application introduces a CDD module to identify the diagnostic request message information, and can accurately determine whether the diagnostic request message information is consistent with the message data length corresponding to the target ECU. When they are inconsistent, the diagnostic request message information will be sent to the CAN TP module, and the diagnostic request message information will be converted into a first format through the CAN TP module, and the message data length of the diagnostic request message information will be adjusted to be consistent with the message data length corresponding to the target ECU, thereby ensuring that the diagnostic request message information meets the receiving requirements of the target ECU.

[0042] (4) The embodiment of the present application introduces a CDD module to identify the diagnostic request message information. After adjusting the message data length of the diagnostic request message information to be consistent with the message data length corresponding to the target ECU, the message format of the first diagnostic request message information will continue to be identified. When it is determined that the message format of the first diagnostic request message information is inconsistent with the message format corresponding to the target ECU, the message format corresponding to the first diagnostic request message information can also be converted and processed through the CAN TP module to make the message format corresponding to the first diagnostic request message information consistent with the message format corresponding to the target ECU, thereby ensuring that the diagnostic request message information meets the receiving requirements of the target ECU.

[0043] (5) The embodiment of the present application can search for the target transmission channel between the diagnostic device and the target ECU through a pre-set diagnostic routing table. When the message data length and message format between the diagnostic device and the target ECU are consistent, the target diagnostic request message information can be sent to the PDUR module through the CDD module, and the PDUR module sends the target diagnostic request message information through the target transmission channel to the network segment where the corresponding target ECU is located to complete the diagnostic message routing request.

[0044] (6) In the embodiment of the present application, when the target ECU receives the target diagnostic request message information sent from the diagnostic device, it will search for the corresponding diagnostic data based on the target diagnostic request message information to obtain the corresponding diagnostic response data. In order to return the diagnostic response data to the diagnostic device, it is necessary to consider whether the message data length and message format currently corresponding to the diagnostic response data are consistent with the diagnostic device. If they are inconsistent, it is necessary to convert the format to ensure that the diagnostic response data can be successfully received by the diagnostic device.

[0045] (7) After the diagnostic response data sent by the target ECU is received by the gateway controller in the embodiment of the present application and converted into multi-frame message information, the first frame message information will be sent out first to allow the diagnostic device to receive it. After the diagnostic device successfully receives it and returns the flow control frame information, the remaining message information will be sent to the diagnostic device in sequence, thereby ensuring that the diagnostic device successfully receives the multi-frame message information.

[0046] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0048] Figure 1 It is a first flow chart of a preferred embodiment of the adaptive forwarding method of the diagnostic message of the present application;

[0049] Figure 2 It is a schematic diagram of the main functional modules of a preferred embodiment of the adaptive forwarding method of the diagnostic message of the present application;

[0050] Figure 3 It is a schematic diagram of the routing and forwarding of diagnostic message data in the traditional mode of the preferred embodiment of the adaptive forwarding system of the diagnostic message of the present application;

[0051] Figure 4 It is a schematic diagram of the diagnostic request routing and forwarding process of a preferred embodiment of the adaptive forwarding system for diagnostic messages of the present application;

[0052] Figure 5 It is a schematic diagram of the diagnostic response routing forwarding process of a preferred embodiment of the adaptive forwarding system for diagnostic messages of the present application;

[0053] Figure 6It is a block diagram of an adaptive forwarding system for diagnostic messages according to an embodiment of the present application;

[0054] Figure 7 This is a schematic structural diagram of a preferred embodiment of the vehicle of the present application.

[0055] Among them, 10-adaptive forwarding system of diagnostic messages; 100-target diagnostic request message information generation module, 200-target diagnostic request message information transmission module, 300-multi-frame message information generation module and 400-multi-frame message information transmission module; 501-memory, 502-processor and 503-communication interface. DETAILED DESCRIPTION

[0056] Embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.

[0057] After decades of development, precipitation and application of CAN (Controller Area Network) and CAN FD (Controller Area Network with Flexible Data rate), CAN network has become an important choice for major OEMs around the world when designing vehicle communication networks. With the continuous improvement of human productivity and the continuous improvement of the pursuit of life, the car, the shining pearl of human industry, is no longer just a simple means of transportation for people to get from A to B. More and more functions related to driving, safety, entertainment, comfort, etc. are added to the car, and more and more ECUs (Electronic Control Units) are born to meet the needs of these functions and integrated into the car. After the car has moved from pure mechanical to electronic, electrified and intelligent, the electronic and electrical architecture of the whole vehicle has also undergone earth-shaking changes. Although domain control and central control computers are gradually replacing the traditional distributed electronic and electrical architecture, there are still many types of ECUs on the whole vehicle. Therefore, the communication network layout of the whole vehicle will also generate several different, isolated and independent local communication networks due to various design considerations.

[0058] Due to various considerations such as cost and demand, in the current vehicle communication network dominated by CAN, there will be situations where CAN and CAN FD coexist. Therefore, GW (GateWay, hereinafter referred to as GW, is a gateway controller) plays a very important role in the current vehicle communication network. Especially in the diagnosis process, different diagnostic devices and ECUs have different support features for CAN / CAN FD, which makes it possible for a diagnostic device that supports a single feature to be unable to communicate with some ECUs after accessing the network. This problem can be solved by using GW to perform diagnostic routing adaptation.

[0059] To solve the above problems, the present invention proposes a method for implementing CAN diagnostic adaptive routing based on the current mainstream AUTOSAR CP architecture, so as to improve the adaptability of GW to diagnostic routing scenarios, so that the diagnostic equipment can still communicate and diagnose with different ECUs distributed in various network segments when the support features of UDS on CAN or UDS on CAN FD are limited. Among them, the present invention is mainly used for the processing technology of the vehicle gateway controller for the routing of diagnostic messages.

[0060] The following describes the adaptive forwarding method, system, vehicle and storage medium of the diagnostic message of the embodiment of the present application with reference to the accompanying drawings. In view of the problem mentioned in the above background technology that different diagnostic devices and ECUs have different support characteristics for CAN / CAN FD during the whole vehicle diagnosis process, which leads to the problem that a diagnostic device with a single support characteristic cannot communicate with some ECUs after accessing the network, the present application provides an adaptive forwarding method for diagnostic messages, in which the diagnostic request information sent by the diagnostic device is received, and the diagnostic request information is compared with the message data length and message format corresponding to the target ECU. When there is inconsistency, the diagnostic request information is format converted, which can effectively ensure that the diagnostic request information is smoothly received by the target ECU through the target transmission channel. Similarly, when the target ECU receives the diagnostic request information and uploads the diagnostic response data, it also needs to be converted into the message data length and message format consistent with the diagnostic device for the diagnostic device to receive, thereby effectively improving the adaptability of the gateway controller to the diagnostic routing scenario, and at the same time, it also enables the diagnostic device to communicate and diagnose with different target ECUs distributed in various network segments when the support characteristics of UDS on CAN or UDS on CAN FD are limited. This solves the problem in the related art that during the vehicle diagnosis process, different diagnostic devices and ECUs have different support characteristics for CAN / CANFD, which results in a diagnostic device with a single support characteristic being unable to communicate with some ECUs after being connected to the network.

[0061] Specifically, Figure 1 A flowchart of a method for adaptive forwarding of diagnostic messages provided in an embodiment of the present application.

[0062] like Figure 1 As shown, the adaptive forwarding method of the diagnostic message includes the following steps:

[0063] In step S101, the diagnostic request message information sent by the diagnostic device is obtained. When it is determined that the message data length and message format of the diagnostic request message information are different from those of the target ECU, the diagnostic request message information is format converted to obtain the target diagnostic request message information.

[0064] In CAN diagnostic adaptive routing, the overall software architecture designed by the present invention complies with the AUTOSAR CP standard, is mainly based on the CAN communication protocol stack, and then combined with the CDD module (Complex Device Driver or Complex Driver, complex device driver / complex driver, which is part of AUTOSAR. The main goal of CDD is to realize complex sensor acquisition and / or actuator control, use specific interrupts and / or complex microcontroller peripherals, and external devices (such as communication transceivers, ASICs, etc.) directly access the microcontroller to meet special functions and timing requirements) to intervene in routing processing to realize diagnostic message request and diagnostic message response functions.

[0065] Based on the standard AUTOSAR CPCAN communication protocol stack, the present invention first adds identification and verification of routing data according to diagnostic routing requirements (i.e., diagnostic routing table) on the interface where BSW and MCAL interact, so as to determine the properties of the diagnostic message data of the required routing.

[0066] It can be understood that the embodiment of the present application obtains the diagnostic request message information of the diagnostic device according to the diagnostic request when receiving the diagnostic request of the diagnostic device to the target ECU; when the CDD module receives the diagnostic request message information, it determines whether the message data length of the diagnostic request message information is consistent with that of the target ECU; if not, the diagnostic request message information is sent to the CAN TP module, and the message data length corresponding to the diagnostic request message information is converted to the message data length corresponding to the target ECU through the CAN TP module to obtain the first diagnostic request message information; the CDD module determines whether the message format of the first diagnostic request message information is consistent with that of the target ECU; if not, the message format corresponding to the first diagnostic request message information is converted to the message format corresponding to the target ECU through the CAN TP module to obtain the target diagnostic request message information.

[0067] After completing the basic processing (i.e., obtaining the diagnostic request message information), the data is passed upward through the standard Canif module, and the CDD module determines whether to directly forward or further process the data (i.e., the diagnostic request message information) based on its recognition result of the diagnostic message.

[0068] If it is direct routing forwarding, the DLC length (i.e., the message data length in the present invention) of the source data (i.e., the diagnostic request data sent by the diagnostic device) and the target data (i.e., the diagnostic response data sent by the target ECU) is consistent, then direct message routing forwarding is performed through the PduR module and the CANIF module, and the routing is transmitted to the target CANIF channel. Before further transmission downward, the message format needs to be finally adjusted. If the two are CAN to CAN FD or CAN FD to CAN, they need to be adjusted according to the routing table to complete the routing forwarding of the diagnostic message (wherein, CAN and CAN FD are the message formats that the diagnostic device or the target ECU may correspond to).

[0069] If the forwarding is variable length, the DLC length of the source data and the target data are inconsistent (the CAN module of the MCAL layer will pass the length information when passing the diagnostic CAN request message to the CAN IF module). The CAN TP module needs to intervene first, and the CAN TP module will perform format conversion on the CAN / CAN FD diagnostic message with inconsistent DLC length.

[0070] Before routing forwarding, the CAN IF data needs to be directly transferred to the CAN TP module. The CAN TP module needs to receive all diagnostic requests or response messages from the CAN IF module, then unpack the received diagnostic data through the CAN TP, and then repack it, and then pass it to the corresponding CAN IF channel through the PDUR module, and then forward it to the CAN network. Among them, the unpacking and packing of CAN TP is to convert the diagnostic data and diagnostic CAN messages according to the rules of ISO14229 (diagnostic routing table). As shown in the following example: before unpacking: CAN FD Frame: 02 10 01 00 00 00 00 00; after unpacking: 1001; before packing: 10 01; after packing: CAN FD Frame: 02 10 01 00 00 00 00 00.

[0071] Further, when it is determined that the message data length and message format of the diagnostic request message information are the same as those corresponding to the target ECU, the diagnostic request message information is used as the target diagnostic request message information; when it is determined that the message data length of the diagnostic request message information and the message data corresponding to the target ECU are different and the message format is the same, the diagnostic request message information is subjected to a first format conversion process to obtain the first diagnostic request message information, and the first diagnostic request message information is used as the target diagnostic request message information; when it is determined that the message data length of the diagnostic request message information and the message data corresponding to the target ECU are the same and the message format is different, the diagnostic request message information is subjected to a second format conversion process, and the diagnostic request message information after the second format conversion process is used as the target diagnostic request message information.

[0072] Specifically, under the AUTOSAR CP architecture, the present invention intervenes in the work of MCAL and BSW (Basic Software) in the diagnosis routing through the CDD module, such as Figure 2 As shown in the figure, during the whole process of diagnostic message request and response, the main work of each module (including CAN module, CAN IF module, PDUR module and CAN TP module) is as follows:

[0073] CAN module: The CAN module is an important module of MCAL (Micro Controller Abstraction Layer). It mainly carries the functional abstraction of the entire CAN controller driver (that is, the functions are encapsulated and abstracted. The encapsulation method and format are specified in AUTOSAR to achieve isolation from the upper-level application logic). It has the function of directly driving the MCU's CAN controller to realize CAN / CAN FD message sending and receiving and CAN controller fault handling.

[0074] CAN IF module: The CAN IF module is an important module of BSW. AUTOSAR CP requires that the upper-layer modules cannot directly access the hardware to achieve software decoupling and isolation. The CAN IF module provides the upper layer with basic services such as CAN message transmission and reception, CAN controller and transceiver mode setting and acquisition, etc. that depend on the CAN hardware.

[0075] PDUR module: The PDUR module (Protocol Data Unit Router) is an important module of BSW. In the present invention, the PDUR module transmits the data to be routed and forwarded between the CAN IF module and the CANTP module according to the pre-configured routing path. These data are PDUs.

[0076] CAN TP module: The CAN TP module (CAN Transport Protocol) is an important module of BSW. In the adaptive diagnostic routing of the present invention, the CAN TP module serves the UDS on CAN / CAN FD diagnostic communication protocol and adaptively adjusts the format of the diagnostic message received from the CAN IF module according to the requirements (i.e., the message data length and message format corresponding to the target ECU) based on ISO 15765-2.

[0077] That is to say, the diagnostic routing workflow is initiated by the diagnostic device. First, the diagnostic device sends a diagnostic request message. After receiving the diagnostic request, the CDD module will distinguish the diagnostic request message as a UDS ON CAN request or a UDS ON CAN FD request according to the content of the diagnostic request message. Specifically, it will identify the message data length and message format (CAN or CAN FD), and can also include identifying the frame type indicated by the first byte of the message. The diagnostic request format supported by the diagnosed ECU (i.e., the target ECU in the present invention) has been agreed upon in advance in the diagnostic routing table. When the CDD module routes and forwards the diagnostic request message to the target ECU, it will compare the identified request format with the format agreed upon by the diagnosed ECU. If the format matches, it will be routed directly. If it does not match, the format conversion between UDS ON CAN and UDS ON CAN FD will be performed (i.e., the message format corresponding to the diagnostic request message is converted to the message format corresponding to the target ECU).

[0078] The embodiment of the present application compares the diagnostic request message information with the message data length and message format corresponding to the target ECU respectively. When the message data length or message format corresponding to the diagnostic request message information and the target ECU is inconsistent, the diagnostic request message information format is converted to be consistent with the target ECU. Of course, in this process, if the message data length and message format corresponding to the diagnostic request message information and the target ECU are consistent, there is no need to convert, and the diagnostic request message information can be directly sent to the target ECU through the gateway controller, which can effectively convert the diagnostic request message information sent by the diagnostic device to ensure the effective delivery of the diagnostic request message information.

[0079] In step S102, a target transmission channel corresponding to the target ECU is determined, and the target diagnosis request message information is sent to the target ECU through the target transmission channel.

[0080] In traditional diagnostic message routing, the formats of all source ends (i.e., the diagnostic device in the present invention) and target ends (i.e., the target ECU in the present invention) are agreed upon in advance. Take the scenario where GW (i.e., gateway controller) routes a diagnostic instrument to request the target ECU to enter an extended session as an example. The diagnosis is UDS ON CAN, and the physical addressing ID is 0x700, where the diagnostic instrument (i.e., diagnostic device) can only access CAN1, and the target ECU can only access CAN2. In this scenario, the data flow is as follows: Figure 3 It is worth noting that Figure 3 The CAN and CAN IF shown in the figure represent channels, not two CAN modules and two CAN IF modules. In the traditional way, after the diagnostic instrument on CAN1 sends a diagnostic request message, the receive interrupt of the GW's CAN module will be triggered, and then the CAN module will receive the diagnostic request message and pass it up to the PDUR module. The PDUR module will pass it down to the CANIF channel and CAN channel corresponding to the CAN module according to the pre-agreed routing channel, and finally route it to the network segment corresponding to the target ECU.

[0081] It can be understood that in the present application, a diagnostic routing table is obtained, and the target transmission channel between the diagnostic device and the target ECU is determined based on the diagnostic routing table; after obtaining the target diagnostic request message information, the CANTP module sends the target diagnostic request message information to the PDUR module, and the PDUR module sends the target diagnostic request message information to the target ECU through the target transmission channel to complete the diagnostic message routing request.

[0082] When performing routing forwarding, the present invention also needs to provide multiple corresponding CAN, CAN IF, and PRUR routing channels according to the pre-agreed diagnostic routing table, but does not perform DLC and CAN message format verification when receiving and sending diagnostic request messages. When agreeing on the diagnostic routing table, the CAN channel and CAN ID of the diagnostic request message can be agreed upon. That is, the CAN message and CAN FD message that meet the ID and channel agreed in the routing table need to be received by the CAN module first. After the reception is completed, the CDD module intervenes to start the adaptive diagnosis identification process.

[0083] In the traditional AUTOSAR CP, after CAN TP parses the data of the diagnostic message, it will be routed and forwarded to the DCM module (Diagnostic Communication Manager, diagnostic communication control module) by the PDUR module. After the DCM module completes the diagnostic function (DCM implements the diagnostic identification function according to the international standard ISO 14229 routing table), it will route the response data back to the CAN TP module through the PDUR. The CAN TP module then processes the response data (converts the diagnostic data and diagnostic CAN message according to the rules of ISO14229, before processing: 10 01; after processing: CAN FD Frame: 02 10 01 00 0000 00 00) to form a UDS communication message.

[0084] Therefore, when the GW performs adaptive diagnostic routing, the CDD module needs to provide a virtual DCM function (in the traditional architecture, DCM implements the specific functions in the ISO 14229 routing table and then transmits the data to the CAN TP module for processing. The virtual DCM does not implement the functions defined in ISO 14229, but only extracts the data of the diagnostic message and selects the appropriate CAN TP channel for processing). The CDD module will select the appropriate CAN TP channel according to the requirements of adaptive diagnostic routing, and parse the diagnostic message of UDS ON CAN or UDS ON CANFD according to the forwarding requirements.

[0085] The embodiment of the present application can search for the target transmission channel between the diagnostic device and the target ECU through a pre-set diagnostic routing table. When the message data length and message format between the diagnostic device and the target ECU are consistent, the target diagnostic request message information can be sent to the PDUR module through the CDD module, and the PDUR module sends the target diagnostic request message information through the target transmission channel to the network segment where the corresponding target ECU is located to complete the diagnostic message routing request.

[0086] In step S103, the diagnostic response data collected by the target ECU according to the target diagnostic request message information is obtained. When it is determined that the diagnostic response data is different from the message data length and message format corresponding to the diagnostic device, the diagnostic response data is format converted to obtain multi-frame message information.

[0087] It can be understood that in the present application, when the target ECU receives the target diagnostic request message information, it collects diagnostic data according to the target diagnostic request message information to obtain the diagnostic response data; when the CDD module receives the diagnostic response data, it determines whether the diagnostic response data is consistent with the message data length corresponding to the diagnostic device; if not, the diagnostic response data is sent to the CAN TP module, and the message data length corresponding to the diagnostic response data is converted to the message data length corresponding to the diagnostic device through the CAN TP module to obtain the first diagnostic response message information; the CDD module determines whether the first diagnostic response message information is consistent with the message format corresponding to the diagnostic device; if not, the first diagnostic response message information is sent to the CAN TP module, and the message format corresponding to the first diagnostic response message information is converted to the message format corresponding to the diagnostic device through the CAN TP module to obtain the multi-frame message information.

[0088] The present invention takes an environment consisting of two independent network segments CAN1 and CAN2 as an example to demonstrate the working scenario of adaptive routing:

[0089] Regulation 1: Diagnostic equipment can only be connected to the CAN1 network. There will be two diagnostic equipment Tester1 and Tester2 on the CAN1 network.

[0090] Regulation 2: Tester1 only supports CAN diagnosis, that is, it can only send and receive diagnostic messages in CAN format, and the message DLC is not greater than 8.

[0091] Regulation 3: Tester2 only supports CAN FD diagnosis, that is, it can only send and receive diagnostic messages in CAN FD format, and the message DLC is not greater than 64.

[0092] Regulation 4: There are ECU1 and ECU2 on the CAN2 network, where ECU1 and ECU2 are only connected to CAN2.

[0093] Regulation 5: ECU1 only supports CAN diagnosis, that is, it can only send and receive diagnostic messages in CAN format, with message DLC no greater than 8, physical addressing ID 0x700, and response ID 0x708.

[0094] Regulation 6: ECU2 in CAN2 only supports CAN FD diagnosis, that is, it can only send and receive diagnostic messages in CAN FD format, with message DLC no greater than 64, physical addressing ID 0x701, and response ID 0x709.

[0095] Regulation 7: The adaptive GW is connected to CAN1 and CAN2 at the same time.

[0096] like Figure 4 As shown in the figure, in the above scenario, the diagnostic request sent by Tester1 to ECU1 or ECU2 on CAN1 can be adjusted to the DUS message format supported by the corresponding ECU when it is finally forwarded to CAN2 under the diagnostic adaptive routing process of GW. For example, Tester1 sends a diagnostic request to CAN1 through the physical addressing ID 0x701: Tester1 CAN1 0x701 CANFrame:03 22F1 89 00 00 00 00; after GW receives this message on CAN1, CDD recognizes that the message length is 8, and there is no need for CAN TP to adjust the format of the message. It can be compatible and sent through UDS ON CAN, and then the message PDU is passed to the PDUR module.

[0097] PDUR recognizes according to the routing configuration that ECU2 will receive this message (ECU2 only supports ECU codes for CAN FD diagnosis), that is, it sends this diagnostic request to CAN2 through CAN IF and CAN module according to the predetermined diagnostic configuration: GW CAN20x701CAN Frame:03 22F1 89 00 00 00 00.

[0098] In the embodiment of the present application, when the target ECU receives the target diagnostic request message information sent from the diagnostic device, it will search for the corresponding diagnostic data according to the target diagnostic request message information to obtain the corresponding diagnostic response data. In order to return the diagnostic response data to the diagnostic device, it is necessary to consider whether the message data length and message format currently corresponding to the diagnostic response data are consistent with the diagnostic device. If they are inconsistent, it is necessary to convert the format to ensure that the diagnostic response data can be successfully received by the diagnostic device.

[0099] In step S104, when the flow control frame information sent by the diagnostic device is received, the multi-frame message information is sent to the diagnostic device.

[0100] It can be understood that in the present application, the first frame message information in the multi-frame message information is obtained, and the first frame message information is sent to the diagnostic device; when the flow control frame information sent by the diagnostic device is received, the remaining message information in the multi-frame message information is sent to the diagnostic device in sequence to complete the diagnostic message routing response.

[0101] like Figure 5As shown in the figure, after ECU2 receives this message, according to the requested 22 service (i.e., the diagnostic service defined in ISO 14229, 0x22 is a hexadecimal number, and 22 service means reading the data of the diagnosed ECU according to DID), the feedback message content is: ECU2CAN2 0x709 CAN FD Frame:00 12 62F1 89 53 57 42 2E 30 2E 33 00 00 00 00 00 0000 00; after GW receives this message in CAN2, CDD recognizes that the message length is 20, and the diagnostic device does not support CAN FD messages. Therefore, the data is passed to the CAN TP module and the message format is converted to multi-frame message transmission. First, the first frame message is sent (the first frame message is also a diagnostic message format defined in ISO 14229. This first frame message is sent from the diagnosed ECU2 to the Tester1 requesting diagnosis): GW CAN1 0x709 CAN Frame:10 12 62F1 89 53 57 42.

[0102] After Tester1 returns the flow control frame (a diagnostic message format defined in ISO 14229, used to control the cycle and number of consecutive frame sending), it sends out consecutive frame messages: GW CAN1 0x709 CAN Frame:21 2E 30 2E 38 2E31 00; GW CAN10x709 CAN Frame:22 00 00 00 00 00 00 00. The above completes the entire diagnostic adaptive routing work.

[0103] After the embodiment of the present application converts the diagnostic response data sent by the target ECU into multi-frame message information through the gateway controller, the first frame message information will be sent out first to allow the diagnostic device to receive it. After the diagnostic device successfully receives it and returns the flow control frame information, the remaining message information will be sent to the diagnostic device in sequence, ensuring that the diagnostic device successfully receives the multi-frame message information.

[0104] In summary, the present invention proposes an adaptive forwarding method for diagnostic messages. Based on the current mainstream AUTOSAR CP architecture, the present invention proposes an implementation method for CAN diagnostic adaptive routing, thereby improving the adaptability of GW to diagnostic routing scenarios, so that the diagnostic device can still communicate and diagnose with different ECUs distributed in various network segments when the support features of UDS on CAN or UDS on CAN FD are limited.

[0105] In summary, the present invention proposes an adaptive forwarding method for diagnostic messages, which receives diagnostic request information sent by a diagnostic device, and compares the diagnostic request information with the message data length and message format corresponding to the target ECU. When there is inconsistency, the diagnostic request information is format converted, which can effectively ensure that the diagnostic request information is smoothly received by the target ECU through the target transmission channel. Similarly, when the target ECU receives the diagnostic request information and uploads the diagnostic response data, it also needs to be converted into a message data length and message format consistent with the diagnostic device for the diagnostic device to receive, thereby effectively improving the adaptability of the gateway controller to the diagnostic routing scenario. At the same time, it also enables the diagnostic device to communicate and diagnose with different target ECUs distributed in various network segments even when the support features for UDS on CAN or UDS on CAN FD are limited.

[0106] Next, the adaptive forwarding system for diagnostic messages proposed in accordance with the embodiments of the present application will be described with reference to the accompanying drawings.

[0107] Figure 6 It is a block diagram of an adaptive forwarding system for diagnostic messages according to an embodiment of the present application.

[0108] like Figure 6 As shown, the adaptive forwarding system 10 of the diagnostic message includes: a target diagnostic request message information generation module 100 , a target diagnostic request message information transmission module 200 , a multi-frame message information generation module 300 and a multi-frame message information transmission module 400 .

[0109] Specifically, the target diagnostic request message information generating module is used to obtain the diagnostic request message information sent by the diagnostic device, and when it is determined that the message data length and message format corresponding to the diagnostic request message information and the target ECU are different, the diagnostic request message information is format converted to obtain the target diagnostic request message information;

[0110] A target diagnosis request message information transmission module, used for determining a target transmission channel corresponding to the target ECU, and sending the target diagnosis request message information to the target ECU through the target transmission channel;

[0111] a multi-frame message information generating module, used for acquiring the diagnostic response data collected by the target ECU according to the target diagnostic request message information, and when it is determined that the diagnostic response data is different from the message data length and message format corresponding to the diagnostic device, performing format conversion processing on the diagnostic response data to obtain multi-frame message information;

[0112] The multi-frame message information transmission module is used to send the multi-frame message information to the diagnostic device when receiving the flow control frame information sent by the diagnostic device.

[0113] Optionally, in one embodiment of the present application, the target diagnosis request message information generation module 100 includes: a diagnosis request message information acquisition unit, a message data length judgment unit and a message format judgment unit.

[0114] The diagnostic request message information acquisition unit is used to acquire the diagnostic request message information of the diagnostic device according to the diagnostic request when receiving the diagnostic request of the diagnostic device to the target ECU;

[0115] a message data length determination unit, configured to determine whether the diagnosis request message information is consistent with the message data length corresponding to the target ECU, and if not, to perform a first format conversion process on the diagnosis request message information to obtain first diagnosis request message information;

[0116] The message format determination unit is used to determine whether the message format of the first diagnostic request message information is consistent with the message format corresponding to the target ECU. If not, the first diagnostic request message information is converted into a second format to obtain the target diagnostic request message information.

[0117] Optionally, in one embodiment of the present application, the target diagnosis request message information generation module 100 further includes: a first message type determination unit, a second message type determination unit and a third message type determination unit;

[0118] The first message type determination unit is used to, when determining that the message data length and message format of the diagnosis request message information are the same as those of the target ECU, use the diagnosis request message information as the target diagnosis request message information;

[0119] a second message type determination unit, configured to, when determining that the diagnostic request message information and the message data length corresponding to the target ECU are different and the message format is the same, perform a first format conversion process on the diagnostic request message information to obtain the first diagnostic request message information, and use the first diagnostic request message information as the target diagnostic request message information;

[0120] The third message type judgment unit is used to perform a second format conversion process on the diagnostic request message information when it is determined that the diagnostic request message information and the message data length corresponding to the target ECU are the same but the message format is different, and use the diagnostic request message information after the second format conversion process as the target diagnostic request message information.

[0121] Optionally, in one embodiment of the present application, the message data length determination unit includes: a diagnosis request message information receiving subunit and a first diagnosis request message information generating subunit;

[0122] Wherein, the diagnosis request message information receiving subunit is used to determine whether the diagnosis request message information is consistent with the message data length corresponding to the target ECU when the CDD module receives the diagnosis request message information;

[0123] The first diagnostic request message information generating subunit is used to send the diagnostic request message information to the CAN TP module if not, and convert the message data length corresponding to the diagnostic request message information to be consistent with the message data length corresponding to the target ECU through the CAN TP module to obtain the first diagnostic request message information.

[0124] Optionally, in one embodiment of the present application, the message format determination unit includes: a first diagnosis request message information determination subunit and a message format conversion subunit;

[0125] Wherein, the first diagnostic request message information judgment subunit is used for the CDD module to judge whether the message format of the first diagnostic request message information is consistent with that of the target ECU;

[0126] The message format conversion subunit is used to, if not, convert the message format corresponding to the first diagnostic request message information into a message format consistent with the message format corresponding to the target ECU through the CAN TP module to obtain the target diagnostic request message information.

[0127] Optionally, in an embodiment of the present application, the target diagnosis request message information transmission module 200 includes: a target transmission channel acquisition unit and a target diagnosis request message information sending unit.

[0128] Wherein, the target transmission channel acquisition unit is used to acquire a diagnostic routing table and determine a target transmission channel between the diagnostic device and the target ECU according to the diagnostic routing table;

[0129] The target diagnostic request message information sending unit is used for, after obtaining the target diagnostic request message information, the CAN TP module sends the target diagnostic request message information to the PDUR module, and the PDUR module sends the target diagnostic request message information to the target ECU through the target transmission channel to complete the diagnostic message routing request.

[0130] Optionally, in an embodiment of the present application, the multi-frame message information generation module 300 includes: a diagnosis response data acquisition unit, a first diagnosis response message information generation unit and a multi-frame message information acquisition unit.

[0131] Wherein, the diagnostic response data acquisition unit is used to collect diagnostic data according to the target diagnostic request message information when the target ECU receives the target diagnostic request message information to obtain the diagnostic response data;

[0132] a first diagnostic response message information generating unit, configured to determine whether the diagnostic response data is consistent with the message data length corresponding to the diagnostic device, and if not, to perform a third format conversion process on the diagnostic response data to obtain first diagnostic response message information;

[0133] The multi-frame message information acquisition unit is used to determine whether the first diagnostic response message information is consistent with the message format corresponding to the diagnostic device. If not, the first diagnostic response message information is converted into a fourth format to obtain multi-frame message information.

[0134] Optionally, in one embodiment of the present application, the first diagnostic response message information generating unit includes: a diagnostic response data judging subunit and a message data length converting subunit.

[0135] Wherein, the diagnostic response data judgment subunit is used to judge whether the diagnostic response data is consistent with the message data length corresponding to the diagnostic device when the CDD module receives the diagnostic response data;

[0136] The message data length conversion subunit is used to send the diagnostic response data to the CAN TP module if not, and convert the message data length corresponding to the diagnostic response data to the message data length corresponding to the diagnostic device through the CAN TP module to obtain the first diagnostic response message information.

[0137] Optionally, in one embodiment of the present application, the multi-frame message information acquisition unit includes: a first diagnostic response message information judgment subunit and a message format conversion subunit.

[0138] Wherein, the first diagnosis response message information judgment subunit is used for the CDD module to judge whether the first diagnosis response message information is consistent with the message format corresponding to the diagnostic device;

[0139] The message format conversion subunit is used to send the first diagnostic response message information to the CANTP module if not, and convert the message format corresponding to the first diagnostic response message information into a message format consistent with the message format corresponding to the diagnostic device through the CAN TP module to obtain the multi-frame message information.

[0140] Optionally, in one embodiment of the present application, the multi-frame message information transmission module 400 includes: a first frame message information sending unit and a diagnostic message routing response unit.

[0141] Wherein, the first frame message information sending unit is used to obtain the first frame message information in the multiple frames of message information, and send the first frame message information to the diagnostic device;

[0142] The diagnostic message routing response unit is used to send the remaining message information in the multi-frame message information to the diagnostic device in sequence when receiving the flow control frame information sent by the diagnostic device, so as to complete the diagnostic message routing response.

[0143] It should be noted that the above explanation of the embodiment of the adaptive forwarding method of diagnostic messages is also applicable to the adaptive forwarding system of diagnostic messages in this embodiment, and will not be repeated here.

[0144] According to the adaptive forwarding system of diagnostic messages proposed in the embodiment of the present application, it is possible to receive the diagnostic request information sent by the diagnostic device, and compare the diagnostic request information with the message data length and message format corresponding to the target ECU. When there is inconsistency, the diagnostic request information is format converted, which can effectively ensure that the diagnostic request information is successfully received by the target ECU through the target transmission channel. Similarly, when the target ECU receives the diagnostic request information and uploads the diagnostic response data, it also needs to be converted into a message data length and message format consistent with the diagnostic device for the diagnostic device to receive, thereby effectively improving the adaptability of the gateway controller to the diagnostic routing scenario. At the same time, it also enables the diagnostic device to communicate and diagnose with different target ECUs distributed in various network segments even when the support features for UDS on CAN or UDS on CAN FD are limited.

[0145] This solves the problem in the prior art that during the vehicle diagnosis process, different diagnostic devices and ECUs have different support characteristics for CAN / CAN FD, resulting in a diagnostic device with a single support characteristic being unable to communicate with some ECUs after being connected to the network.

[0146] Figure 7 A schematic diagram of the structure of a vehicle provided in an embodiment of the present application. The vehicle may include:

[0147] A memory 501 , a processor 502 , and a computer program stored in the memory 501 and executable on the processor 502 .

[0148] When the processor 502 executes the program, the adaptive forwarding method of the diagnostic message provided in the above embodiment is implemented.

[0149] Furthermore, the car also includes:

[0150] The communication interface 503 is used for communication between the memory 501 and the processor 502 .

[0151] The memory 501 is used to store computer programs that can be executed on the processor 502 .

[0152] The memory 501 may include a high-speed RAM memory, and may also include a nonvolatile memory (nonvolatile memory), such as at least one disk memory.

[0153] If the memory 501, the processor 502 and the communication interface 503 are implemented independently, the communication interface 503, the memory 501 and the processor 502 can be connected to each other through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus or an Extended Industry Standard Architecture (EIS) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0154] Optionally, in a specific implementation, if the memory 501, the processor 502 and the communication interface 503 are integrated on a chip, the memory 501, the processor 502 and the communication interface 503 can communicate with each other through an internal interface.

[0155] The processor 502 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.

[0156] This embodiment further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the above-mentioned adaptive forwarding method of the diagnostic message is implemented.

[0157] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0158] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0159] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or N executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.

[0160] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable storage medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purposes of this specification, a "computer-readable storage medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples (non-exhaustive list) of computer-readable storage media include the following: an electrical connection with one or N wirings (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable storage medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways as necessary and then storing it in a computer memory.

[0161] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiment, the N steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0162] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0163] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0164] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present application. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present application.

[0165] It should be understood that the application of the present application is not limited to the above examples. For ordinary technicians in this field, improvements or changes can be made based on the above description. All these improvements and changes should fall within the scope of protection of the claims attached to this application.

Claims

1. A method for adaptive forwarding of diagnostic messages, characterized in that: The adaptive forwarding method of the diagnostic message includes: Acquire the diagnostic request message information sent by the diagnostic device, and when it is determined that the message data length and message format of the diagnostic request message information are different from those of the target ECU, perform format conversion processing on the diagnostic request message information to obtain the target diagnostic request message information; Determine a target transmission channel corresponding to the target ECU, and send the target diagnosis request message information to the target ECU through the target transmission channel; Acquire diagnostic response data collected by the target ECU according to the target diagnostic request message information, and when it is determined that the diagnostic response data is different from the message data length and message format corresponding to the diagnostic device, perform format conversion processing on the diagnostic response data to obtain multi-frame message information; When the flow control frame information sent by the diagnostic device is received, the multi-frame message information is sent to the diagnostic device.

2. The adaptive forwarding method of diagnostic messages according to claim 1, characterized in that: The obtaining of the diagnostic request message information sent by the diagnostic device, when determining that the message data length and message format of the diagnostic request message information are different from those of the target ECU, performs format conversion processing on the diagnostic request message information to obtain the target diagnostic request message information, specifically including: When receiving a diagnostic request from a diagnostic device to a target ECU, obtaining diagnostic request message information of the diagnostic device according to the diagnostic request; Determining whether the diagnostic request message information is consistent with the message data length corresponding to the target ECU, and if not, performing a first format conversion process on the diagnostic request message information to obtain first diagnostic request message information; It is determined whether the first diagnostic request message information is consistent with the message format corresponding to the target ECU. If not, the first diagnostic request message information is converted into a second format to obtain the target diagnostic request message information.

3. The adaptive forwarding method of diagnostic messages according to claim 1, characterized in that: The step of obtaining the diagnostic request message information sent by the diagnostic device further includes: When it is determined that the message data length and message format of the diagnosis request message information are the same as those corresponding to the target ECU, the diagnosis request message information is used as the target diagnosis request message information; When it is determined that the diagnostic request message information and the message data length corresponding to the target ECU are different and the message format is the same, the diagnostic request message information is converted into a first format to obtain the first diagnostic request message information, and the first diagnostic request message information is used as the target diagnostic request message information; When it is determined that the diagnostic request message information and the message data length corresponding to the target ECU are the same but the message format is different, the diagnostic request message information is converted into a second format and the diagnostic request message information after the second format conversion is used as the target diagnostic request message information.

4. The adaptive forwarding method of diagnostic messages according to claim 2, characterized in that: The determining whether the diagnostic request message information is consistent with the message data length corresponding to the target ECU, and if not, performing a first format conversion process on the diagnostic request message information to obtain the first diagnostic request message information, specifically includes: When the CDD module receives the diagnostic request message information, it determines whether the diagnostic request message information is consistent with the message data length corresponding to the target ECU; If not, the diagnostic request message information is sent to the CAN TP module, and the message data length corresponding to the diagnostic request message information is converted by the CAN TP module to be consistent with the message data length corresponding to the target ECU, so as to obtain the first diagnostic request message information.

5. The adaptive forwarding method of diagnostic messages according to claim 4, characterized in that: The determining whether the first diagnostic request message information is consistent with the message format corresponding to the target ECU, and if not, performing a second format conversion process on the first diagnostic request message information to obtain the target diagnostic request message information, specifically includes: The CDD module determines whether the first diagnostic request message information is consistent with the message format corresponding to the target ECU; If not, the message format corresponding to the first diagnostic request message information is converted into a message format consistent with the message format corresponding to the target ECU through the CAN TP module to obtain the target diagnostic request message information.

6. The method for adaptively forwarding diagnostic messages according to claim 5, characterized in that: The determining a target transmission channel corresponding to the target ECU and sending the target diagnosis request message information to the target ECU through the target transmission channel specifically includes: Obtain a diagnostic routing table, and determine a target transmission channel between the diagnostic device and the target ECU based on the diagnostic routing table; after obtaining the target diagnostic request message information, the CAN TP module sends the target diagnostic request message information to the PDUR module, and the PDUR module sends the target diagnostic request message information to the target ECU through the target transmission channel to complete the diagnostic message routing request.

7. The adaptive forwarding method of diagnostic messages according to claim 6, characterized in that: The obtaining of the diagnostic response data collected by the target ECU according to the target diagnostic request message information, when it is determined that the diagnostic response data is different from the message data length and message format corresponding to the diagnostic device, then performing format conversion processing on the diagnostic response data to obtain multi-frame message information, specifically includes: When the target ECU receives the target diagnosis request message information, it collects diagnostic data according to the target diagnosis request message information to obtain the diagnostic response data; Determine whether the diagnostic response data is consistent with the message data length corresponding to the diagnostic device, and if not, perform a third format conversion process on the diagnostic response data to obtain first diagnostic response message information; It is determined whether the first diagnostic response message information is consistent with the message format corresponding to the diagnostic device; if not, a fourth format conversion process is performed on the first diagnostic response message information to obtain multi-frame message information.

8. The adaptive forwarding method of diagnostic messages according to claim 7, characterized in that: The determining whether the diagnostic response data is consistent with the message data length corresponding to the diagnostic device, and if not, performing a third format conversion process on the diagnostic response data to obtain first diagnostic response message information specifically includes: When the CDD module receives the diagnostic response data, it determines whether the diagnostic response data is consistent with the message data length corresponding to the diagnostic device; If not, the diagnostic response data is sent to the CAN TP module, and the message data length corresponding to the diagnostic response data is converted into a message data length consistent with the message data length corresponding to the diagnostic device by the CAN TP module to obtain the first diagnostic response message information.

9. The adaptive forwarding method of diagnostic messages according to claim 7, characterized in that: The determining whether the first diagnostic response message information is consistent with the message format corresponding to the diagnostic device, and if not, performing a fourth format conversion process on the first diagnostic response message information to obtain multi-frame message information specifically includes: The CDD module determines whether the first diagnostic response message information is consistent with the message format corresponding to the diagnostic device; If not, the first diagnostic response message information is sent to the CAN TP module, and the message format corresponding to the first diagnostic response message information is converted into a message format consistent with the message format corresponding to the diagnostic device by the CAN TP module to obtain the multi-frame message information.

10. The method for adaptive forwarding of diagnostic messages according to claim 1, characterized in that: When the flow control frame information sent by the diagnostic device is received, the multi-frame message information is sent to the diagnostic device, specifically including: Acquire the first frame message information in the multiple frames message information, and send the first frame message information to the diagnostic device; When the flow control frame information sent by the diagnostic device is received, the remaining message information in the multi-frame message information is sent to the diagnostic device in sequence to complete the diagnostic message routing response.

11. An adaptive forwarding system for diagnostic messages, characterized in that: The adaptive forwarding system of the diagnostic message comprises: A target diagnostic request message information generating module is used to obtain the diagnostic request message information sent by the diagnostic device, and when it is determined that the message data length and message format of the diagnostic request message information are different from those of the target ECU, the diagnostic request message information is format converted to obtain the target diagnostic request message information; A target diagnosis request message information transmission module, used for determining a target transmission channel corresponding to the target ECU, and sending the target diagnosis request message information to the target ECU through the target transmission channel; a multi-frame message information generating module, used for acquiring the diagnostic response data collected by the target ECU according to the target diagnostic request message information, and when it is determined that the diagnostic response data is different from the message data length and message format corresponding to the diagnostic device, performing format conversion processing on the diagnostic response data to obtain multi-frame message information; The multi-frame message information transmission module is used to send the multi-frame message information to the diagnostic device when receiving the flow control frame information sent by the diagnostic device.

12. A vehicle, characterized in that: The vehicle includes: a memory, a processor, and an adaptive forwarding program for diagnostic messages stored in the memory and executable on the processor. When the adaptive forwarding program for diagnostic messages is executed by the processor, the steps of the adaptive forwarding method for diagnostic messages as described in any one of claims 1 to 10 are implemented.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores an adaptive forwarding program for diagnostic messages, and when the adaptive forwarding program for diagnostic messages is executed by a processor, the steps of the adaptive forwarding method for diagnostic messages according to any one of claims 1 to 10 are implemented.

Citation Information

Cited By

  • Heavy duty vehicle NOx emission data diagnosis system and method based on remote monitoring

    CN119470817A