CAN bus error frame detection positioning method and system

By collecting and analyzing waveform data from the CAN bus controller, and using an AI model to automatically mark and identify the source of error frames, the problem of cumbersome operation and difficult location in traditional methods is solved, and fast and accurate error frame location is achieved.

CN121644335APending Publication Date: 2026-03-10DONGFENG MOTOR GRP
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-19
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

Traditional methods for troubleshooting CAN bus error frames are complex and difficult to implement, especially when dealing with controllers in unusual installation locations, making it difficult to effectively pinpoint the source of the error.

Method used

By collecting waveform data from each controller, using AI models to analyze waveform characteristics, automatically identifying the controller, and extracting key waveform segments for source identification when an error frame is detected, rapid location can be achieved.

Benefits of technology

It reduces the difficulty of troubleshooting, achieves automated and efficient source location of error frames, and is applicable to fault diagnosis of various CAN bus systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121644335A_ABST
    Figure CN121644335A_ABST
Patent Text Reader

Abstract

The invention discloses a CAN bus error frame detection positioning system and method, and relates to the technical field of CAN buses. Aiming at the problems that the traditional CAN bus error frame checking depends on data analysis, oscilloscope detection or one-by-one controller plugging and unplugging, the operation is tedious, and controllers with special installation positions are difficult to process, the method provided by the invention realizes rapid positioning of an error frame source by collecting waveform characteristics of each controller and utilizing AI analysis. According to the technical scheme, the method comprises the steps of waveform data acquisition, AI feature marking, error frame waveform interception and source identification, error frame positioning can be automatically completed, the troubleshooting efficiency is improved, the operation difficulty is reduced, and the method is suitable for fault diagnosis of various vehicle CAN bus systems.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of CAN bus fault diagnosis technology, and in particular to a method and system for detecting and locating CAN bus error frames. Background Technology

[0002] As the core of vehicle network communication, the CAN bus's operational stability directly affects the vehicle's normal operation. Error frames are a common fault manifestation in the CAN bus, and troubleshooting error frames is a crucial step in network problem diagnosis.

[0003] Traditional error frame troubleshooting methods mainly rely on two approaches: one is to manually analyze bus data and combine it with oscilloscope test results to determine the fault range; the other is to locate the source of the error by plugging and unplugging controllers one by one when the data cannot be directly used for judgment. However, manual data analysis is inefficient and requires a high level of expertise from operators; plugging and unplugging controllers one by one is cumbersome in practical applications, especially for controllers without fuses and those that are difficult to access, making troubleshooting difficult and seriously affecting the efficiency of fault handling.

[0004] Therefore, there is an urgent need for a method and system for detecting and locating CAN bus error frames to solve the problems of complex operation and difficult troubleshooting of traditional methods. Summary of the Invention

[0005] The present invention aims to solve at least one of the technical problems existing in the prior art, and proposes a method and system for detecting and locating CAN bus error frames.

[0006] In a first aspect, embodiments of the present invention provide a method for detecting and locating CAN bus error frames, including:

[0007] Waveform data from each controller is captured from the CAN bus network and used as initial data.

[0008] Using initial data as input, the AI ​​model analyzes the waveform data of each controller and labels the controller identity information corresponding to the waveform data;

[0009] When an error frame is detected on the CAN bus, capture the complete waveform of the error frame and extract the waveform data segment corresponding to the first rising or falling edge at the trigger point of the error frame.

[0010] The captured waveform data segment is input into the AI ​​model that has completed labeling training. The AI ​​model compares the waveform features of each labeled controller to identify the controller corresponding to the waveform data segment. The controller is the source controller of the error frame.

[0011] Furthermore, using the rising and falling edges of the waveform in the initial data as feature points as input, an AI model is used to analyze the waveform data of each controller and label the controller identity information corresponding to the waveform data. Specific methods include:

[0012] The waveform data is preprocessed, and the preprocessed data is divided into the training set, validation set and test set of the model;

[0013] From the preprocessed waveform, edge features that can distinguish different controllers are extracted; the AI ​​model is trained based on the extracted edge features to obtain the initial training model;

[0014] The initial AI model is optimized to obtain the final AI model. The trained model is then deployed to a real-world scenario, and the controller identity is automatically labeled on the input CAN waveform, thus completing the labeling of the controller identity information corresponding to the waveform data.

