A method and device for generating fuzzing test data for vehicle networking security

By analyzing the parameter activity and frequent sequence patterns of CAN bus frame data in the Internet of Vehicles, calculating random weight coefficients, and correcting the standard deviation of Gaussian noise, fuzzy test data that better conforms to the laws of vehicle communication is generated. This solves the problem of data generation not conforming to the laws of vehicle communication in the existing technology and improves the effect of fuzzy testing.

CN122093170AInactive Publication Date: 2026-05-26NAT IND INFORMATION SECURITY DEV RES CENT
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610410857.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-03-31
Publication Date
2026-05-26
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing technologies lack a deep understanding of the semantic structure of vehicle communication protocols when generating fuzzy test data for vehicle-to-everything (V2X) networks. This results in data generation that does not conform to the statistical laws of vehicle communication, thus affecting the test results.

Method used

By analyzing the parameter activity and frequent sequence patterns of CAN bus frame data in the Internet of Vehicles, random weighting coefficients are calculated, and the standard deviation of Gaussian noise is corrected to generate fuzzy test data that better conforms to the laws of vehicle communication.

Benefits of technology

It improves the credibility of fuzz test data and the effectiveness of test results, and enhances the ability to detect unknown vulnerabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122093170A_ABST
    Figure CN122093170A_ABST
Patent Text Reader

Abstract

This application relates to the field of security testing technology, specifically to a method and apparatus for generating fuzzy test data for vehicle-to-everything (V2X) security. The method includes: acquiring CAN bus data; calculating a parameter activity coefficient based on CAN bus frame data with the same ID in the real vehicle data, used to measure the activity and boundary conditions of various control commands in the real vehicle data; then combining the correlation between different IDs to perform temporal correlation feature measurement, and further calculating a random weight coefficient to measure the intensity of random transformation of each CAN bus frame data in the real vehicle data; and correcting the standard deviation of Gaussian noise based on the activity of different types of data and the dependencies between data, thereby generating test data for V2X security fuzzy testing. This application aims to generate test data that conforms to the statistical laws of vehicle communication, thereby improving the data pass rate in the underlying protocol stack and thus more effectively testing the upper-layer business logic.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of security testing technology, specifically to a method and apparatus for generating fuzzy test data for vehicle networking security. Background Technology

[0002] With the rapid development of intelligent connected vehicles, the electronic and electrical architecture of vehicles is becoming increasingly complex. In-vehicle networks, especially the Controller Area Network (CAN) bus, have become a primary entry point for attackers to intrude into vehicle control systems. To ensure driving safety and user privacy, proactive security verification of in-vehicle networks is crucial. Fuzzing, as an effective vulnerability discovery method, is widely used in the evaluation of ECU (Electronic Control Unit) protocol stacks and application logic. By injecting a large number of abnormal or boundary inputs into the target ECU, fuzzing can effectively expose security vulnerabilities such as buffer overflows, state machine defects, and privilege circumvention, making it a key technical means to ensure the security and compliance testing of connected vehicles. Fuzzing of connected vehicles requires the generation of a large amount of test data to enhance the detection capability for unknown vulnerabilities.

[0003] Current methods for generating fuzzy test data for connected vehicles (V2V) have significant limitations. Mainstream techniques typically rely on predefined dictionaries or rules for field mutation, or capture seeds from real vehicle CAN traffic data for completely random transformation. For example, additive noise injection methods based on normal distribution use a fixed standard deviation to control the intensity of random disturbances. While this method is easy to implement, it lacks a deep understanding of the semantic structure of vehicle communication protocols, fails to consider the differences between different data types in V2V, and only meets the underlying format requirements. It cannot guarantee the logical coupling relationship between fields, leading to excessively drastic random variations in some data. This further increases the difficulty of generating test data that conforms to the statistical laws of vehicle communication and affects the fuzzy testing results. Summary of the Invention

[0004] In view of the above, it is necessary to provide a fuzzy test data generation method and apparatus for vehicle network security to solve the above problems.

