CN-116991142-B - Automobile diagnosis service method and system based on modularized UDS protocol
Abstract
The present disclosure provides a modularized UDS protocol-based automobile diagnosis service method and system, which relates to the technical field of automobile UDS development, and comprises an upper computer, PCAN and an electronic control unit ECU; the upper computer sends a diagnosis message to the electronic control unit ECU through PCAN, the electronic control unit ECU distinguishes the network protocol control information type of the diagnosis message after receiving the diagnosis message sent by the upper computer, judges whether the current network state of the network layer allows receiving the frame diagnosis message, judges whether the addressing mode, the session mode and the security level are equal to the configuration information of the electronic control unit ECU, judges whether the electronic control unit ECU supports the service after the network layer allows receiving, and sends a single frame or multiple frames according to the protocol type after the session layer confirms the response type to be sent. The present disclosure may enable fast iterations when a need for increasing or decreasing UDS services is detected, reducing the amount of code change.
Inventors
- SHU HUI
- WANG YING
- QIAN ZHAOGANG
- HANG MENGXUN
- FENG ZHIMIN
- CHE JINGGUO
Assignees
- 奇瑞新能源汽车股份有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20230725
Claims (10)
- 1. The automobile diagnosis service system based on the modularized UDS protocol is characterized by comprising an upper computer, PCAN and an electronic control unit ECU, wherein the electronic control unit ECU comprises a network layer and a session layer; The upper computer sends a diagnosis message to the electronic control unit ECU through PCAN, and after receiving the diagnosis message sent by the upper computer, the electronic control unit ECU firstly receives the diagnosis message at a network layer, and specifically comprises the steps of starting a diagnosis session overtime timing after receiving the diagnosis message, distinguishing a diagnosis message addressing mode and identifying a network protocol control information type of the diagnosis message, judging whether the current network state of the network layer supports the reception of the judged diagnosis message information type, if so, clearing the network state, judging whether the message carrying length accords with the network protocol control information type, if so, receiving the diagnosis message, and carrying out the next processing; After the network layer allows to receive, the session layer judges whether the electronic control unit ECU supports the service, and then judges whether the addressing mode, the session mode and the security level are equal to the configuration information of the electronic control unit ECU, and after the session layer confirms the response type to be transmitted, the network layer transmits a single frame or multiple frames according to the protocol type.
- 2. The modular UDS protocol based automotive diagnostic service system of claim 1, wherein the ECU service configuration includes a service identification code, a sub-function support flag bit, a session support state, a function addressing support state and a security access support state.
- 3. The modular UDS protocol based automotive diagnostic service system of claim 1, wherein the network protocol control information types include single frame, first frame, continuous frame and flow control frame.
- 4. The modular UDS protocol based automotive diagnostic service system of claim 1, wherein the network states include a current network state, a continuous frame waiting state, a flow control frame waiting state, a frame sequence number check state and a transmission frame sequence number.
- 5. The modular UDS protocol based automotive diagnostic service system of claim 1, wherein the types of responses to be sent include positive and negative responses, the session layer determines whether the ECU supports the service of the transmitted diagnostic message, and determines whether the addressing mode, session mode and security level are equal to the ECU configuration information, and if not, sends a negative response, and if so, sends a positive response.
- 6. The modular UDS protocol based automotive diagnostic service system of claim 5, wherein the decision addressing scheme is divided into functional addressing and physical addressing, wherein the functional addressing is the communication between the host computer and all ECU's and the physical addressing is the communication between the host computer and a specific ECU.
- 7. The modular UDS protocol based automotive diagnostic service system of claim 1, wherein after receiving the diagnostic message sent by the upper computer, the ECU starts the diagnostic session timeout timer, sets a timeout threshold, and the upper computer needs to send a next frame message within the set threshold.
- 8. A method of a modular UDS protocol based automotive diagnostic service system according to any one of claims 1 to 7, comprising: the upper computer sends a diagnosis message to the electronic control unit ECU through PCAN, and after the electronic control unit ECU receives the diagnosis message sent by the upper computer, the receiving processing process of the network layer firstly comprises the following steps: after receiving the diagnosis message, starting overtime timing of the diagnosis session, distinguishing the addressing mode of the diagnosis message and identifying the network protocol control information type of the diagnosis message, judging whether the current network state supports receiving the judged diagnosis message information type, if so, clearing the network state, judging whether the message carrying length accords with the network protocol control information type, and if so, receiving the diagnosis message and carrying out the next processing.
- 9. The receiving process of the session layer comprises judging whether the receiving state of the network layer is normal, if so, starting a diagnosis message session timeout timer; Inquiring whether the service configuration of the request service electronic control unit ECU is supported, if so, judging whether the service configuration supports the current addressing mode, the session mode, the current security level and whether the suppression flag bit is suppressed under the positive response, if not, sending a positive response diagnosis message, and starting the overtime timing of the diagnosis session.
- 10. An electronic device comprising a processor, a memory and a computer program, wherein the processor is connected to the memory, the computer program being stored in the memory, the processor executing the computer program stored in the memory when the electronic device is running, to cause the electronic device to perform the method according to any one of claims 8-9.
Description
Automobile diagnosis service method and system based on modularized UDS protocol Technical Field The disclosure relates to the technical field of automobile UDS development, in particular to an automobile diagnosis service method and system based on a modularized UDS protocol. Background The statements in this section merely provide background information related to the present disclosure and may not necessarily constitute prior art. With the rapid development of the automobile industry, the automobile is not a simple combination of mechanical parts, the functions of the electronic and electric appliances of the automobile are more and more complex, such as functions of the internet of vehicles, intelligent cabins, auxiliary driving and the like, the fault performance of the automobile is more and more complex and diversified, and in order to more conveniently carry out fault diagnosis on the electronic control units of all functional modules, the new energy automobile is provided with a diagnosis system taking the UDS protocol as a standard, and the information interaction between a diagnosis upper computer and all functional modules is realized through the UDS protocol, so that the diagnosis on all functional modules of the automobile is realized. In the existing method based on modularized UDS diagnosis, the method is a development diagnosis method of a system control layer of an upper computer, but a diagnosis test method aiming at an execution layer of a lower computer is not available, so that rapid iteration cannot be realized when UDS service needs to be increased or reduced, a program and codes need to be edited again, the change amount is large, and the efficiency of the whole system is slow. Disclosure of Invention In order to solve the problems, the present disclosure provides an automobile diagnosis service method and system based on a modularized UDS protocol, which can determine the diagnosis test service flow of a lower computer of the UDS protocol, and can rapidly increase or decrease the number of codes when the UDS service is needed. According to some embodiments, the present disclosure employs the following technical solutions: The automobile diagnosis service system based on the modularized UDS protocol comprises an upper computer, PCAN and an electronic control unit ECU, wherein the electronic control unit ECU comprises a network layer and a session layer; The upper computer sends a diagnosis message to the electronic control unit ECU through PCAN, the electronic control unit ECU distinguishes the network protocol control information type of the diagnosis message after receiving the diagnosis message sent by the upper computer, judges whether the current network state of the network layer allows receiving the frame diagnosis message, judges whether the addressing mode, the session mode and the security level are equal to the configuration information of the electronic control unit ECU, judges whether the electronic control unit ECU supports the service after allowing the network layer to receive the frame diagnosis message, and the network layer sends a single frame or multiple frames according to the protocol type after confirming the response type required to be sent by the session layer. Further, the electronic control unit ECU service configuration includes a service identification code, a sub-function support flag bit, a session support state, a function addressing support state, and a security access support state. Further, the network protocol control information type includes a single frame, a first frame, a continuous frame, and a flow control frame. Further, the network state includes a current network state, a continuous frame waiting state, a flow control frame waiting state, a frame sequence number checking state, and a transmission frame sequence number. Further, the response types to be sent include positive response and negative response, the session layer judges whether the electronic control unit ECU supports the sent diagnostic message service, judges whether the addressing mode, the session mode and the security level are equal to the configuration information of the electronic control unit ECU, sends the negative response if the addressing mode, the session mode and the security level are not equal to the configuration information of the electronic control unit ECU, and sends the positive response if the addressing mode, the session mode and the security level are not equal to the configuration information of the electronic control unit ECU. Further, in the judging addressing mode, the addressing mode is divided into functional addressing and physical addressing, wherein the functional addressing is that the upper computer communicates with all the Electronic Control Units (ECU), and the physical addressing is that the upper computer communicates with a specific Electronic Control Unit (ECU). Further, after receiving the diagnosis message sent by the upper computer