Simulation method and simulation system for diagnosis

By receiving simulation configurations and switching simulation modes through interactive parameters, it simulates electronic control units or diagnostic instruments, solving the problem of insufficient flexibility in existing DoIP simulators and realizing low-cost, highly flexible, and diversified testing.

CN122018354APending Publication Date: 2026-05-12NIO TECH ANHUI CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NIO TECH ANHUI CO LTD
Filing Date
2024-11-11
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Existing DoIP simulators lack flexibility, struggle to simulate various scenarios, are complex to use, and are not user-friendly for non-professional users, resulting in high testing and labor costs.

Method used

A simulation method and system are provided, which can receive simulation configuration parameters and diagnostic interaction parameters, switch simulation modes, simulate electronic control units or diagnostic instruments, realize DoIP connection and diagnosis with external devices, and support diverse testing needs.

Benefits of technology

It reduces the cost of DoIP diagnostic testing, improves the flexibility of the simulator, can adapt to diverse testing needs, and simplifies the usage process for non-professional users.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122018354A_ABST
    Figure CN122018354A_ABST
Patent Text Reader

Abstract

The invention relates to the field of diagnosis, in particular to a simulation method and a simulation system for diagnosis. The simulation method comprises the following steps: receiving simulation configuration parameters and diagnosis interaction parameters, and receiving a switching instruction; and responding to the switching instruction, and switching to execute a first simulation mode for simulating one or more electronic control units according to the simulation configuration parameters and the diagnosis interaction parameters to receive diagnosis or a second simulation mode for simulating a diagnosis instrument according to the simulation configuration parameters and the diagnosis interaction parameters to perform diagnosis. According to the simulation method and the simulation system, one or more electronic control units can be simulated to establish DoIP connection with the diagnostic apparatus and receive diagnosis, and the diagnostic apparatus can also be simulated to establish DoIP connection with one or more ECUs in the to-be-diagnosed equipment and perform diagnosis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of diagnostics, and more specifically to a simulation method and simulation system for diagnostics. Background Technology

[0002] DoIP (Diagnostic Communication over Internet Protocol) is the main standard in the current vehicle diagnostics field. However, DoIP diagnostic tests are expensive and labor-intensive, thus requiring DoIP simulators. However, common DoIP simulators have the following problems: they lack sufficient flexibility, usually only simulating a single vehicle state in diagnostic scenarios, making it difficult to simulate multiple scenarios and adapt to diverse testing needs; they are also highly complex, often requiring various settings and configurations before use, which is difficult for non-professional users. Summary of the Invention

[0003] In view of the above problems, this application aims to provide a simulation method and simulation system for diagnosis.

[0004] The simulation method for diagnosis according to one or more embodiments of this application includes the following steps:

[0005] Receive simulation configuration parameters and diagnostic interaction parameters, and receive switching commands; and

[0006] In response to the switching command, the system switches to either a first simulation mode that simulates one or more electronic control units to receive diagnostics based on the simulation configuration parameters and the diagnostic interaction parameters, or a second simulation mode that simulates a diagnostic instrument to perform diagnostics based on the simulation configuration parameters and the diagnostic interaction parameters.

[0007] Optionally, the step of simulating one or more electronic control units to receive diagnostics based on the simulation configuration parameters and the diagnostic interaction parameters includes:

[0008] Receive connection establishment request message;

[0009] Determine whether the connection establishment request message matches the simulation configuration parameters;

[0010] In response to the connection establishment request message matching the simulation configuration parameters, a DoIP connection is established;

[0011] Receive diagnostic request messages; and

[0012] Based on the diagnostic interaction parameters, obtain the diagnostic response message corresponding to the diagnostic request message and send the diagnostic response message.

[0013] Optionally, the simulation configuration parameters include at least: the simulated IP address of the one or more electronic control units being simulated.

[0014] The connection establishment request message includes at least: the IP addresses of one or more diagnostic targets.

[0015] The step of determining whether the connection establishment request message matches the simulation configuration parameters includes:

[0016] Determine whether the IP address of one or more diagnostic targets in the connection establishment request message is consistent with the simulated IP address of one or more electronic control units being simulated in the simulation configuration parameters.

[0017] Optionally, the diagnostic interaction parameters include at least the following: the analog logic address of the simulated one or more electronic control units, the diagnostic request corresponding to the analog logic address of the simulated one or more electronic control units, and the correspondence between the diagnostic request and the diagnostic response.

[0018] The diagnostic request message includes at least: the logical address of one or more diagnostic targets and the diagnostic request corresponding to the logical address of the one or more diagnostic targets.

[0019] The step of obtaining the diagnostic response message corresponding to the diagnostic request message based on the diagnostic interaction parameters includes:

[0020] Based on the correspondence, obtain the logical address of one or more diagnostic targets in the diagnostic request message and the diagnostic response corresponding to the diagnostic request corresponding to the logical address of the one or more diagnostic targets.

[0021] Optionally, the step of simulating a diagnostic instrument to perform diagnosis based on the simulation configuration parameters and the diagnostic interaction parameters includes:

[0022] Generate a connection establishment request message based on the simulation configuration parameters and send the connection establishment request message;

[0023] Receive a connection establishment reply message corresponding to the connection establishment request message and establish a DoIP connection based on the connection establishment reply message;

[0024] Send a diagnostic request message based on the diagnostic interaction parameters; and

[0025] Receive a diagnostic response message corresponding to the diagnostic request message.

[0026] Optionally, the simulation configuration parameters include at least: the gateway IP address and port information of the device to be diagnosed.

[0027] The device to be diagnosed includes one or more electronic control units, and sending the connection establishment request message based on the simulation configuration parameters includes:

[0028] The connection establishment request message is sent based on the gateway IP address and port information of the device to be diagnosed.

[0029] Optionally, the diagnostic interaction parameters include at least: the logical address of one or more electronic control units of the device to be diagnosed, and the diagnostic request corresponding to the logical address.