[0005] The first aspect of this application provides a method for generating fuzzy test data for vehicle-to-everything (V2X) security, the method comprising: Retrieve the Data field from all CAN bus frame data for each ID in the vehicle network; For each ID, the similarity of data distribution among the same data values ​​in each byte of the Data field is analyzed. Combined with the number of CAN bus frame data for each ID, the parameter activity coefficient of each byte in the Data field of each ID is obtained, which is used to analyze the activity level of vehicle control commands. Group all CAN bus frame data for all IDs, perform frequent sequential pattern analysis on all IDs in each group, and combine the overall distribution characteristics of the parameter activity coefficients of all bytes of each ID to determine the random weight coefficient of the CAN bus frame data for each ID, in order to analyze the intensity of random changes in vehicle control commands. Based on the numerical distribution characteristics of the random weight coefficients and the parameter activity coefficients, the standard deviation of Gaussian noise is corrected. A preset number of seed data are selected from the CAN bus frame data of the actual vehicle, and the corrected Gaussian noise is added to generate fuzzy test data.

[0006] Preferably, the process of obtaining the activity coefficient of each byte in the Data field of each ID is specifically as follows: For each value in each byte, the data of each byte is divided into segments with the same value as the segment, thus obtaining the process interval corresponding to each value; The probability of each value appearing in all data of each byte is calculated, as well as the average distance between all pairwise process intervals corresponding to each value. The average distance is normalized and used as the weight of the probability of the corresponding value. The probability of all values ​​is weighted and summed, and then positively integrated with the proportion of CAN bus frame data of each ID to obtain the parameter activity coefficient of each byte in the Data field of each ID.

[0007] Preferably, the process of performing frequent sequential pattern analysis on all IDs corresponding to each group is as follows: The CAN bus frame data of all IDs are grouped, and the IDs corresponding to all data in each group are used to form a time series. All time series are used to form a sequence database, which is used as input to the sequence mining algorithm. The output is all frequent sequence patterns and the support of each frequent sequence pattern.

[0008] Preferably, the overall distribution characteristics of the parameter activity coefficients of all bytes of each ID are calculated by averaging.

[0009] Preferably, the specific process for determining the random weighting coefficients of the CAN bus frame data for each ID is as follows: Based on ID ID is Based on the distribution characteristics of frequent sequential patterns and the quantitative characteristics of their support, determine the manipulation influence factor of k on i; The formula for calculating the random weight coefficient is as follows: ; In the formula, Is the ID as The random weighting coefficients of the CAN bus frame data, , They are IDs ID is The overall distribution characteristics of parameter activity of all bytes in the Data field of the CAN bus frame data. , All represent the value of ID. It contains all In frequent sequential patterns The previous set of IDs, It is a set The base number, It is the manipulative influence factor of k on i. It is a normalization function.

[0010] Preferably, the step of determining the manipulation influence factor of k on i is as follows: Calculate the percentage of frequent sequence patterns that simultaneously contain both i and k; compare the number of frequent sequence patterns where k precedes i and i precedes k to determine the manipulative influence factor of k on i.

[0011] Preferably, the correction of the standard deviation of Gaussian noise specifically involves: The random weighting coefficients of the CAN bus frame data for each ID and the parameter activity coefficients of each byte of each ID are normalized and then averaged. The average of these averages is then multiplied by the fixed standard deviation to obtain the corrected standard deviation of each byte of the CAN bus frame data for each ID.

[0012] Preferably, the process of adding corrected Gaussian noise to generate fuzzy test data specifically involves: Using all seed data and the byte values ​​that need to be randomly transformed as input, an additive noise injection method based on normal distribution is used to output the transformed byte values. Replace the corresponding byte in the seed data with the transformed byte value, and the replaced data is the generated fuzzy test data.

[0013] Preferably, the byte value that needs to be randomly transformed cannot exceed the maximum number of bytes in the Data field.

[0014] Secondly, embodiments of this application also provide a fuzzy test data generation device for vehicle network security, including a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor executes the computer program to implement the steps of any of the methods described above.

