UDS protocol stack, diagnostic method and electronic device with dynamically adaptable transport layer

By introducing a dynamic adaptation layer into the UDS protocol stack, the high cost caused by a single diagnostic device supporting multiple transmission protocols is solved, compatibility of multiple diagnostic devices is achieved, and the cost of vehicle development is reduced.

CN116389440BActive Publication Date: 2026-07-21ZHONGLING ZHIXING (CHENGDU) TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHONGLING ZHIXING (CHENGDU) TECH CO LTD
Filing Date
2023-04-03
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

In the existing technology, the cost of a single diagnostic device supporting multiple diagnostic transmission protocols is too high, and a fully functional diagnostic tester needs to be configured during the vehicle development process, which increases the R&D cost.

Method used

Adding a dynamic adaptation layer to the UDS protocol stack enables dynamic identification and adaptation of diagnostic requests from different transport layers. It reassembles data structures using identifiers and sends the results to the corresponding transport layer after diagnostic processing, supporting compatibility with multiple diagnostic transport protocols.

Benefits of technology

The cost of the R&D process has been reduced. By introducing a dynamic adaptation layer, the UDS protocol stack has been made compatible with a variety of diagnostic devices, reducing the need for a fully functional diagnostic tester.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116389440B_ABST
    Figure CN116389440B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a UDS protocol stack capable of dynamically adapting a transmission layer, a diagnosis method and an electronic device, the UDS protocol stack comprising a dynamic adaptation layer; the dynamic adaptation layer is configured to receive diagnosis requests initiated by different transmission layers, dynamically identify the type of the transmission layer from which the current diagnosis request comes, and add an identifier representing the type of the transmission layer to a diagnosis request data structure; after the UDS protocol stack completes diagnosis processing, the dynamic adaptation layer sends the diagnosis result to the corresponding transmission layer according to the identifier of the transmission layer. The above scheme is used to solve the technical problem that a single diagnosis device simultaneously supports multiple diagnosis transmission protocols, resulting in high cost in the prior art. Through the dynamic adaptation of the UDS protocol stack for different transmission layers, the UDS protocol stack can adapt to different diagnosis instruments, reducing the cost in the research and development process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of automotive diagnostics, specifically to a UDS protocol stack, diagnostic method, and electronic device that can dynamically adapt to the transport layer. Background Technology

[0002] The UDS (Unified Diagnostic Services) protocol stack is an application layer protocol (ISO 14229-1) used for online diagnostics of automotive electronic devices. The UDS transport layer includes UDSonCAN (ISO14229-3), UDSonIP (ISO14229-5), and UDSonLIN (ISO14229-7), etc. Traditional UDS protocol stacks can only receive diagnostic requests from one transport layer during operation. CAN generally refers to Controller Area Network, IP refers to Internet Protocol, and LIN refers to Local Interconnect Network.

[0003] Increasingly, real-world scenarios require simultaneous support for two or more diagnostic transmission requests, such as UDSonCAN (ISO 14229-3) and UDSonIP (ISO 14229-5), to ensure compatibility with a wider range of diagnostic devices. Supporting multiple diagnostic transmission protocols simultaneously with a single diagnostic device is expensive. Given that vehicle development involves dozens or even hundreds of ECUs (Electronic Control Units), requiring each manufacturer to equip themselves with a fully functional diagnostic tester is impractical. Therefore, it is necessary to develop a UDS protocol stack adapted to different diagnostic devices to reduce development costs. Summary of the Invention

[0004] The purpose of this disclosure is to provide a UDS protocol stack, diagnostic method, and electronic device that can dynamically adapt to the transport layer, in order to solve the technical problem in the prior art where a single diagnostic device simultaneously supports multiple diagnostic transport protocols, resulting in excessively high costs.

[0005] To achieve the above objectives, the first aspect of this disclosure provides a UDS protocol stack that can dynamically adapt to the transport layer, the UDS protocol stack including a dynamic adaptation layer;

