Bus fault diagnosis method and device, electronic equipment and computer readable medium
By judging the integrity of the detection packet on the target gateway node in the vehicle network and determining the identity information of the control object, the problem of high cost or difficulty in accurately locate the fault location of the existing bus fault detection methods is solved, and fast and accurate fault location and cost reduction are achieved.
Patent Information
- Application Number
- CN202510174047.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-17
- Publication Date
- 2025-06-24
AI Technical Summary
Existing bus fault detection methods are costly or difficult to accurately locate the fault location, hardware detection costs are high, while software detection is difficult to accurately locate the fault location.
By obtaining the detection message sent by the control object on the target gateway node in the on-board network, the integrity of the detection message is judged to determine whether it is an error frame. If the error frame is wrong, the identity information of the control object is determined based on the detection message as the fault identity information.
It realizes rapid and accurate positioning of bus failures, reduces detection costs, and improves the accuracy of fault positioning, avoiding major accidents in the vehicle.
Smart Images

Figure CN120200938A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of fault diagnosis, and more specifically, to a bus fault diagnosis method, apparatus, electronic device, and computer-readable medium. Background Art
[0002] Bus fault detection includes hardware detection and software detection. Hardware detection is to place a transistor or a field effect transistor at the front end of the transceiver of each node of the bus, and locate the fault position of the bus by identifying the on and off states of the transistor or the field effect transistor. The cost of the hardware detection method is relatively high.
[0003] Software detection is to locate the bus fault by detecting whether the message is lost. Although the cost of software detection is lower than that of hardware detection, it is difficult to accurately locate the specific position of the bus fault by this method. Summary of the Invention
[0004] This application provides a bus fault diagnosis method, apparatus, electronic device, and computer-readable medium to improve the above-mentioned defects.
[0005] In a first aspect, this application provides a bus fault diagnosis method, which is applied to a target gateway node in a vehicle network. The vehicle network is composed of multiple sub-networks. One sub-network includes a gateway node and a controller connected to a bus. The multiple gateway nodes in the vehicle network are hierarchically distributed. Among them, the target gateway node is the gateway node with the highest level in its sub-network. The method includes: obtaining a detection message sent by a control object in the sub-network where the target gateway node is located, where the control object is a controller or a secondary gateway node, and the level of the secondary gateway node is lower than the level of the target gateway node; determining whether the detection message is an error frame according to the integrity of the detection message; if the detection message is an error frame, determining the identity information of the control object according to the detection message as the fault identity information of the sub-network where the target gateway node is located.
[0006] Optionally, for a possible implementation, the determining whether the detection message is an error frame according to the integrity of the detection message includes: determining whether the detection message is complete; if the detection message is not complete, determining that the detection message is an error frame; if the detection message is complete, determining that the detection message is not an error frame.
[0007] Optionally, for a possible implementation, if the detected message is an error frame, determining the identity information of the control object according to the detected message as the fault identity information of the sub-network where the target gateway node is located includes: if the detected message is an error frame, determining whether the arbitration field information of the detected message is complete; if the arbitration field information of the detected message is complete, determining the identity information of the control object that sends the detected message based on the arbitration field information as the fault identity information of the sub-network where the target gateway node is located.
[0008] In a second aspect, the present application also provides a bus fault diagnosis method applied to a vehicle network. The vehicle network consists of multiple sub-networks. One sub-network includes a gateway node and a controller connected to a bus. The multiple gateway nodes in the vehicle network are hierarchically distributed. Among them, the gateway node at the highest level is used as the main gateway node of the vehicle network. The method includes: the main gateway node obtains the fault identity information of each sub-network, where the fault identity information is determined based on the bus fault diagnosis method in the first aspect; the main gateway node determines the bus detection result of the vehicle network based on the fault identity information of each sub-network.
[0009] Optionally, for a possible implementation, before the main gateway node obtains the fault identity information of each sub-network, it further includes: each target gateway node determines the fault identity information of the sub-network where it is located, and the fault identity information is determined based on the bus fault diagnosis method in the first aspect; when there is a secondary gateway node in the sub-network where each target gateway node is located, the target gateway node obtains the fault identity information sent by the secondary gateway node; when the target gateway node is not the main gateway node, the target gateway node sends the fault identity information of the sub-network where it is located and the fault identity information received from the secondary gateway node to the upper-level gateway node in the same sub-network as the target gateway node, and the level of the upper-level gateway node is higher than that of the target gateway node.
[0010] Optionally, for a possible implementation, the main gateway node determines the bus detection result of the vehicle network based on the fault identity information of each sub-network, including: the main gateway node determines the total number corresponding to each fault identity information based on the fault identity information of each sub-network; if the total number is greater than the threshold, it is determined that the bus detection result of the vehicle network is that there is a bus fault in the sub-network where the control object corresponding to the fault identity information is located.
[0011] Optionally, for a possible implementation, after the master gateway node determines the bus detection result of the vehicle-mounted network based on the fault identity information of each sub-network, the method further includes: sending the bus detection result to the cloud.
[0012] In a third aspect, the present application further provides a bus fault diagnosis device, which is applied to a target gateway node in a vehicle-mounted network. The vehicle-mounted network is composed of multiple sub-networks. One sub-network includes a gateway node and a controller connected to a bus. The multiple gateway nodes in the vehicle-mounted network are hierarchically distributed. Among them, the target gateway node is the gateway node with the highest level in the sub-network where it is located. The device includes: an acquisition unit, configured to acquire a detection message sent by a control object in the sub-network where the target gateway node is located, where the control object is a controller or a secondary gateway node, and the level of the secondary gateway node is lower than the level of the target gateway node; a judgment unit, configured to determine whether the detection message is an error frame by the integrity of the detection message; a detection unit, configured to, if the detection message is an error frame, determine the identity information of the control object according to the detection message as the fault identity information of the sub-network where the target gateway node is located.
[0013] In a fourth aspect, the present application further provides an electronic device, including: one or more processors; a memory; one or more application programs, where the one or more application programs are stored in the memory, and the one or more application programs are configured to be executed by the one or more processors, and the one or more application programs are configured to execute the above method.
[0014] In a fifth aspect, the present application further provides a computer-readable medium, where the readable storage medium stores program code executable by a processor, and when the program code is executed by the processor, the processor executes the above method.
[0015] In a sixth aspect, the present application further provides a computer program product, including computer programs / instructions, and when the computer programs / instructions are executed by a processor, the above method is implemented.
[0016] The present application provides a bus fault diagnosis method, which is applied to a target gateway node in a vehicle network. The vehicle network is composed of multiple sub-networks. One sub-network includes a gateway node and a controller connected to a bus. The multiple gateway nodes in the vehicle network are hierarchically distributed. Among them, the target gateway node is the gateway node with the highest level in its sub-network. The method includes: First, obtain a detection message sent by a control object in the sub-network where the target gateway node is located. The control object is a controller or a secondary gateway node, and the level of the secondary gateway node is lower than that of the target gateway node. Second, determine whether the detection message is an error frame based on the integrity of the detection message. Then, if the detection message is an error frame, determine the identity information of the control object according to the detection message as the fault identity information of the sub-network where the target gateway node is located.
[0017] On the one hand, in the present application, the target gateway node determines whether the detection message is an error frame based on the integrity of the detection message. When the detection message is an error frame, the fault identity information in the sub-network where it is located is determined based on the detection message. That is, when the control object sends an error, the target gateway node can detect the fault identity information based on the detection message, and the bus fault can be quickly located. On the other hand, the present application can not only detect the bus fault, but also determine the fault identity information in the sub-network based on the detection message. That is, the present application can locate which control object has a problem with the connection to the bus based on the fault identity information, and the accuracy of the bus fault location of the present application is relatively high. The present application can timely and accurately detect the occasional faults of the bus, and thus can avoid major accidents of the vehicle.
[0018] Other features and advantages of the present application will be described in the subsequent specification, and part of them will become obvious from the specification, or will be understood by implementing the present application. The objectives and other advantages of the present application can be achieved and obtained through the structures specifically pointed out in the written specification, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present application. For those skilled in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0020] Figure 1 Shows a schematic diagram of the vehicle network topology structure provided by the embodiment of the present application;
[0021] Figure 2 Shows a flowchart of the bus fault diagnosis method provided by the embodiment of the present application;
[0022] Figure 3 shows the method flowchart of the bus fault diagnosis method provided by another embodiment of the present application;
[0023] Figure 4 shows the method flowchart of the bus fault diagnosis method provided by yet another embodiment of the present application;
[0024] Figure 5 shows the structural block diagram of the bus fault diagnosis method device provided by the embodiment of the present application;
[0025] Figure 6 shows the structural block diagram of the electronic device provided by the embodiment of the present application;
[0026] Figure 7 shows the structural block diagram of the computer-readable storage medium provided by the embodiment of the present application;
[0027] Figure 8 shows the structural block diagram of the computer program product provided by the embodiment of the present application. Detailed implementation manners
[0028] In order to enable those skilled in the art of the present technology to better understand the solution of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Usually, the components of the embodiments of the present application described and shown in the accompanying drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application to be protected, but only represents the selected embodiments of the present application. All other embodiments obtained by those skilled in the art based on the embodiments of the present application without creative efforts belong to the scope of protection of the present application.
[0029] It should be noted that: similar reference numerals and letters represent similar items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of the present application, the terms "first", "second", etc. are only used for distinguishing descriptions and cannot be understood as indicating or implying relative importance.
[0030] Bus fault detection includes hardware detection and software detection. Hardware detection is to place a transistor or a field effect transistor at the front end of the transceiver of each node of the bus, and locate the fault position of the bus by identifying the on and off states of the transistor or the field effect transistor. The cost of the hardware detection method is relatively high.
[0031] The software detects bus faults by checking whether detection messages are lost. Although the cost of software detection is lower than that of hardware detection, since bus faults usually affect all nodes on the entire bus and each node will record the loss faults of other nodes, although this method can locate a fault on a certain bus, it is difficult to accurately locate the specific location of the bus fault.
[0032] Therefore, in the embodiments of the present application, a bus fault diagnosis method, device, electronic device and computer-readable medium are provided to solve or partially solve the above problems.
[0033] It should be noted that the bus can be a Controller Area Network (CAN) bus or a Controller Area Network Flexible Data-rate (CANFD) bus.
[0034] This application is applied to in-vehicle networks. Please refer to Figure 1 , which shows an in-vehicle network. Here, ECU represents a controller, CAN represents a bus. The in-vehicle network consists of multiple sub-networks 11. One sub-network includes a gateway node and a controller connected to a bus. The multiple gateway nodes in the in-vehicle network are hierarchically distributed. Among them, the target gateway node is the gateway node with the highest hierarchy in its corresponding sub-network. Among them, the gateway node with the highest hierarchy serves as the main gateway node of the in-vehicle network.
[0035] It should be noted that the number of sub-networks is the same as the number of buses in the in-vehicle network, and the number of target gateway nodes is the same as the number of sub-networks. For example, if there are 6 buses in the in-vehicle network, it means that the in-vehicle network consists of 6 sub-networks and there are 6 target gateway nodes in this in-vehicle network.
[0036] Exemplarily, taking the CAN4 bus as an example, the sub-network corresponding to the CAN4 bus includes the gateway node 2, ECU1, and ECU2 connected to the CAN4. The gateway node 2 is the target gateway node in the sub-network corresponding to the CAN4 bus.
[0037] Exemplarily, taking the CAN2 bus as an example, the sub-network corresponding to the CAN2 bus includes the gateway node 1 and the gateway node 3 connected to the CAN2. Since the level of the gateway node 1 is higher than that of the gateway node 3, in the sub-network corresponding to the CAN2, the gateway node 1 is the target gateway node. For the in-vehicle network of the whole vehicle, the level of the gateway node 1 is the highest and it is the main gateway node of the whole vehicle. Similarly, taking the CAN5 bus as an example, the sub-network corresponding to the CAN5 bus includes the gateway node 3, the ECU6, and the ECU7 connected to the CAN5. The gateway node 3 is the target gateway of the sub-network corresponding to the CAN5 bus.
[0038] It should be noted that a sub-network includes the gateway nodes and controllers connected to a bus. If no controller is connected to the bus in the sub-network, then the sub-network includes the gateway nodes connected to the corresponding bus.
[0039] Exemplarily, if there are gateway nodes and controllers connected to a bus, then the sub-network corresponding to the bus includes all the gateway nodes and controllers connected to the bus. If only gateway nodes are connected to a bus, then the sub-network corresponding to the bus includes all the gateway nodes connected to the bus.
[0040] It should be noted that the levels of the gateway nodes are set in advance, and the levels of the gateway nodes are distributed in a tree structure.
[0041] Please refer to Figure 2 , which shows the flowchart of a bus fault diagnosis method provided by an embodiment of the present application. The method specifically includes steps S101 to step S103.
[0042] Step S101: Obtain the detection message sent by the control object in the sub-network where the target gateway node is located. The control object is a controller or a secondary gateway node, and the level of the secondary gateway node is lower than that of the target gateway node.
[0043] It should be noted that for a sub-network, the gateway node with the highest level in the sub-network is the target gateway node. The bus fault in the sub-network where the target gateway node is located can be detected through the target gateway node. In this way, each target gateway node in the in-vehicle network can detect the bus fault in the sub-network where it is located.
[0044] Specifically, the target gateway node obtains the detection message sent by the control object in the sub-network where it is located, and then determines the bus fault in the sub-network based on the detection message.
[0045] It should be noted that when the control object sends a detection message to the bus according to a preset period, the target gateway node obtains the detection message sent by the control object through the bus. Moreover, the target gateway node only receives the detection message sent by one controller or secondary gateway node at the same time.
[0046] Exemplarily, if the subnet where the target gateway node is located includes the target gateway node and a controller, the target gateway node obtains the detection message sent by the controller.
[0047] Exemplarily, if the subnet where the target gateway node is located includes the target gateway node and a secondary gateway node, the target gateway node obtains the detection message sent by the secondary gateway node.
[0048] Exemplarily, if the subnet where the target gateway node is located includes the target gateway node, a controller, and a secondary gateway node, the target gateway node obtains the detection message sent by the secondary gateway node or the controller.
[0049] It should be noted that the detection message is the data uploaded by the control object to the target gateway node through the bus. The detection message usually can include a start segment, an arbitration segment, a control segment, a data segment, a CRC segment, and an ACK segment.
[0050] Step S102: Determine whether the detection message is an error frame based on the integrity of the detection message.
[0051] It should be noted that the control object sends the detection message to the bus bit by bit. The target gateway node and other control objects connected to the bus can receive the detection message through the bus. When other control objects or the target gateway node in this subnet detect that an error occurs in the transmission of a certain bit of data, the control object stops sending data. Therefore, the detection message received by the target gateway node may not be complete, and an incomplete detection message is also an error frame.
[0052] Therefore, the target gateway node needs to determine whether the detection message is an error frame based on the integrity of the detection message.
[0053] It should be noted that if the target gateway node can receive the detection file within the preset period, it means that there is no serious fault such as the bus being disconnected. If the data of the detection message is complete, it means that there is no abnormality in the bus during the process of uploading the detection message based on the bus. If the data of the detection message is not complete, it means that there is an abnormality in the bus during the process of uploading the detection message based on the bus, and this abnormality is an occasional fault.
[0054] The target gateway node can compare the format of the detection message with the format of the normal message to detect whether the data of the detection message is complete.
[0055] Step S103: If the detected message is an error frame, determine the identity information of the control object according to the detected message, and use it as the fault identity information of the subnet where the target gateway node is located.
[0056] If the detected message is incomplete, it means the detected message is an error frame. Then determine the identity information of the control object according to the detected message, and use it as the fault identity information of the subnet where the target gateway node is located.
[0057] It should be noted that each controller and gateway node in the vehicle network has a unique identity information. The fault identity information represents the identity information of the control object that is connected to the bus and has a bus fault. Based on the identity information, it is possible to locate which gateway node or which controller the identity information corresponds to, and thus the specific location of the bus fault can be located.
[0058] Exemplarily, if the fault identity information in the subnet corresponding to the CAN5 bus is ECU6, it means that there is a fault in the connection between ECU6 and the CAN5 bus.
[0059] Exemplarily, for the target gateway node of a subnet, first, the target gateway node obtains the detected message sent by the control object in the subnet where it is located. Then, determine whether the detected message is an error frame according to the integrity of the detected message. If the detected message is an error frame, determine the identity information of the control object based on the detected message, and use it as the fault identity information in the subnet.
[0060] It is difficult to determine the bus fault by the method of whether the detected message can be received, because it may be that the sending end of the detected message fails, or the bus is disconnected. This method is difficult to locate whether it is a bus fault, nor can it locate the specific location of the bus fault. Moreover, obtaining the detected message periodically has a delay and cannot detect the fault in time.
[0061] And this application proposes a bus fault detection method. On the one hand, this application determines whether the detected message is an error frame by the target gateway node according to the integrity of the detected message. When the detected message is an error frame, determine the fault identity information in the subnet where it is located based on the detected message. That is, when the control object sends an error, the target gateway node can detect the fault identity information based on the detected message and can quickly locate the bus fault. On the other hand, this application can not only detect the bus fault, but also determine the fault identity information in the subnet based on the detected message. That is, this application can locate which control object has a problem with the connection to the bus based on the fault identity information, and the accuracy of bus fault location in this application is relatively high.
[0062] It should be noted that a bus disconnection is a relatively serious bus fault. Before the bus disconnection, there are minor and occasional bus faults. If the minor bus faults can be detected before the bus disconnection and the bus is repaired or replaced in a timely manner, greater faults can be avoided. Especially when applied to vehicles, the present application can detect the occasional faults of the bus in a timely and accurate manner, thereby avoiding major accidents in the vehicle.
[0063] Please refer to Figure 3 , which shows a method flowchart of a bus fault diagnosis method provided by an embodiment of the present application, applied to a target gateway node in a vehicle network. The vehicle network is composed of multiple sub-networks. One sub-network includes a gateway node and a controller connected to a bus. The multiple gateway nodes in the vehicle network are distributed hierarchically. Among them, the target gateway node is the gateway node with the highest level in its sub-network. The method specifically includes steps S201 to S206.
[0064] Step S201: Obtain a detection message sent by a control object in the sub-network where the target gateway node is located. The control object is a controller or a secondary gateway node, and the level of the secondary gateway node is lower than the level of the target gateway node.
[0065] Among them, step S201 has been introduced in detail in the foregoing embodiment and will not be elaborated here.
[0066] Step S202: Determine whether the detection message is complete.
[0067] If there is no occasional bus fault during the transmission process and there is no fault in the sending end of the detection message, the detection message that the target gateway node can receive is complete. If there is an occasional bus fault during the transmission process, the detection message that the target gateway node can receive is not complete. Therefore, it is necessary to determine whether the detection message is an error frame by whether the detection message is complete.
[0068] Step S203: If the detection message is not complete, determine that the detection message is an error frame.
[0069] If the detection message is missing at least one of the start segment, arbitration segment, control segment, data segment, CRC segment, or ACK segment, it means that the detection message is incomplete, indicating that the detection message is not a normal format message, and the detection message is an error frame.
[0070] Step S204: If the detection message is complete, determine that the detection message is not an error frame.
[0071] If the detection message includes a start segment, an arbitration segment, a control segment, a data segment, a CRC segment, and an ACK segment, it indicates that the detection message is a message in normal format, indicating that the detection message is complete and the detection message is not an error frame.
[0072] Step S205: If the detection message is an error frame, determine whether the arbitration field information of the detection message is complete.
[0073] If the detection message is an error frame, it indicates that a transmission failure has occurred during the process of the control object uploading data through the bus.
[0074] It should be noted that a detection message in normal format should include a start segment, an arbitration segment, a control segment, a data segment, a CRC segment, and an ACK segment. When uploading data, the start segment, arbitration segment, control segment, data segment, CRC segment, and ACK segment are uploaded in sequence. A bus failure may occur during the upload of any segment. Therefore, when the detection message is not complete, the arbitration segment may be uploaded successfully or may fail to be uploaded. The arbitration segment includes arbitration field information, and the arbitration field information includes the identity information of the control object that sent the detection message. Therefore, this application needs to determine whether the arbitration field information of the detection message is complete.
[0075] Step S206: If the arbitration field information of the detection message is complete, determine the identity information of the control object that sent the detection message based on the arbitration field information, as the fault identity information of the sub-network where the target gateway node is located.
[0076] If the arbitration field information of the detection message is complete, the identity information of the control object that sent the detection message can be determined based on the arbitration field information, as the fault identity information of the sub-network where the target gateway node is located. That is, it is determined which control object in the sub-network has a faulty connection to the bus.
[0077] This application determines whether the detection message is an error frame by judging the integrity of the detection message. If the detection message is an error frame, it determines whether the arbitration field information of the detection message is complete. If the arbitration field information is complete, it determines the identity information of the control object based on the arbitration field information, as the fault identity information of the sub-network where the target gateway node is located, and the specific location of the bus fault can be determined based on the fault identity information.
[0078] For the case of bus disconnection, it is relatively easy to detect. However, it is difficult to quickly and accurately detect minor anomalies or small faults before the bus disconnection. On the one hand, this application can, based on the acquired detection messages, timely locate the fault identity information based on the detection messages, without having to wait until the messages are lost to detect the bus fault, thus greatly improving the timeliness of bus fault detection. On the other hand, this application can locate the fault identity information in the sub-network where the target gateway node is located based on the detection messages, rather than locating a fault in the entire bus, and can more accurately locate the bus fault.
[0079] Please refer to Figure 4 , which shows a method flowchart of a bus fault diagnosis method provided by an embodiment of this application, applied to a vehicle network. The vehicle network consists of multiple sub-networks. One sub-network includes a gateway node and a controller connected to a bus. The multiple gateway nodes in the vehicle network are hierarchically distributed. Among them, the gateway node at the highest level serves as the main gateway node of the vehicle network. This method specifically includes steps S301 to S302.
[0080] Step S301: The main gateway node acquires the fault identity information of each sub-network, where the fault identity information is determined based on the bus fault diagnosis method of the foregoing embodiment.
[0081] Please refer to Figure 1 , which shows a vehicle network. It can be known that each controller or gateway node can transmit data to the main gateway node of the vehicle through the bus.
[0082] Each target gateway node can obtain the fault identity information of each sub-network based on the bus fault diagnosis method in the foregoing embodiment, that is, each target gateway node can transmit the fault identity information to the main gateway node through the bus.
[0083] Further, before step S301: The main gateway node acquires the fault identity information of each sub-network, it further includes:
[0084] Step S3011: Each target gateway node determines the fault identity information of the sub-network where it is located, and the fault identity information is determined based on the bus fault diagnosis method in the foregoing embodiment.
[0085] It should be noted that the vehicle network consists of multiple sub-networks. There is a target gateway node in each sub-network. Each target gateway node can determine the fault identity information in the sub-network where it is located based on the fault detection method of the foregoing embodiment.
[0086] Step S3012: When there is a secondary gateway node in the sub-network where each target gateway node is located, the target gateway node obtains the fault identity information sent by the secondary gateway node.
[0087] In order to be able to transmit the fault identity information in each target sub-network to the main gateway node, when there is a secondary gateway node in the sub-network where the target gateway node is located, the target gateway node obtains the fault identity information sent by the secondary gateway node. The target gateway node can forward the fault identity information of the secondary gateway node connected to it.
[0088] Step S3013: When the target gateway node is not the main gateway node, the target gateway node sends the fault identity information of the sub-network where it is located and the fault identity information received from the secondary gateway node to the upper-level gateway node in the same sub-network as the target gateway node, and the level of the upper-level gateway node is higher than that of the target gateway node.
[0089] If the target gateway node is the main gateway node, the bus fault can be directly determined based on the obtained fault identity information of each sub-network. If the target gateway node is not the main gateway node, the fault diagnosis information of the sub-network where it is located needs to be transmitted to the main gateway node. For this purpose, when the target gateway node is not the main gateway node, the target gateway node sends the fault identity information of the sub-network where it is located and the fault identity information received from the secondary gateway node to the upper-level gateway node in the same sub-network as the target gateway node. In this way, the fault identity information of each sub-network can be directly or indirectly transmitted to the main gateway node, and the main gateway node can obtain the fault identity information of all sub-networks.
[0090] An exemplary one, please refer to Figure 1 , gateway node 1 is the main gateway node of the whole vehicle. Gateway node 2 sends the fault identity information of the sub-network corresponding to CAN4 bus to gateway node 1 through bus CAN3. Gateway node 2 sends the fault identity information of the sub-network corresponding to CAN6 bus to gateway node 1 through bus CAN3. Gateway node 3 sends the fault identity information of the sub-network corresponding to CAN5 bus to gateway node 1 through bus CAN2. Gateway node 1 can directly obtain the fault identity information of the sub-network corresponding to CAN1 bus, the fault identity information of the sub-network corresponding to CAN2 bus, and the fault identity information of the sub-network corresponding to CAN3 bus, and indirectly obtain the fault identity information of the sub-network corresponding to CAN4 bus, the fault identity information of the sub-network corresponding to CAN5 bus, and the fault identity information of the sub-network corresponding to CAN6 bus.
[0091] Step S302: The main gateway node determines the bus detection result of the vehicle-mounted network based on the fault identity information of each sub-network.
[0092] After the main network node obtains the fault identity information of each sub-network, it can count the fault identity information. When the number of the same fault identity information is greater than the preset number, it is considered that there is a bus fault in the sub-network for this fault identity information.
[0093] Further, step S302: The main network node determines the bus detection result of the vehicle-mounted network based on the fault identity information of each sub-network, including:
[0094] Step S3021: The main network node determines the total number corresponding to each fault identity information based on the fault identity information of each sub-network.
[0095] Based on the received fault identity information of each sub-network, the main network node counts the number of each fault identity information within a period of time to obtain the total number corresponding to each fault identity information.
[0096] Step S3022: If the total number is greater than the threshold, it is determined that there is a bus fault in the sub-network where the control object corresponding to the fault identity information is located for the bus detection result of the vehicle-mounted network.
[0097] If the total number is greater than the threshold, it means that the bus corresponding to this fault identity information frequently fails within a period of time. Then it is determined that the bus detection result of the vehicle-mounted network is that there is a bus fault in the sub-network where the control object corresponding to the fault identity information is located.
[0098] Exemplarily, the main network node determines the total number corresponding to each fault identity information based on the fault identity information of each sub-network. If the fault identity information includes ECU1, ECU3, ECU6, and ECU7 within a period of time, and the total numbers corresponding to the fault identity information ECU1, ECU3, ECU6, and ECU7 within this period are 1, 2, 6, and 10 respectively. The threshold is 9, then it is determined that there is a fault in the connection between ECU7 and its corresponding CAN5 bus.
[0099] This application can more accurately locate the bus fault without increasing the cost.
[0100] Further, after the main network node determines the bus detection result of the vehicle-mounted network based on the fault identity information of each sub-network, it further includes: sending the bus detection result to the cloud.
[0101] The bus detection results can be uploaded to the cloud periodically. The uploaded data includes: the name of the controller and the number of occurrences of CAN bus faults. This facilitates later data analysis of bus faults and extraction of improvement experience. The cloud system can monitor the bus fault information uploaded by the vehicle in real time and prompt fault warning information.
[0102] It should be noted that the target gateway node can send the fault province information to the upper-level gateway node in the form of a custom message. Specifically, the name of the custom message can include the bus information in the sub-network where it is located, and the data field length (unit: bit) of the custom message is the number of controlled objects (up to 64 nodes can be recorded). The definition of each bit in the message data field is shown in the following table.
[0103] Bit0 Bit1 Bit2 …… Bit63 Slave1St Slave2St Slave3St …… Slave64St
[0104] It should be noted that the target gateway node can send custom messages to the upper-level gateway node periodically, and the sending period can be configured according to requirements. For example, the period is 1000 ms.
[0105] Please refer to Figure 5 , which shows a structural block diagram of a bus fault diagnosis method device 600 provided by an embodiment of the present application. The test device 600 includes: an acquisition unit 610, a judgment unit 620, and a detection unit 630.
[0106] The acquisition unit 610 is configured to acquire a detection message sent by a controlled object in the sub-network where the target gateway node is located. The controlled object is a controller or a secondary gateway node, and the level of the secondary gateway node is lower than that of the target gateway node.
[0107] The judgment unit 620 is configured to determine whether the detection message is an error frame based on the integrity of the detection message.
[0108] Further, the judgment unit 620 can also be configured to judge whether the detection message is complete; if the detection message is not complete, it is determined that the detection message is an error frame; if the detection message is complete, it is determined that the detection message is not an error frame.
[0109] The detection unit 630 is configured to, if the detection message is an error frame, determine the identity information of the controlled object according to the detection message as the fault identity information of the sub-network where the target gateway node is located.
[0110] Further, the detection unit 630 can also be used to determine whether the arbitration field information of the detection message is complete if the detection message is an error frame; if the arbitration field information of the detection message is complete, determine the identity information of the control object that sends the detection message based on the arbitration field information, and use it as the fault identity information of the subnet where the target gateway node is located.
[0111] Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the above-described devices and modules can refer to the corresponding processes in the foregoing method embodiments, and will not be described herein again.
[0112] In several embodiments provided in the present application, the coupling between modules can be electrical, mechanical, or other forms of coupling.
[0113] In addition, in each embodiment of the present application, each functional module can be integrated in a processing module, or each module can exist physically alone, or two or more modules can be integrated in one module. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules.
[0114] Please refer to Figure 6 , which shows a structural block diagram of an electronic device 700 provided by an embodiment of the present application. The electronic device 700 can be a vehicle-mounted system, and the vehicle-mounted system can be set in a vehicle. The electronic device 700 in the present application can include one or more of the following components: a processor 711, a memory 712, and one or more application programs, where the processor 711 is electrically connected to the memory 712, and the one or more programs are configured to execute the methods described in the foregoing embodiments of the test method.
[0115] The processor 711 may include one or more processing cores. The processor 711 connects various parts within the entire electronic device 700 using various interfaces and lines, and executes various functions of the electronic device 700 and processes data by running or executing instructions, programs, code sets, or instruction sets stored in the memory 712, and by invoking the data stored in the memory 712. Optionally, the processor 711 may be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), or programmable logic array (PLA). The processor 711 may integrate a combination of one or several of a central processing unit (CPU), a graphics processing unit (GPU), and a modem, etc. Among them, the CPU mainly processes the operating system, user interface, computer programs, etc.; the GPU is responsible for rendering and drawing display content; the modem is used to process wireless communication. It can be understood that the above-mentioned modem may not be integrated into the processor 711 and may be implemented separately through a communication chip. Specifically, the above-described method may be executed by one or more processors 711.
[0116] For some embodiments, the memory 712 may include random access memory (RAM) and may also include read-only memory. The memory 712 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 712 may include a program storage area and a data storage area. Among them, the program storage area may store instructions for implementing the operating system, instructions for implementing at least one function, instructions for implementing each of the following method embodiments, etc. The data storage area may also store data created during the use of the electronic device 700.
[0117] Please refer to Figure 7 , which shows a structural block diagram of a computer-readable medium provided by an embodiment of the present application. Program code is stored in the computer-readable medium 800, and the program code can be called by a processor to execute the method described in the above method embodiments.
[0118] The computer-readable medium 800 can be an electronic memory such as a flash memory, EEPROM (Electrically Erasable Programmable Read-Only Memory), EPROM, hard disk, or ROM. Optionally, the computer-readable medium 800 includes a non-transitory computer-readable storage medium. The computer-readable medium 800 has a storage space for program code 810 that executes any of the method steps in the above-described method. These program codes can be read from or written to one or more computer program products. The program code 810 can be compressed in a suitable form, for example.
[0119] Please refer to Figure 8 , which shows a structural block diagram 900 of a computer program product provided by an embodiment of the present application. The computer program product 900 includes a computer program / instructions 910, and when the computer program / instructions 910 are executed by a processor, the steps of the above-described method are implemented.
[0120] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A bus fault diagnosis method, characterized in that: A method for applying a target gateway node in a vehicle network, wherein the vehicle network is composed of a plurality of sub-networks, wherein one of the sub-networks comprises a gateway node and a controller connected to a bus, wherein the plurality of gateway nodes in the vehicle network are distributed hierarchically, wherein the target gateway node is a gateway node of the highest level in the sub-network in which the target gateway node is located, and wherein the method comprises: Acquire a detection message sent by a control object in a subnetwork where the target gateway node is located, wherein the control object is a controller or a secondary gateway node, and the level of the secondary gateway node is lower than the level of the target gateway node; Determining whether the detection message is an error frame by the integrity of the detection message; If the detection message is an error frame, the identity information of the control object is determined according to the detection message as the fault identity information of the sub-network where the target gateway node is located.
2. The method according to claim 1, characterized in that The step of determining whether the detection message is an error frame by detecting the integrity of the message includes: Determining whether the detection message is complete; If the detection message is not complete, determining that the detection message is an error frame; If the detection message is complete, it is determined that the detection message is not an error frame.
3. The method according to claim 1, characterized in that If the detection message is an error frame, determining the identity information of the control object according to the detection message as the fault identity information of the subnet where the target gateway node is located includes: If the detection message is an error frame, determining whether the arbitration field information of the detection message is complete; If the arbitration field information of the detection message is complete, the identity information of the control object that sends the detection message is determined based on the arbitration field information as the fault identity information of the subnetwork where the target gateway node is located.
4. A bus fault diagnosis method, characterized in that: Applied to an in-vehicle network, the in-vehicle network is composed of multiple sub-networks, one of the sub-networks includes a gateway node and a controller connected to a bus, the multiple gateway nodes in the in-vehicle network are distributed in a hierarchical manner, wherein the gateway node at the highest level serves as the main gateway node of the in-vehicle network, the method includes: The main gateway node obtains fault identity information of each of the sub-networks, wherein the fault identity information is determined based on the bus fault diagnosis method according to any one of claims 1 to 3; The master gateway node determines a bus detection result of the vehicle network based on the fault identity information of each of the sub-networks.
5. The method according to claim 4, characterized in that Before the master gateway node obtains the fault identity information of each sub-network, the method further includes: Each target gateway node determines fault identity information of the sub-network in which it is located, wherein the fault identity information is determined based on the bus fault diagnosis method described in any one of claims 1 to 3; When each of the target gateway nodes has a secondary gateway node in the sub-network where the target gateway node is located, acquiring the fault identity information sent by the secondary gateway node; In the case that the target gateway node is not the master gateway node, the target gateway node sends the fault identity information of the subnet in which it is located and the fault identity information received from the secondary gateway node to the upper-level gateway node in the same subnet as the target gateway node, and the level of the upper-level gateway node is higher than that of the target gateway node.
6. The method according to claim 4, characterized in that The main gateway node determines the bus detection result of the vehicle network based on the fault identity information of each sub-network, including: The main gateway node determines the total number corresponding to each fault identity information based on the fault identity information of each sub-network; If the total number is greater than a threshold, it is determined that the bus detection result of the vehicle network is that a control object corresponding to the fault identity information has a bus fault in the sub-network in which it is located.
7. The method according to claim 4, characterized in that After the main gateway node determines the bus detection result of the vehicle network based on the fault identity information of each sub-network, the method further includes: The bus detection result is sent to the cloud.
8. A bus fault diagnosis device, characterized in that: A target gateway node applied to a vehicle network, wherein the vehicle network is composed of multiple sub-networks, one of the sub-networks includes a gateway node and a controller connected to a bus, the multiple gateway nodes in the vehicle network are distributed in a hierarchical manner, wherein the target gateway node is a gateway node with the highest hierarchy in the sub-network in which it is located, and the device includes: an acquisition unit, configured to acquire a detection message sent by a control object in a subnetwork where the target gateway node is located, wherein the control object is a controller or a secondary gateway node, and the level of the secondary gateway node is lower than that of the target gateway node; A judging unit, used to determine whether the detection message is an error frame by checking the integrity of the detection message; A detection unit is used to determine the identity information of the control object according to the detection message if the detection message is an error frame, as the fault identity information of the sub-network where the target gateway node is located.
9. An electronic device, characterized in that: include: one or more processors; Memory; One or more applications, wherein the one or more applications are stored in the memory, the one or more applications are configured to be executed by the one or more processors, and the one or more applications are configured to execute the method according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program codes, which can be called by a processor to execute the method according to any one of claims 1 to 7.
11. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the method according to any one of claims 1 to 7 is implemented.