[0015] This application has at least the following beneficial effects: This application proposes a fuzzy test data generation method for vehicle-to-everything (V2X) security. First, by analyzing each byte of all CAN bus frame data under the same ID in real-world vehicle data, a parameter activity coefficient is calculated. This indicator measures the activity of each byte under the same ID, thus enhancing the accuracy of subsequent quantification of the acceptable random variation intensity for different data and reducing the proportion of invalid data generation. Then, by combining the correlation between different IDs, a temporal correlation feature measurement is performed, and a random weight coefficient is calculated. This indicator quantifies the acceptable random variation intensity for different data, thus facilitating adaptive adjustment of random intensity for different types of data. The standard deviation of Gaussian noise is used to measure the random intensity of added noise. This application corrects the standard deviation of Gaussian noise based on data activity and variation intensity to generate a more suitable noise level, producing fuzzy test data that more closely resembles real-world conditions. This makes the test results more reliable and helps generate test data that conforms to the statistical laws of vehicle communication, improving the data pass rate in the underlying protocol stack and thus more effectively testing upper-layer business logic. Attached Figure Description

[0016] Figure 1 A flowchart illustrating the steps of a fuzzy test data generation method for vehicle network security, as provided in one embodiment of this application; Figure 2 A flowchart illustrating the acquisition of the activity coefficient of a parameter provided in one embodiment of this application. Detailed Implementation

[0017] In the description of the embodiments in this application, the words "exemplary," "or," and "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design scheme described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of the words "exemplary," "or," and "for example" is intended to present the relevant concepts in a specific manner.

[0018] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in this application's specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the application.

[0019] It should also be noted that the terms "first" and "second" in this application and its accompanying drawings are used to distinguish similar objects, rather than to describe a specific order or sequence. The methods disclosed in the embodiments of this application or the methods shown in the flowcharts include one or more steps for implementing the method. Without departing from the scope of protection of this application, the execution order of multiple steps can be interchanged, and some steps can also be deleted.

[0020] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains.

[0021] The following description, in conjunction with the accompanying drawings, details the specific scheme of the fuzzy test data generation method and apparatus for vehicle network security provided in this application.

[0022] Please see Figure 1 The diagram illustrates a flowchart of a fuzzy test data generation method for vehicle-to-everything (V2X) security according to an embodiment of this application. The method includes the following steps: Step 1: Obtain the Data field from all CAN bus frame data for each ID in the vehicle network.

[0023] The Peak CAN-USB adapter is used to acquire CAN bus data from the vehicle's OBD-II interface. This data contains all CAN bus communication data related to the vehicle's operation during the vehicle-to-everything (V2X) network operation. The acquired CAN bus communication data consists of several CAN bus frames. It should be noted that a complete CAN frame, when transmitted on the bus, sequentially includes the Start of Frame (SOF), Arbitration Segment, Control Segment (DLC), Data Field, Cyclic Redundancy Check (CRC), Acknowledgment (ACK), and End of Frame (EOF). SOF, CRC, ACK, and EOF belong to the data link layer control information of the CAN protocol and are automatically processed by the CAN controller hardware. The data acquired via the Peak CAN-USB adapter only contains the higher-level fields that have passed hardware parsing and verification: ID, DLC, and Data in the Arbitration Segment. When processing the Data field, the "checksum bits (such as CRC, Checksum)" and "Rolling Counter" fields need to be pre-identified or manually marked. Subsequent activity analysis and noise injection are only performed on the remaining Payload / control command fields. In fuzz test data generation, since SOF, CRC, ACK, and EOF cannot be constructed by the user and their correctness is guaranteed by the hardware, there is no need to randomly generate them. However, if the ID is used to identify the function type or sending source of the message, it is very easy for it to be directly discarded by the gateway or driver layer because it is not in the target ECU's receiving whitelist. The DLC indicates the number of valid bytes of Data (0~8), and its value must meet the protocol expectation, otherwise the frame may be rejected for parsing. Therefore, in this application, fuzz test data is mainly generated by randomly transforming the Data.

[0024] Step 2: For each ID, analyze the similarity of data distribution among the same data values ​​in each byte of the Data field. Combined with the number of CAN bus frame data for each ID, obtain the parameter activity coefficient of each byte in the Data field of each ID, which is used to analyze the activity level of vehicle control commands.

