A method and system for online editing and parallel execution of vehicle network test cases

By using web-based online editing and containerized isolation technology, the problems of development collaboration and execution interference in vehicle network testing were solved, achieving an efficient and reliable testing environment and result traceability, thus improving testing efficiency and accuracy.

CN122372457APending Publication Date: 2026-07-10SHANGHAI WEILAN INTELLIGENT TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610581493.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-04-29
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

The lack of a unified online editing tool in existing vehicle network testing technologies leads to a lack of collaboration and code standardization in the development process. Test case execution modes are monotonous and easily interfered with. There is a lack of standardized execution context and variable isolation mechanisms, and test reports are not real-time, making it difficult to guarantee the accuracy and efficiency of testing.

Method used

An online editing environment is built via the web, which automatically generates protocol code, parses test case dependencies, constructs execution plans using a topology sorting algorithm, and combines containerization isolation technology and copy-on-write mechanism to achieve parallel execution and standardized interfaces, generating structured reports.

Benefits of technology

It improves the collaboration and efficiency of test development, ensures the isolation and stability of the test environment, realizes the reliability and traceability of test results, reduces human error and data crosstalk, and provides comprehensive technical support.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122372457A_ABST
    Figure CN122372457A_ABST
Patent Text Reader

Abstract

This invention discloses an online editing and parallel execution method and system for vehicle network test cases, relating to the field of vehicle network testing technology. It establishes an online editing environment via a web interface, enabling automatic generation of protocol code and providing testers with a convenient and efficient development experience. Regarding test case execution, it accurately analyzes the dependencies of test cases, uses a topology sorting algorithm to construct a reasonable execution plan, and adaptively switches between sequential and parallel execution modes. Combined with containerization isolation technology, it allocates an independent execution container for each test case, ensuring the isolation and stability of the testing environment. Simultaneously, it initializes a unified test execution context for each test case and establishes a communication connection with the vehicle network bus simulation engine through a standardized interface, achieving standardization and normalization of operations such as message sending and receiving, fault injection, and assertion verification. In variable management, it adopts a copy-on-write mechanism to achieve isolated sharing of project variables, avoiding data crosstalk.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of vehicle network testing technology, specifically to a method and system for online editing and parallel execution of vehicle network test cases. Background Technology

[0002] With the rapid development of automotive electronics and intelligent connected vehicle technologies, the number of Electronic Control Units (ECUs) in modern vehicles has increased dramatically. Simultaneously, to meet the complex and diverse functional requirements of vehicles, various communication protocol architectures such as CAN, LIN, FlexRay, and Automotive Ethernet have been widely used in in-vehicle networks. This situation of multiple protocols coexisting and a large number of ECUs has led to a continuous expansion in the scale and a significant increase in the complexity of in-vehicle network testing. Against this backdrop, the market has placed more stringent demands on the efficiency, reliability, and standardization of in-vehicle network testing. Efficient, accurate, and comprehensive testing solutions have become a key link in ensuring the quality and safety of intelligent connected vehicles, and are of great significance for promoting technological progress and product upgrades in the automotive industry.

[0003] Existing vehicle network testing technologies suffer from several core shortcomings that hinder their development. Firstly, test case development relies on local environments and lacks unified online editing tools, leading to a lack of collaboration in the development process. Furthermore, it's difficult to standardize coding styles and specifications among different developers. Additionally, protocol code must be written manually, which is not only inefficient but also prone to human error, increasing testing costs and risks. Secondly, regarding the execution of multiple test cases, there is a lack of control over dependencies between test cases. Execution modes are relatively simple, supporting only sequential execution, or, while supporting parallel execution, poor isolation. Different test cases can easily interfere with each other during execution, affecting the accuracy and reliability of test results. Thirdly, there is a lack of standardized execution methods. The test process suffers from several problems. First, the lack of contextual coordination with the vehicle bus simulation engine and inconsistent interfaces for message sending and receiving, fault injection, and assertion verification lead to non-standard test procedures and make it difficult to ensure test consistency and repeatability. Second, the lack of effective isolation mechanisms for project variables makes it easy for different test cases to cause data crosstalk during parallel testing, resulting in an unstable test environment and affecting the correctness of test results. Third, test reports are mostly static and lack real-time feedback and process traceability capabilities, making it difficult for testers to discover problems in a timely manner during testing and to quickly locate the root cause of problems after testing, thus reducing testing efficiency and problem-solving speed. Summary of the Invention