[0015] Furthermore, edge features that can distinguish different controllers are extracted from the preprocessed waveforms. The specific methods include: extracting statistical features, timing features, and morphological features from the rising and falling edges of each waveform; wherein the statistical features include the total number of rising edges / total number of falling edges, the average edge slope, and the standard deviation of the edge slope; and the morphological features include the rising edge delay time and the falling edge delay time.

[0016] Furthermore, the AI ​​model is trained based on the extracted edge features to obtain an initial training model. Specific methods include:

[0017] An edge feature matrix is ​​constructed based on the extracted edge features, and each controller identity is used as a label vector. The edge feature matrix and label vector are then input into the AI ​​model.

[0018] The AI ​​model type is determined, and a convolutional neural network model is adopted as the AI ​​model. The number of convolutional layers, the size and number of convolutional kernels, and the type and size parameters of pooling layers are determined. The stochastic gradient descent algorithm is adopted as the optimization algorithm, the learning rate of the model is set, and the loss function is defined.

[0019] The extracted edge features and corresponding labels are input into the model for training. During the training process, the model calculates the loss value based on the input data and the set loss function, and uses an optimization algorithm to update the model parameters.

[0020] Through multiple iterations of training, the model parameters are continuously adjusted, enabling the model to gradually learn the edge features in the data. In each iteration, the model uses a portion of the training set for forward and backward propagation, calculates the loss value, and updates the parameters.

[0021] During training, it is necessary to monitor the training loss and validation loss of the model. If the training loss continues to decrease while the validation loss begins to increase, it indicates that the model is overfitting, and appropriate measures need to be taken to adjust it.

[0022] Furthermore, the initially trained AI model is optimized to obtain the final AI model. Specific methods include: evaluating the trained model using a test set, calculating the model's accuracy, recall, and F1 score on the test set to assess its performance; optimizing the initially trained AI model based on the evaluation results; if the model's performance is unsatisfactory, optimizing the model architecture, algorithm, and learning rate parameters; after multiple training and optimization iterations, a model that performs optimally on the test set is obtained, and this model is the final AI model.

[0023] Furthermore, the error frame includes an error flag portion and an error delimiter, wherein the error flag portion is an active error flag consisting of 6 consecutive dominant bits or a passive error flag consisting of 6 consecutive recessive bits.

[0024] Secondly, this invention also discloses a CAN bus error frame detection and localization system, comprising a waveform data acquisition module, an AI feature marking module, an error frame waveform interception module, and an error frame localization module; wherein:

[0025] The waveform data acquisition module is used to capture waveform data from each controller in the CAN bus network and use the waveform data as initial data.

[0026] The AI ​​feature labeling module is used to analyze the waveform data of each controller using an AI model, taking initial data as input, and labeling the controller identity information corresponding to the waveform data.

[0027] The error frame waveform capture module is used to capture the complete waveform of the error frame when an error frame is detected on the CAN bus, and to capture the waveform data segment corresponding to the first rising edge or falling edge at the trigger point of the error frame.

[0028] The error frame localization module is used to input the captured waveform data segment into the AI ​​model that has completed labeling training. The AI ​​model compares the waveform features of each labeled controller to identify the controller corresponding to the waveform data segment, which is the source controller of the error frame.

[0029] Furthermore, the AI ​​feature labeling module is used to analyze the waveform data of each controller using an AI model, taking initial data as input, and labeling the controller identity information corresponding to the waveform data. Specific methods include:

[0030] The waveform data is preprocessed, and the preprocessed data is divided into the training set, validation set and test set of the model;

[0031] From the preprocessed waveform, edge features that can distinguish different controllers are extracted; the AI ​​model is trained based on the extracted edge features to obtain the initial training model;

[0032] From the preprocessed waveform, edge features that can distinguish different controllers are extracted. The specific method includes: extracting statistical features, timing features and morphological features for the rising and falling edges of each waveform; wherein the statistical features include the total number of rising edges / total number of falling edges, the average edge slope and the standard deviation of the edge slope; the morphological features are the rising edge delay time and the falling edge delay time.

[0033] The AI ​​model is trained based on the extracted edge features to obtain an initial training model. Specific methods include:

[0034] An edge feature matrix is ​​constructed based on the extracted edge features, and each controller identity is used as a label vector. The edge feature matrix and label vector are then input into the AI ​​model.