[0030] The step of sending a diagnostic request message based on the diagnostic interaction parameters includes:

[0031] A diagnostic request corresponding to one or more electronic control units of the device to be diagnosed is sent based on the logical address of the device.

[0032] The simulation system for diagnosis according to one or more embodiments of this application includes:

[0033] The interaction module receives simulation configuration parameters and diagnostic interaction parameters, and also receives switching commands; and

[0034] The simulation module, in response to the switching command, switches between two modes: a first simulation mode that simulates one or more electronic control units to receive diagnosis based on the simulation configuration parameters and the diagnostic interaction parameters, and a second simulation mode that simulates a diagnostic instrument to perform diagnosis based on the simulation configuration parameters and the diagnostic interaction parameters.

[0035] Optionally, the simulation module is configured as follows:

[0036] Receive connection establishment request message;

[0037] Determine whether the connection establishment request message matches the simulation configuration parameters;

[0038] In response to the connection establishment request message matching the simulation configuration parameters, a DoIP connection is established;

[0039] Receive diagnostic request messages; and

[0040] Based on the diagnostic interaction parameters, obtain the diagnostic response message corresponding to the diagnostic request message and send the diagnostic response message.

[0041] Optionally, the simulation configuration parameters include at least: the simulated IP address of the one or more electronic control units being simulated.

[0042] The connection establishment request message includes at least: the IP addresses of one or more diagnostic targets.

[0043] The step of determining whether the connection establishment request message matches the simulation configuration parameters includes:

[0044] Determine whether the IP address of one or more diagnostic targets in the connection establishment request message is consistent with the simulated IP address of one or more electronic control units being simulated in the simulation configuration parameters.

[0045] Optionally, the diagnostic interaction parameters include at least the following: the analog logic address of the simulated one or more electronic control units, the diagnostic request corresponding to the analog logic address of the simulated one or more electronic control units, and the correspondence between the diagnostic request and the diagnostic response.

[0046] The diagnostic request message includes at least: the logical address of one or more diagnostic targets and the diagnostic request corresponding to the logical address of the one or more diagnostic targets.

[0047] The step of obtaining the diagnostic response message corresponding to the diagnostic request message based on the diagnostic interaction parameters includes:

[0048] Based on the correspondence, obtain the logical address of one or more diagnostic targets in the diagnostic request message and the diagnostic response corresponding to the diagnostic request corresponding to the logical address of the one or more diagnostic targets.

[0049] Optionally, the simulation module is configured as follows:

[0050] Generate a connection establishment request message based on the simulation configuration parameters and send the connection establishment request message;

[0051] Receive a connection establishment reply message corresponding to the connection establishment request message and establish a DoIP connection based on the connection establishment reply message;

[0052] Send a diagnostic request message based on the diagnostic interaction parameters; and

[0053] Receive a diagnostic response message corresponding to the diagnostic request message.

[0054] Optionally, the simulation configuration parameters include at least: the gateway IP address and port information of the device to be diagnosed.

[0055] The device to be diagnosed includes one or more electronic control units, and sending the connection establishment request message based on the simulation configuration parameters includes:

[0056] The connection establishment request message is sent based on the gateway IP address and port information of the device to be diagnosed.

[0057] Optionally, the diagnostic interaction parameters include at least: the logical address of one or more electronic control units of the device under test, and a diagnostic request corresponding to the logical address of the one or more electronic control units of the device under test.

[0058] The step of sending a diagnostic request message based on the diagnostic interaction parameters includes:

[0059] A diagnostic request corresponding to one or more electronic control units of the device to be diagnosed is sent based on the logical address of the device.

[0060] Optionally, the interaction module is further configured to receive the diagnostic interaction parameters in real time and transmit them to the simulation module.

[0061] Optionally, the simulation module is further configured to include a transport layer security certificate and implement a DoIP connection based on the transport layer security certificate.

[0062] Optionally, the device to be diagnosed is a vehicle.

[0063] The simulation method and simulation system according to one or more embodiments of this application can simulate one or more electronic control units to establish a DoIP connection with an external diagnostic instrument and receive diagnostics, or simulate a diagnostic instrument to establish a DoIP connection with the electronic control unit of the device under test and perform diagnostics. The diagnostic performance of the simulation method and simulation system is driven entirely by pre-configured simulation configuration parameters and diagnostic interaction parameters, thereby effectively reducing the cost of DoIP diagnostic testing and providing greater flexibility to meet diverse testing needs. Attached Figure Description

[0064] The above and / or other aspects and advantages of this application will become clearer and more readily understood from the following description taken in conjunction with the accompanying drawings, in which like or similar elements are denoted by the same reference numerals. The drawings include:

[0065] Figure 1 This is a schematic diagram of the simulation system 100 of one or more embodiments of this application in ECU simulation mode.

[0066] Figure 2 This is a schematic diagram of the simulation system 100 of one or more embodiments of this application in the diagnostic instrument simulation mode.

[0067] Figure 3 This is a schematic flowchart illustrating a simulation method for simulating one or more ECUs in ECU simulation mode to undergo diagnostics, according to one or more embodiments of this application.

[0068] Figure 4 This shows an example of the user interface provided by the front-end application layer.

[0069] Figure 5 This is a flowchart illustrating a simulation method for simulating a diagnostic instrument in a diagnostic instrument simulation mode, according to one or more embodiments of this application.

[0070] Figure 6 This shows another example of the user interface provided by the front-end application layer. Detailed Implementation

[0071] The following are some embodiments of this application, intended to provide a basic understanding of the application. They are not intended to identify key or decisive elements of the application or to limit the scope of protection sought.

[0072] For purposes of brevity and illustrativeness, the principles of this application are described herein primarily with reference to exemplary embodiments thereof. However, those skilled in the art will readily recognize that the same principles are equivalently applicable to all types of simulation methods and systems for diagnostics, and that these same principles can be implemented therein, and that any such variations do not depart from the true spirit and scope of this patent application.