[0004] The purpose of this invention is to overcome the shortcomings of existing technologies by providing a method and system for online editing and parallel execution of vehicle network test cases. It establishes an online editing environment via a web interface, enabling automatic generation of protocol code and providing testers with a convenient and efficient development experience. Regarding test case execution, it accurately analyzes the dependencies of test cases, uses a topology sorting algorithm to construct a reasonable execution plan, and adaptively switches between sequential and parallel execution modes. Combined with containerization isolation technology, it allocates an independent execution container for each test case, ensuring the isolation and stability of the test environment. Simultaneously, it initializes a unified test execution context for each test case and establishes a communication connection with the vehicle network bus simulation engine through a standardized interface, achieving standardization and normalization of operations such as message sending and receiving, fault injection, and assertion verification. In variable management, it adopts a copy-on-write mechanism to achieve isolated sharing of project variables, avoiding data crosstalk. Furthermore, it collects test data in real time, generates structured reports, and outputs real-time event streams, enabling comprehensive monitoring and traceability of the testing process.

[0005] To solve the above-mentioned technical problems, the present invention provides the following technical solution: On one hand, a method for online editing and parallel execution of vehicle network test cases, the method comprising: S1: Loads the test project configuration, parses the vehicle communication protocol definition file, automatically generates standardized protocol message class code, builds a web-based visual online editing environment, and provides real-time syntax checking, code completion and intelligent prompting services; S2: Analyze test case dependencies to build an execution plan, adaptively switch between sequential and parallel execution modes based on execution mode parameters, and allocate independent execution containers for each test case based on containerization isolation technology; S3: Initializes a unified test execution context for a single test case, establishes a communication connection with the vehicle network bus simulation engine, and completes message sending and receiving, fault injection, assertion verification, and structured recording of test steps through standardized interfaces; S4: Load project-level shared variables and use a copy-on-write mechanism to generate an independent copy of the variables for each test case, achieving complete isolation of the runtime environment between different test cases; S5: Real-time acquisition of test step-level execution data, generation of enhanced HTML structured test report after test completion, and output of the entire real-time test execution event flow in JSON format; S6: After the test is completed, automatically clean up container resources, fault injection rules and variable copies, summarize test results and complete test case version archiving.

[0006] Furthermore, in S1, it supports parsing vehicle protocol files in DBC, LDF, and ARXML formats to generate Python protocol message classes containing message IDs, signal fields, data types, and value ranges.

[0007] Furthermore, in S2, all test cases in the test project are traversed and scanned to extract the dependency configuration information of each test case. Based on a directed acyclic graph, the test cases are topologically sorted. The priority of each test case is quantified using the execution priority calculation formula of the topological sorting, defining the logical order of test case execution. Preset execution mode parameters are read, and the system automatically switches between sequential and parallel execution modes based on the parameter values. If the parameters indicate sequential execution mode, the test cases are scheduled and executed sequentially according to the topologically sorted list. An independent container is created for each test case and run serially. The execution status is monitored in real time, and failed test cases can be processed according to the configuration. The strategy triggers a retry; if the parameters determine that it is a parallel execution mode, the system combines the preset maximum number of parallel executions with the current CPU and memory resource usage of the server, and allocates dedicated resources to each container using the container parallel resource quota allocation calculation formula. It dynamically creates a thread pool or process pool of appropriate size, evenly distributes test cases without dependency conflicts to each execution unit, and builds a completely isolated execution environment for each test case using Docker containerization technology, limits container resource quotas to prevent resource preemption, and uniformly configures an execution timeout threshold for all parallel test cases. If the timeout occurs, the execution will be automatically terminated and the status will be marked. After the test case is completed, the container will be destroyed immediately to release resources.

[0008] Furthermore, in S2, the priority of each test case is quantified and calculated using the test case topology sorting execution priority calculation formula, thus defining the logical order of test case execution. The calculation formula is as follows: ,in, It represents the execution priority of the i-th test case; the larger the value, the higher the execution priority. is the dependency level between the i-th test case and its dependent test case j, which is 0 when there is no dependency; n is the total number of dependent test cases of the i-th test case. It is the basic priority constant, with a default value of 1 for use cases without dependencies, and is used to unify the baseline priority.

[0009] Furthermore, in step S2, dedicated resources are allocated to each container using a container parallel resource quota allocation calculation formula, the formula of which is: ,in, Execute the container's resource quota for the k-th test case. Total available computing resources for the server; To preset the maximum number of concurrent executions, This is the resource weight coefficient for the k-th test case. The value is 1 for regular test cases and 1.2-1.5 for high-load test cases.