[0035] The AI ​​model type is determined, and a convolutional neural network model is adopted as the AI ​​model. The number of convolutional layers, the size and number of convolutional kernels, and the type and size parameters of pooling layers are determined. The stochastic gradient descent algorithm is adopted as the optimization algorithm, the learning rate of the model is set, and the loss function is defined.

[0036] The extracted edge features and corresponding labels are input into the model for training. During the training process, the model calculates the loss value based on the input data and the set loss function, and uses an optimization algorithm to update the model parameters.

[0037] Through multiple iterations of training, the model parameters are continuously adjusted, enabling the model to gradually learn the edge features in the data. In each iteration, the model uses a portion of the training set for forward and backward propagation, calculates the loss value, and updates the parameters.

[0038] During training, it is necessary to monitor the training loss and validation loss of the model. If the training loss continues to decrease while the validation loss begins to increase, it indicates that the model is overfitting, and appropriate measures need to be taken to adjust it.

[0039] The initial AI model is optimized to obtain the final AI model. The trained model is then deployed to a real-world scenario, and the controller identity is automatically labeled on the input CAN waveform, thus completing the labeling of the controller identity information corresponding to the waveform data.

[0040] Thirdly, the present invention also discloses an electronic device, comprising:

[0041] One or more processors;

[0042] Memory, used to store one or more programs;

[0043] When the one or more programs are executed by the one or more processors, the one or more processors implement the positioning method.

[0044] Fourthly, the present invention also discloses a computer-readable medium storing a computer program, which, when executed by a processor, implements the steps in the positioning method.

[0045] This invention discloses a CAN bus error frame detection and localization system and method. Addressing the problem that traditional CAN bus error frame troubleshooting relies on data analysis, oscilloscope testing, or individual controller plugging and unplugging, which is cumbersome and difficult to handle controllers with unusual installation locations, this invention achieves rapid location of the error frame source by collecting waveform characteristics from each controller and utilizing AI analysis. Its technical solution includes waveform data acquisition, AI feature marking, error frame waveform extraction, and source identification steps, which can automatically complete error frame localization, improve troubleshooting efficiency, reduce operational difficulty, and is applicable to fault diagnosis of various vehicle CAN bus systems. Compared with existing technologies, this invention has the following advantages:

[0046] 1. Solves the problem of difficult error frame troubleshooting: By analyzing the waveform characteristics of the controller through model analysis, the source of the error can be directly located without manually analyzing data frame by frame or plugging and unplugging the controller one by one, which greatly reduces the difficulty of troubleshooting.

[0047] 2. Achieve automatic analysis and improve efficiency: The AI ​​system can accumulate experience through continuous training and continuously optimize the accuracy of feature recognition, so as to achieve automatic and rapid location of error frames, which greatly shortens the investigation time compared with traditional methods.

[0048] 3. Adaptable to complex installation scenarios: No need to touch or disassemble the controller; positioning can be completed simply by waveform acquisition and analysis, effectively solving the problem of troubleshooting controllers in hard-to-reach installation locations. Attached Figure Description

[0049] Figure 1 This is a first schematic diagram of a CAN bus error frame detection and localization method provided in an embodiment of the present invention;

[0050] Figure 2 This is a second schematic diagram of a CAN bus error frame detection and localization method provided in an embodiment of the present invention;

[0051] Figure 3 This is a flowchart illustrating an optional specific implementation method of step S200 in an embodiment of the present invention.

[0052] Figure 4This is a structural block diagram of a CAN bus error frame detection and positioning system provided in an embodiment of the present invention;

[0053] Figure 5 This is a structural block diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0054] To enable those skilled in the art to better understand the technical solutions of the present invention, exemplary embodiments of the present invention are described below in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to aid understanding. These should be considered merely exemplary. Therefore, those skilled in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0055] Where there is no conflict, the various embodiments of the present invention and the features thereof may be combined with each other.

[0056] As used herein, the term “and / or” includes any and all combinations of one or more related enumerated entries.

[0057] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used herein, the singular forms “a” and “the” are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will also be understood that when the terms “comprising” and / or “made of” are used in this specification, the presence of the stated feature, integral, step, operation, element, and / or component is specified, but the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or groups thereof is not excluded. Terms such as “connected” or “linked” are not limited to physical or mechanical connections but can include electrical connections, whether direct or indirect.