[0073] Furthermore, reference is made in the accompanying drawings, which illustrate specific exemplary embodiments. Electrical, mechanical, logical, and structural modifications may be made to these embodiments without departing from the spirit and scope of this application. Moreover, while features of this application are derived from only one of several embodiments, such features may be combined with one or more other features of other embodiments if desired and / or advantageous for any given or identifiable function. Therefore, the following description should not be construed as limiting, and the scope of this application is defined by the appended claims and their equivalents.

[0074] Terms such as "possessing" and "comprising" indicate that, in addition to the units (modules) and steps that are directly and explicitly stated in the specification and claims, the technical solution of this application does not exclude the presence of other units (modules) and steps that are not directly or explicitly stated. Furthermore, the steps described herein are not limited to being performed in the order they are written; rather, a step written later may be performed simultaneously with or prior to a step written earlier.

[0075] First, the simulation system of one or more embodiments of this application will be described.

[0076] The simulation system of one or more embodiments of this application includes:

[0077] The interaction module is used to receive simulation configuration parameters and diagnostic interaction parameters, and to receive switching commands; and

[0078] The simulation module is configured to switch between two simulation modes in response to the switching command. The first simulation mode is an ECU simulation mode (hereinafter referred to as "ECU simulation mode"), which simulates one or more electronic control units (ECUs) for diagnostic purposes based on the simulation configuration parameters and the diagnostic interaction parameters. The second simulation mode is a diagnostic instrument simulation mode, which simulates a diagnostic instrument for diagnostic purposes based on the simulation configuration parameters and the diagnostic interaction parameters. In other words, the simulation system of one or more embodiments of this application can implement both the ECU simulation mode and the diagnostic instrument simulation mode.

[0079] This section first describes the scenario where the simulation system of one or more embodiments of this application implements the ECU simulation mode.

[0080] Figure 1 This is a schematic diagram of the simulation system 100 of one or more embodiments of this application in ECU simulation mode.

[0081] like Figure 1 As shown, the simulation system 100 of one or more embodiments of this application includes:

[0082] Interaction module 110 is used to receive simulation configuration parameters and diagnostic interaction parameters, and to receive switching commands; and

[0083] The simulation module 120 executes the ECU simulation mode in response to the switching command to switch to ECU simulation mode.

[0084] In the simulation module 120, the DoIP connection between the simulation system 100 and the diagnostic instrument 200 can be realized based on the simulation configuration parameters, and the diagnostic interaction between the simulation system 100 and the diagnostic instrument 200 can be realized based on the diagnostic interaction parameters.

[0085] Specifically, in ECU simulation mode, the user-set simulation configuration parameters and diagnostic interaction parameters between the simulation system 100 and the diagnostic instrument 200 can be obtained through the interaction module 110. As an example, the simulation configuration parameters may include relevant configuration parameters of the device containing one or more ECUs simulated by the simulation system. For example, when the simulated ECU is a vehicle ECU, the simulation configuration parameters may include, for instance, the vehicle identification number, the simulated logical address of the simulated ECU, and the simulated IP address. As an example, the diagnostic interaction parameters may include diagnostic interaction messages between the simulation system 100 and the diagnostic instrument 200, wherein the diagnostic interaction messages include: the simulated logical addresses of the one or more ECUs simulated, the diagnostic request messages received by each simulated logical address, and the diagnostic response messages corresponding to the diagnostic request messages received by each simulated logical address.

[0086] Optionally, in ECU simulation mode, TLS (Transport Layer Security certificate) is further configured in simulation module 120. TLS is a digital certificate used to ensure security and privacy in network communication, typically used to verify the identities of both communicating parties and encrypt transmitted data to prevent third parties from eavesdropping or tampering with the data. Thus, before establishing a DoIP connection between simulation module 120 of simulation system 100 and diagnostic instrument 200, TLS handshake verification can preferably be performed first, thereby ensuring the security of subsequent diagnostic interactive communication. As an example, an input option for whether to select TLS to establish DoIP communication can be provided in interaction module 110, allowing users to choose whether to use TLS based on actual circumstances.

[0087] Optionally, in ECU simulation mode, the interaction module 110 can be further configured to receive simulation scenario parameters as simulation configuration parameters. For example, simulation scenario parameters may include DoIP connection status (such as rejection or activation), DoIP connection response delay, and diagnostic response delay. By customizing these various normal or abnormal scenarios, diverse testing needs of the diagnostic instrument can be met.

[0088] In ECU simulation mode, the diagnostic tool 200 sends a DoIP connection establishment request message to the simulation system 100. If the DoIP connection establishment request message matches the simulation configuration parameters, a DoIP connection is established between the simulation system 100 and the diagnostic tool 200. For example, the DoIP connection establishment request message may include the IP addresses of one or more diagnostic targets. When the IP addresses of these one or more diagnostic targets match the simulated IP addresses of one or more ECUs configured in the interaction module 110, the simulation system 100 and the diagnostic tool 200 establish a DoIP connection.

[0089] After establishing the DoIP connection, the simulation system 100 and the diagnostic instrument 200 perform diagnostic interactions based on diagnostic interaction parameters. For example, the diagnostic interaction includes: the diagnostic instrument 200 sending diagnostic request messages to the respective analog logic addresses of one or more emulated ECUs; and the simulation system 100 sending a diagnostic response message corresponding to the diagnostic request message received at each analog logic address to the diagnostic instrument 200.

[0090] The diagnostic interaction parameters are PDU (Protocol Data Unit) data in JSON format based on the UDS (Unified Diagnostic Services) protocol. The format and example of PDU data are shown below:

[0091]