[0010] Furthermore, in S3, when a single test case is started, a unified test execution context is initialized for it. This context has a built-in log recorder, test step manager, independent copy of project variables, and vehicle network bus simulation engine communication client. After the basic context configuration is completed, a stable communication connection is established with the vehicle network bus simulation engine through a standardized handshake protocol. Test node registration, communication channel subscription and message definition synchronization are completed in sequence, and communication parameters such as node identifier and channel information are obtained.

[0011] Furthermore, in S3, based on the standardized interface encapsulated in the context, test cases can directly call the message sending and receiving interface to complete the sending of vehicle network messages and conditional waiting for reception. It supports specifying timeout time and message filtering rules. Through the fault injection interface, fault rules for signal lag, signal distortion, communication delay, and communication packet loss can be dynamically configured and cleared with one click. Based on the assertion verification interface, multi-dimensional automated verification of numerical equality, range judgment, and Boolean verification is completed. When the assertion fails, the actual value and expected value are automatically captured and detailed information is recorded. At the same time, the entire test process is marked through the test step structured recording interface, recording the name, start and end time, execution status, and auxiliary data of each step to form a traceable step chain.

[0012] Furthermore, in step S4, the pre-set project-level shared variable configuration of the test project is loaded, and the information of variable grouping, name, data type, initial value, and value range is parsed and configuration verification is completed. Before each test case is started, a dedicated independent variable copy is generated for the test case based on the copy-on-write mechanism. The actual data copy is triggered only when the test case performs a write operation on the variable for the first time. The variable copy is completely independent of the original shared variable and the copies of other test cases, and belongs only to the execution context of the current test case. During the execution of the test case, the operations of reading, modifying, and assigning values ​​to the variable only apply to its own copy, without changing the original shared variable, and without interfering with the variable data of other test cases. After the test case is executed, the corresponding variable copy is automatically destroyed, releasing memory resources and leaving no data, thus achieving complete isolation of the different test case running environments at the variable level.

[0013] On the other hand, a vehicle network test case online editing and parallel execution system is provided, the system comprising: an online test case editing module, a test case parallel execution scheduling module, a test execution context management module, a project variable management and isolation module, and a structured test report generation module; The online test case editing module provides a web-based code editing environment, parses protocol files to automatically generate message class code, and implements syntax verification, code completion, and intelligent suggestions. The test case parallel execution scheduling module is used to traverse and scan test cases and extract dependencies. It constructs an execution plan based on the topological sorting of the directed acyclic graph, adaptively switches the order and parallel execution mode, and uses Docker containerization technology to allocate independent execution containers for test cases and realize resource management and container reuse. The test execution context management module is used to initialize a unified execution context for a single test case, establish a communication connection with the vehicle network bus simulation engine, and complete message sending and receiving, fault injection, assertion verification and structured recording of test steps through a standardized interface. The project variable management and isolation module is used to load project-level shared variables and complete configuration verification. It uses a copy-on-write mechanism to generate independent variable copies for test cases and automatically destroys the copies after execution to achieve environment isolation. The structured test report generation module is used to collect execution data and generate HTML reports and JSON real-time event streams.

[0014] Compared with existing technologies, this method and system for online editing and parallel execution of vehicle network test cases has the following advantages: This invention introduces two core algorithms: test case dependency topology sorting and container parallel resource quota allocation. These algorithms enable precise control of test case dependencies and quantitative allocation of container resources, effectively improving scheduling efficiency. By building a zero-configuration web-based online editing environment with integrated intelligent syntax checking and code completion, and automatically generating vehicle protocol message code, it changes the traditional model of test case development relying on local development and manual protocol code writing, reducing errors in script writing. Furthermore, by managing test case dependencies and combining them with Docker containerization isolation technology, it enables parallel execution of multiple test cases. Test duration can be linearly reduced with the number of parallel executions, efficiently adapting to large-scale environments. In regression testing and continuous integration scenarios, it significantly improves testing efficiency. Employing a dual mechanism of container environment isolation and copy-on-write variable isolation, it effectively isolates execution interference from different test cases at the underlying level, ensuring uncontaminated test data and reproducible test results. Simultaneously, it unifies the test execution context and standardizes interfaces, achieving deep collaboration with the vehicle network bus simulation engine and covering the full-scenario automated testing needs of multi-protocol vehicle networks. Furthermore, by outputting JSON-formatted event streams in real time and generating enhanced HTML structured test reports, it achieves real-time monitoring and full-process traceability of the testing process, significantly improving problem localization efficiency and providing comprehensive technical support for vehicle ECU network testing.