[0025] Because the application layer protocol in CAN bus communication within the vehicle network is entirely customized by the automaker, and these customized control signals are strictly confidential as core information, the specific semantics of the CAN bus frame data cannot be clearly understood during fuzzy testing of the vehicle network. Due to this limitation, existing technologies often generate randomly generated test data by completely randomizing the seed data during fuzzy testing. However, this complete randomness results in a large amount of invalid test data and fails to guarantee comprehensive coverage, making it difficult to guarantee both the efficiency and quality of fuzzy testing. In fact, during actual vehicle operation, the occurrence of control commands exhibits certain correlations and patterns. These correlations and patterns can reflect changes in some semantic information to a certain extent. Therefore, if the correlations and patterns can be captured based on actual vehicle data, and the completely random transformation of seed data in existing technologies can be adjusted to a controllable level of randomness, the quality of fuzzy test data generation can undoubtedly be further improved.

[0026] To achieve controllable randomness within the fuzzy test data generation process, correlation and pattern analysis of actual vehicle data is necessary. Firstly, in a CAN bus frame, the ID field identifies the message type or source, meaning it's closely related to vehicle operation. During vehicle operation, the activity levels of various control commands differ. For less active control commands, the required control content and corresponding identifier set are relatively limited, resulting in a more restrictive adjustable range. Therefore, generating this type of CAN bus frame data completely randomly could significantly increase the probability of generating invalid test data.

[0027] Secondly, during the test data generation process, to avoid the generated test data being directly filtered out, it is necessary to control the randomization of each control command within a reasonable range. Therefore, it is necessary to determine the boundary conditions corresponding to each parameter in each control command. In reality, most vehicle control commands are not fixed values, but are adjusted within a control range. Within this control range, values ​​closer to the boundaries tend to occur less frequently. For example, taking vehicle speed as an example, the vehicle speed usually remains stable in the middle of the entire control range, while its frequency decreases significantly when approaching the extreme speeds at both ends. Therefore, this characteristic can be used to determine the boundary conditions of certain control commands.

[0028] The data in the Data field of all CAN bus frames with the same ID are used to construct a timing data sequence for each byte of the ID, according to the acquisition order of the CAN bus frame data. Each element in the sequence is the same byte of data in the Data field. Since each data in the Data field is a custom identifier, the Data fields corresponding to the same type of manipulation command are highly similar. The difference in data in the field represents the control intensity. During the control process, the closer to the boundary condition, the lower the probability of occurrence. Since the upper and lower boundaries are the extreme values ​​of control, the occurrence of various types of data on both sides of the lower and upper boundaries is highly similar as they gradually approach the extreme values. That is, in a byte timing data sequence, the sequence formed by the data between two adjacent identical data values ​​is the process interval of that data value. If there are no other identical data values ​​before or after a certain data value, then all the data before it and all the data after it constitute the process interval of that data value.

[0029] Based on the above analysis, the parameter activity coefficient is calculated to measure the activity level and boundary conditions of various control commands in the real vehicle data. The specific formula is as follows: ; Is the ID as The first data in the Data field of all CAN bus frame data The parameter activity coefficient of one byte, It is the first A collection of data values ​​in bytes. It is the first The data value is 1 byte. The mean distance between all pairwise process intervals is used; in this embodiment, the distance is calculated using the Wasserstein distance. This represents the result of normalizing the distance mean, and can be viewed as... The weights are given by e, which represents the natural constant. Since the Wasserstein distance ranges from 0 to positive infinity, an exponential function is used in this embodiment to avoid the parameter activity coefficient being too large due to the Wasserstein distance. It is the first Data values ​​in a time sequence of bytes The probability of its occurrence; Is the ID as The percentage of CAN bus frame data, i.e., ID is The ratio of the number of CAN bus frame data to the total number of CAN bus frame data.

[0030] The flowchart for obtaining the parameter activity coefficient is as follows: Figure 2 As shown.