[0006] The dynamic adaptation layer is used to receive diagnostic requests initiated by different transport layers, dynamically identify the type of transport layer from which the current diagnostic request comes, and add an identifier that characterizes the type of the transport layer to the diagnostic request data structure; after the UDS protocol stack completes the diagnostic processing, the dynamic adaptation layer sends the diagnostic result to the corresponding transport layer according to the identifier of the transport layer.

[0007] Optionally, the dynamic adaptation layer is used to receive original diagnostic request messages sent by different transport layers, reassemble the original diagnostic request messages, append the identifiers of the different transport layers to the reassembled diagnostic request messages, and send the reassembled diagnostic request messages to the session layer of the UDS protocol stack.

[0008] The session layer is used to receive the reassembled diagnostic request message from the dynamic adaptation layer, and when the reassembled diagnostic request message meets the conditions, it sends the reassembled diagnostic request message to the application layer of the UDS protocol stack.

[0009] The application layer is used to obtain the original diagnostic response message based on the reconstructed diagnostic request message, and return the original diagnostic response message to the dynamic adaptation layer.

[0010] The dynamic adaptation layer is also used to reassemble the original diagnostic response messages of different transport layers according to the identifier of the transport layer, and call the sending interface of the transport layer to complete the transmission of the reassembled response message; wherein, the reassembled response message includes the original diagnostic response message and the identifier of the transport layer.

[0011] Optionally, the transport layer is a CAN transport layer; the UDS protocol stack establishes a communication connection with the CAN transport layer. When the UDS protocol stack receives the original diagnostic request message, the UDS protocol stack reads the original diagnostic request message, reassembles the original diagnostic request message, fills the identifier of the CAN transport layer into the reassembled diagnostic request message, and sends the reassembled diagnostic request message to the session layer.

[0012] Optionally, the transport layer is the DoP transport layer; the UDS protocol stack and the DoP transport layer establish a communication connection, the DoP transport layer sends the received diagnostic request back to the dynamic adaptation layer of the UDS protocol stack, the UDS protocol stack reads the original diagnostic request message, reassembles the original diagnostic request message, fills the identifier of the DoP transport layer into the reassembled diagnostic request message, and sends the reassembled diagnostic request message to the session layer.

[0013] A second aspect of this disclosure provides a diagnostic method that can dynamically adapt to a transport layer, applied in a UDS protocol stack, wherein the UDS protocol stack includes a dynamic adaptation layer, and the method includes:

[0014] Receive diagnostic requests initiated by different transport layers, dynamically identify the type of transport layer from which the current diagnostic request comes, and add an identifier that characterizes the type of the transport layer to the diagnostic request data structure;

[0015] After completing the diagnostic process, the diagnostic results are sent to the corresponding transport layer according to the identifier of the transport layer.

[0016] Optionally, the system receives diagnostic requests initiated by different transport layers, dynamically identifies the type of transport layer from which the current diagnostic request originates, and adds an identifier characterizing the type of the transport layer to the diagnostic request data structure, including:

[0017] Receive original diagnostic request messages sent by different transport layers, reassemble the original diagnostic request messages, and append the identifiers of the different transport layers to the reassembled diagnostic request messages.

[0018] Optionally, after completing the diagnostic process, the diagnostic result is sent to the corresponding transport layer according to the identifier of the transport layer, including:

[0019] After completing the diagnostic process, the original diagnostic response messages of different transport layers are reassembled according to the identifier of the transport layer, and the transmission interface of the transport layer is called to complete the transmission of the reassembled response message; wherein, the reassembled response message includes the original diagnostic response message and the identifier of the transport layer.

[0020] A third aspect of this disclosure provides a non-transitory computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements the steps of the method described in the second aspect.

[0021] A fourth aspect of this disclosure provides an electronic device, comprising:

[0022] A memory on which computer programs are stored;

[0023] A processor for executing the computer program in the memory to implement the steps of the method described in the second aspect.

[0024] In this embodiment of the disclosure, by adding a dynamic adaptation layer to the UDS protocol stack, dynamic adaptation is performed for different transport layers, enabling the UDS protocol stack to adapt to different diagnostic instruments and reducing the cost in the research and development process.

