Vehicle diagnosis method and device, storage medium and electronic equipment
By monitoring the transmission control protocol ports in the gateway domain controller and activate the corresponding routes, the problem of complex routing configuration in the existing vehicle diagnostic solution is solved, and efficient communication conversion between the upper computer and the vehicle node is realized, which simplifies the network architecture.
Patent Information
- Application Number
- CN202411804329.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-03-04
AI Technical Summary
The existing vehicle diagnostic solutions require complex routing, resulting in complex network architecture and redundant, making it difficult to realize cross-network segment and cross-communication protocol communication conversion between the upper computer and the vehicle node.
By using the gateway domain controller to monitor the transmission control protocol port, determine the valid TCP connection, and activate the corresponding route, it realizes cross-network segment and cross-communication protocol communication conversion between the host computer and the vehicle node without configuring complex routing.
The network architecture is simplified, the complexity of routing configuration is reduced, and efficient communication conversion between the host computer and the vehicle node is realized, making the vehicle's network architecture more simple.
Smart Images

Figure CN119556680A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of automotive electronic technology, and in particular to a whole vehicle diagnosis method and device, a storage medium and an electronic device. Background Art
[0002] Existing vehicle diagnosis usually uses the CAN (FD) / Ethernet communication protocol through the on-board diagnostics system (OBD) diagnostic port to implement node diagnosis based on the ISO 14229 UDS (Road vehicles-Unified diagnostic Service) specification. Some models have also added diagnostic functions for each node initiated by the master control node through Over The Air (OTA) technology.
[0003] In order to meet the needs of cross-segment and cross-communication protocol communication conversion between the host computer and the vehicle nodes, as well as multi-path diagnosis scenarios, the current vehicle diagnosis solution requires the setting of complex routing, resulting in a complex and redundant network architecture. Summary of the invention
[0004] In view of this, an embodiment of the present invention provides a whole vehicle diagnosis method and device, a storage medium and an electronic device. The solution provided by the present invention should be used to realize cross-communication conversion between the host computer and the whole vehicle node by using a gateway domain controller, without configuring complex routing in the network architecture, making the network architecture more concise.
[0005] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:
[0006] A vehicle diagnostic method, applied to a gateway domain controller, comprising:
[0007] Monitoring a transmission control protocol port of the vehicle, and determining a valid TCP connection from the monitoring queue when a monitoring queue corresponding to the transmission control protocol port is not empty, wherein the monitoring queue is used to store the established TCP connection;
[0008] Determine connection information corresponding to the valid TCP connection;
[0009] Activating the routing of the host computer corresponding to the connection information, and activating the routing of the in-vehicle Ethernet node of the vehicle;
[0010] Receiving a diagnostic request sent by the host computer, and determining a target node in each of the in-vehicle Ethernet nodes based on the diagnostic request;
[0011] The diagnostic request is sent to the target node, and diagnostic response information of the target node is fed back to the host computer.
[0012] In the above method, optionally, determining a valid TCP connection from the listening queue includes:
[0013] Determine whether there is only one TCP connection in the listening queue;
[0014] If there is only one TCP connection in the listening queue, the TCP connection is determined as a valid TCP connection;
[0015] If there are multiple TCP connections in the listening queue, a preset diagnosis rule is applied to diagnose each of the TCP connections, and then a valid TCP connection is determined among the TCP connections.
[0016] In the above method, optionally, determining a target node in each of the in-vehicle Ethernet nodes based on the diagnostic request includes:
[0017] Obtaining a node logical address in the diagnosis request;
[0018] Determine a node IP address corresponding to the node logical address;
[0019] Based on the node IP address and the node logical address, a target node is determined in each of the in-vehicle Ethernet nodes.
[0020] In the above method, optionally, sending the diagnosis request to the target node includes:
[0021] Acquire a diagnostic path of the target node based on the node IP address;
[0022] The diagnostic request is sent to the target node based on the diagnostic path.
[0023] In the above method, optionally, the feeding back the diagnostic response information of the target node to the host computer includes:
[0024] When receiving the diagnostic response fed back by the target node within a preset response time, generating diagnostic response information based on the diagnostic response, and feeding back the diagnostic response information to the host computer;
[0025] When the diagnostic response fed back by the target node is not received within the response time, diagnostic response information indicating a response timeout is generated, and the diagnostic response information is fed back to the host computer.
[0026] A vehicle diagnostic device, applied to a gateway domain controller, comprising:
[0027] A monitoring module, used for monitoring a transmission control protocol port of a vehicle, and determining a valid TCP connection from the monitoring queue when a monitoring queue corresponding to the transmission control protocol port is not empty, wherein the monitoring queue is used for storing the established TCP connection;
[0028] A determination module, configured to determine connection information corresponding to the valid TCP connection;
[0029] An activation module, used to activate the routing of the host computer corresponding to the connection information, and to activate the routing of the in-vehicle Ethernet node of the vehicle;
[0030] A receiving module, used for receiving a diagnostic request sent by the host computer, and determining a target node in each of the in-vehicle Ethernet nodes based on the diagnostic request;
[0031] The feedback module is used to send the diagnosis request to the target node and feed back the diagnosis response information of the target node to the host computer.
[0032] In the above device, optionally, the monitoring module executes a process of determining a valid TCP connection from the monitoring queue, comprising:
[0033] Determine whether there is only one TCP connection in the listening queue;
[0034] If there is only one TCP connection in the listening queue, the TCP connection is determined as a valid TCP connection;
[0035] If there are multiple TCP connections in the listening queue, a preset diagnosis rule is applied to diagnose each of the TCP connections, and then a valid TCP connection is determined among the TCP connections.
[0036] In the above device, optionally, the receiving module executes a process of determining a target node in each of the in-vehicle Ethernet nodes based on the diagnostic request, comprising:
[0037] Obtaining a node logical address in the diagnosis request;
[0038] Determine a node IP address corresponding to the node logical address;
[0039] Based on the node IP address and the node logical address, a target node is determined in each of the in-vehicle Ethernet nodes.
[0040] In the above device, optionally, the feedback module executes a process of sending the diagnosis request to the target node, including:
[0041] Acquire a diagnostic path of the target node based on the node IP address;
[0042] The diagnostic request is sent to the target node based on the diagnostic path.
[0043] In the above device, optionally, the feedback module executes a process of feeding back the diagnostic response information of the target node to the host computer, comprising:
[0044] When receiving the diagnostic response fed back by the target node within a preset response time, generating diagnostic response information based on the diagnostic response, and feeding back the diagnostic response information to the host computer;
[0045] When the diagnostic response fed back by the target node is not received within the response time, diagnostic response information indicating a response timeout is generated, and the diagnostic response information is fed back to the host computer.
[0046] A storage medium includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the vehicle diagnosis method as described above.
[0047] An electronic device includes a memory and one or more instructions, wherein the one or more instructions are stored in the memory and are configured to be executed by one or more processors to perform the vehicle diagnosis method as described above.
[0048] Compared with the prior art, the present invention has the following advantages:
[0049] The present invention provides a whole vehicle diagnosis method and device, a storage medium and an electronic device, which are applied to a gateway domain controller, monitor the transmission control protocol port of the vehicle, and when the monitoring queue corresponding to the transmission control protocol port is not empty, determine the valid TCP connection from the monitoring queue, and the monitoring queue is used to save the established TCP connection; determine the connection information corresponding to the valid TCP connection; activate the routing of the host computer corresponding to the connection information, and activate the routing of the in-vehicle Ethernet node of the vehicle; receive the diagnostic request sent by the host computer, and determine the target node in each in-vehicle Ethernet node based on the diagnostic request; send the diagnostic request to the target node, and feed back the diagnostic response information of the target node to the host computer. The gateway domain controller realizes the communication conversion between the host computer and the nodes of the whole vehicle across network segments and communication protocols, and can realize the communication conversion between the host computer and the nodes of the whole vehicle without using complex routing configuration, making the network architecture of the vehicle more concise. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0051] Figure 1 A flow chart of a vehicle diagnostic method provided by an embodiment of the present invention;
[0052] Figure 2 A flow chart of a method for determining a target node in each in-vehicle Ethernet node based on a diagnostic request provided by an embodiment of the present invention;
[0053] Figure 3 A schematic diagram of a vehicle diagnostic network architecture provided by an embodiment of the present invention;
[0054] Figure 4 A schematic diagram of OBD diagnostic data provided by an embodiment of the present invention;
[0055] Figure 5 A schematic diagram of TBOX diagnostic data provided by an embodiment of the present invention;
[0056] Figure 6 A schematic diagram of local diagnostic data provided by an embodiment of the present invention;
[0057] Figure 7 Another flow chart of vehicle diagnosis provided by an embodiment of the present invention;
[0058] Figure 8 A schematic diagram of the structure of a vehicle diagnostic device provided by an embodiment of the present invention;
[0059] Fig. 9 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0060] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0061] In this application, the terms "comprises", "comprising" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element.
[0062] Terminology explanation:
[0063] GW: The full name of English is: gateway, which refers to the gateway (domain) controller, referred to as gateway, which mainly realizes the network data communication of the whole vehicle node;
[0064] Switch: A multi-port device with an internal structure of MAC+PHY. Its main function is to forward data between different ports. It also has a data interface for connecting to devices such as MCU or SoC. The port is usually described as T1_PORTx or TX_PORT;
[0065] CAN(FD): The full name in English is: Controller area network (with Flexible Data-Rate), (variable rate) controller area network, the physical medium is twisted pair, divided into CAN(FD)_H and CAN(FD)_L, CAN(FD)n_NODEx means the ECU node x connected to the nth CAN(FD) network;
[0066] LIN: The full name in English is: Local Interconnect Network, local interconnect network, the physical medium is single-line serial transmission;
[0067] ETH: The full name in English is Ethernet. T1 refers to vehicle Ethernet. Ethernet nodes are interconnected through themselves or gateway switches. TX is conventional Ethernet, which is generally deployed on the gateway and directly connected to external diagnostic equipment through the external OBD port.
[0068] OBD port: OBD (On-Board Diagnostics) port is the port of the vehicle's automatic diagnostic system.
[0069] In the traditional vehicle diagnosis method, multiple communication protocols such as CAN (FD) / LIN / Ethernet are involved. In the network architecture design, it is necessary to consider the communication conversion between cross-segment and cross-communication protocols, and it will involve multi-path diagnosis scenarios. There may be multiple diagnostic paths for nodes, or even different standard communication protocols. The priority arbitration of diagnosis will be more complicated, and the routing configuration in the network architecture will be complicated.
[0070] In order to solve the above problems, the present invention provides a whole vehicle diagnosis solution applied to a gateway domain controller. The gateway domain controller can be connected to multiple Ethernet interfaces in the vehicle and converted to CAN (FD) / LIN through Ethernet, so that all nodes in the vehicle can be accessed. The gateway domain controller is used to monitor the transmission control protocol port, and the gateway domain controller is used as a communication converter and transfer station between the host computer and the nodes in the vehicle, thereby realizing the communication conversion between the host computer and the nodes in the vehicle across network segments and communication protocols, making the routing configuration of the whole vehicle network architecture more concise, and making the network architecture more concise.
[0071] The present invention can be used in many general or special computing device environments or configurations, such as personal computers, server computers, handheld or portable devices, tablet devices, multi-processor devices, distributed computing environments including any of the above devices or devices, etc.
[0072] The method provided by the present invention is applied to a gateway domain controller, which is located at each communication hub of the entire vehicle. Through the gateway domain controller, the TX (i.e., conventional Ethernet) of the OBD port can be directly connected, and other T1s (i.e., vehicle-mounted Ethernet) can also be connected. The inside of the gateway domain controller can be converted to CAN (FD) / LIN via Ethernet, so that the application can access any node of the entire vehicle.
[0073] Reference Figure 1 , is a flow chart of a vehicle diagnosis method provided by an embodiment of the present invention, and is specifically described as follows:
[0074] S101. Monitor the transmission control protocol port of the vehicle, and when the monitoring queue corresponding to the transmission control protocol port is not empty, determine a valid TCP connection from the monitoring queue, and the monitoring queue is used to store the established TCP connection.
[0075] It should be noted that the transmission control protocol port is the transmission control protocol (TCP, Transmission Control Protocol) port 13400.
[0076] The TCP connection is a TCP connection established by a three-way handshake between the client and the server.
[0077] In the process of monitoring the Transmission Control Protocol port, when a new TCP connection is established, the connection is stored in the monitoring queue.
[0078] The listening queue corresponding to the transmission control protocol port is not empty, for example: when a new TCP connection is established, if there is no TCP connection in the listening queue yet, the TCP connection is added to the listening queue, at which time there is only one TCP connection in the listening queue; if there is already a TCP connection in the listening queue, the TCP connection is added to the listening queue, at which time there are multiple TCP connections in the listening queue.
[0079] When the listening queue is not empty, the process of determining a valid TCP connection from the listening queue is as follows:
[0080] Determine if there is only one TCP connection in the listening queue;
[0081] If there is only one TCP connection in the listening queue, the TCP connection is determined as a valid TCP connection;
[0082] If there are multiple TCP connections in the listening queue, a preset diagnosis rule is applied to diagnose each TCP connection, and then a valid TCP connection is determined among the various TCP connections.
[0083] It should be noted that if there is only one TCP connection in the listening queue, the TCP connection is the currently established TCP connection, and the TCP connection is directly used as a valid TCP connection.
[0084] Applying preset diagnostic rules to diagnose each TCP connection is actually determining the priority of each TCP connection. The diagnostic rules of the present invention include content for priority judgment based on DoIP diagnostic specifications, and the TCP connection with the highest priority is regarded as a valid TCP connection.
[0085] Preferably, the TCP connection that is transmitting data is regarded as the TCP connection with the highest priority.
[0086] Exemplarily, an Alive check request can be sent to each TCP connection and a timeout timer can be started. If a response to the TCP connection feedback is received within the preset time, it is determined whether there are multiple TCP connections with feedback response. If there is only one, the TCP connection with feedback response is directly used as the valid TCP connection. If there are multiple, the TCP connection with feedback response is determined as the first connection, and the type of the host computer of each first connection is determined, and the first type corresponding to the type of the host computer with the highest priority is determined as the valid connection. If no response to the TCP connection feedback is received within the preset time, the TCP connection with the establishment time closest to the current time is used as the valid TCP connection.
[0087] The diagnostic rules of this solution can be implemented based on the ISO13400 specification to identify invalid connections or connections with higher priority. Furthermore, the diagnostic rules can be customized according to user needs. For example, the OBD port diagnosis has the highest priority. When the OBD port connection exists, a TCP connection can be initiated by other diagnostic initiators, but the diagnostic processing is refused and a corresponding response is given.
[0088] S102: Determine connection information corresponding to a valid TCP connection.
[0089] The connection information includes but is not limited to the information of the host computer of the valid TCP, such as IP, port number, logical address and other information.
[0090] S103: Activate the routing of the host computer corresponding to the connection information, and activate the routing of the in-vehicle Ethernet node of the vehicle.
[0091] The purpose of activating the route is to communicate with the host computer later, and it has communicated with the Ethernet node in the car.
[0092] S104: receiving a diagnostic request sent by the host computer, and determining a target node in each in-vehicle Ethernet node based on the diagnostic request.
[0093] Reference Figure 2 , is a flow chart of a method for determining a target node in each in-vehicle Ethernet node based on a diagnostic request provided by an embodiment of the present invention, and is specifically described as follows:
[0094] S201: Obtain a node logical address in a diagnosis request.
[0095] The diagnostic request is parsed to obtain the node logical address in the diagnostic request.
[0096] S202: Determine the node IP address corresponding to the node logical address.
[0097] It should be noted that the node logical address has a unique corresponding node IP address.
[0098] Furthermore, the node logical addresses and node IP addresses of all nodes in the vehicle are uniformly allocated and unique to the host computer.
[0099] S203 : Determine a target node in each in-vehicle Ethernet node based on the node IP address and the node logical address.
[0100] A unique node can be determined through the node IP address and the node logical address, and the node can be determined as the target node.
[0101] S105 , sending a diagnosis request to the target node, and feeding back the diagnosis response information of the target node to the upper computer.
[0102] When sending a diagnostic request to a target node, a diagnostic path of the target node is obtained based on the node IP address; the diagnostic request is sent to the target node based on the diagnostic path; thereby, the diagnostic request can be accurately sent to the target node.
[0103] After the diagnostic request is sent to the target node, a timeout timer is started. A time is preset in the timeout timer, which is the time for waiting for the target node to feedback a response. The preset time in the timeout timer can be understood as the preset response time; when a diagnostic response is received from the target node within the preset response time, diagnostic response information is generated based on the diagnostic response, and the diagnostic response information is fed back to the host computer; when no diagnostic response is received from the target node within the response time, diagnostic response information representing a response timeout is generated, and the diagnostic response information is fed back to the host computer.
[0104] Further, when no diagnostic response fed back by the target node is received within the response time, the generated diagnostic response information is negative diagnostic response information.
[0105] The method provided by the embodiment of the present invention is applied to a gateway domain controller, which monitors the transmission control protocol port of the vehicle. When the monitoring queue corresponding to the transmission control protocol port is not empty, a valid TCP connection is determined from the monitoring queue, and the monitoring queue is used to save the established TCP connection; the connection information corresponding to the valid TCP connection is determined; the routing of the host computer corresponding to the connection information is activated, and the routing of the in-vehicle Ethernet node of the vehicle is activated; the diagnostic request sent by the host computer is received, and the target node is determined in each in-vehicle Ethernet node based on the diagnostic request; the diagnostic request is sent to the target node, and the diagnostic response information of the target node is fed back to the host computer. The gateway domain controller realizes the communication conversion between the host computer and the nodes of the whole vehicle across network segments and communication protocols, and the communication conversion between the host computer and the nodes of the whole vehicle can be realized without using complex routing configuration, making the network architecture of the vehicle more concise.
[0106] Reference Figure 3 , which is a schematic diagram of the vehicle diagnostic network architecture provided in an embodiment of the present invention.
[0107] It should be noted that Figure 3In the network architecture diagram shown, the application can directly connect to the TX (conventional Ethernet) of the OBD port through the gateway domain controller switch, or it can connect to other T1 (vehicle Ethernet). The gateway domain controller can convert to CAN (FD) / LIN through Ethernet, so that the application can access any node of the vehicle. The application here is an application that can realize the vehicle diagnosis function described in this patent, and can diagnose all nodes of the vehicle (including itself) through Ethernet, and support multiple communication protocol conversion and path arrival programs.
[0108] Reference Figure 4 , which is a schematic diagram of OBD diagnostic data provided by an embodiment of the present invention; refer to Figure 5 , which is a schematic diagram of TBOX diagnostic data provided by an embodiment of the present invention; refer to Figure 6 , is a schematic diagram of local diagnostic data provided by an embodiment of the present invention.
[0109] Figures 3 to 6 For the explanations of abbreviations such as GW, Switch, CAN (FD), LIN, ETH, OBD, etc., please refer to the above term explanation section and will not be repeated here.
[0110] Figure 4-Figure 5 The following is an example diagram of the data flow of different types of diagnosis when diagnosing the entire vehicle. In the solution provided by the present invention, the gateway domain controller is located at each communication hub. According to the ISO13400 DoIP (Diagnostic communication over Internet Protocol) specification, the gateway domain controller monitors the data of port number 13400, so it can receive diagnostic requests from the gateway domain controller application OTA (Over-the-Air Technology) master, OBD (On-Board Diagnostics) Tester, and other nodes in the vehicle (such as TBOX). According to the data type, current working conditions and actual customer needs, diagnostic priority arbitration can be effectively implemented to avoid the scenario where the node needs to process multiple diagnostic requests at the same time.
[0111] Reference Figure 7 , which is another flow chart of vehicle diagnosis provided by an embodiment of the present invention, is specifically described as follows:
[0112] Step S01: The application completes system loading and startup, and completes initialization of related states and devices.
[0113] Step S02: As a server, listen to the Transmission Control Protocol (TCP) port 13400 and set the listening queue length (allowing multiple clients to establish a TCP connection with the server through a three-way handshake).
[0114] Step S03: After a new TCP connection is created, determine whether there is an existing connection. If not, the gateway domain controller initiates a TCP handshake with the Ethernet node in the vehicle. If so, diagnostic priority arbitration can be performed based on the DoIP specification by sending an Alive check request to the existing connection and starting a 500ms timeout timer. If no response is received after the timeout, the existing connection is closed and the current connection request is responded to. If it does not time out and a response is received, the current connection request is disconnected. Finally, the gateway domain controller updates the host computer information of the current connection.
[0115] Usually, OBD and the vehicle belong to different local area networks with different IP address segments. The gateway domain controller can support TCP handshake requests from the diagnostic instrument in two directions, from the OBD or other ECUs in the vehicle. In addition, the gateway domain controller also supports the 127.0.0.1 local loopback address, which is the application on the gateway domain controller. During the TCP handshake process, the type of the host computer can be determined by parsing the client IP address.
[0116] Step S04: Execute route activation between the host computer and the gateway domain controller according to the DoIP diagnostic specification. After completing route activation, the gateway domain controller successively completes route activation of nodes with established TCP connections in the vehicle, and records the route activation status of nodes in the vehicle that support the diagnosed ECU.
[0117] Step S05: Initiate a diagnostic request according to the host computer. Based on the DoIP diagnostic specification, the logical address of the target node needs to be specified in the diagnostic request. The logical addresses and IP addresses of all nodes in the vehicle are uniformly allocated and unique by the OEM. The logical address of the target node is obtained by parsing the diagnostic request, and the IP address of the node can be known based on the correspondence between the logical address and the IP address. The diagnostic path of the target node can be obtained based on the IP address, and the gateway domain controller can route the diagnostic request to the target node.
[0118] Step S06: Start the P6 timeout timer and wait for the receiving node to reply with a diagnostic response. If it does not time out, it is routed normally to the corresponding host computer; if it times out, the gateway domain controller replies with a diagnostic negative response to the host computer.
[0119] The present invention proposes a whole vehicle diagnosis implementation scheme, that is, compared with the traditional whole vehicle diagnosis system scheme, firstly, it can optimize the network architecture design and reduce some unnecessary routing relationships; secondly, except for the gateway domain controller, the diagnosis development of other nodes does not need to be iteratively updated according to the whole vehicle diagnosis architecture design, but only needs to maintain the application development and related routing development of the gateway domain controller; thirdly, the node access interface is reduced, and the node can no longer be accessed directly, but must be accessed through the gateway domain controller. While improving the information security protection level of the gateway domain controller, it can effectively improve the information security protection of the whole vehicle communication.
[0120] and Figure 1 Corresponding to the method shown, the present invention also provides a vehicle diagnostic device, which is applied to a gateway domain controller, and is used to support Figure 1 Specific implementation of the method shown.
[0121] Reference Figure 8 , is a structural schematic diagram of a whole vehicle diagnostic device provided in an embodiment of the present invention, and the specific description is as follows.
[0122] A monitoring module 301, used for monitoring a transmission control protocol port of a vehicle, and determining a valid TCP connection from the monitoring queue when a monitoring queue corresponding to the transmission control protocol port is not empty, wherein the monitoring queue is used for storing the established TCP connection;
[0123] A determination module 302, configured to determine connection information corresponding to the valid TCP connection;
[0124] An activation module 303, used to activate the routing of the host computer corresponding to the connection information, and to activate the routing of the in-vehicle Ethernet node of the vehicle;
[0125] The receiving module 304 is used to receive the diagnostic request sent by the host computer, and determine the target node in each of the in-vehicle Ethernet nodes based on the diagnostic request;
[0126] The feedback module 305 is used to send the diagnosis request to the target node and feed back the diagnosis response information of the target node to the host computer.
[0127] The device provided by the embodiment of the present invention is applied to the gateway domain controller, monitors the transmission control protocol port of the vehicle, and when the monitoring queue corresponding to the transmission control protocol port is not empty, determines the valid TCP connection from the monitoring queue, and the monitoring queue is used to save the established TCP connection; determines the connection information corresponding to the valid TCP connection; activates the routing of the host computer corresponding to the connection information, and activates the routing of the vehicle's in-vehicle Ethernet node; receives the diagnostic request sent by the host computer, and determines the target node in each in-vehicle Ethernet node based on the diagnostic request; sends the diagnostic request to the target node, and feeds back the diagnostic response information of the target node to the host computer. The gateway domain controller realizes the communication conversion between the host computer and the nodes of the whole vehicle across network segments and communication protocols, and can realize the communication conversion between the host computer and the nodes of the whole vehicle without using complex routing configuration, making the network architecture of the vehicle more concise.
[0128] In another embodiment provided by the present invention, the monitoring module 301 of the device performs a process of determining a valid TCP connection from the monitoring queue, including:
[0129] Determine whether there is only one TCP connection in the listening queue;
[0130] If there is only one TCP connection in the listening queue, the TCP connection is determined as a valid TCP connection;
[0131] If there are multiple TCP connections in the listening queue, a preset diagnosis rule is applied to diagnose each of the TCP connections, and then a valid TCP connection is determined among the TCP connections.
[0132] In another embodiment provided by the present invention, the receiving module 304 of the device performs a process of determining a target node in each of the in-vehicle Ethernet nodes based on the diagnostic request, including:
[0133] Obtaining a node logical address in the diagnosis request;
[0134] Determine a node IP address corresponding to the node logical address;
[0135] Based on the node IP address and the node logical address, a target node is determined in each of the in-vehicle Ethernet nodes.
[0136] In another embodiment provided by the present invention, the feedback module 305 of the device executes a process of sending the diagnosis request to the target node, including:
[0137] Acquire a diagnostic path of the target node based on the node IP address;
[0138] The diagnostic request is sent to the target node based on the diagnostic path.
[0139] In another embodiment provided by the present invention, the feedback module 305 of the device executes a process of feeding back the diagnostic response information of the target node to the host computer, including:
[0140] When receiving the diagnostic response fed back by the target node within a preset response time, generating diagnostic response information based on the diagnostic response, and feeding back the diagnostic response information to the host computer;
[0141] When the diagnostic response fed back by the target node is not received within the response time, diagnostic response information indicating a response timeout is generated, and the diagnostic response information is fed back to the host computer.
[0142] An embodiment of the present invention further provides a storage medium, which includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the above-mentioned vehicle diagnosis method.
[0143] The embodiment of the present invention further provides an electronic device, the structural diagram of which is shown in FIG. Fig. 9 As shown, it specifically includes a memory 601 and one or more instructions 602, wherein the one or more instructions 602 are stored in the memory 601 and are configured to be executed by one or more processors 603 to execute the one or more instructions 602 to perform the above-mentioned vehicle diagnosis method.
[0144] It should be noted that the information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0145] The specific implementation processes and derivative methods of the above-mentioned embodiments are all within the protection scope of the present invention.
[0146] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without creative work.
[0147] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0148] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A vehicle diagnostic method, characterized in that: Applies to gateway domain controllers, including: Monitoring a transmission control protocol port of the vehicle, and determining a valid TCP connection from the monitoring queue when a monitoring queue corresponding to the transmission control protocol port is not empty, wherein the monitoring queue is used to store the established TCP connection; Determine connection information corresponding to the valid TCP connection; Activating the routing of the host computer corresponding to the connection information, and activating the routing of the in-vehicle Ethernet node of the vehicle; Receiving a diagnostic request sent by the host computer, and determining a target node in each of the in-vehicle Ethernet nodes based on the diagnostic request; The diagnostic request is sent to the target node, and diagnostic response information of the target node is fed back to the host computer.
2. The method according to claim 1, characterized in that Determining a valid TCP connection from the listening queue includes: Determine whether there is only one TCP connection in the listening queue; If there is only one TCP connection in the listening queue, the TCP connection is determined as a valid TCP connection; If there are multiple TCP connections in the listening queue, a preset diagnosis rule is applied to diagnose each of the TCP connections, and then a valid TCP connection is determined among the TCP connections.
3. The method according to claim 1, characterized in that The step of determining a target node in each of the in-vehicle Ethernet nodes based on the diagnostic request includes: Obtaining a node logical address in the diagnosis request; Determine a node IP address corresponding to the node logical address; Based on the node IP address and the node logical address, a target node is determined in each of the in-vehicle Ethernet nodes.
4. The method according to claim 3, characterized in that: The sending the diagnostic request to the target node comprises: Acquire a diagnostic path of the target node based on the node IP address; The diagnostic request is sent to the target node based on the diagnostic path.
5. The method according to claim 1, characterized in that The feeding back the diagnostic response information of the target node to the host computer includes: When receiving the diagnostic response fed back by the target node within a preset response time, generating diagnostic response information based on the diagnostic response, and feeding back the diagnostic response information to the host computer; When the diagnostic response fed back by the target node is not received within the response time, diagnostic response information indicating a response timeout is generated, and the diagnostic response information is fed back to the host computer.
6. A vehicle diagnostic device, characterized in that: Applies to gateway domain controllers, including: A monitoring module, used for monitoring a transmission control protocol port of a vehicle, and determining a valid TCP connection from the monitoring queue when a monitoring queue corresponding to the transmission control protocol port is not empty, wherein the monitoring queue is used for storing the established TCP connection; A determination module, configured to determine connection information corresponding to the valid TCP connection; An activation module, used to activate the routing of the host computer corresponding to the connection information, and to activate the routing of the in-vehicle Ethernet node of the vehicle; A receiving module, used for receiving a diagnostic request sent by the host computer, and determining a target node in each of the in-vehicle Ethernet nodes based on the diagnostic request; The feedback module is used to send the diagnosis request to the target node and feed back the diagnosis response information of the target node to the host computer.
7. The device according to claim 6, characterized in that The monitoring module performs a process of determining a valid TCP connection from the monitoring queue, including: Determine whether there is only one TCP connection in the listening queue; If there is only one TCP connection in the listening queue, the TCP connection is determined as a valid TCP connection; If there are multiple TCP connections in the listening queue, a preset diagnosis rule is applied to diagnose each of the TCP connections, and then a valid TCP connection is determined among the TCP connections.
8. The device according to claim 6, characterized in that The receiving module executes a process of determining a target node in each of the in-vehicle Ethernet nodes based on the diagnostic request, including: Obtaining a node logical address in the diagnosis request; Determine a node IP address corresponding to the node logical address; Based on the node IP address and the node logical address, a target node is determined in each of the in-vehicle Ethernet nodes.
9. A storage medium, characterized in that: The storage medium includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the vehicle diagnosis method according to any one of claims 1 to 5.
10. An electronic device, characterized in that: It comprises a memory and one or more instructions, wherein the one or more instructions are stored in the memory and are configured to be executed by one or more processors to perform the vehicle diagnostic method as described in any one of claims 1-5.