CN115776526A - Vehicle-mounted diagnosis message protocol conversion control method, device, equipment and medium - Google Patents

Vehicle-mounted diagnosis message protocol conversion control method, device, equipment and medium Download PDF

Info

Publication number
CN115776526A
CN115776526A CN202211529762.1A CN202211529762A CN115776526A CN 115776526 A CN115776526 A CN 115776526A CN 202211529762 A CN202211529762 A CN 202211529762A CN 115776526 A CN115776526 A CN 115776526A
Authority
CN
China
Prior art keywords
gateway
response
vehicle
message
target domain
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211529762.1A
Other languages
Chinese (zh)
Inventor
卢乾
黄杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chongqing Changan Automobile Co Ltd
Original Assignee
Chongqing Changan Automobile Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chongqing Changan Automobile Co Ltd filed Critical Chongqing Changan Automobile Co Ltd
Priority to CN202211529762.1A priority Critical patent/CN115776526A/en
Publication of CN115776526A publication Critical patent/CN115776526A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Landscapes

  • Small-Scale Networks (AREA)

Abstract

The application relates to the technical field of automotive electronics, and discloses a method, a device, equipment and a medium for controlling protocol conversion of a vehicle-mounted diagnosis message, wherein the method comprises the following steps: sending an initial request message to a pre-configured multistage vehicle-mounted diagnosis subordinate gateway, and starting a pre-configured first-class receiving response timer; performing protocol conversion on the initial request message through a multi-stage vehicle-mounted diagnosis lower-stage gateway, and transmitting the converted request message to a target domain controller; if the response message returned by the target domain controller is overtime and a negative response code returned by the multistage vehicle-mounted diagnosis subordinate gateway is received in a preset first receiving response time period, the connection with the multistage vehicle-mounted diagnosis subordinate gateway is maintained and the first type receiving response timer is reset so as to receive the response message returned by the target domain controller in the first receiving request time period. The timer is reset through the negative response code to keep connection with the multi-stage vehicle-mounted diagnosis subordinate gateway, and the problem that the response message cannot be uploaded is avoided.

Description