[0015] Other advantages, objectives and features of the invention will be set forth in part in the description which follows, and in part will be apparent to those skilled in the art from the following examination or study, or may be learned from the practice of the invention. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are merely some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without any creative effort.

[0017] Figure 1 A flowchart illustrating a method for online editing and parallel execution of vehicle network test cases; Figure 2 A flowchart of step S2 in a method for online editing and parallel execution of vehicle network test cases; Figure 3 This is a block diagram of an online editing and parallel execution system for vehicle network test cases. Detailed Implementation

[0018] To further illustrate the technical means and effects of the present invention in achieving its intended purpose, the following detailed description of the specific implementation methods, structures, features, and effects of the present invention, in conjunction with the accompanying drawings and preferred embodiments, is provided below.

[0019] The purpose of this invention is to overcome the shortcomings of existing technologies by providing a method and system for online editing and parallel execution of vehicle network test cases. It establishes an online editing environment via a web interface, enabling automatic generation of protocol code and providing testers with a convenient and efficient development experience. Regarding test case execution, it accurately analyzes the dependencies of test cases, uses a topology sorting algorithm to construct a reasonable execution plan, and adaptively switches between sequential and parallel execution modes. Combined with containerization isolation technology, it allocates an independent execution container for each test case, ensuring the isolation and stability of the test environment. Simultaneously, it initializes a unified test execution context for each test case and establishes a communication connection with the vehicle network bus simulation engine through a standardized interface, achieving standardization and normalization of operations such as message sending and receiving, fault injection, and assertion verification. In variable management, it adopts a copy-on-write mechanism to achieve isolated sharing of project variables, avoiding data crosstalk. Furthermore, it collects test data in real time, generates structured reports, and outputs real-time event streams, enabling comprehensive monitoring and traceability of the testing process.

[0020] like Figure 1As shown, after the test management platform starts up, it automatically loads the system's basic configuration and receives the overall configuration of the test project imported by the user. It loads and double-verifies basic parameters such as bus type, execution strategy, reporting rules, resource thresholds, and timeout time to ensure that the configuration is legal and valid. The platform has a built-in protocol parsing component that is compatible with multiple standards. It can automatically identify and batch parse vehicle communication protocol definition files in DBC, LDF, and ARXML formats. It accurately extracts core protocol information in all dimensions, such as message identifiers, signal bit definitions, data encoding formats, physical value conversion parameters, legal value ranges, and node information. It automatically generates Python protocol message class code that can be directly called according to a unified coding standard. The code has built-in standardized logic for message encapsulation, parsing, verification, and conversion, eliminating the need for manual writing of underlying communication code and significantly reducing development costs.

[0021] The platform builds a web-based visual online editing environment accessible through a browser, integrating a professional code editing kernel to provide full-featured script editing services. It supports the creation, editing, saving, deletion, version comparison, rollback, and group management of test cases, while also supporting collaborative editing by multiple users.

[0022] The editing environment runs a real-time syntax checking service, providing instant annotation and intelligent suggestions for script syntax errors, illegal calls to protocol fields, abnormal parameter formats, and undefined variables. It also integrates with the protocol database to provide intelligent auxiliary functions such as keyword completion, signal field association, function parameter suggestions, and usage examples, further lowering the threshold for writing test cases and improving script development efficiency and standardization.

[0023] like Figure 2 As shown, the platform automatically performs a deep scan of all test case files within the test project, supporting both manual configuration and automatic identification modes to parse the pre-dependencies, execution constraints, and associated conditions between test cases. It detects and alerts on circular dependency issues in real time, constructs a directed acyclic graph data model of test cases without circular dependencies, performs topological sorting of all test cases based on this model, eliminates execution logic conflicts, and quantifies the execution priority of each test case using the test case topological sorting execution priority calculation formula: ,in, This represents the execution priority of the i-th test case; the larger the value, the earlier it is executed. is the dependency level between the i-th test case and its dependent test case j, and takes the value of 0 when there is no dependency; n is the total number of dependent test cases of the i-th test case; This is the basic priority constant; the default value for use cases without dependencies is 1.

[0024] Based on the priority ranking results and combined with business requirements, the platform generates standardized and adjustable test case execution plans. The platform reads the execution mode parameters configured by the user and automatically completes the adaptive switching between sequential and parallel execution modes without manual intervention. Sequential execution mode: The test cases are executed serially according to the topology and priority sorting. An isolated execution container is created for each test case. After a single test case is completed and its resources are released, the execution flow of the next test case is started. During the execution process, the running status of the test cases, log output and resource usage are monitored in real time. When a test case fails, the retry operation is automatically performed according to the preset number of retries and retry interval. It supports the resumption of failed test cases, ensuring the stability and continuity of the test process.

[0025] Parallel execution mode: Based on the user-preset maximum number of parallel executions, the system monitors the server's CPU utilization, available memory, disk I / O, and other runtime resource status in real time, down to the second. It then dynamically allocates dedicated computing resources to each execution container using a container parallel resource quota allocation formula: ,in, Execute the container's resource quota for the k-th test case. Total available computing resources for the server To preset the maximum number of concurrent executions, This is the resource weight coefficient for test cases. The value is 1 for regular test cases and 1.2-1.5 for high-load computational test cases.

[0026] The platform dynamically builds an execution thread pool that adapts to the resource scale. Based on the load balancing algorithm, it evenly distributes test cases without dependency conflicts to each execution unit. Through containerization technology, it builds an independent running environment for each test case, strictly limits the upper limit of container resource usage, avoids resource contention between multiple containers, and uniformly configures a global execution timeout threshold for all parallel test cases. Test cases that exceed the threshold will be automatically terminated and marked as timeout. The container is destroyed immediately after the test case is completed, quickly releasing server computing resources. It supports dynamic scaling up and down of parallel scale to adapt to different test task requirements.

[0027] When a single test case starts running, the platform automatically initializes a standardized and unified test execution context for it. The context integrates a complete set of functional components that run independently, including logging, step management, variable management, bus communication, and exception handling. It supports persistent storage of the context and breakpoint recovery, providing a stable and unified operating foundation for test case execution.

[0028] After completing context initialization, a persistent and stable communication connection is established with the vehicle network bus simulation engine through a standardized communication handshake protocol. The built-in disconnection reconnection mechanism completes the test node identity registration, bus communication channel subscription, protocol message data synchronization, and obtains exclusive communication parameters to ensure the stability and uniqueness of test data interaction.

[0029] Test cases utilize standardized, general-purpose interfaces encapsulated in context to automate the entire testing process: The message sending and receiving interface enables precise sending and targeted receiving of vehicle bus messages, supporting custom timeout durations and multi-dimensional message filtering rules, and is compatible with various bus message formats; the fault injection interface allows for flexible configuration of various single or combined bus fault scenarios such as signal jamming, numerical distortion, communication delay, message loss, and bus interference; after testing, all fault configurations can be cleared with a single click, quickly restoring the bus to normal communication status; the assertion verification interface enables automated verification of various types, including signal value comparison, value range determination, Boolean state verification, and custom rule verification; when an assertion fails, the actual value, expected value, trigger location, and error details are automatically recorded; and the structured recording interface provides fine-grained marking of the entire testing process, fully recording the name, start and end time, execution status, interaction data, and log information of each test step, supporting attachment uploads and associations, forming a fully traceable and replayable test execution chain.

[0030] The platform loads project-level shared variables from the global configuration of the test project, supporting multiple data types such as integers, floating-point numbers, booleans, strings, and arrays. It parses complete information including variable grouping, naming rules, data type, initial value, legal value range, and usage permissions, automatically performing compliance checks on variable configurations and filtering invalid configurations and incorrectly formatted variables to ensure variable usability and security. Before each test case is formally executed, the platform uses a copy-on-write mechanism to generate a dedicated, independent copy of the variable. Initially, the copy shares storage resources with the shared variable; data copying is only triggered when the test case first performs a variable write operation, generating independently stored variable data, balancing execution efficiency and isolation.

[0031] This variable copy belongs solely to the execution context of the current test case. During test case execution, all variable read, modification, and assignment operations only affect this copy, without modifying the original shared variables or interfering with the variable data of other test cases, thus preventing data crosstalk between test cases. After test case execution, the platform supports both scheduled and forced cleanup modes, automatically destroying the corresponding variable copy, releasing memory storage resources, and leaving no residual data. This achieves complete isolation of all test case execution environments at the data level, ensuring test data security.

[0032] The platform deploys a high-precision real-time data acquisition component, taking the test step as the smallest acquisition unit. It collects all test data throughout the process, including test case execution status, bus message data, fault injection logs, assertion verification results, execution time statistics, and resource usage data. It supports both real-time reporting and local caching modes to ensure that no data is lost.

[0033] After all test tasks are completed, the platform automatically summarizes all collected data and generates an enhanced HTML structured test report. The report covers complete content such as basic project information, test case execution statistics, failure test case tracing, fault scenario records, assertion error details, execution sequence analysis, and resource usage trends. It also includes built-in visual charts such as pie charts and line charts, and supports data filtering, searching, online viewing, and export to PDF and Excel formats.

[0034] Simultaneously, the platform generates a full-process test execution event stream in JSON format, fully recording the timestamp, event type, and data content of each execution node. It supports real-time streaming output and can seamlessly connect with third-party test management platforms, data analysis systems, and monitoring platforms to meet the needs of secondary data analysis and batch management.

[0035] After all test tasks are terminated, the platform performs an automated full resource cleanup operation, supporting both batch cleanup and incremental cleanup modes: batch destroys the execution containers corresponding to all test cases, clears all runtime data and cache files within the containers; clears all fault injection rules configured in the bus simulation engine, and restores the bus to its initial communication state; and batch destroys all test case variable copies, releasing server memory and storage resources.

[0036] The platform automatically aggregates the execution results of all test cases, and statistically analyzes key indicators such as test pass rate, failure rate, timeout rate, and average execution time. According to preset version management rules, it uniformly packages test case scripts, configuration files, test reports, and event stream data, and archives them into the project version repository by project, time, and version number. It supports quick retrieval, download, reuse, and comparison of historical versions, and realizes standardized and regulated management of the entire testing process.

[0037] like Figure 3 As shown, the online editing and parallel execution system for vehicle network test cases provided by the present invention includes: an online test case editing module, a test case parallel execution scheduling module, a test execution context management module, a project variable management and isolation module, and a structured test report generation module; The online test case editing module provides a visual web-based editing service, supports multi-user collaborative operation and permission management, completes batch parsing and processing of vehicle protocol files, automatically generates standardized protocol message class code, and implements real-time syntax verification, intelligent code completion, keyword suggestions, and usage example display functions for test scripts. It also supports test case group management, version control, online preview, and full lifecycle online development.

[0038] The test case parallel execution scheduling module is responsible for deep scanning of all test cases and automatic resolution of dependencies. It supports manual configuration of dependency rules, performs topology sorting and execution priority calculation based on a directed acyclic graph, builds a standardized and adjustable execution plan, and adaptively switches between sequential and parallel execution modes. It relies on containerization technology to realize the creation of execution containers, dynamic resource configuration, real-time monitoring of running status, anomaly alarms and automatic destruction. Combined with load balancing algorithms, it achieves efficient scheduling of test cases and fine-grained resource management.

[0039] The test execution context management module is responsible for initializing a standardized and persistent execution context for each test case, establishing a stable communication connection with the vehicle network bus simulation engine and supporting reconnection after disconnection, encapsulating standardized interfaces for all types of message sending and receiving, fault injection, assertion verification, step recording, and exception capture, and being compatible with multiple vehicle bus protocols. It supports the automated and standardized execution of test cases and the traceable recording of data throughout the entire process.

[0040] The project variable management and isolation module is responsible for loading, parsing, classifying, and verifying the compliance of project-level shared variables. It supports the management of variables of various data types and uses a copy-on-write mechanism to generate an independent variable copy for each test case. After execution, the variable copy is automatically and securely destroyed, achieving complete isolation of the runtime environment between test cases at the data level and preventing data crosstalk and data leakage issues.

[0041] The structured test report generation module is responsible for the real-time collection, caching, and integrity verification of data at each step of the entire test process. It automatically summarizes test data to generate HTML structured test reports containing visual charts, supports export in multiple formats, and synchronously outputs the entire process execution event flow in JSON format with real-time push support. This meets the diverse needs of online viewing, exporting, third-party integration, in-depth analysis, and visualization of test data.

[0042] In the typical application scenario of testing the interaction function between the vehicle CAN bus instrument cluster and the body controller, it is necessary to verify the transmission and instrument display functions of light signals, door status, and vehicle speed signals in the bus. There are 12 test cases in total, with 3 sets of dependencies, and parallel execution is supported.

[0043] Testers uploaded the vehicle CAN bus DBC protocol file through the online editing module on the web interface. The platform automatically parsed the protocol messages and signal definitions, generated Python protocol message class code, and testers wrote 12 test cases online, including low beam headlight status verification, door opening and closing feedback, real-time vehicle speed signal update, and instrument response under bus packet loss fault. During the editing process, the platform completed syntax verification and protocol field prompts in real time to ensure that the test case scripts were compliant.

