Vehicle diagnosis method, device and equipment based on multiple network segments and storage medium
By assigning IP addresses to the target computer and vehicle gateway and modifying the communication architecture, the diagnostic communication problem in a multi-segment environment was solved, enabling comprehensive and in-depth diagnosis of the vehicle.
Patent Information
- Application Number
- CN202511011230.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-21
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2045-07-21
AI Technical Summary
In vehicle diagnosis, how to achieve flexible diagnostic communication in a multi-segment network environment, break through the limitations of a single network segment, and obtain diagnostic data under different network segments.
By assigning IP addresses located in the first network segment to the target computer and vehicle gateway, establishing a first communication connection, determining whether it is necessary to switch to the second network segment, and modifying the diagnostic communication architecture when necessary, after disconnecting the first communication connection, determining the IP addresses of the second entity node to be diagnosed and the vehicle gateway in the second network segment, establishing second and third communication connections, and implementing diagnostic operations with the second entity node to be diagnosed.
It enables diagnostic equipment to flexibly communicate with physical nodes inside the vehicle under different network segments, breaking through the limitations of a single network segment, obtaining comprehensive and in-depth diagnostic data, and reducing equipment and maintenance costs.
Smart Images

Figure CN120802912A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of vehicle diagnosis, and in particular to a vehicle diagnosis method and device based on multiple network segments, equipment and a storage medium. BACKGROUND
[0002] In the field of vehicle diagnosis, with the continuous development of technology, the diagnosis demand is increasingly complex. On the one hand, the traditional CAN (Controller Area Network) diagnosis technology is still widely used; on the other hand, the emerging DoIP (Diagnostics over Internet Protocol) technology has gradually become mainstream. There are multiple different network segments in the vehicle network, and different network segments may have different communication protocols and characteristics.
[0003] In some cases, direct connection communication between devices in the same network segment can significantly improve the diagnosis efficiency and reduce communication delay and intermediate links. However, this puts higher requirements on the diagnostic instrument, which needs to support communication of different network segments in order to be able to flexibly interact with each device in the vehicle.
[0004] From the above, how to make the vehicle perform diagnosis communication in a multi-network segment network environment is a problem to be solved at present. SUMMARY
[0005] Therefore, the purpose of the present application is to provide a vehicle diagnosis method and device based on multiple network segments, which can make the vehicle perform diagnosis communication in a multi-network segment network environment. The specific scheme is as follows:
[0006] In a first aspect, the present application provides a vehicle diagnosis method based on multiple network segments, applied to a diagnosis device, comprising:
[0007] establishing a first communication link with a vehicle to be diagnosed and a second communication link with a target computer respectively; the target computer is a computer connected with the diagnosis device;
[0008] based on a preset network protocol and the second communication link, assigning the target computer a first IP address located in a first network segment, and using the first communication link to assign a vehicle gateway of the vehicle to be diagnosed a second IP address located in the first network segment, performing static network configuration on the target computer to obtain a third IP address of the target computer located in a second network segment, and determining whether it is necessary to switch from the first network segment to the second network segment for vehicle diagnosis;
[0009] If the switching is not needed, a first communication connection between the first IP address and the second IP address is established, and a vehicle diagnosis operation corresponding to a first to-be-diagnosed entity node is performed based on the first communication connection; the first to-be-diagnosed entity node is in the first network segment;
[0010] If the switching is needed, an instruction message containing node information of a second to-be-diagnosed entity node is sent to the vehicle gateway, so that the vehicle gateway modifies an internal diagnosis communication architecture based on the instruction message to obtain a modified communication architecture; the second to-be-diagnosed entity node is in the second network segment;
[0011] The first communication connection is disconnected, and a fourth IP address of the second to-be-diagnosed entity node in the second network segment and a fifth IP address of the vehicle gateway in the second network segment are determined, 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 are established based on the modified communication architecture;
[0012] A vehicle diagnosis operation corresponding to the second to-be-diagnosed entity node is performed based on the second communication connection and the third communication connection.
[0013] Optionally, the establishing of the first communication link with the to-be-diagnosed vehicle and the second communication link with the target computer respectively comprises:
[0014] The first communication link with the to-be-diagnosed vehicle is established based on an OBD interface of the to-be-diagnosed vehicle;
[0015] The computer connected with the diagnosis device is determined as the target computer, and the second communication link with the target computer is established by using a network cable or a USB interface.
[0016] Optionally, the target computer is allocated a first IP address in a first network segment based on a preset network protocol and the second communication link, and a vehicle gateway of the to-be-diagnosed vehicle is allocated a second IP address in the first network segment by using the first communication link, and the target computer is statically network configured to obtain a third IP address of the target computer in a second network segment, comprising:
[0017] A network adapter corresponding to the target computer is allocated the first IP address in the first network segment based on a dynamic host configuration protocol and the second communication link;
[0018] The vehicle gateway of the to-be-diagnosed vehicle is allocated the second IP address in the first network segment based on the dynamic host configuration protocol and the first communication link, and the target computer is statically network configured to obtain the third IP address of the target computer in the second network segment.
[0019] Optionally, if the switching is not needed, a first communication connection between the first IP address and the second IP address is established, and a vehicle diagnosis operation corresponding to the first to-be-diagnosed entity node is performed based on the first communication connection, including:
[0020] If the switching is not needed, the to-be-diagnosed vehicle is identified based on the target computer and by using a preset vehicle diagnosis 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 and by using the target computer, a diagnosis message containing diagnosis requirements is sent to the vehicle gateway, so that the vehicle gateway determines a forwarding path by using a target address in the diagnosis message, and forwards the diagnosis message to the first to-be-diagnosed entity node in the first network segment based on the forwarding path, so as to perform a corresponding vehicle diagnosis operation.
[0022] Optionally, if the switching is needed, an instruction message containing node information of the second to-be-diagnosed entity node is sent to the vehicle gateway, so that the vehicle gateway modifies an internal diagnosis communication architecture based on the instruction message, to obtain a modified communication architecture, including:
[0023] If the switching of the network segment is needed for vehicle diagnosis, an instruction message containing unique identification information of the second to-be-diagnosed entity node which needs to communicate is sent to the vehicle gateway, so that the vehicle gateway modifies connection settings in an internal routing table based on the instruction message, to obtain a modified communication architecture.
[0024] Optionally, the first communication connection is disconnected, and a fourth IP address of the second to-be-diagnosed entity node located in the second network segment and a fifth IP address of the vehicle gateway located in the second network segment are determined, 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 are established based on the modified communication architecture, including:
[0025] The first communication connection is disconnected, and a fourth IP address of the second to-be-diagnosed entity node located in the second network segment and a fifth IP address of the vehicle gateway located in the second network segment are determined;
[0026] Based on the modified communication architecture, a connection permission with the second to-be-diagnosed entity node is determined, and 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 are established by using the connection permission.
[0027] Optionally, after the vehicle diagnosis operation corresponding to the second to-be-diagnosed entity node is performed based on the second communication connection and the third communication connection, the method further includes:
[0028] sending, by using the third IP address, a service packet including a logical address of the second to-be-diagnosed entity node to the fifth IP address, so that the vehicle gateway at the fifth IP address disconnects the second communication connection and the third communication connection based on the service packet in sequence, and restores the first communication connection.
[0029] In a second aspect, the present application provides a vehicle diagnosis device based on multiple network segments, applied to a diagnosis equipment, including:
[0030] a communication link establishment module, configured to establish a first communication link with a to-be-diagnosed vehicle and a second communication link with a target computer respectively; the target computer is a computer connected with the diagnosis equipment;
[0031] an IP address allocation module, configured to allocate, based on a preset network protocol and the second communication link, a first IP address of a first network segment for the target computer, and allocate, by using the first communication link, a second IP address of the first network segment for a vehicle gateway of the to-be-diagnosed vehicle, perform static network configuration on the target computer to obtain a third IP address of a second network segment of the target computer, and determine whether it is necessary to switch from the first network segment to the second network segment for vehicle diagnosis;
[0032] a first vehicle diagnosis module, configured to, if the switching is not necessary, establish a first communication connection between the first IP address and the second IP address, and perform a vehicle diagnosis operation corresponding to a first to-be-diagnosed entity node based on the first communication connection; the first to-be-diagnosed entity node is in the first network segment;
[0033] an architecture modification module, configured to, if the switching is necessary, send an instruction packet containing node information of a second to-be-diagnosed entity node to the vehicle gateway, so that the vehicle gateway modifies an internal diagnosis communication architecture based on the instruction packet to obtain a modified communication architecture; the second to-be-diagnosed entity node is in the second network segment;
[0034] a connection establishment module, configured to disconnect the first communication connection, determine a fourth IP address of the second to-be-diagnosed entity node in the second network segment and a fifth IP address of the vehicle gateway in the second network segment, 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] a second vehicle diagnosis module configured to perform a vehicle diagnosis operation corresponding to the second entity node to be diagnosed based on the second communication connection and the third communication connection.
[0036] In a third aspect, the present application provides an electronic device, comprising:
[0037] a memory configured to store a computer program;
[0038] a processor configured to execute the computer program to implement the vehicle diagnosis method based on multiple network segments.
[0039] In a fourth aspect, the present application provides a computer readable storage medium configured to store a computer program, wherein the computer program is executed by a processor to implement the vehicle diagnosis method based on multiple network segments.
[0040] The present application establishes a first communication link with a vehicle to be diagnosed and a second communication link with a target computer respectively; the target computer is a computer connected with the diagnosis device; a first IP address of the first network segment is allocated to the target computer based on a preset network protocol and the second communication link, and a second IP address of the first network segment is allocated to a vehicle gateway of the vehicle to be diagnosed by using the first communication link, static network configuration is performed on the target computer to obtain a third IP address of the second network segment of the target computer, and it is determined whether switching from the first network segment to the second network segment for vehicle diagnosis is needed; if not, a first communication connection between the first IP address and the second IP address is established, and a vehicle diagnosis operation corresponding to a first entity node to be diagnosed is performed based on the first communication connection; the first entity node to be diagnosed is in the first network segment; if switching is needed, an instruction packet containing node information of a second entity node to be diagnosed is sent to the vehicle gateway, so that the vehicle gateway modifies the internal diagnosis communication architecture based on the instruction packet to obtain a modified communication architecture; the second entity node to be diagnosed is in the second network segment; the first communication connection is disconnected, and a fourth IP address of the second entity node to be diagnosed in the second network segment and a fifth IP address of the vehicle gateway in the second network segment are determined, 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 are established based on the modified communication architecture; and a vehicle diagnosis operation corresponding to the second entity node to be diagnosed is performed based on the second communication connection and the third communication connection.
[0041] As can be seen, the application first allocates an IP address in the first network segment to the target computer and the vehicle gateway, to establish a first communication connection, and judges whether it is necessary to switch from the first network segment to the second network segment for vehicle diagnosis. When no switching is needed, the diagnosis device and the first to-be-diagnosed entity node are directly communicated through the first communication connection. When switching is needed, an instruction message containing the second to-be-diagnosed entity node is sent to the vehicle gateway, so that the vehicle gateway modifies the internal diagnosis communication architecture based on the instruction message, and after the first communication connection is disconnected, the IP addresses of the second to-be-diagnosed entity node and the vehicle gateway in the second network segment are determined, and a second communication connection and a third communication connection with the target computer are established. In this way, the vehicle diagnosis operation corresponding to the second to-be-diagnosed entity node is performed through the second communication connection and the third communication connection. This flexible network segment switching mechanism enables the diagnosis device to adapt to the communication requirements of the internal entity nodes of the vehicle under different network segments, breaks through the limitation of a single network segment, and thus obtains various diagnosis data of the vehicle under different network segments, and realizes more comprehensive and in-depth diagnosis of the vehicle. BRIEF DESCRIPTION OF DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or the prior art description. Obviously, the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor based on the provided drawings.
[0043] Figure 1 A flow chart of a vehicle diagnosis method based on multiple network segments disclosed by the present application;
[0044] Figure 2 A first IP address allocation schematic diagram disclosed by the present application;
[0045] Figure 3 An IP address allocation schematic diagram of different network segments disclosed by the present application;
[0046] Figure 4 A specific vehicle diagnosis method based on multiple network segments disclosed by the present application;
[0047] Figure 5 A network adaptation requirement schematic diagram disclosed by the present application;
[0048] Figure 6 A vehicle diagnosis device structure schematic diagram based on multiple network segments disclosed by the present application;
[0049] Figure 7 An electronic device structure diagram disclosed by the present application. DETAILED DESCRIPTION
[0050] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative effort belong to the scope of protection of the present application.
[0051] Currently, there are multiple different network segments in a vehicle network, and different network segments can have different communication protocols and characteristics. In some cases, direct connection communication between devices in the same network segment can significantly improve the diagnosis efficiency and reduce communication delay and intermediate links. However, this puts higher requirements on the diagnostic instrument, which needs to support communication of different network segments in order to flexibly interact with each device in the vehicle. To this end, the present application provides a vehicle diagnosis method based on multiple network segments, which uses a second communication connection and a third communication connection to perform a vehicle diagnosis operation corresponding to a second to-be-diagnosed entity node. This flexible network segment switching mechanism enables the diagnosis device to adapt to the communication needs of the entity nodes inside the vehicle under different network segments, breaking through the limitations of a single network segment, and thereby obtaining various diagnosis data of the vehicle under different network segments, and realizing more comprehensive and in-depth diagnosis of the vehicle.
[0052] Referring to Figure 1 The embodiment of the present application discloses a vehicle diagnosis method based on multiple network segments, applied to a diagnosis device, comprising:
[0053] Step S11, respectively establishing a first communication link with a to-be-diagnosed vehicle and a second communication link with a target computer; the target computer is a computer connected with the diagnosis device.
[0054] In this embodiment, the diagnosis device is connected with the OBD (On Board Diagnostics, i.e. vehicle self-diagnosis system) interface of the to-be-diagnosed vehicle to obtain a first communication link, then a computer connected with the diagnosis device is determined as a target computer, and the diagnosis device is connected with the target computer by using a network cable or a USB interface to obtain a second communication link. Specifically, the step of respectively establishing a first communication link with a to-be-diagnosed vehicle and a second communication link with a target computer comprises: establishing a first communication link with the to-be-diagnosed vehicle based on the OBD interface of the to-be-diagnosed vehicle; determining a computer connected with the diagnosis device as a target computer, and establishing a second communication link with the target computer by using a network cable or a USB interface.
[0055] In step S12, a first IP address in the first network segment is allocated to the target computer based on a preset network protocol and the second communication link, and a second IP address in the first network segment is allocated 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 in the second network segment, and it is determined whether switching from the first network segment to the second network segment is needed for vehicle diagnosis.
[0056] In this embodiment, after the first communication link and the second communication link are obtained, a first IP address in the first network segment is allocated to the network adapter corresponding to the target computer based on the second communication link and using a dynamic host configuration protocol (DHCP), Figure 2 A first IP address allocation diagram is provided for this embodiment, in which the value corresponding to the IPv4 address is equivalent to the first IP address, and the DHCP is in an enabled state at this time. Then, a second IP address in the first network segment is allocated to the vehicle gateway of the vehicle to be diagnosed based on the first communication link and using the dynamic host configuration protocol, and the first IP address of the target computer is modified to an IP added by static setting supporting multiple networks to obtain a third IP address of the target computer in the second network segment. Figure 3 A different network segment IP address allocation diagram is provided for this embodiment, in which 192.168.100.150 is equivalent to the first IP address of the target computer in the first network segment; and 192.168.200.150 is equivalent to the third IP address of the target computer in the second network segment, i.e., the target computer has corresponding IP addresses in the first network segment and the second network segment.
[0057] Specifically, the first IP address in the first network segment is allocated to the target computer based on a preset network protocol and the second communication link, and the second IP address in the first network segment is allocated 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 in the second network segment, including: a first IP address in the first network segment is allocated to the network adapter corresponding to the target computer based on a dynamic host configuration protocol and the second communication link; a second IP address in the first network segment is allocated to the vehicle gateway of the vehicle to be diagnosed based on the dynamic host configuration protocol and the first communication link, and static network configuration is performed on the target computer to obtain a third IP address of the target computer in the second network segment.
[0058] If no switching is needed, a first communication connection between the first IP address and the second IP address is established, and a vehicle diagnosis operation corresponding to a first to-be-diagnosed entity node is performed based on the first communication connection; the first to-be-diagnosed entity node is in the first network segment.
[0059] In this embodiment, if no switching from the first network segment to the second network segment is needed for vehicle diagnosis, DoIP (Diagnostic over Internet Protocol) vehicle identification is performed on the to-be-diagnosed vehicle based on the target computer, a TCP (Transmission Control Protocol) connection, i.e., a first communication connection, between the first IP address and the second IP address is established based on an identification result, then a diagnosis message containing diagnosis requirements is sent to the vehicle gateway based on the first communication connection and by using the target computer, so that after the vehicle gateway receives the diagnosis message, a forwarding path is determined by using a target address in the diagnosis message, and the diagnosis message is forwarded to a DoIP entity node in the first network segment, i.e., a first to-be-diagnosed entity node, based on the forwarding path, so as to perform a vehicle diagnosis operation corresponding to the first to-be-diagnosed entity node.
[0060] Specifically, if no switching is needed, a first communication connection between the first IP address and the second IP address is established based on the target computer and by using a preset vehicle diagnosis protocol to identify the to-be-diagnosed vehicle based on an identification result, a diagnosis message containing diagnosis requirements is sent to the vehicle gateway based on the first communication connection and by using the target computer, so that the vehicle gateway determines a forwarding path by using a target address in the diagnosis message, and forwards the diagnosis message to a first to-be-diagnosed entity node in the first network segment based on the forwarding path, so as to perform a corresponding vehicle diagnosis operation.
[0061] If switching is needed, an instruction message containing node information of a second to-be-diagnosed entity node is sent to the vehicle gateway, so that the vehicle gateway modifies an internal diagnosis communication architecture based on the instruction message to obtain a modified communication architecture; the second to-be-diagnosed entity node is in the second network segment.
[0062] In the embodiment, different DoIP entity nodes inside the vehicle to be diagnosed can be in different network segments, but some deep diagnosis operations require direct connection of the target computer and the corresponding target DoIP entity node; the target DoIP entity node is equivalent to a target ECU; the deep diagnosis operation includes flashing. Therefore, when it is necessary to switch network segments for vehicle diagnosis, an instruction message containing the EID of the second to-be-diagnosed entity node that needs to communicate is sent to the vehicle gateway, so that the vehicle gateway modifies the connection settings in the internal routing table based on the message content in the instruction message, so that the vehicle gateway can be directly connected with the second to-be-diagnosed entity node to obtain a modified communication architecture.
[0063] Specifically, if it is necessary to switch, an instruction message containing node information of the second to-be-diagnosed entity node is sent to the vehicle gateway, so that the vehicle gateway modifies the internal diagnosis communication architecture based on the instruction message to obtain a modified communication architecture, including: if it is necessary to switch network segments for vehicle diagnosis, an instruction message containing unique identification information of the second to-be-diagnosed entity node that needs to communicate is sent to the vehicle gateway, so that the vehicle gateway modifies the connection settings in the internal routing table based on the instruction message to obtain a modified communication architecture.
[0064] In step S15, the first communication connection is disconnected, and it is determined that the second to-be-diagnosed entity node is located at a fourth IP address of the second network segment and the vehicle gateway is located at a fifth IP address of the second network segment, 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 are established based on the modified communication architecture.
[0065] In the embodiment, when it is necessary to connect with the second to-be-diagnosed entity node in the second network segment, the first communication connection needs to be disconnected to prepare for the connection with the second to-be-diagnosed entity node. Then, it is determined that the second to-be-diagnosed entity node is located at a fourth IP address of the second network segment and the vehicle gateway is located at a fifth IP address of the second network segment; a second communication connection between the third IP address and the fourth IP address is established based on a preset handshaking mechanism of the TCP protocol. When functional addressing is performed, a third communication connection between the third IP address and the fifth IP address is established based on the functional addressing logic in the DoIP and the modified communication architecture, and the diagnosis message sent relies on network layer routing and transport layer TCP reliable transmission to realize diagnosis interaction with the second to-be-diagnosed entity node and the gateway node.
[0066] Specifically, the first communication connection is disconnected, and the fourth IP address of the second to-be-diagnosed entity node located in the second network segment and the fifth IP address of the vehicle gateway located in the second network segment are determined, 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 are established based on the modified communication architecture, and the method comprises the following steps: the first communication connection is disconnected, and the fourth IP address of the second to-be-diagnosed entity node located in the second network segment and the fifth IP address of the vehicle gateway located in the second network segment are determined; the connection permission with the second to-be-diagnosed entity node is determined based on the modified communication architecture, and 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 are established by using the connection permission.
[0067] In step S16, vehicle diagnosis operation corresponding to the second to-be-diagnosed entity node is performed based on the second communication connection and the third communication connection.
[0068] In this embodiment, after the in-depth diagnosis of the to-be-diagnosed vehicle is performed, it is necessary to restore the vehicle gateway to the original forwarding rule, at this time, the service packet including the logical address of the second to-be-diagnosed entity node is sent to the fifth IP address by using the third IP address, so as to trigger the configuration recovery mechanism inside the vehicle gateway, and the second communication connection and the third communication connection are closed, and then, based on the network layer address configuration, the connection between the first IP address and the second IP address can be re-established, and the original communication mode is restored. Specifically, after the vehicle diagnosis operation corresponding to the second to-be-diagnosed entity node is performed based on the second communication connection and the third communication connection, the service packet including the logical address of the second to-be-diagnosed entity node is sent to the fifth IP address by 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 based on the service packet in sequence, and the first communication connection is restored.
[0069] As can be seen from the above, the application first allocates an IP address in the first network segment to the target computer and the vehicle gateway, to establish a first communication connection, and judges whether it is necessary to switch from the first network segment to the second network segment for vehicle diagnosis. When no switching is needed, the diagnosis device and the first to-be-diagnosed entity node are directly communicated through the first communication connection. When switching is needed, an instruction message containing the second to-be-diagnosed entity node is sent to the vehicle gateway, so that the vehicle gateway modifies the internal diagnosis communication architecture based on the instruction message, and after the first communication connection is disconnected, the IP addresses of the second to-be-diagnosed entity node and the vehicle gateway in the second network segment are determined, and a second communication connection and a third communication connection with the target computer are established. In this way, the vehicle diagnosis operation corresponding to the second to-be-diagnosed entity node is performed by using the second communication connection and the third communication connection. This flexible network segment switching mechanism enables the diagnosis device to adapt to the communication requirements of the internal entity nodes of the vehicle in different network segments, breaks through the limitation of a single network segment, and thus obtains various diagnosis data of the vehicle in different network segments, and realizes more comprehensive and in-depth diagnosis of the vehicle.
[0070] As can be seen from the above embodiment, the application establishes a connection of multiple network segments based on IP allocation to meet the diagnosis communication requirements of the internal entity nodes of the vehicle in different network segments. Therefore, the process of establishing a connection of multiple network segments based on IP allocation is described.
[0071] Referring to Figure 4 The embodiment of the application discloses a specific vehicle diagnosis method based on multiple network segments, applied to a diagnosis device, comprising:
[0072] In this embodiment, the diagnosis of the to-be-diagnosed vehicle often involves cross-network segment communication, so it is necessary to enable the network adapter of the diagnosis device to support dual-network segment IP. Figure 5 A network adapter requirement diagram is provided for this embodiment, all network adapter information of a target computer corresponding to the to-be-diagnosed vehicle is obtained, a target network adapter corresponding to the diagnosis device is determined based on the network adapter information and by sending and receiving messages, and then a first IP address of the target network adapter is recorded. The first IP address is equivalent to IP1 in Figure 4 , that is, 192.168.X.151. Then it is checked whether the first IP address is an IP address allocated by DHCP. If the first IP address is an IP address allocated by DHCP, DHCP automatic allocation is changed to manual allocation to fix the address of the first IP address. If DHCP automatic allocation is relied on, vehicle restart or network fluctuation may cause the change of the first IP address, and manual fixing can avoid 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 4IP3, i.e. 192.168.Y.1; if the first IP address is not an IP address allocated by DHCP, it means that the required dual-segment IP address has been configured as required.
[0073] Then, the diagnostic device allocates a second IP address in the first network segment to the vehicle gateway of the vehicle to be diagnosed through DHCP, and determines whether to switch from the first network segment to the second network segment for vehicle diagnosis, wherein the first network segment is an X network segment, and the second network segment is a Y network segment; if not, a first communication connection is established between the first IP address and the second IP address based on the identification result; a diagnostic message containing diagnostic requirements is sent to the vehicle gateway by the target computer based on the first communication connection, so that the vehicle gateway determines a forwarding path based on the target address in the diagnostic message, and forwards the diagnostic message to a first entity node to be diagnosed in the first network segment, i.e. a DoIP entity node, based on the forwarding path, to perform corresponding vehicle diagnostic operation.
[0074] Further, if it is required to switch from the first network segment to the second network segment for vehicle diagnosis, an instruction message containing unique identification information of a second entity node to be diagnosed which needs to be communicated is sent to the vehicle gateway, so that the vehicle gateway modifies the connection settings in the internal routing table based on the instruction message to obtain a modified communication architecture, then disconnects the first communication connection, and determines a fourth IP address of the second entity node to be diagnosed in the second network segment, which is equivalent to Figure 4 IP4, i.e. 192.168.Y.201; determines a fifth IP address of the vehicle gateway in the second network segment, which is equivalent to Figure 4 IP5, i.e. 192.168.Y.2; determines the connection permission with the second entity node to be diagnosed based on the modified communication architecture, establishes 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 connection permission, to perform vehicle diagnostic operation 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, when the vehicle diagnosis needs to be switched from the first network segment to the second network segment, the third IP address is obtained based on the static setting of the first IP address of the target computer, then the fourth IP address of the second to-be-diagnosed entity node located in the second network segment and the fifth IP address of the vehicle gateway located in the second network segment are determined, 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 are based on, and the vehicle diagnosis operation corresponding to the second to-be-diagnosed entity node in the second network segment is performed. In this way, the diagnosis equipment can adapt to the communication needs of the internal entity nodes of the vehicle in different network segments, break through the limitation of a single network segment, and then obtain various diagnosis data of the vehicle in different network segments, so that one diagnosis equipment can be used for vehicle diagnosis of multiple different network architectures, thereby reducing the use and maintenance costs of the equipment and improving the utilization rate of the equipment.
[0076] Correspondingly, referring to Figure 6 The application further provides a vehicle diagnosis device based on multiple network segments, applied to a diagnosis equipment, comprising:
[0077] A communication link establishment module 11 is configured to establish a first communication link with a to-be-diagnosed vehicle and a second communication link with a target computer respectively; the target computer is a computer connected with the diagnosis equipment;
[0078] An IP address allocation module 12 is configured to allocate a first IP address of a first network segment to the target computer based on a preset network protocol and the second communication link, and allocate a second IP address of the first network segment to a vehicle gateway of the to-be-diagnosed vehicle by using the first communication link, to perform static network configuration on the target computer, so as to obtain a third IP address of the target computer located in a second network segment, and to determine whether the vehicle diagnosis needs to be switched from the first network segment to the second network segment;
[0079] A first vehicle diagnosis module 13 is configured to, if the switching is not needed, establish a first communication connection between the first IP address and the second IP address, and perform a vehicle diagnosis operation corresponding to a first to-be-diagnosed entity node based on the first communication connection; the first to-be-diagnosed entity node is located in the first network segment;
[0080] An architecture modification module 14 is configured to, if the switching is needed, send an instruction packet containing node information of a second to-be-diagnosed entity node to the vehicle gateway, so that the vehicle gateway modifies the internal diagnosis communication architecture based on the instruction packet to obtain a modified communication architecture; the second to-be-diagnosed entity node is located in the second network segment;
[0081] The connection establishing module 15 is configured to disconnect the first communication connection, determine a fourth IP address of the second to-be-diagnosed entity node located in the second network segment and a fifth IP address of the vehicle gateway located in the second network segment, 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 diagnosis module 16 is configured to perform a vehicle diagnosis operation corresponding to the second to-be-diagnosed entity node based on the second communication connection and the third communication connection.
[0083] As can be seen from the above, the application first allocates IP addresses located in the first network segment to the target computer and the vehicle gateway to establish the first communication connection, and determines whether it is necessary to switch from the first network segment to the second network segment for vehicle diagnosis. When it is not necessary to switch, the diagnosis device directly communicates with the first to-be-diagnosed entity node through the first communication connection. When it is necessary to switch, the instruction packet containing the second to-be-diagnosed entity node is sent to the vehicle gateway, so that the vehicle gateway modifies the internal diagnosis communication architecture based on the instruction packet, and after the first communication connection is disconnected, the IP addresses of the second to-be-diagnosed entity node and the vehicle gateway in the second network segment are determined, and the second communication connection and the third communication connection with the target computer are established. In this way, the second communication connection and the third communication connection are used to perform a vehicle diagnosis operation corresponding to the second to-be-diagnosed entity node. The flexible network segment switching mechanism enables the diagnosis device to adapt to the communication requirements of the entity nodes in the vehicle in different network segments, breaks through the limitation of a single network segment, and thus obtains various diagnosis data of the vehicle in different network segments, and realizes more comprehensive and in-depth diagnosis of the vehicle.
[0084] In some embodiments, the communication link establishing module 11 can specifically include:
[0085] The first link establishing unit is configured to establish a first communication link with the to-be-diagnosed vehicle based on an OBD interface of the to-be-diagnosed vehicle.
[0086] The second link establishing unit is configured to determine a computer connected with the diagnosis device as a target computer, and establish a second communication link with the target computer by using a network cable or a USB interface.
[0087] In some embodiments, the IP address allocating module 12 can specifically include:
[0088] The first address allocating unit is configured to allocate a first IP address located in the first network segment to a network adapter corresponding to the target computer based on a dynamic host configuration protocol and the second communication link.
[0089] a second address allocation unit configured to allocate a second IP address in the first network segment to a 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 in a second network segment.
[0090] In some embodiments, the first vehicle diagnosis module 13 can specifically include:
[0091] a first connection establishment unit configured to, if no switching is required, identify the vehicle to be diagnosed based on the target computer and using a preset vehicle diagnosis protocol, and to establish a first communication connection between the first IP address and the second IP address based on the identification result;
[0092] a diagnosis message sending unit configured to send a diagnosis message containing diagnosis requirements to the vehicle gateway based on the first communication connection and using the target computer, so that the vehicle gateway determines a forwarding path based on a target address in the diagnosis message, and forwards the diagnosis message to a first to-be-diagnosed entity node in the first network segment based on the forwarding path, to perform corresponding vehicle diagnosis operations.
[0093] In some embodiments, the architecture modification module 14 can specifically include:
[0094] a connection setting modification unit configured to, if switching of network segments is required for vehicle diagnosis, send an instruction message containing unique identification information of a second to-be-diagnosed entity node that needs to communicate to the vehicle gateway, so that the vehicle gateway modifies connection settings in an internal routing table based on the instruction message, to obtain a modified communication architecture.
[0095] In some embodiments, the connection establishment module 15 can specifically include:
[0096] an IP address determination unit configured to disconnect the first communication connection, and determine a fourth IP address of the second to-be-diagnosed entity node in the second network segment and a fifth IP address of the vehicle gateway in the second network segment;
[0097] a communication connection establishment unit configured to determine a connection permission with the second to-be-diagnosed entity node 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 using the connection permission.
[0098] In some embodiments, the second vehicle diagnosis module 16 can specifically include:
[0099] The connection breaking unit is configured to send a service packet including a logical address of the second to-be-diagnosed entity node to the fifth IP address by using the third IP address, so that the vehicle gateway where the fifth IP address is located breaks the second communication connection and the third communication connection in sequence based on the service packet, and restores the first communication connection.
[0100] Further, the embodiment of the present application further discloses an electronic device, Figure 7 is a structural diagram of an electronic device 20 according to an exemplary embodiment, and the content in the figure cannot be considered as any limitation on the use range of the present application. The electronic device 20 can 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 is configured to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the related steps in the multi-network segment-based vehicle diagnosis method disclosed in any of the preceding embodiments. In addition, the electronic device 20 in the embodiment can be an electronic computer.
[0101] In the embodiment, the power supply 23 is configured to provide working 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 followed by the communication interface 24 can be any communication protocol applicable to the technical solution of the present application, which is not limited here; the input / output interface 25 is configured to obtain external input data or output data to the outside, and the specific interface type can be selected according to the specific application needs, which is not limited here.
[0102] In addition, the memory 22 as a carrier for resource storage can be a read-only memory, a random access memory, a magnetic disk or an optical disk, and the resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage mode can be temporary storage or permanent storage.
[0103] The operating system 221 is configured to manage and control each hardware device on the electronic device 20 and the computer program 222, and can be Windows Server, Netware, Unix, Linux, etc. The computer program 222 can further include computer programs for completing other specific work in addition to the computer programs for completing the multi-network segment-based vehicle diagnosis method executed by the electronic device 20 disclosed in any of the preceding embodiments.
[0104] Further, the application also discloses a computer readable storage medium for storing a computer program, wherein the computer program is executed by a processor to realize the multi-network segment based vehicle diagnosis method disclosed above. For the specific steps of the method, refer to the corresponding content disclosed in the foregoing embodiments, which will not be repeated here.
[0105] The various embodiments are described in the specification by way of progression, each building on the last to facilitate ease of understanding. The same or similar reference numerals are used in the drawings and the specification to identify elements with the same or similar function in the embodiments. The drawings and specification are like the embodiments disclosed in the foregoing, and a detailed description will not be repeated here.
[0106] Those skilled in the art will further appreciate that the units and algorithm steps of the examples described in connection 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 disclosure has generally been described in terms of its functionality as opposed to its structural implementation. Whether such functionality is implemented in hardware or software depends on the particular application and design constraints imposed on the overall system. Skilled artisans recognize the interchangeability of these two implementations. The disclosure is not limited to the described implementations.
[0107] The steps of a method or algorithm described in connection with the embodiments disclosed herein can be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module can reside in random access memory (RAM), flash memory, read-only memory (ROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0108] Finally, it needs to be pointed out that in this document, the relationship terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between the entities or operations. Moreover, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. Without more limitations, the element defined by the statement "including a" does not exclude the presence of other identical elements in the process, method, article or device including the element.
[0109] The technical solutions provided by the present application are described in detail above, and the principles and implementation manners of the present application are described by using specific examples. The above description of the examples is only used to help understand the method of the present application and its core idea; meanwhile, for those skilled in the art, according to the idea of the present application, the specific implementation manners and application ranges will be changed, and the above description of the content of the specification should not be understood as a limitation on the present application.
Claims
1. A vehicle diagnostic method based on multiple network segments, characterized in that: Used in diagnostic equipment, including: Establishing 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; Assigning a first IP address located in a first network segment to the target computer based on a preset network protocol and the second communication link, assigning a second IP address located in the first network segment to a vehicle gateway of the vehicle to be diagnosed using the first communication link, performing static network configuration on the target computer to obtain a third IP address located in the second network segment of the target computer, and determining whether it is necessary to switch from the first network segment to the second network segment for vehicle diagnosis; If switching is not required, establishing a first communication connection between the first IP address and the second IP address, and performing a vehicle diagnostic operation corresponding to a first entity node to be diagnosed based on the first communication connection; the first entity node to be diagnosed is in the first network segment; If switching is required, a command message containing node information of the second entity node to be diagnosed is sent to the vehicle gateway, so that the vehicle gateway modifies the internal diagnostic communication architecture based on the command message to obtain a modified communication architecture; the second entity node to be diagnosed is located in the second network segment; Disconnecting the first communication connection, determining that the second entity node to be diagnosed is located at a fourth IP address in the second network segment and that the vehicle gateway is located at a fifth IP address 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; A vehicle diagnostic operation corresponding to the second entity node to be diagnosed is performed based on the second communication connection and the third communication connection.
2. The vehicle diagnosis method based on multiple network segments according to claim 1, characterized in that: The step of establishing a first communication link with the vehicle to be diagnosed and a second communication link with the target computer respectively includes: Establishing a first communication link with the vehicle to be diagnosed based on the OBD interface of the vehicle to be diagnosed; The computer connected to the diagnostic device is determined as the target computer, and a second communication link with the target computer is established using a network cable or a USB interface.
3. The vehicle diagnosis method based on multiple network segments according to claim 1, characterized in that: The method of allocating a first IP address located in a first network segment to the target computer based on a preset network protocol and the second communication link, allocating a second IP address located in the first network segment to a 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 located in the second network segment of the target computer includes: assigning a first IP address located in a first network segment to a network adapter corresponding to the target computer based on the Dynamic Host Configuration Protocol and the second communication link; 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 a 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.
4. The vehicle diagnosis method based on multiple network segments according to claim 1, characterized in that: If switching is not required, establishing a first communication connection between the first IP address and the second IP address, and performing a vehicle diagnostic operation corresponding to the first entity node to be diagnosed based on the first communication connection, including: If switching is not required, identifying the vehicle to be diagnosed 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 and using the target computer, a diagnostic message containing diagnostic requirements is sent to the vehicle gateway, so that the vehicle gateway uses the target address in the diagnostic message to determine a 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 to perform corresponding vehicle diagnostic operations.
5. The vehicle diagnosis method based on multiple network segments according to claim 1, characterized in that: If switching is required, a command message containing node information of the second entity node to be diagnosed is sent to the vehicle gateway, so that the vehicle gateway modifies the internal diagnostic communication architecture based on the command message to obtain a modified communication architecture, including: If it is necessary to switch the network segment for vehicle diagnosis, a command message containing the unique identification information of the second entity node to be diagnosed that needs to communicate will be sent to the vehicle gateway, so that the vehicle gateway can modify the connection settings in the internal routing table based on the command message to obtain the modified communication architecture.
6. The vehicle diagnosis method based on multiple network segments according to claim 1, characterized in that: The disconnecting the first communication connection, determining that the second entity node to be diagnosed is located at a fourth IP address of the second network segment and the vehicle gateway is located at a fifth IP address of 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 that the second entity node to be diagnosed is located at a fourth IP address of the second network segment and the vehicle gateway is located at a fifth IP address of the second network segment; Determine a connection permission with the second entity node to be diagnosed based on the modified communication architecture, 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.
7. The vehicle diagnosis method based on multiple network segments according to any one of claims 1 to 6, 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 service message including the logical address of the second entity node to be diagnosed is sent 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.
8. A vehicle diagnostic device based on multiple network segments, characterized in that: Used in diagnostic equipment, including: a communication link establishing module, configured to establish a first communication link with the vehicle to be diagnosed and a second communication link with a target computer; the target computer being a computer connected to the diagnostic device; an IP address allocation module, configured to allocate a first IP address located in a first network segment to the target computer based on a preset network protocol and the second communication link, allocate a second IP address located in the first network segment to a vehicle gateway of the vehicle to be diagnosed using the first communication link, perform static network configuration on the target computer to obtain a third IP address located in the second network segment of the target computer, and determine whether it is necessary to switch from the first network segment to the second network segment for vehicle diagnosis; a first vehicle diagnostic module, configured to establish a first communication connection between the first IP address and the second IP address if switching is not required, and perform a vehicle diagnostic operation corresponding to a 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; an architecture modification module, configured to, if switching is required, send a command message containing node information of a second entity node to be diagnosed to the vehicle gateway, so that the vehicle gateway modifies an internal diagnostic communication architecture based on the command message to obtain a modified communication architecture; the second entity node to be diagnosed is located in the second network segment; a connection establishing module, configured to disconnect the first communication connection, determine that the second entity node to be diagnosed is located at a fourth IP address in the second network segment and that the vehicle gateway is located at a fifth IP address in the second network segment, and establish, based on the modified communication architecture, 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; The second vehicle diagnostic module is configured to perform a vehicle diagnostic operation corresponding to the second physical node to be diagnosed based on the second communication connection and the third communication connection.
9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the multi-segment based vehicle diagnostic method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that Used to store a computer program, wherein when the computer program is executed by a processor, the multi-segment based vehicle diagnostic method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Vehicle communication method and system
CN112165438A
Vehicle diagnosis method and device, electronic equipment and computer readable storage medium
CN116781737A
DOIP remote diagnosis method and device based on cross-network segment communication, equipment and medium
CN117459553A
Vehicle networking system, method and device
CN118646769A
Message forwarding method, device, equipment and vehicle
CN119697293A