Vehicle-mounted diagnosis system based on CAN communication and adjustable power supply and method thereof

By designing an on-board diagnostic system based on CAN communication and adjustable power supply, the problem that existing systems are difficult to identify the CAN packet structure and semantics under the condition of no protocol files is solved, abnormal detection and linkage response control are realized, and the system's universality and diagnostic closed-loop capability are improved.

CN120161820AActive Publication Date: 2025-06-17RIVOTEK TECH (JIANGSU) CO LTD

Patent Information

Application Number
CN202510641546.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-19
Publication Date
2025-06-17
Estimated Expiration
2045-05-19

AI Technical Summary

Technical Problem

The existing on-board diagnostic system is difficult to identify the CAN message structure and semantics under the condition of no protocol file, and lacks abnormal detection and linkage response capabilities based on signal behavior, which limits its universality and diagnostic closed-loop capabilities in complex vehicle environments.

Method used

A vehicle-mounted diagnostic system based on CAN communication and adjustable power supply is designed, including CAN communication acquisition module, data processing module, signal semantic recognition module, abnormality detection module and adjustable power supply equipment module. The system realizes CAN message structure recognition, semantic inference and abnormal detection through multi-channel synchronous acquisition, byte feature clustering, bit-level entropy analysis, semantic label matching and prediction model construction, and performs closed-loop response control through adjustable power supply.

Benefits of technology

Under the condition of no protocol file, the system can automatically identify the CAN message structure and semantics, improve the ability to identify abnormal signal status, and realize real-time power supply control of the on-board electronic control unit through linkage adjustable power supply, improving the universality of the diagnostic system and the diagnostic closed-loop capability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120161820A_ABST
    Figure CN120161820A_ABST
Patent Text Reader

Abstract

The invention discloses a vehicle-mounted diagnosis system based on CAN communication and an adjustable power supply and a method thereof, and relates to the technical field of vehicle electronic diagnosis. Comprising the following steps: a CAN communication acquisition module is used for acquiring a multi-channel CAN message containing a timestamp; the data processing module is used for identifying a signal field in the message and generating a structured signal value; the signal semantic recognition module is used for matching the structured signal with the reference state data and determining a semantic tag of the structured signal; the anomaly detection module identifies structural anomaly, time anomaly and behavior anomaly based on rule judgment and time sequence prediction; the control instruction generation module is used for generating a power supply control instruction according to the abnormal level; and the adjustable power supply equipment module adjusts output voltage and current parameters according to the control instruction and feeds back a power supply state. According to the method, a closed-loop diagnosis process from CAN data acquisition, signal behavior modeling to power supply response control is constructed, and the method is suitable for application scenes such as function verification, anomaly recognition and system testing of the vehicle-mounted electronic control unit.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of vehicle electronic diagnosis, and in particular to a vehicle-mounted diagnosis system and method based on CAN communication and adjustable power supply. Background Art

[0002] With the development of intelligent connected vehicles, autonomous driving and electric vehicles, high-speed communication between electronic control units (ECUs) inside vehicles through the CAN (Controller Area Network) bus has become the mainstream architecture. Vehicle-mounted communication based on the CAN bus has the advantages of clear structure and stable transmission, and plays an important role in applications such as vehicle status monitoring, fault diagnosis, and test verification. Engineers usually analyze the signal fields in the CAN message to understand the working status and interaction behavior of various ECUs, and assist in functional verification and troubleshooting.

[0003] In the prior art, the parsing of CAN communication messages usually relies on the DBC protocol files provided by the manufacturer to obtain information such as message structure, signal boundaries and semantic labels. However, in application scenarios such as actual testing, reverse engineering, and cross-model platform development, the following problems often exist: First, the lack of protocol file support makes it impossible to correctly identify the message field structure; second, even if the structure is available, its signal semantics is difficult to distinguish, and it is difficult to meet the flexible testing requirements of multiple models and suppliers; third, the current anomaly detection is mostly based on threshold rules, which cannot capture abnormal patterns at the temporal behavior level; fourth, most existing diagnostic systems remain at the data collection and analysis layer, lack an active response mechanism to abnormal conditions, and are difficult to form closed-loop control.

[0004] Therefore, there is an urgent need for an on-board diagnostic system that can complete CAN message structure recognition and semantic inference without protocol files, realize anomaly detection based on signal behavior prediction, and link adjustable power supply for real-time control response, so as to improve the versatility, intelligence and diagnostic closed-loop capabilities in complex vehicle environments. Summary of the invention

