A method, apparatus, device, and storage medium for fuzzy testing of an in-vehicle CAN bus.
By constructing multidimensional behavior graphs and causal paths to generate anomaly test templates, the problem of CAN bus fuzzy testing being unable to cover complex timing and state logic is solved, enabling effective testing and anomaly injection of CAN bus communication behavior, and improving the effectiveness and accuracy of testing.
Patent Information
- Application Number
- CN202611322403.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-28
- Publication Date
- 2026-11-10
AI Technical Summary
Existing fuzzy testing methods for CAN bus are unable to cover complex logic that depends on timing and state, resulting in invalid tests. They lack protocol semantic constraints, cannot cover complex logic coupled with timing and state, lack test feedback optimization mechanisms, have insufficient safety control capabilities, and weak cross-ECU collaborative anomaly detection capabilities.
By constructing a multi-dimensional behavior graph, identifying causal paths, generating anomaly test templates, instantiating execution units to test the CAN bus, and obtaining test results, a systematic coverage of CAN bus communication behavior and anomaly injection are achieved.
This improves the effectiveness and coverage of CAN bus fuzz testing, enhances the accuracy of anomaly localization, and enables more effective fuzz testing of vehicle CAN bus communication behavior.
Smart Images

Figure CN123074804A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of vehicle testing technology, specifically to a method, apparatus, device, and storage medium for fuzzy testing of an on-board CAN bus. Background Technology
[0002] Controller Area Network (CAN), as the core communication method between Electronic Control Units (ECUs) in vehicles, is widely used in key functional modules such as powertrain systems, chassis systems, and body control systems. Related CAN bus fuzzy testing methods are mostly based on random mutation or boundary value perturbation; that is, randomly modifying byte data in the CAN message, or modifying it to field boundary values according to fixed rules, and then injecting it into the CAN bus to observe whether any anomalies occur. However, randomly modifying a single byte of data may not conform to the vehicle's communication logic, rendering the test invalid. Therefore, such testing methods are difficult to cover complex logic that depends on timing and state. Summary of the Invention
[0003] This invention provides a method, apparatus, device, and storage medium for fuzz testing of an in-vehicle CAN bus, in order to solve the problem that fuzz testing of CAN bus is difficult to cover complex logic that depends on timing and state.
[0004] In a first aspect, the present invention provides a method for fuzzy testing of an in-vehicle CAN bus, the method comprising: constructing a multi-dimensional behavioral graph based on vehicle CAN bus communication data to characterize the correlation between CAN signals; identifying causal paths characterizing the causal relationships between signals from the multi-dimensional behavioral graph to form a set of causal paths; constructing a multi-dimensional attack space to characterize the value spaces of various CAN signal data; generating an abnormal test template based on the set of causal paths and the multi-dimensional attack space, the abnormal test template describing the CAN signals participating in the test and the operation mode of injecting the CAN signals into the CAN bus; testing the CAN bus through an execution unit instantiated and converted from the abnormal test template; and obtaining test results.
[0005] In some optional implementations, the construction of a multidimensional behavioral graph based on vehicle CAN bus communication data to characterize the correlation between CAN signals includes: collecting CAN bus communication data under different vehicle operating conditions; extracting semantic attribute information of the CAN bus communication data through CAN protocol description information; extracting descriptive features of different CAN signals based on the semantic attribute information; calculating the correlation weight between each CAN signal through the descriptive features between each CAN signal; and drawing the multidimensional behavioral graph according to the correlation weight.
[0006] In some optional implementations, the descriptive features include at least one of timing features, statistical features, and semantic features; the timing features include at least one of the CAN signal message period, period jitter, and transmission interval, used to characterize the temporal correlation between CAN signals; the statistical features include at least one of the CAN signal bit distribution, field volatility, and flip frequency, used to measure whether the changing trends of different CAN signals are consistent; the semantic features include the correspondence between CAN signals and physical quantities, used to determine the degree of logical correlation between different CAN signals.
[0007] In some optional implementations, the step of calculating the correlation weight between each CAN signal based on the descriptive features between each CAN signal includes: calculating the temporal similarity based on the temporal features between two CAN signals; calculating the distribution consistency index of the probability distribution between two signals based on the statistical features between two CAN signals; calculating the logical correlation index based on the semantic features between two CAN signals; and normalizing and fusing the temporal similarity, the distribution consistency index, and the logical correlation index to obtain the correlation weight between the two CAN signals.
[0008] In some optional implementations, the step of identifying causal paths representing causal relationships between signals from the multidimensional behavior graph to form a set of causal paths includes: determining that the change time of the first signal precedes that of the second signal; determining whether the correlation weight between the first signal and the second signal is greater than a preset weight threshold; if it is greater than the preset weight threshold, detecting whether the second signal changes when a perturbation is applied to the first signal; if the second signal changes, determining that the path from the first signal to the second signal is a causal path; and traversing all signal pairs through the step of determining that the change time of the first signal precedes that of the second signal to the step of determining that the path from the first signal to the second signal is a causal path if the second signal changes, to obtain the set of causal paths.
[0009] In some optional implementations, the execution unit instantiated and transformed through the anomaly test template tests the CAN bus, including: calculating the priority of each execution unit based on the danger level of each CAN signal and the causal path confidence between each CAN signal; and controlling each execution unit to test the CAN bus according to the priority order.
[0010] In some optional implementations, obtaining the test results includes: obtaining the feedback CAN bus status information as the test results; and updating the scheduling priority of each execution unit based on the CAN bus status information.
[0011] Secondly, the present invention provides an in-vehicle CAN bus fuzzy testing device, the device comprising: a behavior graph construction module, used to construct a multi-dimensional behavior graph representing the correlation between CAN signals based on vehicle CAN bus communication data; a causal analysis module, used to identify causal paths representing the causal relationship between signals from the multi-dimensional behavior graph, forming a causal path set; a data space definition module, used to construct a multi-dimensional attack space representing the data value space of various CAN signals; a test template generation module, used to generate an abnormal test template based on the causal path set and the multi-dimensional attack space, the abnormal test template describing the CAN signals participating in the test and the operation method of injecting the CAN signals into the CAN bus; a testing module, used to test the CAN bus through an execution unit instantiated and converted from the abnormal test template; and a result feedback module, used to obtain the test results.
[0012] Thirdly, the present invention provides an electronic device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the computer instructions to perform the method described in the first aspect or any corresponding embodiment thereof.
[0013] Fourthly, the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to perform the method described in the first aspect or any corresponding embodiment thereof.
[0014] Fifthly, the present invention provides a computer program product, including computer instructions for causing a computer to perform the method described in the first aspect or any corresponding embodiment thereof.
[0015] The technical solution provided by this invention has the following advantages: This solution first collects and parses the vehicle CAN bus communication data, extracting multi-dimensional features to construct a multi-dimensional behavior graph. This graph represents the relationships between CAN messages and signal objects. Then, based on the multi-dimensional behavior graph, causal paths between signals are inferred, enabling the uncovering of potential interaction logic between signals within the bus and moving away from the traditional fuzz testing model that relies solely on random perturbations. Based on the causal paths, anomaly test templates with field constraints, timing constraints, and triggering conditions are generated. These templates are then instantiated into fuzz test execution units, generating test cases that closely match the actual bus communication logic, reducing the proportion of invalid tests. This solution, while ensuring a safe and controllable testing process, allows for targeted anomaly injection testing, improving the triggering efficiency of logic-based and timing-based anomalies under the CAN bus. This facilitates rapid detection of problems in bus communication, improves the accuracy of anomaly location, and enables more effective fuzz testing of vehicle CAN bus communication behavior. Attached Figure Description
[0016] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0017] Figure 1 This is a flowchart illustrating a method for fuzzy testing of an in-vehicle CAN bus according to an embodiment of the present invention. Figure 2 This is a schematic diagram of the structure of an in-vehicle CAN bus fuzzy testing device according to an embodiment of the present invention; Figure 3 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0019] It is understood that before using the technical solutions disclosed in the various embodiments of the present invention, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in the present invention and their authorization should be obtained in accordance with relevant laws and regulations through appropriate means.
[0020] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0021] As the core communication method between vehicle electronic control units, the CAN bus is widely used in key functional modules such as powertrain systems, chassis systems, and body control systems. With the rapid development of intelligent connected vehicles, the number of ECUs inside vehicles continues to increase, and the system control logic is becoming increasingly complex. The functional importance of the CAN bus is constantly increasing, and its safety issues are becoming more and more prominent.
[0022] Most fuzzy tests of CAN buses employ random mutation or boundary value perturbation. This typically involves randomly modifying CAN message bytes or injecting fields with fixed boundary outliers like 0xFF or 0x00 into the bus and then observing for any abnormal behavior. However, each byte in a CAN message corresponds to specific business semantics such as vehicle speed, braking force, and status flags. Directly and randomly modifying bytes often generates test data that does not conform to the actual communication logic of the vehicle, resulting in a large number of invalid tests. Furthermore, vehicle control behaviors have pre- and post-dependent relationships. For example, the braking process requires the pre-conditions of "vehicle speed greater than 50 km / h → braking request generated → brake pressure change." Traditional testing methods struggle to adapt to this type of business logic that is strongly coupled with timing and operational status. In summary, related technologies suffer from a lack of protocol semantic constraints in the test data and an inability to cover timing. The fuzzy testing approach suffers from several challenges, including complex state-coupled logic, a lack of test feedback optimization mechanisms, insufficient security control capabilities, and weak detection of cross-ECU collaborative anomalies. Therefore, there is an urgent need to develop a fuzzy testing method with semantic awareness, behavioral modeling, and adaptive scheduling capabilities to improve the effectiveness, coverage, and engineering feasibility of testing.
[0023] According to an embodiment of the present invention, an embodiment of a vehicle-mounted CAN bus fuzzy testing method is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0024] This embodiment provides a method for fuzzy testing of an in-vehicle CAN bus. Figure 1 This is a flowchart of a vehicle-mounted CAN bus fuzzy testing method according to an embodiment of the present invention. The process includes the following steps: Step S101: Construct a multi-dimensional behavioral graph based on vehicle CAN bus communication data to characterize the correlation between CAN signals; Step S102: Identify causal paths representing causal relationships between signals from the multidimensional behavior graph to form a set of causal paths; Step S103: Construct a multi-dimensional attack space to characterize the value space of various CAN signal data; Step S104: Generate an anomaly test template based on the causal path set and the multidimensional attack space. The anomaly test template is used to describe the CAN signals participating in the test and the operation method of injecting the CAN signals into the CAN bus. Step S105: The execution unit obtained by instantiating and converting the anomaly test template tests the CAN bus; Step S106: Obtain the test results.
[0025] Specifically, in the initial stage of testing, this embodiment of the invention first collects raw CAN bus communication data under actual vehicle operating conditions. Different signals within the vehicle network are not completely independent; there are objective data relationships between vehicle speed signals, brake pressure signals, and accelerator pedal position signals. A multidimensional behavioral graph is a graphical representation of these relationships, where nodes correspond to various CAN signals, and edges between nodes reflect the strength of the connection between different signals. This embodiment constructs this graph structure based on the collected bus communication data. Taking a high-speed CAN network segment of a fuel-powered passenger vehicle as an example, bus messages are continuously captured under actual vehicle driving conditions. After parsing the messages, three types of signals—vehicle speed, brake master cylinder pressure, and accelerator pedal opening—are extracted as nodes in the graph structure. Edges are assigned corresponding association weights based on the degree of data linkage between signals. The weight values are set between 0 and 1; the closer the weight value is to 1, the stronger the data connection between the two sets of signals. Nodes with too low a weight (e.g., below 0.2) are discarded, thus obtaining a multidimensional behavioral graph with sparse characteristics.
[0026] Multidimensional behavioral graphs can demonstrate the statistical relationships between signals. However, statistical correlations cannot be directly equated with the driving transmission relationships between signals. It is necessary to filter out pathways with causal transmission properties from the constructed graph structure. All filtered pathways together constitute a set of causal paths. Continuing with the passenger vehicle example, there is a high correlation weight between the vehicle speed signal node and the brake master cylinder pressure signal node in the multidimensional behavioral graph. However, this phenomenon only indicates that the data changes of the two sets of signals have synchronous characteristics; it cannot confirm that a change in the vehicle speed signal will lead to a response in the brake master cylinder pressure. At this point, a controlled data perturbation is applied to the candidate upstream signal, and the changes in the data distribution of the downstream signal are observed. If it is confirmed that the brake master cylinder pressure synchronously shifts after a change in the vehicle speed signal, a causal path from the vehicle speed signal to the brake master cylinder pressure signal can be established. All signal pairings within the graph are traversed to complete the extraction and aggregation of all valid causal paths.
[0027] After obtaining the set of causal paths, it is necessary to define the data boundaries for abnormal sample output during the testing process. This set of boundaries constitutes the multidimensional attack space. The multidimensional attack space defines the entire range of data values allowed for various CAN signals, including field value space, signal semantic space, message timing space, and cross-message state space. It encompasses both the numerical range within which the signal operates normally and abnormal values exceeding the normal business definition. By jointly modeling the multidimensional attack space, a systematic coverage of CAN communication behavior is achieved. For example, for the vehicle speed signal of the example vehicle, the protocol defines the legal physical quantity value range as 0~220km / h. The multidimensional attack space will extend the coverage of the value range outward to include values exceeding the nominal upper limit, such as 230km / h and 245km / h. At the message transmission level, the time offset of the signal message is also included in the coverage of the attack space. For example, timing samples with a message transmission time offset forward by 12ms and backward by 18ms are both covered by this space.
[0028] By constructing the causal path set and the multi-dimensional attack space, an anomaly test template can be generated. The anomaly test template carries the basic information of the test object and records all operational parameters injected into the bus by the test samples. The anomaly test template includes the target message or signal, field constraints, timing constraints, anomaly type, triggering conditions, and execution parameters. The anomaly types include field mutation, value out-of-bounds, timing disturbance, message loss, sequence disorder, and compound anomalies. Field mutation refers to modifying the data of a specific field in the CAN message; for example, if the normal vehicle speed is 80 km / h, the speed can be changed to 300 km / h during testing to observe the ECU's anomaly handling capability. Compound anomalies indicate that multiple anomalies are modified together, such as simultaneously modifying the braking force field, changing the transmission time, discarding some messages, simulating more complex attack scenarios. A single template completely records the CAN signal object participating in the test, as well as all operational parameters corresponding to the message injection of that signal into the CAN bus.
[0029] The causal path determines which signal and which correlation to attack. The multidimensional attack space determines how to attack and what anomalies to generate. In other words, the causal path determines what to measure, and the multidimensional attack space determines how to measure it.
[0030] The anomaly test template generation process includes: first, determining the target signal and associated conditions to be tested based on the causal path; second, selecting the corresponding anomaly dimension from the multidimensional attack space based on the field attributes, semantic constraints, temporal characteristics and state relationships corresponding to the target signal; then determining the anomaly parameters, triggering conditions and execution constraints, and finally generating an anomaly test template containing the target object, anomaly type, anomaly parameters, temporal constraints and triggering conditions.
[0031] Specifically, the first processing step in template generation involves identifying the target signal to be tested and its associated conditions based on a single causal path. The causal path records the upstream and downstream transmission relationships between signals; the upstream signal is the target object to be injected in this test, and the signal transmission relationships carried by the path itself are the basic association conditions. Taking the cross-ECU causal path "vehicle speed signal → brake master cylinder pressure signal" as an example, the upstream vehicle speed signal is identified as the target to be tested, and the signal transmission relationships represented by this path serve as the basic association conditions for the template generation stage.
[0032] After identifying the target signal to be tested, the corresponding field attributes, semantic constraints, temporal characteristics, and state relationships are retrieved. Based on this, suitable anomaly dimensions are selected within the multi-dimensional attack space. The multi-dimensional attack space encompasses a set of anomaly samples across multiple dimensions, including field values, semantics, temporal sequence, and state. Not all dimensions need to be enabled; instead, targeted selection is made based on the inherent communication characteristics of the target signal. For vehicle speed signals, the protocol file limits their legal physical value range and standard message transmission period. Furthermore, the signal's business behavior is strongly bound to the vehicle's driving state. Therefore, anomaly samples can be selected from the field value and temporal sequence dimensions. If the target signal is a phase-sensitive shifting state signal, the focus can be on selecting anomaly samples from the temporal and state dimensions, avoiding attack dimensions irrelevant to the signal's business characteristics and reducing meaningless candidate parameters.
[0033] After selecting the attack dimension, the abnormal parameters, triggering conditions, and execution constraints are further determined item by item. Abnormal parameters are taken from the value set of the corresponding dimension in the multi-dimensional attack space. Taking the aforementioned vehicle speed signal as an example, the protocol stipulates that the legal upper limit of vehicle speed is 220 km / h, so 235 km / h is selected as the abnormal parameter for the field out-of-bounds category. Triggering conditions limit the pre-test vehicle state for injection to take effect. Combined with business logic, this is set to an actual vehicle speed greater than 50 km / h. The injection behavior corresponding to this template is only allowed to be activated when the bus meets this operating state. Execution constraints are used to limit the boundaries of the test behavior, such as the maximum duration of message injection and the number of consecutively injected messages in a single instance.
[0034] After configuring the above elements, the target object, exception type, exception parameters, timing constraints, and triggering conditions are integrated and encapsulated to output a complete exception test template.
[0035] By iterating through all valid causal links in the causal path set one by one and repeating the template generation process described above, a complete batch of anomaly test templates can be obtained.
[0036] For example: Template 1 (Braking Anomaly): Target ID: 0x2F4, Target Field: Braking Force Signal, Anomaly Type: Field Out of Bounds, Injected Value: 150% (Exceeding Normal Range), Timing Constraint: Triggered when vehicle speed > 50km / h, Execution Frequency: 20Hz. Template 2 (Timing Attack): Target ID: 0x130, Anomaly Type: Timing Advancement, Advance Time: 15ms.
[0037] Anomaly test templates are abstract text at the descriptive level and cannot directly output message data to the vehicle bus. They need to be instantiated and converted into executable test execution units. The execution unit translates the template information, converting the signal objects, anomaly values, and injection operations recorded in the template into message call instructions that the hardware interface can recognize. Internally, the unit encapsulates the message ID, signal encoding conversion results, and relevant message output parameters, and sends the message via the CAN adapter hardware interface. Different templates generate their own independent execution units, and all execution units participate in the bus injection test sequentially.
[0038] After each set of execution units completes bus injection, it collects various status information fed back from the bus as the output of this test. In the example real vehicle test bench environment, the execution unit continuously injects an abnormal message representing 245km / h into the bus, and then collects the ECU feedback message and bus frame statistics as the test results. Based on the obtained test results, it can be determined whether this abnormal injection triggered abnormal behavior in the vehicle network, thus completing a complete test process.
[0039] Based on the aforementioned technical methods, the establishment of multi-dimensional behavioral graphs breaks away from the inherent paradigm of isolated single-message testing. It incorporates the objectively existing data connections between signals into the testing considerations. The generation of test samples no longer relies entirely on randomly tampering with bytes, significantly reducing the proportion of meaningless test samples. Through causal path filtering, the testing process prioritizes injection operations on signal links with transmission relationships, improving the probability of discovering potential anomalies compared to the indiscriminate traversal of all message fields. The multi-dimensional attack space provides clear data value boundaries, and both the anomaly test template and execution unit are generated under these boundary constraints, ensuring that test samples have a clear business orientation. The entire processing flow targets the inherent characteristics of automotive CAN communication, effectively detecting interactions between signals on the bus and enhancing the practical effectiveness of fuzz testing technology in automotive network scenarios.
[0040] In some optional implementations, step S101 above includes: Step a1: Collect CAN bus communication data under different vehicle operating conditions; Step a2: Extract the semantic attribute information of the CAN bus communication data through the CAN protocol description information; Step a3: Extract descriptive features of different CAN signals based on the semantic attribute information; Step a4: Calculate the correlation weight between each CAN signal using the descriptive features between each CAN signal, and draw the multidimensional behavior graph based on the correlation weight.
[0041] Specifically, in this embodiment of the invention, the construction process of the multidimensional behavior graph can be broken down into a multi-stage data processing flow.
[0042] The test hardware environment consists of a host computer, a CAN interface adapter, a vehicle test bench, and the corresponding DBC protocol file for the vehicle model. The CAN interface adapter handles data forwarding between the host computer and the vehicle's CAN network segment; all raw bus data is transmitted back to the host computer via this hardware link. The first step is to collect raw bus data. This includes various operating conditions such as vehicle idling, constant speed driving at 60 km / h, rapid acceleration, and moderate braking. The sampling frequency can be set to 500 Hz to continuously capture CAN bus communication data.
[0043] After acquiring the original message sequences under multiple operating conditions, the CAN protocol description file is used to complete the parsing and extraction of semantic attribute information. This includes, but is not limited to, DBC files and equivalent signal definition data. The DBC file records the underlying encoding rules of the vehicle signals, essentially acting as a "communication protocol dictionary" for the CAN bus. Equivalent signal definition data refers to other documents with similar functions to the DBC file, which can also describe message IDs, signal lengths, and value ranges. Taking the DBC file as the protocol description carrier as an example, the host computer reads the DBC file to parse the binary CAN messages, converting the bit stream in the messages into signal values with actual physical meaning, such as vehicle speed, braking pressure, and pedal opening. This establishes a mapping between bit data and physical quantities, obtaining the semantic information corresponding to each set of CAN signals. Simultaneously, through data parsing, attribute information such as message identifiers, data length codes, signal start bits and lengths, scaling ratios and offsets, signal value ranges, and enumeration types are obtained.
[0044] Based on the semantic attribute information obtained from the parsing, various descriptive features corresponding to different CAN signals are further extracted. The processing procedure performs statistics on the collected message data to obtain descriptive features that can characterize the behavior of CAN signals, which are used to represent the data change performance of different signals.
[0045] After obtaining the descriptive features of multiple signal sets, a similarity algorithm can be used to calculate the correlation weight between each pair of CAN signals based on these features. This weight represents the degree of correlation between the two signal sets. A corresponding weight threshold is set, and only node connections with weights greater than this threshold are retained. Using various signals such as the parsed vehicle speed signal, brake master cylinder pressure signal, and accelerator pedal opening signal as nodes in the graph, connection edges between nodes are generated according to the calculated correlation weights. Weak connections with weights below the threshold are removed, ultimately generating a multidimensional behavioral graph with a sparse structure.
[0046] After the above step-by-step processing, the analysis of the raw binary messages is no longer done in a general way, but rather at the level of business signals to quantify the strength of the connections between signals. The multi-condition acquisition mode can cover various vehicle operating states, enabling the acquisition of more comprehensive raw bus samples. Message parsing is completed using protocol files, avoiding the semantic loss problems caused by directly manipulating raw bits. A sparse graph structure is obtained through weighted filtering, filtering out a large number of low-value weak associations, reducing the computational overhead of subsequent graph analysis, and providing a reliable data model foundation for subsequent causal path identification.
[0047] In some optional implementations, the descriptive features include at least one of timing features, statistical features, and semantic features; the timing features include at least one of the CAN signal message period, period jitter, and transmission interval, used to characterize the temporal correlation between CAN signals; the statistical features include at least one of the CAN signal bit distribution, field volatility, and flip frequency, used to measure whether the changing trends of different CAN signals are consistent; the semantic features include the correspondence between CAN signals and physical quantities, used to determine the degree of logical correlation between different CAN signals.
[0048] Specifically, in this invention, the descriptive features used to construct the multidimensional behavior graph can be any one or a combination of time-series features, statistical features, and semantic features. The interaction of various signals within the vehicle CAN bus is reflected in the time dimension, data change dimension, and business interpretation dimension. A single type of feature is insufficient to fully capture the inherent relationship between signals. Selecting the corresponding feature type based on the actual test conditions can match the data processing requirements of different test scenarios.
[0049] Timing characteristics are used to characterize the time correlation at the CAN signal layer, and at least one of the following can be selected for calculation: message period, period jitter, and transmission interval. Taking a high-speed CAN network segment of a passenger vehicle as an example, the baseline transmission period of the message representing engine speed is set to 10ms. Affected by fluctuations in vehicle load, the actual message output will exhibit... The periodic jitter within the range of 1.2ms to +1.5ms, and the time difference between two adjacent messages of the same type, constitute the transmission interval. When the message period, jitter range, and transmission interval of two sets of signals exhibit a synchronous trend, such as one preceding the other, it indicates a temporal linkage between them. This type of time-dimensional information can reflect the objective relationship between the signals in the transmission timing.
[0050] Statistical characteristics are used to measure the degree of matching of data change trends in different CAN signals. At least one of the following can be used for statistical analysis: bit distribution, field volatility, and flip frequency. Bit distribution represents the percentage of bits that are 0 or 1 in the message; field volatility records the overall fluctuation amplitude of the signal value per unit time; and flip frequency characterizes the occurrence of bits being 0. 1. Frequency of state transitions. For example, when a vehicle depresses the brake pedal, the volatility of the field corresponding to brake pressure increases significantly, and the flipping frequency of the relevant state bits increases synchronously. By comparing the changes in the above statistical indicators of the two sets of signals, it can be determined whether the trends of the two data changes tend to be synchronized.
[0051] Semantic features reflect the mapping relationship between CAN signals and physical quantities. This information originates from the encoding and conversion rules recorded in the protocol file. After scaling and offset conversion, binary message fields are mapped to understandable physical quantities such as vehicle speed, brake pressure, and pedal opening. Some signals do not have obvious time synchronization or statistical value synchronization, but the physical services they represent are inherently related. For example, the physical quantity of brake pedal travel and the physical quantity of brake master cylinder pressure. Based on the correspondence of these physical quantities, the degree of correlation at the service level between signals can be determined.
[0052] In actual testing, a single type of feature can be used to calculate subsequent correlation weights, or two or even three types of features can be used simultaneously for joint analysis. Using only a single type of feature results in lower computational overhead, making it suitable for testing equipment with limited hardware computing power. Combining multiple types of features allows for a more comprehensive portrayal of the relationships between signals, considering temporal transmission behavior, statistical performance, and business interpretation, thus providing multi-faceted data support for solving subsequent correlation weights.
[0053] In some alternative implementations, step a4 above includes: Step a41: Calculate the timing similarity based on the timing characteristics between the two CAN signals; Step a42: Calculate the distribution consistency index of the probability distribution between the two CAN signals based on the statistical characteristics between them; Step a43: Calculate the logical association index based on the semantic features between the two CAN signals; Step a44: Normalize and fuse the temporal similarity, the distribution consistency index, and the logical association index to obtain the association weight between the two CAN signals.
[0054] Specifically, the calculation of the correlation weights between signals can be broken down into three indices, each calculated separately and then fused. First, the temporal similarity is calculated based on the timing characteristics of the two sets of CAN signals. This index captures the sequential pattern of signal changes over time. For the acquired signal time series, for example, the timestamp sets corresponding to all numerical jump points of the two sets of signals are extracted. For instance, in a real vehicle shifting scenario, the time when the engine speed signal jumps is denoted as Ta, and the time when the vehicle speed signal jumps is denoted as Tb. The time difference Ta-Tb for each matching jump pair is calculated; for example, in this example, this difference is concentrated around 100ms. The mean and standard deviation of the time differences of all valid jump pairs are calculated. The actual standard deviation is converted to the preset maximum allowable standard deviation and then mapped to the 0-1 output range. If the time difference of a large number of jump samples is stable at 100ms and the standard deviation is very small, the temporal similarity calculation result approaches 1; if the time difference of the jumps is discrete and has no fixed interval, the temporal similarity approaches 0. Taking engine speed and vehicle speed signals as examples, the transition delay of a large number of samples is concentrated in 92-108ms, and the calculated time series similarity can reach 0.87.
[0055] Secondly, by utilizing the statistical characteristics of the two sets of CAN signals, a distribution consistency index is obtained for their probability distributions. This index is used to assess the degree of matching between the overall change patterns of the two sets of signals. The values of the two signals are divided into discrete intervals with an equal number of samples. The sample counts within each interval are statistically analyzed to obtain the probability density histograms for signals A and B. The KS test is used to calculate the maximum cumulative deviation between the two sets of sample distributions. The test statistic is then mapped and transformed to obtain a distribution consistency index between 0 and 1. For example, when a vehicle is accelerating, as the vehicle speed continuously increases, the engine speed increases synchronously. The cumulative deviation between the probability distributions of the two sets of signals is small, and the distribution consistency index is high. Conversely, if one set of signal values continuously increases while the other set shows no corresponding change, the cumulative deviation is large, and the consistency index approaches 0. The higher the index value, the higher the degree of matching between the overall change trends of the two sets of signal values.
[0056] Subsequently, a logical association index is calculated based on semantic features. This index is equivalent to the mutual information between the two sets of signals. Mutual information, in information theory, measures the degree of interdependence between two random variables. It represents the reduction in uncertainty of one variable after knowing the other. Mutual information is used to measure the amount of effective information that can be obtained from the observation of one signal to that of another. For two sets of discretized CAN signal samples, the joint probability and marginal probability are statistically calculated using the standard formula for mutual information, and then normalized to the 0-1 interval. If knowing the value of signal A allows for a highly reliable prediction of the value of signal B, then the logical association index of the two sets of signals is relatively high. For example, for the brake pedal travel signal and the brake master cylinder pressure signal, the observation of the pedal travel can effectively predict the value of the brake pressure, and the calculated mutual information, after normalization, can reach 0.91. However, there is almost no information interaction between the vehicle lighting control signal and the engine speed signal, and the joint probability is approximately equal to the product of the marginal probabilities, so the corresponding logical association index approaches 0.
[0057] After obtaining the three normalized indicators mentioned above, a weighted summation W=a·M+b·T+c·D is performed, where M represents the logical association indicator, T represents the temporal similarity, and D represents the distribution consistency indicator. The weighting coefficients satisfy a+b+c=1, and the final association weights in the 0-1 interval are output, which are used for assigning edge weights to the multidimensional behavioral graph.
[0058] Technicians can adjust the values of each coefficient based on the testing focus. If the test emphasizes the linkage at the signal timing level, coefficient b can be increased appropriately; if the coupling relationship at the business information level is emphasized, coefficient a should be increased. The final weight W will fall within the range of 0. In interval 1, the larger the weight value, the stronger the correlation between the two sets of CAN signals. Through the above-described multi-dimensional calculation and fusion processing mode, information from time evolution, statistical distribution, and business information correlation is unified into quantifiable weight scalars, providing a unified numerical benchmark for assigning edge weights to the multi-dimensional behavioral graph. The joint consideration of multi-dimensional indicators avoids the biased judgments caused by single-dimensional evaluation, ensuring that the final correlation weights more closely reflect the actual coupling situation of signals within the vehicle network, laying a reliable quantitative foundation for the subsequent construction of the graph structure.
[0059] In some optional implementations, step S102 above includes: Step b1: Determine that the change time of the first signal precedes that of the second signal; Step b2: Determine whether the correlation weight between the first signal and the second signal is greater than a preset weight threshold; Step b3: If the value is greater than the preset weight threshold, detect whether the second signal changes when a disturbance is applied to the first signal; Step b4: If the second signal changes, then the path from the first signal to the second signal is determined to be a causal path; Step b5 involves traversing all signal pairs to obtain the set of causal paths, from the step of determining that the change time of the first signal precedes that of the second signal to the step of determining that the path from the first signal to the second signal is a causal path if the second signal changes.
[0060] Specifically, for each candidate signal pair in the multidimensional behavior graph, a timing sequence determination is first performed to verify whether the time of significant change in the first signal generally precedes the time of change in the second signal. The time-stamped signal sequences collected and stored previously are read, and all time points at which the amplitude of the two signals changes are extracted. Taking the accelerator pedal opening signal and engine torque signal in the vehicle network as an example, jump time samples under multiple driving conditions are statistically analyzed. If the vast majority of sample records show that the jump time of the accelerator pedal opening signal is earlier than the jump time of the engine torque signal, then the upstream signal timing precedence condition is met. If the statistical results show a large number of samples where the jump time of the second signal precedes that of the first signal, then the causal candidate in that direction is directly excluded and not proceeded to subsequent processing stages.
[0061] After completing the timing condition verification, the calculated correlation weights for the candidate signal pairs are retrieved and compared with a pre-configured weight threshold. In this implementation, the preset weight threshold is set to 0.6. If the correlation weights of two signal pairs do not reach this threshold, it indicates that the overall coupling between the two signals is weak. Even if the timing condition is met, disturbance verification is not performed, and the candidate pair is discarded. For example, for the window control signal and the coolant temperature signal, even if a timing jump is occasionally observed, the calculated correlation weight is only 0.18, lower than the set threshold, and the subsequent determination of this signal pair is terminated. Only signal pairs with correlation weights exceeding the preset threshold enter the controlled disturbance verification stage.
[0062] For signal pairs that simultaneously meet the conditions of timing precedence and weight exceeding the threshold, while maintaining other vehicle operating conditions unchanged in the test bench environment, a controlled perturbation is applied to the first signal, which acts as a candidate upstream. Complete sampling sequences of the second signal before and after the perturbation are collected, and it is determined whether the data distribution of the second signal undergoes a statistically significant change. In practical processing, the KS test can be used to compare the distribution differences of downstream signal samples before and after the perturbation. Assuming a modified message is injected into the bus, a controllable numerical offset perturbation is applied to the accelerator pedal opening signal, and engine torque sampling data is continuously collected. If the test results show a significant shift in the probability distribution of the downstream signal after the perturbation, it confirms that the numerical change of the first signal can actually drive the second signal.
[0063] Once controlled disturbance detection confirms a significant change in the downstream signal, a valid causal path is established from the first signal to the second signal. This path does not limit the signals to belonging to the same electronic control unit and can identify cross-component interaction links distributed between different ECUs.
[0064] The entire discrimination logic, from temporal sequence confirmation to causal path determination, is iteratively executed across all candidate signal pairs within the multidimensional behavior graph. After each signal pair is verified, the identified valid path is saved as a causal path. All valid paths are aggregated to obtain a complete set of causal paths. Through this hierarchical discrimination, this embodiment of the invention can filter out pseudo-correlated pairs that only exhibit statistical synchronization characteristics, using the measured bus response to controlled bench disturbances as the basis for causal determination, thus reducing the risk of misjudgment caused by purely statistical inference based solely on historical data. The final output set of causal paths objectively depicts the driving transmission links of signals within the vehicle bus, providing clear candidate test objects for the generation of subsequent anomaly test templates.
[0065] In some optional implementations, step S105 above includes: Step c1: Calculate the priority of each execution unit based on the danger level of each CAN signal and the causal path confidence between each CAN signal; Step c2: Control each execution unit to test the CAN bus according to priority order.
[0066] Specifically, in this embodiment of the invention, all execution units obtained by the abnormal test template conversion will not be executed in an unordered manner. Instead, the priority is obtained by combining the danger level of the CAN signal itself and the confidence of the causal path. The scheduling module completes the bus injection test in sequence according to the priority level.
[0067] The anomaly test template is instantiated to generate schedulable fuzzy test execution units. Each execution unit encapsulates the message ID, field mutation rules, timing control parameters, message injection frequency, and maximum execution count. Before officially sending messages to the bus, CRC verification, DLC validity verification, and signal encoding validity verification are performed to eliminate messages with incorrect formats, preventing bus errors caused by illegal message formats. After instantiation and pre-verification of all execution units, priority calculation is performed for each unit. The priority calculation formula used in this implementation is: Priority = Field Risk Score × Path Confidence. The field risk score quantifies the likelihood and severity of adverse effects on vehicle functionality, safety status, and ECU operation after an abnormal tampering of a CAN signal field. This score is obtained through a multi-dimensional weighted calculation of field functional importance, safety sensitivity, historical anomaly triggering, and the correlation degree of the multi-dimensional behavior graph. The importance of a field's function can be determined by reading the DBC protocol description file and the corresponding ECU function category to which the signal belongs. Signals belonging to braking or power control ECUs have higher importance values. Safety sensitivity is assigned based on the conclusions of the overall vehicle safety analysis. Historical anomaly triggering scenarios are taken from the test feedback statistics collected during this round of testing. For example, the brake master cylinder pressure signal belongs to a chassis safety-related ECU and has high safety sensitivity, with a corresponding field risk score of 0.92. The status signals of the in-vehicle multimedia entertainment system do not participate in the overall vehicle driving control, and the field risk score is 0.25.
[0068] Path confidence characterizes the reliability level of the signal transmission relationship represented by a causal path, and can be calculated by weighting signal correlation strength, timing consistency, and disturbance verification results. The signal correlation strength represents the correlation weight between the aforementioned CAN signals; the timing consistency calculation method is described in the previous embodiment; the disturbance verification result is represented by the disturbance verification score, and the specific scoring rules can be defined by technicians according to actual needs, which will not be repeated in this embodiment.
[0069] If the signal pair has a high correlation weight, low time dispersion of timing jumps, and significant changes in the distribution of downstream signals under controlled disturbances, the path confidence approaches 1. If the downstream signal shows no stable response after multiple disturbance tests, the path confidence approaches 0. The risk score of the corresponding execution unit is multiplied by the path confidence to obtain the final priority value of that execution unit. After the priorities of all execution units are calculated, the scheduling module sequentially calls up each execution unit in descending order of priority to complete the injection test of abnormal messages into the CAN bus.
[0070] Based on the aforementioned technical methods, high-priority execution units receive test resources first and are given priority in anomaly injection targeting security-sensitive signal links, while lower-priority execution units are executed later. By incorporating both signal security risks and the reliability of causal paths into the priority determination criteria, test resources are tilted towards test objects with high security risks and high reliability of transmission links. This increases the coverage probability of high-risk anomaly scenarios within a limited test cycle and improves the practical testing efficiency of fuzz testing.
[0071] In some optional implementations, safety constraint control logic is introduced during the test execution phase to implement boundary control over the injection behavior of fuzz testing. During test execution, the operating status of the CAN bus is continuously monitored, and upper limit thresholds are set for the injection frequency of abnormal messages and the bus load level to prevent test messages from excessively consuming bus bandwidth. Bus feedback information is collected in real time, and once an ECU restart or bus entry is detected... In response to anomalies such as an off state or a rapid surge in error frames, the scheduling module immediately suspends the message injection operation of the current execution unit to prevent the test behavior from further aggravating the bus anomaly and to protect the vehicle ECU hardware from the negative impact of the test operation. The subsequent test process can only continue after the bus state returns to normal, depending on the configuration.
[0072] In some optional implementations, step S106 above includes: Step d1: Obtain the feedback CAN bus status information as the test result; Step d2: Update the scheduling priority of each execution unit based on the CAN bus status information.
[0073] Specifically, in some optional implementations, after the test is completed, feedback information from the bus side is collected as the test result, and the scheduling priority of each execution unit is dynamically adjusted using this feedback data, thereby forming a closed-loop iterative test processing flow.
[0074] Throughout the message injection test conducted by the execution unit, CAN bus status information is continuously collected. This collection includes multi-dimensional data such as ECU operating status, CAN error frame statistics, ACK anomaly events, and real-time bus load. All of this information is used as the test result for this round. For example, if an abnormal message with identifier 0x2F4 and data length DLC equal to 9 is injected into the bus, and a restart of the braking ECU is detected, the system synchronously records the triggering conditions of this test, the observed abnormal phenomenon, and the minimum message test case that can reproduce the fault, thus completing the recording and retention of test site information.
[0075] After receiving the status information from the bus, the underlying parameters of the corresponding execution unit are adjusted based on whether the test process triggers a bus or ECU malfunction, thereby updating the scheduling priority of that execution unit. If an execution unit successfully reproduces abnormal phenomena such as ECU restart or a large number of error frames during the injection process, the risk score and causal path confidence of the corresponding execution unit are increased. After recalculation, its scheduling priority is improved, and it can obtain more execution opportunities in subsequent test cycles. For execution units that have not observed any abnormal response in multiple executions, the risk score or path confidence is appropriately reduced, so that its calculated scheduling priority is reduced accordingly.
[0076] After the priorities of all execution units have been updated, the scheduling module will then conduct the next round of fuzzy injection testing according to the updated priority arrangement. Based on the above technical means, the actual bus test feedback is introduced into the scheduling decision-making process, causing test resources to be tilted towards execution units that are more likely to trigger exceptions. This avoids the test process always using fixed scheduling parameters, thus improving the efficiency of vulnerability discovery within a limited test duration.
[0077] This embodiment also provides an in-vehicle CAN bus fuzzy testing device, which is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0078] This embodiment provides an on-board CAN bus fuzzy testing device, such as... Figure 2 As shown, it includes: Behavior graph construction module 201 is used to construct a multi-dimensional behavior graph based on vehicle CAN bus communication data to characterize the correlation between CAN signals; Causal analysis module 202 is used to identify causal paths representing causal relationships between signals from the multidimensional behavior graph, and form a set of causal paths; The data space definition module 203 is used to construct a multi-dimensional attack space to characterize the value space of various CAN signal data. The test template generation module 204 is used to generate an abnormal test template based on the causal path set and the multidimensional attack space. The abnormal test template is used to describe the CAN signal participating in the test and the operation method of injecting the CAN signal into the CAN bus. Test module 205 is used to test the CAN bus by the execution unit instantiated and converted from the anomaly test template; The result feedback module 206 is used to obtain test results.
[0079] The apparatus provided in this embodiment of the invention can execute the method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects for executing the method. Further functional descriptions of the various modules and units described above are the same as those in the corresponding embodiments described above, and will not be repeated here.
[0080] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention.
[0081] The following is a detailed reference. Figure 3 The diagram illustrates a structural schematic suitable for implementing an electronic device according to embodiments of the present invention. The electronic device may include a processor (e.g., a central processing unit, graphics processor, etc.) 301, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 302 or a program loaded from memory 308 into random access memory (RAM) 303. The RAM 303 also stores various programs and data required for the operation of the electronic device. The processor 301, ROM 302, and RAM 303 are interconnected via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.
[0082] Typically, the following devices can be connected to I / O interface 305: input devices 306 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 307 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; memory devices 308 including, for example, magnetic tapes, hard disks, etc.; and communication devices 309. Communication device 309 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 3 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown, and more or fewer devices may be implemented or have instead.
[0083] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 309, or installed from a memory 308, or installed from a ROM 302. When the computer program is executed by the processor 301, it performs the functions defined in the methods of the embodiments of the present invention.
[0084] Figure 3The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments of the present invention.
[0085] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the methods shown in the above embodiments.
[0086] A portion of this invention can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to the invention through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.
[0087] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A method for fuzzy testing of an on-board CAN bus, characterized in that, The method includes: A multi-dimensional behavioral graph is constructed based on vehicle CAN bus communication data to characterize the correlation between CAN signals. From the multidimensional behavior graph, identify causal paths representing causal relationships between signals to form a set of causal paths; Construct a multidimensional attack space to characterize the value space of various CAN signal data; An anomaly test template is generated based on the causal path set and the multidimensional attack space. The anomaly test template is used to describe the CAN signals participating in the test and the operation method of injecting the CAN signals into the CAN bus. The execution unit obtained by instantiating and converting the aforementioned anomaly test template is used to test the CAN bus; Get the test results.
2. The method according to claim 1, characterized in that, The construction of a multi-dimensional behavioral graph based on vehicle CAN bus communication data to characterize the correlation between CAN signals includes: Collect CAN bus communication data under different vehicle operating conditions; The semantic attribute information of the CAN bus communication data is extracted using the CAN protocol description information; Based on the semantic attribute information, descriptive features of different CAN signals are extracted; The correlation weights between each CAN signal are calculated based on the descriptive features of each CAN signal, and the multidimensional behavior graph is drawn based on the correlation weights.
3. The method according to claim 2, characterized in that, The descriptive features include at least one of timing features, statistical features, and semantic features; the timing features include at least one of the CAN signal message period, period jitter, and transmission interval, used to characterize the temporal correlation between CAN signals; the statistical features include at least one of the CAN signal bit distribution, field volatility, and flip frequency, used to measure whether the changing trends of different CAN signals are consistent; the semantic features include the correspondence between CAN signals and physical quantities, used to determine the degree of logical correlation between different CAN signals.
4. The method according to claim 3, characterized in that, The calculation of the correlation weights between CAN signals based on their descriptive features includes: Calculate timing similarity based on the timing characteristics between two CAN signals; The distribution consistency index of the probability distribution between two CAN signals is calculated by using the statistical characteristics between the two signals. Calculate logical correlation index based on semantic features between two CAN signals; The temporal similarity, distribution consistency index, and logical correlation index are normalized and fused to obtain the correlation weight between the two CAN signals.
5. The method according to claim 2, characterized in that, The step of identifying causal paths representing causal relationships between signals from the multidimensional behavior graph, forming a set of causal paths, includes: The change time of the first signal precedes that of the second signal; Determine whether the correlation weight between the first signal and the second signal is greater than a preset weight threshold; If the value is greater than the preset weight threshold, detect whether the second signal changes when a perturbation is applied to the first signal; If the second signal changes, the path from the first signal to the second signal is determined to be a causal path; By traversing all signal pairs from the step of determining that the change time of the first signal precedes that of the second signal, to the step of determining that if the second signal changes, the path from the first signal to the second signal is a causal path, the set of causal paths is obtained.
6. The method according to claim 2, characterized in that, The execution unit instantiated and transformed through the anomaly test template performs tests on the CAN bus, including: The priority of each execution unit is calculated based on the danger level of each CAN signal and the causal path confidence between each CAN signal; The execution units are controlled to test the CAN bus according to priority order.
7. The method according to claim 1, characterized in that, The acquisition of test results includes: The test result is obtained by receiving the feedback CAN bus status information. The scheduling priority of each execution unit is updated based on the CAN bus status information.
8. A vehicle-mounted CAN bus fuzzy testing device, characterized in that, The device includes: The behavior graph construction module is used to construct multi-dimensional behavior graphs that characterize the relationships between CAN signals based on vehicle CAN bus communication data. The causal analysis module is used to identify causal paths representing causal relationships between signals from the multidimensional behavior graph, forming a set of causal paths; The data space definition module is used to construct a multi-dimensional attack space that characterizes the value space of various CAN signal data. The test template generation module is used to generate an abnormal test template based on the causal path set and the multidimensional attack space. The abnormal test template is used to describe the CAN signal participating in the test and the operation method of injecting the CAN signal into the CAN bus. The test module is used to test the CAN bus by the execution unit instantiated and converted from the exception test template; The results feedback module is used to obtain test results.
9. An electronic device, characterized in that, include: A memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, the processor executing the computer instructions to perform the method of any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to perform the method of any one of claims 1 to 7.
