A Verification Method for V2X Communication and Cooperative Sensing Based on Metamorphosis Testing

By constructing a formal metamorphic relation set through metamorphic testing methods, source test cases and derived test cases are generated, which solves the problems of missing test oracles and insufficient cross-layer verification in V2X systems, and realizes automated testing and anomaly detection of V2X communication and collaborative sensing systems.

CN123123973APending Publication Date: 2026-11-17SHENZHEN RES INST OF NANJING UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610744095.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-16
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

Existing V2X testing and simulation technologies suffer from a lack of test predictions, a lack of unified cross-layer verification relationships between the communication and perception layers, and anomaly detection methods that struggle to cover unknown anomalies and complex attack scenarios, resulting in low testing efficiency and insufficient automation.

Method used

The metamorphic testing method is adopted to construct a collaborative simulation test system that integrates traffic simulation, communication simulation and collaborative perception. By constructing a formal metamorphic relationship set, source test cases and derived test cases are generated to realize cross-layer correlation verification of indicators of communication layer and perception layer, and to automatically identify abnormal attack scenarios.

Benefits of technology

It enables automated testing and anomaly detection in complex communication environments, improves the automation level of V2X system testing and verification and defect detection capabilities, and is applicable to V2X communication testing, collaborative perception verification, autonomous driving simulation testing and vehicle-to-everything (V2X) anomaly detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123123973A_ABST
    Figure CN123123973A_ABST
Patent Text Reader

Abstract

This invention relates to a V2X communication and cooperative perception verification method based on metamorphic testing, belonging to the field of intelligent connected vehicle testing and verification technology. This method integrates CARLA, ns... ‑ 3. A collaborative simulation system under test is built using OpenCDA. The system designs transformation relationships such as distance-power monotonicity, frequency-power dependence, coupling of communication quality and perception accuracy, CPM message time continuity, and multi-source fusion consistency anomaly detection. It automatically generates source test cases and derived test cases, synchronously collects communication and perception metrics, and performs automated judgment based on the transformation relationships. This invention does not require a pre-defined standard correct output and can achieve full-link verification of V2X communication and collaborative perception. It is applicable to V2X communication testing, collaborative perception verification, autonomous driving simulation testing, and vehicle-to-everything (V2X) anomaly detection scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of intelligent connected vehicle testing and verification technology, specifically involving a transformation test method and automated verification system for V2X communication environment and vehicle cooperative perception system, applicable to scenarios such as V2X communication testing, cooperative perception verification, autonomous driving simulation testing and vehicle network anomaly detection. Background Technology

[0002] With the development of intelligent connected vehicles and vehicle-to-infrastructure (V2X) technologies, vehicles are gradually evolving from single-vehicle perception to multi-vehicle cooperative perception and V2X cooperative perception. In V2X cooperative perception systems, vehicles, roadside units, and other traffic participants transmit data such as location, speed, target detection results, and road environment information through wireless communication links. The cooperative perception fusion algorithm then fuses and processes the multi-source information to improve the vehicle's perception of its surroundings.

[0003] However, the effectiveness of V2X cooperative sensing systems depends not only on sensor performance and fusion algorithms, but also on the wireless communication environment. Communication between vehicles and between vehicles and roadside units can be affected by factors such as communication distance, obstacle obstruction, signal interference, shadow fading, multipath effects, and network congestion, leading to changes in received signal strength, increased path loss, higher packet loss rate, or increased communication latency, which further affects the integrity, timeliness, and consistency of cooperative sensing data.

[0004] Existing V2X testing and simulation technologies suffer from the following shortcomings. First, there is a lack of test predictions. In complex communication and collaborative sensing scenarios, the system output is uncertain under different communication conditions, making it difficult to predefine a unique standard correct output for each test scenario. Second, existing co-simulation frameworks primarily focus on the coordinated operation of traffic simulation, communication simulation, and collaborative sensing modules, lacking a systematic automated verification mechanism. Testers still need to manually analyze communication metrics, sensing results, and scenario replays, resulting in low testing efficiency.

[0005] Furthermore, there is a lack of unified cross-layer verification between the communication layer and the perception layer. In V2X systems, the physical communication layer typically focuses on metrics such as RSSI, path loss, signal-to-noise ratio, and packet loss rate, while the collaborative perception application layer focuses on metrics such as detection rate, positioning error, fusion accuracy, and consistency score. Existing methods often analyze communication performance or perception performance separately, lacking formal and quantitative verification methods for the coupling relationship between communication layer metrics and perception layer metrics, making it difficult to track and locate anomaly propagation processes.