[0005] The purpose of the present invention is to provide an on-board diagnostic system based on CAN communication and an adjustable power supply and a method thereof, which are used to identify the CAN message structure and semantics without a protocol file, identify abnormal states based on behavioral characteristics, and drive the adjustable power supply to perform closed-loop response control, so as to solve the problems of strong structural dependence, undistinguishable semantics, limited abnormal judgment and lack of linkage response in existing diagnostic systems.

[0006] The present invention achieves the above-mentioned purpose through the following technical solutions: In one aspect, the present invention provides an on-board diagnostic system based on CAN communication and adjustable power supply, comprising: The CAN communication acquisition module is used to establish a communication connection with the vehicle electronic control unit and acquire CAN message data including timestamp information; The data processing module is used to parse the CAN message data, identify one or more signal fields in the message, and perform byte order identification and sign bit identification on each signal field to obtain structured signal values; The signal semantic recognition module is used to align the structured signal values with reference data to determine the semantic tags of the structured signal values. The reference data is vehicle status information obtained through the OBD-II interface, vehicle sensors, or manual input; The anomaly detection module is used to build a prediction model based on the structured signal values and time information, compare the prediction results with the actual signal behavior, determine whether there is an anomaly, and output an anomaly flag; The control instruction generation module is used to generate control instructions according to the anomaly flag. The control instructions include control commands for setting power supply parameters; The adjustable power supply device module is used to adjust the output voltage and current parameters according to the control instructions and control the power supply status of the vehicle electronic control unit.

[0007] A further improvement of the present invention is that the CAN communication acquisition module includes: The multi-channel synchronous acquisition unit is used to receive messages from multiple CAN communication channels in parallel, and perform time alignment processing on the time information of each channel message based on a unified hardware clock to form an original message sequence with a unified time reference; The acquisition consistency verification unit is used to perform acquisition quality detection on the message sequence, including determining whether there are message losses, repetitions, abnormal field lengths, or timestamp mutations, and generating an acquisition consistency identifier for each message, which is provided to the anomaly detection module as a basis for judging data validity.

[0008] A further improvement of the present invention is that the data processing module includes: The byte feature extraction unit is used to extract the following features for each byte position in the acquired CAN message sequence Extract the following features: Byte flip rate , the expression is: ; Average byte value , the expression is: ; Ratio of different values , the expression is: ; Where: Indicates the field value of the byte in the th CAN message, is the total number of messages, Indicates the number of different values that the byte appears in all messages; Byte clustering unit, which is used to input the feature vector composed of the above three types of features into the density-based spatial clustering algorithm for clustering analysis to identify the candidate boundaries of the signal field. The algorithm uses the Euclidean distance as the similarity measure, and the clustering radius and the minimum number of samples are preset system parameters;

[0009] A further improvement of the present invention lies in that the data processing module includes: Bit-level entropy analysis unit, which is used to perform sliding window entropy value calculation in the CAN message data field. The window is a sliding window with a length of 8 bits and a step size of 1 bit , and the entropy value calculation formula is: ; Where: represents the probability of occurrence of the bit value in the window, and the window step size is 1 bit; Entropy difference determination unit, which is used to calculate the entropy difference between adjacent sliding windows. The calculation formula is: ; When the entropy difference is greater than the preset threshold , it is determined that the window start index is the candidate signal field boundary position; Field joint verification unit, which is used to perform position matching verification on the candidate field boundaries identified by the entropy difference determination unit and the field boundaries identified by the clustering algorithm. If the two boundary positions are the same or the distance between them is less than the preset tolerance value, it is determined as a valid signal field boundary; Field output unit, which is used to output the valid field boundary information confirmed by the field joint verification unit, including the start byte index and the end byte index of the field.

[0010] A further improvement of the present invention lies in that the signal semantic recognition module includes: State data normalization processing unit, which is used to collect the reference state data sequence during the vehicle operation, align the reference state data with the structured signal value sequence in dimension, and achieve the consistency of the sequence length through resampling, linear interpolation or time synchronization; A sequence matching and recognition unit, which takes a structured signal value sequence as input, performs one-to-one matching with a reference state data sequence, constructs a two-sequence difference degree matrix, and searches for the matching path with the minimum cost in a two-dimensional index space based on the cumulative difference cost of matrix elements. The matching path represents the optimal reference label correspondence of the structured signal value in the time dimension; A label output unit, which, according to the category information corresponding to the reference data samples in the matching path, marks the structured signal fields as dynamic class, state class, or verification class semantic labels respectively, and outputs them as the signal semantic recognition result.