Vehicle-mounted diagnosis message protocol conversion control method, device, equipment and medium
Technical Field
The application relates to the technical field of automotive electronics, in particular to a method, a device, equipment and a medium for controlling protocol conversion of vehicle-mounted diagnosis messages.
Background
Automobile intellectualization is a hot topic, and each large automobile company pays attention to related technologies, new functions are developed endlessly, and many new functions are not supported by a traditional Controller Area Network (CAN) Network, so that new Network technologies such as an ethernet Network and the like are introduced into an automobile.
However, the ethernet cannot completely replace the conventional CAN network due to the problems of technical maturity, cost and the like, so that a new technical problem is brought, that is, the problem of inter-conversion and inter-communication between different network protocols. For vehicle diagnosis, the Protocol is converted between a CAN-based Diagnostic Protocol and an ethernet-based Diagnostic Protocol DOIP (Diagnostic communication over Internet Protocol). An ethernet CAN use a frame of message to send longer data, but a single frame of a diagnosis protocol based on a CAN only send 64 bytes of data at the longest, which requires the combination of short messages and the splitting of long messages in the routing process, in the process, a gateway needs to spend a long time, connection timeout between the gateway and the diagnosis device may occur, but the diagnosis device cannot be left unrestrained, and the like, so an additional timer mechanism needs to be added in the gateway to ensure that the abnormal conditions of timeout connection disconnection or unrestrained waiting cannot occur in the protocol conversion process.
Therefore, how to implement the protocol conversion process without timeout disconnection or unlimited waiting is a problem that needs to be solved urgently at present.
Disclosure of Invention
In view of the above drawbacks of the prior art, the present invention provides a method, an apparatus, a device and a medium for controlling protocol conversion of on-board diagnostics messages, so as to solve the above technical problems.
In an embodiment of the present invention, a method for controlling protocol conversion of a vehicle-mounted diagnosis message is provided, where the method is applied to a vehicle-mounted diagnosis device, and the method includes:
sending an initial request message to a pre-configured multistage vehicle-mounted diagnosis subordinate gateway, and starting a pre-configured first-class receiving response timer;
performing protocol conversion on the initial request message through the multistage vehicle-mounted diagnosis lower-level gateway, and transmitting the converted request message to a target domain controller;
if the response message returned by the target domain controller is overtime and a negative response code returned by the multistage vehicle-mounted diagnosis subordinate gateway is received in a preset first receiving response time period, the connection with the multistage vehicle-mounted diagnosis subordinate gateway is maintained and the first type receiving response timer is reset so as to receive the response message returned by the target domain controller in a first receiving request time period.
In an embodiment of the present invention, after transmitting the converted request packet to the target domain controller, the method further includes:
if a response message returned by the target domain controller is received within a preset first message returning time period, determining that the response of the target domain controller is not overtime, and keeping connection with the multistage vehicle-mounted diagnosis lower-level gateway and the target domain controller;
and if the response message returned by the target domain controller is not received in a preset first message return time period, determining that the response of the target domain controller is overtime, and receiving a negative response code returned by the multistage vehicle-mounted diagnosis subordinate gateway in a preset first receiving response time period.
In an embodiment of the present invention, the multistage vehicle-mounted diagnosis lower level gateway includes a first-stage gateway and a second-stage gateway, and the performing protocol conversion on the initial request packet and transmitting the converted request packet to the target domain controller through the multistage vehicle-mounted diagnosis lower level gateway includes:
converting the initial request message based on the CAN network into a request message based on the Ethernet through the primary gateway, and transmitting the request message based on the Ethernet to the secondary gateway;
and converting the request message based on the Ethernet into a target request message based on a CAN (controller area network) through the secondary gateway, and transmitting the target request message based on the CAN to the target domain controller so as to realize the diagnosis of the target domain controller.
In an embodiment of the present invention, after performing protocol conversion on the initial request packet and transmitting the converted request packet to the target domain controller through the multi-level vehicle-mounted diagnosis lower level gateway, the method further includes:
converting the initial response message based on the CAN network returned by the target domain controller into a response message based on the Ethernet through the secondary gateway, and transmitting the response message based on the Ethernet to the primary gateway;
and converting the response message based on the Ethernet into a target response message based on the CAN through the primary gateway, and transmitting the target response message to the vehicle-mounted diagnostic equipment.
In an embodiment of the present invention, the converting, by the secondary gateway, the initial response packet based on the CAN network returned by the target domain controller into a response packet based on the ethernet network includes:
if the initial response message based on the CAN network returned by the target domain controller is a multi-frame response message, combining the initial response message based on the CAN network returned by the target domain controller through a message combination module configured in advance in the secondary gateway, and converting the combined response message into the response message based on the Ethernet.
In an embodiment of the present invention, the receiving, within a preset first receiving response time period, a negative response code returned by the multilevel vehicle-mounted diagnosis subordinate gateway includes:
when the primary gateway receives the initial request message, a first class receiving request timer is started, and if the primary gateway does not return the response message to the vehicle-mounted diagnosis equipment within a first receiving request time period corresponding to the first class receiving request timer, the primary gateway sends the negative response code to the vehicle-mounted diagnosis equipment by using the logical addresses of the target and the controller; and/or the presence of a gas in the gas,
and when the secondary gateway receives the request message based on the Ethernet, starting a first class receiving request timer, and if the secondary gateway does not return the response message to the primary gateway within a first receiving request time period corresponding to the first class receiving request timer, sending the negative response code to the primary gateway by using the logical addresses of the target and the controller.
In an embodiment of the present invention, after maintaining the connection with the multi-stage vehicle diagnosis subordinate gateway and resetting the first type reception response timer, the method further includes:
if the first-level gateway does not return the negative response code within a second receiving request time period or within the time from the target domain controller to the next response message, determining that the connection between the first-level gateway and the second-level gateway is overtime;
and in a second request receiving time period or the time from the target domain controller to the next response message sending, the secondary gateway does not return the negative response code to the primary gateway, and disconnects the vehicle-mounted diagnosis equipment, the primary gateway, the secondary gateway and the target domain controller.
In an embodiment of the present invention, a device for controlling protocol conversion of vehicle-mounted diagnosis messages is further provided, where the device includes:
the initial request message issuing module is used for sending an initial request message to a pre-configured multistage vehicle-mounted diagnosis subordinate gateway and starting a pre-configured first-class receiving response timer;
the request message conversion module is used for carrying out protocol conversion on the initial request message through the multistage vehicle-mounted diagnosis subordinate gateway and transmitting the converted request message to a target domain controller;
and the overtime connection module is used for keeping connection with the multistage vehicle-mounted diagnosis lower-level gateway and resetting the first type of receiving response timer if the response message returned by the target domain controller is overtime and a negative response code returned by the multistage vehicle-mounted diagnosis lower-level gateway is received within a preset first receiving response time period, so that the response message returned by the target domain controller is received within a first receiving request time period.
In an embodiment of the present invention, an electronic device is further provided, where the electronic device includes:
one or more processors;
a storage device for storing one or more programs that, when executed by the one or more processors, cause the electronic device to implement the on-board diagnostic message protocol conversion control method as described above.
In an embodiment of the present invention, there is further provided a computer-readable storage medium, on which a computer program is stored, wherein when the computer program is executed by a processor of a computer, the computer program is used to make the computer execute the on-board diagnosis message protocol conversion control method as described above.
The invention has the beneficial effects that: firstly, sending an initial request message to a pre-configured multistage vehicle-mounted diagnosis subordinate gateway, and starting a pre-configured first-class receiving response timer; then, carrying out protocol conversion on the initial request message through the multistage vehicle-mounted diagnosis lower-level gateway, and transmitting the converted request message to a target domain controller; if the response message returned by the target domain controller is overtime and a negative response code returned by the multistage vehicle-mounted diagnosis subordinate gateway is received in a preset first receiving response time period, the connection with the multistage vehicle-mounted diagnosis subordinate gateway is maintained and the first type receiving response timer is reset so as to receive the response message returned by the target domain controller in a first receiving request time period. In the invention, the multi-stage vehicle-mounted diagnosis lower-level gateway sends the request message to the target domain controller and returns the response message, and when the returned response message is overtime, the timer is reset through the negative response code to keep the connection with the multi-stage vehicle-mounted diagnosis lower-level gateway, so that the problem that the response message cannot be uploaded due to disconnection is avoided.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application. It is obvious that the drawings in the following description are only some embodiments of the application, and that for a person skilled in the art, other drawings can be derived from them without inventive effort. In the drawings:
fig. 1 is a schematic diagram of an implementation environment of a vehicle-mounted diagnosis message protocol conversion control method according to an exemplary embodiment of the present application;
FIG. 2 is a flow chart illustrating an on-board diagnostics message protocol conversion control method in accordance with an exemplary embodiment of the present application;
fig. 3 is an interaction diagram of a vehicle-mounted diagnosis message protocol conversion control method according to an exemplary embodiment of the present application;
fig. 4 is a block diagram of an on-board diagnostic message protocol conversion control apparatus shown in an exemplary embodiment of the present application;
FIG. 5 illustrates a schematic structural diagram of a computer system suitable for use in implementing the electronic device of an embodiment of the present application.
Detailed Description
Other advantages and effects of the present invention will become apparent to those skilled in the art from the disclosure herein, wherein the embodiments of the present invention are described in detail with reference to the accompanying drawings and preferred embodiments. The invention is capable of other and different embodiments and of being practiced or of being carried out in various ways, and its several details are capable of modification in various respects, all without departing from the spirit and scope of the present invention. It should be understood that the preferred embodiments are illustrative of the invention only and are not limiting upon the scope of the invention.
It should be noted that the drawings provided in the following embodiments are only for illustrating the basic idea of the present invention, and the drawings only show the components related to the present invention rather than being drawn according to the number, shape and size of the components in actual implementation, and the type, amount and proportion of each component in actual implementation can be changed freely, and the layout of the components can be more complicated.
In the following description, numerous details are set forth to provide a more thorough explanation of embodiments of the present invention, however, it will be apparent to one skilled in the art that embodiments of the present invention may be practiced without these specific details, and in other embodiments, well-known structures and devices are shown in block diagram form, rather than in detail, to avoid obscuring embodiments of the present invention.
It should be noted that, in the current diagnostic packet routing method in the prior art, there is uncertainty in the diagnostic period of the connection timeout setting, for example, chinese patent CN113141306A discloses a diagnostic packet routing method and a bus routing device thereof, and the processing of the potential connection timeout risk is that when the requested data transmission time is greater than P2/P2 timer, the gateway sends NRC78 to the on-board diagnostic device in the period of 1/2P2 timer, but it is not described how to determine that the transmission time is greater than P2/P2 timer, and sending NRC78 is a periodic sending, and the condition of determining whether to send NRC78 is single, the processing mode is too simple, and the gateway will send more useless negative responses to the on-board diagnostic device.
The following describes in detail a method, an apparatus, a device, and a medium for controlling protocol conversion of on-board diagnostics messages according to the present application.
Referring to fig. 1, fig. 1 is a schematic diagram of an implementation environment of a protocol conversion control method for a vehicle-mounted diagnosis message according to an exemplary embodiment of the present application. The implementation environment comprises an on-board diagnostic device 101, a multi-level on-board diagnostic subordinate gateway 102, and a target domain controller 103. The vehicle-mounted diagnostic device 101 is configured to execute a vehicle-mounted diagnostic message protocol conversion control method in the embodiment of the present application, the multi-level vehicle-mounted diagnostic lower-level gateway 102 is configured to perform protocol conversion and timeout processing on a message, and the target domain controller 103 is configured to receive a request message, perform diagnosis, and return a response message.
Illustratively, a vehicle-mounted diagnostic device 101 sends an initial request message to a preconfigured multi-stage vehicle-mounted diagnostic subordinate gateway 102, and starts a preconfigured first-class receive response timer; performing protocol conversion on the initial request message through the multi-stage vehicle-mounted diagnosis lower-level gateway 102, and transmitting the converted request message to a target domain controller 103; if the response message returned by the target domain controller 103 is overtime and a negative response code returned by the multistage vehicle-mounted diagnosis subordinate gateway 102 is received within a preset first receiving response time period, the connection with the multistage vehicle-mounted diagnosis subordinate gateway 102 is maintained and the first type receiving response timer is reset, so that the response message returned by the target domain controller 103 is received within a first receiving request time period.
Fig. 2 is a flowchart illustrating an on-board diagnostic message protocol conversion control method according to an exemplary embodiment of the present application. The method provided by the embodiment of the present application may be executed by any electronic device with computing processing capability, for example, the method may be executed by the on-board diagnostic device 101 in the embodiment of fig. 1 described above. In the following embodiments, the on-board diagnosis apparatus 101 is exemplified as an execution subject, but the present disclosure is not limited thereto.
Referring to fig. 2, the method for controlling protocol conversion of vehicle-mounted diagnosis messages provided in the embodiment of the present application at least includes the following steps S210 to S230.
In step S210, an initial request message is sent to the preconfigured multi-level vehicle-mounted diagnosis lower gateway, and a preconfigured first-type reception response timer is started.
It should be noted that the Diagnostic method in the embodiment of the present application is implemented based on a Universal Diagnostic Service (UDS), which is essentially a one-to-one communication mechanism, in the UDS service, in order to avoid abnormality caused by continuously sending a request instruction by a Diagnostic ECU when the Diagnostic ECU is busy, a Negative Response Code (NRC) is designed in the UDS service, which represents that a request is received but a Response is late, the NRC is associated with connection timeout timers P2 and P6 of the UDS, and the Diagnostic ECU (Electronic Control Unit) can reset the timers P2 and P6 of the Diagnostic device by sending the NRC 78.
Where if the ECU rejects a request, it responds negatively (Negative Response) to reply with an NRC in the third byte. Different NRCs have different meanings. The NRC78 (request correct received-reply pending) indicates that the request message was correctly received, all parameters in the request message are valid, but the operation to be performed has not been completed yet, and the Server side (Server side) is not ready to receive another request. Once the requested service has been completed, the server should send a positive or negative response, and the response code should be different. This NRC negative response may be repeated by the Server side until the requested service is completed and a final response message is sent. When using this NRC, the server should always send a final response (whether a positive or negative response).
Illustratively, the vehicle-mounted diagnosis device issues an initial request message based on a CAN network protocol to the multi-stage vehicle-mounted diagnosis subordinate gateway, and simultaneously starts a P2Client timer. The first type receiving response timer is a P2Client timer, the P2Client timer counts time from the time when the vehicle-mounted diagnostic device sends the request to the time when the vehicle-mounted diagnostic device receives the response, and the normal time is 50ms.
In step S220, the protocol of the initial request packet is converted through the multi-level vehicle-mounted diagnosis lower-level gateway, and the converted request packet is transmitted to the target domain controller.
Illustratively, the initial request message is converted into a message in a CAN/CANFD format by the multi-level vehicle-mounted diagnosis subordinate gateway and transmitted to the target domain controller, so that the target domain controller responds to the request message and performs diagnosis, and then returns the diagnosis result to the vehicle-mounted diagnosis device in the form of a response message.
In step S230, if the response message returned by the target domain controller is overtime and a negative response code returned by the multi-level vehicle-mounted diagnosis lower-level gateway is received within a preset first receiving response time period, the connection with the multi-level vehicle-mounted diagnosis lower-level gateway is maintained and the first type receiving response timer is reset, so as to receive the response message returned by the target domain controller within the first receiving request time period.
Exemplarily, if the conversion time of the request message or the response message in the multi-stage vehicle-mounted diagnosis subordinate gateway is too long and timeout is caused, the P2Client timer is reset through a negative response code NRC78, so as to ensure that the response message can be received in the next first request receiving time period, and avoid the problem that the response message cannot be received after disconnection due to timeout; meanwhile, when the response message is not received within the first receiving request time period, the connection can be disconnected, and the problem of infinite waiting is avoided.
As can be seen from the foregoing steps S210 to S230, in the scheme provided in this embodiment, the multi-level vehicle-mounted diagnosis lower-level gateway issues the request message to the target domain controller and returns the response message, and when the returned response message times out, the timer is reset by using the negative response code to maintain the connection with the multi-level vehicle-mounted diagnosis lower-level gateway, so as to avoid a problem that the response message cannot be uploaded due to disconnection of the connection.
In an embodiment of the present application, after transmitting the converted request packet to the target domain controller, the method further includes the following steps:
if a response message returned by the target domain controller is received within a preset first message returning time period, determining that the response of the target domain controller is not overtime, and keeping connection with the multistage vehicle-mounted diagnosis lower-level gateway and the target domain controller;
and if the response message returned by the target domain controller is not received in a preset first message return time period, determining that the response of the target domain controller is overtime, and receiving a negative response code returned by the multistage vehicle-mounted diagnosis subordinate gateway in a preset first receiving response time period.
Illustratively, whether a response message is returned is determined by a preset first message returning time period, and the protocol conversion of the multi-stage vehicle-mounted diagnosis subordinate gateway to the request message is overtime and the protocol conversion of the response message is overtime, which will result in the vehicle-mounted diagnosis device receiving the response message being overtime. And when the response of the target domain controller is not overtime, the connection between the vehicle-mounted diagnosis equipment and the multistage vehicle-mounted diagnosis lower-level gateway and the connection between the multistage vehicle-mounted diagnosis lower-level gateway and the target domain controller are maintained so as to issue a subsequent request message. When the response of the target domain controller is overtime, the connection between the vehicle-mounted diagnosis equipment and the multi-stage vehicle-mounted diagnosis lower-level gateway and the connection between the multi-stage vehicle-mounted diagnosis lower-level gateway and the target domain controller in the first receiving request time period are kept through negative response codes.
In an embodiment of the application, the multi-level vehicle-mounted diagnosis lower level gateway includes a first level gateway and a second level gateway, and performs protocol conversion on the initial request packet and transmits the converted request packet to the target domain controller through the multi-level vehicle-mounted diagnosis lower level gateway, including the following steps:
converting the initial request message based on the CAN network into a request message based on the Ethernet through the primary gateway, and transmitting the request message based on the Ethernet to the secondary gateway;
and converting the request message based on the Ethernet into a target request message based on a CAN (controller area network) through the secondary gateway, and transmitting the target request message based on the CAN to the target area controller so as to realize the diagnosis of the target area controller.
In an embodiment of the application, after performing protocol conversion on the initial request packet and transmitting the converted request packet to the target domain controller through the multi-level vehicle-mounted diagnosis lower-level gateway, the method further includes the following steps:
converting the initial response message based on the CAN network returned by the target domain controller into a response message based on the Ethernet through the secondary gateway, and transmitting the response message based on the Ethernet to the primary gateway;
and converting the response message based on the Ethernet into a target response message based on the CAN through the primary gateway, and transmitting the target response message to the vehicle-mounted diagnostic equipment.
For example, referring to fig. 3, fig. 3 is an interaction schematic diagram of a vehicle-mounted diagnosis message protocol conversion control method according to an exemplary embodiment of the present application. When the vehicle-mounted diagnosis equipment diagnoses a node (namely a target domain controller in the embodiment) hung under a multilevel gateway in a vehicle, a first-level gateway routes a DoIP message (namely an Ethernet-based message) to a second-level gateway, the second-level gateway converts the DoIP message into a CAN/CAN FD format message (namely a CAN-based message) and sends the CAN/CAN FD format message to the diagnosed CAN node, after the second-level gateway node finishes receiving a response message, the response message is converted into the DoIP format message and sent to the first-level gateway, and the first-level gateway routes the message to the vehicle-mounted diagnosis equipment.
In an embodiment of the present application, the converting, by the secondary gateway, an initial response packet based on the CAN network returned by the target domain controller into a response packet based on the ethernet network includes the following steps:
if the initial response message based on the CAN network returned by the target domain controller is a multi-frame response message, combining the initial response message based on the CAN network returned by the target domain controller through a message combination module configured in advance in the secondary gateway, converting the combined response message into the response message based on the Ethernet, and connecting the relational networks of the technical materials of the products through the product production place if the production addresses of the products are the same.
In an embodiment of the present application, receiving a negative response code returned by the multi-level vehicle-mounted diagnosis subordinate gateway within a preset first receiving response time period includes the following steps:
when the primary gateway receives the initial request message, starting a first class receiving request timer, and if the primary gateway does not return the response message to the vehicle-mounted diagnostic equipment within a first receiving request time period corresponding to the first class receiving request timer, sending the negative response code to the vehicle-mounted diagnostic equipment by using the logical addresses of the target and the controller; and/or the presence of a gas in the gas,
and when the second-level gateway receives the request message based on the Ethernet, starting a first-class receiving request timer, and if the second-level gateway does not return the response message to the first-level gateway within a first receiving request time period corresponding to the first-class receiving request timer, sending the negative response code to the first-level gateway by using the logical addresses of the target and the controller.
For example, referring to fig. 3, when the primary gateway receives the diagnostic request message, the P2_ Server timer is started to count, and when the P2_ Server/2 timer expires, the primary gateway has not sent the diagnostic response message to the vehicle-mounted diagnostic device, the NRC78 negative response code is started to be sent to the vehicle-mounted diagnostic device by using the logical address of the target domain controller. In addition, the secondary gateway starts a P2_ Server timer when receiving the DoIP request message of the primary gateway, and starts to send NRC78 negative response codes to the primary gateway by using the logical address of the target domain controller when the P2_ Server/2 timer does not send a diagnosis response message to the primary gateway when the P2_ Server/2 timer expires. The first type of receiving request timer is a P2_ Server timer, the P2_ Server timer times the time from the beginning of receiving the request by the target domain controller to the end of the response given by the target domain controller, and the regular time is 100ms.
In an embodiment of the present application, after maintaining the connection with the multi-stage on-board diagnostic lower level gateway and resetting the first type reception response timer, the method further includes the following steps:
if the first-level gateway does not return the negative response code within a second receiving request time period or within the time from the target domain controller to the next response message, determining that the connection between the first-level gateway and the second-level gateway is overtime;
and in a second request receiving time period or the time from the target domain controller to the next response message sending, the secondary gateway does not return the negative response code to the primary gateway, and disconnects the vehicle-mounted diagnosis equipment, the primary gateway, the secondary gateway and the target domain controller.
For example, referring to fig. 3, the secondary gateway does not send NRC78 to the primary gateway any more when P2_ Server/2 or P2_ Server/2 expires next time, then P2_ Client or P2_ Client timeout occurs between the primary gateway and the secondary gateway, and the primary gateway does not send NRC78 to the on-board diagnostic device any more when P2_ Server/2 or P2_ Server/2 expires next time, so as to implement the timeout disconnection between the on-board diagnostic device and the multi-stage on-board diagnostic lower gateway, and between the on-board diagnostic lower gateway and the target domain controller, and avoid infinite waiting. Wherein, the second receiving request time period is P2_ Server/2 or P2_ Server/2, and P2_ Server is the time required by the target domain controller to send the next response when the target domain controller sends the NRC78 to start timing; p2_ Client is a time period from when the NRC78 is received by the vehicle-mounted diagnostic device to when the vehicle-mounted diagnostic device receives the next multi-frame or single-frame, and the regular time is 5000ms.
Fig. 4 is a block diagram of an on-board diagnostic message protocol conversion control apparatus according to an exemplary embodiment of the present application. The apparatus may be applied to the implementation environment shown in fig. 1. The apparatus may also be applied to other exemplary implementation environments and specifically configured in other devices, and the embodiment does not limit the implementation environment to which the apparatus is applied.
As shown in fig. 4, the exemplary on-board diagnostic message protocol conversion control apparatus includes:
an initial request message issuing module 401, configured to send an initial request message to a preconfigured multi-level vehicle-mounted diagnosis lower-level gateway, and start a preconfigured first-class receive response timer;
a request message conversion module 402, configured to perform protocol conversion on the initial request message through the multi-level vehicle-mounted diagnosis lower-level gateway, and transmit the converted request message to a target domain controller;
an overtime connection module 403, configured to, if the response packet returned by the target domain controller is overtime and a negative response code returned by the multistage vehicle-mounted diagnosis lower-level gateway is received within a preset first receiving response time period, maintain connection with the multistage vehicle-mounted diagnosis lower-level gateway and reset the first type receiving response timer, so as to receive the response packet returned by the target domain controller within a first receiving request time period.
In the exemplary vehicle-mounted diagnosis message protocol conversion control device, the multi-stage vehicle-mounted diagnosis subordinate gateway issues a request message to the target domain controller and returns a response message, and when the returned response message is overtime, the timer is reset through a negative response code so as to keep connection with the multi-stage vehicle-mounted diagnosis subordinate gateway, so that the problem that the response message cannot be uploaded due to disconnection is avoided.
It should be noted that the vehicle-mounted diagnosis message protocol conversion control device provided in the foregoing embodiment and the vehicle-mounted diagnosis message protocol conversion control method provided in the foregoing embodiment belong to the same concept, and specific ways of executing operations by each module and unit have been described in detail in the method embodiment, and are not described herein again. In practical applications, the vehicle-mounted diagnosis message protocol conversion control device provided in the above embodiment may distribute the above functions by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the above described functions, which is not limited herein.
An embodiment of the present application further provides an electronic device, including: one or more processors; the storage device is configured to store one or more programs, and when the one or more programs are executed by the one or more processors, the electronic device is enabled to implement the on-board diagnosis message protocol conversion control method provided in each of the above embodiments.
FIG. 5 illustrates a schematic structural diagram of a computer system suitable for use to implement the electronic device of the embodiments of the subject application. It should be noted that the computer system 500 of the electronic device shown in fig. 5 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 5, the computer system 500 includes a Central Processing Unit (CPU) 501, which can perform various suitable actions and processes, such as executing the method described in the above embodiments, according to a program stored in a Read-Only Memory (ROM) 502 or a program loaded from a storage portion 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data necessary for system operation are also stored. The CPU 501, ROM 502, and RAM 503 are connected to each other through a bus 504. An Input/Output (I/O) interface 505 is also connected to bus 504.
The following components are connected to the I/O interface 505: an input portion 506 including a keyboard, a mouse, and the like; an output section 507 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like; a storage portion 508 including a hard disk and the like; and a communication section 509 including a Network interface card such as a LAN (Local Area Network) card, a modem, or the like. The communication section 509 performs communication processing via a network such as the internet. A drive 510 is also connected to the I/O interface 505 as needed. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 510 as necessary, so that a computer program read out therefrom is mounted into the storage section 508 as necessary.
In particular, according to embodiments of the present application, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising a computer program for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 509, and/or installed from the removable medium 511. The computer program executes various functions defined in the system of the present application when executed by a Central Processing Unit (CPU) 501.
It should be noted that the computer readable medium shown in the embodiments of the present application may be a computer readable signal medium or a computer readable storage medium or any combination of the two. The computer readable storage medium may be, for example, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a Read-Only Memory (ROM), an Erasable Programmable Read-Only Memory (EPROM), a flash Memory, an optical fiber, a portable Compact Disc Read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer-readable signal medium may include a propagated data signal with a computer program embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. The computer program embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. Each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software, or may be implemented by hardware, and the described units may also be disposed in a processor. Wherein the names of the elements do not in some way constitute a limitation on the elements themselves.
Another aspect of the present application also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor of a computer, causes the computer to execute the in-vehicle diagnostic message protocol conversion control method as described above. The computer-readable storage medium may be included in the electronic device described in the above embodiment, or may exist separately without being incorporated in the electronic device.
Another aspect of the application also provides a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and executes the computer instructions, so that the computer device executes the on-board diagnosis message protocol conversion control method provided in the above embodiments.
The foregoing embodiments are merely illustrative of the principles of the present invention and its efficacy, and are not to be construed as limiting the invention. Those skilled in the art can modify or change the above-described embodiments without departing from the spirit and scope of the present invention. Accordingly, it is intended that all equivalent modifications or changes which can be made by those skilled in the art without departing from the spirit and technical spirit of the present invention be covered by the claims of the present invention.