[0025] Other features and advantages of this disclosure will be described in detail in the following detailed description section. Attached Figure Description

[0026] The accompanying drawings are provided to further illustrate the present disclosure and form part of the specification. They are used together with the following detailed description to explain the present disclosure, but do not constitute a limitation thereof. In the drawings:

[0027] Figure 1 This is a schematic diagram illustrating the architecture of a UDS protocol stack that can dynamically adapt to the transport layer, according to an exemplary embodiment.

[0028] Figure 2 This is a flowchart illustrating a diagnostic method for dynamically adaptable transport layers according to an exemplary embodiment. Detailed Implementation

[0029] The specific embodiments of this disclosure will be described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for illustration and explanation only and are not intended to limit this disclosure.

[0030] The automotive diagnostic communication process involves the diagnostic tool sending a diagnostic request, the ECU providing a diagnostic response, and the UDS (User Data System) defining a unified content and format for different diagnostic functions and responses. Diagnostic communication establishes the communication connection between the diagnostic tool and the ECU and is responsible for transmitting diagnostic results from the ECU to the diagnostic tool.

[0031] This invention designs a UDS protocol stack that can dynamically adapt to the transport layer, dynamically supporting diagnostic requests initiated by multiple UDS transport layers. A dynamic adaptation layer is added to the UDS protocol stack to dynamically identify which UDS transport layer the current diagnostic request comes from, and adds the identification identifier of the UDS transport layer to the diagnostic request data structure. After the UDS protocol stack completes the diagnostic processing, it returns the diagnostic result to the diagnostic tester. When sending the diagnostic result, the data is sent to the corresponding diagnostic transport layer according to the identification ID of the UDS transport layer.

[0032] like Figure 1 The diagram shown is a schematic of the UDS protocol stack architecture that can dynamically adapt to the transport layer according to an exemplary embodiment. It includes a transport layer, a transport layer dynamic adaptation layer, a session layer, and an application layer. The functions of each component are as follows.

[0033] transport layer

[0034] The transport layer is used to convert data into single data frames that can adapt to different bus specifications for transmission. Common ones are CAN bus and Ethernet bus, with corresponding transmission protocols of ISO15765 and ISO13400, respectively. Different transport layers have the same general structure and define three types of service primitives: request service, instruction service, and acknowledgment service.

[0035] The request service is used to pass control message information and data to be sent to the network layer. It is applied to higher layers or application layers, such as when a diagnostic tool sends data to an ECU.

[0036] The instruction service is used to pass status information and received data to higher layers or application layers. It is applied to the network layer, for example, when the ECU receives data from the diagnostic tool, it transmits it to the application layer.

[0037] The confirmation service is used by the network layer to pass status information to higher layers or the application layer, such as when a diagnostic tool receives data returned by the ECU.

[0038] The instruction service data received by the transport layer is sent to the transport dynamic adaptation layer of the UDS protocol stack to reassemble the data packet, that is, to combine the transport layer identifier and the original data packet to form a new instruction service data packet.

[0039] Transport layer dynamic adaptation layer

[0040] The transport layer dynamic adaptation layer is used to receive diagnostic requests from different transport layers, reassemble the diagnostic request data packets, append the identifiers of different transport layers to the reassembled diagnostic request packets, send the reassembled diagnostic request packets to the session layer of the UDS protocol stack for further diagnostic processing, and send the processed diagnostic request packets to the diagnostic tester according to the transport layer identifiers.

[0041] Session layer

[0042] The session layer receives diagnostic requests processed by the transport layer's dynamic adaptation layer and handles diagnostic sessions, secure access session mode control, etc.

[0043] Application layer

[0044] When the session mode and secure access meet the current diagnostic request, the diagnostic request is sent to the diagnostic application layer for further diagnostic processing, such as a data read service request. The application layer completes the reading of specific data items, assembles the read data into a diagnostic response message, and returns it to the dynamic transport adapter layer.

