Method for determining a vehicle communication failure and vehicle
By sending messages in the CAN network segment and detecting responses, combined with voltage and node location, the problem of locating faults in the CAN network segment is solved, improving the reliability of vehicle communication and maintenance efficiency.
Patent Information
- Application Number
- CN202611522065.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-29
- Publication Date
- 2026-11-24
AI Technical Summary
In existing technologies, fault information cannot be accurately located when there is a CAN network segment failure, resulting in poor vehicle communication reliability.
By sending the first message to the target network segment, detecting the number of response messages and voltage values, and combining this with node location information, the fault type and location are determined, including faults such as open circuits and short circuits.
Accurately locating the fault location and type improves the reliability of vehicle communication and maintenance efficiency.
Smart Images

Figure CN123164036A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of vehicle communication, and more specifically, to a method for determining vehicle communication faults and a vehicle in the field of vehicle communication. Background Technology
[0002] With the continuous improvement of vehicle electrification, in-vehicle networks, especially Controller Area Networks (CAN), are widely used in automotive electronic systems to achieve real-time communication and collaborative control between various Electronic Control Units (ECUs). However, in existing technologies, when a fault occurs in the CAN network segment, the fault cannot be located, resulting in poor reliability in the vehicle.
[0003] Therefore, accurately identifying fault information and improving the reliability of vehicle communication when a fault occurs in the CAN network segment is an urgent problem to be solved. Summary of the Invention
[0004] This application provides a method for determining vehicle communication faults and a vehicle. The method for determining vehicle communication faults can accurately identify fault information when a fault occurs in the CAN network segment, thereby improving the reliability of communication in the vehicle.
[0005] Firstly, a method for determining vehicle communication faults is provided, the method comprising: Send the first message to the target network segment; Detect whether a response packet corresponding to the first packet exists in the target network segment; If a response message exists in the target network segment, the fault information of the target network segment is obtained based on the number of response messages. The fault information of the target network segment is used to indicate the fault type and / or fault location of the target network segment. Based on the fault information of the target network segment, generate a fault identifier for the target network segment.
[0006] In the embodiments of this application, compared to the prior art where CAN bus cables cannot be detected by the ECU when they experience open circuits or short circuits, making it difficult for the ECU to effectively record fault codes and thus unable to accurately distinguish the fault type and location, causing difficulties for maintenance personnel in troubleshooting and quickly pinpointing the root cause of the fault, affecting the reliability of vehicle communication, this solution, after sending the first message to the target network segment, checks whether there is a corresponding response message in the target network segment. This can determine the communication response status of the nodes in the target network segment, distinguish whether it is a global loss, and determine whether there is a node communication anomaly in the target network segment. If there is a response message in the target network segment, the fault information of the target network segment is obtained based on the number of response messages, determining whether there is a node communication anomaly, thereby obtaining the fault information of the target network segment and determining the cause of the fault. Because this solution first distinguishes the case of a global loss, it can eliminate global faults of overall communication interruption. Then, for local faults, it accurately determines the fault location and fault type by combining the number of response messages and node location information, thereby improving the reliability of vehicle communication.
[0007] In conjunction with the first aspect, in some possible implementations, fault information of the target network segment is obtained based on the number of response packets, including: If the number of response messages is less than the first preset number, the fault information of the target network segment is obtained based on the location information of each node in the target network segment and the response messages. When the number of response messages is the first preset number, the fault information of the target network segment is obtained based on the voltage value of the level line in the target network segment.
[0008] In the embodiments of this application, if the number of response messages is less than the first preset number, it indicates that some nodes in the target network segment have failed to respond, i.e., there is a node communication abnormality. At this time, the location information of each node and the response messages are further combined to locate the cable breakage fault. If the number of response messages is the first preset number, the fault information of the target network segment is obtained based on the voltage value of the level line in the target network segment. Since the number of response messages is the first preset number, it indicates that all nodes in the target network segment can respond normally. At this time, there is no breakage caused by node loss. Furthermore, the voltage value of the level line can be used to determine whether a short circuit has occurred and the type of short circuit, thereby accurately diagnosing the cable short circuit fault.
[0009] Combining the first aspect and the above implementation methods, in some possible implementation methods, when the number of response messages is less than a first preset number, fault information of the target network segment is obtained based on the location information of each node in the target network segment and the response messages, including: Based on the response messages, identify the nodes in the target network segment that have not sent response messages; Based on the location information of each node in the target network segment, the first node is determined from the nodes in the target network segment that have not sent a response message. The first node is the node that is closest to the gateway among the nodes that have not sent a response message. The fault information of the target network segment is determined to be an open circuit between the first node and the second node, wherein the second node is adjacent to the first node.
[0010] In the embodiments of this application, a first node closest to the gateway is identified from the nodes that have not sent a response message, and the segment between this first node and its adjacent second node is determined as the break point. Since nodes closer to the gateway than the first node can respond normally, while the first node and subsequent nodes fail to respond, it can be determined that the cable break occurs between the first and second nodes. Compared to existing technologies that can only record node loss faults but cannot locate the specific break point, this solution can accurately locate the break point fault to the cable segment between two adjacent nodes, thereby providing a clear direction for troubleshooting, reducing the workload of troubleshooting, improving maintenance efficiency, and enhancing the reliability of vehicle communication.
[0011] Combining the first aspect and the above implementation methods, in some possible implementation methods, the target network segment includes a first level line and a second level line. When the number of response messages is a first preset number, fault information of the target network segment is obtained based on the voltage values of the level lines in the target network segment, including: The voltage difference is obtained based on the voltage values of the first and second level lines. If the detected voltage difference is less than the first preset voltage threshold within the preset acquisition period, the fault information of the target network segment is determined to be a short circuit between the first level line and the second level line.
[0012] In the embodiments of this application, when the number of response messages is a first preset number, all nodes in the target network segment can respond normally, and there is no open circuit fault caused by node loss. Further judgment is made based on the voltage difference between the first and second level lines within a preset sampling period. Since a short circuit between the first and second level lines is only determined when the voltage difference is consistently less than a first preset voltage threshold within the preset sampling period, misjudgments caused by transient interference or sampling errors can be avoided, improving the accuracy and reliability of short circuit fault detection. The above scheme can identify short circuit faults between the first and second level lines when node communication is normal, thereby achieving the diagnosis of open and short circuit faults and improving the reliability of vehicle communication and maintenance efficiency.
[0013] Combining the first aspect and the above implementation methods, in some possible implementation methods, when the number of response messages is a first preset number, fault information of the target network segment is obtained based on the voltage value of the level line in the target network segment, including: If the voltage values of all level lines in the target network segment are less than the first preset voltage threshold within the preset acquisition period, the fault information of the target network segment is determined to be a short circuit to ground of the level line. If the voltage values of all level lines in the target network segment are greater than the second preset voltage threshold within the preset acquisition period, the fault information of the target network segment is determined to be a short circuit between the level line and the power supply.
[0014] In the embodiments of this application, when the number of response messages is a first preset number, all nodes in the target network segment can respond normally, and there is no open circuit fault caused by node loss. Further, the voltage value of the level line is compared with a preset voltage threshold. Since a short circuit to ground is only determined when the level line voltage value is less than the first preset voltage threshold within a preset sampling period, and a short circuit to the power supply is only determined when it is greater than the second preset voltage threshold, misjudgments caused by transient interference or sampling errors can be avoided, accurately distinguishing between short circuits to ground and short circuits to the power supply. The above scheme can further accurately identify short circuits to ground or to the power supply when node communication is normal, thereby achieving comprehensive diagnosis of open circuit and short circuit faults, improving the reliability of vehicle communication and maintenance efficiency.
[0015] Combining the first aspect and the above implementation methods, among some possible implementation methods, the determination method also includes: Obtain the communication cycle of the target network segment; Based on the communication cycle, a preset acquisition cycle is obtained, and the duration of the preset acquisition cycle is greater than or equal to the communication cycle.
[0016] In the embodiments of this application, the communication cycle of the target network segment is obtained, and a preset acquisition cycle is determined based on the communication cycle, such that the duration of the preset acquisition cycle is greater than or equal to the communication cycle. Since the communication cycle reflects the duration of message transmission in the target network segment, at least one complete message communication process can be covered within the preset acquisition cycle. Therefore, the acquired voltage value can avoid only acquiring transient voltage due to an excessively short sampling period, leading to missed detection or misjudgment of short-circuit faults. The above scheme can adaptively determine the acquisition cycle by combining the communication cycle of the target network segment itself, so that the voltage sampling matches the actual communication process of the bus, thereby improving the accuracy and reliability of short-circuit fault detection.
[0017] Combining the first aspect and the above implementation methods, in some possible implementations, the target network segment includes a voltage sampling circuit, and the determination method further includes: Obtain the voltage value at the sampling point in the voltage sampling circuit; Based on the voltage division ratio of the voltage sampling circuit and the voltage value at the sampling point, the voltage value of the level line in the target network segment is obtained.
[0018] In the embodiments of this application, a voltage sampling circuit is set in the target network segment, and the voltage value of the sampling point in the voltage sampling circuit is obtained. Then, the actual voltage value of the level line is calculated based on the voltage division ratio of the voltage sampling circuit and the voltage value of the sampling point. Since voltage division sampling can obtain the voltage information of the level line, it will not interfere with the normal message communication of the target network segment, and can provide accurate level line voltage data for short circuit fault diagnosis. Therefore, this solution can accurately determine the fault and improve the reliability of vehicle communication and maintenance efficiency.
[0019] Combining the first aspect and the above implementation methods, in some possible implementations, the voltage sampling circuit includes a first resistor and a second resistor. Based on the voltage division ratio of the voltage sampling circuit and the voltage value at the sampling point, the voltage value of the level line in the target network segment is obtained, including: Determine the target resistance value based on the first resistor and the second resistor; Determine the voltage division ratio based on the target resistance and the first resistance; or... Determine the voltage division ratio based on the target resistance value and the second resistor; The first resistor is located between the sampling point and ground, and the second resistor is located between the sampling point and the power supply.
[0020] In the embodiments of this application, a voltage divider structure is formed by a first resistor and a second resistor, and a target resistance value is determined based on the two. Then, the voltage division ratio is determined according to the target resistance value and the first resistor or the second resistor. Since the first resistor is located between the sampling point and ground, and the second resistor is located between the sampling point and the power supply, the voltage on the level line can be sampled after being reduced according to the voltage division ratio. Without affecting the bus communication, the actual voltage value of the level line can be obtained through the voltage division ratio and the voltage value of the sampling point, thereby providing a reliable basis for accurately judging faults such as short circuits between level lines, short circuits to ground, or short circuits to the power supply.
[0021] Combining the first aspect and the above implementation methods, among some possible implementation methods, the determination method also includes: If no response message is found in the target network segment, obtain the bus status of the target network segment; When the bus status is not in the bus off state, the fault information of the target network segment is determined to be an open circuit between the gateway and the third node; The third node is the node in the target network segment that is closest to the gateway.
[0022] In the embodiments of this application, if there is no response message in the target network segment, it indicates that the target network segment may have experienced a global communication interruption. At this time, the bus status of the target network segment is obtained, and if the bus status is not in the bus-off state, the fault information of the target network segment is determined to be an open circuit between the gateway and the third node. Since the bus status is not in the bus-off state, it indicates that the gateway's own controller local area network controller can still work normally, and the network segment as a whole has no response, so the fault can be accurately located in the cable between the gateway and the third node closest to the gateway, thereby improving the accuracy of fault location and maintenance efficiency.
[0023] Secondly, a vehicle communication fault determination device is provided, the vehicle communication fault determination device comprising: The sending module is used to send the first message to the target network segment; The processing module is used to detect whether there is a response message corresponding to the first message in the target network segment; if there is a response message in the target network segment, it obtains the fault information of the target network segment based on the number of response messages, and the fault information of the target network segment is used to indicate the fault type and / or fault location of the target network segment; based on the fault information of the target network segment, it generates a fault identifier of the target network segment.
[0024] It should be understood that the extensions, limitations, explanations and descriptions of the relevant content in the first aspect above also apply to the same content in the second aspect.
[0025] Thirdly, a vehicle is provided, including a memory and a processor; the memory is used to store executable program code, and the processor is used to call and run the executable program code from the memory, causing the vehicle to perform the vehicle communication fault determination method in the first aspect or any possible implementation of the first aspect.
[0026] Fourthly, a computer program product is provided, comprising: computer program code, which, when run on a computer, causes the computer to execute the method for determining vehicle communication faults in the first aspect or any possible implementation thereof.
[0027] Fifthly, a computer-readable storage medium is provided that stores computer program code, which, when executed on a computer, causes the computer to perform the method for determining vehicle communication faults as described in the first aspect or any possible implementation thereof. Attached Figure Description
[0028] Figure 1 This is a schematic diagram of the topology of the controller local area network provided in the embodiments of this application; Figure 2This is a schematic diagram of another controller area network topology provided in an embodiment of this application; Figure 3 This is a schematic flowchart illustrating a method for determining vehicle communication faults provided in an embodiment of this application; Figure 4 This is a schematic diagram of another controller area network topology provided in an embodiment of this application; Figure 5 This is a schematic diagram of the topology of another controller area network provided in the embodiments of this application; Figure 6 This is a schematic flowchart of another method for determining vehicle communication faults provided in an embodiment of this application; Figure 7 This is a schematic flowchart illustrating another method for determining vehicle communication faults provided in an embodiment of this application; Figure 8 This is a schematic flowchart illustrating another method for determining vehicle communication faults provided in the embodiments of this application; Figure 9 This is a schematic diagram of the structure of a vehicle communication fault determination device provided in an embodiment of this application; Figure 10 This is a schematic diagram of the structure of a vehicle provided in an embodiment of this application. Detailed Implementation
[0029] The technical solutions in this application will be clearly and thoroughly described below with reference to the accompanying drawings. In the description of the embodiments of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B. "And / or" in the text is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Furthermore, in the description of the embodiments of this application, "multiple" refers to two or more than two.
[0030] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature.
[0031] Before introducing the methods of the embodiments of this application, the technical terms that may be involved in the embodiments of this application will be explained first.
[0032] CAN bus: also known as Controller Area Network, CAN network, or vehicle bus, is used to enable high-speed data exchange between various electronic control units within a vehicle. The data units transmitted in the CAN bus can be called CAN messages or CAN signals; for example, the CAN bus can use a communication rate of 500kbps.
[0033] ECU: Also known as Electronic Control Unit, Vehicle Controller, Automotive Microcomputer Controller, Network Node, etc., it is used to implement specific control, computing, or sensing functions within a vehicle and has the ability to communicate with the vehicle network. For example, an electronic control unit may include a microcontroller, memory, power management chip, and a physical layer interface connected to a bus.
[0034] Gateway: Also known as a communication gateway, vehicle gateway, or bus gateway, it is used for data forwarding, protocol conversion, and message management between different networks or buses. For example, a gateway may include a processor, memory, and a communication interface module to enable interconnection between the CAN bus and other buses.
[0035] Network segment: Also known as network area, bus segment, or communication segment, it is used to divide the controller area network bus into several parts to facilitate management and communication monitoring. For example, a network segment may include several ECU nodes connected under the same gateway.
[0036] Microcontroller Unit (MCU): Also known as a controller, microcontroller, or embedded processor, it is used to perform tasks such as vehicle control logic, data acquisition, and communication processing. For example, an MCU may include a transceiver module for CAN bus communication, a computing unit, and a storage module.
[0037] With the continuous improvement of vehicle electronics, in-vehicle networks, especially CAN bus, are widely used in automotive electronic systems to realize real-time communication and collaborative control between various ECUs.
[0038] Figure 1 This is a schematic diagram of the topology of the controller local area network provided in the embodiments of this application; as shown Figure 1 As shown, multiple ECUs can be connected via a CAN bus to form a CAN network segment, and a gateway connects multiple CAN network segments throughout the vehicle. Data sent by each ECU within the same network segment is mutually visible, while data exchange between ECUs in different network segments requires routing and forwarding through a gateway.
[0039] Figure 2 This is a schematic diagram of another controller local area network topology provided in an embodiment of this application; for example, as shown below. Figure 2As shown, the CAN bus consists of a pair of differential lines: a high-level line (i.e., the first level line) and a low-level line (i.e., the second level line). Each ECU integrates a transceiver and an MCU. The transceiver is responsible for bidirectional conversion between logic levels and differential physical signals: the transmitting end receives digital signals from the MCU and converts them into differential voltage signals to drive the bus; the receiving end monitors the differential voltage on the bus in real time and converts it into logic levels to feed back to the MCU, thus completing reliable data transmission and reception and bus arbitration functions. The MCU includes a CAN controller, which can be used for CAN bus data transmission, reception, error detection, and error frame transmission.
[0040] For example, when the Controller Area Network (CAN) bus uses differential signals for transmission, logic 1 corresponds to a recessive level, in which case the voltage of both the first and second level lines is 2.5V, and the voltage difference between them is 0V. Logic 0 corresponds to a dominant level, in which case the voltage of both the first and second level lines is 3.5V, and the voltage of both the first and second level lines is 1.5V, and the voltage difference between them is 2V. Through these differential voltage relationships, the CAN bus can reliably transmit messages.
[0041] However, in the existing technology, when a cable fault occurs on the CAN bus, such as a cable break between the gateway and the ECU, or between the various ECUs, or a short circuit between the first and second level lines, a short circuit between the first or second level line and the power supply, or a short circuit between the first or second level line and ground, the above cable faults cannot be detected by the CAN controller module inside the MCU. Therefore, the ECU cannot record the corresponding fault code, making it difficult for maintenance personnel to troubleshoot the problem and quickly pinpoint the cause of the fault, thus affecting the reliability of vehicle communication and maintenance efficiency.
[0042] In view of this, this application provides a method and vehicle for determining vehicle communication faults. Compared to existing technologies where CAN bus cable faults such as open circuits and short circuits cannot be detected by the ECU, making it difficult for the ECU to effectively record fault codes and accurately distinguish fault types and locations, causing difficulties for maintenance personnel in troubleshooting and quickly pinpointing the root cause of the fault, thus affecting the reliability of vehicle communication, this solution, after sending a first message to the target network segment, checks whether there is a corresponding response message in the target network segment. This allows for the determination of the communication response status of nodes in the target network segment, distinguishing between global loss cases to determine whether node communication anomalies have occurred in the target network segment. If response messages exist in the target network segment, the number of response messages is used to obtain fault information for the target network segment, determining whether node communication anomalies exist, thereby obtaining fault information for the target network segment and determining the cause of the fault. Because this solution first distinguishes between global loss cases, it can eliminate global faults causing overall communication interruption. Then, for local faults, it combines the number of response messages and node location information to accurately determine the fault location and fault type, thereby improving the reliability of vehicle communication.
[0043] The following is combined with Figure 3 This application provides a detailed description of a method for determining vehicle communication faults according to an embodiment.
[0044] Figure 3 This is a schematic flowchart illustrating a method for determining vehicle communication faults provided in an embodiment of this application. Figure 3 As shown, method 300 includes S301 to S304, which are described in detail below.
[0045] For example, Figure 3 The method 300 shown can be executed by the gateway in the vehicle.
[0046] Optionally, Figure 3 The method 300 shown can also be executed by a vehicle; or by a microcontroller unit in the vehicle; or by a software platform in an electronic device integrated in the vehicle; or by a hardware or software module integrated in a gateway.
[0047] S301, send the first message to the target network segment.
[0048] The first message, also known as a diagnostic message, probe message, query message, or test message, is a message sent by the gateway to the target network segment to trigger responses from the nodes in the target network segment.
[0049] For example, the first message may be a controller local area network data frame actively constructed and sent by the gateway, whose identifier may be a pre-agreed diagnostic identifier, and whose data field may contain enabling information for instructing each node in the target network segment to respond; the first message may also be any frame sent by the gateway during normal communication.
[0050] In the embodiments of this application, when the gateway needs to diagnose communication faults in the target network segment, it sends a first message to the target network segment. The first message is used to trigger each node in the target network segment to acknowledge receipt of the first message. After the first message is sent, the gateway checks whether there is a response message corresponding to the first message in the target network segment to determine whether any node in the target network segment has successfully received the first message, thereby providing a basis for determining the fault type and / or fault location of the target network segment based on the number of response messages.
[0051] In one possible implementation, the first message can be a message that the gateway periodically sends during normal communication, or a diagnostic message that the gateway actively sends when it detects a possible fault in the target network segment.
[0052] It should be understood that the timing of sending the first message can be flexibly set according to diagnostic needs, such as sending it after the vehicle is woken up and the gateway is initialized, or sending it when a communication anomaly is detected in the target network segment.
[0053] In one possible implementation, the identifier of the first message can be set to a broadcast message that all nodes in the target network segment must receive, so that all nodes in the target network segment will respond to the first message, thereby improving the statistical completeness of the number of response messages. The first message can be sent once or multiple times. When it is sent multiple times, the gateway can combine the corresponding response information from multiple transmissions to improve the accuracy of the diagnostic results.
[0054] In one possible implementation, the gateway can determine whether the target network segment is idle before sending the first message. If the target network segment is idle, the gateway then sends the first message to avoid bus arbitration conflicts between the first message sent by the gateway and messages being sent by other nodes in the target network segment, thereby ensuring the reliability of the diagnostic process.
[0055] S302, detect whether there is a response message corresponding to the first message in the target network segment.
[0056] Response message: Also known as response flag, acknowledgment response, or response information, it is used to indicate the dominant level sent by a node in the target network segment in the response bit after successfully receiving the first message sent by the gateway, or to reply with a response frame.
[0057] For example, in a controller area network protocol, after the receiving node correctly receives a message, it will send a dominant level in the acknowledgment bit to cover the recessive level sent by the sending node. This dominant level is the acknowledgment flag bit.
[0058] In the embodiments of this application, after the gateway sends the first message to the target network segment, it checks whether there is a response message corresponding to the first message in the target network segment.
[0059] The aforementioned detection may include: detecting whether there is a dominant level in the acknowledgment bit of the first message, or detecting whether an independent acknowledgment frame for the first message appears in the target network segment; if an acknowledgment message is detected, it is determined that a node in the target network segment has successfully received the first message; if no acknowledgment message is detected, it is determined that no node in the target network segment has successfully received the first message, thereby providing a basis for determining the fault information of the target network segment based on the number of acknowledgment messages or the bus status.
[0060] In one possible implementation, the gateway can detect the acknowledgment bit level when sending the first message via the controller local area network controller. For example, the sending node (i.e., the gateway) sends a recessive level in the acknowledgment bit, while the receiving nodes (i.e., the various ECUs in the network segment) send a dominant level in the acknowledgment bit if they correctly receive the message, overriding the recessive level of the sending node. If the gateway detects a dominant level in the acknowledgment bit, it determines that an acknowledgment message exists; if it detects a recessive level in the acknowledgment bit, it determines that no acknowledgment message exists.
[0061] In one possible implementation, the gateway can determine the existence of a response message by detecting whether an independent response frame appears in the target network segment. An independent response frame can be a message sent by a node to the gateway after receiving the first message, according to a preset identifier and preset data format. The gateway listens on the bus for a preset waiting time after sending the first message. If it receives an independent response frame, it determines that a response message exists and can further determine the identity of the node that sent the response message based on the identifier or data content of the independent response frame.
[0062] For example, suppose the gateway is connected to network segment 1, and ECU1, ECU2 and ECU3 are connected to network segment 1. After the gateway sends the first message to network segment 1, it detects the level of the acknowledgment bit of the first message. If a dominant level is detected in the acknowledgment bit, it is determined that at least one node in network segment 1 has successfully received and acknowledged the first message. If a recessive level is detected in the acknowledgment bit, it is determined that no node in network segment 1 has successfully received and acknowledged the first message.
[0063] Furthermore, the gateway listens to the bus within a preset waiting time. If it receives independent response frames from ECU1 and ECU2 respectively, but does not receive a response frame from ECU3, it determines that there is a response message corresponding to the first message.
[0064] In one possible implementation, the gateway can record the reception time of the response message when detecting it. By comparing the reception time with the transmission time of the first message, the response time of the response message can be determined. If the response time exceeds a preset threshold, it indicates that there may be communication delays or abnormal node responses in the target network segment, and further analysis using voltage sampling values can be used to determine if there is a cable fault.
[0065] In one possible implementation, the gateway can detect the presence of a response message within a preset waiting time after sending the first message. The preset waiting time can be determined based on the communication rate of the target network segment, the message length, and the bus load. For example, in a controller area network segment with a communication rate of 500kbps, the preset waiting time can be set to match the transmission time of a single message frame to ensure that the gateway does not prematurely determine that there is no response before the response message arrives.
[0066] In one implementation, the determination method further includes: If no response message is found in the target network segment, obtain the bus status of the target network segment; When the bus status is not in the bus off state, the fault information of the target network segment is determined to be an open circuit between the gateway and the third node; The third node is the node in the target network segment that is closest to the gateway.
[0067] It should be understood that the third node can also be called the first node, the nearest node, or the node closest to the gateway. It is used to represent the electronic control unit that is first in the target network segment when arranged in order of proximity to the gateway.
[0068] For example, the third node can be determined based on a pre-stored table of relative positions of electronic control units. In the table of relative positions of electronic control units, the position numbers of electronic control units within the same network segment are sequentially increased in order of proximity to the gateway, and the electronic control unit with the smallest position number is the third node.
[0069] Bus status: also known as Controller Area Network (CNN) controller status or bus communication status, is used to indicate the current state of the Controller Area Network (CNN) controller in the gateway.
[0070] For example, the bus status can include a bus off state and a bus normal state. The bus off state indicates that the transmission error counter inside the controller has accumulated to a set value, and the node actively withdraws from bus communication. The bus normal state indicates that the controller has not entered the bus off state and can still send and receive messages normally.
[0071] Bus shutdown state: also known as bus shutdown fault or bus shutdown mode, it indicates a fault mode that the Controller Area Network (CNN) controller enters when the internal transmission error counter accumulates to a set value.
[0072] In one embodiment, when a target fault is detected, the bus state is determined to be a bus off state.
[0073] The target fault is used to represent the Busoff fault, also known as the bus shutdown fault, which is a fault state. When the transmit error counter in the CAN controller accumulates to a set value (e.g., 255), the CAN controller enters the Busoff state and actively stops sending and receiving messages.
[0074] It should be understood that busoff faults can be caused by short circuits between high and low level lines, severe bus line faults, abnormal terminating resistors, and other reasons. In this solution, by detecting whether a busoff fault has occurred within the gateway itself, it can determine whether the gateway's CAN controller has exited communication due to a bus physical layer fault. This allows it to distinguish whether the lack of response from the entire target network segment is due to the gateway's own bus shutdown or a cable break between the gateway and the first node in the target network segment, providing a basis for accurately determining the fault type and location.
[0075] For example, when the error counter accumulates to 255, the Controller Area Network (CLAN) controller enters the bus shutdown state and actively stops sending and receiving messages; a short circuit between the high and low lines may also cause the controller to enter the bus shutdown state.
[0076] In the embodiments of this application, after the gateway sends the first message to the target network segment, if no response message corresponding to the first message is detected in the target network segment, it means that no node in the target network segment has successfully received and responded to the first message. At this time, the gateway obtains the bus status of the target network segment. If the bus status is not in the bus off state, that is, the gateway's own controller local area network controller is still in the normal working state, then the fault information of the target network segment is determined to be that there is a break in the circuit between the gateway and the third node, where the third node is the node in the target network segment that is closest to the gateway. Thus, the scenario of global network segment loss and normal gateway itself is accurately located as a cable break between the gateway and the first node.
[0077] For example, such as Figure 4As shown, the gateway is connected to network segment 1, on which ECU1, ECU2, ECU3...ECUn are connected sequentially. ECU1 is the closest to the gateway, while ECUn is the farthest. After the gateway sends the first message to network segment 1, no response message is detected within a preset waiting time. The gateway reads the transmission error counter value and, finding that the count value has not reached the set value, determines that the bus status is normal. At this point, based on the pre-stored ECU relative position table, the gateway determines that the ECU with the smallest position number in network segment 1 is ECU1, i.e., the third node; thus, a cable fault is identified in the first segment. The gateway records a fault code indicating that the cable between the gateway and ECU1 is open.
[0078] In one possible implementation, the bus status of the target network segment can be obtained by reading the status register of the controller local area network controller in the gateway or by sending the count value of the error counter.
[0079] For example, if the count value of the transmission error counter is detected to have accumulated to a set value, such as 255, the bus status is determined to be the bus off state; if the count value of the transmission error counter has not accumulated to the set value, the bus status is determined to be the bus normal state.
[0080] In one embodiment, if the bus status is in the bus off state, it indicates that the gateway's own Controller Area Network (CLAN) controller has exited bus communication due to an error counter overflow. In this case, it cannot be simply determined that the cable between the gateway and the third node is broken. The gateway can further acquire the voltage sampling values of the first and second level lines in the target network segment to determine whether a fault such as a short circuit between the high and low level lines, a short circuit to the power supply, or a short circuit to ground has occurred.
[0081] In one possible implementation, the third node can use the location information of each node in the target network segment, which can be a pre-stored ECU relative position table.
[0082] For example, the ECU relative location table can be as shown in Table 1, including CAN network segment, ECU name, and ECU location number; wherein, CAN network segment 1 corresponds to ECU1 and ECU2, ECU1 has a location number of 1, and ECU2 has a location number of 2; CAN network segment 2 corresponds to ECU3 and ECU4, ECU3 has a location number of 1, and ECU4 has a location number of 2; the ECU location numbers within the same network segment increase sequentially according to the distance from the gateway from near to far, that is, the smaller the location number, the closer the ECU is to the gateway.
[0083] Table 1
[0084] It should be understood that Table 1 is only used as an example to illustrate CAN network segment 1 including ECU1 and ECU2, and CAN network segment 2 including ECU3 and ECU4. CAN network segment 1 may include more ECUs, such as ECU1, ECU2, ECU3...ECUn. CAN network segment 2 and other CAN network segments may also include more ECUs. The number and position number of ECUs in each CAN network segment can be set according to the network topology of the vehicle model. This application embodiment does not limit this.
[0085] In one possible implementation, after determining that there is an open circuit between the gateway and the third node, the voltage sampling values of the first and second level lines in the target network segment can be further obtained to confirm whether there are other concurrent cable faults.
[0086] For example, if the voltage sampling value simultaneously shows a short circuit between the first and second level lines, then both open circuit and short circuit fault information can be recorded.
[0087] In the above implementation, if there is no response message in the target network segment, it indicates that the target network segment may have experienced a global communication interruption. At this time, the bus status of the target network segment is obtained, and if the bus status is not in the bus-off state, the fault information of the target network segment is determined to be an open circuit between the gateway and the third node. Since the bus status is not in the bus-off state, it indicates that the gateway's own controller LAN controller is still working normally, and the network segment as a whole has no response, so the fault can be accurately located in the cable between the gateway and the third node closest to the gateway, thereby improving the accuracy of fault location and maintenance efficiency.
[0088] S303, if there are response messages in the target network segment, obtain the fault information of the target network segment based on the number of response messages. The fault information of the target network segment is used to indicate the fault type and / or fault location of the target network segment.
[0089] Fault type: also known as fault category or fault type, it is used to indicate the specific form of fault that occurs in the bus cable of the target network segment.
[0090] For example, the fault type may include at least one of the following: cable break, short circuit between high-level and low-level lines, short circuit between high-level and / or low-level lines and power supply, and short circuit between high-level and / or low-level lines and ground.
[0091] Fault location: also known as fault section or fault location, is used to indicate the node interval or section corresponding to the cable that has failed in the target network segment.
[0092] For example, the fault location can be represented as a cable segment between two adjacent nodes, or a cable segment between the gateway and the first node, etc.
[0093] In the embodiments of this application, after the gateway sends the first message to the target network segment, if a response message corresponding to the first message is detected in the target network segment, then at least one node in the target network segment has successfully received the first message and responded, that is, the target network segment has not experienced an overall communication interruption; at this time, the number of response messages is determined to obtain the fault information of the target network segment, and the fault information is used to indicate the fault type and / or fault location of the target network segment.
[0094] In one possible implementation, fault information can be recorded in the form of fault codes, which may include network segment identifier, fault type, and fault location information. The fault codes can then be sent to diagnostic equipment or stored for later diagnostic purposes.
[0095] In one possible implementation, S301 can be executed periodically to send a first message to the target network segment and update the fault information of the target network segment based on the number of corresponding response messages sent each time. When a change in the number of response messages is detected, for example, from being equal to a first preset number to being less than a first preset number, or from being less than a first preset number back to being equal to a first preset number, the gateway can update the fault identifier accordingly to reflect the current communication status of the target network segment.
[0096] In one implementation, the specific process of obtaining fault information of the target network segment based on the number of response messages may include: If the number of response messages is less than the first preset number, the fault information of the target network segment is obtained based on the location information of each node in the target network segment and the response messages. When the number of response messages is the first preset number, the fault information of the target network segment is obtained based on the voltage value of the level line in the target network segment.
[0097] First preset quantity: also known as preset total number of nodes, preset number of responses, or baseline quantity, it is used to represent the total number of nodes pre-recorded in the target network segment, or the baseline number of response messages set according to diagnostic requirements.
[0098] For example, the first preset quantity can be pre-stored in the gateway; if the target network segment includes multiple nodes, the first preset quantity can be equal to the total number of nodes in the target network segment.
[0099] Node location information: also known as electronic control unit location information, node relative location information, or location number, is used to indicate the relative positional relationship between each node and the gateway in the target network segment.
[0100] For example, node location information can be stored in the gateway in the form of a relative location table of electronic control units. The relative location table of electronic control units includes network segment, electronic control unit name and electronic control unit location number. The location numbers of electronic control units within the same network segment are sequentially increased in order of proximity to the gateway.
[0101] Level lines: also known as differential signal lines or bus signal lines, are used to represent high-level and low-level lines in the controller area network bus.
[0102] For example, the level line may include a first level line and a second level line. The first level line may be a high level line and the second level line may be a low level line. When logic is 1, the voltage of both the first level line and the second level line is 2.5V. When logic is 0, the voltage of the first level line is 3.5V and the voltage of the second level line is 1.5V.
[0103] In the embodiments of this application, after obtaining the number of response messages in the target network segment in response to the first message, the number of response messages is compared with a first preset number. If the number of response messages is less than the first preset number, it indicates that some nodes in the target network segment have failed to respond, i.e., there is a node communication abnormality. At this time, the gateway determines the cable break location based on the location information of each node in the target network segment and the response messages, thereby obtaining the fault information of the target network segment. If the number of response messages is the first preset number, it indicates that all nodes in the target network segment have successfully responded, i.e., there is no break fault caused by node communication abnormality. At this time, the gateway determines whether a short circuit fault such as a short circuit between high-level and low-level lines, a short circuit to power supply, or a short circuit to ground has occurred based on the voltage value of the level lines in the target network segment, thereby obtaining the fault information of the target network segment.
[0104] In the above implementation, if the number of response messages is less than the first preset number, it indicates that some nodes in the target network segment have failed to respond, i.e., there is a node communication abnormality. At this time, the location information of each node and the response messages are further combined to locate the cable breakage fault. If the number of response messages is the first preset number, the fault information of the target network segment is obtained based on the voltage value of the level line in the target network segment. Since the number of response messages is the first preset number, it indicates that all nodes in the target network segment can respond normally. At this time, there is no breakage caused by node loss. Furthermore, the voltage value of the level line can be used to determine whether a short circuit has occurred and the type of short circuit, thereby accurately diagnosing the cable short circuit fault.
[0105] In one implementation, when the number of response messages is less than a first preset number, the specific process of obtaining the fault information of the target network segment based on the location information of each node in the target network segment and the response messages may include: Based on the response messages, identify the nodes in the target network segment that have not sent response messages; Based on the location information of each node in the target network segment, the first node is determined from the nodes in the target network segment that have not sent a response message. The first node is the node that is closest to the gateway among the nodes that have not sent a response message. The fault information of the target network segment is determined to be an open circuit between the first node and the second node, wherein the second node is adjacent to the first node.
[0106] Nodes that do not send a response message: also known as unresponsive nodes, disconnected nodes, or unacknowledged nodes, are used to indicate electronic control units in the target network segment that have not sent a response flag or a reply message to the first message sent by the gateway.
[0107] For example, if an electronic control unit (ECU) does not send a dominant level in the acknowledgment bit or reply with an independent acknowledgment frame after the gateway sends the first message, then that ECU is a node that has not sent an acknowledgment message.
[0108] A circuit break is used to indicate that the bus cable between two adjacent nodes in a target network segment is disconnected, causing a communication interruption between the two nodes.
[0109] For example, if the cable between the first node and the second node is broken, the nodes before the second node can still communicate normally with the gateway, while the first node and the nodes after it cannot communicate normally with the gateway.
[0110] In the embodiments of this application, after sending a first message to the target network segment and detecting a response message, the gateway determines the nodes in the target network segment that have not sent a response message based on the response message. Then, based on the location information of each node in the target network segment, the gateway determines the first node that is closest to the gateway from the nodes that have not sent a response message. Then, the gateway determines the fault information of the target network segment as an open circuit between the first node and the second node, wherein the second node is adjacent to the first node, and the distance between the second node and the gateway is less than the distance between the first node and the gateway. In this way, the gateway can accurately locate the cable open circuit fault to the cable segment between the first node and the second node.
[0111] In one possible implementation, the first node can be determined from among the nodes that have not sent a response message, based on the location information of each node in the target network segment. Among the nodes that have not sent a response message, the node with the smallest position number in the ECU relative position table is selected as the first node, that is, the unresponsive node that is closest to the gateway.
[0112] In one possible implementation, the fault information of the target network segment is determined to be an open circuit between the first node and the second node. Since the first node is the node closest to the gateway among the nodes that did not send an acknowledgment message, all nodes with position numbers less than the first node's position number have successfully sent acknowledgment messages, meaning that communication between these nodes and the gateway is normal. However, the first node and subsequent nodes with position numbers greater than the first node did not send acknowledgment messages, indicating that these nodes cannot communicate normally with the gateway. Therefore, it can be determined that the cable break occurred between the second node and the first node, where the second node is the node with a position number smaller than the first node, i.e., the node adjacent to the first node and closer to the gateway.
[0113] In one possible implementation, a first message can be periodically sent to the target network segment, and the nodes that did not send a response message and the first node can be re-determined based on the detected response message each time. If the first node determined is the same in multiple consecutive periods, the cable break between the first node and the second node can be determined as a continuous fault; if the first node determined is different in different periods, the fault information is recorded.
[0114] For example, the gateway is connected to CAN network segment 1, on which ECU1, ECU2, ECU3 and ECU4 are connected in sequence. The total number of nodes pre-recorded in the gateway is 4. After the gateway sends the first message to network segment 1, it detects that ECU1 and ECU2 have sent response messages, while ECU3 and ECU4 have not sent response messages. The gateway determines that the nodes that have not sent response messages are ECU3 and ECU4 according to the pre-stored ECU relative position table. The position number of ECU3 is 3 and the position number of ECU4 is 4. The node with the smallest position number among the nodes that have not sent response messages is ECU3, so ECU3 is determined as the first node. The node with the position number 2 preceding ECU3 is ECU2, which is the second node. Since ECU1 and ECU2 can respond normally, while ECU3 and ECU4 do not respond, the gateway determines that the fault information of network segment 1 is that the cable between ECU2 and ECU3 has been broken, and records the corresponding fault code. The fault code includes the network segment 1 identifier, the type of open circuit fault, and the position information between ECU2 and ECU3.
[0115] In the above implementation, the first node closest to the gateway is identified from the nodes that have not sent a response message. The segment between this first node and its adjacent second node is then identified as the break point. Since nodes closer to the gateway than the first node can respond normally, while the first node and subsequent nodes fail to respond, it can be determined that the cable break occurs between the first and second nodes. Compared to existing technologies that can only record node loss faults without pinpointing the specific break point, this solution can accurately locate the break point to the cable segment between two adjacent nodes, thus providing a clear direction for troubleshooting, reducing the workload of troubleshooting, improving maintenance efficiency, and enhancing the reliability of vehicle communication.
[0116] In one implementation, the target network segment includes a first voltage line and a second voltage line. When the number of response messages is a first preset number, the specific process of obtaining fault information of the target network segment based on the voltage values of the voltage lines in the target network segment may include: The voltage difference is obtained based on the voltage values of the first and second level lines. If the detected voltage difference is less than the first preset voltage threshold within the preset acquisition period, the fault information of the target network segment is determined to be a short circuit between the first level line and the second level line.
[0117] The first level line, also known as the high level line, high line, or differential high line, is used to represent the differential signal line with a higher voltage in the controller area network bus.
[0118] The second level line, also known as the low level line, low line, or differential low line, is used to represent a differential signal line with a lower voltage in the controller area network bus.
[0119] The first preset voltage threshold, also known as the short circuit determination threshold or voltage difference threshold, is used to represent the reference value for determining whether a short circuit has occurred between the first level line and the second level line.
[0120] For example, the first preset voltage threshold can be 0.1V, 0.2V or other values close to 0V; when the voltage difference is less than the first preset voltage threshold, it indicates that the voltages of the first level line and the second level line are approximately equal, and it is determined that there is a short circuit between them.
[0121] The preset acquisition period, also known as the sampling period, detection period, or continuous sampling duration, is used to represent the time interval for multiple consecutive samplings of the voltage level line.
[0122] For example, the preset collection period can be determined based on the communication period of the target network segment, and its duration is greater than or equal to the communication period, covering at least one complete message communication process.
[0123] In the embodiments of this application, the voltage values of the first and second level lines are obtained in the target network segment, and the voltage difference is obtained based on the voltage values of the first and second level lines. Within a preset acquisition period, the gateway continuously samples the first and second level lines multiple times to obtain multiple voltage differences. If multiple voltage differences are detected to be less than a first preset voltage threshold, the fault information of the target network segment is determined to be a short circuit between the first and second level lines, and the corresponding fault code or fault identifier is recorded. By determining a short circuit only when multiple voltage differences meet the conditions within the preset acquisition period, misjudgments caused by instantaneous interference or single sampling errors can be avoided, thereby improving the accuracy of short circuit fault diagnosis.
[0124] In one possible implementation, the voltage values of the first and second level lines can be obtained through a voltage sampling circuit set up in the gateway for each network segment.
[0125] For example, such as Figure 5 As shown, a voltage sampling circuit is set up for each network segment. Taking network segment 1 as an example, the gateway includes an MCU and a voltage divider circuit connected to the high-level line and low-level line of network segment 1 respectively. The output of the voltage divider circuit is connected to the analog-to-digital converter (ADC) interface of the MCU.
[0126] Specifically, a voltage divider circuit is set up for the high-level line and another voltage divider circuit is set up for the low-level line. The MCU connects to the sampling points of these two voltage divider circuits through two AD interfaces to obtain the voltage values of the high-level line and the low-level line, respectively. Each network segment has a corresponding voltage divider circuit for its high-level and low-level lines, which are connected to the corresponding AD interface of the MCU.
[0127] Furthermore, such as Figure 5 As shown, the voltage divider circuit includes a first resistor R1 and a second resistor R2. Taking the high-level line voltage divider circuit as an example, the second resistor R2 is connected between the high-level line and the sampling point, and the first resistor R1 is connected between the sampling point and ground. The sampling point is located between the first resistor R1 and the second resistor R2 and is connected to the MCU's AD interface. The low-level line voltage divider circuit can adopt the same structure, that is, the second resistor R2 is connected between the low-level line and the sampling point, and the first resistor R1 is connected between the sampling point and ground.
[0128] In one possible implementation, within a preset acquisition period, the voltage values of the first and second level lines can be acquired multiple times consecutively at preset sampling intervals, and the voltage difference corresponding to each sample can be calculated. The number of consecutive samples can be set according to the diagnostic accuracy, for example, 5, 10, or more consecutive samples. The preset sampling interval can be the same or dynamically adjusted according to the bus communication status.
[0129] In one possible implementation, the voltage difference can be calculated as follows: the voltage difference equals the voltage value of the first level line minus the voltage value of the second level line. During normal communication on the controller local area network bus, the voltage difference corresponding to logic 0 is 3.5V minus 1.5V equals 2V, and the voltage difference corresponding to logic 1 is 2.5V minus 2.5V equals 0V. When a short circuit occurs between the first and second level lines, their voltages tend to be equal, and the voltage difference approaches 0V. Therefore, setting the first preset voltage threshold to a value close to 0V, such as 0.1V, can determine whether a short circuit has occurred.
[0130] Optionally, when calculating the voltage difference, the absolute value of the difference between the voltage value of the first level line and the voltage value of the second level line can be determined as the voltage difference.
[0131] Optionally, an operational amplifier and an RC filter circuit can be added between the sampling point and the MCU's AD interface to further improve sampling accuracy and reduce the impact on bus communication quality. Thus, the gateway can accurately obtain the voltage values of the first and second level lines in each network segment without affecting bus communication, providing a reliable basis for subsequent fault diagnosis such as short circuits between the first and second level lines, short circuits to the power supply, or short circuits to ground.
[0132] For example, the gateway is connected to CAN network segment 1, and ECU1, ECU2 and ECU3 are connected to network segment 1. The gateway pre-records the communication period of network segment 1 as 10ms. The gateway sets the preset acquisition period to 10ms and continuously samples 10 times at a sampling interval of 1ms within the preset acquisition period to obtain the voltage values of the first level line and the second level line respectively. For each sampling, the gateway calculates the difference between the voltage of the first level line and the voltage of the second level line to obtain 10 voltage difference values. If all 10 voltage difference values are less than 0.1V, the fault information of network segment 1 is determined to be a short circuit between the first level line and the second level line, and the corresponding fault code is recorded. The fault code includes the network segment 1 identifier and the short circuit fault type.
[0133] In one embodiment, if at least one voltage difference is not less than a first preset voltage threshold within a preset acquisition period, it indicates that the voltage difference between the first level line and the second level line is not continuously in a short circuit state. At this time, the gateway can determine that no short circuit has occurred between the first level line and the second level line in the target network segment, and continue monitoring or perform other fault type judgment processes.
[0134] In one possible implementation, the first preset voltage threshold can be set according to the type and communication rate of the controller area network bus. For example, for a controller area network bus with a communication rate of 500kbps, the first preset voltage threshold can be set to 0.1V; for other types of buses, the corresponding threshold can be set according to the differential voltage range during normal communication and the voltage characteristics during short circuit.
[0135] In one possible implementation, the short-circuit detection between the first and second level lines can be performed in parallel with other fault detections.
[0136] For example, while determining whether the voltage difference is less than a first preset voltage threshold, the gateway can also determine whether the voltage value of the first or second voltage line is greater than a second preset voltage threshold or less than a third preset voltage threshold, to determine whether a short circuit to the power supply or a short circuit to ground has occurred. This parallel determination allows for the simultaneous identification of multiple short-circuit fault types, improving diagnostic efficiency.
[0137] In the above implementation, when the number of response messages is a first preset number, all nodes in the target network segment can respond normally, and there is no open circuit fault caused by node loss. Further judgment is made based on the voltage difference between the first and second level lines within a preset sampling period. Since a short circuit between the first and second level lines is only determined when the voltage difference is consistently less than a first preset voltage threshold within the preset sampling period, misjudgments caused by transient interference or sampling errors can be avoided, improving the accuracy and reliability of short circuit fault detection. This scheme can identify short circuit faults between the first and second level lines when node communication is normal, thereby achieving the diagnosis of open and short circuit faults and improving the reliability of vehicle communication and maintenance efficiency.
[0138] In one implementation, when the number of response messages is a first preset number, the specific process of obtaining fault information of the target network segment based on the voltage value of the level line in the target network segment may include: If the voltage values of all level lines in the target network segment are less than the first preset voltage threshold within the preset acquisition period, the fault information of the target network segment is determined to be a short circuit to ground of the level line. If the voltage values of all level lines in the target network segment are greater than the second preset voltage threshold within the preset acquisition period, the fault information of the target network segment is determined to be a short circuit between the level line and the power supply.
[0139] The second preset voltage threshold, also known as the power supply short circuit determination threshold or high voltage threshold, is used to represent the reference value for determining whether a power supply short circuit has occurred on the level line.
[0140] For example, the second preset voltage threshold can be 7V, 12V, or other values significantly higher than the normal bus level; when the voltage value of the level line is greater than the second preset voltage threshold, it indicates that the voltage of the level line is abnormally high, and it is determined that the level line is short-circuited to the power supply. The second preset voltage threshold is greater than the first preset voltage threshold.
[0141] In the embodiments of this application, the voltage value of the level line in the target network segment is obtained, and the level line is sampled multiple times continuously within a preset acquisition period to obtain multiple voltage values; if multiple voltage values are detected to be less than a first preset voltage threshold, the fault information of the target network segment is determined to be a short circuit to ground of the level line; if multiple voltage values are detected to be greater than a second preset voltage threshold, the fault information of the target network segment is determined to be a short circuit to the power supply of the level line; by determining a short circuit only when multiple voltage values meet the conditions within the preset acquisition period, misjudgment caused by instantaneous interference or single sampling error can be avoided, and the two fault types of short circuit to ground and short circuit to the power supply can be accurately distinguished.
[0142] It should be understood that a voltage level line can include a first voltage level line and a second voltage level line. The first voltage level line and the second voltage level line can be evaluated separately.
[0143] For example, if the voltage value of the first level line is less than a first preset voltage threshold throughout the preset sampling period, it is determined that the first level line is short-circuited to ground; if the voltage value of the first level line is greater than a second preset voltage threshold throughout the preset sampling period, it is determined that the first level line is short-circuited to the power supply. The second level line can be judged in the same way. If both the first and second level lines meet the corresponding conditions, it is determined that both level lines have experienced corresponding short-circuit faults.
[0144] In one possible implementation, the voltage value of the level line can be acquired multiple times consecutively at a preset sampling interval within a preset acquisition period. The number of consecutive samples can be set according to the diagnostic accuracy requirements, such as 5, 10, or more consecutive samples. The preset sampling interval can be the same or dynamically adjusted according to the bus communication status.
[0145] In one possible implementation, the voltage level can be continuously sampled periodically, and it can be determined whether the voltage values are all less than a first preset voltage threshold or all greater than a second preset voltage threshold. If a short circuit to ground or a short circuit to the power supply is determined to occur in multiple consecutive diagnostic cycles, the short circuit fault can be determined to be a persistent fault; if a short circuit is determined to occur only in some diagnostic cycles, the fault information can be recorded.
[0146] For example, the gateway is connected to CAN network segment 1, and ECU1, ECU2, and ECU3 are connected to network segment 1. The gateway pre-records the communication cycle of network segment 1 as 10ms. The gateway sets the preset acquisition cycle to 10ms and continuously samples 10 times at 1ms intervals within this preset acquisition cycle to obtain the voltage values of the high-level line and the low-level line respectively. For the high-level line, if all 10 voltage values are less than 0.1V, the fault information of network segment 1 is determined to be a short circuit to ground on the high-level line, and the corresponding fault code is recorded. If all 10 voltage values are greater than 7V, the fault information of network segment 1 is determined to be a short circuit to power supply on the high-level line, and the corresponding fault code is recorded. The same judgment method is used for the low-level line. If both the high-level line and the low-level line meet the short circuit to ground condition, the gateway can simultaneously record the fault codes for both lines being short-circuited to ground.
[0147] In one possible implementation, after determining whether the voltage level line is short-circuited to ground or short-circuited to power, the gateway can further combine this information with its own bus status for a comprehensive judgment. For example, if the gateway experiences a Busoff fault, the existence of a short-circuit fault is further confirmed; if the gateway does not experience a Busoff fault, but the voltage value of the voltage level line remains abnormal, a short-circuit fault can still be determined, and the corresponding fault code is recorded.
[0148] Optionally, the first preset voltage threshold and the second preset voltage threshold can be set separately according to the type of voltage level line in the target network segment. For example, for a high-level line, the second preset voltage threshold can be set to 7V; for a low-level line, the second preset voltage threshold can be set to 5V. By setting the thresholds separately, the voltage characteristics of different types of voltage level lines can be matched more accurately, thereby improving the accuracy of short-circuit fault diagnosis.
[0149] In the above implementation, when the number of response messages is the first preset number, all nodes in the target network segment can respond normally, and there is no open circuit fault caused by node loss. Further, the voltage value of the level line is compared with a preset voltage threshold. Since a short circuit to ground is only determined when the level line voltage value is less than the first preset voltage threshold within the preset sampling period, and a short circuit to the power supply is only determined when it is greater than the second preset voltage threshold, misjudgments caused by transient interference or sampling errors can be avoided, accurately distinguishing between short circuits to ground and short circuits to the power supply. This scheme can further accurately identify short circuits to ground or to the power supply when node communication is normal, thereby achieving comprehensive diagnosis of open circuit and short circuit faults, improving the reliability of vehicle communication and maintenance efficiency.
[0150] In one implementation, the determination method further includes: Obtain the communication cycle of the target network segment; Based on the communication cycle, a preset acquisition cycle is obtained, and the duration of the preset acquisition cycle is greater than or equal to the communication cycle.
[0151] The communication cycle, also known as the message cycle, bus communication cycle, or shortest message cycle, is used to represent the time interval or period of message transmission in the target network segment.
[0152] For example, the period of each message in the target network segment can be recorded, and the shortest message period can be used as the communication period. The communication period can be written into the gateway storage before loading, or it can be dynamically updated according to the bus load during the operation of the gateway.
[0153] In the embodiments of this application, the communication cycle of the target network segment is obtained, and a preset acquisition cycle is determined based on the communication cycle, such that the duration of the preset acquisition cycle is greater than or equal to the communication cycle. Within the preset acquisition cycle, the gateway continuously samples the voltage value of the level line in the target network segment multiple times to obtain multiple voltage values, and determines whether a short circuit fault has occurred in the target network segment based on the multiple voltage values. Since the preset acquisition cycle covers at least one complete communication cycle, the sampling process can cover the complete process of message transmission in the target network segment, avoiding the situation where only transient voltages are collected due to an excessively short sampling cycle. This provides a reliable basis for subsequent accurate determination of whether there is a short circuit between the first level line and the second level line, a short circuit between the level line and ground, or a short circuit between the level line and the power supply.
[0154] In one possible implementation, the gateway obtains the communication cycle of the target network segment by performing statistics based on the actual packets transmitted in the target network segment during the gateway's operation.
[0155] For example, a gateway can monitor the transmission time intervals of each message in a target network segment over a period of time and determine the shortest time interval as the communication cycle.
[0156] In one possible implementation, the gateway can determine the preset collection period based on the communication period.
[0157] For example, the preset acquisition period can be equal to the communication period; or, the preset acquisition period can be an integer multiple of the communication period, such as 2 times, 3 times or more.
[0158] For example, the gateway is connected to network segment 1. Assume that the shortest message period pre-stored in network segment 1 is 10ms. The gateway acquires this communication period of 10ms and sets the preset acquisition period to 10ms, making the preset acquisition period equal to the communication period. Within the preset acquisition period, the gateway continuously samples 10 times at a sampling interval of 1ms, acquiring the voltage values of the high-level line and the low-level line respectively, obtaining 10 high-level line voltage values and 10 low-level line voltage values. The gateway calculates the voltage difference based on the high-level line voltage value and the low-level line voltage value in each sampling period. If all 10 voltage differences are less than 0.1V, it is determined that a short circuit has occurred between the high-level line and the low-level line in network segment 1, and the corresponding fault code is recorded. If all 10 high-level line voltage values are less than 0.1V, it is determined that a high-level line short circuit to ground has occurred in network segment 1. If all 10 high-level line voltage values are greater than 7V, it is determined that a high-level line short circuit to power supply has occurred in network segment 1.
[0159] Optionally, if there are multiple message cycles in the target network segment, the gateway can use the shortest message cycle as the communication cycle, or it can use the average value of multiple message cycles as the communication cycle.
[0160] In the above implementation, the communication cycle of the target network segment is obtained, and a preset acquisition cycle is determined based on this communication cycle. The duration of the preset acquisition cycle is greater than or equal to the communication cycle. Since the communication cycle reflects the duration of message transmission in the target network segment, at least one complete message communication process can be covered within the preset acquisition cycle. Therefore, the acquired voltage value can avoid only acquiring transient voltages due to an excessively short sampling period, which could lead to missed or false short-circuit fault detection. The above scheme can adaptively determine the acquisition cycle by combining it with the communication cycle of the target network segment itself, matching the voltage sampling with the actual bus communication process, thereby improving the accuracy and reliability of short-circuit fault detection.
[0161] In one implementation, the target network segment includes a voltage sampling circuit, and the determination method further includes: Obtain the voltage value at the sampling point in the voltage sampling circuit; Based on the voltage division ratio of the voltage sampling circuit and the voltage value at the sampling point, the voltage value of the level line in the target network segment is obtained.
[0162] The sampling point, also known as the voltage divider point, analog-to-digital conversion sampling point, or detection node, is used to represent the node in the voltage sampling circuit that connects to the analog-to-digital conversion interface.
[0163] For example, the sampling point is located between the first resistor and the second resistor, and the gateway's MCU connects to the sampling point through an analog-to-digital (AD) interface.
[0164] In the embodiments of this application, a voltage sampling circuit is provided for each network segment. The sampling points of the high-level line and the low-level line are connected through two AD interfaces respectively. The voltage sampling circuit (i.e., voltage divider circuit) is used to sample the voltage values of the high-level line and the low-level line.
[0165] The voltage divider circuit is used to reduce the impact of analog-to-digital conversion sampling on the high and low level line voltages, thus avoiding affecting the bus communication quality. The voltage divider resistor in the voltage divider circuit should have a resistance value much larger than the controller local area network bus terminating resistor value. For example, when the terminating resistor is 120Ω, the voltage divider resistor can be selected as 10KΩ.
[0166] It should be understood that the voltage division ratio is determined based on the resistance values of the first and second resistors. For example, the voltage division ratio equals the sum of the resistance values of the first and second resistors divided by the resistance value of the first resistor; the voltage value of the level line equals the voltage value at the sampling point multiplied by the voltage division ratio. For example, if the resistance of the first resistor is 10KΩ and the resistance of the second resistor is 10KΩ, then the voltage division ratio is (10KΩ + 10KΩ) / 10KΩ = 2; if the voltage value at the sampling point is 1.75V, then the voltage value of the level line is 1.75V × 2 = 3.5V.
[0167] For example, the gateway is connected to CAN network segment 1, which includes high-level lines and low-level lines. The gateway has a first voltage sampling circuit for the high-level lines and a second voltage sampling circuit for the low-level lines. Taking the first voltage sampling circuit for the high-level lines as an example, assuming the first resistor R1 is 10KΩ and the second resistor R2 is 10KΩ, the second resistor R2 is connected between the high-level line and the sampling point, and the first resistor R1 is connected between the sampling point and ground. The sampling point is connected to the MCU's AD interface. The gateway acquires data through the AD interface. The voltage value at the sampling point is 1.75V. Based on the voltage division ratio (10KΩ+10KΩ) / 10KΩ=2, the actual voltage value of the high-level line is calculated to be 1.75V×2=3.5V. Similarly, the second voltage sampling circuit of the low-level line collects a sampling point voltage value of 0.75V, which is calculated to be 0.75V×2=1.5V. At this time, the high-level line voltage of 3.5V and the low-level line voltage of 1.5V correspond to the dominant level of logic 0 on the controller local area network bus, indicating that the bus communication is normal.
[0168] Optionally, after acquiring the voltage values at the sampling points, the voltage values can be filtered. For example, the gateway can take the average or median of the voltage values acquired multiple times consecutively to filter out random interference.
[0169] In the above implementation, a voltage sampling circuit is set up in the target network segment to obtain the voltage value of the sampling point in the voltage sampling circuit. Then, the actual voltage value of the level line is calculated based on the voltage division ratio of the voltage sampling circuit and the voltage value of the sampling point. Since voltage division sampling can obtain the voltage information of the level line, it will not interfere with the normal message communication of the target network segment, and can provide accurate level line voltage data for short circuit fault diagnosis. Therefore, this solution can accurately determine the fault and improve the reliability of vehicle communication and maintenance efficiency.
[0170] In one implementation, the voltage sampling circuit includes a first resistor and a second resistor. The specific process of obtaining the voltage value of the level line in the target network segment based on the voltage division ratio of the voltage sampling circuit and the voltage value at the sampling point may include: Determine the target resistance value based on the first resistor and the second resistor; Determine the voltage division ratio based on the target resistance and the first resistance; or... Determine the voltage division ratio based on the target resistance value and the second resistor; The first resistor is located between the sampling point and ground, and the second resistor is located between the sampling point and the power supply.
[0171] The target resistance value can also be called the total resistance value, equivalent resistance value, or voltage divider total resistance value. It is used to represent the resistance value determined based on the first resistor and the second resistor.
[0172] For example, the target resistance value can be the sum of the resistance values of the first resistor and the second resistor, that is, the target resistance value is equal to the sum of the resistance values of the first resistor and the second resistor.
[0173] It should be understood that the actual voltage value of the high-level line can be obtained by calculating the voltage division ratio. For example, the voltage value of the high-level line is equal to the voltage of the analog-to-digital conversion sampling point multiplied by the sum of the resistance values of the two voltage dividing resistors (the first resistor and the second resistor) in the voltage divider circuit, and then divided by the resistance value of the voltage dividing resistor (the first resistor) connected to ground.
[0174] Optionally, an operational amplifier and resistor-capacitor filter circuit can be added between the sampling point and the analog-to-digital conversion interface of the microcontroller to further improve sampling accuracy and reduce the impact on bus communication quality.
[0175] In the embodiments of this application, a target resistance value is determined based on the resistance values of the first resistor and the second resistor in the voltage sampling circuit; then, the voltage division ratio is determined based on the target resistance value and the first resistor, or based on the target resistance value and the second resistor; wherein, the first resistor is located between the sampling point and ground, and the second resistor is located between the sampling point and the power supply; after determining the voltage division ratio in the above manner, the gateway can convert the voltage value of the sampling point into the actual voltage value of the level line according to the voltage value of the sampling point and the voltage division ratio, thereby providing an accurate data basis for subsequent judgment of short circuit between the first level line and the second level line, short circuit between the level line and ground, or short circuit between the level line and the power supply.
[0176] In one possible implementation, the target resistance value is determined based on the first resistor and the second resistor, specifically the sum of the resistance values of the first resistor and the second resistor.
[0177] For example, if the first resistor is R1 and the second resistor is R2, then the target resistance Rtotal = R1 + R2. Since the first resistor is located between the sampling point and ground, and the second resistor is located between the sampling point and the power supply, the relationship between the sampling point voltage and the power supply voltage (i.e., the line voltage) is: Sampling point voltage = Line voltage × R1 / (R1 + R2). Therefore, the line voltage = Sampling point voltage × (R1 + R2) / R1. Thus, the voltage division ratio can be expressed as (R1 + R2) / R1, which is the target resistance divided by the first resistor.
[0178] For example, the gateway is connected to CAN network segment 1, which includes a high-level line and a low-level line. Taking the voltage sampling circuit of the high-level line as an example, the first resistor R1 is 10KΩ, the second resistor R2 is 10KΩ, the second resistor R2 is connected between the high-level line and the sampling point, and the first resistor R1 is connected between the sampling point and ground. The gateway determines the target resistance value R_total = R1 + R2 = 20KΩ based on the first resistor R1 and the second resistor R2. Based on the target resistance value R_total and the first resistor R1, the voltage division ratio is determined as R_total / R1 = 20KΩ / 10KΩ = 2; The gateway collects the voltage value of the sampling point through the AD interface, which is 1.75V. According to the voltage division ratio of 2, the actual voltage value of the high-level line is calculated to be 1.75V × 2 = 3.5V. Assuming that the voltage sampling circuit of the low-level line uses the same structure, if the sampling point voltage is 0.75V, then the actual voltage of the low-level line is 0.75V × 2 = 1.5V. Thus, the high-level line voltage of 3.5V and the low-level line voltage of 1.5V correspond to the dominant level of logic 0 of the controller local area network bus, indicating that the bus communication is normal.
[0179] In the above implementation, a voltage divider structure is formed by the first resistor and the second resistor, and the target resistance value is determined based on the two. Then, the voltage division ratio is determined according to the target resistance value and the first resistor or the second resistor. Since the first resistor is located between the sampling point and ground, and the second resistor is located between the sampling point and the power supply, the voltage on the level line can be sampled after being reduced according to the voltage division ratio. Without affecting the bus communication, the actual voltage value of the level line can be obtained through the voltage division ratio and the voltage value of the sampling point, thus providing a reliable basis for accurately judging faults such as short circuits between level lines, short circuits to ground, or short circuits to the power supply.
[0180] S304 generates a fault identifier for the target network segment based on the fault information of the target network segment.
[0181] Among them, the fault identifier, also known as the fault code, diagnostic identifier, fault identifier information, or fault record identifier, is used to represent the identifier information generated by the gateway based on the fault information of the target network segment.
[0182] For example, a fault identifier may include at least one of the following: network segment identifier, fault type, fault location, identifier of the node where the fault occurred, and fault occurrence time; the fault identifier may be represented in the form of numeric encoding, character encoding, or a combination of fields.
[0183] In the embodiments of this application, after obtaining the fault information of the target network segment according to S303, a fault identifier corresponding to the target network segment is generated according to the fault information; the fault identifier is used to characterize the fault type and / or fault location currently occurring in the target network segment, and the fault identifier can be stored and recorded, or sent to the diagnostic interface, instrument or other control unit through the vehicle network.
[0184] For example, the gateway is connected to CAN network segment 1, and ECU1, ECU2 and ECU3 are connected sequentially on network segment 1. After the gateway sends the first message to network segment 1, it detects that ECU1 and ECU2 have sent response messages, but ECU3 has not sent a response message. The gateway determines the position number of ECU3 as 3 according to the pre-stored ECU relative position table, and the node with the previous position number of ECU3 as 2 is ECU2. Thus, the fault information of network segment 1 is that the cable between ECU2 and ECU3 is broken. A fault identifier is generated according to the preset mapping relationship. The fault identifier includes the network segment 1 identifier, the open circuit fault type and the position information between ECU2 and ECU3. The fault identifier is stored and sent to the diagnostic interface through the CAN bus.
[0185] In the above solution, after the maintenance personnel connect the diagnostic interface through the diagnostic equipment and read the fault identifier, they can directly determine that the cable between ECU2 and ECU3 in network segment 1 is broken, without having to check each one individually.
[0186] In one possible implementation, fault identifiers can be generated based on a pre-defined mapping relationship. This mapping relationship can be pre-stored in the gateway to represent the correspondence between different fault types and / or different fault locations and different fault identifiers.
[0187] For example, a cable break corresponds to a first-class fault indicator, a short circuit between a high-level line and a low-level line corresponds to a second-class fault indicator, a short circuit to the power supply corresponds to a third-class fault indicator, and a short circuit to ground corresponds to a fourth-class fault indicator.
[0188] Optionally, different sub-identifiers can be set in the fault identifier according to the different fault locations. For example, the first sub-identifier corresponds to the circuit break between the gateway and the first node, and the second sub-identifier corresponds to the circuit break between the first node and the second node.
[0189] In one possible implementation, the priority of fault identifiers can be set according to the severity of the fault.
[0190] For example, a cable break causing a node to lose communication is more serious than a short circuit between a high-level and low-level line; a power supply short circuit may cause an abnormal increase in bus voltage, which is more serious than a short circuit to ground. Fault identifiers should be recorded and reported in priority order so that maintenance personnel can prioritize handling high-priority faults that affect communication security.
[0191] In one possible implementation, if the fault in the target network segment is detected to have disappeared, for example, the number of response messages returns to the first preset number and the voltage value of the level line is normal, then the corresponding fault identifier is cleared, or the fault identifier is marked as recovered.
[0192] In the above embodiments, compared to the prior art where CAN bus cable faults such as open circuits and short circuits cannot be detected by the ECU, making it difficult for the ECU to effectively record fault codes and thus unable to accurately distinguish the fault type and location, causing difficulties for maintenance personnel in troubleshooting and failing to quickly pinpoint the root cause of the fault, affecting the reliability of vehicle communication, this solution, after sending the first message to the target network segment, checks whether there is a corresponding response message in the target network segment. This can determine the communication response status of the nodes in the target network segment, distinguish whether it is a global loss, and determine whether there is a node communication anomaly in the target network segment. If there is a response message in the target network segment, the fault information of the target network segment is obtained based on the number of response messages, determining whether there is a node communication anomaly, thereby obtaining the fault information of the target network segment and determining the cause of the fault. Because this solution first distinguishes the case of a global loss, it can eliminate global faults of overall communication interruption. Then, for local faults, it combines the number of response messages and node location information to accurately determine the fault location and fault type, thereby improving the reliability of vehicle communication.
[0193] The following is combined with Figure 6 Another method for determining vehicle communication faults provided in the embodiments of this application will be described in detail.
[0194] Figure 6 This is a schematic flowchart illustrating another method for determining vehicle communication faults provided in an embodiment of this application. Figure 6 As shown, method 600 includes S601 to S608, which are described in detail below.
[0195] For example, Figure 6 The method 600 shown can be executed by a gateway in the vehicle.
[0196] Optionally, Figure 6The method 600 shown can also be executed by a vehicle; or by a microcontroller unit in the vehicle; or by a software platform in an electronic device integrated in the vehicle; or by a hardware or software module integrated in a gateway.
[0197] S601, gateway initialization completed.
[0198] For example, after the vehicle is powered on, the gateway is woken up and completes internal initialization, such as loading the ECU relative position table and reading the configuration information of each network segment.
[0199] Alternatively, the implementation of S601 can be found in the relevant description in S301, and will not be repeated here.
[0200] S602, determine whether the target network segment has been lost globally; if yes, execute S603; if no, execute S605.
[0201] For example, a first message is sent to CAN network segment 1 to check whether any acknowledgment flags are received and whether messages sent by other nodes in the network segment are received; if none are received, it is determined that a global loss has occurred and S603 is executed; otherwise, S605 is executed.
[0202] Alternatively, the implementation of S602 can be found in the relevant description in S302, and will not be repeated here.
[0203] S603, determine whether a target fault has occurred; if yes, execute S602; if no, execute S604.
[0204] The target fault is used to represent the Busoff fault, also known as the bus shutdown fault, which is a fault state. When the transmit error counter in the CAN controller accumulates to a set value (e.g., 255), the CAN controller enters the Busoff state and actively stops sending and receiving messages.
[0205] For example, the system reads the transmission error counter of its own CAN controller. If the count value reaches 255, it determines that a Busoff fault has occurred and executes S609 to perform voltage sampling to determine a short circuit; if the count value does not reach 255, it executes S604.
[0206] Alternatively, the implementation of S603 can be found in the relevant description in S303, and will not be repeated here.
[0207] S604, a fault code indicating a cable break between the gateway and ECU1.
[0208] For example, if it is determined that no busoff has occurred, but there is no response from the entire network segment 1, it indicates that there is a break in the cable between the gateway and ECU1, and the corresponding fault code is recorded.
[0209] Alternatively, the implementation of S604 can be found in the relevant description in S303, and will not be repeated here.
[0210] S605, determine whether a node loss has occurred in the target network segment; if yes, execute S606; if no, execute S602.
[0211] For example, according to the ECU relative position table, check in turn whether ECU1 to ECUm have been continuously not sending messages. If ECU2 loses a node, then execute S606.
[0212] Alternatively, the implementation of S605 can be found in the relevant description in S303, and will not be repeated here.
[0213] S606, determine whether only ECUn has lost a node; if yes, proceed to S608; if no, proceed to S607.
[0214] For example, according to the ECU relative position table, check whether each ECU has continuously failed to send a message. If ECU1 to ECUn-1 all send messages normally, and only ECUn fails to send a message, then it is determined that only ECUn has lost a node, and S608 is executed; if there are other ECUs besides ECUn that have lost a node, then S607 is executed.
[0215] Alternatively, the implementation of S606 can be found in the relevant description in S303, and will not be repeated here.
[0216] S607, determine the location of the fault and record the cable breakage fault code of the corresponding section.
[0217] For example, if the missing node with the smallest position number among ECU1 to ECUm is detected as ECUm, the fault location is determined to be the cable segment between ECUm and ECUm+1, and the corresponding cable open circuit fault code is recorded; or, if the gateway detects that there is a missing node among ECUm+1 to ECUn, the fault location is determined to be the cable segment between ECUm and ECUm+1, and the corresponding cable open circuit fault code is recorded.
[0218] Alternatively, the implementation of S607 can be found in the relevant description in S303, and will not be repeated here.
[0219] S608 records a fault code indicating a cable break between ECUn-1 and ECUn, or a fault code indicating an abnormality in ECUn.
[0220] For example, if only ECUn is lost, the gateway records a CAN bus cable breakage fault code between ECUn-1 and ECUn, or an ECUn controller abnormality fault code, so that maintenance personnel can further investigate whether the cable is broken or the ECUn itself is abnormal based on the fault code.
[0221] Optionally, after executing S608, execute S602 to continuously perform fault detection.
[0222] Alternatively, the implementation of S608 can be found in the relevant description in S303, and will not be repeated here.
[0223] In the above embodiment, by determining in S606 whether only ECUn has lost a node, it is possible to distinguish between the loss of an end node and the loss of other nodes. When only ECUn is lost, by recording the cable break fault code between ECUn-1 and ECUn or the ECUn controller malfunction fault code in S608, it is possible to avoid misjudging an ECUn controller malfunction as a cable break. When not only ECUn is lost, by determining the fault location based on the previous detection results in S607 and recording the cable break fault code of the corresponding section, it is possible to accurately locate the cable break in the middle section. Therefore, this solution can accurately distinguish the cable break location from the node malfunction based on the different distribution of node loss, improving fault location accuracy and maintenance efficiency.
[0224] The following is combined with Figure 7 Another method for determining vehicle communication faults provided in the embodiments of this application will be described in detail.
[0225] Figure 7 This is a schematic flowchart illustrating another method for determining vehicle communication faults provided in an embodiment of this application. Figure 7 As shown, method 700 includes S701 to S706, which are described in detail below.
[0226] For example, Figure 7 The method 700 shown can be executed by the gateway in the vehicle.
[0227] Optionally, Figure 7 The method 700 shown can also be executed by a vehicle; or by a microcontroller unit in the vehicle; or by a software platform in an electronic device integrated in the vehicle; or by a hardware or software module integrated in a gateway.
[0228] S701, gateway initialization completed.
[0229] For example, Alternatively, the implementation of S701 can be found in the relevant description in S301, and will not be repeated here.
[0230] S702, determine whether a target fault has occurred; if yes, execute S703; if no, execute S702.
[0231] The target fault is the Busoff fault. The gateway reads the count value of the transmission error counter in its own CAN controller. If the count value accumulates to 255, it determines that a Busoff fault has occurred and executes S703; if the count value has not accumulated to 255, it returns to S702 to continue monitoring whether a Busoff fault has occurred.
[0232] For example, the count value of the transmission error counter in its own CAN controller is read. If the count value accumulates to 255, a Busoff fault is determined to have occurred, and S703 is executed; if the count value does not accumulate to 255, the process returns to S702 to continue monitoring whether a Busoff fault has occurred.
[0233] Alternatively, the implementation of S702 can be found in the relevant description in S303, and will not be repeated here.
[0234] S703 continuously samples low-level and high-level lines to obtain the voltage values of multiple low-level lines and multiple high-level lines.
[0235] For example, within a preset acquisition period, the voltage sampling circuit continuously samples CAN_L and CAN_H multiple times to obtain multiple CAN_L voltage values and multiple CAN_H voltage values. The preset acquisition period can be greater than or equal to the communication period of the target network segment.
[0236] Alternatively, the implementation of S703 can be found in the relevant description in S303, and will not be repeated here.
[0237] S704 calculates the voltage difference between the voltage values of multiple low-level lines and the voltage values of multiple high-level lines.
[0238] For example, for each sampling period, the high-level line voltage value is subtracted from the low-level line voltage value within the same sampling period to obtain multiple voltage differences; or the absolute value of the difference between the high-level line voltage value and the low-level line voltage value is calculated to obtain multiple voltage differences.
[0239] Alternatively, the implementation of S704 can be found in the relevant description in S303, and will not be repeated here.
[0240] S705: Determine if the voltage difference is less than 0.1V; if yes, proceed to S706; if no, proceed to S702.
[0241] For example, if the voltage difference corresponding to multiple sampling periods is less than 0.1V, it means that the voltages of CAN_H and CAN_L are almost equal, and it is determined that there is a short circuit between the high-level line and the low-level line; if there is at least one voltage difference not less than 0.1V, then return to S702 to continue monitoring.
[0242] Alternatively, the implementation of S705 can be found in the relevant description in S303, and will not be repeated here.
[0243] S706 records cable short circuit faults between high-level and low-level lines.
[0244] For example, a fault code indicating a short circuit between the high-level and low-level lines can be recorded and stored in non-volatile memory, or sent to a diagnostic interface via the CAN bus for maintenance personnel to read.
[0245] Alternatively, the implementation of S706 can be found in the relevant description in S303, and will not be repeated here.
[0246] In the above embodiments, by continuously sampling the high-level line and the low-level line, multiple voltage values are obtained and the voltage difference is calculated. Only when the voltage difference corresponding to multiple sampling periods is less than 0.1V is a short circuit between the high-level line and the low-level line determined and the fault is recorded. This can avoid misjudgment caused by single sampling error or instantaneous interference and improve the accuracy of short circuit fault diagnosis. This solution distinguishes between short circuits between the high-level line and the low-level line and other cable faults, providing maintenance personnel with clear fault type information and improving the reliability of vehicle communication and maintenance efficiency.
[0247] The following is combined with Figure 8 This application provides a detailed description of yet another method for determining vehicle communication faults.
[0248] Figure 8 This is a schematic flowchart illustrating another method for determining vehicle communication faults provided in an embodiment of this application. Figure 8 As shown, method 800 includes S801 to S805, which are described in detail below.
[0249] For example, Figure 8 The method 800 shown can be executed by the gateway in the vehicle.
[0250] Optionally, Figure 8 The method 800 shown can also be executed by a vehicle; or by a microcontroller unit in the vehicle; or by a software platform in an electronic device integrated in the vehicle; or by a hardware or software module integrated in a gateway.
[0251] S801 continuously samples the voltage level lines to obtain multiple voltage values.
[0252] For example, within a preset sampling period, the voltage levels (e.g., high-level or low-level lines) in the target network segment are sampled multiple times consecutively to obtain multiple voltage values. The preset sampling period can be greater than or equal to the communication period of the target network segment to ensure that the sampling process covers the entire message transmission process.
[0253] Alternatively, the implementation of S801 can be found in the relevant description in S303, and will not be repeated here.
[0254] S802 determines whether multiple voltage values are all greater than 7V; if yes, execute S803; if no, execute S804.
[0255] For example, if the voltage value obtained in multiple consecutive sampling periods is greater than 7V, it indicates that the voltage of the level line is continuously and abnormally rising, and it is determined that the level line is short-circuited to the power supply; if there is at least one voltage value not greater than 7V, then S804 is executed to continue to determine whether it is short-circuited to ground.
[0256] Alternatively, the implementation of S802 can be found in the relevant description in S303, and will not be repeated here.
[0257] S803 records short circuit faults in the cable between the level line and the power supply.
[0258] For example, a fault code indicating a short circuit between the level line and the power supply can be recorded and stored in non-volatile memory, or sent to a diagnostic interface via the CAN bus for maintenance personnel to read.
[0259] Alternatively, the implementation of S803 can be found in the relevant description in S303, and will not be repeated here.
[0260] S804 determines whether multiple voltage values are all less than 0.1V; if yes, execute S805; if no, execute S802.
[0261] For example, if the voltage value obtained in multiple consecutive sampling periods is less than 0.1V, it indicates that the voltage of the level line is continuously and abnormally decreasing, and it is determined that the level line is short-circuited to ground; if there is at least one voltage value not less than 0.1V, then return to S802 to continue monitoring.
[0262] Alternatively, the implementation of S804 can be found in the relevant description in S303, and will not be repeated here.
[0263] S805 records cable short circuit faults between the level line and ground.
[0264] For example, a fault code indicating a short circuit between the level line and ground can be recorded and stored in non-volatile memory, or sent to a diagnostic interface via the CAN bus for maintenance personnel to read.
[0265] Alternatively, the implementation of S805 can be found in the relevant description in S303, and will not be repeated here.
[0266] In the above embodiments, by continuously sampling the power supply line, and determining a short circuit to the power supply only when multiple voltage values are greater than 7V, and a short circuit to ground only when multiple voltage values are less than 0.1V, misjudgments caused by single sampling errors or instantaneous interference can be avoided, thus improving the accuracy of short circuit fault diagnosis. At the same time, it can distinguish between two fault types: power supply short circuit and ground short circuit, providing maintenance personnel with clear fault type information, thereby quickly pinpointing the root cause of the fault and improving the reliability of vehicle communication and maintenance efficiency.
[0267] It should be noted that, Figures 6 to 8 The methods shown can be executed individually or in parallel; alternatively, they can be executed according to a preset cycle. For example, a gateway can execute these methods simultaneously within the same diagnostic cycle. Figure 6 The cable breakage fault detection shown Figure 7 The short circuit fault detection between the first and second level lines shown and Figure 8 The indicated level line can detect short circuit faults to power or ground; alternatively, the same or different execution cycles can be set for the above three detections, and each can be triggered according to its respective cycle. By executing in parallel or periodically, comprehensive and real-time diagnosis of open circuit and short circuit faults can be achieved without affecting the normal communication of the target network segment.
[0268] The above text combined Figures 1 to 8 This application provides a detailed description of a method for determining vehicle communication faults, based on embodiments thereof; the following will be combined with... Figure 9 and Figure 10 The apparatus embodiments of this application are described in detail below. It should be understood that the apparatus in the embodiments of this application can perform the various methods described in the foregoing embodiments of this application, that is, the specific working processes of the various products described below can be referred to the corresponding processes in the foregoing method embodiments.
[0269] Figure 9 This is a schematic diagram of a vehicle communication fault determination device provided in an embodiment of this application. The vehicle communication fault determination device 900 includes a sending module 901 and a processing module 902.
[0270] Sending module 901 is used to send the first message to the target network segment; The processing module 902 is used to detect whether there is a response message corresponding to the first message in the target network segment; if there is a response message in the target network segment, it obtains the fault information of the target network segment based on the number of response messages, and the fault information of the target network segment is used to indicate the fault type and / or fault location of the target network segment; based on the fault information of the target network segment, it generates a fault identifier of the target network segment.
[0271] Optionally, as an embodiment, the processing module 902 is specifically used to: when the number of response messages is less than a first preset number, obtain fault information of the target network segment based on the location information of each node in the target network segment and the response messages; when the number of response messages is the first preset number, obtain fault information of the target network segment based on the voltage value of the level line in the target network segment.
[0272] Optionally, as an embodiment, the processing module 902 is specifically used for: determining, based on the response message, nodes in the target network segment that have not sent response messages; determining, based on the location information of each node in the target network segment, a first node from the nodes in the target network segment that have not sent response messages, wherein the first node is the node that is closest to the gateway among the nodes that have not sent response messages; and determining that the fault information of the target network segment is an open circuit between the first node and the second node, wherein the second node is adjacent to the first node.
[0273] Optionally, as an embodiment, the processing module 902 is specifically used to: obtain a voltage difference based on the voltage value of the first level line and the voltage value of the second level line; and if the voltage difference is detected to be less than the first preset voltage threshold within a preset acquisition period, determine that the fault information of the target network segment is a short circuit between the first level line and the second level line.
[0274] Optionally, as an embodiment, the processing module 902 is specifically used to: within a preset acquisition period, if the voltage values of the level lines in the target network segment are all less than a first preset voltage threshold, determine that the fault information of the target network segment is a short circuit to ground of the level line; within a preset acquisition period, if the voltage values of the level lines in the target network segment are all greater than a second preset voltage threshold, determine that the fault information of the target network segment is a short circuit to the power supply of the level line.
[0275] Optionally, as an embodiment, the processing module 902 is further configured to: obtain the communication cycle of the target network segment; and obtain a preset collection cycle based on the communication cycle, wherein the duration of the preset collection cycle is greater than or equal to the communication cycle.
[0276] Optionally, as an embodiment, the processing module 902 is further configured to: obtain the voltage value of the sampling point in the voltage sampling circuit; and obtain the voltage value of the level line in the target network segment based on the voltage division ratio of the voltage sampling circuit and the voltage value of the sampling point.
[0277] Optionally, as an embodiment, the processing module 902 is specifically used to: determine a target resistance value based on a first resistor and a second resistor; determine a voltage division ratio based on the target resistance value and the first resistor; or, determine a voltage division ratio based on the target resistance value and the second resistor; wherein the first resistor is located between the sampling point and ground, and the second resistor is located between the sampling point and the power supply.
[0278] Optionally, as an embodiment, the processing module 902 is further configured to: obtain the bus status of the target network segment when there is no response message in the target network segment; and determine the fault information of the target network segment as an open circuit between the gateway and the third node when the bus status is not in the bus off state; wherein the third node is the node in the target network segment that is closest to the gateway.
[0279] It should be noted that the aforementioned vehicle communication fault determination device 900 is embodied in the form of a functional unit. The term "module" here can be implemented in software and / or hardware, without specific limitations.
[0280] For example, a "module" can be a software program, hardware circuit, or a combination of both that implements the above functions. Hardware circuits may include application-specific integrated circuits (ASICs), electronic circuits, processors (e.g., shared processors, proprietary processors, or group processors) and memory for executing one or more software or firmware programs, combined logic circuits, and / or other suitable components that support the described functions.
[0281] Therefore, the units of the various examples described in the embodiments of this application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0282] Figure 10 This is a schematic diagram of the structure of a vehicle provided in an embodiment of this application.
[0283] For example, vehicle 1000 includes: processor 1001, memory 1002 and executable program code 1003.
[0284] For example, vehicle 1000 includes one or more processors 1001, which can support vehicle 1000 in implementing the method for determining vehicle communication faults in the method embodiment. Processor 1001 can be a general-purpose processor or a special-purpose processor. For example, processor 1001 can be a central processing unit (CPU), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, such as discrete gates, transistor logic devices, or discrete hardware components.
[0285] For example, the processor 1001 can be used to control the vehicle 1000, execute software programs, and process data from the software programs. The vehicle 1000 may also include a communication unit for receiving and transmitting signals.
[0286] For example, the vehicle 1000 may include one or more memories 1002 storing executable program code 1003. The executable program code 1003 can be run by the processor 1001 to generate instructions, causing the processor 1001 to execute the vehicle communication fault determination method described in the above method embodiments according to the instructions. For example, the processor 1001 executes the following according to the instructions: sending a first message to a target network segment; detecting whether there is a response message corresponding to the first message in the target network segment; if there is a response message in the target network segment, obtaining fault information of the target network segment based on the number of response messages, the fault information of the target network segment being used to indicate the fault type and / or fault location of the target network segment; and generating a fault identifier for the target network segment based on the fault information of the target network segment.
[0287] Optionally, the memory 1002 may also store data. Optionally, the processor 1001 may also read data stored in the memory 1002, which may be stored at the same memory address as the executable program code 1003, or the data may be stored at a different memory address than the executable program code 1003.
[0288] For example, the processor 1001 and memory 1002 can be configured separately or integrated together, for example, integrated on the system-on-chip (SOC) of the terminal device.
[0289] For example, the memory 1002 can be used to store the relevant program of the vehicle communication fault determination method provided in the embodiments of this application, and the processor 1001 can be used to call the executable program code 1003 stored in the memory 1002 when controlling the vehicle to execute the vehicle communication fault determination method of the embodiments of this application.
[0290] This application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method for determining vehicle communication faults in any of the foregoing embodiments.
[0291] The computer-readable storage medium may include, but is not limited to, any type of disk, including floppy disks, optical disks, Digital Video Discs (DVDs), Compact Disc Read-Only Memory (CD-ROMs), microdrives, and magneto-optical disks, read-only memory (ROMs), random access memory (RAMs), erasable programmable read-only memory (EPROMs), electrically erasable programmable read-only memory (EEPROMs), dynamic random access memory (DRAMs), video random access memory (VRAMs), flash memory devices, magnetic cards or optical cards, nanosystems (including molecular memory ICs), or any type of medium or device suitable for storing instructions and / or data.
[0292] This application also provides a computer program product that, when run on a computer, causes the computer to perform the aforementioned related steps to implement the method for determining vehicle communication faults in the above embodiments.
[0293] In addition, the electronic device provided in the embodiments of this application may specifically be a chip, component or module. The electronic device may include a connected processor and a memory. The memory is used to store instructions. When the electronic device is running, the processor may call and execute the instructions to make the chip execute the vehicle communication fault determination method in the above embodiments.
[0294] The vehicle, computer-readable storage medium, computer program product or chip provided in this application are all used to execute the corresponding vehicle communication fault determination method provided above. Therefore, the beneficial effects that can be achieved can be referred to the beneficial effects in the corresponding vehicle communication fault determination method provided above, and will not be repeated here.
[0295] Through the above description of the embodiments, those skilled in the art will understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0296] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0297] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method of determining a vehicle communication failure, characterized in that, The gateway applied in the vehicle, the determination method includes: Send the first message to the target network segment; Detect whether a response packet corresponding to the first packet exists in the target network segment; If the response message exists in the target network segment, the fault information of the target network segment is obtained based on the number of response messages. The fault information of the target network segment is used to indicate the fault type and / or fault location of the target network segment. Based on the fault information of the target network segment, a fault identifier for the target network segment is generated.
2. The determination method according to claim 1, characterized in that, The process of obtaining fault information of the target network segment based on the number of response messages includes: If the number of response messages is less than a first preset number, the fault information of the target network segment is obtained based on the location information of each node in the target network segment and the response messages. When the number of response messages is the first preset number, the fault information of the target network segment is obtained based on the voltage value of the level line in the target network segment.
3. The determination method according to claim 2, characterized in that, When the number of response messages is less than a first preset number, the fault information of the target network segment is obtained based on the location information of each node in the target network segment and the response messages, including: Based on the response message, determine the nodes in the target network segment that did not send the response message; Based on the location information of each node in the target network segment, a first node is determined from the nodes in the target network segment that have not sent the response message. The first node is the node that is closest to the gateway among the nodes that have not sent the response message. The fault information of the target network segment is determined to be an open circuit between the first node and the second node, wherein the second node is adjacent to the first node.
4. The determination method according to claim 2, characterized in that, The target network segment includes a first level line and a second level line. When the number of response messages is the first preset number, fault information of the target network segment is obtained based on the voltage values of the level lines in the target network segment, including: The voltage difference is obtained based on the voltage values of the first and second level lines. If, within a preset acquisition period, the voltage difference is detected to be less than a first preset voltage threshold, the fault information of the target network segment is determined to be a short circuit between the first level line and the second level line.
5. The determination method according to claim 2, characterized in that, When the number of response messages is the first preset number, the fault information of the target network segment is obtained based on the voltage value of the level line in the target network segment, including: If, within a preset acquisition period, the voltage values of all the level lines in the target network segment are less than a first preset voltage threshold, the fault information of the target network segment is determined to be a short circuit to ground of the level line. If, within the preset acquisition period, the voltage values of all the level lines in the target network segment are greater than the second preset voltage threshold, the fault information of the target network segment is determined to be a short circuit between the level lines and the power supply.
6. The determining method according to claim 4 or 5, characterized in that, The determination method further includes: Obtain the communication cycle of the target network segment; Based on the communication period, the preset acquisition period is obtained, and the duration of the preset acquisition period is greater than or equal to the communication period.
7. The determination method according to claim 2, characterized in that, The target network segment includes a voltage sampling circuit, and the determination method further includes: Obtain the voltage value at the sampling point in the voltage sampling circuit; Based on the voltage division ratio of the voltage sampling circuit and the voltage value of the sampling point, the voltage value of the level line in the target network segment is obtained.
8. The determination method according to claim 7, characterized in that, The voltage sampling circuit includes a first resistor and a second resistor. The step of obtaining the voltage value of the level line in the target network segment based on the voltage division ratio of the voltage sampling circuit and the voltage value of the sampling point includes: Determine the target resistance value based on the first resistor and the second resistor; The voltage division ratio is determined based on the target resistance value and the first resistance; or, The voltage division ratio is determined based on the target resistance value and the second resistance; The first resistor is located between the sampling point and ground, and the second resistor is located between the sampling point and the power supply.
9. The determining method according to any one of claims 1 to 5, characterized in that, The determination method further includes: If the response message is not present in the target network segment, obtain the bus status of the target network segment; When the bus status is not in the bus off state, the fault information of the target network segment is determined to be an open circuit between the gateway and the third node; The third node is the node in the target network segment that is closest to the gateway.
10. A vehicle, characterized in that, The vehicles include: Memory, used to store executable program code; A processor for calling and running the executable program code from the memory, causing the vehicle to perform the determination method as described in any one of claims 1 to 9.