[0031] It should be understood that this application uses bytes as the smallest parameter unit. This implies that during the fuzzy test data generation process, the activity level of each parameter varies. For parameters with lower activity, their adjustable value set is more limited. If these low-activity parameters are subjected to complete randomization, the probability of invalid data will significantly increase. Parameter activity can be measured from two aspects: the activity level of the manipulation instruction to which the parameter is located and the activity level of the parameter within the manipulation instruction. First, when the activity level of a parameter's manipulation instruction is lower—that is, the probability of the ID appearing is lower and the Data corresponding to the ID is more stable—it indicates that the probability of invalid data being generated in a completely randomized manner under that manipulation instruction is higher. Second, under normal circumstances, the closer a parameter is to the boundary of its corresponding manipulation instruction, the lower its probability of existence. Data closer to the boundary corresponds to a higher similarity in the distribution of process intervals, meaning a smaller Wasserstein distance between process intervals. Therefore, for a parameter with lower activity, the parameter activity coefficient is smaller.

[0032] Step 3: Group all CAN bus frame data for all IDs, perform frequent sequential pattern analysis on all IDs in each group, and determine the random weight coefficient of the CAN bus frame data for each ID by combining the overall distribution characteristics of the parameter activity coefficients of all bytes of each ID, in order to analyze the intensity of random changes in vehicle control commands.

[0033] The parameter activity coefficient measures the correlation and regularity between data within the same type of control command. However, during vehicle control, there are also certain temporal correlation characteristics between different control data. Therefore, it is necessary to perform correlation analysis on different control command data (i.e., CAN bus frame data with different IDs) and determine the random adjustment range and intensity of each seed data obtained from real vehicle data through this temporal correlation characteristic measurement and parameter activity coefficient.

[0034] All CAN bus frame data obtained are grouped according to the acquisition time, with each group consisting of 5-second intervals. The IDs of each frame data within the same group are then arranged into a time series based on the acquisition time. All time series are then combined to form a sequence database. This sequence database is then used as input, with a minimum support of 0.01 and a maximum pattern length of 5. A sequence mining algorithm is employed to output all frequent sequence patterns and the support of each frequent sequence pattern (i.e., the number of times each frequent pattern occurs). In this embodiment, the PrefixSpan algorithm is used, which is a well-known technique and will not be described in detail here.

[0035] Based on the above analysis, a random weighting coefficient is calculated to measure the intensity of random changes in each CAN bus frame data in the real vehicle data. The specific formula is as follows: ; ; In the formula, Is the ID as The random weighting coefficients of the CAN bus frame data, , They are IDs ID is The overall distribution characteristics of parameter activity of all bytes in the Data field of the CAN bus frame data are measured by averaging in this embodiment. , All represent the value of ID. It contains all In frequent sequential patterns The previous set of IDs, It is a set The base number, It is the manipulative influence factor of k on i. It is a normalization function. It should be noted that if the set... If the set is empty, then the entire normalization term is set to 0; It contains at the same time and The number of frequent sequential patterns, It is the number of all frequent sequential patterns. , They are simultaneously included and In frequent sequential patterns exist Before, exist The number of previous frequent sequential patterns, This is a parameter tuning coefficient to avoid a denominator of 0, and its value is set to 1 to maintain... exist Before, exist The previous frequent sequential pattern quantities were used to determine their relative importance, so parameter tuning coefficients were added to both the numerator and denominator. It should be noted that the normalization performed here is to achieve the desired result for... The proportion change should be avoided because, without normalization, ... Too large, resulting in an ID of Parameter activity coefficient in CAN bus frame data Completely masked; the normalization method uses the maximum-minimum normalization method.

[0036] It is understandable that different manipulation instructions may have a certain correlation, thus forming a certain sequential pattern. In this sequential pattern, the preceding manipulation instruction has a certain influence on the following manipulation instruction. First, the strength of a manipulation instruction during random transformation is closely related to the activity of each byte parameter in that instruction. The lower the activity, the more attention needs to be paid to the random strength during random transformation to avoid data invalidation due to excessively strong randomness. Second, according to the sequential relationship between manipulation instructions, the earlier manipulation instruction has a stronger influence on the later one. If the activity of the preceding manipulation instruction is low, and the subsequent manipulation instruction performs a stronger random transformation, leading to increased data fluctuation, data invalidation will occur due to the mismatch. Therefore, the stronger the correlation between the preceding and following manipulation instructions, the greater the influence of the preceding instruction. Thus, when the random weight coefficient is smaller, the intensity of random transformation should also be reduced when performing random transformation on the frame data of the corresponding ID to avoid greater data randomness and stronger fluctuations.