[0058] Unless otherwise specified, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having the meaning consistent with their meaning in the context of the relevant art and the invention, and will not be interpreted as having an idealized or overly formal meaning unless expressly so defined herein.

[0059] In the technical solution of this invention, the collection, storage, use, processing, transmission, provision, and disclosure of user personal information all comply with relevant laws and regulations and do not violate public order and good morals. The use of user data in this technical solution follows relevant national laws and regulations (e.g., the "Information Security Technology - Personal Information Security Specification"). For example: appropriate measures are taken for personal information access control; restrictions are imposed on the display of personal information; the purpose of using personal information does not exceed the scope of direct or reasonable association; and explicit identity targeting is eliminated when using personal information to avoid precisely locating a specific individual.

[0060] To address at least one of the technical problems existing in the aforementioned related technologies, the present invention provides a CAN bus error frame detection and location method and system.

[0061] This embodiment discloses a method for detecting and locating CAN bus error frames, such as... Figure 1 and 2 ,include:

[0062] S100. Capture waveform data from each controller in the CAN bus network, using the waveform data as initial data; specifically, use an oscilloscope connected to the CAN bus network to acquire waveform data of all controllers on the bus under normal operating conditions. This data serves as the initial data for subsequent analysis, covering the complete waveform characteristics of each controller. The oscilloscope in this embodiment has the ability to capture bus waveforms in real time, simultaneously acquiring normal waveforms and error frame waveforms from multiple controllers, and supports precise extraction of waveform segments at specified locations.

[0063] For example, connect the oscilloscope probe to the designated test point on the CAN bus, start each controller to work normally, and use the oscilloscope to collect waveform data from each controller for 10 minutes to ensure data integrity and obtain the initial waveform dataset.

[0064] S200. Using initial data as input, the AI ​​model analyzes the waveform data of each controller and marks the controller identity information corresponding to the waveform data; specifically, the collected initial waveform data is input into the model, and the model uses the rising edge and falling edge of the waveform as the core feature points to analyze the differences in waveforms of different controllers, assigns a unique identity label to the waveform features of each controller, and establishes the correspondence between "waveform feature controllers".

[0065] For example, the initial waveform dataset is input into the analysis and labeling module. The module extracts feature parameters such as the rising edge slope and falling edge time of each controller waveform, assigns a unique identification code to each controller and establishes a feature database. The training time is about 30 minutes, and the feature labeling is completed.

[0066] In S200 of this embodiment, the rising and falling edges of the waveform in the initial data are used as feature points as input. An AI model analyzes the waveform data of each controller and labels the controller identity information corresponding to the waveform data, such as... Figure 3 Specific methods include:

[0067] S201. Preprocess the waveform data and divide the preprocessed data into the training set, validation set and test set of the model; among which, the training set (70%) is used to optimize the initially trained AI model for the model to learn the mapping relationship between features and identity; the validation set (20%) is used to adjust the model parameters to avoid overfitting; the test set (10%) is used to simulate real-world scenarios and test the model's generalization ability.

[0068] S202. Extract edge features that can distinguish different controllers from the preprocessed waveform; train the AI ​​model based on the extracted edge features to obtain the initial training model;

[0069] In this embodiment, edge features that can distinguish different controllers are extracted from the preprocessed waveform. The specific method includes: extracting statistical features, timing features and morphological features for the rising and falling edges of each waveform; wherein the statistical features include the total number of rising edges / total number of falling edges, the average edge slope and the standard deviation of the edge slope; and the morphological features include the rising edge delay time and the falling edge delay time.

[0070] In this embodiment, the AI ​​model is trained based on the extracted edge features to obtain an initial training model. The specific method includes:

[0071] An edge feature matrix is ​​constructed based on the extracted edge features, and each controller identity is used as a label vector. The edge feature matrix and label vector are then input into the AI ​​model.

[0072] The AI ​​model type is determined, and a convolutional neural network model is adopted as the AI ​​model. The number of convolutional layers, the size and number of convolutional kernels, and the type and size parameters of pooling layers are determined. The stochastic gradient descent algorithm is adopted as the optimization algorithm, the learning rate of the model is set, and the loss function is defined.

[0073] The extracted edge features and corresponding labels are input into the model for training. During the training process, the model calculates the loss value based on the input data and the set loss function, and uses an optimization algorithm to update the model parameters.