Claims (10)

1. A protocol conversion control method for vehicle-mounted diagnosis messages is characterized in that the method is applied to vehicle-mounted diagnosis equipment, and comprises the following steps:
sending an initial request message to a pre-configured multistage vehicle-mounted diagnosis subordinate gateway, and starting a pre-configured first-class receiving response timer;
performing protocol conversion on the initial request message through the multistage vehicle-mounted diagnosis lower-level gateway, and transmitting the converted request message to a target domain controller;
if the response message returned by the target domain controller is overtime and a negative response code returned by the multistage vehicle-mounted diagnosis subordinate gateway is received in a preset first receiving response time period, the connection with the multistage vehicle-mounted diagnosis subordinate gateway is maintained and the first type receiving response timer is reset so as to receive the response message returned by the target domain controller in a first receiving request time period.
2. The on-board diagnostics message protocol conversion control method of claim 1, wherein after transmitting the converted request message to the target domain controller, further comprising:
if a response message returned by the target domain controller is received within a preset first message returning time period, determining that the response of the target domain controller is not overtime, and keeping connection with the multistage vehicle-mounted diagnosis lower-level gateway and the target domain controller;
and if the response message returned by the target domain controller is not received within the preset first message return time period, determining that the response of the target domain controller is overtime, and receiving a negative response code returned by the multistage vehicle-mounted diagnosis lower-level gateway within the preset first response receiving time period.
3. The method according to claim 1, wherein the multi-level vehicle-mounted diagnosis lower level gateway includes a first-level gateway and a second-level gateway, and the multi-level vehicle-mounted diagnosis lower level gateway performs protocol conversion on the initial request packet and transmits the converted request packet to the target domain controller, including:
converting the initial request message based on the CAN network into a request message based on the Ethernet through the primary gateway, and transmitting the request message based on the Ethernet to the secondary gateway;
and converting the request message based on the Ethernet into a target request message based on a CAN (controller area network) through the secondary gateway, and transmitting the target request message based on the CAN to the target area controller so as to realize the diagnosis of the target area controller.
4. The method according to claim 3, wherein after the protocol conversion of the initial request packet is performed by the multi-stage vehicle-mounted diagnosis subordinate gateway and the converted request packet is transmitted to the target domain controller, the method further comprises:
converting the initial response message based on the CAN network returned by the target domain controller into a response message based on the Ethernet through the secondary gateway, and transmitting the response message based on the Ethernet to the primary gateway;
and converting the response message based on the Ethernet into a target response message based on the CAN through the primary gateway, and transmitting the target response message to the vehicle-mounted diagnostic equipment.
5. The method according to claim 4, wherein the step of converting the initial response packet based on the CAN network returned by the target domain controller into the response packet based on the Ethernet through the secondary gateway comprises:
if the initial response message based on the CAN network returned by the target domain controller is a multi-frame response message, combining the initial response message based on the CAN network returned by the target domain controller through a message combination module configured in the secondary gateway in advance, and converting the combined response message into the response message based on the Ethernet.
6. The method for controlling protocol conversion of on-board diagnostics messages according to claim 3, wherein the receiving a negative response code returned by the multi-level on-board diagnostics lower-level gateway within a preset first response receiving time period includes:
when the primary gateway receives the initial request message, starting a first class receiving request timer, and if the primary gateway does not return the response message to the vehicle-mounted diagnostic equipment within a first receiving request time period corresponding to the first class receiving request timer, sending the negative response code to the vehicle-mounted diagnostic equipment by using the logical addresses of the target and the controller; and/or the presence of a gas in the gas,
and when the secondary gateway receives the request message based on the Ethernet, starting a first class receiving request timer, and if the secondary gateway does not return the response message to the primary gateway within a first receiving request time period corresponding to the first class receiving request timer, sending the negative response code to the primary gateway by using the logical addresses of the target and the controller.
7. The vehicle-mounted diagnosis message protocol conversion control method of claim 3, wherein after maintaining the connection with the multi-level vehicle-mounted diagnosis subordinate gateway and resetting the first type reception response timer, further comprising:
if the first-level gateway does not return the negative response code within a second receiving request time period or within the time from the target domain controller to the next response message, determining that the connection between the first-level gateway and the second-level gateway is overtime;
and in a second request receiving time period or the time from the target domain controller to the next response message sending, the secondary gateway does not return the negative response code to the primary gateway, and disconnects the vehicle-mounted diagnosis equipment, the primary gateway, the secondary gateway and the target domain controller.
8. An on-board diagnostic message protocol conversion control apparatus, the apparatus comprising:
the system comprises an initial request message issuing module, a first type receiving response timer and a second type receiving response timer, wherein the initial request message issuing module is used for sending an initial request message to a pre-configured multistage vehicle-mounted diagnosis subordinate gateway and starting the pre-configured first type receiving response timer;
the request message conversion module is used for carrying out protocol conversion on the initial request message through the multistage vehicle-mounted diagnosis subordinate gateway and transmitting the converted request message to a target domain controller;
and the overtime connection module is used for keeping connection with the multistage vehicle-mounted diagnosis lower-level gateway and resetting the first type of receiving response timer if the response message returned by the target domain controller is overtime and a negative response code returned by the multistage vehicle-mounted diagnosis lower-level gateway is received within a preset first receiving response time period, so that the response message returned by the target domain controller is received within a first receiving request time period.
9. An electronic device, characterized in that the electronic device comprises:
one or more processors;
storage means for storing one or more programs that, when executed by the one or more processors, cause the electronic device to implement the in-vehicle diagnostic message protocol conversion control method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that a computer program is stored thereon, which, when executed by a processor of a computer, causes the computer to execute the on-board diagnostic message protocol conversion control method of any one of claims 1 to 7.
CN202211529762.1A 2022-11-30 2022-11-30 Vehicle-mounted diagnosis message protocol conversion control method, device, equipment and medium Pending CN115776526A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211529762.1A CN115776526A (en) 2022-11-30 2022-11-30 Vehicle-mounted diagnosis message protocol conversion control method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211529762.1A CN115776526A (en) 2022-11-30 2022-11-30 Vehicle-mounted diagnosis message protocol conversion control method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN115776526A true CN115776526A (en) 2023-03-10