[0006] In abnormal and attack scenarios, the V2X collaborative awareness process may encounter issues such as channel abrupt changes, message delays, spoofing, abnormal state transitions, and Byzantine nodes. Existing anomaly detection methods typically rely on manually constructed test scenarios, preset rules, or known attack signatures, making it difficult to cover unknown anomalies and complex attack combinations, and thus failing to meet the large-scale automated testing requirements of highly reliable V2X systems.

[0007] Metamorphic testing is a software testing method designed to mitigate the problem of missing test predictions. Its basic idea is to construct source test cases and derived test cases to verify whether changes in input and output satisfy a predefined metamorphic relationship. For V2X communication and cooperative perception systems, communication physical models, vehicle kinematic constraints, cooperative perception fusion logic, and multi-source consistency constraints can all be used to construct metamorphic relationships. Therefore, there is an urgent need for a V2X communication and cooperative perception verification method and system that does not require a pre-defined standard correct output, can perform cross-layer correlation verification of communication layer and perception layer indicators, and can automatically determine abnormal attack scenarios. Summary of the Invention

[0008] This invention addresses the challenge of predicting the correct standard output of V2X communication and cooperative sensing systems in complex communication environments by providing a V2X communication and cooperative sensing verification method based on metamorphic testing. It constructs a cooperative simulation test system integrating traffic simulation, communication simulation, and cooperative sensing, building quantifiable formal metamorphic relationships based on communication physics theory, cooperative sensing logic, and anomaly detection rules. Automated verification is then performed through the output relationship between source and derived test cases. This achieves unified testing and defect determination for the communication layer, sensing layer, and anomaly attack scenarios, improving the automation level and defect detection capability of V2X system testing and verification.

[0009] To achieve the above objectives, this invention proposes a V2X communication and cooperative sensing verification method based on metamorphic testing. The method first constructs a cooperative simulation test system integrating a CARLA vehicle and sensor simulation module, an ns-3 communication protocol stack and channel model module, and an OpenCDA cooperative sensing fusion module. Then, a formalized metamorphic relation set is constructed based on the physical characteristics of V2X communication, the cooperative sensing fusion logic, and the requirements for anomaly attack detection. Next, source test cases and corresponding derived test cases are generated based on the formalized metamorphic relation set. Then, the source test cases and derived test cases are input into the cooperative simulation test system for execution, and communication layer and sensing layer indicators are collected simultaneously. Finally, the output results of the source test cases and derived test cases are verified to ensure they satisfy the corresponding metamorphic relations, thereby determining whether the test system has defects or anomalies. Specifically, the method includes the following steps:

[0010] 1) Construct an integrated simulation test system. The CARLA vehicle and sensor simulation module, the ns-3 communication protocol stack and channel model module, and the OpenCDA collaborative sensing fusion module are collaboratively integrated to form a collaborative simulation test system for V2X communication and collaborative sensing verification. This collaborative simulation test system simulates vehicle motion, sensor perception, V2X message transmission, and the collaborative sensing fusion process. During the simulation, the traffic simulation, communication simulation, and collaborative sensing modules are synchronized in time. A conservative time synchronization mechanism is used to control the data interaction timing between modules, ensuring that the maximum time deviation between modules is less than a preset threshold; preferably, the maximum time deviation is less than 10 ms.

[0011] 2) Construct a formalized set of metamorphic relationships. Based on the physical characteristics of V2X communication, the collaborative sensing fusion logic, and the requirements for anomaly attack detection, a formalized set of metamorphic relationships is constructed. This set of formalized metamorphic relationships includes at least the communication physical layer metamorphic relationship, the communication quality and sensing performance coupling metamorphic relationship, the collaborative sensing message temporal continuity metamorphic relationship, and the multi-source fusion consistency anomaly detection metamorphic relationship.

[0012] The formalized set of metamorphic relations includes at least one of the following metamorphic relations:

[0013] MR-1: Based on the distance-power monotonicity degeneration relationship of the Friis equation, it is used to verify whether the change in communication distance satisfies the preset monotonic relationship with the received signal strength or path loss when the transmit power, carrier frequency, antenna gain and channel conditions remain unchanged.

[0014] MR-2: Based on the frequency-power dependence of electromagnetic wave theory, it is used to verify whether the carrier frequency change and the received power or path loss change satisfy a preset physical relationship when the communication distance and transmit power remain unchanged.

[0015] MR-3: The monotonic coupling degenerative relationship between communication quality and sensing accuracy is used to verify whether the collaborative sensing detection rate, cross-multiplication ratio, fusion accuracy or consistency score meet the preset coupling relationship when packet loss rate, bit error rate, signal-to-noise ratio or communication delay changes.

[0016] MR-4: Lipschitz temporal continuity transformation relation for CPM messages, used to verify whether changes in target position, velocity, or state in continuous cooperative sensing messages satisfy vehicle kinematic constraints and temporal continuity constraints;