[0044] The platform scans 12 test cases, parses out two sets of dependencies: the low beam headlight test depends on the body controller initialization test case, and the door status test depends on the bus connection test case. It constructs a directed acyclic graph and completes topological sorting. It calculates the execution priority of each test case using a priority formula, configures a parallel execution mode, sets the maximum number of parallel executions to 6, monitors server resources in real time, allocates balanced resource quotas to each container, assigns the 8 test cases without dependencies to the parallel thread pool, and schedules the 4 test cases with dependencies sequentially.

[0045] When each test case starts, the platform initializes an independent test context, establishes a connection with the CAN bus simulation engine, registers instrument nodes and body control nodes, and during execution, the test case calls the message sending and receiving interface to send body status messages, calls the fault injection interface to simulate 10% packet loss and signal jamming faults, and calls the assertion interface to verify that the instrument display values ​​are consistent with the bus signal values. At the same time, the test steps and message data are recorded throughout the process.

[0046] The platform loads shared variables for the project (such as bus baud rate, fault injection probability, and vehicle speed threshold), and uses a copy-on-write mechanism to generate independent variable copies for 12 test cases. Modifying parameters such as fault probability and threshold during test case execution will not affect the original shared variables and other test cases, thus completely avoiding test errors caused by data crosstalk.

[0047] After the test is completed, the platform collects the execution data of all test cases, generates an HTML test report, and intuitively displays the pass rate of 12 test cases, details of failed test cases, bus interaction sequence diagram, and outputs JSON execution event stream for the test platform to connect and analyze.

[0048] The platform automatically destroys all execution containers, clears fault injection rules, destroys variable copies, releases all resources, and archives the test case scripts, DBC files, and test reports by version number, retaining a complete record of the interaction test between the instrument and the body controller for this batch of tests, facilitating subsequent reproduction and traceability.

[0049] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the present invention. Any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the scope of the present invention.

Claims

1. A method for online editing and parallel execution of vehicle network test cases, characterized in that, The method includes: S1: Loads the test project configuration, parses the vehicle communication protocol definition file, automatically generates standardized protocol message class code, builds a web-based visual online editing environment, and provides real-time syntax checking, code completion and intelligent prompting services; S2: Analyze test case dependencies to build an execution plan, adaptively switch between sequential and parallel execution modes based on execution mode parameters, and allocate independent execution containers for each test case based on containerization isolation technology; S3: Initializes a unified test execution context for a single test case, establishes a communication connection with the vehicle network bus simulation engine, and completes message sending and receiving, fault injection, assertion verification, and structured recording of test steps through standardized interfaces; S4: Load project-level shared variables and use a copy-on-write mechanism to generate an independent copy of the variables for each test case, achieving complete isolation of the runtime environment between different test cases; S5: Real-time acquisition of test step-level execution data, generation of enhanced HTML structured test report after test completion, and output of the entire real-time test execution event flow in JSON format; S6: After the test is completed, automatically clean up container resources, fault injection rules and variable copies, summarize test results and complete test case version archiving.

2. The method for online editing and parallel execution of vehicle network test cases according to claim 1, characterized in that, In S1, it supports parsing vehicle protocol files in DBC, LDF, and ARXML formats to generate Python protocol message classes containing message ID, signal fields, data types, and value ranges.

3. The method for online editing and parallel execution of vehicle network test cases according to claim 1, characterized in that, In S2, all test cases in the test project are traversed and scanned, the dependency and association configuration information of each test case is extracted, the test cases are sorted topologically based on the directed acyclic graph, and the priority of each test case is quantitatively calculated by the test case topological sorting execution priority calculation formula to define the execution order logic of the test cases. The system reads preset execution mode parameters and automatically switches between sequential and parallel execution modes based on the parameter values. If the parameters indicate sequential execution, the system schedules execution sequentially according to the topology-sorted test case list, creating an independent container for each test case and running it serially. The system monitors the execution status in real time, and failed test cases can be retried according to the configured policy. If the parameters indicate parallel execution, the system combines the preset maximum number of parallel executions with the current CPU and memory resource usage of the server, and allocates dedicated resources to each container using the container parallel resource quota allocation formula. It dynamically creates thread pools or process pools of appropriate size, evenly distributing test cases without dependency conflicts to each execution unit. Through containerization technology, it builds a completely isolated execution environment for each test case, limits container resource quotas to prevent resource preemption, and uniformly configures execution timeout thresholds for all parallel test cases. If a timeout occurs, execution is automatically terminated and the status is marked. After the test case is completed, the container is destroyed immediately to release resources.

