A multi-network segment-based vehicle diagnosis method, device, equipment and storage medium
Patent Information
- Application Number
- CN202511011230.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-21
- Publication Date
- 2026-09-08
- Estimated Expiration
- 2045-07-21
AI Technical Summary
[0040] This application establishes a first communication link with the vehicle to be diagnosed and a second communication link with a target computer; the target computer is a computer connected to the diagnostic device; based on a preset network protocol and the second communication link, a first IP address located in a first network segment is assigned to the target computer, and a second IP address located in the first network segment is assigned to the vehicle gateway of the vehicle to be diagnosed using the first communication link; static network configuration is performed on the target computer to obtain a third IP address of the target computer located in a second network segment, and it is determined whether it is necessary to switch from the first network segment to the second network segment for vehicle diagnosis; if no switch is needed, a first communication connection is established between the first IP address and the second IP address, and vehicle diagnosis operation corresponding to the first entity node to be diagnosed is performed based on the first communication connection; the first entity node to be diagnosed... The first entity node is located in the first network segment. If a switch is required, an instruction message containing node information of the second entity node to be diagnosed is sent to the vehicle gateway, so that the vehicle gateway can modify its internal diagnostic communication architecture based on the instruction message to obtain a modified communication architecture. The second entity node to be diagnosed is located in the second network segment. The first communication connection is disconnected, and the fourth IP address of the second entity node to be diagnosed in the second network segment and the fifth IP address of the vehicle gateway in the second network segment are determined. Based on the modified communication architecture, a second communication connection is established between the third IP address and the fourth IP address, and a third communication connection is established between the third IP address and the fifth IP address. Based on the second communication connection and the third communication connection, vehicle diagnostic operations corresponding to the second entity node to be diagnosed are performed.
Smart Images