[0017] MR-5: Multi-source fusion consistency anomaly detection metamorphosis relationship, used to verify whether the consistency score of the multi-source collaborative perception results is lower than a preset threshold, or decreases more than a preset threshold compared to the source test cases, or whether an anomaly judgment is triggered when there are false object injections, abnormal nodes, or Byzantine attacks.

[0018] 3) Generate parameterized test cases. Based on the formal metamorphic relation set constructed in step 2), the test orchestration module traverses the preset parameter space to generate source test cases and their corresponding derived test cases. For each set of source test cases, according to the input transformation rule corresponding to the selected metamorphic relation, only the specified input parameters related to that metamorphic relation are changed, while other irrelevant parameters remain unchanged, thereby generating derived test cases. The input parameters include at least one of the following: vehicle position, vehicle spacing, carrier frequency, transmit power, channel model parameters, packet loss rate, signal-to-noise ratio, obstacle status, perceived message content, and abnormal node configuration.

[0019] 4) Execute source and derived test cases. Input the source and derived test cases into the co-simulation system under test and run them to perform V2X communication simulation, vehicle sensor simulation, and collaborative perception fusion process. During the simulation execution, synchronously collect communication layer indicators and perception layer indicators. The communication layer indicators include at least one of Received Signal Strength Index (RSSI), path loss, signal-to-noise ratio (SNR), packet loss rate, and communication delay; the perception layer indicators include at least one of target detection rate, Intersection over Union (IoU), positioning error, fusion accuracy, and multi-source consistency score.

[0020] 5) Perform metamorphic relationship verification and defect determination. Based on the formal metamorphic relationship defined in step 2), verify the relationship between the output results of the source test cases and derived test cases. The verification process includes at least one of the following: monotonicity judgment, threshold comparison, statistical test, logical assertion, time continuity check, and multi-source consistency score calculation. When the output results of the source test cases and derived test cases satisfy the corresponding metamorphic relationship, the system under test is determined to have passed the verification under this test condition; when the output results violate the corresponding metamorphic relationship, the system under test is determined to have a defect or anomaly, and a test report is generated. The test report includes the violated metamorphic relationship number, source test case parameters, derived test case parameters, changes in communication layer indicators, changes in perception layer indicators, anomaly occurrence time, and defect determination result.

[0021] Furthermore, the specific steps of step 1) above are as follows:

[0022] Step 1)-1: Initial state;

[0023] Step 1)-2: Input vehicle simulation configuration, communication simulation configuration, collaborative perception fusion configuration, and traffic scenario configuration to be verified;

[0024] Steps 1)-3: Initialize the CARLA vehicle and sensor simulation module to simulate vehicle motion and sensor perception processes;

[0025] Step 1)-4: Initialize the ns-3 communication protocol stack and channel model module to simulate the V2X message transmission process;

[0026] Step 1)-5: Initialize the OpenCDA collaborative sensing fusion module to perform the collaborative sensing fusion process;

[0027] Steps 1)-6: Establish the data interaction relationship between the CARLA vehicle and sensor simulation module, the ns-3 communication protocol stack and channel model module, and the OpenCDA collaborative perception fusion module;

[0028] Steps 1)-7: A conservative time synchronization mechanism is used to control the timing of data interaction between traffic simulation, communication simulation, and collaborative perception fusion processes;

[0029] Step 1)-8: Determine whether the maximum time deviation between each module is less than the preset threshold. If so, execute Step 1)-9; otherwise, adjust the synchronization parameters of the conservative time synchronization mechanism and re-execute Step 1)-7.

[0030] Steps 1)-9: Output the co-simulation of the system under test;

[0031] Step 1)-10: End state.

[0032] Furthermore, the specific steps of step 2) above are as follows:

[0033] Step 2)-1: Initial state;

[0034] Step 2)-2: Input the physical characteristics of V2X communication, collaborative sensing fusion logic, and abnormal attack detection requirements;

[0035] Steps 2)-3: Based on the relationship between communication distance, transmit power, carrier frequency, antenna gain and channel conditions, construct the distance-power monotonicity decay relationship based on the Friis equation;

[0036] Steps 2)-4: Based on the relationship between carrier frequency change and received power or path loss change, construct a frequency-power dependence degradation relationship based on electromagnetic wave theory;

[0037] Steps 2)-5: Based on the relationship between packet loss rate, bit error rate, signal-to-noise ratio or communication latency and collaborative sensing detection rate, cross-interval ratio, fusion accuracy or consistency score, construct a monotonic coupling transformation relationship between communication quality and sensing accuracy;

