Embedded software test verification method and system based on virtual simulation environment
By adopting an embedded software testing and verification method based on a virtual simulation environment, the limitations of existing tools in terms of functional coverage, real-time performance, and scalability are overcome. This method enables efficient and accurate testing and verification throughout the entire lifecycle, reduces costs, and supports seamless portability of test cases.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-03
- Publication Date
- 2026-03-24
AI Technical Summary
Existing embedded software testing and verification tools have limitations in terms of functional coverage, real-time performance, resource consumption, system support, rapid deployment, and scalability, making it difficult to meet the needs of efficient and accurate testing and verification.
An embedded software testing and verification method based on a virtual simulation environment is adopted. Virtual embedded boards are configured through distributed nodes and deployed in a containerized manner. Combined with time synchronization mechanism, blueprint design, communication middleware and visual monitoring, a fully digital testing and verification environment is built to support testing and verification throughout the entire life cycle.
It improves the accuracy and efficiency of test results, supports full lifecycle testing and verification, reduces costs, ensures that test cases can be seamlessly ported to real hardware environments, and enables the reuse of test resources.
Smart Images

Figure CN121722682A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of embedded software development technology, and in particular to an embedded software testing and verification method and system based on a virtual simulation environment. Background Technology
[0002] In embedded software development, testing and verification are crucial for ensuring software quality. However, traditional testing methods rely on real hardware environments, resulting in high costs, low efficiency, and difficulty in comprehensively covering all test scenarios. This is especially true for complex embedded systems, where frequent hardware environment switching may be necessary, leading to customization challenges and ultimately, inefficiency. Therefore, developing a highly efficient, reliable, flexible, and scalable fully digital testing and verification method that supports the entire lifecycle of embedded software is of paramount importance.
[0003] Currently, some virtual simulation tools on the market attempt to address the aforementioned issues, but certain limitations still exist in the field of embedded software testing and verification. First, these tools perform poorly in terms of real-time performance, failing to accurately simulate the real-time behavior of various processors and operating systems in embedded systems, leading to discrepancies between test results and actual operating environments. Second, these tools often only meet the needs of certain levels of testing and verification, such as unit testing, integration testing, or system testing, and cannot cover the entire lifecycle. Finally, some tools are overly customized, resulting in insufficient scalability, a large workload for porting, and difficulty in adapting to the needs of various software and hardware platforms in different systems.
[0004] For example, SpecChecker is mainly used for static analysis of embedded software code and has relatively limited functionality; SunWiseUnit focuses on unit testing and integration testing of embedded software, and its advantage lies only in the fact that users can quickly and easily create test cases; VisionBUS is mainly for machine vision applications, requiring direct connection to cameras or image sensors and relying on a dedicated SDK, with high requirements for hard real-time performance (such as triggering synchronization); virtualization testing tools such as Docker are mainly for software-level isolation, making it difficult to simulate embedded hardware (such as specific processors, peripheral interfaces, etc.) and lacking strong real-time performance; VMware consumes high resources and has a long virtual machine startup time, making it unsuitable for testing scenarios that require rapid iteration, etc.
[0005] In summary, existing embedded software testing and verification tools have certain limitations in terms of functional coverage, real-time performance, resource consumption, system support, rapid deployment, and scalability, making it difficult to meet the needs of some industries that require highly customized, efficient, and accurate testing and verification. Summary of the Invention
[0006] To address the aforementioned issues, this invention proposes an embedded software testing and verification method and system based on a virtual simulation environment. This method enables the rapid construction of a fully digital virtual simulation testing and verification environment that matches the hardware functions of a real embedded system, allowing software testers to quickly conduct one-stop testing and verification and software quality assessment activities throughout the entire lifecycle of various embedded software.
[0007] The technical solution adopted in this invention is as follows: An embedded software testing and verification method based on a virtual simulation environment includes: Based on the testing requirements, virtual embedded boards are configured and containerized through distributed nodes, and a time synchronization mechanism is used to keep the virtual embedded boards on each distributed node in sync. Based on the blueprint design, the interconnection relationship of each application software system is constructed and the configuration file is generated. The software configuration items, external interfaces and functional modules of the embedded software system under test are then deployed. Data communication between distributed nodes based on multiple bus protocols is performed through communication middleware; Simulate external excitation signals to input into a virtual simulation environment to verify data input excitation for embedded software; Collect and store bus data during the testing process, analyze and evaluate the data, and visualize and monitor the testing process.
[0008] Furthermore, the configuration of virtual embedded boards through distributed nodes and containerized deployment includes: deploying distributed nodes using microservices, automatically allocating hardware resources for each node through load balancing, dividing different services into independent modules, and decoupling code from deployment.
[0009] Furthermore, the step of configuring virtual embedded boards and deploying them in a containerized manner through distributed nodes also includes: configuring node information through a visual interface, automatically generating deployment scripts based on the node information configuration, and realizing automatic deployment of each distributed node.
[0010] Furthermore, the simulated external excitation signal is connected to the virtual simulation environment, including: Process interface modeling: Construct an interface model between application software and digital objects, construct static interface testing and dynamic testing models, and construct a process model between application software and digital objects; Functional module modeling: Construct a controller model and keep it consistent with the actual external sensor bus of the embedded system. The controller types in the controller model include CAN controller, Ethernet controller, serial port controller and SRIO controller.
[0011] Furthermore, in step S5, the process of collecting and storing bus data during the test, parsing and evaluating the data, and visually monitoring the test process includes: collecting semi-physical environment data and virtual bus data, and classifying and storing them according to the original data and the parsed data; being able to set filtering conditions based on the English or Chinese names of the interface control files to filter the interface control files to be monitored; and adding a data playback function to enable data analysis and processing without the test card.
[0012] An embedded software testing and verification system based on a virtual simulation environment includes: The distributed deployment module is configured to configure virtual embedded boards through distributed nodes and deploy them in a containerized manner according to test requirements, and to keep the virtual embedded boards on each distributed node in sync through a time synchronization mechanism. The blueprint deployment module is configured to design and build the interconnection relationships of various application software systems based on the blueprint and generate configuration files to deploy the software configuration items, external interfaces and functional modules of the embedded software system under test. The communication middleware module is configured to perform data communication between distributed nodes based on multiple bus protocols; The performance incentive and evaluation module is configured to simulate external incentive signals to access the virtual simulation environment and perform data input incentive verification on the embedded software. The visualization monitoring module is configured to collect and store bus data during the testing process, parse and evaluate the data, and provide visualization monitoring of the testing process.
[0013] Furthermore, the communication middleware module adopts the DDS communication protocol, encapsulates the application programming interface of the DDS communication protocol and defines a general data format to form a general interface for the distributed simulation system; it utilizes the cross-platform and multi-language characteristics and publish-subscribe data transmission strategy of the DDS communication protocol to perform communication interaction between simulation resources and single or multiple digital boards and external stimuli.
[0014] Furthermore, the performance incentive and evaluation module is built using a B / S model, supporting simultaneous use by multiple clients. The workflow includes configuration initialization, data collection, data parsing and evaluation, data storage, and data query.
[0015] Furthermore, the visualization monitoring module includes: The real-time data acquisition unit is configured to acquire bus data from each device in real time via communication middleware and supports playback control. The fault detection and alarm unit is configured to detect potential problems and generate corresponding alarms by analyzing the behavior of the data stream in real time. The performance evaluation unit is configured to evaluate the performance of the bus, including latency, bandwidth usage, and message transmission throughput.
[0016] Furthermore, the visualization monitoring module also includes: The statistics and logging unit is configured to generate test verification logs and perform statistical analysis and categorized display. The data quality assessment unit is configured to perform preset checks on the transmitted data to assess whether the transmitted data meets the corresponding requirements; the preset checks include integrity, accuracy, and format correctness checks; The throughput and bandwidth assessment unit is configured to monitor data throughput and bandwidth usage in real time through the communication middleware.
[0017] The beneficial effects of this invention are as follows: 1) This invention highly simulates real hardware through a virtual simulation environment, which can ensure the accuracy of test results. The embedded software testing and verification system of this invention supports quick switching between simulation and real environments without affecting the testing process.
[0018] 2) This invention supports full lifecycle testing and verification of embedded software, including unit testing, integration testing, acceptance testing and system testing, which can meet the testing needs of different stages and improve testing efficiency.
[0019] 3) The embedded software testing and verification system of the present invention can automatically generate test cases and perform coverage analysis, including statements, branches and MCD, to ensure the comprehensiveness of the test.
[0020] 4) This invention establishes a comprehensive quality assessment system through various evaluation indicators, such as code coverage and defect density, which can provide data support for software optimization.
[0021] In summary, this invention solves the problems of high cost in setting up embedded software testing and verification environments and lack of supporting stimulus data. It enables a fully digital embedded software testing and verification environment, and test cases can be seamlessly ported to real hardware environments for testing and verification, achieving test resource reuse, accumulating test assets, and reducing human and material costs. It also ensures pre-development verification of embedded software, enables layered and graded testing, and realizes fully digital test stimulus verification and quality assessment functions for embedded software. Attached Figure Description
[0022] Figure 1 This is a flowchart of an embedded software testing and verification method based on a virtual simulation environment, according to Embodiment 1 of the present invention.
[0023] Figure 2 This is a framework diagram of an embedded software testing and verification system based on a virtual simulation environment, according to Embodiment 3 of the present invention.
[0024] Figure 3 This is a process interface modeling business process diagram of Embodiment 3 of the present invention.
[0025] Figure 4 This is a schematic diagram of the interaction of the functional module model in Embodiment 3 of the present invention.
[0026] Figure 5 This is an overall structural diagram of the incentive evaluation function in Embodiment 3 of the present invention.
[0027] Figure 6 This is a flowchart of the incentive evaluation process in Embodiment 3 of the present invention.
[0028] Figure 7 This is a screenshot of the blueprint design interface of Embodiment 3 of the present invention.
[0029] Figure 8 This is a schematic diagram of the communication network between processing boards in Embodiment 3 of the present invention.
[0030] Figure 9 This is a schematic diagram of the interaction between communication components in Embodiment 3 of the present invention. Detailed Implementation
[0031] To provide a clearer understanding of the technical features, objectives, and effects of the present invention, specific embodiments are now described. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention; that is, the described embodiments are only a part of the embodiments of the invention, not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0032] Example 1 like Figure 1 As shown, this embodiment provides an embedded software testing and verification method based on a virtual simulation environment, including: Based on the testing requirements, virtual embedded boards are configured and containerized through distributed nodes, and a time synchronization mechanism is used to keep the virtual embedded boards on each distributed node in sync. Based on the blueprint design, the interconnection relationship of each application software system is constructed and the configuration file is generated. The software configuration items, external interfaces and functional modules of the embedded software system under test are then deployed. Data communication between distributed nodes based on multiple bus protocols is performed through communication middleware; Simulate external excitation signals to input into a virtual simulation environment to verify data input excitation for embedded software; Collect and store bus data during the testing process, analyze and evaluate the data, and visualize and monitor the testing process.
[0033] The specific implementation process of the embedded software testing and verification method in this embodiment is as follows.
[0034] 1. Distributed node configuration, containerized deployment, and time synchronization In this embodiment, virtual embedded boards are configured and containerized by distributed nodes, and a time synchronization mechanism is used to keep the virtual embedded boards of each distributed node in sync.
[0035] Specifically, firstly, based on the testing scenarios and scale requirements of the embedded software, suitable distributed node resources are selected. For the hardware functions required by different testing tasks, virtual embedded boards with corresponding functions are configured in each node, covering core hardware features such as processor simulation and peripheral interface simulation. Then, containerization technology is used to encapsulate the virtual boards and their supporting runtime environment into standardized containers. Container orchestration tools are used to achieve rapid deployment and flexible scheduling of containers on each node. At the same time, a unified time synchronization mechanism is introduced to ensure that the virtual boards in the containers of each distributed node follow the same time base, ensuring the timing consistency of cross-node data interaction and collaborative simulation.
[0036] It should be noted that the above method enables the rapid setup and elastic scaling of the virtual testing environment through containerized deployment, avoiding the cumbersome process of traditional hardware environment setup; the time synchronization mechanism solves the problem of test result distortion caused by timing deviations between distributed nodes, laying the foundation for subsequent cross-node collaborative testing and ensuring the timing consistency between the virtual simulation environment and the real hardware environment.
[0037] 2. System Deployment Based on Blueprint Design In this embodiment, the interconnection relationship between various application software systems is constructed based on the blueprint design and configuration files are generated to deploy the software configuration items, external interfaces and functional modules of the embedded software system under test.
[0038] Specifically, a visual blueprint design tool is first used to outline the interconnection logic between the embedded software under test and external related systems, as well as the internal functional modules, clarifying data interaction paths, interface protocol specifications, and module dependencies. Based on this blueprint, a standardized configuration file is automatically generated, clearly defining the deployment parameters of software configuration items, adaptation rules for external interfaces, and operating thresholds for functional modules. Then, following the guidance of the configuration file, each component of the software under test is precisely deployed to the corresponding virtual embedded board, completing the automatic association and interface adaptation between modules without the need for manual configuration one by one.
[0039] It should be noted that blueprint-based design simplifies the deployment process of complex systems and reduces the error rate of manual configuration. The generation of standardized configuration files enables the test environment to have good reusability and portability, which can quickly adapt to the testing needs of embedded software with different architectures, while ensuring the consistency of the deployment of each module and interface, providing a stable basic environment for full lifecycle testing.
[0040] 3. Distributed node data communication based on communication middleware In this embodiment, data communication between distributed nodes based on multiple bus protocols is performed through a communication middleware.
[0041] Specifically, the communication middleware pre-integrates the adaptation capabilities of multiple mainstream bus protocols, including but not limited to CAN, Ethernet / IP, RS485, and other commonly used protocols in embedded systems. When distributed nodes need to exchange data, the virtual board of the sending node encapsulates the data according to the specified protocol format and performs protocol conversion and data forwarding through the communication middleware. The communication middleware of the receiving node parses the adapted data and transmits it to the corresponding virtual board, realizing seamless data exchange between different nodes. The middleware also has data buffering and error checking functions to ensure the reliability of data transmission.
[0042] It should be noted that the above method shields the differences between different bus protocols through communication middleware, achieving unified adaptation of multiple protocols. There is no need to develop separate communication interfaces for different protocols, which improves the versatility of the system. The data forwarding and error checking mechanism ensures the efficiency and accuracy of data communication between distributed nodes, meeting the needs of multi-node collaborative data interaction in embedded software testing.
[0043] 4. External excitation signal simulation and excitation verification In this embodiment, an external excitation signal is simulated to be input into the virtual simulation environment to verify the data input excitation of the embedded software.
[0044] Specifically, based on the actual application scenarios of embedded software, we identify various types of external stimulus signals that it may receive, including sensor data acquisition, external control commands, and abnormal operating condition signals. We construct diverse stimulus signal models through the performance stimulus module, generate corresponding simulated signals according to test requirements, and connect to the virtual simulation environment through a virtual interface to simulate signal input in real scenarios. During the stimulus process, signal parameters, timing, and triggering conditions can be flexibly adjusted to perform comprehensive input stimulus verification on the software under test and record the software's response results.
[0045] It should be noted that the above method solves the problems of lack of supporting stimulus data and incomplete coverage of stimulus scenarios in traditional testing. By simulating diverse stimulus signals, it achieves comprehensive coverage of various operating scenarios of the software. The flexible adjustment of stimulus parameters enables the test to accurately focus on key scenarios, effectively verify the software's response capability to different input signals, and improve the comprehensiveness and relevance of the test.
[0046] 5. Test data collection, analysis, evaluation, and visualization monitoring In this embodiment, bus data during the testing process is collected and stored, the data is analyzed and evaluated, and the testing process is monitored visually.
[0047] Specifically, during test execution, the data acquisition component captures bus transmission data between distributed nodes in real time, including input stimulus data, software response data, and interface interaction data, and stores it in a standardized format in a data warehouse to ensure the traceability of test data. Subsequently, the data parsing module performs structured processing on the stored data, extracts key indicators (such as data transmission latency, response accuracy, and protocol compliance), and performs automatic analysis and quality assessment in conjunction with preset evaluation criteria. At the same time, a visual interface displays test progress, data flow status, evaluation results, and other information in real time, allowing testers to intuitively grasp the test dynamics.
[0048] It should be noted that the above methods enable full-process traceability and automated analysis of test data, reducing the workload of manual data processing and improving evaluation efficiency; visual monitoring makes the testing process transparent, making it easier for testers to discover abnormal issues and locate their root causes in a timely manner, providing accurate data support for software quality optimization.
[0049] Example 2 This embodiment provides an embedded software testing and verification system based on a virtual simulation environment, including: The distributed deployment module is configured to configure virtual embedded boards through distributed nodes and deploy them in a containerized manner according to test requirements, and to keep the virtual embedded boards on each distributed node in sync through a time synchronization mechanism. The blueprint deployment module is configured to design and build the interconnection relationships of various application software systems based on the blueprint and generate configuration files to deploy the software configuration items, external interfaces and functional modules of the embedded software system under test. The communication middleware module is configured to perform data communication between distributed nodes based on multiple bus protocols; The performance incentive and evaluation module is configured to simulate external incentive signals to access the virtual simulation environment and perform data input incentive verification on the embedded software. The visualization monitoring module is configured to collect and store bus data during the testing process, parse and evaluate the data, and provide visualization monitoring of the testing process.
[0050] The specific implementation method of the embedded software testing and verification system in this embodiment is as follows.
[0051] 1. Distributed Deployment Module In this embodiment, the distributed deployment module is configured to configure virtual embedded boards through distributed nodes and perform containerized deployment according to test requirements, and to keep the virtual embedded boards of each distributed node in sync through a time synchronization mechanism.
[0052] Specifically, the module first receives test requirement parameters, including test scale, hardware functional requirements, and number of nodes, and then selects suitable distributed node resources. Through the virtual board configuration unit, it generates virtual embedded board instances with corresponding processor and peripheral interface functions for each node. With the help of the containerized deployment unit, it encapsulates the virtual boards and their runtime dependencies into container images, and completes the automated deployment of containers on each node through orchestration and scheduling logic. At the same time, it has a built-in time synchronization unit to achieve time calibration of virtual boards in containers on each node through a unified time base protocol, ensuring cross-node timing coordination.
[0053] It should be noted that this module significantly shortens the test environment setup cycle and reduces the manual cost of environment setup through automated configuration and containerized deployment; the time synchronization function ensures the timing accuracy of distributed simulation, avoids test failures caused by time deviations between nodes, and ensures the consistency of behavior between the virtual environment and the real hardware environment.
[0054] 2. Blueprint Deployment Module In this embodiment, the blueprint deployment module is configured to design and build the interconnection relationship of various application software systems based on the blueprint and generate configuration files to deploy the software configuration items, external interfaces and functional modules of the embedded software system under test.
[0055] Specifically, this module provides a visual blueprint design interface, allowing testers to drag and drop to build the interconnection logic between the software under test and related systems and internal modules, and define interface interaction rules and module dependencies. Through the configuration file generation unit, the logic of the blueprint design is automatically converted into a standardized configuration file, which clarifies the deployment path, interface parameters, module running constraints and other information of the software configuration items. The deployment execution unit reads the configuration file and automatically distributes each component of the software under test to the corresponding virtual embedded board, completing module assembly and interface adaptation, and realizing the rapid construction of the test environment.
[0056] It should be noted that this module simplifies the configuration process of the test environment for complex embedded software through blueprint-based design and automated deployment, improving the accuracy and efficiency of environment deployment; the standardized configuration files enable the test environment to have good portability and reusability, and can quickly adapt to the testing of embedded software of different versions and architectures, meeting the environmental requirements of the entire lifecycle testing.
[0057] 3. Communication Middleware Module In this embodiment, the communication middleware module is configured to perform data communication between distributed nodes based on multiple bus protocols.
[0058] Specifically, the module has a built-in multi-protocol adaptation unit that pre-integrates parsing and conversion logic for commonly used bus protocols in embedded systems, supporting seamless compatibility between different protocols. The data transmission unit is responsible for receiving communication requests from each distributed node, encapsulating or converting the data sent from the sending end, and forwarding the data to the target node through an optimized transmission path. It also provides data buffering and flow control functions to avoid data loss or congestion. The error checking unit performs integrity verification on the transmitted data to ensure the reliability of data transmission. In addition, the module supports protocol extension and can add custom bus protocol adaptation capabilities according to testing requirements.
[0059] It should be noted that this module solves the problem of cumbersome development of multi-protocol communication interfaces in traditional testing, realizes unified scheduling and management of multiple bus protocols, and improves the system's versatility and scalability; the data transmission optimization and error checking mechanism ensure the efficiency and accuracy of data interaction between distributed nodes, and provides stable communication support for multi-module collaborative testing.
[0060] 4. Performance Incentive and Evaluation Module In this embodiment, the performance incentive and evaluation module is configured to simulate external incentive signals to access the virtual simulation environment and perform data input incentive verification on the embedded software.
[0061] Specifically, the excitation signal generation unit of this module constructs various types of excitation models, such as sensor signals, control commands, and abnormal operating conditions, according to the requirements of the test scenario, and generates simulated excitation signals that conform to the characteristics of real scenarios; the signal access unit accurately connects the excitation signals to the virtual simulation environment through a virtual interface to realize signal interaction with the software under test; the excitation control unit supports flexible adjustment of the parameters, timing, triggering conditions, etc. of the excitation signals, and can automatically execute the excitation sequence according to the preset test process, or the excitation process can be manually controlled by the tester; the evaluation unit records the response data of the software under test to the excitation signals and makes a preliminary judgment on the effectiveness and compliance of the response.
[0062] It should be noted that this module fills the gap in the lack of test stimulus data in traditional testing by simulating diverse stimulus signals, and achieves comprehensive coverage of software operation scenarios; the flexible and controllable stimulus process enables the test to accurately verify the performance of the software under different operating conditions, providing direct test basis for software function optimization and improving the pertinence and effectiveness of the test.
[0063] 5. Visual monitoring module In this embodiment, the visualization monitoring module is configured to collect and store bus data during the testing process, parse and evaluate the data, and perform visualization monitoring of the testing process.
[0064] Specifically, the module's data acquisition unit captures various bus data during the testing process in real time, including stimulus input data, software response data, and interface interaction data. This data is categorized and stored according to timestamps and node identifiers to ensure data integrity and traceability. The data parsing and evaluation unit performs structured processing on the stored data, extracts key quality indicators, compares and analyzes them against preset standards, and generates quantitative evaluation results. The visualization unit uses charts, curves, and status indicators to present real-time information such as test progress, data flow status, evaluation results, and anomaly alarms, allowing testers to view test dynamics from multiple dimensions. It also provides data export functionality for subsequent in-depth analysis.
[0065] It should be noted that this module automates the collection, parsing, and evaluation of test data, reducing manual intervention and improving testing efficiency and evaluation accuracy. Visual monitoring makes the testing process transparent, making it easier for testers to promptly identify and locate abnormal issues during testing. It provides comprehensive and intuitive data support for software quality assessment, helping testers to quickly optimize software performance.
[0066] Example 3 This embodiment is based on embodiment 1: This embodiment provides an embedded software testing and verification method based on a virtual simulation environment. It adopts a hybrid solution of QEMU processor simulation software and Docker platform, providing a user-friendly visual interface for users to edit and configure the embedded software simulation test environment. It provides a platform for hardware modeling and software testing, and includes a rich model library (various processors, operating systems, buses, peripherals, etc.) for test environment setup and embedded software operation functions. It is applied throughout the entire lifecycle of embedded software development and testing verification, mainly providing one-stop testing and verification services for software developers and testers.
[0067] like Figure 2As shown, this embodiment also provides an embedded software testing and verification system based on a virtual simulation environment, including human-computer interaction components, platform business components and basic environment support components, involving distributed modular deployment of virtual boards, performance incentives and evaluation, blueprint design, communication middleware and visualization monitoring functions.
[0068] In this embodiment, users can use one or more distributed nodes to simulate part or the entire embedded software testing environment according to testing needs. Each distributed node can be configured as an embedded digital board, and the embedded digital board can be deployed in a containerized manner. This allows each node to provide one embedded application software environment. A system-level time synchronization mechanism ensures that the digital boards of the distributed nodes maintain time consistency. Data communication between the nodes using various bus protocols is achieved through communication middleware. A multi-system, fully digital embedded software testing and verification environment is built using distributed nodes. Test stimuli are automatically generated, and a real-time monitoring module is provided to evaluate and monitor the data throughout the testing and verification process. This enables functional and interface testing of various embedded system application software based on various simulated scenarios on an x86 general-purpose server.
[0069] The specific implementation of the embedded software testing and verification method and system in this embodiment is as follows.
[0070] 1. Virtual board distributed modular deployment function Distributed modular deployment automatically deploys various types of virtual embedded boards and their loaded applications to the server according to configuration files, and uses microservices to manage the nodes of the distributed deployment, and automatically allocates hardware resources to each node through load balancing.
[0071] Preferably, different business functions are divided into different modules, and the code and deployment are decoupled from each other; the distributed node modularization enables different device nodes to be deployed and run independently, allowing for single-node functional testing as well as multi-node system functional and interface testing; at the same time, a visual interface is provided to configure node information, and deployment scripts are automatically generated based on the interface configuration, and each node can be automatically deployed with a click.
[0072] The distributed modular deployment of virtual boards enables simultaneous one-click loading of multiple embedded software programs based on different processors and operating systems, providing diverse functional verification environments for various types of embedded applications. It can be expanded to support full-scale simulation and verification of different system scenarios in the field. Specifically, the processors and embedded operating systems currently supported for testing include: 1) The MPC8640D processes the excitation model of the board and supports the VxWorks 5.5 operating system; 2) T2080 / 4080 processing board excitation model, supports VxWorks 7.0 operating system; 3) The Zynq7045 processes the board's stimulus model and supports compatibility with the Reworks operating system; 4) The FT6678 processes the excitation model of the board and supports the Reworks operating system; 5) The FT2000 processing board excitation model supports compatibility with operating systems such as Tianmai 3 and Reworks.
[0073] 2. Performance incentive and evaluation functions 1) Performance stimulation refers to the process of simulating external stimulation signals of embedded systems and inputting them into a fully digital simulation environment to verify the data input stimulation of application software, including process interface modeling and functional module modeling.
[0074] like Figure 3 As shown, process interface modeling comprises four parts: application software and digital object interface generation module, static interface testing, dynamic testing, and application software and digital object process generation module.
[0075] Preferably, the functional module modeling includes CAN controller modeling, Ethernet controller modeling, serial port controller modeling, SRIO controller modeling, etc. (consistent with the actual external sensor bus of the embedded system). Each controller module is in the form of an executable file under the Windows platform, interacting with the processing board through middleware, and the interaction content can be edited or imported.
[0076] Taking the CAN controller and SRIO controller module as examples, the specific process is as follows: Figure 4 As shown.
[0077] 2) The performance evaluation function refers to the evaluation of data flow through data monitored on the bus. The incentive evaluation module supports data collection, recording, and storage, and can view, analyze, and evaluate data according to user needs. The incentive evaluation function is built using a B / S model and supports simultaneous use by multiple clients. The overall structure of the incentive evaluation function is as follows: Figure 5 As shown.
[0078] Preferably, the data acquisition section can acquire semi-physical environment data or virtual bus data, and the acquired data is stored separately as raw data and parsed data. Users can quickly filter the data.
[0079] Preferably, for virtual bus data, filtering conditions can be set to filter the data according to the English and Chinese names of the ICD (Interface Control File) to identify the ICDs to be monitored. For bus data recorded in the database, the real-time monitoring system can utilize data playback functionality to analyze and process various data without the test card, just like analyzing and processing the collected bus data, thus eliminating dependence on the hardware environment for data analysis. The stimulus evaluation process is shown in the figure below, including configuration initialization, data acquisition, data parsing and evaluation, data storage, and data querying. Figure 6 As shown.
[0080] 3. Blueprint-based rapid deployment and communication middleware functionality 1) Blueprint-based design is mainly used to build and configure the interconnected relationships of various application software systems. It uses a graphical approach to establish system models and generate blueprint configuration files.
[0081] Blueprint design relies on the configuration of various software layers, ICD documents, communication buses, and other components to generate corresponding scene blueprints. For example... Figure 7 As shown, the generated scenario blueprint mainly includes the configuration attributes of each configuration item node, the configuration attributes of the communication bus, and the interconnection relationships of related ports and data. It can deploy all software configuration items, external interfaces, and functional modules of the entire embedded software system under test with one click, and build a fully digital test and verification environment consistent with the real hardware environment.
[0082] 2) Different business functions in this system are implemented through different components. The components communicate with each other using DDS, adopting a data-centric network design pattern. Leveraging DDS's cross-platform, multi-language capabilities and publish-subscribe data transmission strategy, the DDS API is encapsulated, and a common data format is defined, designing a universal interface for distributed simulation systems. Through this standard interface, simulation resources can quickly achieve communication and interaction on single or multiple digital boards and external stimuli.
[0083] Example of handling inter-board communication networking: Figure 8 As shown, the interaction between the components via the communication middleware is illustrated in the diagram. Figure 9 As shown.
[0084] 4. Visual monitoring module The visualization monitoring module enables front-end users to view and evaluate business data in real time. It can analyze, filter, handle anomalies, import and replay historical data, and provide hardware resource visualization. For hardware resources used in the virtual environment, it can achieve real-time monitoring and dynamic deployment, improving hardware utilization efficiency. The visualization monitoring module is used for business and system operation monitoring, providing graphical visualizations and triggering alarms and prompts based on set boundary values. Its main functions include: 1) Real-time data acquisition: Real-time acquisition of bus data (such as CAN message send / receive events, SRIO bus data stream, etc.) of each device through communication middleware, supporting playback control.
[0085] 2) Fault detection and alarm: By analyzing the behavior of the data stream in real time, potential problems such as packet loss, latency, and bandwidth bottlenecks are detected, and corresponding alarms are generated.
[0086] 3) Performance evaluation: Evaluate the performance of the bus, such as latency, bandwidth usage, message transmission throughput, etc.
[0087] 4) Statistics and Logs: Generate detailed test verification logs, perform statistical analysis, and provide categorized displays for analysis and system optimization.
[0088] 5) Data quality assessment: By checking the integrity, accuracy, and format correctness of the transmitted data, assess whether the data meets the system requirements.
[0089] 6) Throughput and bandwidth assessment: Real-time monitoring of data throughput and bandwidth usage through communication middleware to ensure that the performance of the simulation system meets the design requirements.
[0090] Example 4 This embodiment is based on embodiment 1: This embodiment provides an embedded software testing and verification method based on a virtual simulation environment, applied to the configuration items and system testing process of a certain embedded software. The specific implementation steps are as follows: Step 1: Setting up a fully digital environment Select a virtualization platform that supports multi-core heterogeneous systems and configure a virtual hardware environment (e.g., the software runs on an FT2000 processor, ReWorks 6.1).
[0091] Step 2: Deploy the application software to be tested Upload the embedded software and related dependency files to the virtual environment, configure the peripheral interfaces involved in the software, and start the fully digital environment for pre-verification.
[0092] Step 3: Test Case Construction and Execution Construct hierarchical test cases based on the application software to ensure the correctness of software functions and interfaces, cover the functions, performance and boundary conditions of embedded software, execute test cases in a virtual environment, record test results and analyze problems.
[0093] Step 4: Evaluation and Verification of Test Results Port test cases to a real hardware environment to verify the consistency of test results, and optimize embedded software and test cases based on the test results.
[0094] By following the steps above, software developers or testers can conduct functional verification and performance testing of embedded software before the hardware is fully assembled, significantly shortening the development cycle and improving testing efficiency.
[0095] In summary, as demonstrated by the above embodiments, the embedded software testing and verification method and system based on a virtual simulation environment proposed in this invention can effectively solve the problems of high cost of building embedded software testing and verification environments and lack of supporting stimulus data, thus realizing the construction of a fully digital embedded software testing and verification environment. Simultaneously, test cases can be seamlessly ported to real hardware environments for testing and verification, achieving the reuse of test resources and reducing human and material costs. Furthermore, this invention can also realize pre-verification and hierarchical testing of embedded software development, solving the problem of the inability to quickly verify and test embedded software due to delays in hardware availability, and providing efficient and reliable technical support for embedded software testing and verification.
[0096] Example 5 This embodiment is based on embodiment 1: This embodiment provides a computer device, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the embedded software testing and verification method based on a virtual simulation environment as described in Embodiment 1. The computer program can be in the form of source code, object code, executable file, or some intermediate form.
[0097] Example 6 This embodiment is based on embodiment 1: This embodiment provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the embedded software testing and verification method based on a virtual simulation environment described in Embodiment 1. The computer program can be in the form of source code, object code, executable file, or some intermediate form. The storage medium includes any entity or device capable of carrying computer program code, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc.
[0098] The above description is merely a preferred embodiment of the present invention. It should be understood that the present invention is not limited to the forms disclosed herein and should not be construed as excluding other embodiments. It can be used in various other combinations, modifications, and environments, and can be altered within the scope of the concept described herein through the above teachings or related technologies or knowledge. Modifications and variations made by those skilled in the art that do not depart from the spirit and scope of the present invention should be within the protection scope of the appended claims.
[0099] It should be noted that, for the sake of simplicity, the foregoing method embodiments are described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
Claims
1. A method for testing and verifying embedded software based on a virtual simulation environment, characterized in that, include: Based on the testing requirements, virtual embedded boards are configured and containerized through distributed nodes, and a time synchronization mechanism is used to keep the virtual embedded boards on each distributed node in sync. Based on the blueprint design, the interconnection relationship of each application software system is constructed and the configuration file is generated. The software configuration items, external interfaces and functional modules of the embedded software system under test are then deployed. Data communication between distributed nodes based on multiple bus protocols is performed through communication middleware; Simulate external excitation signals to input into a virtual simulation environment to verify data input excitation for embedded software; Collect and store bus data during the testing process, analyze and evaluate the data, and visualize and monitor the testing process.
2. The embedded software testing and verification method based on a virtual simulation environment according to claim 1, characterized in that, The configuration of virtual embedded boards through distributed nodes and containerized deployment includes: using microservices to manage and deploy distributed nodes, automatically allocating hardware resources for each node through load balancing, dividing different services into independent modules, and decoupling code from deployment.
3. The embedded software testing and verification method based on a virtual simulation environment according to claim 2, characterized in that, The method of configuring virtual embedded boards and deploying them in a containerized manner through distributed nodes also includes: configuring node information through a visual interface, automatically generating deployment scripts based on the node information configuration, and realizing automatic deployment of each distributed node.
4. The embedded software testing and verification method based on a virtual simulation environment according to claim 1, characterized in that, The simulated external excitation signal is connected to the virtual simulation environment, including: Process interface modeling: Construct an interface model between application software and digital objects, construct static interface testing and dynamic testing models, and construct a process model between application software and digital objects; Functional module modeling: Construct a controller model and keep it consistent with the actual external sensor bus of the embedded system. The controller types in the controller model include CAN controller, Ethernet controller, serial port controller and SRIO controller.
5. The embedded software testing and verification method based on a virtual simulation environment according to claim 1, characterized in that, In step S5, the process of collecting and storing bus data during the test, parsing and evaluating the data, and visually monitoring the test process includes: collecting semi-physical environment data and virtual bus data, and classifying and storing them according to raw data and parsed data; being able to set filtering conditions based on the English or Chinese names of interface control files to filter the interface control files to be monitored; and adding a data playback function to enable data analysis and processing without the test card.
6. An embedded software testing and verification system based on a virtual simulation environment, characterized in that, include: The distributed deployment module is configured to configure virtual embedded boards through distributed nodes and deploy them in a containerized manner according to test requirements, and to keep the virtual embedded boards on each distributed node in sync through a time synchronization mechanism. The blueprint deployment module is configured to design and build the interconnection relationships of various application software systems based on the blueprint and generate configuration files to deploy the software configuration items, external interfaces and functional modules of the embedded software system under test. The communication middleware module is configured to perform data communication between distributed nodes based on multiple bus protocols; The performance incentive and evaluation module is configured to simulate external incentive signals to access the virtual simulation environment and perform data input incentive verification on the embedded software. The visualization monitoring module is configured to collect and store bus data during the testing process, parse and evaluate the data, and provide visualization monitoring of the testing process.
7. The embedded software testing and verification system based on a virtual simulation environment according to claim 6, characterized in that, The communication middleware module adopts the DDS communication protocol, encapsulates the application programming interface of the DDS communication protocol and defines a general data format to form a general interface for the distributed simulation system; it utilizes the cross-platform and multi-language characteristics and publish-subscribe data transmission strategy of the DDS communication protocol to perform communication interaction between simulation resources and single or multiple digital boards and external stimuli.
8. The embedded software testing and verification system based on a virtual simulation environment according to claim 6, characterized in that, The performance incentive and evaluation module is built using a B / S model, supports multiple clients to use simultaneously, and its workflow includes configuration initialization, data collection, data parsing and evaluation, data storage and data query.
9. The embedded software testing and verification system based on a virtual simulation environment according to claim 6, characterized in that, The visualization monitoring module includes: The real-time data acquisition unit is configured to acquire bus data from each device in real time via communication middleware and supports playback control. The fault detection and alarm unit is configured to detect potential problems and generate corresponding alarms by analyzing the behavior of the data stream in real time. The performance evaluation unit is configured to evaluate the performance of the bus, including latency, bandwidth usage, and message transmission throughput.
10. The embedded software testing and verification system based on a virtual simulation environment according to claim 9, characterized in that, The visualization monitoring module also includes: The statistics and logging unit is configured to generate test verification logs and perform statistical analysis and categorized display. The data quality assessment unit is configured to perform preset checks on the transmitted data to assess whether the transmitted data meets the corresponding requirements; the preset checks include integrity, accuracy, and format correctness checks; The throughput and bandwidth assessment unit is configured to monitor data throughput and bandwidth usage in real time through the communication middleware.