Family

ID=85390954

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211529762.1A Pending CN115776526A (en) 2022-11-30 2022-11-30 Vehicle-mounted diagnosis message protocol conversion control method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN115776526A (en)

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130031212A1 (en) * 2011-07-28 2013-01-31 Denso Corporation Gateway and in-vehicle network system
CN103080719A (en) * 2010-09-10 2013-05-01 迪尔公司 Method and system for performing diagnostics or software maintenance for a vehicle
CN106961437A (en) * 2017-03-24 2017-07-18 华东师范大学 CAN and Ethernet hybrid network gateway network management device and its exchange method
US20190079842A1 (en) * 2017-09-13 2019-03-14 Hyundai Motor Company Failure diagnosis apparatus and method for in-vehicle control unit
CN110758289A (en) * 2019-10-31 2020-02-07 上海赫千电子科技有限公司 Sleep and wake-up method of in-vehicle hybrid network comprising vehicle-mounted Ethernet
CN111552273A (en) * 2020-05-08 2020-08-18 广州小鹏汽车制造有限公司 Vehicle data acquisition method and acquisition system thereof, vehicle and readable storage medium
CN111901076A (en) * 2020-09-03 2020-11-06 北京经纬恒润科技有限公司 Vehicle diagnosis data forwarding method and device and gateway
US20200394853A1 (en) * 2019-06-17 2020-12-17 Hyndai Motor Company Vehicle diagnostic communication apparatus, system including the same and method thereof
CN112578764A (en) * 2019-09-30 2021-03-30 北京车和家信息技术有限公司 Vehicle fault diagnosis method and system and vehicle
CN113204226A (en) * 2021-04-25 2021-08-03 重庆长安汽车股份有限公司 Vehicle diagnosis system and method
CN114765594A (en) * 2021-01-04 2022-07-19 广州汽车集团股份有限公司 Global vehicle-mounted network management method, system and vehicle-mounted gateway
CN115390546A (en) * 2022-08-16 2022-11-25 北京经纬恒润科技股份有限公司 Vehicle diagnostic communication method, device, equipment and medium

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103080719A (en) * 2010-09-10 2013-05-01 迪尔公司 Method and system for performing diagnostics or software maintenance for a vehicle
US20130031212A1 (en) * 2011-07-28 2013-01-31 Denso Corporation Gateway and in-vehicle network system
CN106961437A (en) * 2017-03-24 2017-07-18 华东师范大学 CAN and Ethernet hybrid network gateway network management device and its exchange method
US20190079842A1 (en) * 2017-09-13 2019-03-14 Hyundai Motor Company Failure diagnosis apparatus and method for in-vehicle control unit
US20200394853A1 (en) * 2019-06-17 2020-12-17 Hyndai Motor Company Vehicle diagnostic communication apparatus, system including the same and method thereof
CN112578764A (en) * 2019-09-30 2021-03-30 北京车和家信息技术有限公司 Vehicle fault diagnosis method and system and vehicle
CN110758289A (en) * 2019-10-31 2020-02-07 上海赫千电子科技有限公司 Sleep and wake-up method of in-vehicle hybrid network comprising vehicle-mounted Ethernet
CN111552273A (en) * 2020-05-08 2020-08-18 广州小鹏汽车制造有限公司 Vehicle data acquisition method and acquisition system thereof, vehicle and readable storage medium
CN111901076A (en) * 2020-09-03 2020-11-06 北京经纬恒润科技有限公司 Vehicle diagnosis data forwarding method and device and gateway
CN114765594A (en) * 2021-01-04 2022-07-19 广州汽车集团股份有限公司 Global vehicle-mounted network management method, system and vehicle-mounted gateway
CN113204226A (en) * 2021-04-25 2021-08-03 重庆长安汽车股份有限公司 Vehicle diagnosis system and method
CN115390546A (en) * 2022-08-16 2022-11-25 北京经纬恒润科技股份有限公司 Vehicle diagnostic communication method, device, equipment and medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
尹荣彬: "智能网联汽车车载以太网技术应用研究", 汽车文摘, 23 October 2019 (2019-10-23) *
张哲宇: "汽车CAN-FlexRay总线网关研究与设计", 贵州大学学报(自然科学版), 15 October 2017 (2017-10-15) *
胡林: "基于CANoe的车载网关系统仿真及分析", 农业装备与车辆工程, 19 January 2020 (2020-01-19) *