[0038] Steps 2)-6: Based on the relationship between the target position, velocity or state changes and vehicle kinematic constraints and temporal continuity constraints in the continuous collaborative sensing messages, construct the Lipschitz temporal continuity transformation relationship of CPM messages;

[0039] Steps 2)-7: Based on the relationship between the consistency score of the multi-source collaborative perception results and the spurious object injection, abnormal nodes or Byzantine attacks, construct the metamorphic relationship of multi-source fusion consistency anomaly detection;

[0040] Steps 2)-8: Store the above metamorphic relations into a formalized metamorphic relation set;

[0041] Step 2)-9: Output the set of formalized metamorphic relations;

[0042] Step 2)-10: End state.

[0043] Furthermore, the specific steps of step 3) above are as follows:

[0044] Step 3)-1: Initial state;

[0045] Step 3)-2: Input the set of formalized metamorphic relations and the preset parameter space;

[0046] Step 3)-3: Select a metamorphic relation to be verified from the set of formalized metamorphic relations;

[0047] Steps 3)-4: Determine the input transformation rule and the specified input parameters to be changed corresponding to the selected metamorphic relationship;

[0048] Steps 3)-5: Generate source test cases based on the preset parameter space;

[0049] Steps 3)-6: While keeping other irrelevant parameters unchanged, change the specified input parameters related to the selected metamorphic relationship to generate derived test cases corresponding to the source test cases;

[0050] Step 3)-7: Determine whether the metamorphic relations in the formal metamorphic relation set have been traversed. If yes, execute step 3)-8; otherwise, execute step 3)-3.

[0051] Steps 3)-8: Output the source test cases and derived test case sets;

[0052] Step 3)-9: End state.

[0053] Furthermore, the specific steps of step 4) above are as follows:

[0054] Step 4)-1: Initial state;

[0055] Step 4)-2: Input source test cases, derived test cases, and co-simulate the system under test;

[0056] Step 4)-3: Input the source test cases into the co-simulation system under test and run them;

[0057] Step 4)-4: Execute the vehicle motion simulation, sensor perception simulation, V2X communication simulation, and collaborative perception fusion process corresponding to the source test cases;

[0058] Steps 4)-5: Synchronously collect communication layer metrics and perception layer metrics corresponding to the source test cases;

[0059] Steps 4)-6: Input the derived test cases into the co-simulation system under test and run them;

[0060] Steps 4)-7: Execute the vehicle motion simulation, sensor perception simulation, V2X communication simulation, and collaborative perception fusion process corresponding to the derived test cases;

[0061] Steps 4)-8: Synchronously collect communication layer metrics and perception layer metrics corresponding to the derived test cases;

[0062] Steps 4)-9: Output the simulation results corresponding to the source test cases and derived test cases;

[0063] Step 4)-10: End state.

[0064] Furthermore, the specific steps of step 5) above are as follows:

[0065] Step 5)-1: Initial state;

[0066] Step 5)-2: Input the set of formalized metamorphic relations, the output results of the source test cases, and the output results of the derived test cases;

[0067] Step 5)-3: Determine the metamorphic relationship between the source test cases and the derived test cases;

[0068] Step 5)-4: Based on the corresponding metamorphic relationship, perform monotonicity judgment, threshold comparison, statistical test, logical assertion, time continuity check or multi-source consistency score calculation on the output results of the source test cases and the output results of the derived test cases.

[0069] Step 5)-5: Determine whether the output results of the source test case and the derived test case satisfy the corresponding metamorphic relationship. If yes, proceed to step 5)-6; otherwise, proceed to step 5)-7.

[0070] Steps 5)-6: Determine whether the system under test passes the verification under the test conditions, and record the verification result;

[0071] Steps 5)-7: Determine if the system under test has defects or abnormalities;

[0072] Steps 5)-8: Generate a test report, which includes the violation metamorphic relationship number, source test case parameters, derived test case parameters, changes in communication layer indicators, changes in perception layer indicators, time of anomaly occurrence, and defect determination results;

[0073] Steps 5)-9: Output the test report;

[0074] Steps 5-10: End state.

[0075] This invention also provides a V2X communication and collaborative sensing verification system based on metamorphic testing, used to implement the above verification method. The system includes a simulation integration module, a metamorphic relation library module, a test orchestration module, a data acquisition module, and a verification assertion module.

[0076] The simulation integration module is used to manage the coordinated execution of CARLA, ns-3 and OpenCDA, and to synchronize the vehicle motion simulation, communication link simulation and cooperative perception fusion process in time, forming a V2X communication and cooperative perception test system.

[0077] The metamorphic relation library module is used to store executable metamorphic relation definitions, including distance-power monotonicity metamorphic relation, frequency-power dependence metamorphic relation, communication quality and sensing accuracy monotonic coupling metamorphic relation, CPM message Lipschitz time continuity metamorphic relation, and multi-source fusion consistency anomaly detection metamorphic relation.

