Control software joint simulation hardware-in-loop test system and method
By using control software to co-simulate a hardware-in-the-loop (HIL) testing system, efficient co-simulation and full-process management of the new energy vehicle HIL testing system have been achieved. This solves the problems of inflexible test environment configuration, insufficient automation and traceability in existing technologies, and improves testing efficiency and transparency of quality management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUNAN CRRC TIMES ELECTRIC DRIVE TECHNOLOGY CO LTD
- Filing Date
- 2025-12-23
- Publication Date
- 2026-04-17
AI Technical Summary
Existing HIL testing systems for new energy vehicles lack an efficient co-simulation platform, have insufficient automation and traceability in the testing process, lack in-depth quality measurement of test data, and are difficult to support the development and quality management of complex systems.
A hardware-in-the-loop testing system for co-simulation of control software is provided, including a hardware-in-the-loop testing platform, a test project management platform, and an automated testing platform. It supports the hybrid deployment of physical and virtual controllers, realizes closed-loop testing, and performs full-process management and quality measurement through the test project management platform.
It improves the flexibility and efficiency of the testing platform, automates and makes the testing process traceable, provides a quantitative assessment of software quality, and enhances development efficiency and transparency in quality management.
Smart Images

Figure CN121879176A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of software simulation and testing technology for new energy vehicles, and in particular to a hardware-in-the-loop testing system and method for co-simulation of control software. Background Technology
[0002] As the electronic and electrical architecture of new energy vehicles becomes increasingly complex, it integrates a large number of key electronic control units (ECUs) such as the vehicle control unit (VCU), battery management system (BMS), and motor controller (MCU). To ensure the functional reliability, safety, and interoperability of these controllers, hardware-in-the-loop (HIL) testing has become an indispensable core verification method in the product development process.
[0003] The HIL (High-Intensity Logic) testing system for new energy vehicles is a vehicle simulation testing platform based on HIL technology. Its core principle lies in using a real-time simulator to simulate the behavior of the controlled object (i.e., the vehicle's operating environment and the controlled object model). Taking a pure electric vehicle as an example, the simulation model typically includes the transmission system, longitudinal dynamics system, virtual environment, driver model, inverter, and motor system. The main function of this system is to achieve high-precision real-time operation of the complete vehicle model, simulate the input signals (such as sensor signals and CAN messages) of each controller under test (e.g., VCU, BMS, MCU), and collect the output signals of each controller, thereby forming a complete closed-loop testing environment to support the software development testing and system integration debugging of the controllers.
[0004] In software testing methodologies, testing is primarily divided into manual testing and automated testing. Traditional purely manual testing methods are inefficient, error-prone, and costly, making them ill-suited to the continuous and rapid iteration cycles of modern software development. Therefore, test automation has become an inevitable trend in the industry. By building automated testing platforms and transforming test case sets into a library of repeatable test scripts, testing efficiency can be greatly improved, development speed accelerated, defects detected early, and development costs reduced, ultimately laying a solid foundation for technological innovation and collaborative team development.
[0005] However, despite the relatively mature HIL technology and test automation concepts, existing test platforms still have the following significant shortcomings in practical applications, especially in the development of complex systems such as commercial vehicles, which restrict further improvements in development efficiency and quality: 1. From the perspective of simulation model integration: There is a lack of efficient co-simulation platforms. Existing simulation system platforms are often isolated and fragmented. Especially for commercial vehicles, which have a wide variety of controller types and complex interactions, existing platforms struggle to achieve unified management and flexible integration of various controller models, and cannot support cross-system co-simulation, thus limiting the coverage and realism of test scenarios.
[0006] 2. From the perspective of development process management: There is a lack of traceability capabilities for deliverables based on test cases. The current testing platform has a weak connection to the software development process (such as requirements, design, and code implementation). The failure to establish an automated traceability mechanism based on test cases makes it impossible to clearly track whether a requirement has passed the corresponding test verification, making it difficult to ensure the consistency of software deliverables with the original design intent, and posing challenges to process management and quality auditing.
[0007] 3. From a data-driven decision-making perspective: Lack of in-depth quality measurement of test data. Existing testing processes generate massive amounts of data, but lack platform-based tools for systematically analyzing and measuring this data. Data such as test execution results, defect discovery rates, and test case pass rates cannot be transformed into quantifiable quality indicators, thus failing to provide effective data support and decision-making basis for continuous improvement of the software development process. Summary of the Invention
[0008] The technical problem to be solved by this invention is: In view of the technical problems existing in the prior art, this invention provides a control software co-simulation hardware-in-the-loop testing system and method, which aims to solve the problems of inflexible test environment configuration, insufficient automation and traceability of the test process, and lack of software quality quantitative measurement means in the prior art.
[0009] To solve the above-mentioned technical problems, the technical solution proposed by this invention is as follows: A control software co-simulation hardware-in-the-loop test system includes: The hardware-in-the-loop test platform includes an I / O interface board and a real-time simulator. The I / O interface board is used to establish a signal connection with one or more physical controllers under test. The real-time simulator is used to run a controlled object model, which includes a virtual controller model corresponding to the physical controller under test. The test project management platform is communicatively connected to the hardware-in-the-loop test platform. An automated testing platform is used to schedule and execute automated test scripts, and is communicatively connected to the hardware-in-the-loop testing platform and the test project management platform, respectively. The system supports the hybrid deployment and collaborative testing of physical controllers and virtual controller models. When constructing a test loop, the selected controller type is connected in physical form via an I / O interface board. For the same type of controller that is not connected in physical form, it is replaced by the corresponding virtual controller model in the real-time simulator, so that the physical controller and the virtual controller model can interact with each other in real time to form a closed-loop test.
[0010] As a further improvement to the system of the present invention: the controlled object model is a pure electric vehicle model, and the physical controller under test includes one or more of the following: vehicle controller (VCU), motor controller (MCU), and transmission controller (TCU).
[0011] As a further improvement to the system of the present invention, the hardware-in-the-loop test platform also includes an FPGA board for high-speed simulation of the motor model.
[0012] As a further improvement to the system of the present invention: the test project management platform includes a database for storing and managing test assets, which include test requirements, test cases, test models, test code, test reports and test issues.
[0013] As a further improvement to the system of the present invention: the test project management platform includes a project management module and a test management module; The project management module is used to manage test projects, user permissions, and email notification rules. The test management module is used to manage the entire process of test requirements, test models, test code, test cases, test execution, test issues, relationships, test reports, and test resources.
[0014] As a further improvement to the system of the present invention: the test project management platform also includes a quality measurement module and a missed test analysis module. The quality measurement module is used to quantify the quality of the software development process based on test execution data and generate a measurement report. The missed test analysis module is used to analyze after-sales software problems and generate reproducible test cases.
[0015] As a further improvement to the system of the present invention: the automated testing platform and the test project management platform form a closed-loop data flow, and the test report generated by the automated testing platform after performing the test is fed back to the test project management platform to drive the continuous management and optimization of test assets.
[0016] As a further improvement to the system of the present invention: the automated testing platform includes a build scheduling module, which is communicatively connected to the code configuration library; The build scheduling module is configured to: automatically extract the target version of the controller software code from the code configuration library and automatically build it in response to the triggering of the test task, generating an executable file; and automatically schedule static testing tools to perform static code testing, schedule dynamic testing tools to perform model-in-the-loop testing and software-in-the-loop testing, and schedule the hardware-in-the-loop testing platform to perform automated hardware-in-the-loop testing. The automated testing platform is also connected to a continuous integration server to submit the built test tasks to the continuous integration server, and the continuous integration server will periodically trigger the test building and execution, generate test reports, and automatically push them to designated terminals.
[0017] This invention also provides a hardware-in-the-loop testing method for control software co-simulation, the method being applied to the aforementioned control software co-simulation hardware-in-the-loop testing system, comprising the following steps: Step S1: Load the controlled object model, which includes the virtual controller model, into the real-time simulator and run it; Step S2: Establish a signal connection with one or more physical controllers under test via the IO interface board; Step S3: Select the type and quantity of the controller under test, and connect the selected type of controller under test as a physical controller to the test loop. At the same time, configure the unconnected controllers of the same type to run in the real-time simulator by their corresponding virtual controller models, so as to form a hybrid test environment containing physical controllers and virtual controller models. Step S4: Schedule and execute automated test scripts through the automated test platform to control the controlled object model to simulate the operating conditions, so that the physical controller and the virtual controller model can perform dynamic data interaction to complete the closed-loop test.
[0018] As a further improvement to the method of the present invention: test cases are provided to the automated testing platform through the test project management platform; and the test reports are fed back to the test project management platform for storage and management through the automated testing platform.
[0019] Compared with the prior art, the beneficial effects of the present invention are as follows: 1. This invention, through a hybrid deployment mechanism of physical and virtual controllers, allows users to freely choose to connect any type of controller (such as VCU, MCU, TCU) to the test loop in the form of physical or virtual models according to test requirements. This breaks the physical limitations of traditional test benches, enabling a single system to flexibly support single controller testing, multi-controller joint testing, and system integration testing. This greatly improves the utilization rate and configuration efficiency of the test platform and reduces hardware investment and maintenance costs.
[0020] 2. This invention integrates a test project management platform and an automated testing platform, and constructs a closed-loop data flow between the two, achieving fully online and automated management of the entire process from test requirements, test case design, script generation, automatic execution to report generation and issue tracing. Test reports are automatically fed back and drive asset optimization. At the same time, through relational management, bidirectional and accurate traceability between requirements, test cases, models / code, and defects is achieved, significantly improving the standardization, efficiency, and transparency of the testing process management. Attached Figure Description
[0021] Figure 1 This is a schematic diagram illustrating the relationship between the automated testing platform in an embodiment of the present invention.
[0022] Figure 2 This is a diagram showing the main data flow of the automated testing platform in this embodiment of the invention.
[0023] Figure 3 This is a schematic diagram of the HIL_ASM model and fusion in an embodiment of the present invention.
[0024] Figure 4 This is a schematic diagram of MCU communication and control messages in an embodiment of the present invention.
[0025] Figure 5 This is a bus communication topology diagram of VCU, TCU, and MCU in an embodiment of the present invention.
[0026] Figure 6 This is a framework diagram of the test project management platform in an embodiment of the present invention.
[0027] Figure 7 This is a schematic diagram of an automated test report in an embodiment of the present invention.
[0028] Figure 8 This is a schematic diagram of a continuous upshift test in an embodiment of the present invention. Detailed Implementation
[0029] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0030] like Figure 1 , Figure 2 As shown, this embodiment provides a hardware-in-the-loop test system for co-simulation of control software, including: The hardware-in-the-loop test platform includes an I / O interface board and a real-time simulator. The I / O interface board is used to establish signal connections with one or more physical controllers under test, and the real-time simulator is used to run the controlled object model, which includes a virtual controller model corresponding to the physical controller under test. The test project management platform communicates and connects with the hardware-in-the-loop test platform. An automated testing platform is used to schedule and execute automated test scripts, and it communicates with the hardware-in-the-loop testing platform and the test project management platform, respectively. The system supports the mixed deployment and collaborative testing of physical controllers and virtual controller models. When constructing test loops, the selected controller type is connected in physical form through IO interface boards. For the same type of controller that is not connected in physical form, it is replaced by the corresponding virtual controller model in the real-time simulator, so that the physical controller and the virtual controller model can interact with each other in real time to form a closed-loop test.
[0031] In this embodiment, the controlled object model is a pure electric vehicle model, and the physical controller under test includes one or more of the following: vehicle controller (VCU), motor controller (MCU), and transmission controller (TCU).
[0032] Specifically, the controlled object model is a pure electric vehicle model for commercial vehicles, which includes key subsystem models such as battery, motor, transmission, and vehicle dynamics. Among them, the torque management module is responsible for calculating, allocating, and limiting the drive torque in real time based on driving requests, vehicle status, and system boundary conditions in the simulation model, and is the key to verifying the vehicle's dynamics and safety.
[0033] The hardware-in-the-loop test platform forms the physical simulation foundation of the system. Its main hardware components include: a real-time (RT) system, a rich set of high-speed I / O boards, a motor FPGA simulation board, and a host computer. The real-time simulator runs controlled object models including vehicle dynamics, motors, and transmissions, as well as virtual controller models of key controllers (VCU, MCU, TCU), such as... Figure 3 As shown. The I / O interface board (including CAN, analog, and digital channels) establishes a physical connection with the actual controller hardware through standardized cables and connectors: Regarding CAN communication, for example... Figure 4 As shown, the board's multiple CAN channels are connected to the corresponding CAN ports of controllers such as the VCU, MCU, and TCU via twisted-pair cables, and terminating resistors are configured to form a stable network; for example... Figure 5 As shown, each controller is interconnected according to a preset bus communication topology, forming a complete distributed communication architecture. Simultaneously, analog and digital channels receive voltage / current signals and switching / PWM signals output by the controllers, respectively, and the physical pins are mapped to the signal variables of the simulation model via experimental management software. All connections adhere to the wiring diagram and electrical characteristic parameters, ensuring the accuracy, real-time performance, and reliability of signal transmission, thereby establishing a closed-loop interactive physical signal path between the physical controller and the virtual simulation environment.
[0034] In this embodiment, the user can freely choose between the physical controller and the virtual controller based on the testing objective. For example, when focusing on testing newly developed VCU software, the physical VCU can be connected to the system via an I / O board, while the MCU and TCU run in a real-time simulator using their corresponding virtual controller models. The three form a closed loop through I / O signals and bus communication. The instructions issued by the physical VCU drive the virtual MCU and TCU models, and the vehicle status feedback from the models is then fed back to the VCU, thereby achieving testing of a single controller while encompassing the complete system interaction.
[0035] The automated testing platform system in this embodiment adopts an integrated hardware and software collaborative architecture: At the hardware level, a standardized testing environment is built around the core controllers (VCU, MCU, TCU) of new energy commercial vehicles. It integrates hardware devices, supporting software, and simulation models that have undergone complete closed-loop debugging, and includes the hardware and software of the controller under test, the vehicle CAN bus communication protocol, vehicle technical parameters, electrical wiring diagrams, and interface electrical characteristic parameters, forming a plug-and-play, traceable testing foundation; At the software level, a toolchain covering the entire process of test environment construction, test case design, and test implementation is provided, including an integrated platform interface toolkit, multi-channel real-time CAN interfaces, FPGA real-time interfaces, experimental management software with real-time testing and bus signal editing functions, automated testing software with an automated testing framework and development environment, and a fault simulation software package that supports signal and communication-level fault injection, together realizing flexible and reproducible automated testing capabilities from single controller to multi-system joint simulation.
[0036] Specifically, the construction and parameterization of the controlled object model are carried out during the hardware-in-the-loop testing preparation phase. A model is built using a commercial base model, and model development and parameterization are performed in the MathWorks Simulink environment. From the controlled object model library, a pure electric vehicle base model is selected. Based on its characteristic parameters, graphical tools are used to develop and parameterize the controlled object model's functions, ensuring that the model's performance matches the characteristics of the real vehicle.
[0037] Because the motor model (especially the inverter and motor body) requires extremely high simulation step sizes (microseconds), general-purpose CPUs are insufficient to meet real-time requirements. Therefore, this system incorporates an FPGA board into the hardware-in-the-loop test platform. For example... Figure 1 and Figure 2 The "motor FPGA simulation board" mentioned above compiles and downloads a highly dynamic motor model to an FPGA for execution, utilizing its hardware parallel computing capabilities to achieve high-speed simulation of the motor model and ensure the real-time performance and accuracy of the entire co-simulation environment.
[0038] In this embodiment, the test project management platform includes a database for storing and managing test assets, which include test requirements, test cases, test models, test code, test reports, and test issues.
[0039] like Figure 6 As shown, the test project management platform focuses on the full lifecycle management of software testing, constructing a comprehensive management system covering four dimensions: organization, project, process, and quality. At the organization and personnel management level, the platform provides a basic framework for department management, personnel management, and user and role permission allocation, and achieves efficient task collaboration and notification through configurable email templates and intelligent reminder mechanisms. At the core project management and execution layer, the platform provides full-process control around "test projects," supporting project creation, workspace management, file directory organization, and node classification. The testing process fully covers all aspects from requirements analysis, model and code management, test case design, to test execution analysis and defect management, and achieves bidirectional traceability between requirements, test cases, models, and code. Simultaneously, it plans and controls specific testing activities through test round management, supporting the allocation, execution, suspension, and result analysis of test tasks.
[0040] In terms of knowledge accumulation and quality insight, the platform has established a test knowledge base to accumulate test cases and defect experience, supports the automatic generation of various test reports and statements, and integrated a software quality measurement module. This module can analyze and calculate process data by building quality models, ultimately outputting quantitative test reports, such as... Figure 7 As shown, this enables objective evaluation and continuous improvement of software quality. Finally, at the system configuration and support layer, the platform provides backend functions such as server and database configuration, version control system (such as SVN) integration, license management, and email service rule configuration to ensure the stable and secure operation of the entire system.
[0041] Existing technologies lack objective and quantitative methods for evaluating the quality of the software development process, often resulting in quality issues only emerging later. This embodiment innovatively integrates a quality measurement module and a defect analysis module into a test project management platform. By establishing a quality measurement model, it automatically analyzes process data such as test coverage and defect density, generating quantitative quality reports to achieve objective evaluation and trend prediction of software quality status. Simultaneously, for after-sales issues, the system can assist in defect analysis and automatically generate reproducible test cases, continuously enriching the test case library. This forms a closed loop of continuous quality improvement—"test-measurement-analysis-improvement"—ensuring and enhancing the quality and reliability of the final software product from a process perspective.
[0042] In this embodiment, the test project management platform includes a project management module and a test management module; The project management module manages test projects, user permissions, and email notification rules. Specifically, it provides full-process project management functions, including creating, submitting, configuring, viewing, disabling / enabling, and deleting projects. It supports creating, importing (e.g., importing an OA system account list), editing, and deleting project-related users in the personnel management interface. Users can customize role types and operation permissions for project managers, developers, and testers in the permission management interface. After logging in, users can view all tasks under their name and directly access them. It also supports connection to an email server, customizable email sending rules, and intelligent email reminders, providing timely notifications regarding the closure of relevant test tasks and issues.
[0043] The test management module is used to manage the entire process of test requirements, test models, test code, test cases, test execution, test issues, relationships, test reports, and test resources.
[0044] In this embodiment, the test management module realizes online management of the entire test activity process, specifically including: Test Requirement Management: The platform provides functions for creating, modifying, and deleting test requirements, as well as importing test requirement documents in formats such as Excel.
[0045] Test model management: The platform provides functions for importing, exporting, and deleting test models.
[0046] Test code management: The platform provides functions for importing, exporting, and deleting test code.
[0047] Test case management.
[0048] Test execution analysis and management: The platform provides an interface for test case execution and test result analysis.
[0049] Test knowledge base management: The platform provides functions such as importing and deleting document templates during the software development and testing phase, as well as creating new documents based on the templates.
[0050] Relationship Management: Provides operations for creating, modifying, and deleting relationships between test requirements, test cases, and models / code; provides operations for creating, modifying, and deleting relationships between test issues, test requirements, and test cases, thereby enabling traceability and verification of deliverables in the software development process through test cases.
[0051] Test report generation: The platform can generate various test reports, such as test issue management process record reports, correlation matrix reports, software requirement test reports, software coverage analysis reports, etc.
[0052] Test resource reuse: Test resources belonging to a specific continuous integration project, including test requirements, test cases, controlled object models, etc., can be reused in other continuous integration projects through export / import / copying.
[0053] The test management module ensures that testing activities are standardized, orderly, and closely integrated with the development process.
[0054] In this embodiment, a closed-loop data flow is formed between the automated testing platform and the test project management platform, such as... Figure 2 As shown, the test reports generated by the automated testing platform after executing the tests are fed back to the test project management platform to drive the continuous management and optimization of test assets.
[0055] Specifically, a crucial data flow loop is formed between the test project management platform and the automated testing platform. The test project management platform provides test cases, models, and other assets to the automated testing platform. After the automated testing platform drives test execution, the generated detailed test reports (including pass / fail status, logs, curve data, etc.) are automatically fed back and stored in the test project management platform. These reports are not only used for problem analysis but also drive the continuous management and optimization of test assets. For example, test cases can be supplemented based on test coverage reports, or test sequences can be optimized based on common failure modes.
[0056] In this embodiment, the automated testing platform includes a build scheduling module, which is communicatively connected to the code configuration library; The build scheduling module is configured to: automatically extract the target version of the controller software code from the code configuration repository and automatically build it in response to the triggering of test tasks, generating an executable file; and automatically schedule static testing tools to perform static code testing, schedule dynamic testing tools to perform model-in-the-loop testing and software-in-the-loop testing, and schedule hardware-in-the-loop testing platform to perform hardware-in-the-loop automated testing. The automated testing platform also communicates with the continuous integration server to submit the built test tasks to the continuous integration server, which then triggers test building and execution at regular intervals, generates test reports, and automatically pushes them to designated terminals.
[0057] In this embodiment, the automated testing platform also includes an automated build module and an automated test scheduling module. The automated build module integrates with a code configuration repository (such as SVN). When a test task is triggered, it automatically extracts the latest version of the controller software code, compiles and builds it, and generates an executable file that can be downloaded to the physical controller or virtual controller model. The automated test scheduling module schedules different testing tools sequentially or in parallel according to the test plan: it schedules static testing tools for code style checks; it schedules Model-in-the-Loop (MIL) and Software-in-the-Loop (SIL) testing tools for dynamic testing; and finally, it schedules the Hardware-in-the-Loop (HIL) system to perform automated hardware-in-the-loop testing. This achieves full-chain automation from code to final HIL testing, greatly improving testing efficiency, accelerating development speed, and helping to discover defects early.
[0058] In this embodiment, the test project management platform also includes a quality measurement module and a missing test analysis module. The quality measurement module is used to quantify the quality of the software development process based on test execution data and generate a measurement report. The missing test analysis module is used to analyze after-sales software problems and generate reproducible test cases.
[0059] Specifically, the quality metric module analyzes data generated during testing (such as requirement coverage, code coverage, test case pass rate, defect density, etc.), establishes quantitative models, generates quality metric reports, and objectively assesses the software quality status and development trends. Specifically, a software development process quality metric model has been established, covering development process quality such as software requirement coverage, structure coverage, and specification coverage. The missed detection analysis module provides a management interface to assist in analyzing why software issues reported by after-sales personnel failed testing. It also constructs test cases for these issues to reproduce them, thereby continuously improving the testing system and preventing similar issues from being missed again. This module enables the measurement of software quality that controls the software development process.
[0060] This embodiment also provides a test case design scheme and an automated test platform closed-loop environment scheme: Test Case Design Scheme: The most crucial parts of the testing process are test case writing, automated script writing, and debugging. This involves designing a method and apparatus for establishing test sequence groups. This mainly includes: building test sequences based on test cases; encapsulating the built test sequences into a test case testing platform; and integrating the test case testing platform into the required automated testing projects. By encapsulating functionally identical test sequences across different automated testing projects into a test case testing platform, it is possible to eliminate the need to recreate variables and rebuild test sequences one by one before each automated testing project execution. Instead, the platform can be integrated into the required automated testing project simply by modifying the access parameters accordingly, thus saving time spent recreating variables and rebuilding test sequences.
[0061] Automated testing platform closed-loop environment solution: In the automated testing preparation stage, a hardware-in-the-loop testing environment based on the implementation object is built, seamlessly linked with the hardware platform, and the automated testing toolchain environment is debugged and model simulation and compilation are performed. The main steps are as follows: (1) Automated toolchain debugging, HIL testing tools are seamlessly linked; (2) External devices and virtual environment (simulation model construction) are linked through configuration tools; (3) Automated execution (driving) program and modeling module environment construction are linked.
[0062] This embodiment also provides a hardware-in-the-loop testing method for control software co-simulation, applied to a control software co-simulation hardware-in-the-loop testing system, including the following steps: Step S1: Load the controlled object model, which includes the virtual controller model, into the real-time simulator for execution.
[0063] Step S2: Establish a signal connection with one or more physical controllers under test via the IO interface board.
[0064] Step S3: Select the type and quantity of the controller under test, and connect the selected type of controller under test as a physical controller to the test loop. At the same time, configure the unconnected controllers of the same type to run in the real-time simulator by their corresponding virtual controller models, so as to form a hybrid test environment containing physical controllers and virtual controller models.
[0065] Specifically, users select the "mode" for this test through a software interface (such as experimental management software). For example, they might select the "Physical VCU + Virtual MCU + Virtual TCU" mode. Based on this selection, the system formally connects the physical VCU to the test loop and activates the virtual models of the MCU and TCU in the simulator, while simultaneously disabling the signal paths of any potentially connected physical MCU and TCU, thus creating a hybrid test environment. This step enables flexible and intuitive application of the simulation system, allowing for the testing of signal interaction and functional control effects of the control software.
[0066] Step S4: Schedule and execute automated test scripts through the automated test platform to control the controlled object model to simulate the operating conditions, enabling dynamic data interaction between the physical controller and the virtual controller model to complete the closed-loop test.
[0067] Specifically, the test is executed by an automated platform running test scripts, such as a continuous upshift test script. Figure 8As shown, the vehicle model is driven to run, and the physical device and virtual controller begin to interact, completing the closed-loop test and recording all data. Based on the automated test script control environment model, various operating conditions are simulated on the target machine to perform automated testing on the controller. An interface is established to connect the test unit and the environment model, and automated test scripts are used in conjunction with bench simulation of various operating conditions to perform automated testing on the controller. Manual testing by testers is eliminated, improving testing efficiency and accuracy. Automated test scripts can be run in batches, improving testing efficiency and shortening the project cycle.
[0068] In this embodiment, test cases are provided to the automated testing platform through the test project management platform; the test reports are then fed back to the test project management platform for storage and management through the automated testing platform.
[0069] In summary, this embodiment provides a highly flexible, automated, traceable, and quality-information-enabled co-simulation testing system and method for control software. This system can meet the current and future needs of the automotive industry, automating software testing such as R&D verification testing, compliance testing, certification service testing, extreme testing, and scenario simulation (market problem reproduction). It also enables test coverage studies and software quality evaluation, ensuring that the software meets pre-defined goals and requirements.
[0070] This embodiment further provides a computer device, including a processor and a memory, the memory for storing a computer program and the processor for executing the computer program to perform the method as described above.
[0071] It is understood that the method described in this embodiment can be executed by a single device, such as a computer or server, or it can be applied to a distributed scenario where multiple devices cooperate to complete the task. In a distributed scenario, one of the multiple devices may execute only one or more steps of the method described in this embodiment, and the multiple devices interact to complete the method. The processor can be implemented using a general-purpose CPU, microprocessor, application-specific integrated circuit, or one or more integrated circuits, and is used to execute relevant programs to implement the method described in this embodiment. The memory can be implemented using read-only memory (ROM), random access memory (RAM), static storage devices, and dynamic storage devices. The memory can store the operating system and other applications. When the method described in this embodiment is implemented through software or firmware, the relevant program code is stored in the memory and called and executed by the processor.
[0072] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention in any way. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the invention. Therefore, 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 should fall within the protection scope of the present invention.
Claims
1. A control software co-simulation hardware-in-the-loop test system, characterized in that, include: The hardware-in-the-loop test platform includes an I / O interface board and a real-time simulator. The I / O interface board is used to establish a signal connection with one or more physical controllers under test. The real-time simulator is used to run a controlled object model, which includes a virtual controller model corresponding to the physical controller under test. The test project management platform is communicatively connected to the hardware-in-the-loop test platform. An automated testing platform is used to schedule and execute automated test scripts, and is communicatively connected to the hardware-in-the-loop testing platform and the test project management platform, respectively. The system supports hybrid deployment and collaborative testing of physical controller and virtual controller models; When constructing the test loop, the selected controller type is connected in physical form through the IO interface board; for the same type of controller that is not connected in physical form, it is replaced by the corresponding virtual controller model in the real-time simulator, so that the physical controller and the virtual controller model can interact in real time to form a closed loop test.
2. The control software co-simulation hardware-in-the-loop test system of claim 1, wherein, The controlled object model is a pure electric vehicle model, and the physical controller under test includes one or more of the following: vehicle controller (VCU), motor controller (MCU), and transmission controller (TCU).
3. The control software co-simulation hardware-in-the-loop testing system according to claim 1, characterized in that, The hardware-in-the-loop test platform also includes an FPGA board for high-speed simulation of the motor model.
4. The control software co-simulation hardware-in-the-loop test system according to claim 1, characterized in that, The test project management platform includes a database for storing and managing test assets, which include test requirements, test cases, test models, test code, test reports, and test issues.
5. The control software co-simulation hardware-in-the-loop test system according to claim 1, characterized in that, The test project management platform includes a project management module and a test management module; The project management module is used to manage test projects, user permissions, and email notification rules. The test management module is used to manage the entire process of test requirements, test models, test code, test cases, test execution, test issues, relationships, test reports, and test resources.
6. The control software co-simulation hardware-in-the-loop test system according to claim 1 or 5, characterized in that, The test project management platform also includes a quality measurement module and a missing test analysis module. The quality measurement module is used to quantify the quality of the software development process based on test execution data and generate a measurement report. The missing test analysis module is used to analyze after-sales software problems and generate reproducible test cases.
7. The control software co-simulation hardware-in-the-loop test system according to claim 1, characterized in that, The automated testing platform and the test project management platform form a closed-loop data flow. The test report generated by the automated testing platform after executing the test is fed back to the test project management platform to drive the continuous management and optimization of test assets.
8. The control software co-simulation hardware-in-the-loop testing system according to claim 7, characterized in that, The automated testing platform includes a build scheduling module, which is communicatively connected to the code configuration library. The build scheduling module is configured to: in response to the triggering of a test task, automatically extract the target version of the controller software code from the code configuration library and automatically build it to generate an executable file; It automatically schedules static testing tools to perform static code testing, schedules dynamic testing tools to perform model-in-the-loop testing and software-in-the-loop testing, and schedules the hardware-in-the-loop testing platform to perform automated hardware-in-the-loop testing; The automated testing platform is also connected to a continuous integration server to submit the built test tasks to the continuous integration server, and the continuous integration server will periodically trigger the test building and execution, generate test reports, and automatically push them to designated terminals.
9. A control software co-simulation hardware-in-the-loop testing method, said method being applied to the control software co-simulation hardware-in-the-loop testing system as described in any one of claims 1 to 7, characterized in that, Includes the following steps: Step S1: Load the controlled object model, which includes the virtual controller model, into the real-time simulator and run it; Step S2: Establish a signal connection with one or more physical controllers under test via the IO interface board; Step S3: Select the type and quantity of the controller under test, and connect the selected type of controller under test as a physical controller to the test loop. At the same time, configure the unconnected controllers of the same type to run in the real-time simulator by their corresponding virtual controller models, so as to form a hybrid test environment containing physical controllers and virtual controller models. Step S4: Schedule and execute automated test scripts through the automated test platform to control the controlled object model to simulate the operating conditions, so that the physical controller and the virtual controller model can perform dynamic data interaction to complete the closed-loop test.
10. The control software co-simulation hardware-in-the-loop testing method according to claim 9, characterized in that, Test cases are provided to the automated testing platform through the test project management platform; test reports are then fed back to the test project management platform for storage and management through the automated testing platform.