[0074] Through multiple iterations of training, the model parameters are continuously adjusted, enabling the model to gradually learn the edge features in the data. In each iteration, the model uses a portion of the training set for forward and backward propagation, calculates the loss value, and updates the parameters.

[0075] During training, it is necessary to monitor the training loss and validation loss of the model. If the training loss continues to decrease while the validation loss begins to increase, it indicates that the model is overfitting, and appropriate measures need to be taken to adjust it.

[0076] S203. Optimize the initially trained AI model to obtain the final AI model. Deploy the trained model to the actual scenario and automatically label the controller identity of the input CAN waveform to complete the labeling of the controller identity information corresponding to the waveform data.

[0077] In this embodiment, the initial training AI model is optimized to obtain the final AI model. The specific method includes: evaluating the trained model using a test set, calculating the model's accuracy, recall, and F1 score on the test set to assess the model's performance; optimizing the initial training AI model based on the evaluation results, and if the model's performance is not ideal, optimizing the initial training AI model by adjusting the model architecture, optimizing the algorithm, and adjusting the learning rate parameters; after multiple training and optimizations, a model that performs optimally on the test set is obtained, and this model is the final model.

[0078] S300. When an error frame is detected on the CAN bus, the complete waveform of the error frame is captured, and the waveform data segment corresponding to the first rising or falling edge at the trigger point of the error frame is extracted. Specifically, when the CAN bus detects an error and generates an error frame, the oscilloscope captures the complete waveform of the error frame in real time. According to the CAN bus error frame structure, the focus is on extracting the waveform data segment corresponding to the first rising or falling edge at the moment the error frame is triggered. This segment is the key basis for determining the initiator of the error.

[0079] The error frame consists of two distinct fields: the first field is the error flag portion, and the second field is the error delimiter. There are two types of error flags: active and passive. An active error flag consists of six consecutive dominant bits (often, active error flag bits may overlap, meaning more than six consecutive dominant bits constitute an active error flag). A passive error flag consists of six consecutive recessive bits. The error frame is issued by one or more controllers, and the first controller to issue the error frame is usually the source of the error frame. Locating the source of the error frame is the purpose of the method disclosed in this embodiment.

[0080] For example, by manually setting a fault in a controller, an error frame is generated on the CAN bus. The oscilloscope captures the waveform of the error frame in real time and automatically extracts the waveform segment of the first rising edge at the point of error triggering, with a duration of 5ms.

[0081] S400. The captured waveform data segment is input into the AI ​​model that has completed labeling training. The AI ​​model compares the waveform features of each labeled controller to identify the controller corresponding to the waveform data segment. This controller is the source controller of the error frame. Specifically, the captured waveform data segment is input into the model that has completed feature labeling. The model finds the controller with the highest matching degree by comparing the stored waveform features of each controller. This controller is the source of the error frame.

[0082] For example, the captured waveform segment is input into the analysis and marking module. The module compares it with the feature database and outputs the matching result within 2 seconds, accurately identifying the identification code of the fault controller and completing the source location of the error frame.

[0083] This embodiment discloses a method and system for detecting and locating CAN bus error frames. Addressing the problem that traditional CAN bus error frame troubleshooting relies on data analysis, oscilloscope testing, or individual controller plugging and unplugging, which is cumbersome and difficult to handle controllers with unusual installation locations, this invention achieves rapid location of the error frame source by collecting and analyzing the waveform characteristics of each controller. Its technical solution includes waveform data acquisition, AI feature marking, error frame waveform extraction, and source identification steps, which can automatically complete error frame location, improve troubleshooting efficiency, reduce operational difficulty, and is applicable to fault diagnosis of various CAN bus systems.

[0084] Based on the same inventive concept, embodiments of the present invention also provide a CAN bus error frame detection and location system, such as... Figure 4 It includes a waveform data acquisition module, an AI feature marking module, an error frame waveform extraction module, and an error frame location module; among which:

[0085] The waveform data acquisition module is used to capture waveform data from each controller in the CAN bus network and use the waveform data as initial data.

[0086] The AI ​​feature labeling module is used to analyze the waveform data of each controller using an AI model, taking initial data as input, and labeling the controller identity information corresponding to the waveform data.

[0087] The error frame waveform capture module is used to capture the complete waveform of the error frame when an error frame is detected on the CAN bus, and to capture the waveform data segment corresponding to the first rising edge or falling edge at the trigger point of the error frame.