[0078] The test orchestration module is used to traverse the parameter space according to the metamorphic relationships in the metamorphic relationship library, generate source test cases and derived test cases, and input the test cases into the simulation integration module for execution.

[0079] The data acquisition module is used to synchronously record the timing data of the communication layer and the perception layer during the simulation execution. The communication layer data includes at least one of RSSI, path loss, SNR, packet loss rate, and communication delay; the perception layer data includes at least one of detection rate, IoU, positioning error, fusion accuracy, and consistency score.

[0080] The verification assertion module is used to perform statistical tests, logical assertions, temporal continuity checks, and consistency score calculations on the output results of source test cases and derived test cases based on the metamorphic relationships in the metamorphic relationship library. When the output result violates the corresponding metamorphic relationship, the verification assertion module generates a defect report and outputs the corresponding exception type and test scenario information.

[0081] Compared with the prior art, the present invention has the following beneficial effects:

[0082] First, this invention combines the Friis free-space transmission equation, path loss, shadow fading and other communication physical characteristics with perception layer indicators such as cooperative sensing detection rate, cross-intersection ratio, fusion accuracy and consistency score to construct a quantifiable transformation relationship between the communication layer and the perception layer, thereby realizing cross-layer verification of the entire V2X communication and cooperative sensing link.

[0083] Secondly, based on the temporal continuity characteristics of CPM messages, this invention constructs a temporal transformation relationship that satisfies the Lipschitz continuity constraint, and combines vehicle kinematic constraints and noise tolerance to verify the target position, velocity and state changes in continuous cooperative sensing messages, thereby automatically detecting problems such as message temporal forgery, state abrupt changes and abnormal jumps.

[0084] In addition, this invention constructs an anomaly detection metamorphic relationship based on the consistency of multi-source perception fusion. By comparing the consistency between the information reported by different vehicles or roadside units and the fusion result, it determines whether there are false object injections, abnormal nodes, or Byzantine attacks. This method does not rely on preset attack signatures and can improve the detection capability in unknown anomalies and complex attack scenarios.

[0085] Finally, this invention achieves automated testing of V2X communication and collaborative sensing systems through test orchestration, generation of source and derived test cases, collection of communication and perception metrics, verification of metamorphic relationships, and generation of defect reports. This method can perform black-box verification without altering the core logic of the original simulation framework, is compatible with existing collaborative simulation platforms, and supports parameter space traversal, boundary scene testing, and continuous integration testing. Attached Figure Description

[0086] Figure 1 This is an overall flowchart of a V2X communication and collaborative sensing verification method and system based on metamorphic testing in an embodiment of the present invention.

[0087] Figure 2 This is a flowchart of the MR-1 distance attenuation monotonicity test in this invention.

[0088] Figure 3 This is a flowchart of the MR-4 Lipschitz continuity verification process in this invention.

[0089] Figure 4 This is a flowchart of the timing synchronization process for simulation test execution in this invention.

[0090] Figure 5 This is a flowchart for verifying the MR-3 communication-sensing coupling relationship in this invention. Detailed Implementation

[0091] To better understand the technical content of the present invention, specific embodiments are described below in conjunction with the accompanying drawings.

[0092] Figure 1 This is an overall flowchart of a V2X communication and collaborative sensing verification method and system based on metamorphic testing in an embodiment of the present invention.

[0093] The V2X communication and collaborative sensing verification method and system based on metamorphic testing described in this embodiment includes the following steps.

[0094] Step 1) Constructing an integrated simulation system under test: The CARLA vehicle and sensor simulation module, the ns-3 communication protocol stack and channel model module, and the OpenCDA collaborative perception fusion module are collaboratively integrated to form a collaborative simulation system under test for V2X communication and collaborative perception verification. This collaborative simulation system under test simulates vehicle motion, sensor perception, V2X message transmission, and the collaborative perception fusion process. During the simulation, a conservative time synchronization mechanism is used to control the data interaction timing between the traffic simulation, communication simulation, and collaborative perception modules, ensuring that the maximum time deviation between each module is less than a preset threshold.

[0095] Step 2) Constructing a set of formal metamorphic relationships: Based on the physical characteristics of V2X communication, the collaborative sensing fusion logic, and the requirements for anomaly attack detection, a set of formal metamorphic relationships is constructed. This set includes distance-power monotonicity metamorphic relationships based on the Friis equation, frequency-power dependence metamorphic relationships based on electromagnetic wave theory, monotonic coupling metamorphic relationships between communication quality and sensing accuracy, Lipschitz time continuity metamorphic relationships for CPM messages, and metamorphic relationships for multi-source fusion consistency anomaly detection.