[0092] As shown above, in the data format, "ecu_logic_addr" is the simulated logic address of the ECU being simulated, pduRx is the diagnostic request message received at this simulated logic address, and pduTx is the diagnostic response message sent by the simulation system 100 in response to this diagnostic request message. That is, the PDU data (i.e., diagnostic interaction parameters) configures the correspondence between the simulated logic addresses of one or more ECUs being simulated, the diagnostic requests corresponding to those simulated ECUs, and the diagnostic responses corresponding to those diagnostic requests.

[0093] Taking "0005" in the data example as an example, pduRx is configured as "22334C" and pduTx is configured as "62334C000001". When the ECU with the simulated logic address "0005" simulated by the simulation system 100 receives the diagnostic request message "22334C" sent by the diagnostic instrument 200, the simulation system 100 will send the diagnostic reply message "62334C000001" corresponding to "22334C" back to the diagnostic instrument 200 to perform diagnostic interaction.

[0094] If the value of pduTx is a list structure, and the simulation system 100 receives the same diagnostic request message multiple times for the same analog logic address, it will send diagnostic response messages in sequence to reply to the diagnostic request message. Taking "0012" in the data example as an example, when the ECU with analog logic address "0012" simulated by the simulation system 100 receives the diagnostic request message "22F19E" sent by the diagnostic instrument 200 for the first time, the simulation system 100 will send the diagnostic response message "62F19E01" for the first time. When it receives the diagnostic request message "22F19E" sent to analog logic address "0012" for the second time, the simulation system 100 can reply with "62F19E02". When it receives the diagnostic request message "22F19E" sent to analog logic address "0012" for the third time, the simulation system 100 will reply with "62F19E03" and keep this reply until the diagnostic communication ends.

[0095] As can be seen, the simulation system 100 is data-driven, responding to diagnostic request messages sent by the diagnostic instrument 200 according to the configured diagnostic interaction parameters. It supports single or multiple responses to the same diagnostic request message, providing greater flexibility and adaptability to diverse testing needs. Specifically, users can flexibly set diagnostic interaction parameters through configuration files, interface input, or other methods to achieve various testing requirements. For example, some scenarios only require a single response to a diagnostic request message, while others require multiple responses to a single diagnostic request. These can all be achieved by setting different response methods in the diagnostic interaction parameters (such as responding only once, responding multiple times at specified intervals, or responding multiple times according to specified time intervals, etc.).

[0096] Optionally, the interaction module 110 can also be configured to update the diagnostic interaction parameters in real time during the diagnostic interaction process. Specifically, the interaction module 110 can receive the updated diagnostic interaction parameters (i.e., PDU data in JSON format based on the UDS protocol), and the simulation module 120 can continue to perform diagnostic interaction with the diagnostic instrument 200 based on the updated diagnostic interaction parameters without affecting the DoIP diagnostic communication.

[0097] Next, a scenario in which the simulation system of one or more embodiments of this application implements the diagnostic instrument simulation mode will be described.

[0098] Figure 2 This is a schematic diagram of the simulation system 100 of one or more embodiments of this application in the diagnostic instrument simulation mode.

[0099] like Figure 2 As shown, the simulation system 100 of one or more embodiments of this application is used to simulate a diagnostic instrument to communicate with the device 300 to be diagnosed and to diagnose the device 300. The simulation system 100 includes:

[0100] Interaction module 110 is used to receive simulation configuration parameters and diagnostic interaction parameters, and to receive switching commands; and

[0101] The simulation module 120, in response to the switching command to switch to the diagnostic instrument simulation mode, executes the diagnostic instrument simulation mode. In the simulation module 120, a DoIP connection is established with the device under test 300 based on the simulation configuration parameters, and a diagnostic interaction is established with the device under test 300 based on the diagnostic interaction parameters to perform diagnosis.

[0102] As an example, simulation configuration parameters may include, for instance, the gateway IP address and port information of the device 300 to be diagnosed. As another example, the device 300 to be diagnosed may include one or more ECUs, wherein the diagnostic interaction parameters include diagnostic interaction messages between the device 300 to be diagnosed and the simulation system 100 for diagnosing the one or more ECUs. These diagnostic interaction messages include: the logical address of each of the one or more ECUs, and a diagnostic request message sent to each logical address.

[0103] Optionally, the simulation module 120 of the simulation system 100 sends a DoIP connection establishment request message to the device under test 300, and establishes a DoIP connection between the simulation system 100 and the device under test 300 based on the DoIP connection establishment request message. Specifically, based on the gateway IP address and port information of the device under test 300 obtained from the interaction module 110, the simulation module 120 sends a DoIP connection establishment request message to the gateway of the device under test 300, thereby establishing a DoIP connection between the simulation module 120 and the gateway of the device under test 300.

[0104] Optionally, the diagnostic interaction with the device under test 300 based on diagnostic interaction parameters includes: the simulation module 120 of the simulation system 100 sending a diagnostic request message to the logical address of one or more ECUs of the device under test 300 corresponding to the diagnostic request message (each logical address has a one-to-one corresponding diagnostic request message); and the one or more ECUs of the device under test 300 sending a diagnostic response message corresponding to the diagnostic request message to the simulation system 100.

[0105] For example, after the simulation system 100 and the gateway of the device under test 300 have established a DoIP connection, the simulation module 120 sends diagnostic request messages to the logical addresses of one or more ECUs in the device under test 300, wherein each diagnostic request message is sent to its corresponding logical address. Upon receiving a diagnostic request message, each of the one or more ECUs sends a diagnostic response message corresponding to that received message, thereby enabling diagnostic interaction between the simulation system 100 and the device under test 300.

[0106] The simulation system of one or more embodiments of this application has been described above. Next, the simulation method of one or more embodiments of this application will be described.

[0107] The simulation methods of one or more embodiments of this application, like the simulation systems of one or more embodiments of this application, can also switch instructions to implement "ECU simulation mode" or "diagnostic instrument simulation mode".

[0108] This section first describes the scenario where the simulation method of one or more embodiments of this application implements the ECU simulation mode.

[0109] Figure 3 This is a schematic flowchart illustrating a simulation method for simulating one or more ECUs in ECU simulation mode to undergo diagnostics, according to one or more embodiments of this application.

[0110] As an example, the simulation methods of one or more embodiments of this application can be implemented using simulation software, such as... Figure 3 As shown, the simulation software may include a front-end application layer (which is also equivalent to the interaction module 110 of the simulation system 100), an interaction layer, and a back-end service layer (which is also equivalent to the simulation module 120 of the simulation system 100).

[0111] The front-end application layer, which can be developed using Python, is responsible for providing the user interface. Figure 4 This illustrates an example of the user interface provided by the front-end application layer. For example... Figure 4 As shown, this user interface allows users to interact with the simulation software, including configuring simulation parameters and diagnostic interaction parameters, starting / stopping the simulation, and viewing the interaction process.

[0112] The interaction layer, located between the front-end application layer and the back-end service layer, is responsible for handling communication and data exchange between them. In one or more embodiments, the interaction layer includes an API (Application Programming Interface). Communication between the front-end and back-end is conducted via the API, and API communication is implemented through clearly defined interface specifications, including the data formats for requests and responses. The inclusion of APIs in the interaction layer ensures interoperability between the front-end and back-end, facilitating automated testing and expansion of engineering use cases.

[0113] The backend service layer is developed using Go, aiming to achieve high performance, scalability, and concurrency support. It provides simulation software to receive requests from the frontend application layer and execute corresponding business logic, including: simulating the ECU to establish a DoIP connection with the diagnostic tool, processing diagnostic request messages, and sending diagnostic response messages.

[0114] In summary, due to Go's cross-platform support and Python's portability, this simulation software can run on different operating systems (such as macOS, Linux, Windows, etc.), reducing its dependence on the operating system, enhancing its flexibility in adapting to different operating systems, and reducing the complexity of using the simulation software across operating systems.

[0115] Next, combine Figure 3 and Figure 4 This paper will introduce the specific process of the simulation method in ECU simulation mode.

[0116] The simulation software can switch to ECU simulation mode based on a switching command received from the front-end application layer (e.g., a switching command to ECU simulation mode, not shown). In ECU simulation mode, the simulation software can simulate one or more ECUs and interact with a diagnostic tool for diagnostics. First, the front-end application layer and back-end service layer of the simulation software are run separately. Optionally, since the interaction layer includes an API, only the back-end service layer can be run when using the API for external calls. This facilitates automated testing. For example, the API allows other software or systems to communicate with the simulation software's back-end service layer through a predefined interface without requiring a user interface in the front-end application layer. Therefore, automated testing can be achieved through external calls (such as automated test scripts) via the API.

[0117] As an example, the front-end application layer can provide Figure 4 The user interface shown allows for the configuration of various data. When the simulated ECU is a vehicle ECU, as... Figure 4 As shown, users can configure the following simulation configuration parameters in area 1 of the operation interface: vehicle information, including the vehicle's VIN (Vehicle Identification Number) and VID (Vendor Identification); the simulated logical address, simulated IP address, and DoIP connection status of the simulated ECU; DoIP response delay time and UDS delay time. The DoIP connection status can be represented by an activation response code, such as "00" indicating connection rejection, "10" indicating connection acceptance (successful activation), "11" indicating connection acceptance (pending confirmation), etc. By including DoIP response delay time and UDS delay time in the simulation configuration parameters, abnormal diagnostic scenarios caused by DoIP response delay and / or UDS delay in actual diagnosis can be simulated, thereby making the simulation system in this application more consistent with actual abnormal diagnostic scenarios.

[0118] In one or more embodiments, such as Figure 4 As shown, users can operate three buttons in area 2: "Add Node", "Edit Node" and "Delete Node" to add, remove, edit and delete simulation configuration parameters configured in area 1.

[0119] like Figure 4As shown, users can configure diagnostic interaction parameters in area 3 of the operation interface, such as PDU data based on the UDS protocol in JSON format. The PDU data may include the simulated logic address of the emulated ECU, the diagnostic request message received under the simulated logic address, and the diagnostic response message sent in response to the diagnostic request message.

[0120] In one or more embodiments, users can also directly load local JSON files by operating the "Load File" button in zone 2. This method of configuring PDU data also simplifies the manual configuration process in zone 3.

[0121] After configuring the data at the front-end application layer, the user clicks the "Start Playback" button in section 2 of the operation interface, as follows: Figure 3 As shown, the front-end application layer sends the configured data to the interaction layer, and then the interaction layer sends an HTTP request along with the configuration data to the back-end service layer. At this point, the "Start Playback" button is updated to "Stop Playback". Optionally, the simulation playback can also be started by directly calling the API to send an HTTP request, which eliminates the need to click "Start Playback" and thus achieves automated simulation testing.

[0122] like Figure 3 As shown, the diagnostic tool first establishes a TCP connection with the backend service layer through a TCP handshake. The TCP handshake is a process in the TCP / IP protocol stack used to establish a connection between two network entities. After the TCP connection is established, the diagnostic tool sends a DoIP connection establishment request message to the backend service layer. This DoIP connection establishment request message includes the IP addresses of one or more diagnostic targets. The backend service layer processes the DoIP connection establishment request message. That is, when the IP address of the one or more diagnostic targets matches the simulated IP address of one or more ECUs configured in the simulation software, the backend service layer will return a DoIP connection establishment reply message and establish a DoIP connection with the diagnostic tool to receive diagnostics.

[0123] In particular, the diagnostic tool can simultaneously establish DoIP connections with multiple ECUs being simulated, thus forming... Figure 3 The "multiple DoIP connections" shown only exist in this ECU simulation mode. Therefore, one or more ECUs being simulated can simultaneously interact with the diagnostic tool after establishing a connection to receive diagnostics. On the other hand, if the IP addresses of one or more diagnostic targets in the DoIP connection establishment request message do not match the simulated IP addresses of the ECU configured in the simulation software, the DoIP connection establishment will fail.