4. The method for online editing and parallel execution of vehicle network test cases according to claim 3, characterized in that, In step S2, the priority of each test case is quantified and calculated using the test case topology sorting execution priority calculation formula, thus defining the logical sequence of test case execution. The calculation formula is as follows: ,in, It represents the execution priority of the i-th test case; the larger the value, the higher the execution priority. is the dependency level between the i-th test case and its dependent test case j, which is 0 when there is no dependency; n is the total number of dependent test cases of the i-th test case. It is the basic priority constant, with a default value of 1 for use cases without dependencies, and is used to unify the baseline priority.

5. The method for online editing and parallel execution of vehicle network test cases according to claim 3, characterized in that, In step S2, dedicated resources are allocated to each container using a container parallel resource quota allocation calculation formula, which is as follows: ,in, Execute the container's resource quota for the k-th test case. Total available computing resources for the server; To preset the maximum number of concurrent executions, For the first The resource weight coefficient for each test case is set to 1 for regular test cases and 1.2-1.5 for high-load test cases.

6. The method for online editing and parallel execution of vehicle network test cases according to claim 1, characterized in that, In S3, when a single test case is started, a unified test execution context is initialized. This context has a built-in log recorder, test step manager, independent copy of project variables, and vehicle network bus simulation engine communication client. After the basic context configuration is completed, a stable communication connection is established with the vehicle network bus simulation engine through a standardized handshake protocol. Test node registration, communication channel subscription and message definition synchronization are completed in sequence, and communication parameters such as node identifier and channel information are obtained.

7. The method for online editing and parallel execution of vehicle network test cases according to claim 1, characterized in that, In S3, based on the standardized interface encapsulated in the context, test cases can directly call the message sending and receiving interface to complete the sending of vehicle network messages and conditional waiting for reception. It supports specifying timeout time and message filtering rules. Through the fault injection interface, fault rules for signal lag, signal distortion, communication delay, and communication packet loss can be dynamically configured and cleared with one click. Based on the assertion verification interface, multi-dimensional automated verification of numerical equality, range judgment, and Boolean verification is completed. When the assertion fails, the actual value and expected value are automatically captured and detailed information is recorded. At the same time, the entire test process is marked through the test step structured recording interface, recording the name, start and end time, execution status, and auxiliary data of each step to form a traceable step link.

8. The method for online editing and parallel execution of vehicle network test cases according to claim 1, characterized in that, In step S4, the pre-set project-level shared variable configuration of the test project is loaded, and the information of variable grouping, name, data type, initial value, and value range is parsed and configuration verification is completed. Before each test case is started, a dedicated independent variable copy is generated for the test case based on the copy-on-write mechanism. The actual data copy is triggered only when the test case performs a write operation on the variable for the first time. The variable copy is completely independent of the original shared variable and the copies of other test cases, and belongs only to the execution context of the current test case. During the execution of the test case, the operations of reading, modifying, and assigning values ​​to the variable only apply to its own copy, without changing the original shared variable, and without interfering with the variable data of other test cases. After the test case is executed, the corresponding variable copy is automatically destroyed, releasing memory resources and leaving no data, thus achieving complete isolation of the different test case running environments at the variable level.

9. A system for online editing and parallel execution of vehicle network test cases, the system being applicable to the method for online editing and parallel execution of vehicle network test cases as described in any one of claims 1-8, characterized in that, The system includes: an online test case editing module, a test case parallel execution scheduling module, a test execution context management module, a project variable management and isolation module, and a structured test report generation module; The online test case editing module provides a web-based code editing environment, parses protocol files to automatically generate message class code, and implements syntax verification, code completion, and intelligent suggestions. The test case parallel execution scheduling module is used to traverse and scan test cases and extract dependencies. It constructs an execution plan based on the topological sorting of the directed acyclic graph, adaptively switches the order and parallel execution mode, and uses Docker containerization technology to allocate independent execution containers for test cases and realize resource management and container reuse. The test execution context management module is used to initialize a unified execution context for a single test case, establish a communication connection with the vehicle network bus simulation engine, and complete message sending and receiving, fault injection, assertion verification and structured recording of test steps through a standardized interface. The project variable management and isolation module is used to load project-level shared variables and complete configuration verification. It uses a copy-on-write mechanism to generate independent variable copies for test cases and automatically destroys the copies after execution to achieve environment isolation. The structured test report generation module is used to collect execution data and generate HTML reports and JSON real-time event streams.