[0096] Step 3) Generate parameterized test cases: Based on the formalized metamorphic relation set, the test orchestration module traverses the preset parameter space to generate source test cases and their corresponding derived test cases. For each set of source test cases, according to the input transformation rule corresponding to the selected metamorphic relation, only the specified input parameters related to that metamorphic relation are changed, while other irrelevant parameters remain unchanged, thereby generating derived test cases.

[0097] Step 4) Execute source and derived test cases: Input the source and derived test cases into the collaborative simulation system under test and run them to perform V2X communication simulation, vehicle sensor simulation, and collaborative perception fusion process. During the simulation execution, communication layer indicators and perception layer indicators are collected synchronously. The communication layer indicators include at least one of RSSI, path loss, SNR, packet loss rate, and communication latency; the perception layer indicators include at least one of target detection rate, IoU, positioning error, fusion accuracy, and multi-source consistency score.

[0098] Step 5) Perform metamorphic relation verification and defect determination: Based on the formalized set of metamorphic relations, verify the relationships between the outputs of the source test cases and derived test cases. The verification process includes at least one of the following: monotonicity judgment, threshold comparison, statistical test, logical assertion, time continuity check, and multi-source consistency score calculation. When the output results satisfy the corresponding metamorphic relation, the system under test is deemed to have passed the verification under this test condition; when the output results violate the corresponding metamorphic relation, the system under test is deemed to have a defect or anomaly, and a test report is generated.

[0099] Figure 2 This is a flowchart of the MR-1 distance attenuation monotonicity test. MR-1 is used to verify whether the received signal strength, received power, or path loss meets a preset monotonic relationship when the communication distance between vehicles increases, while keeping the transmit power, carrier frequency, antenna gain, and channel conditions constant. The specific steps are as follows:

[0100] Initial state; Step S21: Set the simulation scenario and communication parameters, including at least one of transmit power, carrier frequency, antenna gain, and channel model parameters; Step S22: Generate source test cases and set the inter-vehicle communication distance in the source test cases to d1; Step S23: Generate derived test cases and set the inter-vehicle communication distance in the derived test cases to d2, where d2 is greater than d1, while keeping other parameters unchanged; Step S24: Input the source test cases and derived test cases into the co-simulation of the system under test and execute the co-simulation; Step S25: Step S26: Collect RSSI and received power indices corresponding to the source test case and the derived test case; Step S27: Calculate the average received power or average received signal strength corresponding to distances d1 and d2, denoted as P(d1) and P(d2) respectively; Step S28: Determine whether P(d1) is greater than P(d2). If it is, proceed to step S2a; otherwise, proceed to step S2b; Step S2a: Determine whether the source test case and the derived test case satisfy the MR-1 distance-power monotonicity decay relationship; Step S2b: Determine whether the MR-1 distance-power monotonicity decay relationship is violated and output the abnormal result; End state.

[0101] Figure 3 This is a flowchart of the MR-4 Lipschitz continuity verification process. MR-4 is used to verify whether changes in target position, velocity, or state in continuous cooperative sensing messages satisfy vehicle kinematic constraints and temporal continuity constraints. The specific steps are as follows:

[0102] Step S31: Extract the collaborative sensing target trajectory within a continuous time window W from the CPM message sequence; Step S32: Extract the target state vectors xi and xi+1 corresponding to adjacent times ti and ti+1 within the time window W; Step S33: Calculate the target state change Δxi between adjacent times, where Δxi = ||xi+1 - xi||; Step S34: Calculate the rate of change Li based on the time interval Δt = ti+1 - ti, where Li = Δxi / Δt; Step S35: Compare the rate of change Li with the preset Lipschitz constant threshold Lmax; Step S36: Determine whether Li ≤ Lmax is satisfied. If satisfied, proceed to step S37a; otherwise, proceed to step S37b; Step S37a: Determine that the continuity constraint is satisfied, and the test passes; Step S37b: Determine that the continuity constraint is not satisfied, and determine that there is a message timing anomaly, a sudden state change, or an abnormal jump.

[0103] Figure 4 This is a flowchart illustrating the timing synchronization process during simulation testing. The flowchart explains the collaborative execution, time synchronization, and metric acquisition processes between the CARLA vehicle and sensor simulation module, the ns-3 communication protocol stack and channel model module, and the OpenCDA collaborative sensing fusion module. The specific steps are as follows:

[0104] Initial state; Step S41: Initialize the collaborative simulation environment, which includes the CARLA vehicle and sensor simulation module, the ns-3 communication protocol stack and channel model module, and the OpenCDA collaborative perception fusion module; Step S42: Set conservative time synchronization parameters and maximum time deviation threshold; Step S43: Generate source test cases and derived test cases; Step S44: Execute vehicle motion and sensor perception simulation; Step S45: Execute V2X message transmission and channel simulation; Step S46: Execute collaborative perception fusion; Step S47: Synchronously collect communication layer indicators and perception layer indicators; Step S48: Determine whether the time deviation between modules is less than the preset threshold. If so, execute step S4a; otherwise, execute step S4b; Step S4a: Record the test results and enter the verification assertion; Step S4b: Execute time synchronization correction and rescheduling; End state.

[0105] Figure 5 This is a flowchart for verifying the communication-sensing coupling relationship of MR-3. MR-3 is used to verify whether the cooperative sensing performance meets the preset communication-sensing coupling relationship when communication quality changes. The specific steps are as follows:

[0106] Initial state; Step S51: Set communication disturbance conditions, which include at least one of packet loss rate, communication delay, or signal-to-noise ratio; Step S52: Generate source test cases and derived test cases according to the communication disturbance conditions; Step S53: Execute collaborative simulation and synchronously collect communication indicators and sensing indicators; Step S54: Extract communication layer indicators, which include at least one of packet loss rate, communication delay, or signal-to-noise ratio (SNR); Step S55: Extract sensing layer indicators, which include at least one of detection rate, intersection-to-union ratio (IoU), or fusion accuracy; Step S56: Calculate the relationship between changes in communication indicators and changes in sensing performance; Step S57: Determine whether the preset communication-sensing coupling relationship is satisfied. If satisfied, execute step S5a; otherwise, execute step S5b; Step S5a: Determine that MR-3 is satisfied and output a normal result; Step S5b: Determine that MR-3 is violated and determine that there is a communication-sensing coupling anomaly; End state.

[0107] In addition, this invention can also be used for multi-source fusion consistency anomaly detection testing. Specifically, MR-5 is selected as the metamorphic relationship to be verified. In a simulation scenario, four vehicles with V2X communication capabilities are deployed, with three vehicles acting as normal nodes and one vehicle acting as an abnormal node or attack node. In the source test cases, each vehicle reports target information according to the actual perception results; in the derived test cases, the attack node injects false object information into other vehicles, or reports target position, speed, or status information inconsistent with the real scene. The system under test runs the source test cases and derived test cases, and fuses the multi-source target information through the collaborative perception fusion module. The data acquisition module synchronously records the target information reported by each vehicle, the fusion results, and the multi-source consistency score. When the multi-source consistency score in the derived test cases is lower than the preset consistency threshold, it is determined that the system has detected an abnormal node or false object injection behavior; when the consistency score does not decrease significantly or does not trigger anomaly judgment, it is determined that the system under test has a multi-source fusion consistency anomaly detection defect, and an anomaly detection report is automatically output.

[0108] In summary, this invention constructs a V2X communication and collaborative perception verification method and system based on metamorphic testing. In the absence of standard correct output, it utilizes the output relationship between source test cases and derived test cases to complete automated judgment, solving the problems of missing test oracles, insufficient cross-layer verification, and insufficient automated judgment capability for abnormal attack scenarios in V2X communication and collaborative perception systems. It can realize full-link verification of V2X communication and collaborative perception and is applicable to scenarios such as V2X communication testing, collaborative perception verification, autonomous driving simulation testing, and vehicle network anomaly detection.

Claims

1. A V2X communication and collaborative sensing verification method based on metamorphic testing, characterized in that, A collaborative simulation test system integrating traffic simulation, communication simulation, and collaborative sensing is constructed. Based on the physical characteristics of V2X communication, the collaborative sensing fusion logic, and the requirements for anomaly attack detection, a formalized metamorphic relation set is built. Source test cases and derived test cases are generated according to this formalized metamorphic relation set. By verifying whether the output results of the source test cases and derived test cases satisfy the corresponding metamorphic relations, defects or anomalies in the test system are determined. This method includes the following steps: 1) Construct a collaborative simulation test system that integrates traffic simulation, communication simulation, and collaborative perception fusion. The collaborative simulation test system is used to simulate vehicle motion, sensor perception, V2X message transmission, and collaborative perception fusion process. 2) Based on the physical characteristics of V2X communication, collaborative perception fusion logic, and abnormal attack detection requirements, a formal metamorphic relationship set is constructed. The formal metamorphic relationship set is used to describe the relationship that the input changes and output changes between the source test case and the derived test case should satisfy. 3) Generate source test cases and derived test cases corresponding to the source test cases based on the formalized metamorphic relation set, wherein the derived test cases are generated by changing the specified input parameters related to the corresponding metamorphic relation while keeping other irrelevant parameters unchanged; 4) Input the source test cases and derived test cases into the collaborative simulation system under test respectively, execute V2X communication simulation, vehicle sensor simulation and collaborative perception fusion process, and collect communication layer indicators and perception layer indicators simultaneously; 5) Based on the formalized metamorphic relation set, verify the relationship between the output results of the source test cases and the derived test cases. If the output results satisfy the corresponding metamorphic relation, the system under test is determined to have passed the verification under the corresponding test conditions. If the output results violate the corresponding metamorphic relation, the system under test is determined to have defects or abnormalities, and a test report is generated.