[0124] Optionally, such as Figure 4As shown, the user interface also includes a "TLS-based DoIP" button. Users can click this button in section 2 and select to use the TLS certificate under the target path to establish a "TLS-based DoIP" connection, which can increase the security of the DoIP connection.

[0125] Next, after the DoIP connection is established, the diagnostic tool and the backend service layer begin... Figure 3 The "Diagnostic Session Loop" shown is as follows: The diagnostic tool sends a DoIP diagnostic request message to the backend service layer; the backend service layer processes the UDS message; and the backend server returns a DoIP diagnostic response message to the diagnostic tool. The DoIP diagnostic request message contains the logical addresses of one or more diagnostic targets. The backend service layer processes the UDS message based on this logical address and, based on the correspondence in the pre-configured PDU data, sends the diagnostic response message corresponding to the logical address of the one or more diagnostic targets and the corresponding UDS message back to the diagnostic tool. Specifically, when clicking... Figure 4 After "Start Playback," the data from zones 1 and 3 are transmitted to the backend service layer. When a diagnostic request message is received from the diagnostic instrument, the simulation software returns the corresponding diagnostic response message according to the configuration data. This is one loop. When the diagnostic instrument sends a diagnostic request message again, a new loop begins. This loop is repeated in... Figure 3 This is represented as "diagnostic session loop".

[0126] Additionally, as an example, such as Figure 4 As shown, users can click the "Log" button to view the diagnostic interaction process log in section 4. As another example... Figure 4 As shown, clicking the "Update Data" button in Zone 1 will send the updated JSON data from Zone 3 to the backend service layer. Specifically, as shown... Figure 3 As shown, the front-end application layer sends the data update request to the interaction layer, and the interaction layer transmits the updated JSON data to the back-end service layer by sending an HTTP request. In other words, the front-end application layer can update the simulation data in real time by calling the API of the back-end service layer, so that the simulation data can be updated in real time without interrupting the DoIP diagnostic communication.

[0127] Finally, Figure 4 Click the "Stop Playback" button in section 1, and it will work as follows: Figure 3 As shown, in the simulation software, the front-end application layer sends the instruction to end playback to the interaction layer. The interaction layer sends an HTTP request to the back-end service layer to clear the playback data, thereby clearing the data passed in during the simulation. At this time, the DoIP connection communication is interrupted, and the simulation ends.

[0128] Next, a scenario in which the simulation method of one or more embodiments of this application implements the simulation mode of a diagnostic instrument will be described.

[0129] Combination Figure 5 and Figure 6 This section introduces the specific process of the simulation method in the diagnostic instrument simulation mode. Among other things, Figure 5 This is a flowchart illustrating a simulation method for simulating a diagnostic instrument in a diagnostic instrument simulation mode, according to one or more embodiments of this application.

[0130] Figure 6 This shows another example of the user interface provided by the front-end application layer.

[0131] like Figure 5 As shown, in diagnostic instrument simulation mode, the simulation software simulates a diagnostic instrument to perform diagnostics, similarly running the front-end application layer and back-end service layer of the simulation software. First, user-defined simulation configuration begins in the front-end application layer; specifically, for example, in... Figure 6 In section 1 of the operation interface shown, relevant parameters can be configured. As an example, the IP address and port of the gateway of the device to be diagnosed can be configured. At the same time, the user can also click the "Add Request" button in section 1. Each click adds a row to the form. The user can fill in the logical address of one or more ECUs in the device to be diagnosed and the UDS diagnostic request message to be sent to this logical address in each form.

[0132] Next, similarly to the above, the front-end application layer sends the configuration data and PDU data to the back-end service layer through the interaction layer, and then presses... Figure 6 The "Connect" button in section 1 of the interface shown in the figure enables the interaction layer to transmit configuration data and PDU data to the backend service layer by sending an HTTP request.

[0133] like Figure 5 As shown, a TCP connection is first established between the device under diagnosis and the backend service layer via a TCP handshake. Once the TCP connection is established, the backend service layer sends a DoIP connection establishment request message to the device under diagnosis to establish a DoIP connection. Figure 6 For example, the backend service layer will send a DoIP connection establishment request packet to the gateway of the device under diagnosis with IP address "172.20.2.2" through port "13400". The device under diagnosis will then send a DoIP connection establishment reply packet to the backend service layer. After the DoIP connection is successfully established, as follows... Figure 6 In section 1 shown, the "Send All" and all "Send" buttons will be clickable. At this time, the simulation software and the device under diagnosis will enter... Figure 5 The "diagnostic session loop" in the context specifically refers to, for example, when clicking... Figure 6After clicking the "Send" button on the first row, the data from the first row of zone 1 is passed to the backend service layer. The simulation software then sends a DoIP diagnostic request message based on this data and receives the returned diagnostic response message. This is a loop. When clicking... Figure 6 After the "Send" button in the second row, a new loop of the same type begins, and this loop continues... Figure 5 This is represented as "diagnostic session loop".

[0134] like Figure 5 As shown, the diagnostic session loop includes: the backend service layer processing UDS messages and sending DoIP diagnostic request messages to the device to be diagnosed; the device to be diagnosed returning the DoIP diagnostic response message corresponding to the DoIP diagnostic request message to the backend service layer; and the backend service layer processing UDS messages and returning DoIP diagnostic messages to the device to be diagnosed.

[0135] As an example, when click Figure 6 In the case of "Send All" in section 1 of the operation interface shown, the backend service layer will send the UDS diagnostic request messages in the form in sequence, continuing to... Figure 6 For example, after clicking "Send All", the backend service layer can... Figure 6 The UDS diagnostic request messages are sent sequentially: "22F100" for the ECU with logical address "0005", "22F190" for the ECU with logical address "0008", "22F19C" for the ECU with logical address "0200", and "3E80" for the ECU with logical address "0201". After the gateway of the diagnostic device receives the above UDS diagnostic request messages, it will send them to the corresponding ECUs according to the logical address information in the messages. Then the simulation software can conduct a diagnostic session loop with each ECU to diagnose each ECU.