[0088] The error frame localization module is used to input the captured waveform data segment into the AI ​​model that has completed labeling training. The AI ​​model compares the waveform features of each labeled controller to identify the controller corresponding to the waveform data segment, which is the source controller of the error frame.

[0089] Specifically, the waveform data of each controller is analyzed using an AI model, and the controller identity information corresponding to the waveform data is labeled. The specific methods include:

[0090] The waveform data is preprocessed, and the preprocessed data is divided into the training set, validation set and test set of the model;

[0091] From the preprocessed waveform, edge features that can distinguish different controllers are extracted; the AI ​​model is trained based on the extracted edge features to obtain the initial training model;

[0092] From the preprocessed waveform, edge features that can distinguish different controllers are extracted. The specific method includes: extracting statistical features, timing features and morphological features for the rising and falling edges of each waveform; wherein the statistical features include the total number of rising edges / total number of falling edges, the average edge slope and the standard deviation of the edge slope; the morphological features are the rising edge delay time and the falling edge delay time.

[0093] The AI ​​model is trained based on the extracted edge features to obtain an initial training model. Specific methods include:

[0094] An edge feature matrix is ​​constructed based on the extracted edge features, and each controller identity is used as a label vector. The edge feature matrix and label vector are then input into the AI ​​model.

[0095] The AI ​​model type is determined, and a convolutional neural network model is adopted as the AI ​​model. The number of convolutional layers, the size and number of convolutional kernels, and the type and size parameters of pooling layers are determined. The stochastic gradient descent algorithm is adopted as the optimization algorithm, the learning rate of the model is set, and the loss function is defined.

[0096] The extracted edge features and corresponding labels are input into the model for training. During the training process, the model calculates the loss value based on the input data and the set loss function, and uses an optimization algorithm to update the model parameters.

[0097] Through multiple iterations of training, the model parameters are continuously adjusted, enabling the model to gradually learn the edge features in the data. In each iteration, the model uses a portion of the training set for forward and backward propagation, calculates the loss value, and updates the parameters.

[0098] During training, it is necessary to monitor the training loss and validation loss of the model. If the training loss continues to decrease while the validation loss begins to increase, it indicates that the model is overfitting, and appropriate measures need to be taken to adjust it.

[0099] The initial AI model is optimized to obtain the final AI model. The trained model is then deployed to a real-world scenario, and the controller identity is automatically labeled on the input CAN waveform, thus completing the labeling of the controller identity information corresponding to the waveform data.

[0100] Based on the same inventive concept, embodiments of the present invention also provide an electronic device. Figure 5 This is a structural block diagram of an electronic device provided in an embodiment of the present invention. Figure 5 As shown, an embodiment of the present invention provides an electronic device including: one or more processors 101, a memory 102, and one or more I / O interfaces 103. The memory 102 stores one or more programs, which, when executed by the one or more processors, cause the one or more processors to implement any of the positioning methods described in the above embodiments; the one or more I / O interfaces 103 are connected between the processor and the memory, configured to enable information interaction between the processor and the memory.

[0101] The processor 101 is a device with data processing capabilities, including but not limited to a central processing unit (CPU); the memory 102 is a device with data storage capabilities, including but not limited to random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), and flash memory (FLASH); the I / O interface (read / write interface) 103 is connected between the processor 101 and the memory 102, and can realize information interaction between the processor 101 and the memory 102, including but not limited to a data bus (Bus).

[0102] In some embodiments, the processor 101, memory 102, and I / O interface 103 are interconnected via bus 104, and thus connected to other components of the computing device.

[0103] In some embodiments, the one or more processors 101 include a field-programmable gate array.

[0104] This invention also provides a computer-readable medium. The computer-readable medium stores a computer program, which, when executed by a processor, implements the steps of any of the positioning methods described in the above embodiments. The computer-readable storage medium may be volatile or non-volatile.

[0105] This invention also provides a computer program product, including computer-readable code, or a non-volatile computer-readable storage medium carrying computer-readable code. When the computer-readable code is run in the processor of an electronic device, the processor in the electronic device executes the above-described positioning method.