[0045] Next, the scheme in the embodiments of this disclosure will be described using the CAN transport layer and the DoIP (Diagnostic Communication over IP) transport layer as examples.

[0046] The standard protocol specification for the CAN transport layer is ISO 15765-2. The CAN transport layer is used to convert data into a single data frame that can adapt to the CAN bus specification for transmission. If the length of the message to be transmitted exceeds the length of the CAN data frame, the message information needs to be split. The CAN transport layer is an implementation of the ISO 15765-2 standard specification.

[0047] The standard specification protocol for the DoIP transport layer is ISO 13400-2, which is the UDS transport layer protocol specification implemented on the Ethernet bus. The DoIP transport layer needs to implement the DoIP entity. The DoIP entity consists of the DoIP protocol stack, which is implemented in accordance with the ISO 13400 standard. External diagnostic devices can discover, connect to and activate the DoIP entity to complete the data transmission.

[0048] In this embodiment of the disclosure, the transport layer dynamic adaptation layer can receive the original diagnostic request messages sent by different UDS transport layers, and can correctly identify and parse the message data, and reassemble the transport layer identifiers that match the original diagnostic request data.

[0049] The UDS protocol stack and the CAN transport layer establish a communication connection. When there is diagnostic request indication data, the UDS protocol stack reads the message data. After reading the message, the UDS protocol stack constructs a new request message data structure, fills the identifier of the CAN transport layer into the corresponding data element, and further passes the data to the session layer of the UDS protocol stack for processing.

[0050] The UDS protocol stack and the DoIP transport layer establish a communication connection, create a DoIP entity and set the entity's logical address so that the device diagnostic instrument can discover and activate the DoIP entity. The diagnostic instrument sends a diagnostic request, and the DoIP transport layer sends the request back to the UDS protocol stack's transport layer dynamic adaptation. After reading the message, the UDS protocol stack constructs a new request message data structure, fills the DoIP transport layer identifier into the corresponding data element, and passes the data to the UDS protocol stack's session layer for processing.

[0051] After the UDS protocol stack completes the diagnostic processing, it will generate a corresponding positive or negative response, construct a response data structure, and the response data unit contains the original response message and transport layer identifier. Based on the transport layer identifier, the original response message of different transport layers is constructed, and the transmission interface of the transport layer is called to complete the transmission of the response message.

[0052] In one possible implementation, the UDS protocol stack can only process a single diagnostic request at a time, since the diagnostic session mode is globally unique; the UDS protocol stack can add parallel diagnostic processing logic to improve diagnostic efficiency.

[0053] Based on the same inventive concept, this disclosure also provides a diagnostic method that can dynamically adapt to the transport layer, applied in the UDS protocol stack, such as... Figure 2 As shown, the method includes the following steps.

[0054] Step 201: Receive diagnostic requests initiated by different transport layers, dynamically identify the type of transport layer from which the current diagnostic request comes, and add an identifier used to characterize the type of the transport layer to the diagnostic request data structure;

[0055] Step 202: After completing the diagnostic process, the diagnostic result is sent to the corresponding transport layer according to the identifier of the transport layer.

[0056] The specific implementation of each step in the above embodiments has been described in detail in the embodiments related to the UDS protocol stack, and will not be elaborated here.

[0057] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, which, when executed by a processor, implement the steps of the aforementioned diagnostic method for dynamically adaptable transport layers. For example, the computer-readable storage medium may be the aforementioned memory including program instructions, which can be executed by a processor of an electronic device to complete the aforementioned diagnostic method for dynamically adaptable transport layers.

[0058] In another exemplary embodiment, a computer program product is also provided, the computer program product comprising a computer program executable by a programmable device, the computer program having a code portion for performing the above-described diagnostic method for dynamically adaptable transport layers when executed by the programmable device.

[0059] In another exemplary embodiment, this disclosure also provides an electronic device, including: a storage medium having a computer program stored thereon; and a processor for executing the computer program in the storage medium to implement the steps of the above-described diagnostic method for dynamically adaptable transport layers.