2. The V2X communication and cooperative sensing verification method based on metamorphic testing according to claim 1, characterized in that, In step 1), the collaborative simulation system under test includes a CARLA vehicle and sensor simulation module, an ns-3 communication protocol stack and channel model module, and an OpenCDA collaborative perception fusion module. The CARLA vehicle and sensor simulation module simulates vehicle motion and sensor perception processes, the ns-3 communication protocol stack and channel model module simulates V2X message transmission processes, and the OpenCDA collaborative perception fusion module executes the collaborative perception fusion process. The collaborative simulation system under test employs a conservative time synchronization mechanism to control the data interaction timing between traffic simulation, communication simulation, and the collaborative perception fusion process, ensuring that the maximum time deviation between each module is less than a preset threshold.

3. The V2X communication and cooperative sensing verification method based on metamorphic testing according to claim 1, characterized in that, In step 2), the formalized metamorphic relation set includes communication physical layer metamorphic relations, which include distance-power monotonic metamorphic relations based on Friis equations and frequency-power dependent metamorphic relations based on electromagnetic wave theory. The distance-power monotonic metamorphic relations are used to verify whether, with constant transmit power, carrier frequency, antenna gain, and channel conditions, the received signal strength satisfies a monotonic non-increasing relationship when the communication distance increases, or whether the path loss satisfies a monotonic non-decreasing relationship. The frequency-power dependent metamorphic relations are used to verify whether, with constant communication distance and transmit power, changes in carrier frequency and changes in received power or path loss satisfy a preset physical relationship.

4. The V2X communication and cooperative sensing verification method based on metamorphic testing according to claim 1, characterized in that, In step 2), the formalized metamorphic relationship set includes the communication quality and sensing performance coupled metamorphic relationship. The communication quality and sensing performance coupled metamorphic relationship is used to verify whether the collaborative sensing detection rate, cross-multiplication ratio, fusion accuracy, or multi-source consistency score meets the preset coupling relationship when the packet loss rate, bit error rate, signal-to-noise ratio, or communication delay changes. Among them, when the communication packet loss rate, bit error rate, or communication delay increases, or the signal-to-noise ratio decreases, the collaborative sensing detection rate, cross-multiplication ratio, fusion accuracy, or multi-source consistency score meets the monotonic non-increasing relationship or is within the preset tolerance range.

5. The V2X communication and cooperative sensing verification method based on metamorphic testing according to claim 1, characterized in that, In step 2), the formalized metamorphic relation set includes the collaborative sensing message temporal continuity metamorphic relation and the multi-source fusion consistency anomaly detection metamorphic relation; wherein, the collaborative sensing message temporal continuity metamorphic relation is the CPM message Lipschitz temporal continuity metamorphic relation, used to verify whether the changes in target position, velocity or state in continuous collaborative sensing messages satisfy vehicle kinematic constraints and temporal continuity constraints; the multi-source fusion consistency anomaly detection metamorphic relation is used to verify whether the consistency score of the multi-source collaborative sensing result is lower than a preset threshold, or decreases more than a preset threshold compared to the source test cases, or triggers anomaly judgment when there are false object injections, abnormal nodes or Byzantine attacks.

6. A V2X communication and cooperative sensing verification system based on metamorphic testing that implements the method of any one of claims 1 to 5, characterized in that, It includes a simulation integration module, a metamorphic relation library module, a test orchestration module, a data acquisition module, and a verification assertion module; the simulation integration module is used to manage the collaborative execution of traffic simulation, communication simulation, and collaborative perception fusion processes, and to form a V2X communication and collaborative perception system under test; the metamorphic relation library module is used to store executable metamorphic relation definitions; The test orchestration module is used to traverse the parameter space according to the metamorphic relationship in the metamorphic relationship library module, generate source test cases and derived test cases, and input the test cases into the simulation integration module for execution. The data acquisition module is used to synchronously record communication layer indicators and perception layer indicators during the simulation execution process; The verification assertion module is used to perform statistical tests, logical assertions, time continuity checks, or consistency score calculations on the output results of source test cases and derived test cases based on the metamorphic relationships in the metamorphic relationship library module, and generate a defect report when the output results violate the corresponding metamorphic relationship.