[0136] Optionally, as an example, clicking the "Send" button for a specific row in the form will also allow the backend service layer to send a separate UDS diagnostic request message for that row based on the user's needs. It should be noted that, as... Figure 6 As shown, you can click the "Log" button to view the diagnostic interaction process record in section 2.

[0137] Finally, Figure 6 Click the "Disconnect" button in section 1, and it will work as follows: Figure 5 As shown, the front-end application layer sends the disconnect command to the interaction layer, and the interaction layer sends the stop DoIP connection command to the back-end service layer. Thus, the DoIP connection communication is interrupted, and the simulation ends.

[0138] In summary, the simulation method and system provided by one or more embodiments of this application can simulate establishing a DoIP connection between one or more ECUs and a diagnostic instrument, and simulate one or more ECUs undergoing diagnostics. They can also simulate establishing a DoIP connection between a diagnostic instrument and one or more ECUs in a device under test, and perform diagnostics on those ECUs. Furthermore, the simulation method and system provided by one or more embodiments of this application can be data-driven based on set simulation configuration parameters and diagnostic interaction parameters, supporting the simulation of various abnormal diagnostic scenarios.

[0139] Furthermore, the simulation method and system provided in one or more embodiments of this application adopt a front-end and back-end separation design. The front-end provides parameter input, and the back-end provides an external access API to support the expansion of automated testing, which solves the problem of insufficient flexibility of the simulator. Specifically, by adopting a front-end and back-end separation design, the front-end can be developed and updated as an independent module. This means that the front-end can add other parameter input interfaces or modify existing parameter settings without making many changes and adjustments to the back-end. Users can flexibly configure simulation parameters through the interface provided by the front-end, which greatly improves the flexibility and user-friendliness of the simulation. Moreover, the front-end and back-end separation design reduces the dependency between the front-end and back-end, making it easier to expand and upgrade the system. For example, when it is necessary to add additional simulation functions or improve existing functions, the front-end or back-end can be updated separately as needed without causing too much impact on the entire system. This decoupled design also improves the maintainability and scalability of the system, enabling the system to adapt more flexibly to constantly changing needs.

[0140] Furthermore, the simulation method and system provided in one or more embodiments of this application can switch simulation modes by adjusting simulation configuration parameters and diagnostic interaction parameters based on the user's actual diagnostic testing needs. This allows the simulation method and system to simulate one or more ECUs in a simulated vehicle establishing a DoIP connection with a diagnostic tool and to simulate one or more ECUs in a simulated vehicle receiving diagnostics, meeting the user's testing needs for functional modifications or iterations when changing vehicle designs. It can also simulate a diagnostic tool establishing a DoIP connection with one or more ECUs in the device to be diagnosed, meeting the user's testing needs for diagnosing various vehicle functions while the vehicle design remains unchanged. Since testing related to physical vehicle diagnostics often requires the cooperation of a vehicle or test bench, different vehicle designs and different functions within each vehicle design result in high costs for physical vehicles and require significant manpower and time for testing scenarios, leading to high trial-and-error costs. The simulation method and system in this application provide a more economical solution, avoiding the construction of actual test scenarios and effectively reducing the cost of diagnostic testing. Simultaneously, the simulation method and system provided in one or more embodiments of this application can run on multiple operating systems and have an intuitive user interface, making operation simpler and faster, and reducing the complexity of diagnostic testing through simulation.

[0141] Where applicable, the various embodiments provided in this application may be implemented using hardware, software, or a combination of hardware and software. Furthermore, where applicable, without departing from the scope of this application, the various hardware and / or software components described herein may be combined into composite components comprising software, hardware, and / or both. Where applicable, without departing from the scope of this application, the various hardware and / or software components described herein may be divided into sub-components comprising software, hardware, or both. Additionally, where applicable, it is contemplated that software components may be implemented as hardware components, and vice versa.

[0142] The software (such as program code and / or data) according to this application can be stored on one or more computer storage media. It is also contemplated that the software identified herein can be implemented using one or more networked and / or otherwise general-purpose or special-purpose computers and / or computer systems. Where applicable, the order of the various steps described herein can be changed, combined into compound steps, and / or divided into sub-steps to provide the features described herein.

[0143] The embodiments and examples presented herein are provided to illustrate embodiments of this application and its specific applications, thereby enabling those skilled in the art to implement and use this application. However, those skilled in the art will understand that the above description and examples are provided for ease of illustration and example only. The descriptions presented are not intended to cover all aspects of this application or to limit this application to the precise forms disclosed.

Claims

1. A simulation method for diagnosis, characterized in that, The method includes the following steps: Receive simulation configuration parameters and diagnostic interaction parameters, and receive switching commands; and In response to the switching command, the system switches to either a first simulation mode that simulates one or more electronic control units to receive diagnostics based on the simulation configuration parameters and the diagnostic interaction parameters, or a second simulation mode that simulates a diagnostic instrument to perform diagnostics based on the simulation configuration parameters and the diagnostic interaction parameters.

2. The simulation method as described in claim 1, characterized in that, The step of simulating one or more electronic control units to receive diagnostics based on the simulation configuration parameters and the diagnostic interaction parameters includes: Receive connection establishment request message; Determine whether the connection establishment request message matches the simulation configuration parameters; In response to the connection establishment request message matching the simulation configuration parameters, a DoIP connection is established; Receive diagnostic request messages; and Based on the diagnostic interaction parameters, obtain the diagnostic response message corresponding to the diagnostic request message and send the diagnostic response message.

3. The simulation method as described in claim 2, characterized in that, The simulation configuration parameters include at least: the simulated IP address of one or more electronic control units being simulated. The connection establishment request message includes at least: the IP addresses of one or more diagnostic targets. The step of determining whether the connection establishment request message matches the simulation configuration parameters includes: Determine whether the IP address of one or more diagnostic targets in the connection establishment request message is consistent with the simulated IP address of one or more electronic control units being simulated in the simulation configuration parameters.