[0106] Those skilled in the art will understand that all or some of the steps, systems, and apparatuses disclosed above, and their functional modules / units, can be implemented as software, firmware, hardware, or suitable combinations thereof. In hardware implementations, the division between functional modules / units mentioned above does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed collaboratively by several physical components. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit (ASIC). Such software can be distributed on a computer-readable storage medium, which may include computer storage media (or non-transitory media) and communication media (or transient media).

[0107] As is known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information, such as computer-readable program instructions, data structures, program modules, or other data. Computer storage media includes, but is not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), static random access memory (SRAM), flash memory or other memory technologies, portable compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and is accessible to a computer. Furthermore, it is known to those skilled in the art that communication media typically contain computer-readable program instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.

[0108] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage media in the respective computing / processing device.

[0109] The computer program instructions used to perform the operations of this invention may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Smalltalk, C++, etc., and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The computer-readable program instructions may be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuitry, such as programmable logic circuitry, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), is personalized by utilizing state information from the computer-readable program instructions. This electronic circuitry can execute the computer-readable program instructions to implement various aspects of the invention.

[0110] The computer program product described herein can be implemented specifically through hardware, software, or a combination thereof. In one alternative embodiment, the computer program product is specifically embodied in a computer storage medium; in another alternative embodiment, the computer program product is specifically embodied in a software product, such as a software development kit (SDK), etc.

[0111] Various aspects of the present invention are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.

[0112] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processor of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner; thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.

[0113] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.

[0114] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction, which contains one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those shown in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0115] Example embodiments have been disclosed herein, and while specific terminology has been used, it is for illustrative purposes only and should be construed as such, and is not intended to be limiting. In some instances, it will be apparent to those skilled in the art that features, characteristics, and / or elements described in conjunction with particular embodiments may be used alone, or in combination with features, characteristics, and / or elements described in conjunction with other embodiments, unless otherwise expressly indicated. Therefore, those skilled in the art will understand that various changes in form and detail may be made without departing from the scope of the invention as set forth in the appended claims.

Claims

1. A method for detecting and locating CAN bus error frames, characterized in that The application comprises the following steps: Waveform data of each controller is captured from the CAN bus network, and the waveform data is used as initial data; The waveform data of each controller is analyzed by an AI model, and the controller identity information corresponding to the waveform data is labeled; When an error frame is detected on the CAN bus, the complete waveform of the error frame is captured, and the waveform data segment corresponding to the first rising edge or falling edge at the trigger point of the error frame is intercepted; The intercepted waveform data segment is input into the AI model that has completed label training, and the AI model compares the labeled waveform features of each controller to identify the controller corresponding to the waveform data segment, which is the source controller of the error frame.

2. The positioning method according to claim 1, characterized in that, The rising edge and falling edge of the waveform in the initial data are used as feature points as input, and the waveform data of each controller is analyzed by an AI model, and the controller identity information corresponding to the waveform data is labeled, the specific method comprising: The waveform data is preprocessed, and the preprocessed data is divided into a training set, a validation set and a test set of the model; Edge features that can distinguish different controllers are extracted from the preprocessed waveform, and an AI model is trained based on the extracted edge features to obtain an initial training model; The initial training AI model is optimized to obtain a final AI model, and the trained model is deployed to the actual scene to automatically label the controller identity of the input CAN waveform, completing the labeling of the controller identity information corresponding to the waveform data.

3. The positioning method according to claim 2, characterized in that, Edge features that can distinguish different controllers are extracted from the preprocessed waveform, and the specific method comprises: for each rising edge and falling edge of the waveform, statistical features, timing features and morphological features are extracted; wherein the statistical features include the total number of rising edges / the total number of falling edges, the average edge slope and the edge slope standard deviation; the morphological features include rising edge delay time and falling edge delay time.

4. The positioning method of claim 2, wherein, The AI model is trained based on the extracted edge features to obtain an initial training model, and the specific method comprises: An edge feature matrix is constructed based on the extracted edge features, each controller identity is used as a label vector, and the edge feature matrix and label vector are input into the AI model; The type of AI model is determined, a convolutional neural network model is used as the AI model, the number of convolutional layers, the size and number of convolutional kernels, the type and size parameters of the pooling layer are determined, a stochastic gradient descent algorithm is used as the optimization algorithm, the learning rate of the model is set, and the loss function is defined; The extracted edge features and corresponding labels are input into the model for training; during the training process, the model calculates the loss value based on the input data and the set loss function, and updates the model parameters using the optimization algorithm; Through multiple iterations of training, the model parameters are continuously adjusted, and the model gradually learns the edge features in the data; in each iteration, the model uses part of the training set data for forward propagation and backward propagation, calculates the loss value and updates the parameters; During the training process, the training loss and validation loss of the model need to be monitored. If the training loss continuously decreases while the validation loss starts to rise, it indicates that the model has overfitting, and appropriate measures need to be taken to adjust it.