[0060] The preferred embodiments of this disclosure have been described in detail above with reference to the accompanying drawings. However, this disclosure is not limited to the specific details of the above embodiments. Within the scope of the technical concept of this disclosure, various simple modifications can be made to the technical solutions of this disclosure, and these simple modifications all fall within the protection scope of this disclosure.

[0061] It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, this disclosure will not describe the various possible combinations separately.

[0062] Furthermore, various different embodiments of this disclosure can be combined in any way, as long as they do not violate the spirit of this disclosure, they should also be regarded as the content disclosed in this disclosure.

Claims

1. A UDS protocol stack that can dynamically adapt to the transport layer, characterized in that, The UDS protocol stack includes a dynamic adaptation layer; The dynamic adaptation layer is used to receive diagnostic requests initiated by different transport layers, dynamically identify the type of transport layer from which the current diagnostic request comes, and add an identifier that characterizes the type of the transport layer to the diagnostic request data structure; after the UDS protocol stack completes the diagnostic processing, the dynamic adaptation layer sends the diagnostic result to the corresponding transport layer according to the identifier of the transport layer. The dynamic adaptation layer is used to receive original diagnostic request messages sent by different transport layers, reassemble the original diagnostic request messages, append the identifiers of the different transport layers to the reassembled diagnostic request messages, and send the reassembled diagnostic request messages to the session layer of the UDS protocol stack. The session layer is used to receive the reassembled diagnostic request message from the dynamic adaptation layer, and when the reassembled diagnostic request message meets the conditions of session mode and secure access, it sends the reassembled diagnostic request message to the application layer of the UDS protocol stack. The application layer is used to obtain the original diagnostic response message based on the reconstructed diagnostic request message, and return the original diagnostic response message to the dynamic adaptation layer. The dynamic adaptation layer is also used to reassemble the original diagnostic response messages of different transport layers according to the identifier of the transport layer, and call the sending interface of the transport layer to complete the transmission of the reassembled response message; wherein, the reassembled response message includes the original diagnostic response message and the identifier of the transport layer.

2. The UDS protocol stack as described in claim 1, characterized in that, The transport layer is the CAN transport layer; the UDS protocol stack establishes a communication connection with the CAN transport layer. When the UDS protocol stack receives the original diagnostic request message, it reads the original diagnostic request message, reassembles the original diagnostic request message, fills the identifier of the CAN transport layer into the reassembled diagnostic request message, and sends the reassembled diagnostic request message to the session layer.

3. The UDS protocol stack as described in claim 1, characterized in that, The transport layer is the DoIP transport layer; the UDS protocol stack establishes a communication connection with the DoIP transport layer, the DoIP transport layer sends the received diagnostic request back to the dynamic adaptation layer of the UDS protocol stack, the UDS protocol stack reads the original diagnostic request message, reassembles the original diagnostic request message, fills the identifier of the DoIP transport layer into the reassembled diagnostic request message, and sends the reassembled diagnostic request message to the session layer.

4. A diagnostic method that can dynamically adapt to the transport layer, applied in the UDS protocol stack, characterized in that, The UDS protocol stack includes a dynamic adaptation layer, and the method includes: The system receives diagnostic requests from different transport layers, dynamically identifies the type of transport layer from which the current diagnostic request originates, and adds an identifier characterizing the type of the transport layer to the diagnostic request data structure, including: Receive original diagnostic request messages sent by different transport layers, reassemble the original diagnostic request messages, and append the identifiers of the different transport layers to the reassembled diagnostic request messages; After completing the diagnostic process, the diagnostic results are sent to the corresponding transport layer according to the transport layer identifier, including: After completing the diagnostic process, the original diagnostic response messages of different transport layers are reassembled according to the identifier of the transport layer, and the transmission interface of the transport layer is called to complete the transmission of the reassembled response message; wherein, the reassembled response message includes the original diagnostic response message and the identifier of the transport layer.

5. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps of the method of claim 4.

6. An electronic device, characterized in that, include: A memory on which computer programs are stored; A processor for executing the computer program in the memory to implement the steps of the method of claim 4.