4. The simulation method as described in claim 2, characterized in that, The diagnostic interaction parameters include at least the following: the simulated logical address of the one or more simulated electronic control units, the diagnostic request corresponding to the simulated logical address of the one or more simulated electronic control units, and the correspondence between the diagnostic request and the diagnostic response. The diagnostic request message includes at least: the logical address of one or more diagnostic targets and the diagnostic request corresponding to the logical address of the one or more diagnostic targets. The step of obtaining the diagnostic response message corresponding to the diagnostic request message based on the diagnostic interaction parameters includes: Based on the correspondence, obtain the logical address of one or more diagnostic targets in the diagnostic request message and the diagnostic response corresponding to the diagnostic request corresponding to the logical address of the one or more diagnostic targets.

5. The simulation method as described in claim 1, characterized in that, The step of simulating a diagnostic instrument to perform diagnosis based on the simulation configuration parameters and the diagnostic interaction parameters includes: Generate a connection establishment request message based on the simulation configuration parameters and send the connection establishment request message; Receive a connection establishment reply message corresponding to the connection establishment request message and establish a DoIP connection based on the connection establishment reply message; Send a diagnostic request message based on the diagnostic interaction parameters; and Receive a diagnostic response message corresponding to the diagnostic request message.

6. The simulation method as described in claim 5, characterized in that, The simulation configuration parameters include at least: the gateway IP address and port information of the device to be diagnosed. The device to be diagnosed includes one or more electronic control units, and sending the connection establishment request message based on the simulation configuration parameters includes: The connection establishment request message is sent based on the gateway IP address and port information of the device to be diagnosed.

7. The simulation method as described in claim 5, characterized in that, The diagnostic interaction parameters include at least: the logical address of one or more electronic control units of the device to be diagnosed, and the diagnostic request corresponding to the logical address. The step of sending a diagnostic request message based on the diagnostic interaction parameters includes: A diagnostic request corresponding to one or more electronic control units of the device to be diagnosed is sent based on the logical address of the device.

8. A simulation system for diagnosis, characterized in that, include: The interaction module receives simulation configuration parameters and diagnostic interaction parameters, and also receives switching commands. as well as The simulation module, in response to the switching command, switches between a first simulation mode that simulates one or more electronic control units to receive diagnosis based on the simulation configuration parameters and the diagnostic interaction parameters, and a second simulation mode that simulates a diagnostic instrument to perform diagnosis based on the simulation configuration parameters and the diagnostic interaction parameters.

9. The simulation system as described in claim 8, characterized in that, The simulation module is configured as follows: Receive connection establishment request message; Determine whether the connection establishment request message matches the simulation configuration parameters; In response to the connection establishment request message matching the simulation configuration parameters, a DoIP connection is established; Receive diagnostic request message; as well as Based on the diagnostic interaction parameters, obtain the diagnostic response message corresponding to the diagnostic request message and send the diagnostic response message.

10. The simulation system as described in claim 9, characterized in that, The simulation configuration parameters include at least: the simulated IP address of one or more electronic control units being simulated. The connection establishment request message includes at least: the IP addresses of one or more diagnostic targets. The step of determining whether the connection establishment request message matches the simulation configuration parameters includes: Determine whether the IP address of one or more diagnostic targets in the connection establishment request message is consistent with the simulated IP address of one or more electronic control units being simulated in the simulation configuration parameters.

11. The simulation system as described in claim 10, characterized in that, The diagnostic interaction parameters include at least the following: the simulated logical address of the one or more simulated electronic control units, the diagnostic request corresponding to the simulated logical address of the one or more simulated electronic control units, and the correspondence between the diagnostic request and the diagnostic response. The diagnostic request message includes at least: the logical address of one or more diagnostic targets and the diagnostic request corresponding to the logical address of the one or more diagnostic targets. The step of obtaining the diagnostic response message corresponding to the diagnostic request message based on the diagnostic interaction parameters includes: Based on the correspondence, obtain the logical address of one or more diagnostic targets in the diagnostic request message and the diagnostic response corresponding to the diagnostic request corresponding to the logical address of the one or more diagnostic targets.

12. The simulation system as described in claim 8, characterized in that, The simulation module is configured as follows: Generate a connection establishment request message based on the simulation configuration parameters and send the connection establishment request message; Receive a connection establishment reply message corresponding to the connection establishment request message and establish a DoIP connection based on the connection establishment reply message; Send a diagnostic request message based on the diagnostic interaction parameters; as well as Receive a diagnostic response message corresponding to the diagnostic request message.

13. The simulation system as described in claim 12, characterized in that, The simulation configuration parameters include at least: the gateway IP address and port information of the device to be diagnosed. The device to be diagnosed includes one or more electronic control units, and sending the connection establishment request message based on the simulation configuration parameters includes: The connection establishment request message is sent based on the gateway IP address and port information of the device to be diagnosed.

14. The simulation system as described in claim 13, characterized in that, The diagnostic interaction parameters include at least: the logical address of one or more electronic control units of the device under diagnosis, and the diagnostic request corresponding to the logical address of one or more electronic control units of the device under diagnosis. The step of sending a diagnostic request message based on the diagnostic interaction parameters includes: A diagnostic request corresponding to one or more electronic control units of the device to be diagnosed is sent based on the logical address of the device.

15. The simulation system as described in claim 8, characterized in that, The interaction module is further configured to receive the diagnostic interaction parameters in real time and transmit them to the simulation module.

16. The simulation system as described in claim 8, characterized in that, The simulation module is further configured to include a transport layer security certificate and to implement a DoIP connection based on the transport layer security certificate.

17. The simulation system as described in claim 8, characterized in that, The device to be diagnosed is a vehicle.