[0011] A further improvement of the present invention is that the anomaly detection module includes: A structure rule matching unit, which compares the structured signal value with the reference numerical range of the corresponding semantic label. If the current signal value exceeds the preset minimum and maximum value ranges, it is determined as a structure anomaly, and a structure anomaly flag is output; A time deviation detection unit, which obtains the difference between the current actual acquisition time and the predicted acquisition time of the structured signal value. If the time difference exceeds the preset tolerance threshold range, it is determined as a time anomaly, and a time anomaly flag is output; A combined anomaly determination unit, which receives the structure anomaly flag and the time anomaly flag. If both are established at the same moment, it outputs an anomaly determination signal for indicating a high-level anomaly state.

[0012] A further improvement of the present invention is that the anomaly detection module further includes a prediction model module, and the prediction model module includes: A period normalization unit, which calculates the time interval between any current message and the previous message based on the historical CAN message timestamp data, and divides the time interval by the average period value of the corresponding message identifier to obtain a normalized period value; A prediction model training unit, which constructs a recurrent neural network model containing two layers of long short-term memory neural units, trains the normalized period sequence, and the training objective is to minimize the mean square error between the predicted time output by the model and the actual acquisition time; A time judgment interval generation unit, which determines an acceptable time interval within which the actual acquisition time should be based on the output result of the prediction model and the historical prediction error range; when the actual acquisition time of the current message exceeds this time interval, a prediction anomaly flag is generated to indicate the existing time behavior anomaly.

[0013] A further improvement of the present invention is that the control instruction generation module includes: A mapping unit, configured to call a corresponding control instruction template according to the exception level flag output by the exception detection module, wherein the template is preset with an instruction structure for power supply control; A parameter injection unit, configured to write current control parameters into the control instruction template, where the control parameters include a target voltage value, a target current value, and a continuous execution time; An instruction encapsulation unit, configured to encapsulate the instruction template injected with control parameters according to a preset serial communication protocol, and output the encapsulated control instruction data packet to an adjustable power supply device interface for controlling the voltage and current output behavior.

[0014] A further improvement of the present invention lies in that the adjustable power supply device includes: A serial port communication unit, configured to receive a control instruction data packet from the control instruction generation module based on a serial port protocol, and the protocol is MODBUSRTU or an equivalent communication protocol; A control instruction parsing unit, configured to parse the control instruction data packet, extract set parameter information, and control the power supply module to adjust the output voltage to a target voltage, adjust the output current to a target current, and maintain the output duration; A status feedback unit, configured to periodically read current output status parameters during the power supply control process, including real-time output voltage, current, and working status identifier, and feedback the status parameters via the serial port communication unit for subsequent control judgment.

[0015] On the other hand, the present invention provides a vehicle diagnosis method based on CAN communication and an adjustable power supply, which is applied to the vehicle diagnosis system based on CAN communication and an adjustable power supply as described above, and includes the following steps: Step 1: Establish a CAN communication connection, and collect CAN message data including timestamp information through a CAN communication acquisition module; Step 2: Parse the CAN message data through a data processing module, identify one or more signal fields in the message, and perform byte order identification and sign bit identification on each signal field to obtain a structured signal value; Step 3: Through a signal semantic recognition module, align the structured signal value with reference data obtained through an OBD-II interface, in-vehicle sensors, or manual input, and determine a semantic label of the structured signal value based on the comparison result; Step 4: Through an exception detection module, construct a prediction model based on the structured signal value and its corresponding timestamp information, and compare the prediction result with the actual signal behavior to determine whether there is an exception, and output an exception flag; Step 5: Through the control instruction generation module, generate control instructions according to the exception flag, where the control instructions include power supply parameters such as target voltage value, target current value, and continuous execution time; Step 6: Receive and execute the control instructions through the adjustable power supply device, and adjust the output voltage and current parameters to control the power supply state of the in-vehicle electronic control unit.

[0016] Compared with the prior art, the beneficial effects of the present invention are as follows: Without a protocol file, the present invention can automatically identify the message structure and field boundaries based on the collected CAN message data, and is applicable to the general diagnostic requirements in scenarios where multiple vehicle models and multiple protocols are not available; By matching and analyzing with the reference state data, semantic annotation of structured signal values is realized, which can assist in identifying the physical meaning corresponding to the signal fields and enhance the data interpretation ability of the system; The system integrates rule detection and time prediction methods, can comprehensively judge structural anomalies, time deviations, and behavioral anomalies, and improves the ability to identify abnormal signal states; Combining the generation of control instructions with the linkage of the adjustable power supply device, power supply parameter control based on the diagnostic results can be realized, and a closed-loop execution path of signal recognition - status judgment - power supply adjustment is constructed; The system modules are clearly divided and the interface definitions are clear, which can be applied to the deployment of various software and hardware platforms, and has good engineering realizability and test adaptability. Description of the Drawings