Figure CN120802912B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of vehicle diagnostic technology, and in particular to a vehicle diagnostic method, apparatus, equipment and storage medium based on multiple network segments. Background Technology
[0002] In the field of vehicle diagnostics, diagnostic needs are becoming increasingly complex with the continuous development of technology. On the one hand, traditional CAN (Controller Area Network) diagnostic technology is still widely used; on the other hand, emerging DoIP (Diagnostics over Internet Protocol) technology is gradually becoming mainstream. Vehicle networks contain multiple different network segments, which may have different communication protocols and characteristics.
[0003] In some cases, direct communication between devices on the same network segment can significantly improve diagnostic efficiency and reduce communication latency and intermediate steps. However, this places higher demands on the diagnostic tool, requiring it to support communication across different network segments in order to flexibly interact with various devices in the vehicle.
[0004] As can be seen from the above, how to enable vehicles to perform diagnostic communication in a multi-segment network environment is an urgent problem to be solved. Summary of the Invention
[0005] In view of this, the purpose of this invention is to provide a vehicle diagnostic method, apparatus, device, and storage medium based on multiple network segments, enabling vehicles to perform diagnostic communication in a multi-segment network environment. The specific solution is as follows:
[0006] Firstly, this application provides a vehicle diagnostic method based on multiple network segments, applied to diagnostic equipment, including:
[0007] A first communication link is established with the vehicle to be diagnosed and a second communication link is established with a target computer; the target computer is a computer connected to the diagnostic equipment.
[0008] Based on the preset network protocol and the second communication link, a first IP address located in the first network segment is assigned to the target computer, and a second IP address located in the first network segment is assigned to the vehicle gateway of the vehicle to be diagnosed using the first communication link. Static network configuration is performed on the target computer to obtain a third IP address of the target computer located in the second network segment, and it is determined whether it is necessary to switch from the first network segment to the second network segment for vehicle diagnosis.
[0009] If no switching is required, a first communication connection is established between the first IP address and the second IP address, and vehicle diagnostic operations corresponding to the first entity node to be diagnosed are performed based on the first communication connection; the first entity node to be diagnosed is located in the first network segment.
[0010] If a switch is required, an instruction message containing node information of the second entity node to be diagnosed is sent to the vehicle gateway, so that the vehicle gateway can modify its internal diagnostic communication architecture based on the instruction message to obtain the modified communication architecture; the second entity node to be diagnosed is located in the second network segment;
[0011] Disconnect the first communication connection, and determine the fourth IP address of the second entity node to be diagnosed located in the second network segment and the fifth IP address of the vehicle gateway located in the second network segment. Based on the modified communication architecture, establish a second communication connection between the third IP address and the fourth IP address, and a third communication connection between the third IP address and the fifth IP address.
[0012] Vehicle diagnostic operations corresponding to the second entity node to be diagnosed are performed based on the second communication connection and the third communication connection.
[0013] Optionally, establishing a first communication link with the vehicle to be diagnosed and a second communication link with the target computer includes:
[0014] A first communication link is established between the vehicle to be diagnosed and the vehicle through the OBD interface.
[0015] The computer connected to the diagnostic device is identified as the target computer, and a second communication link is established with the target computer using a network cable or USB interface.
[0016] Optionally, the step of assigning a first IP address located in the first network segment to the target computer based on a preset network protocol and the second communication link, and assigning a second IP address located in the first network segment to the vehicle gateway of the vehicle to be diagnosed using the first communication link, and performing static network configuration on the target computer to obtain a third IP address of the target computer located in the second network segment, includes:
[0017] Based on the Dynamic Host Configuration Protocol and the second communication link, a first IP address located in the first network segment is assigned to the network adapter corresponding to the target computer.
[0018] Based on the Dynamic Host Configuration Protocol and the first communication link, a second IP address located in the first network segment is assigned to the vehicle gateway of the vehicle to be diagnosed, and static network configuration is performed on the target computer to obtain a third IP address located in the second network segment.
[0019] Optionally, if no switching is required, a first communication connection is established between the first IP address and the second IP address, and vehicle diagnostic operations corresponding to the first entity node to be diagnosed are performed based on the first communication connection, including:
[0020] If no switching is required, the vehicle to be diagnosed is identified based on the target computer and using a preset vehicle diagnostic protocol, so as to establish a first communication connection between the first IP address and the second IP address based on the identification result.
[0021] Based on the first communication connection, the target computer sends a diagnostic message containing diagnostic requirements to the vehicle gateway, so that the vehicle gateway uses the target address in the diagnostic message to determine the forwarding path, and forwards the diagnostic message to the first entity node to be diagnosed in the first network segment based on the forwarding path, so as to perform the corresponding vehicle diagnostic operation.
[0022] Optionally, if a switch is required, an instruction message containing node information of the second entity node to be diagnosed is sent to the vehicle gateway, so that the vehicle gateway modifies its internal diagnostic communication architecture based on the instruction message to obtain a modified communication architecture, including:
[0023] If a network segment needs to be switched for vehicle diagnostics, an instruction message containing the unique identifier of the second entity node to be diagnosed that needs to communicate is sent to the vehicle gateway. The vehicle gateway then modifies the connection settings in its internal routing table based on the instruction message to obtain the modified communication architecture.
[0024] Optionally, disconnecting the first communication connection and determining the fourth IP address of the second entity node to be diagnosed located in the second network segment and the fifth IP address of the vehicle gateway located in the second network segment, establishing a second communication connection between the third IP address and the fourth IP address, and a third communication connection between the third IP address and the fifth IP address based on the modified communication architecture, includes:
[0025] Disconnect the first communication connection and determine the fourth IP address of the second entity node to be diagnosed in the second network segment and the fifth IP address of the vehicle gateway in the second network segment;
[0026] Based on the modified communication architecture, a connection permission is determined with the second entity node to be diagnosed. The connection permission is used to establish a second communication connection between the third IP address and the fourth IP address, and a third communication connection between the third IP address and the fifth IP address.
[0027] Optionally, after performing the vehicle diagnostic operation corresponding to the second entity node to be diagnosed based on the second communication connection and the third communication connection, the method further includes:
[0028] The third IP address is used to send a service message including the logical address of the second entity node to be diagnosed to the fifth IP address, so that the vehicle gateway where the fifth IP address is located disconnects the second communication connection and the third communication connection in sequence based on the service message, and restores the first communication connection.
[0029] Secondly, this application provides a vehicle diagnostic device based on multiple network segments, applied to diagnostic equipment, comprising:
[0030] A communication link establishment module is used to establish a first communication link with the vehicle to be diagnosed and a second communication link with a target computer; the target computer is a computer connected to the diagnostic device.
[0031] The IP address allocation module is used to allocate a first IP address located in the first network segment to the target computer based on a preset network protocol and the second communication link, and to allocate a second IP address located in the first network segment to the vehicle gateway of the vehicle to be diagnosed using the first communication link, to perform static network configuration on the target computer to obtain a third IP address of the target computer located in the second network segment, and to determine whether it is necessary to switch from the first network segment to the second network segment for vehicle diagnosis.
[0032] The first vehicle diagnostic module is used to establish a first communication connection between the first IP address and the second IP address if no switching is required, and to perform vehicle diagnostic operations corresponding to the first entity node to be diagnosed based on the first communication connection; the first entity node to be diagnosed is located in the first network segment.
[0033] The architecture modification module is used to send an instruction message containing node information of the second entity node to be diagnosed to the vehicle gateway if a switch is required, so that the vehicle gateway can modify its internal diagnostic communication architecture based on the instruction message to obtain the modified communication architecture; the second entity node to be diagnosed is located in the second network segment;
[0034] A connection establishment module is used to disconnect the first communication connection, and determine the fourth IP address of the second entity node to be diagnosed located in the second network segment and the fifth IP address of the vehicle gateway located in the second network segment, and establish a second communication connection between the third IP address and the fourth IP address, and a third communication connection between the third IP address and the fifth IP address based on the modified communication architecture.
[0035] The second vehicle diagnostic module is used to perform vehicle diagnostic operations corresponding to the second entity node to be diagnosed based on the second communication connection and the third communication connection.
[0036] Thirdly, this application provides an electronic device, comprising:
[0037] Memory, used to store computer programs;
[0038] A processor is used to execute the computer program to implement the aforementioned vehicle diagnostic method based on multiple network segments.
[0039] Fourthly, this application provides a computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the aforementioned vehicle diagnostic method based on multiple network segments.
[0040] This application establishes a first communication link with the vehicle to be diagnosed and a second communication link with a target computer; the target computer is a computer connected to the diagnostic device; based on a preset network protocol and the second communication link, a first IP address located in a first network segment is assigned to the target computer, and a second IP address located in the first network segment is assigned to the vehicle gateway of the vehicle to be diagnosed using the first communication link; static network configuration is performed on the target computer to obtain a third IP address of the target computer located in a second network segment, and it is determined whether it is necessary to switch from the first network segment to the second network segment for vehicle diagnosis; if no switch is needed, a first communication connection is established between the first IP address and the second IP address, and vehicle diagnosis operation corresponding to the first entity node to be diagnosed is performed based on the first communication connection; the first entity node to be diagnosed... The first entity node is located in the first network segment. If a switch is required, an instruction message containing node information of the second entity node to be diagnosed is sent to the vehicle gateway, so that the vehicle gateway can modify its internal diagnostic communication architecture based on the instruction message to obtain a modified communication architecture. The second entity node to be diagnosed is located in the second network segment. The first communication connection is disconnected, and the fourth IP address of the second entity node to be diagnosed in the second network segment and the fifth IP address of the vehicle gateway in the second network segment are determined. Based on the modified communication architecture, a second communication connection is established between the third IP address and the fourth IP address, and a third communication connection is established between the third IP address and the fifth IP address. Based on the second communication connection and the third communication connection, vehicle diagnostic operations corresponding to the second entity node to be diagnosed are performed.
[0041] As can be seen from the above, this application first assigns IP addresses located in the first network segment to the target computer and the vehicle gateway to establish a first communication connection, and then determines whether it is necessary to switch from the first network segment to the second network segment for vehicle diagnostics. When no switching is required, direct communication between the diagnostic device and the first entity node to be diagnosed is achieved through the first communication connection. When a switch is required, an instruction message containing the second entity node to be diagnosed is sent to the vehicle gateway, so that the vehicle gateway can modify its internal diagnostic communication architecture based on the instruction message. After disconnecting the first communication connection, the IP addresses of the second entity node to be diagnosed and the vehicle gateway in the second network segment are determined, and a second and third communication connection are established with the target computer. In this way, vehicle diagnostic operations corresponding to the second entity node to be diagnosed are performed using the second and third communication connections. This flexible network segment switching mechanism allows the diagnostic device to adapt to the communication needs of internal vehicle entities in different network segments, breaking through the limitations of a single network segment, and thus obtaining various diagnostic data of the vehicle in different network segments, achieving a more comprehensive and in-depth diagnosis of the vehicle. Attached Figure Description
[0042] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0043] Figure 1 This is a flowchart of a vehicle diagnostic method based on multiple network segments disclosed in this application;
[0044] Figure 2 This is a schematic diagram of a first IP address allocation disclosed in this application;
[0045] Figure 3 This is a schematic diagram illustrating the allocation of IP addresses across different network segments as disclosed in this application;
[0046] Figure 4 This application discloses a specific vehicle diagnostic method based on multiple network segments.
[0047] Figure 5 This is a schematic diagram of a network adaptation requirement disclosed in this application;
[0048] Figure 6 This is a schematic diagram of the structure of a vehicle diagnostic device based on multiple network segments disclosed in this application;
[0049] Figure 7 This is a structural diagram of an electronic device disclosed in this application. Detailed Implementation
[0050] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0051] Currently, vehicle networks consist of multiple network segments, each with its own communication protocols and characteristics. In some cases, direct communication between devices within the same network segment can significantly improve diagnostic efficiency and reduce communication latency and intermediate steps. However, this places higher demands on diagnostic equipment, requiring it to support communication across different network segments to flexibly interact with various devices within the vehicle. To address this, this application provides a multi-network-segment-based vehicle diagnostic method. This method utilizes a second and a third communication connection to perform vehicle diagnostic operations corresponding to a second entity node to be diagnosed. This flexible network segment switching mechanism allows the diagnostic equipment to adapt to the communication needs of internal vehicle nodes across different network segments, overcoming the limitations of a single network segment and enabling the acquisition of various diagnostic data from different network segments, thus achieving a more comprehensive and in-depth diagnosis of the vehicle.
[0052] See Figure 1 As shown, this embodiment of the invention discloses a vehicle diagnostic method based on multiple network segments, applied to diagnostic equipment, including:
[0053] Step S11: Establish a first communication link with the vehicle to be diagnosed and a second communication link with the target computer; the target computer is a computer connected to the diagnostic device.
[0054] In this embodiment, the diagnostic device is connected to the OBD (On-Board Diagnostics) interface of the vehicle to be diagnosed to establish a first communication link. Then, a computer connected to the diagnostic device is designated as the target computer, and the diagnostic device is connected to the target computer using a network cable or USB interface to establish a second communication link. Specifically, establishing the first communication link with the vehicle to be diagnosed and the second communication link with the target computer includes: establishing a first communication link with the vehicle to be diagnosed based on the OBD interface of the vehicle; designating the computer connected to the diagnostic device as the target computer, and establishing a second communication link with the target computer using a network cable or USB interface.
[0055] Step S12: Based on the preset network protocol and the second communication link, assign a first IP address located in the first network segment to the target computer, and use the first communication link to assign a second IP address located in the first network segment to the vehicle gateway of the vehicle to be diagnosed, perform static network configuration on the target computer to obtain a third IP address of the target computer located in the second network segment, and determine whether it is necessary to switch from the first network segment to the second network segment for vehicle diagnosis.
[0056] In this embodiment, after obtaining the first communication link and the second communication link, a first IP address located in the first network segment is assigned to the network adapter corresponding to the target computer based on the second communication link and using the Dynamic Host Configuration Protocol (DHCP). Figure 2 This embodiment provides a schematic diagram of a first IP address allocation, where the value corresponding to the IPv4 address is equivalent to the first IP address, and DHCP is enabled at this time. Then, based on the first communication link and using the Dynamic Host Configuration Protocol, a second IP address located in the first network segment is allocated to the vehicle gateway of the vehicle to be diagnosed, and the first IP address of the target computer is modified to an IP address added by static settings that support multiple networks, so as to obtain a third IP address of the target computer located in the second network segment. Figure 3 This embodiment provides a schematic diagram of IP address allocation across different network segments. In this diagram, 192.168.100.150 corresponds to the first IP address of the target computer in the first network segment; 192.168.200.150 corresponds to the third IP address of the target computer in the second network segment. That is, the target computer has corresponding IP addresses in both the first and second network segments.
[0057] Specifically, the step of allocating a first IP address located in the first network segment to the target computer based on a preset network protocol and the second communication link, and allocating a second IP address located in the first network segment to the vehicle gateway of the vehicle to be diagnosed using the first communication link, and performing static network configuration on the target computer to obtain a third IP address of the target computer located in the second network segment, includes: allocating a first IP address located in the first network segment to the network adapter corresponding to the target computer based on a dynamic host configuration protocol and the second communication link; allocating a second IP address located in the first network segment to the vehicle gateway of the vehicle to be diagnosed based on the dynamic host configuration protocol and the first communication link, and performing static network configuration on the target computer to obtain a third IP address of the target computer located in the second network segment.
[0058] Step S13: If no switching is required, establish a first communication connection between the first IP address and the second IP address, and perform vehicle diagnostic operations corresponding to the first entity node to be diagnosed based on the first communication connection; the first entity node to be diagnosed is located in the first network segment.
[0059] In this embodiment, if it is not necessary to switch from the first network segment to the second network segment for vehicle diagnostics, the target computer performs DoIP (Diagnostic over Internet Protocol) vehicle identification on the vehicle to be diagnosed. Based on the identification result, a TCP (Transmission Control Protocol) connection, i.e., a first communication connection, is established between the first IP address and the second IP address. Then, based on the first communication connection and using the target computer, a diagnostic message containing diagnostic requirements is sent to the vehicle gateway. After receiving the diagnostic message, the vehicle gateway uses the target address in the diagnostic message to determine the forwarding path and forwards the diagnostic message to the DoIP entity node corresponding to the first network segment, i.e., the first entity node to be diagnosed, based on the forwarding path, to perform vehicle diagnostic operations corresponding to the first entity node to be diagnosed.
[0060] Specifically, if no switching is required, establishing a first communication connection between the first IP address and the second IP address, and performing vehicle diagnostic operations corresponding to the first entity node to be diagnosed based on the first communication connection, includes: if no switching is required, identifying the vehicle to be diagnosed based on the target computer and using a preset vehicle diagnostic protocol, and establishing a first communication connection between the first IP address and the second IP address based on the identification result; sending a diagnostic message containing diagnostic requirements to the vehicle gateway based on the first communication connection and using the target computer, so that the vehicle gateway can determine a forwarding path using the target address in the diagnostic message, and forward the diagnostic message to the first entity node to be diagnosed in the first network segment based on the forwarding path, so as to perform corresponding vehicle diagnostic operations.
[0061] Step S14: If a switch is required, an instruction message containing node information of the second entity node to be diagnosed is sent to the vehicle gateway so that the vehicle gateway can modify its internal diagnostic communication architecture based on the instruction message to obtain the modified communication architecture; the second entity node to be diagnosed is located in the second network segment.
[0062] In this embodiment, since different DoIP entity nodes inside the vehicle to be diagnosed may be located in different network segments, but some deep diagnostic operations require a direct connection between the target computer and the corresponding target DoIP entity node; the target DoIP entity node is equivalent to the target ECU; the deep diagnostic operation includes flashing. Therefore, when it is necessary to switch network segments for vehicle diagnostics, an instruction message containing the EID of the second entity node to be diagnosed that needs to communicate is sent to the vehicle gateway, so that the vehicle gateway can modify the connection settings in its internal routing table based on the message content in the instruction message, enabling the vehicle gateway to directly connect with the second entity node to be diagnosed, thereby obtaining the modified communication architecture.
[0063] Specifically, if a switch is required, an instruction message containing node information of the second entity node to be diagnosed is sent to the vehicle gateway, so that the vehicle gateway can modify its internal diagnostic communication architecture based on the instruction message to obtain a modified communication architecture. This includes: if a network segment needs to be switched for vehicle diagnosis, an instruction message containing the unique identifier information of the second entity node to be diagnosed that needs to communicate is sent to the vehicle gateway, so that the vehicle gateway can modify the connection settings in its internal routing table based on the instruction message to obtain a modified communication architecture.
[0064] Step S15: Disconnect the first communication connection, and determine the fourth IP address of the second entity node to be diagnosed located in the second network segment and the fifth IP address of the vehicle gateway located in the second network segment. Based on the modified communication architecture, establish a second communication connection between the third IP address and the fourth IP address, and a third communication connection between the third IP address and the fifth IP address.
[0065] In this embodiment, when a connection needs to be established with the second entity node to be diagnosed located in the second network segment, the first communication connection needs to be disconnected to prepare for the connection with the second entity node to be diagnosed. Next, the fourth IP address of the second entity node to be diagnosed located in the second network segment and the fifth IP address of the vehicle gateway located in the second network segment are determined. A second communication connection is established between the third IP address and the fourth IP address based on a preset handshake mechanism of the TCP protocol. During functional addressing, a third communication connection is established between the third IP address and the fifth IP address based on the functional addressing logic in DoIP and the modified communication architecture. The sent diagnostic messages rely on network layer routing and reliable TCP transmission at the transport layer to achieve diagnostic interaction with the second entity node to be diagnosed and the gateway node.
[0066] Specifically, disconnecting the first communication connection and determining the fourth IP address of the second entity node to be diagnosed located in the second network segment and the fifth IP address of the vehicle gateway located in the second network segment, and establishing a second communication connection between the third IP address and the fourth IP address, and a third communication connection between the third IP address and the fifth IP address based on the modified communication architecture, includes: disconnecting the first communication connection and determining the fourth IP address of the second entity node to be diagnosed located in the second network segment and the fifth IP address of the vehicle gateway located in the second network segment; determining a connection permission with the second entity node to be diagnosed based on the modified communication architecture, and establishing a second communication connection between the third IP address and the fourth IP address, and a third communication connection between the third IP address and the fifth IP address using the connection permission.
[0067] Step S16: Perform vehicle diagnostic operations corresponding to the second entity node to be diagnosed based on the second communication connection and the third communication connection.
[0068] In this embodiment, after performing a deep diagnostic on the vehicle to be diagnosed, the vehicle gateway needs to be restored to its original forwarding rules. At this point, a service message including the logical address of the second entity node to be diagnosed is sent from the third IP address to the fifth IP address to trigger the configuration recovery mechanism within the vehicle gateway. This closes the second and third communication connections. Then, based on the network layer address configuration, the connection between the first and second IP addresses can be re-established, restoring the original communication mode. Specifically, after performing the vehicle diagnostic operation corresponding to the second entity node to be diagnosed based on the second and third communication connections, the process further includes: sending a service message including the logical address of the second entity node to be diagnosed from the third IP address to the fifth IP address, so that the vehicle gateway where the fifth IP address is located sequentially disconnects the second and third communication connections based on the service message and restores the first communication connection.
[0069] As can be seen from the above, this application first assigns IP addresses located in the first network segment to the target computer and the vehicle gateway to establish a first communication connection, and then determines whether it is necessary to switch from the first network segment to the second network segment for vehicle diagnostics. When no switching is required, direct communication between the diagnostic device and the first entity node to be diagnosed is achieved through the first communication connection. When a switch is required, an instruction message containing the second entity node to be diagnosed is sent to the vehicle gateway, so that the vehicle gateway can modify its internal diagnostic communication architecture based on the instruction message. After disconnecting the first communication connection, the IP addresses of the second entity node to be diagnosed and the vehicle gateway in the second network segment are determined, and a second and third communication connection are established with the target computer. In this way, vehicle diagnostic operations corresponding to the second entity node to be diagnosed are performed using the second and third communication connections. This flexible network segment switching mechanism allows the diagnostic device to adapt to the communication needs of internal vehicle entities in different network segments, breaking through the limitations of a single network segment, and thus obtaining various diagnostic data of the vehicle in different network segments, achieving a more comprehensive and in-depth diagnosis of the vehicle.
[0070] As can be seen from the above embodiments, this application establishes multi-segment connections based on allocated IP addresses to meet the diagnostic communication needs of vehicle internal entity nodes under different network segments. Therefore, the process of establishing multi-segment connections based on allocated IP addresses is described.
[0071] See Figure 4 As shown, this embodiment of the invention discloses a specific vehicle diagnostic method based on multiple network segments, applied to diagnostic equipment, including:
[0072] In this embodiment, the diagnosis of the vehicle to be diagnosed often involves cross-network segment communication, so the network adapter of the diagnostic device needs to support dual network segment IPs at the same time. Figure 5 This embodiment provides a schematic diagram of network adaptation requirements. It obtains all network adapter information for the target computer corresponding to the vehicle to be diagnosed, determines the target network adapter corresponding to the diagnostic device based on the network adapter information and by sending and receiving packets, and then records the first IP address of the target network adapter. The first IP address is equivalent to... Figure 4 The IP address in the first IP address is 192.168.X.151. Next, it is checked whether the first IP address was obtained through DHCP. If it was, the DHCP automatic allocation is changed to manual to fix the first IP address. Relying on DHCP automatic allocation can cause the first IP address to change due to vehicle restarts or network fluctuations; manual fixing avoids this problem. Since the first IP address is in the first network segment, a static third IP address in the second network segment is added, which is equivalent to... Figure 4The IP3 in the first IP address is 192.168.Y.1. If the first IP address is not an IP address assigned by DHCP, it means that the required dual-segment IP address has been configured as required.
[0073] Next, the diagnostic device assigns a second IP address in the first network segment to the vehicle gateway of the vehicle to be diagnosed via DHCP, and determines whether a switch from the first network segment to the second network segment is needed for vehicle diagnosis. Here, the first network segment is network segment X, and the second network segment is network segment Y. If a switch from the first network segment to the second network segment is not needed for vehicle diagnosis, a first communication connection is established between the first IP address and the second IP address based on the identification result. Based on the first communication connection and using the target computer, a diagnostic message containing diagnostic requirements is sent to the vehicle gateway. The vehicle gateway then uses the target address in the diagnostic message to determine a forwarding path and forwards the diagnostic message to the DoIP entity node corresponding to the first network segment, i.e., the first entity node to be diagnosed, based on the forwarding path, to perform the corresponding vehicle diagnostic operation.
[0074] Furthermore, if a switch from the first network segment to the second network segment is required for vehicle diagnostics, an instruction message containing the unique identifier information of the second entity node to be diagnosed that needs to communicate is sent to the vehicle gateway. This allows the vehicle gateway to modify the connection settings in its internal routing table based on the instruction message, obtaining a modified communication architecture. Then, the first communication connection is disconnected, and the fourth IP address of the second entity node to be diagnosed is determined to be located in the second network segment. This is equivalent to... Figure 4 IP4 in the network, i.e., 192.168.Y.201; determines that the vehicle gateway is located at the fifth IP address in the second network segment, which is equivalent to Figure 4 IP5, i.e., 192.168.Y.2; based on the modified communication architecture, determine the connection permission with the second entity node to be diagnosed, and use the connection permission to establish a second communication connection between the third IP address and the fourth IP address, and a third communication connection between the third IP address and the fifth IP address, so as to perform vehicle diagnostic operations corresponding to the second entity node to be diagnosed based on the second communication connection and the third communication connection.
[0075] As can be seen from the above, when this application needs to switch from the first network segment to the second network segment for vehicle diagnostics, it uses a third IP address obtained by statically setting the first IP address of the target computer, then determines the fourth IP address of the second entity node to be diagnosed located in the second network segment and the fifth IP address of the vehicle gateway located in the second network segment. Based on the second communication connection between the third IP address and the fourth IP address, and the third communication connection between the third IP address and the fifth IP address, it performs vehicle diagnostic operations corresponding to the second entity node to be diagnosed located in the second network segment. In this way, the diagnostic device can adapt to the communication needs of internal vehicle nodes under different network segments, breaking through the limitation of a single network segment, and thus obtaining various diagnostic data of vehicles under different network segments. This allows a single diagnostic device to be used for vehicle diagnostics of multiple different network architectures, reducing the cost of using and maintaining the device, and improving the utilization rate of the device.
[0076] Accordingly, see Figure 6 As shown, this application also provides a vehicle diagnostic device based on multiple network segments, applied to diagnostic equipment, including:
[0077] The communication link establishment module 11 is used to establish a first communication link with the vehicle to be diagnosed and a second communication link with the target computer; the target computer is a computer connected to the diagnostic device.
[0078] IP address allocation module 12 is used to allocate a first IP address located in the first network segment to the target computer based on a preset network protocol and the second communication link, and to allocate a second IP address located in the first network segment to the vehicle gateway of the vehicle to be diagnosed using the first communication link, to perform static network configuration on the target computer to obtain a third IP address of the target computer located in the second network segment, and to determine whether it is necessary to switch from the first network segment to the second network segment for vehicle diagnosis.
[0079] The first vehicle diagnostic module 13 is used to establish a first communication connection between the first IP address and the second IP address if no switching is required, and to perform vehicle diagnostic operations corresponding to the first entity node to be diagnosed based on the first communication connection; the first entity node to be diagnosed is located in the first network segment.
[0080] The architecture modification module 14 is used to send an instruction message containing node information of the second entity node to be diagnosed to the vehicle gateway if a switch is required, so that the vehicle gateway can modify its internal diagnostic communication architecture based on the instruction message to obtain the modified communication architecture; the second entity node to be diagnosed is located in the second network segment.
[0081] The connection establishment module 15 is used to disconnect the first communication connection, and determine the fourth IP address of the second entity node to be diagnosed located in the second network segment and the fifth IP address of the vehicle gateway located in the second network segment, and establish a second communication connection between the third IP address and the fourth IP address, and a third communication connection between the third IP address and the fifth IP address based on the modified communication architecture.
[0082] The second vehicle diagnostic module 16 is used to perform vehicle diagnostic operations corresponding to the second entity node to be diagnosed based on the second communication connection and the third communication connection.
[0083] As can be seen from the above, this application first assigns IP addresses located in the first network segment to the target computer and the vehicle gateway to establish a first communication connection, and then determines whether it is necessary to switch from the first network segment to the second network segment for vehicle diagnostics. When no switching is required, direct communication between the diagnostic device and the first entity node to be diagnosed is achieved through the first communication connection. When a switch is required, an instruction message containing the second entity node to be diagnosed is sent to the vehicle gateway, so that the vehicle gateway can modify its internal diagnostic communication architecture based on the instruction message. After disconnecting the first communication connection, the IP addresses of the second entity node to be diagnosed and the vehicle gateway in the second network segment are determined, and a second and third communication connection are established with the target computer. In this way, vehicle diagnostic operations corresponding to the second entity node to be diagnosed are performed using the second and third communication connections. This flexible network segment switching mechanism allows the diagnostic device to adapt to the communication needs of internal vehicle entities in different network segments, breaking through the limitations of a single network segment, and thus obtaining various diagnostic data of the vehicle in different network segments, achieving a more comprehensive and in-depth diagnosis of the vehicle.
[0084] In some specific embodiments, the communication link establishment module 11 may specifically include:
[0085] The first link establishment unit is used to establish a first communication link with the vehicle to be diagnosed based on the OBD interface of the vehicle to be diagnosed.
[0086] The second link establishment unit is used to identify the computer connected to the diagnostic device as the target computer and establish a second communication link with the target computer using a network cable or USB interface.
[0087] In some specific embodiments, the IP address allocation module 12 may specifically include:
[0088] The first address allocation unit is used to allocate a first IP address located in the first network segment to the network adapter corresponding to the target computer based on the dynamic host configuration protocol and the second communication link;
[0089] The second address allocation unit is used to allocate a second IP address located in the first network segment to the vehicle gateway of the vehicle to be diagnosed based on the dynamic host configuration protocol and the first communication link, and to perform static network configuration on the target computer to obtain a third IP address of the target computer located in the second network segment.
[0090] In some specific embodiments, the first vehicle diagnostic module 13 may specifically include:
[0091] The first connection establishment unit is used to identify the vehicle to be diagnosed based on the target computer and using a preset vehicle diagnostic protocol if no switching is required, so as to establish a first communication connection between the first IP address and the second IP address based on the identification result.
[0092] The diagnostic message sending unit is configured to send a diagnostic message containing diagnostic requirements to the vehicle gateway based on the first communication connection and using the target computer, so that the vehicle gateway can determine the forwarding path using the target address in the diagnostic message, and forward the diagnostic message to the first entity node to be diagnosed in the first network segment based on the forwarding path, so as to perform the corresponding vehicle diagnostic operation.
[0093] In some specific embodiments, the architecture modification module 14 may specifically include:
[0094] The connection setting modification unit is used when a network segment needs to be switched for vehicle diagnosis. In this case, it sends an instruction message containing the unique identifier information of the second entity node to be diagnosed that needs to communicate to the vehicle gateway, so that the vehicle gateway can modify the connection settings in its internal routing table based on the instruction message to obtain the modified communication architecture.
[0095] In some specific embodiments, the connection establishment module 15 may specifically include:
[0096] The IP address determination unit is used to disconnect the first communication connection and determine the fourth IP address of the second entity node to be diagnosed located in the second network segment and the fifth IP address of the vehicle gateway located in the second network segment.
[0097] A communication connection establishment unit is used to determine a connection permission with the second entity node to be diagnosed based on the modified communication architecture, and to establish a second communication connection between the third IP address and the fourth IP address, and a third communication connection between the third IP address and the fifth IP address using the connection permission.
[0098] In some specific embodiments, the second vehicle diagnostic module 16 may specifically include:
[0099] The connection disconnection unit is used to send a service message including the logical address of the second entity node to be diagnosed to the fifth IP address using the third IP address, so that the vehicle gateway where the fifth IP address is located disconnects the second communication connection and the third communication connection in sequence based on the service message, and restores the first communication connection.
[0100] Furthermore, embodiments of this application also disclose an electronic device, Figure 7 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content of the diagram should not be construed as limiting the scope of this application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the multi-segment vehicle diagnostic method disclosed in any of the foregoing embodiments. Furthermore, the electronic device 20 in this embodiment may specifically be a computer.
[0101] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.
[0102] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored thereon can include operating system 221, computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0103] The operating system 221 is used to manage and control the various hardware devices on the electronic device 20 and the computer program 222, which may be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program capable of performing the multi-segment vehicle diagnostic method executed by the electronic device 20 as disclosed in any of the foregoing embodiments, the computer program 222 may further include computer programs capable of performing other specific tasks.
[0104] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned vehicle diagnostic method based on multiple network segments. Specific steps of this method can be found in the corresponding content disclosed in the foregoing embodiments, and will not be repeated here.
[0105] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.
[0106] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0107] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0108] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0109] The technical solutions provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A multi-net segment based vehicle diagnostic method, characterized by, Used in diagnostic equipment, including: A first communication link is established with the vehicle to be diagnosed and a second communication link is established with a target computer; the target computer is a computer connected to the diagnostic equipment. Based on the preset network protocol and the second communication link, a first IP address located in the first network segment is assigned to the target computer, and a second IP address located in the first network segment is assigned to the vehicle gateway of the vehicle to be diagnosed using the first communication link. Static network configuration is performed on the target computer to obtain a third IP address located in the second network segment, and it is determined whether it is necessary to switch from the first network segment to the second network segment for vehicle diagnosis. If no switching is required, a first communication connection is established between the first IP address and the second IP address, and vehicle diagnostic operations corresponding to the first entity node to be diagnosed are performed based on the first communication connection; the first entity node to be diagnosed is located in the first network segment. If a switch is required, an instruction message containing node information of the second entity node to be diagnosed is sent to the vehicle gateway, so that the vehicle gateway can modify its internal diagnostic communication architecture based on the instruction message to obtain the modified communication architecture; the second entity node to be diagnosed is located in the second network segment; Disconnect the first communication connection, and determine the fourth IP address of the second entity node to be diagnosed located in the second network segment and the fifth IP address of the vehicle gateway located in the second network segment. Based on the modified communication architecture, establish a second communication connection between the third IP address and the fourth IP address, and a third communication connection between the third IP address and the fifth IP address. Based on the second communication connection and the third communication connection, perform vehicle diagnostic operations corresponding to the second entity node to be diagnosed; If a switch is required, an instruction message containing node information of the second entity node to be diagnosed is sent to the vehicle gateway, so that the vehicle gateway can modify its internal diagnostic communication architecture based on the instruction message to obtain a modified communication architecture, including: If a network segment needs to be switched for vehicle diagnostics, an instruction message containing the unique identifier of the second entity node to be diagnosed that needs to communicate is sent to the vehicle gateway. The vehicle gateway then modifies the connection settings in its internal routing table based on the instruction message to obtain the modified communication architecture.
2. The multi-net segment based vehicle diagnostic method of claim 1, wherein, The establishment of a first communication link with the vehicle to be diagnosed and a second communication link with the target computer includes: A first communication link is established between the vehicle to be diagnosed and the vehicle through the OBD interface. The computer connected to the diagnostic device is identified as the target computer, and a second communication link is established with the target computer using a network cable or USB interface.
3. The vehicle diagnostic method based on multiple network segments according to claim 1, characterized in that, The process of allocating a first IP address located in the first network segment to the target computer based on a preset network protocol and the second communication link, and allocating a second IP address located in the first network segment to the vehicle gateway of the vehicle to be diagnosed using the first communication link, and performing static network configuration on the target computer to obtain a third IP address of the target computer located in the second network segment, includes: Based on the Dynamic Host Configuration Protocol and the second communication link, a first IP address located in the first network segment is assigned to the network adapter corresponding to the target computer. Based on the Dynamic Host Configuration Protocol and the first communication link, a second IP address located in the first network segment is assigned to the vehicle gateway of the vehicle to be diagnosed, and static network configuration is performed on the target computer to obtain a third IP address located in the second network segment.
4. The vehicle diagnostic method based on multiple network segments according to claim 1, characterized in that, If no switching is required, a first communication connection is established between the first IP address and the second IP address, and vehicle diagnostic operations corresponding to the first entity node to be diagnosed are performed based on the first communication connection, including: If no switching is required, the vehicle to be diagnosed is identified based on the target computer and using a preset vehicle diagnostic protocol, so as to establish a first communication connection between the first IP address and the second IP address based on the identification result. Based on the first communication connection, the target computer sends a diagnostic message containing diagnostic requirements to the vehicle gateway, so that the vehicle gateway uses the target address in the diagnostic message to determine the forwarding path, and forwards the diagnostic message to the first entity node to be diagnosed in the first network segment based on the forwarding path, so as to perform the corresponding vehicle diagnostic operation.
5. The vehicle diagnostic method based on multiple network segments according to claim 1, characterized in that, The process of disconnecting the first communication connection, determining the fourth IP address of the second entity node to be diagnosed located in the second network segment, and the fifth IP address of the vehicle gateway located in the second network segment, and establishing a second communication connection between the third IP address and the fourth IP address, and a third communication connection between the third IP address and the fifth IP address based on the modified communication architecture, includes: Disconnect the first communication connection and determine the fourth IP address of the second entity node to be diagnosed in the second network segment and the fifth IP address of the vehicle gateway in the second network segment; Based on the modified communication architecture, a connection permission is determined with the second entity node to be diagnosed. The connection permission is used to establish a second communication connection between the third IP address and the fourth IP address, and a third communication connection between the third IP address and the fifth IP address.
6. The vehicle diagnostic method based on multiple network segments according to any one of claims 1 to 5, characterized in that, After performing the vehicle diagnostic operation corresponding to the second entity node to be diagnosed based on the second communication connection and the third communication connection, the method further includes: The third IP address is used to send a service message including the logical address of the second entity node to be diagnosed to the fifth IP address, so that the vehicle gateway where the fifth IP address is located disconnects the second communication connection and the third communication connection in sequence based on the service message, and restores the first communication connection.
7. A vehicle diagnostic device based on multiple network segments, characterized in that, Used in diagnostic equipment, including: A communication link establishment module is used to establish a first communication link with the vehicle to be diagnosed and a second communication link with a target computer; the target computer is a computer connected to the diagnostic device. The IP address allocation module is used to allocate a first IP address located in the first network segment to the target computer based on a preset network protocol and the second communication link, and to allocate a second IP address located in the first network segment to the vehicle gateway of the vehicle to be diagnosed using the first communication link, to perform static network configuration on the target computer to obtain a third IP address of the target computer located in the second network segment, and to determine whether it is necessary to switch from the first network segment to the second network segment for vehicle diagnosis. The first vehicle diagnostic module is used to establish a first communication connection between the first IP address and the second IP address if no switching is required, and to perform vehicle diagnostic operations corresponding to the first entity node to be diagnosed based on the first communication connection; the first entity node to be diagnosed is located in the first network segment. The architecture modification module is used to send an instruction message containing node information of the second entity node to be diagnosed to the vehicle gateway if a switch is required, so that the vehicle gateway can modify its internal diagnostic communication architecture based on the instruction message to obtain the modified communication architecture; the second entity node to be diagnosed is located in the second network segment; A connection establishment module is used to disconnect the first communication connection, and determine the fourth IP address of the second entity node to be diagnosed located in the second network segment and the fifth IP address of the vehicle gateway located in the second network segment, and establish a second communication connection between the third IP address and the fourth IP address, and a third communication connection between the third IP address and the fifth IP address based on the modified communication architecture. The second vehicle diagnostic module is used to perform vehicle diagnostic operations corresponding to the second entity node to be diagnosed based on the second communication connection and the third communication connection. Specifically, the architecture modification module is used to send an instruction message containing the unique identifier information of the second entity node to be diagnosed that needs to communicate to the vehicle gateway if it is necessary to switch network segments for vehicle diagnosis. This allows the vehicle gateway to modify the connection settings in its internal routing table based on the instruction message, thereby obtaining the modified communication architecture.
8. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor is configured to execute the computer program to implement the multi-segment-based vehicle diagnostic method as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, Used to store a computer program, wherein the computer program, when executed by a processor, implements the multi-segment-based vehicle diagnostic method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Vehicle diagnosis method and device, electronic equipment and computer readable storage medium
CN116781737A
Vehicle networking system, method and device
CN118646769A