An automobile CAN bus automatic detection method, system and detection device
By configuring detection parameters and verifying the consistency of transmitted and received messages in real time, the problem of inconsistent communication in the automotive CAN bus network was solved, realizing a fast and automatic detection method, which improved the efficiency of electrical debugging and the vehicle debugging cycle.
Patent Information
- Application Number
- CN202311242815.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-25
- Publication Date
- 2026-08-25
- Estimated Expiration
- 2043-09-25
AI Technical Summary
In existing technologies, inconsistent communication on the automotive CAN bus network causes vehicle functions to malfunction, making it difficult for electrical technicians to resolve the issue quickly and resulting in a long problem-solving cycle.
An automatic detection method for automotive CAN bus is provided. By configuring detection parameters, loading the CAN network description file, starting the detection program, and executing the online controller's confirmation process, the method verifies the consistency of transmitted and received messages in real time and achieves automatic detection using CAN monitoring and analysis tools.
It enables rapid detection of potential risks in CAN networks, reduces manual intervention, improves detection efficiency, shortens the debugging cycle, and ensures normal vehicle functionality.
Smart Images

Figure CN117389242B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of automotive bus technology, specifically relating to an automatic detection method, system, and computing device for automotive CAN bus. Background Technology
[0002] CAN stands for Controller Area Network, an internationally standardized serial communication protocol from the International Organization for Standardization. With the development of electronics and automotive engineering, various electronic control systems (ECUs) have been developed to address considerations such as safety, economy, and comfort. Because these systems use different data types and have varying reliability requirements, many systems consist of multiple buses, leading to an increase in the number of wiring harnesses. To meet the need for reducing the number of vehicle wiring harnesses and enabling high-speed communication of large amounts of data across multiple LANs, the CAN communication protocol was developed.
[0003] The automotive industry now widely uses CAN bus technology to ensure normal communication between various on-board controllers. The reliability of the on-board CAN network determines the safe operation of vehicle functions, especially in new energy vehicles, which place higher demands on the communication quality of the entire vehicle's CAN network. When developing new models, OEMs often encounter situations on test vehicles where inconsistent communication between on-board controllers leads to malfunctions. The main reasons for this include:
[0004] 1) The CAN network is missing some messages required by the controller;
[0005] 2) Newly developed controllers on the CAN network may send some undefined messages;
[0006] 3) The messages sent by the controller are abnormal, such as occasional message timeouts or message deviation rates exceeding the design threshold. When these problems occur, the electrical debugging personnel of the manufacturing unit cannot solve them, and relevant electrical R&D personnel need to investigate the problem simultaneously, resulting in a long problem-solving cycle and affecting the normal use of the vehicle. Summary of the Invention
[0007] This invention provides an automatic detection method for automotive CAN bus. Electrical technicians can use the CAN bus to detect potential risks in each CAN network of the vehicle with one click, without requiring them to understand the communication protocol details of the online controllers on each CAN network, making it convenient for electrical technicians to operate and test.
[0008] The methods include:
[0009] S1: Configure the parameters for detecting the CAN bus, including network topology and CAN segment;
[0010] S2: Load the CAN network description file of the CAN segment in the CAN channel of the CAN monitoring and analysis tool;
[0011] S3: Start the CAN bus detection program;
[0012] S4: Determine if all parameters have been configured. If so, proceed to S5.
[0013] Otherwise, the CAN bus detection program will exit, indicating that no network topology and CAN segment have been selected, and will proceed to S1;
[0014] S5: Determine whether the CAN channel has loaded the CAN network description file and whether the CAN network description file name is consistent with the configured network segment name;
[0015] If they match, proceed to S6;
[0016] Otherwise, exit the CAN bus detection program, prompting that the correct CAN network description file has not been loaded, and proceed to S2;
[0017] S6: Initiate the confirmation process for the online controller;
[0018] S7: Execute the real-time verification process for the consistency of the online controller's transmitted and received messages.
[0019] It should be further noted that the online controller confirmation process in step S6 includes the following steps:
[0020] S61: Use CAN monitoring and analysis tools to monitor the CAN network segment under test in real time;
[0021] S62: Retrieve a list of all message information that has appeared on the storage bus;
[0022] S63: Compare the message ID as a feature value with the message definition in the CAN network description file to determine all message sending nodes in the message information list;
[0023] S64: Determine whether the message sending node is a gateway controller. If so, proceed to S63.
[0024] Otherwise, proceed to S65;
[0025] S65: Store the name of the sending node in the node list of the online controller;
[0026] S66: Displays the node names and number of nodes in the node list in the program interface.
[0027] It should be further noted that the real-time verification process for the consistency of sent and received messages in step S7 includes the following steps:
[0028] S71: Filter the list of received messages for the online controller from the CAN network description file;
[0029] S72: Using the message ID as a feature value, check each message in the message list to see if there is a bus segment to be detected;
[0030] If it exists, proceed to S73; otherwise, proceed to S710.
[0031] S73: Filter the list of messages sent by the online controller from the CAN network description file;
[0032] S74: Using the message period as a characteristic value, check each message in the sent message list to see if it is an event-type message;
[0033] If yes, proceed to S75; otherwise, proceed to S76.
[0034] S75: If a message is not within the scope of system analysis, then the message will be removed;
[0035] S76: Using the message PGN as the characteristic value, check each message in the sent message list to see if the message PGN is 0xECFF or 0xEBFF;
[0036] If so, proceed to S75; otherwise, proceed to S77.
[0037] S77: Stores the list of verified messages sent by the online controller;
[0038] S78: Using the message ID as the characteristic value, check whether the list of messages to be checked exists on the bus network segment to be tested. If so, proceed to S79; otherwise, proceed to S710.
[0039] S79: Using the message ID as the characteristic value, check whether the messages in all message information lists are defined in the CAN network description file. If so, proceed to S712; otherwise, proceed to S711.
[0040] S710: Stores missing message information and displays it in real time on the program interface;
[0041] S711: Stores undefined message information and displays it in real time on the program interface;
[0042] S712: Stores a list of verified messages;
[0043] S713: Use CAN monitoring and analysis tools to monitor message information of the verified message list in real time;
[0044] S714: Determine whether the interval between two consecutive receptions of a message in the verified message list exceeds the interval threshold. ;
[0045] If so, proceed to S715; otherwise, proceed to S716.
[0046] S715: Stores exception message information and displays it in real time on the program interface;
[0047] S716: Determine whether the message transmission cycle deviation rate of the verified message list exceeds the message cycle deviation rate threshold. ;
[0048] If so, proceed to S715; otherwise, return to the initial state.
[0049] It should be further noted that the interval time threshold Calculate using the following formula:
[0050]
[0051] in, This is the timeout evaluation coefficient; The message transmission period defined in the CAN network description file, in milliseconds (ms).
[0052] It should be further noted that the message cycle deviation rate includes the average message cycle deviation rate. and worst message cycle deviation rate ;
[0053] The average message cycle deviation rate and worst message cycle deviation rate Calculate using the following formula:
[0054]
[0055]
[0056] Where n is the number of times a message is transmitted on the CAN bus within a certain time period; The weight for the message cycle deviation; The timestamp of the message text being transmitted on the CAN bus this time; The timestamp of the last time the message was transmitted on the CAN bus; The transmission period for the message is defined in the CAN network description file, in milliseconds (ms).
[0057] It should be further noted that the aforementioned message period deviation rate threshold Calculate using the following formula:
[0058] .
[0059] The present invention also provides an automatic detection system for automotive CAN bus, the system comprising: a parameter configuration module, a file loading module, a program startup module, a parameter judgment module, a network segment name judgment module, a confirmation process startup module, and a verification execution module;
[0060] The parameter configuration module provides users with a parameter input device, enabling users to configure the parameters for detecting the CAN bus, including the network topology and CAN network segment.
[0061] The file loading module is configured with a CAN monitoring and analysis tool, which is used to load the CAN network description file of the CAN network segment into the CAN channel of the CAN monitoring and analysis tool;
[0062] The program startup module is used to start the CAN bus detection program;
[0063] The parameter judgment module is used to determine whether all parameters have been configured. If so, it sends a configuration completion signal to the network segment name judgment module; otherwise, it exits the CAN bus detection program, prompts that no network topology and CAN network segment have been selected, and sends an incomplete signal to the parameter configuration module.
[0064] The network segment name determination module is used to determine whether the CAN channel has loaded the CAN network description file and whether the CAN network description file name is consistent with the configured network segment name;
[0065] If they match, a consistency signal is sent to the confirmation process initiation module; otherwise, the CAN bus detection program exits, indicating that the correct CAN network description file has not been loaded, and an unloaded message is sent to the file loading module.
[0066] The confirmation process initiation module is used to initiate and execute the confirmation process of the online controller;
[0067] The verification execution module is used to perform real-time verification of the consistency of the online controller's transmitted and received messages.
[0068] The present invention also provides a detection device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of an automatic detection method for an automotive CAN bus.
[0069] As can be seen from the above technical solutions, the present invention has the following advantages:
[0070] The automatic detection method for automotive CAN bus provided by this invention can automatically and accurately determine whether the transmitted and received messages of each online controller in the CAN network meet design requirements and whether there are any timeouts or deviations exceeding design requirements. This information is then displayed intuitively to electrical debugging personnel through a program interface. Users of the automatic automotive CAN bus detection system do not need to understand the communication protocol details of each online controller on the CAN network, thus standardizing and simplifying the initial electrical debugging of vehicles after production, shortening the debugging cycle, and reducing the frequency of manual CAN bus testing by electrical designers in R&D units, thereby improving testing efficiency. Attached Figure Description
[0071] To more clearly illustrate the technical solution of the present invention, the accompanying drawings used in the description will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0072] Figure 1 Flowchart of an automatic detection method for automotive CAN bus;
[0073] Figure 2 This is a schematic diagram of an automatic detection system for the automotive CAN bus.
[0074] Figure 3 A flowchart for the online controller's confirmation process;
[0075] Figure 4 Flowchart for real-time verification of the consistency of transmitted and received messages for online controllers. Detailed Implementation
[0076] The automatic detection method for automotive CAN bus provided by this invention is applied to the detection of automotive CAN bus, which can realize the automatic detection of automotive CAN bus, reduce manual intervention, and improve detection efficiency.
[0077] The automatic detection method for automotive CAN bus disclosed in this invention utilizes CAN monitoring and analysis tools, combined with the online controller's confirmation process and real-time verification process for the consistency of transmitted and received messages. By judging relevant parameters of the CAN bus detection program, it achieves automatic detection of the automotive CAN bus, further effectively solving the problem of abnormal messages sent by the controller, such as occasional message timeouts or message deviation rates exceeding design thresholds. When these problems occur, the electrical debugging personnel of the manufacturing unit cannot solve them, requiring relevant electrical R&D personnel to troubleshoot simultaneously, resulting in long problem-solving cycles and affecting the normal use of the vehicle.
[0078] In the various embodiments of this disclosure, the term "user" may refer to electrical commissioning personnel, electrical R&D personnel, and personnel involved in vehicle testing and use.
[0079] like Figure 1 A flowchart illustrating a preferred embodiment of the automatic detection method for automotive CAN bus of the present invention is shown. Figure 2 As shown, the automatic detection method for automotive CAN bus is applied to one or more detection devices. These devices can be connected to the vehicle's OBD interface to perform CAN bus detection. The detection device is a device capable of automatically performing numerical calculations and / or information processing according to pre-set or stored instructions. Its hardware includes, but is not limited to, microprocessors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), and digital signal processors (DSPs).
[0080] The testing equipment is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic devices can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the embodiments described and / or claimed herein.
[0081] The networks in which the testing equipment is located include, but are not limited to, the Internet, wide area networks, metropolitan area networks, local area networks, and virtual private networks (VPNs).
[0082] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0083] The method in this embodiment includes:
[0084] S1: Configure the parameters for detecting the CAN bus, including network topology and CAN segment;
[0085] In this embodiment, the parameters for configuring the CAN bus for detection are not limited to the above-mentioned configuration parameters. Other parameter information can also be configured according to actual needs to meet the requirements for confirming the CAN network segment being detected.
[0086] S2: Load the CAN network description file of the CAN segment in the CAN channel of the CAN monitoring and analysis tool;
[0087] In embodiments of the present invention, the CAN network description file is a DBC (Database CAN) file. Here, the content of the DBC file is not limited to the network segment name, controller node, controller node receive message definition, controller node send message definition, and message period.
[0088] The CAN monitoring and analysis tool in this embodiment can monitor and record the data flow of the CAN network. The tool analyzes data based on attributes or standardized higher-level protocols. It can display all messages transmitted to the CAN bus in real time, as well as different nodes and views. Optional data flow recording allows for later offline analysis.
[0089] S3: Start the CAN bus detection program;
[0090] According to embodiments of this application, the CAN bus detection program can be started by the user as needed, or it can be started automatically based on the preset program of the CAN monitoring and analysis tool, such as automatically starting after the CAN monitoring and analysis tool is enabled. Whether it starts automatically or manually by the user can be configured according to the actual needs of the CAN monitoring and analysis tool, and is not limited here.
[0091] As needed, the present invention can be configured with on and off buttons, which can be set on the program panel, and the on and off status can be displayed on the program panel.
[0092] S4: Determine if all parameters have been configured. If so, proceed to S5.
[0093] Otherwise, the CAN bus detection program will exit, indicating that no network topology and CAN segment have been selected, and will proceed to S1;
[0094] In embodiments of the present invention, it is necessary to first determine whether the user has selected network topology and network segment parameters to meet the requirements for subsequent confirmation of the detected CAN network segment. If the program detects that no parameters have been selected, it will automatically exit the CAN bus detection program and display "No network topology and network segment selected" on the program interface to remind the user to operate.
[0095] S5: Determine whether the CAN channel has loaded the CAN network description file and whether the CAN network description file name is consistent with the configured network segment name;
[0096] If they match, proceed to S6;
[0097] Otherwise, exit the CAN bus detection program, prompting that the correct CAN network description file has not been loaded, and proceed to S2;
[0098] In embodiments of the present invention, the system compares the name of the DBC file loaded on the CAN channel with the name of the network segment selected by the user to determine whether subsequent online controller confirmation and message consistency verification processes are required. If the CAN channel does not load a DBC file, or the name of the loaded DBC file does not match the name of the network segment selected by the user, the CAN bus detection program exits, and the program interface displays "Incorrect CAN network description file not loaded" to remind the user to operate correctly.
[0099] S6: Initiate the confirmation process for the online controller;
[0100] Among them, such as Figure 3 As shown, the online controller verification process includes the following steps:
[0101] S61: Use CAN monitoring and analysis tools to monitor the CAN network segment under test in real time;
[0102] In the embodiments of the present invention, the CAN monitoring and analysis tool can be Vector's CANoe product, or a domestically produced product with similar functions; no limitation is made here.
[0103] S62: Retrieve MsgList1, a list of all message information that has appeared on the storage bus;
[0104] S63: Compare the message ID as a feature value with the message definition in the CAN network description file to determine all message sending nodes in the message information list;
[0105] S64: Determine whether the message sending node is a gateway controller. If so, proceed to S63.
[0106] Otherwise, proceed to S65;
[0107] S65: Store the name of the sending node in the node list of the online controller;
[0108] S66: Displays the node names and number of nodes in the node list in the program interface.
[0109] In embodiments of the present invention, the status of the online controller node is distinguished by the color of the status indicator light, with green indicating normal and red indicating a problem with the detection result.
[0110] S7: Execute the real-time verification process for the consistency of the online controller's transmitted and received messages.
[0111] like Figure 4 As shown, the real-time verification process for the consistency of transmitted and received messages in this embodiment includes the following steps:
[0112] S71: For the online controller node of Nodelist, filter out the received message list MsgList2 of the online controller from the CAN network description file;
[0113] S72: Using the message ID as the characteristic value, check each message in the MsgList2 message list to see if there is a bus segment to be detected;
[0114] If it exists, proceed to S73; otherwise, proceed to S710.
[0115] S73: For online controller nodes, filter the online controller's transmit message list MsgList3 from the CAN network description file;
[0116] S74: Using the message period as a characteristic value, check each message in the sent message list to see if it is an event-type message;
[0117] If yes, proceed to S75; otherwise, proceed to S76.
[0118] S75: If a message is not within the scope of system analysis, then the message will be removed;
[0119] S76: Using the message PGN as the characteristic value, check each message in the sent message list MsgList3 to see if the message PGN is 0xECFF or 0xEBFF;
[0120] If so, proceed to S75; otherwise, proceed to S77.
[0121] In this embodiment, considering that the bus will not periodically display messages with PGN of 0xECFF or 0xEBFF under normal vehicle function, this method does not consider the above messages.
[0122] S77: Store the list of verified messages sent by the online controller, MsgList4;
[0123] S78: Using the message ID as the characteristic value, check whether the message list MsgList4 being checked exists on the bus network segment to be detected. If it does, proceed to S79; otherwise, proceed to S710.
[0124] S79: Using the message ID as the characteristic value, check whether the messages in all message information lists are defined in the CAN network description file. If so, proceed to S712; otherwise, proceed to S711.
[0125] S710: Stores missing message information and displays it in real time on the program interface;
[0126] S711: Stores undefined message information and displays it in real time on the program interface;
[0127] S712: Stores the list of verified messages, MsgList5;
[0128] S713: Use CAN monitoring and analysis tools to monitor message information of the verified message list in real time;
[0129] S714: Determine whether the interval between two consecutive receptions of a message in the verified message list exceeds the interval threshold. ;
[0130] If so, proceed to S715; otherwise, proceed to S716.
[0131] In this embodiment, the interval time threshold Calculate using the following formula:
[0132] ,in This is the timeout evaluation coefficient; The message transmission period defined in the CAN network description file, in milliseconds (ms).
[0133] S715: Stores exception message information and displays it in real time on the program interface;
[0134] S716: Determine whether the message transmission cycle deviation rate of the verified message list exceeds the message cycle deviation rate threshold. If so, proceed to S715; otherwise, return to the initial state.
[0135] In this embodiment, the message period deviation rate includes the average message period deviation rate. and worst message cycle deviation rate Average message cycle deviation rate and worst message cycle deviation rate Calculate using the following formula:
[0136]
[0137] Where n is the number of times the message is transmitted on the bus within a certain time period; The weight for the message cycle deviation; This is the timestamp of the message text being transmitted on the bus this time; This is the timestamp of the last time the message was transmitted on the bus; The transmission period for this message is defined in the CAN network description file, in milliseconds (ms).
[0138] Additionally, the message cycle deviation rate threshold Calculate using the following formula:
[0139] .
[0140] Thus, the automatic detection method for automotive CAN bus provided by this invention can accurately determine, with one click, whether the transmitted and received messages of each online controller on the selected network segment meet the design requirements and whether there are any timeouts or deviations exceeding design requirements, based on the user-selected network segment. This information is then displayed intuitively to the electrical debugging personnel in the program interface. Users of the automatic detection system for automotive CAN bus do not need to understand the communication protocol details of the online controllers on each CAN network, thus standardizing and simplifying the initial electrical debugging of vehicles after production and shortening the debugging cycle.
[0141] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0142] Furthermore, as a refinement and extension of the specific implementation methods of the above embodiments, in order to fully illustrate the specific implementation process of this embodiment, another automatic detection method for automotive CAN bus is provided, the method including:
[0143] S101. The user performs parameter configuration operations, including network topology and network segment configuration.
[0144] S102. Select the CAN channel of the CAN monitoring and analysis tool and load the CAN network description file of the CAN segment being monitored.
[0145] S103. Start the CAN bus detection program.
[0146] S104. Determine whether all parameters have been configured. If yes, proceed to S105; otherwise, proceed to S106.
[0147] S105. Determine whether the CAN channel has loaded the CAN network description file and whether the CAN network description file name is consistent with the configured network segment name. If so, proceed to S108; otherwise, proceed to S107.
[0148] S106. Exit the CAN bus detection program, prompting that no network topology and network segment have been selected, and then proceed to S101.
[0149] S107. Exit the CAN bus detection program, prompting that the correct CAN network description file has not been loaded, and proceed to S102.
[0150] S108. Perform the online controller verification process.
[0151] S109. Perform real-time verification of the consistency of the online controller's transmitted and received messages.
[0152] The above methods improve detection efficiency, automate the detection process, and ensure detection results.
[0153] The following are embodiments of the automatic detection system for automotive CAN bus provided in this disclosure. This system and the automatic detection method for automotive CAN bus in the above embodiments belong to the same inventive concept. For details not described in detail in the embodiments of the automatic detection system for automotive CAN bus, please refer to the embodiments of the automatic detection method for automotive CAN bus described above.
[0154] The system includes: a parameter configuration module, a file loading module, a program startup module, a parameter judgment module, a network segment name judgment module, a confirmation process startup module, and a verification execution module; of course, a memory and communication module can also be configured according to actual needs. These modules can be configured into the testing equipment.
[0155] The parameter configuration module provides users with a parameter input device, enabling users to configure the parameters for detecting the CAN bus, including the network topology and CAN network segment.
[0156] The parameter input device can be a touch screen display, keyboard, mouse, trackball, voice recognizer, card reader, or other known input device.
[0157] The file loading module is configured with a CAN monitoring and analysis tool, which is used to load the CAN network description file of the CAN network segment into the CAN channel of the CAN monitoring and analysis tool;
[0158] The program startup module is used to start the CAN bus detection program;
[0159] The parameter judgment module is used to determine whether all parameters have been configured. If so, it sends a configuration completion signal to the network segment name judgment module; otherwise, it exits the CAN bus detection program, prompts that no network topology and CAN network segment have been selected, and sends an incomplete signal to the parameter configuration module.
[0160] The network segment name determination module is used to determine whether the CAN channel has loaded the CAN network description file and whether the CAN network description file name is consistent with the configured network segment name;
[0161] If they match, a consistency signal is sent to the confirmation process initiation module; otherwise, the CAN bus detection program exits, indicating that the correct CAN network description file has not been loaded, and an unloaded message is sent to the file loading module.
[0162] The confirmation process initiation module is used to initiate and execute the confirmation process of the online controller;
[0163] The verification execution module is used to perform real-time verification of the consistency of the online controller's transmitted and received messages.
[0164] The automotive CAN bus automatic detection device of the present invention comprises the units and algorithm steps of various examples described in conjunction with the embodiments disclosed herein, and can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of each example have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can implement the described functions using different methods for each specific application, but such implementations should not be considered beyond the scope of the present invention.
[0165] Those skilled in the art will understand that various aspects of the automotive CAN bus automatic detection method can be implemented as a system, method, or program product. Therefore, various aspects of this disclosure can be specifically implemented in the following forms: a completely hardware implementation, a completely software implementation (including firmware, microcode, etc.), or a combination of hardware and software aspects, collectively referred to herein as a "circuit," "module," or "system."
[0166] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. An automatic detection method for automotive CAN bus, characterized in that the method... include: S1: Configure the parameters for detecting the CAN bus; S2: Load the CAN network description file of the CAN segment in the CAN channel of the CAN monitoring and analysis tool; S3: Start the CAN bus detection program; S4: Determine if all parameters have been configured. If so, proceed to S5. Otherwise, the CAN bus detection program will exit, indicating that no network topology and CAN segment have been selected, and will proceed to S1; S5: Determine whether the CAN channel has loaded the CAN network description file and whether the CAN network description file name is consistent with the configured network segment name; If they match, proceed to S6; Otherwise, exit the CAN bus detection program, prompting that the correct CAN network description file has not been loaded, and proceed to S2; S6: Initiate the confirmation process for the online controller; S7: Execute the real-time verification process for the consistency of transmitted and received messages of the online controller; The real-time verification process for the consistency of transmitted and received messages in step S7 includes the following steps: S71: Filter the list of received messages for the online controller from the CAN network description file; S72: Using the message ID as a characteristic value, check each message in the message list to see if there is a bus segment to be detected; If it exists, proceed to S73; otherwise, proceed to S710. S73: Filter the list of messages sent by the online controller from the CAN network description file; S74: Using the message period as a characteristic value, check each message in the sent message list to see if it is an event-type message; If yes, proceed to S75; otherwise, proceed to S76. S75: If a message is not within the scope of system analysis, then the message will be removed; S76: Using the message PGN as the characteristic value, check each message in the sent message list to see if the message PGN is 0xECFF or 0xEBFF; If so, proceed to S75; otherwise, proceed to S77. S77: Stores the list of verified messages sent by the online controller; S78: Using the message ID as the characteristic value, check each message in the list of messages to be checked to see if it exists on the bus network segment to be tested. If it does, proceed to S79; otherwise, proceed to S710. S79: Using the message ID as the characteristic value, check whether the messages in all message information lists are defined in the CAN network description file. If so, proceed to S712; otherwise, proceed to S711. S710: Stores missing message information and displays it in real time on the program interface; S711: Stores undefined message information and displays it in real time on the program interface; S712: Stores a list of verified messages; S713: Use CAN monitoring and analysis tools to monitor message information of the verified message list in real time; S714: Determine whether the interval between two consecutive receptions of a message in the verified message list exceeds the interval threshold. ; If so, proceed to S715; otherwise, proceed to S716. S715: Stores exception message information and displays it in real time on the program interface; S716: Determine whether the message transmission cycle deviation rate of the verified message list exceeds the message cycle deviation rate threshold. ; If so, proceed to S715; otherwise, return to the initial state.
2. The automatic detection method for automotive CAN bus according to claim 1, characterized in that, The parameters include network topology and CAN segment.
3. The automatic detection method for automotive CAN bus according to claim 1, characterized in that, In step S4, it is determined whether all parameters have been configured. If not, the CAN bus detection program is exited, prompting that no network topology and CAN segment have been selected, and then proceeds to S1.
4. The automatic detection method for automotive CAN bus according to claim 1, characterized in that, The online controller verification process in step S6 includes the following steps: S61: Use CAN monitoring and analysis tools to monitor the CAN network segment under test in real time; S62: Retrieve a list of all message information that has appeared on the storage bus; S63: Compare the message ID as a feature value with the message definition in the CAN network description file to determine all message sending nodes in the message information list; S64: Determine whether the message sending node is a gateway controller. If so, proceed to S63. Otherwise, proceed to S65; S65: Store the name of the sending node in the node list of the online controller; S66: Displays the node names and number of nodes in the node list in the program interface.
5. The automatic detection method for automotive CAN bus according to claim 1, characterized in that, The interval time threshold Calculate using the following formula: in, This is the timeout evaluation coefficient; The message transmission period defined in the CAN network description file.
6. The automatic detection method for automotive CAN bus according to claim 1, characterized in that, Message cycle deviation rate includes average message cycle deviation rate and worst message cycle deviation rate ; The average message cycle deviation rate and worst message cycle deviation rate Calculate using the following formula: Where n is the number of times a message is transmitted on the CAN bus within a certain time period; The weight for the message cycle deviation; The timestamp of the message text being transmitted on the CAN bus this time; The timestamp of the last time the message was transmitted on the CAN bus; The transmission period is defined in the CAN network description file.
7. The automatic detection method for automotive CAN bus according to claim 1, characterized in that, The message period deviation rate threshold Calculate using the following formula: 。 8. An automatic detection system for automotive CAN bus, characterized in that, The system employs the automatic detection method for the automotive CAN bus as described in any one of claims 1 to 7; The system includes: a parameter configuration module, a file loading module, a program startup module, a parameter judgment module, a network segment name judgment module, a confirmation process startup module, and a verification execution module; The parameter configuration module provides users with a parameter input device, enabling users to configure the parameters for detecting the CAN bus, including the network topology and CAN segment. The file loading module is configured with a CAN monitoring and analysis tool, which is used to load the CAN network description file of the CAN network segment into the CAN channel of the CAN monitoring and analysis tool; The program startup module is used to start the CAN bus detection program; The parameter judgment module is used to determine whether all parameters have been configured. If so, it sends a configuration completion signal to the network segment name judgment module; otherwise, it exits the CAN bus detection program, prompts that no network topology and CAN network segment have been selected, and sends an incomplete signal to the parameter configuration module. The network segment name determination module is used to determine whether the CAN channel has loaded the CAN network description file and whether the CAN network description file name is consistent with the configured network segment name; If they match, a consistency signal is sent to the confirmation process initiation module; otherwise, the CAN bus detection program exits, indicating that the correct CAN network description file has not been loaded, and an unloaded message is sent to the file loading module. The confirmation process initiation module is used to initiate and execute the confirmation process of the online controller; The verification execution module is used to perform real-time verification of the consistency of the online controller's transmitted and received messages.
9. A detection device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the automatic detection method for automotive CAN bus as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Dual-redundant CAN bus communication system
CN105743755A
System for generating DBC file and electronic equipment
CN116760895A