Automated testing method, device and platform for automobiles
By generating test cases and scripts through automated testing methods, the problems of long testing cycles and low efficiency in the automotive industry are solved. This enables efficient and accurate test report generation and library file updates, and is applicable to functional specification testing of different vehicle models.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-27
- Publication Date
- 2026-03-17
AI Technical Summary
Existing technologies for automobile testing suffer from long testing cycles, low efficiency, and poor accuracy. Manual testing methods cannot meet the testing requirements for complex functions.
An automated testing approach is adopted, which automatically completes the test and generates reports by generating test cases and scripts. It uses CAN bus simulation information and database to match test requirements and controls power supply and sensors to perform test actions.
Shorten the testing cycle, save labor costs, improve testing efficiency and accuracy, and generate automated test library files associated with the vehicle functional specification version to facilitate efficient testing of different vehicle models.
Smart Images

Figure CN115729798B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of automotive testing technology, and in particular to an automated testing method, apparatus, and platform for automobiles. Background Technology
[0002] Currently, users have increasingly higher functional requirements for automobiles. For example, Electric Power Steering (EPS), as one of the core components of automobiles, has evolved from providing basic assistance to achieving auxiliary control to fully automated control. Different customer needs have resulted in huge development requirements for the hardware and software of EPS, which in turn has led to a corresponding increase in the workload of automobile testing.
[0003] In related technologies, during vehicle testing, testers manually create test scripts and test cases, perform manual testing based on these scripts and cases, and manually generate test reports. However, this manual testing method is not only time-consuming and inefficient, but also lacks accuracy and objectivity, thus reducing the reliability of the tests. Summary of the Invention
[0004] In view of this, the present invention aims to propose an automated testing method for automobiles. This method can realize automated testing of automobiles, effectively shorten the testing cycle, save labor costs, improve testing efficiency and accuracy, and enhance objectivity. Furthermore, it can generate an automated test library file, which is associated with the version of the vehicle's functional requirements specification, facilitating the efficient application of corresponding functional specifications for testing different vehicle models and ensuring the uniqueness of the tests.
[0005] To achieve the above objectives, the technical solution of the present invention is implemented as follows:
[0006] An automated testing method for automobiles includes the following steps:
[0007] Obtain the current testing requirements for the vehicle to be tested;
[0008] Generate at least one test case based on the current testing requirements, and use the at least one test case to generate at least one test script to test the vehicle under test; and
[0009] The system controls the vehicle under test to complete the test based on the at least one test script, and generates a test report for the vehicle under test based on the test data and test results during the test process.
[0010] Further, generating at least one test case based on the current testing requirements includes:
[0011] Based on the current testing requirements, generate simulation information for the vehicle's CAN / CANFD bus;
[0012] The simulation information is used to match the test environment information and / or test fault data of the vehicle under test;
[0013] The at least one test case is obtained based on the test environment information and / or test failure data.
[0014] Further, generating at least one test case based on the current testing requirements includes:
[0015] A test identifier that identifies the current test requirement;
[0016] Match the at least one test case from the database based on the test identifier and the current test requirements.
[0017] Furthermore, it also includes:
[0018] The database is updated every preset time interval based on the received update information.
[0019] Furthermore, controlling the vehicle under test to complete the test based on the at least one test script includes:
[0020] The at least one test script is used to generate at least one CAN command related to the voltage of the power supply, the control of the IG switch, and the output signal of the sensor, respectively.
[0021] The power supply, IG switch, and / or sensor are controlled to perform corresponding test actions according to at least one CAN command.
[0022] Compared with existing technologies, the automated testing method for automobiles described in this invention has the following advantages:
[0023] The automated testing method for automobiles described in this invention generates automated test cases and writes automated test scripts based on test requirements to automatically complete tests and generate test reports, thereby achieving automated testing of automobiles. This effectively reduces the testing cycle, saves labor costs, improves testing efficiency and accuracy, and enhances objectivity. Furthermore, it can generate an automated test library file, which is associated with the version of the vehicle's functional specifications, facilitating efficient testing of different vehicle models and ensuring test uniqueness.
[0024] Another objective of this invention is to provide an automated testing device for automobiles. This device can realize automated testing of automobiles, effectively reduce the testing cycle, save labor costs, improve testing efficiency and accuracy, and enhance objectivity. Furthermore, it can generate an automated test library file, which is associated with the version of the vehicle's functional requirements specification, facilitating efficient testing and ensuring uniqueness of tests for different vehicle models using the corresponding functional specifications.
[0025] To achieve the above objectives, the technical solution of the present invention is implemented as follows:
[0026] An automated testing device for automobiles, comprising:
[0027] The acquisition module is used to acquire the current testing requirements of the vehicle to be tested;
[0028] A generation module is configured to generate at least one test case based on the current testing requirements, and to generate at least one test script for testing the vehicle under test using the at least one test case; and
[0029] The testing module is used to control the vehicle under test to complete the test based on the at least one test script, and to generate a test report for the vehicle under test based on the test data and test results during the test process.
[0030] Further, the generation module is used to generate simulation information of the vehicle's CAN / CANFD bus according to the current test requirements, match the test environment information and / or test fault data of the vehicle under test according to the simulation information, and obtain the at least one test case according to the test environment information and / or test fault data; or,
[0031] The generation module is used to identify the test identifier of the current test requirement, and match the at least one test case from the database according to the test identifier and the current test requirement.
[0032] Furthermore, it also includes:
[0033] The update module is used to update the database according to the received update information at preset intervals.
[0034] Furthermore, the test module is used to generate at least one CAN command related to the voltage of the power supply, the control of the IG switch, and the output signal of the sensor using the at least one test script, and to control the power supply, IG switch, and / or sensor to perform corresponding test actions according to the at least one CAN command.
[0035] The automated testing device for automobiles described above has the same advantages over existing technologies as the automated testing method for automobiles described above, and will not be repeated here.
[0036] Another objective of this invention is to propose an automated testing platform for automobiles. This platform can realize automated testing of automobiles, effectively shorten the testing cycle, save labor costs, improve testing efficiency and accuracy, and enhance objectivity. Furthermore, it can generate automated test library files, which are associated with the version of the vehicle's functional requirements specification, facilitating efficient testing and ensuring uniqueness of tests for different vehicle models using the corresponding functional specifications.
[0037] To achieve the above objectives, the technical solution of the present invention is implemented as follows:
[0038] An automated testing platform for automobiles is provided, which is equipped with the automated testing device for automobiles as described in the above embodiments.
[0039] The automated testing platform for automobiles described above has the same advantages over existing technologies as the automated testing device for automobiles mentioned above, and will not be repeated here. Attached Figure Description
[0040] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an undue limitation of the invention. In the drawings:
[0041] Figure 1 This is a flowchart of the automated testing method for automobiles according to an embodiment of the present invention;
[0042] Figure 2 This is a schematic diagram of the structure of the automated testing system described in an embodiment of the present invention;
[0043] Figure 3 This is a block diagram of the automated testing device for automobiles according to an embodiment of the present invention. Detailed Implementation
[0044] It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other.
[0045] With the rapid advancements in automotive electrification, intelligentization, and connectivity, intelligent features and overall vehicle comfort have become indispensable components in evaluating vehicle performance. Therefore, users are no longer satisfied with just basic functions; current products demand greater complexity than simply fulfilling basic driving needs. For example, the electric power steering (EPS) system, a core automotive component, has evolved from providing basic assistance to achieving assisted control and fully automated control. These diverse customer demands have resulted in enormous hardware and software development requirements for EPS, leading to a corresponding increase in testing workload.
[0046] To shorten R&D cycles and save development costs, OEMs often develop vehicle models on a platform-based model. Within this platform, the technical requirements documents are often identical or similar. However, the testing methods for these technologies involve testers manually creating test scripts and test cases, resulting in long testing cycles and slightly lower accuracy, timing, and uniqueness. Specifically, these technologies suffer from the following shortcomings:
[0047] (1) The current testing method is entirely manual, which has a long testing cycle, is not easy to manage, has poor document traceability management, and requires manual issuance of test reports.
[0048] (2) There are many testers, and the work is repetitive, which is not conducive to platform function porting testing.
[0049] (3) The execution time or operation time of each step is relatively random when using manual testing, and the working conditions are poorly reproduced.
[0050] Therefore, embodiments of the present invention can employ automated testing methods, perform upgrade management based on corresponding test documents, have testers extract test requirements, compile test cases, and build automated test scripts based on software such as CANoe software, complete the test, and generate test reports.
[0051] The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0052] Figure 1 This is a flowchart of an automated testing method for automobiles according to an embodiment of the present invention.
[0053] like Figure 1 As shown, the automated testing method for automobiles according to an embodiment of the present invention includes the following steps:
[0054] Step S101: Obtain the current test requirements for the vehicle to be tested.
[0055] In this invention, the current test requirements can be obtained in various ways. For example, user voice can be collected and recognized to obtain the current test requirements; another example is to collect the trigger signal when the user presses a button, wherein the trigger signal has a corresponding relationship with the test requirements, and the user's current test requirements can be determined based on the trigger signal.
[0056] Step S102: Generate at least one test case based on the current testing requirements, and use the at least one test case to generate at least one test script for testing the vehicle under test.
[0057] It is understood that the embodiments of the present invention can automatically generate test cases and test scripts according to testing requirements, thereby saving manual labor time, eliminating the need for manual construction of test cases and test scripts, and improving testing efficiency. Furthermore, the automated generation of test cases and test scripts ensures that the test procedures are identical under the same testing requirements, allowing for the use of the same test procedures and accurate determination of test conclusions.
[0058] In some embodiments, generating at least one test case based on current test requirements includes: generating simulation information of the vehicle's CAN / CANFD bus based on current test requirements; matching the test environment information and / or test fault data of the vehicle under test based on the simulation information; and obtaining at least one test case based on the test environment information and / or test fault data.
[0059] The simulation information can be a simulation message. In this embodiment of the invention, the physical variables of the simulation information can be extracted through environment variables. At the same time, the environment variables also involve the use of the fault injection module in CAN communication. The fault injection module can generate faults such as physical value anomaly verification algorithm anomaly and message loss. The definition of this part of the environment variables is defined by the input and output signals in the test case.
[0060] Therefore, embodiments of the present invention can automatically generate at least one test case by matching test environment information and / or test fault data with simulation information, thereby saving manual labor time, eliminating the need for manual test case building, and improving testing efficiency.
[0061] In some embodiments, generating at least one test case based on current test requirements includes: identifying a test identifier for the current test requirements; and matching at least one test case from a database based on the test identifier and the current test requirements.
[0062] It is understood that, according to the test requirements, the embodiments of the present invention can also directly match at least one test case from the database to automatically generate test cases, thereby saving manual time, eliminating the need for manual test case building, and improving test efficiency.
[0063] In this embodiment, the database is updated every preset time interval based on the received update information.
[0064] The preset duration can be set according to actual needs and is not specifically limited. This embodiment of the invention can update the database in a timely manner to meet the development needs of automobiles.
[0065] Step S103: Control the vehicle under test to complete the test based on at least one test script, and generate a test report for the vehicle under test based on the test data and test results during the test process.
[0066] It is understood that the embodiments of the present invention can use automated testing methods to deliver test scripts and perform tests, and can automatically generate test reports, thereby effectively saving labor costs and improving the objectivity and accuracy of testing.
[0067] In this embodiment, the vehicle under test is controlled to complete the test based on at least one test script, including: using at least one test script to generate at least one CAN command related to the voltage of the power supply, the control of the IG switch, and the output signal of the sensor; and controlling the power supply, IG switch, and / or sensor to perform corresponding test actions according to at least one CAN command.
[0068] It is understood that embodiments of the present invention can use CAN communication to control the power supply voltage, the IG switch, and the sensor output signal. The control process of the IG switch is as follows:
[0069] The CAN command is initiated by the microcontroller receiving CAN messages from the CAN transceiver module and sending an IG status request command via CANoe. The microcontroller drives the relay to turn on and off through the I / O port and the relay driver circuit. One end of the relay is connected to the positive terminal of the CAN control power supply, and the other end is connected to the ECU. When the relay is closed, the positive terminal of the power supply is connected to the IG line, and the IG status is ON. When the relay is open, the IG line is disconnected, and the IG status is OFF. Thus, the IG status is controlled via CAN.
[0070] In summary, the testing method of this invention has at least the following effects:
[0071] (1) Save manpower and time by using automated testing methods to deliver test scripts for software testing;
[0072] (2) Use automated test case IDs for traceability to facilitate the correspondence between test points and source documents;
[0073] (3) The automated testing methods are matched and updated with the platform functional specifications of the OEM, and are applicable to all models of the implementation specifications, thus increasing testing efficiency and applicability;
[0074] (4) Using the same test procedure for testing can accurately and clearly determine the test conclusion;
[0075] (5) Automated generation of test reports saves labor costs and improves objectivity and accuracy.
[0076] It should be noted that the testing method of this invention can be applied to the automated testing system shown in Figure 2, including: test cases, system variables, environment variables, control module, CCP / XCP protocol integration module, and vehicle bus simulation module, wherein,
[0077] (1) Test cases ID1 to IDn are test cases extracted from the platform function files. They include test sequence and working condition action process according to time. Control instructions are completed by calling parameters in system variables.
[0078] (2) System variables, including flag bits for the ECU to execute various actions and physical value signals that need to be sent to the actual vehicle, internal parameters of the controller that need to be uploaded using CCP / XCP, and status feedback of each control module to be received and updated.
[0079] (3) Test cases and system variables: This part is associated with the functional documents of the whole vehicle and managed as the same version. When the functional strategy changes, the test cases and system variables should also be updated synchronously.
[0080] (4) Environmental variables include fault injection flags, vehicle control signals and signals emitted by the ECU, which serve as interface information between the vehicle and the test cases;
[0081] (5) The control module uses CAN communication to control the voltage of the power supply, the IG switch, and the sensor output signals. The control module obtains signal values from system variables to execute corresponding control based on the signals. The signal values are obtained by the microcontroller (Electronic Control Unit, ECU) receiving CAN messages from the CAN transceiver module and sending IG status request commands from the CANoe. The microcontroller drives the relay to turn on and off through the IO port and the relay drive circuit. One end of the relay is connected to the positive terminal of the CAN control power supply, and the other end is connected to the ECU. When the relay is closed, the positive terminal of the power supply is connected to the IG line, and the IG state is ON. When the relay is open, the IG line is disconnected, and the IG state is OFF. The IG state is controlled by CAN.
[0082] (6) The CCP / XCP protocol integration module will integrate DAQ mode and periodically upload the required ECU internal control signals;
[0083] (7) The vehicle bus simulation module is used to simulate vehicle bus information.
[0084] Based on such Figure 2 The automated testing system shown in this embodiment of the invention enables the automated testing of automobiles as follows:
[0085] First, the automated testing system consists of a programmable DC power supply, an automated CAN IG control module, a CAN control torque sensor module, and a CANoe module. The Caple module within CANoe constructs a simulation message of the vehicle's CAN bus, and extracts the physical variables of the simulation message through environment variables. These environment variables utilize a fault injection module in CAN communication to generate faults such as physical value anomalies, algorithmic errors, and message loss. The environment variables are defined based on the input and output signals in the test cases, and their construction content is determined according to the functional specifications of all test vehicle models. System variables for CANoe are built based on these environment variables. These system variables are used to assign values to the environment variables and can be updated according to the version number of the functional specifications.
[0086] Secondly, in this embodiment of the invention, the Testcase module in CANoe is used to compile Teststeps, and the Testcase script supports the compilation and parsing of protocol instructions based on CCP or XCP, thereby obtaining the internal variable parameters of the control module. At the same time, the programmable DC power supply, the automated CAN IG control module, and the CAN control torque sensor module are all uniformly coordinated and controlled by the Testcase module through the private CAN or CANFD, thereby enabling arbitrary test and input environments.
[0087] According to the automated testing method for automobiles of the present invention, automated test cases are generated based on test requirements, and automated test scripts are written to automatically complete the tests and automatically generate test reports, thereby realizing automated testing of automobiles, effectively reducing the test cycle, saving labor costs, improving test efficiency and accuracy, and enhancing objectivity. Furthermore, an automated test library file can be generated, which is associated with the version of the vehicle requirement functional specifications, facilitating the efficient application of corresponding functional specifications for different vehicle models and ensuring the uniqueness of the tests.
[0088] Furthermore, such as Figure 3 As shown, an embodiment of the present invention also discloses an automated testing device 10 for automobiles, comprising: an acquisition module 100, a generation module 200, and a testing module 300.
[0089] Specifically, such as Figure 3 As shown, the acquisition module 100 is used to acquire the current test requirements of the vehicle under test; the generation module 200 is used to generate at least one test case based on the current test requirements, and to generate at least one test script for testing the vehicle under test using the at least one test case; the testing module 300 is used to control the vehicle under test to complete the test based on the at least one test script, and to generate a test report for the vehicle under test based on the test data and test results during the test process.
[0090] Furthermore, the generation module 200 is used to generate simulation information of the vehicle's CAN / CANFD bus according to the current test requirements, match the test environment information and / or test fault data of the vehicle under test according to the simulation information, and obtain at least one test case according to the test environment information and / or test fault data; or, the generation module 200 is used to identify the test identifier of the current test requirements, and match at least one test case from the database according to the test identifier and the current test requirements.
[0091] Furthermore, the apparatus 10 in this embodiment of the invention further includes an update module. The update module is configured to update the database according to received update information every preset time interval.
[0092] Furthermore, the test module 300 is used to generate at least one CAN command related to the voltage of the power supply, the control of the IG switch, and the output signal of the sensor using at least one test script, and to control the power supply, the IG switch, and / or the sensor to perform corresponding test actions according to the at least one CAN command.
[0093] It should be noted that the specific implementation of the automated testing device for automobiles in this embodiment of the invention is similar to the specific implementation of the automated testing method for automobiles. To reduce redundancy, it will not be described in detail here.
[0094] The automated testing device for automobiles according to embodiments of the present invention generates automated test cases and writes automated test scripts based on test requirements to automatically complete tests and generate test reports, thereby realizing automated testing of automobiles, effectively reducing the test cycle, saving labor costs, improving test efficiency and accuracy, and enhancing objectivity. Furthermore, it can generate automated test library files, which are associated with the version of the vehicle's functional specifications, facilitating the efficient application of corresponding functional specifications for different vehicle models and ensuring test uniqueness.
[0095] Furthermore, embodiments of the present invention disclose an automated testing platform for automobiles, which is equipped with the automated testing device for automobiles described above. Because of this device, the platform can achieve automated testing of automobiles, effectively reducing the testing cycle, saving labor costs, improving testing efficiency and accuracy, and enhancing objectivity. It can also generate automated test library files, which are associated with the version of the vehicle's functional requirements specification, facilitating efficient testing of different vehicle models and ensuring test uniqueness.
[0096] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. An automated testing method of an automobile, characterized by, The method comprises the following steps: obtaining current test requirements of a to-be-tested automobile; generating at least one test case according to the current test requirements and generating at least one test script for testing the to-be-tested automobile by using the at least one test case, which specifically comprises: generating simulation information of a whole vehicle CAN / CANFD bus according to the current test requirements, and leading out physical variables in the simulation information through environment variables, wherein the environment variables include a fault injection flag, whole vehicle control signals and output signals of ECUs; building system variables of CANoe based on the environment variables, wherein the system variables are used for assigning values to the environment variables, the test case is associated with the system variables according to a functional document of the whole vehicle, and when a functional strategy changes, the test case and the system variables are synchronously updated; the system variables include flags of ECU performing various actions, physical value signals of an external real vehicle, internal control signals uploaded through a CCP protocol or an XCP protocol and state feedbacks of receiving updates of various modules; based on the environment variables and the system variables, compiling at least one test case, and generating at least one test script for testing the to-be-tested automobile by using the at least one test case; and controlling the to-be-tested automobile to complete testing based on the at least one test script, and generating a test report of the to-be-tested automobile according to test data and test results in a test process; the controlling the to-be-tested automobile to complete testing based on the at least one test script comprises: generating at least one CAN instruction related to a voltage of a power supply, control of an IG switch and output signals of sensors by using the at least one test script; controlling the power supply, the IG switch and / or the sensors to perform corresponding test actions according to the at least one CAN instruction through a control module, wherein the control module provides the at least one CAN instruction through the system variables.
2. The method of claim 1, wherein, the generating at least one test case according to the current test requirements comprises: generating simulation information of a whole vehicle CAN / CANFD bus according to the current test requirements; matching test environment information and / or test fault data of the to-be-tested automobile according to the simulation information; obtaining the at least one test case according to the test environment information and / or the test fault data.
3. The method of claim 1, wherein, the generating at least one test case according to the current test requirements comprises: identifying a test identifier of the current test requirements; matching the at least one test case from a database according to the test identifier and the current test requirements.
4. The method of claim 3, wherein, It also comprises: updating the database according to received update information every preset time length.
5. An automated testing device for an automobile, characterized by The device for implementing the automatic test method of the automobile according to any one of claims 1-4 comprises: an obtaining module for obtaining current test requirements of a to-be-tested automobile; a generating module for generating at least one test case according to the current test requirements and generating at least one test script for testing the to-be-tested automobile by using the at least one test case; and The test module is configured to control the to-be-tested automobile to complete a test based on the at least one test script, and generate a test report of the to-be-tested automobile according to test data and test results in the test process. The test module is configured to generate at least one CAN instruction related to a voltage of a power supply, control of an IG switch and an output signal of a sensor respectively by using the at least one test script, and control the power supply, the IG switch and / or the sensor to perform corresponding test actions according to the at least one CAN instruction.
6. The apparatus of claim 5, wherein, The generation module is configured to generate simulation information of a whole vehicle CAN / CANFD bus according to the current test requirement, match test environment information and / or test fault data of the to-be-tested automobile according to the simulation information, and obtain the at least one test case according to the test environment information and / or the test fault data; or, The generation module is configured to identify a test identifier of the current test requirement, and match the at least one test case from a database according to the test identifier and the current test requirement.
7. The apparatus of claim 6, wherein, Further comprising: An update module configured to update the database according to received update information every preset time length.
8. An automated test platform for automobiles, characterized by, An automotive test device comprising the automotive test device according to any one of claims 5-7.
Citation Information
Patent Citations
ECU automatic test method and system, storage medium and device
CN112068530A
Automobile CAN communication fault test system, method and device and storage medium
CN113259209A