5. The positioning method of claim 2, wherein, The initial AI model is optimized to obtain a final AI model. The method comprises the following steps: evaluating the trained model using a test set, calculating the accuracy, recall rate and F1 value of the model on the test set to evaluate the performance of the model; optimizing the initial AI model according to the evaluation result, if the performance of the model is not ideal, adjusting the model architecture, optimizing the algorithm and learning rate parameter to optimize the initial AI model; after multiple training and optimization, an optimal model on the test set is obtained, which is the model.

6. The positioning method of claim 2, wherein, The error frame includes an error flag part and an error delimiter, and the error flag part is an active error flag composed of 6 continuous dominant bits or a passive error flag composed of 6 continuous recessive bits.

7. A CAN bus error frame detection and localization system characterized by, The method comprises a waveform data acquisition module, an AI feature marking module, an error frame waveform interception module and an error frame positioning module. The waveform data acquisition module is used to capture waveform data of each controller from the CAN bus network, and the waveform data is used as initial data. The AI feature marking module is used to input the initial data, analyze the waveform data of each controller through the AI model, and mark the controller identity information corresponding to the waveform data. The error frame waveform interception module is used to capture the complete waveform of the error frame when detecting the error frame of the CAN bus, and intercept the waveform data segment corresponding to the first rising edge or falling edge of the error frame trigger. The error frame positioning module is used to input the intercepted waveform data segment into the AI model that has completed the marking training, compare the marked waveform features of each controller by the AI model, identify the controller corresponding to the waveform data segment, and the controller is the source controller of the error frame.

8. The positioning system of claim 7, wherein, The AI feature marking module is used to input the initial data, analyze the waveform data of each controller through the AI model, and mark the controller identity information corresponding to the waveform data. The specific method comprises the following steps: The waveform data is preprocessed, and the preprocessed data is divided into a training set, a validation set and a test set of the model. The edge features capable of distinguishing different controllers are extracted from the preprocessed waveform, and the AI model is trained based on the extracted edge features to obtain an initial training model. The edge features capable of distinguishing different controllers are extracted from the preprocessed waveform. The specific method comprises the following steps: the rising edge and the falling edge of each waveform are extracted to obtain statistical features, timing features and morphological features. The statistical features include the total number of rising edges / falling edges, the average edge slope and the edge slope standard deviation. The morphological features include rising edge delay time and falling edge delay time. The AI model is trained based on the extracted edge features to obtain an initial training model. The specific method comprises the following steps: An edge feature matrix is constructed based on the extracted edge features, each controller identity is taken as a label vector, and the edge feature matrix and the label vector are input into the AI model. Determine the type of AI model, use a convolutional neural network model as the AI model, determine the number of convolutional layers, the size and number of convolutional kernels, and the type and size parameters of the pooling layer; use the stochastic gradient descent algorithm as the optimization algorithm, set the learning rate of the model, and define the loss function; The extracted edge features and corresponding labels are input into the model for training. During the training process, the model calculates the loss value based on the input data and the set loss function, and updates the model parameters using the optimization algorithm; Through multiple iterations of training, the model parameters are continuously adjusted, and the model gradually learns the edge features in the data. In each iteration, the model uses a portion of the training set data for forward propagation and backward propagation, calculates the loss value, and updates the parameters; During the training process, the training loss and validation loss of the model need to be monitored. If the training loss continues to decrease while the validation loss begins to rise, it indicates that the model has overfitting, and appropriate measures need to be taken to adjust it; Optimize the initial AI model to obtain the final AI model, and deploy the trained model to the actual scene to automatically label the controller identity of the input CAN waveform, and complete the labeling of the controller identity information corresponding to the waveform data.

9. An electronic device, comprising: Comprise: One or more processors; Memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the positioning method as claimed in any one of claims 1 to 6.

10. A computer readable medium having stored thereon a computer program, characterized in that The computer program is executed by the processor to implement the steps in the positioning method as claimed in any one of claims 1 to 6.