[0037] Step 4: Based on the numerical distribution characteristics of the random weight coefficient and the parameter activity coefficient, the standard deviation of the Gaussian noise is corrected. A preset number of seed data are selected from the CAN bus frame data of the actual vehicle, and the corrected Gaussian noise is added to generate fuzzy test data.

[0038] During the fuzzy testing of vehicle-to-everything (V2X) security, the collected CAN bus frame data is used as seed data. In this embodiment, data is selected from the CAN bus frame data. Seed data, in this embodiment Take 200 as seed data to ensure at least one frame is selected from each ID. Further, analyze all CAN bus frame data from the actual vehicle and calculate the random weighting coefficient for each ID. Use all seed data and the byte values ​​requiring random transformation as input, employing an additive noise injection method based on normal distribution to output the transformed byte values. Replace the corresponding bytes in the seed data with these transformed byte values; the replaced data is the generated fuzzy test data. It should be noted that the byte values ​​requiring random transformation can be selected as needed, but two points must be considered: first, the byte value cannot exceed the maximum number of bytes in the Data field (8 bytes); second, the more byte values ​​selected, the greater the probability of invalid transformed test data. The additive noise injection method based on normal distribution is a well-known technique and will not be elaborated further. It should also be noted that for discrete or enumerated data, after injecting Gaussian noise, a rounding operation is required to ensure the generated data conforms to the byte format requirements.

[0039] In the original additive noise injection method based on normal distribution, the severity of random perturbation needs to be controlled by setting a standard deviation. However, the standard deviation in the original algorithm is a fixed value that does not consider the differences between different data types, applying the same intensity of transformation to all data types. This leads to excessively high random transformation intensity for some data, increasing data inefficiency and resulting in poor fuzzing performance for such data. The constructed random weight coefficient quantifies the acceptable random transformation intensity for various data types, thus allowing for adaptive correction of the standard deviation. The specific formula is as follows: ; Is the ID as The first CAN bus frame data Standard deviation corrected for byte size It is the fixed standard deviation set by the original additive noise injection method based on normal distribution, and its value is 20 in this embodiment; Is the ID as The random weighting coefficients of the CAN bus frame data, It is the maximum value of the random weight coefficient. It is the parameter activity coefficient. Is the ID as The maximum value of the parameter activity coefficient in all CAN bus frame data. This represents a preset value used to prevent the denominator from being 0; in this embodiment, the value is 0.01. Wherein, , These represent the results of normalizing the random weighting coefficient of the CAN bus frame data with ID i and the parameter activity coefficient of the j-th byte with ID i, respectively.

[0040] It is understandable that the acceptable intensity of random transformations can be measured based on the activity level of different types of data and the dependencies between data. Therefore, the intensity of random transformations can be adjusted by using the standard deviation after correction using the above formula, thereby reducing the proportion of invalid data and improving the quality of data fuzzing tests.

[0041] Based on the same inventive concept as the above method, this application embodiment also provides a fuzzy test data generation device for vehicle network security, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it implements the steps of any one of the above-described fuzzy test data generation methods for vehicle network security.

[0042] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than that shown in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. In the descriptions corresponding to the flowcharts and block diagrams in the accompanying drawings, the operations or steps corresponding to different blocks may also occur in a different order than disclosed in the description; sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. Each block in a block diagram and / or flowchart, and combinations of blocks in a block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0043] It will be apparent to those skilled in the art that this application is not limited to the details of the exemplary embodiments described above, and that this application can be implemented in other specific forms without departing from its essential characteristics. Therefore, the embodiments described above should be considered exemplary and non-limiting in all respects; modifications to the technical solutions described in the foregoing embodiments, or equivalent substitutions of some technical features, without causing the essence of the corresponding technical solutions to deviate from the scope of the technical solutions in the embodiments of this application, should all be included within the protection scope of this application.

Claims