Similar Documents

Publication Publication Date Title
CN107659494B (en) Data processing method and intelligent vehicle-mounted gateway
CN112118315A (en) Data processing system, method, device, electronic equipment and storage medium
CN110768882B (en) Data monitoring method and system, monitoring equipment and vehicle
CN111555953A (en) Remote diagnosis method, device and system based on vehicle-mounted Ethernet and TSP (Total suspended particulate) server
CN101385296A (en) Gateway for the automatic routing of messages between buses
US11362859B2 (en) In-vehicle communication device and in-vehicle system
CN112015161A (en) Vehicle diagnostic communication device and method and system comprising same
CN103428260A (en) System and method for allocating server to terminal and efficiently delivering messages to the terminal
CN112367236B (en) Data scheduling method and system of LIN bus
CN106875664B (en) Exclusive data acquisition method based on CAN bus
CN114268927A (en) Vehicle-mounted communication method, device, equipment and storage medium
JPH02228854A (en) Data communication system and data communication method
CN115776526A (en) Vehicle-mounted diagnosis message protocol conversion control method, device, equipment and medium
Dekanic et al. Integration of CAN bus drivers and UDS on Aurix platform
CN115657646B (en) Test method and device of CAN controller
CN109981778B (en) Method, device, equipment and storage medium for realizing service of content distribution network
CN111092952A (en) Data interaction method and related product
CN112217649A (en) Terminal device management method, server and terminal device
CN115883572A (en) Peripheral sharing method and device
Ng et al. Performance analysis of wireless control area network (wcan) using token frame scheme
Lee et al. Communication entities discovery in complex CPS system
CN111447126B (en) Ethernet bus communication method, device, robot, equipment and computer readable storage medium
CN107911477B (en) Data communication method, device and system
CN116193472B (en) Vehicle-mounted network management method and device, electronic equipment and storage medium
EP4312410A1 (en) A can communication controller and a method of operating a can communication controller

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination