Vehicle-mounted Ethernet communication test method and related equipment
By fine-tuning the general large language model, a test case adapted to the on-board Ethernet communication protocol was generated, and the existing test methods were solved, efficient and automated testing and intelligent security vulnerability analysis were achieved, and the security and reliability of the system were improved.
Patent Information
- Application Number
- CN202510346006.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-24
- Publication Date
- 2025-06-24
AI Technical Summary
The existing in-vehicle Ethernet communication testing methods are inefficient and inadequate in adaptability, difficult to cover the diversity and complexity of protocols, and lack intelligent security vulnerability analysis.
By fine-tuning the communication test of the general large language model, test cases are generated that are adapted to the target vehicle-mounted Ethernet communication protocol, and test cases are automatically generated and batch-run by using the fine-tuning model to analyze abnormal feedback in real time to accurately discover security vulnerabilities.
It improves testing efficiency and automation, enhances the security and reliability of the system, and can flexibly adapt to different vehicle-mounted Ethernet communication protocols to quickly discover and locate security vulnerabilities.
Smart Images

Figure CN120200929A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of in-vehicle Ethernet. More specifically, this application relates to an in-vehicle Ethernet communication test method and related devices. Background Art
[0002] With the rapid development of intelligent connected vehicle technology, in-vehicle Ethernet, as a high-bandwidth and low-latency communication bus, has gradually become an important communication method for automotive electronic systems and is widely used in fields such as autonomous driving, in-vehicle entertainment, and advanced driver assistance systems. However, the complexity of the in-vehicle Ethernet communication protocol and the diversity of protocols from different manufacturers make the testing of communication components particularly crucial and challenging. Conducting communication tests efficiently and accurately not only helps ensure the stability of the system but also improves the security and reliability of the in-vehicle network.
[0003] In the prior art, the in-vehicle Ethernet communication test usually relies on manually writing test cases and conducting tests based on fixed rules. However, manually writing test cases is time-consuming and inefficient, and it is difficult to cover the diversity and complexity of the protocol. Especially when facing the in-vehicle Ethernet communication protocols of different manufacturers, it is often necessary to adjust the test strategy additionally, resulting in poor adaptability of the test method. In addition, the traditional test method relies heavily on manual operation during the running process and is difficult to achieve large-scale automated testing, thus limiting the test efficiency and comprehensiveness. That is, the prior art has technical problems such as low efficiency in generating test cases, insufficient adaptability, and lack of intelligent analysis of security vulnerabilities. Summary of the Invention
[0004] In the summary of the invention part of this application, a series of simplified concepts are introduced, which will be further described in detail in the specific implementation part. The summary of the invention part of this application does not mean to attempt to define the key features and essential technical features of the claimed technical solution, nor does it mean to attempt to determine the protection scope of the claimed technical solution.
[0005] The in-vehicle Ethernet communication test method and related devices provided by this application can automatically generate and batch-run test cases by fine-tuning a large language model, adapt to different in-vehicle Ethernet communication protocols, and analyze abnormal feedback in real time to accurately discover security vulnerabilities, which can improve test efficiency, automation level, and system security.
[0006] In a first aspect, the present application provides a method for testing in - vehicle Ethernet communication, including: performing fine - tuning on a general large - language model for communication testing to obtain a test case generation model adapted to the target in - vehicle Ethernet communication protocol; generating target test cases for a communication component to be tested based on the test case generation model; running the target test cases based on the communication component to be tested; and determining security vulnerabilities of the communication component to be tested according to the abnormal feedback information of the communication component to be tested.
[0007] In some embodiments, the step of performing fine - tuning on a general large - language model for communication testing to obtain a test case generation model adapted to the target in - vehicle Ethernet communication protocol includes: constructing an initial training data set based on the technical documents, protocol specifications of the target in - vehicle Ethernet communication protocol, and the historical operation data of the communication component to be tested; pre - processing the initial training data set to obtain a target training data set; and inputting the target training data set into the general large - language model to obtain the test case generation model.
[0008] In some embodiments, the step of constructing an initial training data set based on the technical documents, protocol specifications of the target in - vehicle Ethernet communication protocol, and the historical operation data of the communication component to be tested includes: constructing the initial training data set based on the abnormal feedback information, the technical documents, the protocol specifications, and the historical operation data.
[0009] In some embodiments, the step of generating target test cases for a communication component to be tested based on the test case generation model includes: generating model prompt words according to the protocol rules of the target in - vehicle Ethernet communication protocol; inputting the model prompt words into the test case generation model to obtain initial test cases; and performing protocol compliance correction on the initial test cases to obtain the target test cases.
[0010] In some embodiments, the step of performing protocol compliance correction on the initial test cases to obtain the target test cases includes: performing structural adaptability adjustment on the initial test cases according to the format specifications of the target in - vehicle Ethernet communication protocol to obtain intermediate test cases; and performing timing compliance adjustment on the intermediate test cases according to the service interaction state logic of the target in - vehicle Ethernet communication protocol to obtain the target test cases.
[0011] In some embodiments, the step of running the target test cases based on the communication component to be tested includes: constructing an in - vehicle Ethernet simulation environment through a virtualized communication framework based on the communication component to be tested; and injecting the target test cases into the in - vehicle Ethernet simulation environment in batches to obtain the abnormal feedback information through a multi - dimensional abnormal capture mechanism.
[0012] In some embodiments, the in-vehicle Ethernet communication test method further includes: determining a vulnerability quantification value of the communication component to be tested according to the vulnerability category and vulnerability level of the security vulnerability; when the vulnerability quantification value is less than a preset vulnerability threshold, determining that the communication component to be tested passes the test.
[0013] In a second aspect, the present application further provides an in-vehicle Ethernet communication test device, including: a model generation unit, configured to perform communication test fine-tuning on a general large language model to obtain a test case generation model adapted to the target in-vehicle Ethernet communication protocol; a use case generation unit, configured to generate target test cases for the communication component to be tested based on the test case generation model; a use case execution unit, configured to execute the target test cases based on the communication component to be tested; and a test feedback unit, configured to determine the security vulnerabilities of the communication component to be tested according to the abnormal feedback information of the communication component to be tested.
[0014] In a third aspect, the present application further provides an electronic device, including: a memory and a processor, where the processor is configured to implement the steps of the in-vehicle Ethernet communication test method described in the first aspect when executing a computer program stored in the memory.
[0015] In a fourth aspect, the present application further provides a computer-readable storage medium storing a computer program, where the computer program, when executed by a processor, implements the steps of the in-vehicle Ethernet communication test method described in the first aspect.
[0016] In a fifth aspect, the present application further provides a computer program product, including a computer program or computer-executable instructions, where the computer program or computer-executable instructions, when executed by a processor, implement the in-vehicle Ethernet communication test method provided in the embodiments of the present application.
[0017] In summary, through communication test fine-tuning of the general large language model, the present application enables it to generate test cases that better conform to the in-vehicle Ethernet communication protocol. Automatically generating test cases using the fine-tuned large language model can avoid the cumbersome process of manually writing test cases and significantly improve the test efficiency. At the same time, during the test execution process, the test cases can be automatically run in batches, reducing the dependence on manual operations and making the test process more intelligent and automated. Moreover, there may be differences in the in-vehicle Ethernet communication protocols of different manufacturers, and traditional test methods often require manually adjusting the test strategy for specific protocols. However, through fine-tuning the large language model, the present solution enables it to adapt to different protocol environments and can more flexibly adapt to different in-vehicle Ethernet communication protocols, improving the applicability of the test method. After the test cases are run, the abnormal feedback information of the communication component to be tested is automatically analyzed, and based on this, the security vulnerabilities existing in the communication component to be tested are judged. This real-time analysis and feedback mechanism enables the vulnerabilities to be quickly discovered and located, thereby accelerating the repair and optimization process and enhancing the security and reliability of the in-vehicle communication system. In conclusion, the in-vehicle Ethernet communication test method provided by the present application can automatically generate and batch-run test cases by fine-tuning the large language model, adapt to different in-vehicle Ethernet communication protocols, and perform real-time analysis of abnormal feedback to accurately discover security vulnerabilities, which can improve the test efficiency, automation level, and system security. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] By reading the following detailed description of the preferred embodiments, various other advantages and benefits will become clear to those of ordinary skill in the art. The drawings are only for the purpose of illustrating the preferred embodiments and are not considered to be a limitation of this specification. Moreover, throughout the drawings, the same reference numerals are used to represent the same components. In the drawings:
[0019] Figure 1 is a schematic flowchart of an in-vehicle Ethernet communication test method provided by an embodiment of the present application;
[0020] Figure 2 is a schematic composition structure diagram of an in-vehicle Ethernet communication test device provided by an embodiment of the present application;
[0021] Figure 3 is a schematic composition structure diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0022] The terms in the description, claims, and drawings of this application, such as "first", "second", "third", "fourth", etc. (if any), are used to distinguish similar objects and not to describe a specific order or sequence. Therefore, it is understood that under appropriate circumstances, these terms can be used interchangeably, so that the described embodiments can be implemented in different orders, unless there are special requirements in the drawings or description. In addition, the terms "is" and "has" and any variants thereof in this application are intended to inclusively cover all possible constituent elements non-exclusively. For example, a process, method, system, product, or device that includes several steps or units does not necessarily have to be limited to the explicitly listed steps or units, but may also include other steps or units not explicitly listed, or steps or units inherent to the process, method, product, or device.
[0023] In this application, a "module" or "unit" refers to a computer program or a part of a computer program with a specific function, which works in cooperation with other related parts to achieve a predetermined goal. These modules or units can be implemented by software, hardware (such as processing circuits or memories), or a combination of both. One or more processors or memories can implement one or more modules or units. At the same time, each module or unit can also be a part of a larger module or unit.
[0024] The technical solutions in this application will be described in detail below with reference to the drawings in the embodiments. It should be noted that the described embodiments are only a part of this application, not all embodiments. In the following description, the "some embodiments" mentioned are only subsets of all possible embodiments, which can be the same or different subsets, and different embodiments can be combined with each other without conflict.
[0025] Figure 1 is a schematic flowchart of a vehicle-mounted Ethernet communication test method provided by an embodiment of this application. Exemplarily, refer to Figure 1 The vehicle-mounted Ethernet communication test method provided by the embodiment of this application may include the following steps 101 to 104:
[0026] Step 101, perform communication test fine-tuning on the general large language model to obtain a test case generation model adapted to the target vehicle-mounted Ethernet communication protocol;
[0027] In some examples, a General Large Language Model (LLM) is an artificial intelligence model trained on large-scale text data, with general natural language understanding and generation capabilities, such as OpenAI GPT, Google PaLM, Meta LlaMA, and DeepSeek Coder V3, etc. For example, after fine-tuning, DeepSeek Coder V3 can be used to automatically generate test cases for specific communication protocols. By providing protocol documents, technical specifications, historical test data, etc. related to in-vehicle Ethernet, the general large language model is trained using the method of supervised learning or instruction tuning. That is, for the in-vehicle Ethernet communication protocol, the parameters of the large language model are adjusted and optimized so that it can generate high-quality protocol test cases. The test case generation model is a fine-tuned large language model that can automatically generate test cases according to a specific in-vehicle Ethernet protocol, covering different communication scenarios, boundary conditions, and abnormal situations. The target in-vehicle Ethernet communication protocol is a specific communication protocol used in the in-vehicle network environment, usually used for high-speed data exchange between automotive electronic control units (ECUs), such as the time synchronization protocol (IEEE 802.1AS), the audio-video bridging protocol (AVB), the service-oriented communication protocol (SOME / IP), etc.
[0028] By implementing step 101, the large language model is fine-tuned to be able to generate test cases for specific in-vehicle Ethernet communication protocols, which can improve the pertinence and applicability of testing; it can also adapt to different manufacturers and different versions of in-vehicle Ethernet communication protocols, enhancing the flexibility and scalability of the testing method.
[0029] Step 102, based on the test case generation model, generate target test cases for the communication component to be tested;
[0030] In some examples, the communication component to be tested refers to electronic control units and network devices that execute communication functions and need to be tested in the in-vehicle Ethernet environment, such as gateways, domain controllers, cameras, radars, etc.; the communication component to be tested can transmit data through in-vehicle Ethernet, ensure that its communication protocol complies with standards, can process data packets stably and accurately, and has necessary security protection capabilities. The target test case is a specific test plan generated based on the in-vehicle Ethernet communication protocol rules and the characteristics of the communication component to be tested, including test input, expected output, execution conditions, and exception handling mechanisms, etc., which can be used to verify the behavior of the communication component in normal and abnormal situations and detect potential vulnerabilities.
[0031] Through the implementation of step 102, test cases are automatically generated, improving the efficiency and coverage of testing. It can ensure that various communication scenarios can be tested, is applicable to different types of in-vehicle communication components, and there is no need to manually adjust test cases for different components, which can improve the generality of the testing method.
[0032] Step 103, based on the communication component to be tested, run the target test case;
[0033] In some examples, the communication component to be tested can be deployed in a virtual simulation environment, and then in the virtual simulation environment, according to the definition of the target test case, send test data packets to the communication component to be tested and record its response.
[0034] Through the implementation of step 103, test cases are automatically executed, reducing manual intervention, which can improve the intelligence and automation of the testing process.
[0035] Step 104, determine the security vulnerabilities of the communication component to be tested according to the abnormal feedback information of the communication component to be tested;
[0036] In some examples, the abnormal feedback information is the abnormal behavior that occurs when the communication component to be tested runs the target test case, including protocol violations, functional abnormalities, response timeouts, data loss, etc. The abnormal feedback information can be collected through log records, protocol analysis tools or built-in monitoring mechanisms; for example, tools such as Wireshark and CANoe can be used to capture the abnormal feedback information. A security vulnerability is a security risk caused by design defects, implementation vulnerabilities or imperfect error handling mechanisms in the communication component to be tested, which may be exploited by attackers and affect the stability and security of the communication system. Security vulnerabilities usually manifest as abnormal behaviors of the communication component in abnormal situations, and these abnormal behaviors can be identified and located by analyzing the abnormal feedback information.
[0037] Through the implementation of step 104, automatically analyze the abnormal feedback information, accurately identify potential communication security vulnerabilities, can quickly locate the link where the vulnerability is located, speed up the process of problem repair and optimization, and reduce security risks.
[0038] In summary, through communication test fine-tuning of the general large language model in the implementation of this application, it can generate test cases that more conform to the in-vehicle Ethernet communication protocol. Using the fine-tuned large language model to automatically generate test cases can avoid the cumbersome process of manually writing test cases and greatly improve the test efficiency. At the same time, during the test execution process, the test cases can be automatically run in batches, reducing the dependence on manual operations and making the test process more intelligent and automated. Moreover, there may be differences in the in-vehicle Ethernet communication protocols of different manufacturers, and traditional test methods often require manually adjusting the test strategy for specific protocols. However, this solution can adapt to different protocol environments by fine-tuning the large language model, and can more flexibly adapt to different in-vehicle Ethernet communication protocols, improving the applicability of the test method. After the test cases are run, the abnormal feedback information of the communication component to be tested is automatically analyzed, and based on this, the security vulnerabilities existing in the communication component to be tested are judged. This real-time analysis and feedback mechanism enables the vulnerabilities to be quickly discovered and located, thus accelerating the repair and optimization process and enhancing the security and reliability of the in-vehicle communication system. In summary, the in-vehicle Ethernet communication test method provided by the embodiments of this application can automatically generate and batch-run test cases by fine-tuning the large language model, adapt to different in-vehicle Ethernet communication protocols, and analyze abnormal feedback in real time to accurately discover security vulnerabilities, which can improve the test efficiency, automation level, and system security.
[0039] In some embodiments, the foregoing step 101 may include: constructing an initial training data set based on the technical documents, protocol specifications of the target in-vehicle Ethernet communication protocol, and the historical operation data of the communication component to be tested; preprocessing the initial training data set to obtain a target training data set; and inputting the target training data set into the general large language model to obtain a test case generation model.
[0040] In some examples, the technical documents and protocol specifications of the target in-vehicle Ethernet communication protocol are official documents describing the target in-vehicle Ethernet communication protocol, including content such as protocol structure, message format, data encoding, and transmission rules. The historical operation data of the communication component to be tested are communication logs, exception reports, packet capture records, etc. recorded during the actual operation of the in-vehicle communication component to be tested, and can be extracted from the electronic control unit logs, network monitoring tools, or in-vehicle bus data. The initial training data set is the original data set sorted out according to information such as technical documents, protocol specifications, and historical operation data, and is used to train the test case generation model; the initial training data set can be cleaned, formatted, and standardized to improve the data quality and make it suitable for model training, such as filtering out irrelevant information (removing invalid logs or duplicate data), standardizing the data structure, and annotating the data, etc.; the target training data set is the high-quality data set suitable for training after preprocessing, and contains test data under different communication scenarios.
[0041] Through the implementation of the above embodiments, combined with technical documents, protocol specifications, and historical operation data, it is possible to ensure that the test case generation model has higher adaptability and generalization capabilities; through data preprocessing, the quality of training data can be improved, ensuring that the model learns accurate and complete protocol features and improving the accuracy of test case generation.
[0042] In some embodiments, the foregoing initial training dataset constructed based on the technical documents, protocol specifications of the target in - vehicle Ethernet communication protocol, and the historical operation data of the communication component to be tested may include: constructing the initial training dataset based on anomaly feedback information, technical documents, protocol specifications, and historical operation data.
[0043] Exemplarily, during the entire testing process, by continuously iteratively optimizing the test case generation model and the target test cases, the effectiveness of the testing can be effectively improved; that is, based on anomaly feedback information, technical documents, protocol specifications, and historical operation data, the initial training dataset is constructed again, and the general large - language model is retrained regularly to adapt to newly discovered vulnerabilities and attack patterns; as the testing progresses, the test cases are continuously updated to enhance the detection ability for system weak links and potential vulnerabilities, which can ensure the continuous evolution of the testing process and the continuous improvement of the vulnerability detection ability, thereby improving the security and reliability of the in - vehicle Ethernet communication system.
[0044] Through the implementation of the above embodiments, introducing anomaly feedback information can make the training data more conform to the actual communication environment and improve the model's ability to identify potential problems; and through the fusion of multi - source data, the comprehensiveness of test cases can be enhanced, making the testing more targeted and effective.
[0045] In some embodiments, the foregoing step 102 may include: generating model prompt words according to the protocol rules of the target in - vehicle Ethernet communication protocol; inputting the model prompt words into the test case generation model to obtain initial test cases; and performing protocol compliance correction on the initial test cases to obtain target test cases.
[0046] In some examples, the protocol rules of the target in - vehicle Ethernet communication protocol include rules such as data frame format, transmission rate, error - detection mechanism, service interaction process, etc., which are used to ensure the stability and security of data transmission; for example, if the target in - vehicle Ethernet protocol stipulates that the format of the data frame should be "[destination address][source address][data length][data content][checksum]", then the test cases need to conform to this structure. The model prompt words are input instructions used to guide the large - language model to generate test cases, including key information such as protocol rules, test objectives, and test scenarios, to ensure that the generated test cases meet the test requirements; for example, they can be automatically constructed according to the protocol rules, such as "Please generate UDP communication test cases that conform to the ISO 17215 standard", or written in combination with actual test requirements, such as "Test cases for in - vehicle Ethernet communication in the case of packet loss simulation". The initial test cases are the preliminary test cases automatically generated by the test - case generation model based on the model prompt words, which may contain content that does not conform to the protocol specifications or is not optimized and need to be further corrected and adjusted. The process of protocol compliance correction is to adjust the initial test cases in terms of structure, format, and timing, etc., to make them meet the technical requirements of the target in - vehicle Ethernet communication protocol and ensure the effectiveness of the test cases; the target test cases are the final test cases that fully conform to the target in - vehicle Ethernet communication protocol specifications after protocol compliance correction and can be directly used to test the communication components to be tested.
[0047] Through the implementation of the above - mentioned embodiments, using the protocol - rule generation model prompt words can ensure that the test - case generation model can accurately understand the test requirements and improve the quality of the generated test cases; through protocol compliance correction, it can ensure that the test cases conform to the in - vehicle Ethernet communication protocol standard and enhance the reliability of the test.
[0048] In some embodiments, the foregoing protocol compliance correction of the initial test cases to obtain the target test cases may include: making a structural adaptability adjustment to the initial test cases according to the format specifications of the target in - vehicle Ethernet communication protocol to obtain intermediate test cases; making a timing compliance adjustment to the intermediate test cases according to the service interaction state logic of the target in - vehicle Ethernet communication protocol to obtain the target test cases.
[0049] In some examples, the format specification of the target in - vehicle Ethernet communication protocol includes the standardized requirements of the target in - vehicle Ethernet communication protocol for data - frame format, field arrangement, field length, data encoding method, etc., ensuring that communication data can be correctly parsed and processed at both the sending and receiving ends. The process of structure adaptability adjustment is to adjust the data - frame structure of the initial test cases to conform to the format specification of the target in - vehicle Ethernet communication protocol, including field complementation, length adjustment, data - type conversion, etc.; the intermediate test cases are the test cases that have conformed to the protocol format specification after structure adaptability adjustment but have not yet undergone timing compliance adjustment. The service interaction state logic of the target in - vehicle Ethernet communication protocol is the requirement of the target in - vehicle Ethernet communication protocol for the data - transmission process, handshake protocol, request - response mechanism, etc. of different services, ensuring that the communication sequence is correct and the state transition conforms to the protocol agreement. The process of timing compliance adjustment is to adjust the sending sequence, time interval, timeout time, response mechanism, etc. of the messages in the intermediate test cases according to the service interaction state logic of the target in - vehicle Ethernet communication protocol to ensure that the test cases meet the protocol requirements. After structure adaptability adjustment and timing compliance adjustment, the test cases that finally meet all the technical requirements of the target in - vehicle Ethernet communication protocol are the target test cases and can be directly used to test the communication components to be tested.
[0050] Through the implementation of the above - mentioned embodiments, the structure adaptability adjustment can ensure that the test cases meet the format requirements of the protocol and improve their executability; the timing compliance adjustment can ensure that the test cases meet the service interaction logic of the protocol, avoiding misjudgment or test failure caused by improper test - case design.
[0051] In some embodiments, the aforementioned step 103 may include: based on the communication components to be tested, constructing an in - vehicle Ethernet simulation environment through a virtualized communication framework; injecting the target test cases into the in - vehicle Ethernet simulation environment in batches to obtain abnormal feedback information through a multi - dimensional anomaly capture mechanism.
[0052] In some examples, the virtualized communication framework is a communication system based on software simulation, capable of simulating the operating environment of in-vehicle Ethernet communication protocols for testing without using real hardware. The virtualized communication framework includes functions such as protocol stack simulation, data flow management, and message routing, enabling testing to be completed in a virtual environment. First, in-vehicle Ethernet simulation tools such as Vector CANoe, Wireshark, Scapy, etc. can be used for virtualization, and then network virtualization technologies such as Docker and VMware NSX can be used to build an isolated communication test environment. Finally, combined with open-source or self-developed tools such as Mininet and ns-3, a simulation framework that conforms to the target in-vehicle communication protocol can be built. The in-vehicle Ethernet simulation environment is a test environment built through the virtualized communication framework and capable of simulating the actual in-vehicle Ethernet communication network. The in-vehicle Ethernet simulation environment can reproduce the topological structure, data interaction mode, service discovery mechanism, etc. of the real in-vehicle network to support the testing of communication protocols and vulnerability detection. For example, a simulation environment for the SOME / IP protocol can be built using VSOME / IP to simulate the communication interaction between different ECUs. Target test cases can be gradually injected into the simulation environment according to a certain strategy to observe the response under different communication conditions, which helps to discover hidden communication vulnerabilities and at the same time reduces the system load problem caused by large-scale testing at one time. Automated test tools such as Python+Scapy and Robot Framework can be used to send test cases in batches, and scheduling algorithms such as time slice polling and random test sequences can also be combined to control the injection rhythm of test cases. The multi-dimensional anomaly capture mechanism is a variety of detection means used to monitor and analyze in-vehicle Ethernet communication anomalies, including but not limited to: protocol consistency detection, timing anomaly analysis, abnormal traffic detection, security vulnerability triggering, etc., to identify possible communication failures or security threats. Network packet capture tools such as Wireshark can be used to capture data streams and analyze whether the data frames conform to the protocol specifications, or log analysis tools such as the ELK Stack can be used to record and mine communication anomaly patterns.
[0053] Through the implementation of the above embodiments, using the virtualized communication framework to build an in-vehicle Ethernet simulation environment can reduce hardware dependence and improve testing flexibility; adopting the multi-dimensional anomaly capture mechanism can improve the comprehensiveness of anomaly detection and enhance the accuracy and reliability of testing.
[0054] In some embodiments, the foregoing in-vehicle Ethernet communication test method may further include: determining the vulnerability quantification value of the communication component to be tested according to the vulnerability category and vulnerability level of the security vulnerability; when the vulnerability quantification value is less than the preset vulnerability threshold, determining that the communication component to be tested passes the test.
[0055] In some examples, the vulnerability categories are classified into different security risk types according to the characteristics of security vulnerabilities, including security authentication vulnerabilities, data integrity vulnerabilities, performance bottleneck vulnerabilities, configuration error vulnerabilities, denial-of-service vulnerabilities, etc. Vulnerabilities of different categories may affect different aspects of the in-vehicle system and require different mitigation measures. The vulnerability level is graded according to the severity of the vulnerability. Industry standards such as the Common Vulnerability Scoring System (CVSS) can be used to quantitatively determine security vulnerabilities. The vulnerability level can be divided into levels such as low, medium, high, and critical to measure the potential harm of the vulnerability to the system. First, a weight can be assigned to each vulnerability category, and this weight reflects the importance of this type of vulnerability in the overall security assessment. For example, security authentication vulnerabilities may be assigned a weight of 0.5, data integrity vulnerabilities are assigned a weight of 0.8, and performance bottleneck vulnerabilities are assigned a weight of 0.3. Then, a coefficient is assigned to the vulnerability level. For example, critical-level vulnerabilities may be assigned a coefficient of 1.0, high-level vulnerabilities are assigned a coefficient of 0.7, and medium-level vulnerabilities are assigned a coefficient of 0.4, etc. Then, multiply the category weight, level coefficient, and the number of vulnerabilities of the security vulnerabilities for the communication component to be tested one by one, and then add up all the results to obtain the final vulnerability quantification value. The preset vulnerability threshold is the vulnerability tolerance set during the security test to determine whether a communication component passes the test. If the vulnerability quantification value of a certain component is lower than this threshold, it is considered that the component meets the security requirements; if it is higher than the preset vulnerability threshold, further repair or strengthening of security protection measures is required. For example, the preset vulnerability threshold is 7.0. If the vulnerability quantification value of a certain vulnerability is 6.5, then the component passes the test; if the vulnerability quantification value is 8.2, it needs to be retested after repair.
[0056] Through the implementation of the above embodiments, by using the quantitative evaluation of vulnerability categories and vulnerability levels, the detection results of security vulnerabilities are made more intuitive, and a vulnerability threshold is set, which can improve the automation level of test decisions, avoid human intervention, and improve test efficiency.
[0057] Furthermore, as an implementation of the foregoing method embodiments, the present application also provides an in-vehicle Ethernet communication test device for implementing the foregoing method embodiments. This device embodiment corresponds to the foregoing method embodiment. For ease of reading, the details of the foregoing method embodiment will not be repeated one by one in this in-vehicle Ethernet communication test device embodiment, but it should be clear that the device in the embodiments of the present application can correspondingly implement all the content in the foregoing method embodiment. As Figure 2As shown in the figure, the in-vehicle Ethernet communication test device 20 includes: a model generation unit 201, a test case generation unit 202, a test case execution unit 203, and a test feedback unit 204. Among them, the model generation unit 201 is used to perform fine-tuning on the general large language model for communication testing to obtain a test case generation model adapted to the target in-vehicle Ethernet communication protocol; the test case generation unit 202 is used to generate target test cases for the communication component to be tested based on the test case generation model; the test case execution unit 203 is used to execute the target test cases based on the communication component to be tested; the test feedback unit 204 is used to determine the security vulnerabilities of the communication component to be tested according to the abnormal feedback information of the communication component to be tested.
[0058] In some embodiments, the model generation unit 201 is further used to construct an initial training data set based on the technical documents, protocol specifications of the target in-vehicle Ethernet communication protocol, and the historical operation data of the communication component to be tested; preprocess the initial training data set to obtain a target training data set; input the target training data set into the general large language model to obtain a test case generation model.
[0059] In some embodiments, the model generation unit 201 is further used to construct an initial training data set based on the abnormal feedback information, technical documents, protocol specifications, and historical operation data.
[0060] In some embodiments, the test case generation unit 202 is further used to generate model prompt words according to the protocol rules of the target in-vehicle Ethernet communication protocol; input the model prompt words into the test case generation model to obtain initial test cases; perform protocol compliance correction on the initial test cases to obtain target test cases.
[0061] In some embodiments, the test case generation unit 202 is further used to perform structural adaptability adjustment on the initial test cases according to the format specifications of the target in-vehicle Ethernet communication protocol to obtain intermediate test cases; perform timing compliance adjustment on the intermediate test cases according to the service interaction status logic of the target in-vehicle Ethernet communication protocol to obtain target test cases.
[0062] In some embodiments, the test case execution unit 203 is further used to construct an in-vehicle Ethernet simulation environment based on the communication component to be tested through a virtualized communication framework; inject the target test cases into the in-vehicle Ethernet simulation environment in batches to obtain abnormal feedback information through a multi-dimensional abnormal capture mechanism.
[0063] In some embodiments, the test feedback unit 204 is further used to determine the vulnerability quantification value of the communication component to be tested according to the vulnerability category and vulnerability level of the security vulnerability; when the vulnerability quantification value is less than the preset vulnerability threshold, it is determined that the communication component to be tested passes the test.
[0064] The present application also provides a computer-readable storage medium storing computer-executable instructions or a computer program, which, when executed by a processor, will cause the processor to execute any step of the in-vehicle Ethernet communication test method provided by the present application.
[0065] In some embodiments, the computer-readable storage medium may be a random access memory (RAM), a read-only memory (ROM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM), etc.; it may also be various devices including one or any combination of the above memories.
[0066] In some embodiments, the computer-executable instructions may be in the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including being deployed as an independent program or being deployed as a module, component, subroutine, or other unit suitable for use in a computing environment.
[0067] In some embodiments, the computer-executable instructions may or may not correspond to a file in the file system and may be stored as part of a file that stores other programs or data. For example, they may be stored in one or more scripts in a hypertext markup language (HTML) document, stored in a single file dedicated to the program in question, or stored in multiple cooperating files (e.g., files that store one or more modules, subroutines, or code portions).
[0068] In some embodiments, the computer-executable instructions may be deployed to be executed on one electronic device, or on multiple electronic devices located at one location, or, on multiple electronic devices distributed at multiple locations and interconnected by a communication network.
[0069] As Figure 3 shown, the present application also provides an electronic device 30, including a memory 310, a processor 320, and a computer program 311 stored on the memory 310 and executable on the processor. When the processor 320 executes the computer program 311, it implements any step of the above in-vehicle Ethernet communication test method.
[0070] The present application also provides a computer program product, which includes a computer program or computer-executable instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer program or computer-executable instructions from the computer-readable storage medium, and the processor executes the computer program or computer-executable instructions, so that the electronic device executes any step of the in-vehicle Ethernet communication test method described above in the present application.
[0071] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A vehicle Ethernet communication test method, characterized in that: include: Fine-tune the general large language model for communication testing to obtain a test case generation model that adapts to the target vehicle Ethernet communication protocol; Based on the test case generation model, generating a target test case for the communication component to be tested; Based on the communication component to be tested, running the target test case; The security vulnerability of the communication component to be tested is determined according to the abnormal feedback information of the communication component to be tested.
2. The vehicle-mounted Ethernet communication test method according to claim 1, characterized in that: The communication test fine-tuning of the general large language model to obtain a test case generation model adapted to the target vehicle Ethernet communication protocol includes: Based on the technical documents and protocol specifications of the target in-vehicle Ethernet communication protocol and the historical operation data of the communication component to be tested, an initial training data set is constructed; Preprocessing the initial training data set to obtain a target training data set; The target training data set is input into the universal large language model to obtain the test case generation model.
3. The vehicle-mounted Ethernet communication test method according to claim 2, characterized in that: The initial training data set is constructed based on the technical documents and protocol specifications of the target in-vehicle Ethernet communication protocol and the historical operation data of the communication component to be tested, including: The initial training data set is constructed based on the abnormal feedback information, the technical documents, the protocol specifications and the historical operation data.
4. The vehicle-mounted Ethernet communication test method according to claim 1, characterized in that: The step of generating a target test case for the communication component to be tested based on the test case generation model includes: Generate a model prompt word according to the protocol rules of the target vehicle Ethernet communication protocol; Inputting the model prompt words into the test case generation model to obtain an initial test case; The initial test case is modified for protocol compliance to obtain the target test case.
5. The vehicle-mounted Ethernet communication test method according to claim 4, characterized in that: The performing protocol compliance correction on the initial test case to obtain the target test case includes: According to the format specification of the target in-vehicle Ethernet communication protocol, adjusting the structural adaptability of the initial test case to obtain an intermediate test case; According to the service interaction state logic of the target in-vehicle Ethernet communication protocol, the intermediate test case is adjusted for timing compliance to obtain the target test case.
6. The vehicle-mounted Ethernet communication test method according to claim 1, characterized in that: The running of the target test case based on the communication component to be tested includes: Based on the communication component to be tested, a vehicle Ethernet simulation environment is constructed through a virtualized communication framework; The target test cases are injected into the vehicle Ethernet simulation environment in batches to obtain the abnormal feedback information through a multi-dimensional abnormal capture mechanism.
7. The vehicle-mounted Ethernet communication test method according to claim 1, characterized in that: The vehicle-mounted Ethernet communication test method further includes: Determining a vulnerability quantification value of the communication component to be tested according to the vulnerability category and vulnerability level of the security vulnerability; When the vulnerability quantification value is less than a preset vulnerability threshold, it is determined that the communication component to be tested passes the test.
8. A vehicle-mounted Ethernet communication test device, characterized in that: include: A model generation unit, used to fine-tune the general large language model for communication testing, and obtain a test case generation model adapted to the target vehicle Ethernet communication protocol; A test case generation unit, configured to generate a target test case for the communication component to be tested based on the test case generation model; A test case running unit, configured to run the target test case based on the communication component to be tested; The test feedback unit is used to determine the security vulnerability of the communication component to be tested according to the abnormal feedback information of the communication component to be tested.
9. An electronic device, comprising: A memory and a processor, wherein the processor is used to implement the steps of the vehicle Ethernet communication testing method as described in any one of claims 1 to 7 when executing the computer program stored in the memory.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the vehicle Ethernet communication testing method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
SOA Ethernet test system and method based on cloud
CN117155836A
Advanced vulnerability mining and automatic testing method and testing system based on large language model
CN118171288A
Adaptive AUTOSAR middleware protocol conformance fuzzy test method
CN118250203A
Automobile information safety fuzzy test method and system based on large model
CN119670092A
Method for evaluating security of vehicle internal network
WO2024172190A1
Cited By
5G-based vehicle-mounted TBOX protocol test method, equipment and medium
CN120692205A