1. A method for generating fuzzy test data for vehicle-to-everything (V2X) security, characterized in that, The method includes the following steps: Retrieve the Data field from all CAN bus frame data for each ID in the vehicle network; For each ID, the similarity of data distribution among the same data values ​​in each byte of the Data field is analyzed. Combined with the number of CAN bus frame data for each ID, the parameter activity coefficient of each byte in the Data field of each ID is obtained, which is used to analyze the activity level of vehicle control commands. Group all CAN bus frame data for all IDs, perform frequent sequential pattern analysis on all IDs in each group, and combine the overall distribution characteristics of the parameter activity coefficients of all bytes of each ID to determine the random weight coefficient of the CAN bus frame data for each ID, in order to analyze the intensity of random changes in vehicle control commands. Based on the numerical distribution characteristics of the random weight coefficients and the parameter activity coefficients, the standard deviation of Gaussian noise is corrected. A preset number of seed data are selected from the CAN bus frame data of the actual vehicle, and the corrected Gaussian noise is added to generate fuzzy test data.

2. The fuzzy test data generation method for vehicle network security as described in claim 1, characterized in that, The activity coefficient of each byte in the Data field of each ID is obtained as follows: For each value in each byte, the data of each byte is divided into segments with the same value as the segment, thus obtaining the process interval corresponding to each value; The probability of each value appearing in all data of each byte is calculated, as well as the average distance between all pairwise process intervals corresponding to each value. The average distance is normalized and used as the weight of the probability of the corresponding value. The probability of all values ​​is weighted and summed, and then positively integrated with the proportion of CAN bus frame data of each ID to obtain the parameter activity coefficient of each byte in the Data field of each ID.

3. The fuzzy test data generation method for vehicle network security as described in claim 1, characterized in that, The process of performing frequent sequential pattern analysis on all IDs corresponding to each group is as follows: The CAN bus frame data of all IDs are grouped, and the IDs corresponding to all data in each group are used to form a time series. All time series are used to form a sequence database, which is used as input to the sequence mining algorithm. The output is all frequent sequence patterns and the support of each frequent sequence pattern.

4. The fuzzy test data generation method for vehicle network security as described in claim 1, characterized in that, The overall distribution characteristics of the activity coefficient of all bytes of each ID are calculated by averaging.

5. The fuzzy test data generation method for vehicle network security as described in claim 3, characterized in that, The specific process for determining the random weighting coefficients of the CAN bus frame data for each ID is as follows: Based on ID ID is Based on the distribution characteristics of frequent sequential patterns and the quantitative characteristics of their support, determine the manipulation influence factor of k on i; The formula for calculating the random weight coefficient is as follows: ; In the formula, Is the ID as The random weighting coefficients of the CAN bus frame data, , They are IDs ID is The overall distribution characteristics of parameter activity of all bytes in the Data field of the CAN bus frame data. , All represent the value of ID. It contains all In frequent sequential patterns The previous set of IDs, It is a set The base number, It is the manipulative influence factor of k on i. It is a normalization function.

6. The fuzzy test data generation method for vehicle-to-everything (V2X) security as described in claim 5, characterized in that, The steps for determining the manipulation influence factor of k on i are as follows: Calculate the percentage of frequent sequence patterns that simultaneously contain both i and k; compare the number of frequent sequence patterns where k precedes i and i precedes k to determine the manipulative influence factor of k on i.

7. The fuzzy test data generation method for vehicle network security as described in claim 1, characterized in that, The correction for the standard deviation of Gaussian noise is specifically as follows: The random weighting coefficients of the CAN bus frame data for each ID and the parameter activity coefficients of each byte of each ID are normalized and then averaged. The average of these averages is then multiplied by the fixed standard deviation to obtain the corrected standard deviation of each byte of the CAN bus frame data for each ID.

8. The fuzzy test data generation method for vehicle network security as described in claim 1, characterized in that, The process of adding corrected Gaussian noise to generate fuzzy test data is as follows: Using all seed data and the byte values ​​that need to be randomly transformed as input, an additive noise injection method based on normal distribution is used to output the transformed byte values. Replace the corresponding byte in the seed data with the transformed byte value, and the replaced data is the generated fuzzy test data.

9. A method for generating fuzzy test data for vehicle network security as described in claim 8, characterized in that, The byte value that needs to be randomly transformed cannot exceed the maximum number of bytes in the Data field.

10. A fuzzy test data generation device for vehicle network security, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method as described in any one of claims 1-9.