[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings. Among them: Figure 1 It is the system modular diagram of the present invention; Figure 2 It is the method flow chart of the present invention. Detailed Embodiments

[0018] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the following will clearly and completely describe the technical solutions of the embodiments of the present invention with reference to the drawings of the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. Based on the described embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art belong to the scope of protection of the present invention.

[0019] This embodiment provides an in-vehicle diagnostic system and method based on CAN communication and an adjustable power supply. Without relying on a CAN protocol database (such as a DBC file), the system can automatically complete CAN message structure analysis, signal semantics recognition, anomaly detection, and response control, and is applicable to application scenarios such as in-service testing of vehicle electronic control units (ECUs), abnormal behavior recognition, and fault injection response.

[0020] As Figure 1 shown in the figure, this is an embodiment of the present invention. This embodiment provides an in-vehicle diagnostic system based on CAN communication and an adjustable power supply, including: (1) CAN communication acquisition module The CAN communication acquisition module is used to establish a CAN communication connection with the vehicle's electronic control unit (ECU), collect message data on the vehicle's internal CAN bus, and attach an accurate timestamp to each message to achieve multi-channel synchronization and subsequent data parsing. The module is composed of the following: Multi-channel synchronous acquisition unit This unit is responsible for parallelly receiving messages from multiple CAN communication channels and adapting to multiple network segments such as the vehicle controller, powertrain system, and chassis control.

[0021] To achieve time consistency between channels, this unit assigns timestamps to all messages based on a unified hardware clock, thus forming an original message sequence with a unified time reference.

[0022] The message timestamp accuracy can be better than 1 ms; Supports channel expansion, such as interfaces like CAN0 / CAN1 / CANFD, etc.; Optionally supports a synchronous trigger mechanism to start acquisition driven by an external signal.

[0023] This mechanism ensures that the data collected from all channels has a unified time reference and supports subsequent time modeling of message behavior and extraction of timing features.

[0024] Acquisition consistency verification unit This unit is used to perform quality detection on the collected message sequence, specifically including: Message integrity judgment: Detect whether there are missing or duplicate messages; Field anomaly detection: Identify problems such as abnormal field lengths and illegal identifiers; Timestamp jump detection: Analyze the time continuity of the message and judge whether there are abnormal mutations; Consistency flag generation: According to the verification results, attach an acquisition consistency flag to each message for data validity screening.

[0025] The consistency flag will be used as an auxiliary basis for signal credibility judgment in the subsequent anomaly detection module. For example, it can filter out abnormal messages caused by communication jitter or interruption, improving the diagnostic accuracy.

[0026] Implementation basis and software and hardware environment This module can be deployed in the upper computer test platform. For example, the TSMaster tool can be used to configure the acquisition channel and timestamp function, and it can be connected to the vehicle network through the USB-CAN or PCIe-CAN interface. It can also be integrated into a dedicated diagnostic device as a front-end acquisition subsystem.

[0027] (2)Data processing module The data processing module is used to convert the message data obtained by the CAN communication acquisition module into structured signal values and identify the valid field boundaries in the messages. To adapt to the situation where there is no DBC protocol file in practice, this module realizes field parsing through a dual-path structure extraction mechanism, that is: Byte feature clustering path; Bit-level entropy value analysis path; The two paths independently identify the field boundaries and improve the recognition accuracy through result fusion.

[0028] 1. Byte feature clustering path This path identifies the structural features of signal fields in CAN messages based on statistical features and clustering algorithms.

[0029] 1.1 Byte feature extraction unit This unit is used for each byte position in the CAN message Extract three types of feature values, defined as follows: Byte flip rate , the expression is: reflecting the bit volatility at this position: ; Average byte value , the expression is: reflecting the numerical level: ; Ratio of different values , the expression is: reflecting the variation range: ; Among them: represents the th CAN message byte field value, is the total number of messages, is the logical indication function; represents the byte appears in all messages 1.2 Byte Clustering Unit Combine the above three eigenvalue to form an eigenvector and input it into a density clustering algorithm (such as DBSCAN). The specific implementation is as follows: Distance metric: Euclidean distance; Similarity judgment: Based on a preset clustering radius and minimum number of samples; Output result: Identify the boundary of the aggregation interval as the candidate field boundary.

[0030] 1.3 Field Output Unit Output the boundary indexes of each aggregation section in the clustering result as the start and end positions of the structured field, as the preliminary field recognition result.

[0031] 2. Bit-level Entropy Value Analysis Path This path analyzes the change trend of each bit in the CAN message based on the principle of information entropy, and is used to assist in identifying the signal field boundary.

[0032] 2.1 Bit-level Entropy Analysis Unit Perform a bit-level sliding window operation on the CAN message data: Window length: 8 bits; Step size: 1 bit; Entropy value calculation formula: ; Where: represents the bit value The occurrence probability within the window, and the window step size is 1 bit; 2.2 Entropy Difference Judgment Unit Used to detect the change amplitude between adjacent windows: The entropy difference is defined as: ; When the entropy difference is greater than the preset threshold , it is determined that the window start index is the candidate signal field boundary position; 3. Field Boundary Fusion and Verification Mechanism 3.1 Field Joint Verification Unit Match the field boundary identified by clustering with the entropy difference mutation point. If their positions are close, it is determined as a valid field boundary.

[0033] 3.2 Field Output Unit Output the valid field boundary information confirmed by the joint verification, including the start and end byte indexes of the field, and provide it to the subsequent module as the structured field information.

[0034] Module Output Result Field position (starting byte, ending byte); Structured signal values corresponding to each field; Basic attributes of each field (byte order, signed / unsigned flag, etc.).

[0035] In this embodiment, the module effectively improves the field recognition ability of the system under the condition of lack of protocol support by introducing a dual-path mechanism of statistical clustering + information entropy analysis, and is applicable to the CAN message structure analysis tasks of different vehicle models and different supplier ECUs, with strong engineering adaptability and technical expandability.

[0036] (3) Signal semantic recognition module This module is used to identify the semantic types (such as dynamic type, status type, verification type) of structured signal fields according to the vehicle operation state data, and realize the automatic meaning classification of unknown CAN signals. The module consists of the following sub-units: Status data normalization processing unit Collect the reference status data sequence during vehicle operation (such as engine speed, vehicle speed, gear obtained through OBD-II, etc.); Perform time synchronization, resampling or linear interpolation processing on the reference data to ensure that it is aligned with the structured signal value sequence in the time dimension and has a consistent data length; Support the diversity of reference data sources and have strong generality.

[0037] Sequence matching and recognition unit Based on the structured signal value sequence, construct a double-sequence difference matrix between it and the reference status data; Use the cumulative cost minimum path algorithm (such as DTW) to search for the minimum cost matching path in the two-dimensional index space; The matching path can represent the most similar alignment relationship of the signal with the reference status in the time dimension.

[0038] Label output unit According to the labels of the reference status samples in the matching path, label the structured signal fields into the following three categories: Dynamic type (such as engine speed); Status type (such as gear, switch); Verification type (such as CRC field); Output the result for reference by the anomaly detection module.

[0039] (4) Anomaly detection module This module is used to judge whether the signal shows abnormal behavior based on the signal results after semantic recognition, and then use it as the basis for the system response decision. Its composition is as follows: Structure rule matching unit For each structured signal value, compare it according to the reference numerical range corresponding to its semantic tag; If the signal value is less than the minimum value or greater than the maximum value, it is regarded as a structural anomaly; Output a structural anomaly flag.

[0040] Time deviation detection unit Obtain the acquisition time of the current message; Compare it with the expected sampling time corresponding to the message identifier; If the time difference exceeds the tolerance threshold preset by the system, it is marked as a time anomaly.

[0041] Joint anomaly determination unit If the structural anomaly flag and the time anomaly flag appear simultaneously at the same sampling moment, the system determines it as a high-level anomaly state; This state will trigger a key control response.

[0042] Prediction model module To improve the intelligence of time behavior recognition, the system further introduces a periodic prediction model: Period normalization unit For any current message, calculate the time interval between it and the previous message; Divide this interval by the average period of the message identifier to obtain a sequence of normalized period values.

[0043] Prediction model training unit Construct a recurrent neural network containing two layers of LSTM (Long Short-Term Memory) neural units; Use the sequence of normalized period values as input to predict the next cycle sampling moment; The model training objective is to minimize the mean square error between the actual sampling time and the predicted value.

[0044] Time judgment interval generation unit Based on the model output and historical error fluctuations, generate an acceptable sampling time interval; If the current sampling time exceeds this interval, generate a prediction anomaly flag.

[0045] (5)Control instruction generation module This module is used to automatically generate control instructions according to the anomaly level to drive an external adjustable power supply to intervene in the power supply state of the ECU.

[0046] The module includes: Mapping unit Receive the anomaly level flag (such as level one, level two, level three) from the anomaly detection module; Call the corresponding control strategy template, and the instruction structure and placeholder fields are preset in the template.

[0047] Parameter injection unit Fill in the control parameters such as the target voltage value, current value, and duration into the template; Support dynamic configuration of control strategies and adaptive calculation of parameters (such as control modes of boosting, power-off, and voltage-drop fluctuations).

[0048] Instruction encapsulation unit Encapsulate the control template after parameter injection into a serial port protocol data packet; Support common protocol formats such as MODBUS RTU and SCPI; Output the encapsulated instruction to the adjustable power supply device through the serial port.

[0049] (6) Adjustable power supply device This module is the power supply execution mechanism of the system, and changes the power supply parameters for the in-vehicle electronic control unit according to the received control instructions.

[0050] The module includes: Serial port communication unit Used to receive control instruction data packets; Support MODBUS RTU, SCPI or user-defined protocols; The communication baud rate and check format are configurable.

[0051] Control instruction parsing unit Parse the voltage, current, and time parameters in the data packet; The control power output module adjusts the voltage to the set value, stably outputs the current, and maintains the set duration.

[0052] Status feedback unit Periodically read the current power output parameters, including real-time voltage, current, overload status, etc.; Feedback the status parameters to the host computer through the serial port to achieve a closed-loop power supply control.

[0053] Such as Figure 2 As shown, it is another embodiment of the present invention. This embodiment provides a vehicle diagnosis method based on CAN communication and an adjustable power supply, which applies a vehicle diagnosis system based on CAN communication and an adjustable power supply as described above, and is characterized in that it includes the following steps: Step 1: Establish a CAN communication connection, and collect CAN message data containing timestamp information through the CAN communication acquisition module; Step 2: Parse the CAN message data through the data processing module, identify one or more signal fields in the message, and perform byte order identification and sign bit identification on each signal field to obtain structured signal values; Step 3: Through the signal semantic recognition module, align the structured signal values with the reference data obtained through the OBD-II interface, in-vehicle sensors, or manual input, and determine the semantic tags of the structured signal values based on the comparison results; Step 4: Through the anomaly detection module, construct a prediction model based on the structured signal values and their corresponding timestamp information, and compare the prediction results with the actual signal behavior to determine whether there is an anomaly and output an anomaly flag; Step 5: Through the control instruction generation module, generate control instructions according to the anomaly flag. The control instructions include power supply parameters such as target voltage value, target current value, and continuous execution time; Step 6: Receive and execute the control instructions through the adjustable power supply device to adjust the output voltage and current parameters to control the power supply state of the in-vehicle electronic control unit.

[0054] This method provides a complete technical path from signal structure recognition, semantic understanding, anomaly recognition to power supply intervention control, and constructs a closed-loop process of CAN diagnosis data-driven + abnormal behavior trigger + power supply control response. This method is applicable to the following typical application scenarios: CAN signal recognition and monitoring under the condition of no DBC protocol; ECU operation behavior stability analysis and automatic anomaly recognition; Power disturbance injection test and fault simulation verification; Intelligent driving system status confirmation and failure response control.

[0055] The method process has strong module independence and system integration, and is applicable to various automotive electronics development and verification scenarios such as software platform deployment, hardware-in-the-loop simulation (HIL), and bench test systems.

[0056] In summary, the present invention realizes the full-process diagnostic control ability of the in-vehicle electronic control unit by constructing a multi-module collaborative system including CAN communication acquisition, data structured processing, semantic recognition, anomaly detection, control instruction generation, and adjustable power supply response. This system can complete the structure recognition and semantic judgment of CAN signals under the condition of no protocol, has multi-dimensional anomaly detection ability, and can automatically drive the power supply device to perform closed-loop power supply regulation according to the diagnosis results, breaking through the limitations of existing vehicle diagnostic technologies in terms of structure dependence, behavior recognition, and linkage control. The whole system has the characteristics of flexible architecture, high function integration, and strong engineering adaptability, and is applicable to the debugging and verification of electronic control units, fault simulation tests, and system robustness evaluations in multi-vehicle and multi-platform environments, with broad application prospects and promotion value.

[0057] In the description of this specification, the descriptions referring to terms such as "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" etc. mean that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present application. Moreover, the specific features, structures, materials, or characteristics described may be combined in a suitable manner in any one or more embodiments or examples. In addition, without contradiction, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples.

[0058] Any process or method description shown in the flowchart or described in other ways herein can be understood as representing a module, segment, or part of code including one or more executable instructions for implementing a specific logical function or process. And the scope of the preferred embodiments of the present application includes additional implementations, where the functions may be executed in a substantially simultaneous manner or in the reverse order according to the functions involved, without being executed in the order shown or discussed.

[0059] As described above, the above is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present application can easily think of various changes or substitutions, and these should all be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. An on-board diagnostic system based on CAN communication and adjustable power supply, characterized in that: The system comprises: CAN communication acquisition module, used to establish a communication connection with the vehicle electronic control unit and collect CAN message data including timestamp information; A data processing module is used to parse the CAN message data, identify one or more signal fields in the message, and perform byte order recognition and sign bit recognition on each signal field to obtain a structured signal value; A signal semantic recognition module, used to align the structured signal value with reference data and determine the semantic label of the structured signal value, wherein the reference data is vehicle status information obtained through an OBD-II interface, an on-board sensor or manual input; An anomaly detection module, used to build a prediction model based on the structured signal value and time information, and compare the prediction result with the actual signal behavior to determine whether there is an anomaly and output an anomaly flag; A control instruction generating module, used for generating a control instruction according to the abnormal flag, wherein the control instruction includes a control command for setting a power supply parameter; The adjustable power supply device module is used to adjust the output voltage and current parameters according to the control instructions to control the power supply state of the vehicle-mounted electronic control unit.

2. The on-board diagnostic system based on CAN communication and adjustable power supply according to claim 1, characterized in that: The CAN communication acquisition module includes: Multi-channel synchronous acquisition unit, used to receive messages from multiple CAN communication channels in parallel, and perform time alignment processing on the time information of each channel message based on a unified hardware clock to form an original message sequence with a unified time reference; The collection consistency check unit is used to perform collection quality detection on the message sequence, including determining whether there is message loss, duplication, field length anomaly or timestamp mutation, and generating a collection consistency identifier for each message, which is provided to the anomaly detection module as a basis for judging data validity.

3. The on-board diagnostic system based on CAN communication and adjustable power supply according to claim 1, characterized in that: The data processing module comprises: Byte feature extraction unit, used to extract the byte position of each byte in the collected CAN message sequence The following features are extracted: Byte flip rate , the expression is: ; Average Byte Value , the expression is: ; Different value ratio , the expression is: ; in: Indicates The first The field value of the byte, is the total number of messages, is the logical indicator function; Indicates The number of different values ​​that a byte has in all messages; A byte clustering unit, used to input the feature vector composed of the above three types of features into a density-based spatial clustering algorithm for clustering analysis to identify candidate signal field boundaries. The algorithm uses Euclidean distance as a similarity metric, and the cluster radius and minimum number of samples are preset system parameters; The field output unit is used to output the field boundaries in the clustering results as structured field information.

4. The on-board diagnostic system based on CAN communication and adjustable power supply according to claim 1, characterized in that: The data processing module comprises: Bit-level entropy analysis unit, used to perform sliding window entropy value calculation in the CAN message data field, the window is a sliding window with a length of 8 bits and a step size of 1 bit , the entropy value calculation formula is: ; in: Indicates bit value The probability of occurrence within a window, wherein the window step is 1 bit; The entropy difference determination unit is used to calculate the entropy difference between adjacent sliding windows. The calculation formula is: ; When the entropy difference Greater than the preset threshold When , determine the window start index is the candidate signal field boundary position; A field joint verification unit is used to perform position matching verification on the candidate field boundary identified by the entropy difference determination unit and the field boundary identified by the clustering algorithm. If the positions of the two boundaries are consistent or the distance between them is less than a preset tolerance value, they are identified as valid signal field boundaries. The field output unit is used to output the valid field boundary information confirmed by the field joint verification unit, including the field start byte index and end byte index.

5. The on-board diagnostic system based on CAN communication and adjustable power supply according to claim 1, characterized in that: The signal semantic recognition module comprises: A state data normalization processing unit, used to collect a reference state data sequence during vehicle operation, and align the reference state data with the structured signal value sequence in dimension, and achieve sequence length consistency by resampling, linear interpolation or time synchronization; A sequence matching recognition unit is used to take the structured signal value sequence as input, perform one-to-one matching with the reference state data sequence, construct a dual sequence difference matrix, and search for a matching path with the minimum cost in a two-dimensional index space based on the cumulative difference cost of the matrix elements, wherein the matching path represents the optimal reference label correspondence relationship of the structured signal value in the time dimension; The label output unit is used to mark the structured signal fields as dynamic, state or verification semantic labels according to the category information corresponding to the reference data samples in the matching path, and output them as signal semantic recognition results.

6. The on-board diagnostic system based on CAN communication and adjustable power supply according to claim 1, characterized in that: The anomaly detection module comprises: The structural rule matching unit is used to compare the structured signal value with the reference value interval of the corresponding semantic label. If the current signal value exceeds the preset minimum and maximum value range, it is determined to be structurally abnormal and a structural abnormality flag is output; A time deviation detection unit is used to obtain the difference between the current actual acquisition time and the predicted acquisition time of the structured signal value. If the time difference exceeds a preset tolerance threshold range, it is determined as a time anomaly and a time anomaly flag is output; The combined abnormality determination unit is used to receive the structural abnormality flag and the time abnormality flag, and if the two are established at the same time, output an abnormality determination signal for indicating a high-level abnormal state.

7. The on-board diagnostic system based on CAN communication and adjustable power supply according to claim 1, characterized in that: The anomaly detection module further includes a prediction model module, and the prediction model module includes: The cycle normalization unit is used to calculate the time interval between any current message and the previous message based on the historically collected CAN message timestamp data, and divide the time interval by the average cycle value of the corresponding message identifier to obtain a normalized cycle value; A prediction model training unit is used to construct a recursive neural network model containing two layers of long short-term memory neural units, and train the normalized period sequence. The training goal is to minimize the mean square error between the predicted time output by the model and the actual acquisition time; The time judgment interval generation unit is used to determine an acceptable time interval within which the actual collection time should be based on the output results of the prediction model and the historical prediction error range; if the actual collection time of the current message exceeds the time interval, a prediction anomaly flag is generated to indicate the existence of time behavior anomalies.

8. The on-board diagnostic system based on CAN communication and adjustable power supply according to claim 1, characterized in that: The control instruction generation module comprises: A mapping unit, used to call a corresponding control instruction template according to the abnormality level flag output by the abnormality detection module, wherein the template is preset with an instruction structure for power supply control; A parameter injection unit, used to write current control parameters into the control instruction template, wherein the control parameters include a target voltage value, a target current value and a continuous execution time; The instruction encapsulation unit is used to encapsulate the instruction template after the control parameters are injected according to the preset serial communication protocol, and output the encapsulated control instruction data packet to the adjustable power supply device interface to control the voltage and current output behavior.

9. The on-board diagnostic system based on CAN communication and adjustable power supply according to claim 1, characterized in that: The adjustable power supply device comprises: A serial port communication unit, used for receiving a control instruction data packet from a control instruction generation module based on a serial port protocol, wherein the protocol is MODBUSRTU or an equivalent communication protocol; A control instruction parsing unit, used to parse the control instruction data packet, extract the setting parameter information and control the power module to adjust the output voltage to the target voltage, adjust the output current to the target current, and maintain the output duration; The state feedback unit is used to periodically read the current output state parameters, including real-time output voltage, current and working state identification, during the power supply control process, and feed back the state parameters via the serial communication unit for subsequent control judgment.

10. An on-board diagnostic method based on CAN communication and adjustable power supply, applied to an on-board diagnostic system based on CAN communication and adjustable power supply as claimed in any one of claims 1 to 9, characterized in that: The method comprises the following steps: Step 1: Establish a CAN communication connection and collect CAN message data containing timestamp information through the CAN communication acquisition module; Step 2: Parse the CAN message data through a data processing module, identify one or more signal fields in the message, and perform byte order recognition and sign bit recognition on each signal field to obtain a structured signal value; Step 3: Aligning the structured signal value with reference data obtained through the OBD-II interface, vehicle-mounted sensors or manual input through a signal semantic recognition module, and determining a semantic label of the structured signal value based on the comparison result; Step 4: Through the anomaly detection module, a prediction model is built based on the structured signal value and its corresponding timestamp information, and the prediction result is compared with the actual signal behavior to determine whether there is an anomaly and output an anomaly flag; Step 5: Generate a control instruction according to the abnormal flag through a control instruction generation module, wherein the control instruction includes power supply parameters such as a target voltage value, a target current value, and a continuous execution time; Step 6: Receive and execute control instructions through the adjustable power supply device to adjust the output voltage and current parameters to control the power supply status of the on-board electronic control unit.

Citation Information

Patent Citations

  • Data transmission method and electronic equipment

    CN112436924A

  • Automatic industrial control protocol reverse system and method based on global voting expert algorithm

    CN119105384A

  • Power system protocol analysis method and system based on association rule analysis and sequence comparison

    CN119150845A

  • Management method and device for stable operation of system and server

    CN119201630A

  • Black box fuzzy testing method and device based on feedback enhancement

    CN119475344A

Cited By

  • Vehicle-mounted heterogeneous equipment networking method

    CN120768926A

  • Communication method of electronic control unit, storage medium and electronic equipment

    CN121397012A