Controller test method and system and electronic equipment
By connecting multiple controllers on the test platform, creating test projects and importing test configurations, and using the test resources of other controllers to supplement insufficient resources, the problem of low controller testing efficiency in the existing technology is solved, and efficient and reliable controller testing is achieved.
Patent Information
- Application Number
- CN202510223027.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-27
- Publication Date
- 2025-05-30
AI Technical Summary
In the prior art, controller testing is inefficient because only a single test resource can be used to test a single controller.
Provide a test method for controllers, connecting to at least two controllers through a test platform, creating test engineering and test action parameters of each controller, importing the test configuration of the target controller, and replenishing insufficient resources using the test resources of other controllers to realize simultaneous testing of multiple controllers.
It improves the testing efficiency of the controller, reduces the redundancy of hardware test resources, improves the reliability of tests, and improves the utilization rate of test resources.
Smart Images

Figure CN120065997A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of testing technologies, and particularly to a method and apparatus for testing a controller and an electronic device. Background Art
[0002] Currently, a controller is used to implement the control of different functions of a device. Before the controller is put into use in the target device, in order to ensure the reliability of the controller, the controller will be tested. In the prior art, when testing the controller, only a single test resource can be used to test one controller alone, but the test efficiency of this test method is very low. Summary of the Invention
[0003] In view of the above problems, this application provides a method and system for testing a controller and an electronic device, which are used to solve the problem that in the prior art, only a single test resource is used to test one controller alone, but the test efficiency of this test method is very low.
[0004] According to a first aspect of an embodiment of this application, a method for testing a controller is provided, which is applied to a test platform. The test platform is respectively connected to at least two controllers. The test method includes: in response to an engineering creation instruction, creating test projects for each controller, and creating test action parameters and test environment models corresponding to each controller; importing the test action parameters and the test environment model of the target controller into the corresponding test project to obtain a target test configuration, where the target controller is any one of the controllers; if the initial test resources corresponding to the target controller are insufficient, using the test resources corresponding to other controllers as the target test resources of the target controller; based on the target test configuration, invoking the target test resources to test the target controller to obtain a test result of the target controller.
[0005] In an optional manner, after invoking the target test resources to test the target controller based on the target test configuration to obtain a test result of the target controller, it further includes: constructing corresponding test files according to the test cases corresponding to each controller; the test files include each test case, and the test conditions, test statuses, and sub-test results corresponding to each test case; generating corresponding test reports according to the sub-test results of the test cases corresponding to each controller; the test reports further include the test case functions, the test conditions, and the test statuses corresponding to each sub-test result.
[0006] In an alternative approach, the testing method further includes: traversing each of the controllers and designating the traversed controller as the target controller; constructing a 3D model of the target controller, and generating, in the 3D model based on the target test case of the target controller, a virtual animation corresponding to the target test action represented by the target test case, and a virtual icon corresponding to the sub-test result of the target test case; wherein, the virtual icon indicates whether the target test case has been successfully executed; and the target test case is a test case in the current test.
[0007] In an alternative approach, the testing method further includes: the project creation instruction is an instruction generated by any one of the host computers; wherein, each of the controllers is connected to a corresponding host computer.
[0008] According to a second aspect of the embodiments of the present application, there is provided a testing system for a controller, the testing system including: a testing platform and at least two test benches, the testing platform being respectively connected to each of the test benches, each test bench being connected to a corresponding controller, and each test bench including initial test resources; the testing platform is configured to, in response to a project creation instruction, create test projects for each of the controllers, and create test action parameters and test environment models corresponding to each of the controllers; and is further configured to import the test action parameters and the test environment model of the target controller into the corresponding test project to obtain a target test configuration; wherein, the target controller is any one of the controllers; if the initial test resources corresponding to the target controller are insufficient, then use the test resources corresponding to other controllers as the target test resources of the target controller; the testing platform is further configured to, based on the target test configuration, call the target test resources to test the target controller to obtain the test result of the target controller.
[0009] In an alternative approach, the testing platform is further configured to construct corresponding test files according to the test cases corresponding to each of the controllers; the test files include each of the test cases, and the test conditions, test statuses, and sub-test results corresponding to each test case; the testing platform is further configured to generate corresponding test reports according to the sub-test results of the test cases corresponding to each of the controllers; the test reports further include the test case functions, the test conditions, and the test statuses corresponding to each of the sub-test results.
[0010] In an alternative manner, the test platform is further configured to traverse each of the controllers, and use the traversed controller as a target controller; construct a three-dimensional model of the target controller, and generate a virtual animation corresponding to a target test action represented by the target test case and a virtual icon corresponding to a test result of the target test case in the three-dimensional model, where the virtual icon can represent whether the target test case is successfully executed; and the target test case is a test case in the current test.
[0011] In an alternative manner, each of the test benches further includes: a host computer and a test cabinet. The host computer in each test bench is connected to a slave computer, and the slave computer is disposed in the test cabinet; the host computer is further configured to configure a target communication protocol of the slave computer according to an interface of the target controller, so as to implement communication between the test cabinet and the target controller.
[0012] In an alternative manner, the test platform is disposed in any one of the host computers of multiple test benches, and is further configured to generate the project creation instruction.
[0013] According to a third aspect of the embodiments of the present application, an electronic device is provided, including: a controller; a memory, configured to store one or more programs, and when the one or more programs are executed by the controller, the controller is caused to implement the following operations of the test method: in response to a project creation instruction, create test projects for each controller, and create test action parameters and a test environment model corresponding to each controller; import the test action parameters and the test environment model of the target controller into the corresponding test project to obtain a target test configuration, where the target controller is any one of the controllers; if the initial test resources corresponding to the target controller are insufficient, use the test resources corresponding to other controllers as the target test resources of the target controller; and based on the target test configuration, call the target test resources to test the target controller to obtain a test result of the target controller.
[0014] In this application, by responding to the engineering creation instruction, test projects for each controller are created. Compared with the prior art where a single test resource is used to test one controller separately, in this embodiment, multiple controllers can be tested simultaneously, which can improve the test efficiency of the controllers. And test action parameters and test environment models corresponding to the respective controllers are created to implement the construction of the hardware test environment and virtual test environment for each controller. By constructing the test environment model, a test controller that does not need to interact with the target controller can be used. Compared with the prior art where an entity test controller is connected to interact with the target controller, the hardware test resources are further reduced, thereby reducing the redundancy of the test system and improving the reliability of the test. Then, the test action parameters and test environment model of the target controller are imported into the corresponding test project to obtain the target test configuration. If the initial test resources corresponding to the target controller are insufficient, the test resources corresponding to other controllers are used as the target test resources for the target controller. Based on the target test configuration, the target test resources are called to test the target controller to obtain the test result of the target controller, which can solve the problem of insufficient test resources caused by using fixed single test resources to test the controller in the prior art and can utilize the unused test resources corresponding to other controllers, improving the utilization rate of the test resources.
[0015] The above description is only an overview of the technical solution of the embodiment of this application. In order to be able to understand the technical means of the embodiment of this application more clearly, it can be implemented according to the content of the specification. And in order to make the above and other purposes, features and advantages of the embodiment of this application more obvious and understandable, the specific embodiments of this application are specifically given below. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The drawings are only used to illustrate the embodiments and are not considered as a limitation to this application. And throughout the drawings, the same reference numerals are used to represent the same components. In the drawings:
[0017] Figure 1 The flowchart of the first embodiment of a method for testing a controller provided by this application is shown.
[0018] Figure 2 The flowchart of the second embodiment of a method for testing a controller provided by this application is shown
[0019] Figure 3 The structural schematic diagram of a test system for a controller provided by the embodiment of this application is shown.
[0020] Figure 4 The structural schematic diagram of the embodiment of the electronic device of this application is shown. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0021] Here, exemplary embodiments will be described in detail, and examples thereof are shown in the accompanying drawings. When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0022] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0023] The flowcharts shown in the accompanying drawings are merely illustrative and do not necessarily include all contents and operations / steps, nor do they necessarily need to be executed in the described order. For example, some operations / steps can be decomposed, while some operations / steps can be combined or partially combined, so the actual execution order may change according to the actual situation.
[0024] In the present application, "a plurality of" means two or more. "And / or" describes the association relationship of associated objects and indicates that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally represents an "or" relationship between the associated objects before and after.
[0025] Currently, a controller is used to implement the control of different functions of a device. Before the controller is put into use for the target device, in order to ensure the reliability of the controller, the controller will be tested. In the prior art, when testing the controller, only a single test resource can be used to test a single controller alone, and the test efficiency of this test method is very low. For example, a vehicle includes multiple controllers, such as a cockpit domain controller, a door controller, and a window controller, etc., to implement the control of different functions in the vehicle.
[0026] Figure 1 The flowchart of the first embodiment of a method for testing a controller provided by the present application is shown. This method is executed by a test platform, and the test platform is respectively connected to at least two controllers. Please refer to Figure 1 As shown, the method includes the following steps:
[0027] Step S110: In response to an engineering creation instruction, create a test project for each controller, and create test action parameters and a test environment model corresponding to the target controller; where the target controller is any one of the controllers.
[0028] Among them, when the user tests each controller, a test project for the target controller needs to be established to enable testing of the target controller. Exemplarily, clicking "Create test configuration" in the page window of the test platform will generate a.stc file; the test action parameters are used to characterize the test content that the target controller needs to perform and the hardware test resources that need to be utilized. Exemplarily, the test experiment environment XIL (X-in-the-loop, an API standard applicable to all "in-the-loop" systems) application port service can be added in the configuration window of the test platform, and a port configuration xml file can be added; the test environment model is used to characterize the virtual simulation model that needs to interact with the target controller during the test process. For example, if the target controller is a cockpit controller, it needs to interact with the window controller. By establishing the window controller as a virtual simulation model, the test of the cockpit controller can be realized. Exemplarily, PlantModel can be selected in the test platform, and finally a.scf file is saved to complete the establishment of the test environment model.
[0029] Step S120: Import the test action parameters and the test environment model of the target controller into the corresponding test project to obtain the target test configuration; where the target controller is any controller.
[0030] Among them, importing the test action parameters and the test environment model into the test project realizes the establishment of the hardware test environment and the virtual test environment of the target controller, and realizes the connection between the hardware test resources and the virtual test environment, forming the target test configuration of the target controller.
[0031] Step S130: If the initial test resources corresponding to the target controller are insufficient, use the test resources corresponding to other controllers as the target test resources of the target controller.
[0032] Among them, when the user creates a test project, the initial test resources corresponding to each controller will be obtained. Exemplarily, the Local Host can be selected in the tool window of the test platform, and a port with the Port Type of ModelACCESS can be created. By calculating the required test resources of the target controller, it is determined whether the initial test resources corresponding to the target controller are sufficient. If the initial test resources of the target controller are insufficient, the test resources in other cabinets will be used as the target test resources of the target controller to meet the test resource requirements for the target control. Exemplarily, if the initial test resources of the target controller are insufficient, the test resources corresponding to other controllers can be directly called separately for testing and used as the test resources of the target controller. The number of other controllers can be 1 or more; the initial test resources of the target controller and the test resources of other controllers can also be used together as the target test resources of the target controller, and the number of other controllers can be 1 or more. Specifically, the initial test resources include a preset number of CAN resources. If the CAN resources of the target controller are insufficient, the CAN resources of other controllers will be used as the target CAN resources; the target controller requires 15 CAN resources. If the target controller has 10 CAN resources and another test bench has 15 CAN resources, the 15 CAN resources of the other test bench can be selected as the target CAN resources; or 10 CAN resources in the target controller and 5 CAN resources in another test bench, a total of 15 CAN resources can be selected as the target CAN resources of the target controller.
[0033] Step S140: Based on the target test configuration, call the target test resources to test the target controller to obtain the test result of the target controller.
[0034] Among them, the test platform calls the target test resources according to the generated target test configuration to implement the test of the target controller, thereby obtaining the test result of the target controller.
[0035] In this embodiment, by responding to the engineering creation instruction, a test project for each controller is created. Compared with the prior art in which a single test resource is used to test one controller alone, multiple controllers can be tested simultaneously in this embodiment, which can improve the test efficiency of the controllers, and create the corresponding test action parameters and test environment models for each controller to realize the construction of the hardware test environment and virtual test environment for each controller. By constructing the test environment model, a test controller that does not need to interact with the target controller can be used. Compared with the prior art in which an entity test controller is connected to interact with the target controller, the hardware test resources are further reduced, thereby reducing the redundancy of the test system and improving the reliability of the test. The test action parameters and the test environment model are imported into the test project to obtain the target test configuration. If the initial test resources corresponding to the target controller are insufficient, the test resources corresponding to other controllers are used as the target test resources for the target controller. Based on the target test configuration, the target test resources are called to test the target controller to obtain the test result of the target controller, which can solve the problem of insufficient test resources caused by using fixed single test resources to test the controller in the prior art, and can utilize the unused test resources corresponding to other controllers to improve the utilization rate of the test resources.
[0036] Figure 2 The flowchart of the second embodiment of a test method for a controller provided by the present application is shown. Please refer to Figure 2 as shown, after step S140 in Figure 1 further includes steps S210 to S220, which are introduced in detail as follows:
[0037] Step S210: Construct corresponding test files according to the test cases corresponding to each controller; the test files include each test case, as well as the test conditions, test status, and sub-test results corresponding to each test case;
[0038] Among them, each controller corresponds to multiple test cases, and each test case represents a test item of the target controller. Since the test items are different, each test case has corresponding test conditions, test status, and sub-test results; the test conditions are the condition parameter configurations for performing this test case. For example, when testing the function of controlling the vehicle to move forward, the gear needs to be configured to the forward gear and the accelerator pedal needs to be controlled to be stepped on; the test status represents the progress status of the test process. For example, the test status includes processes such as the test conditions being written into the test resources corresponding to the target controller, waiting for the test process to run, and reading the test results. By obtaining the test status of each test case, the test process corresponding to each test case can be known, so that the test process can be monitored; the sub-test result represents the test result parameters of the test case and whether the test is passed.
[0039] By constructing test files, it is possible to clearly know each test case included in each controller, as well as the test conditions, test status, and sub-test results corresponding to each test case, facilitating users to find the test cases corresponding to the target test controller.
[0040] Step S220: Generate corresponding test reports according to the sub-test results of the test cases corresponding to each controller; the test reports also include the test case functions, test conditions, and test status corresponding to each sub-test result.
[0041] Among them, by comprehensively analyzing the sub-test results of the test cases corresponding to each controller, corresponding test reports can be obtained. Exemplarily, the test results of all test cases of each controller can be screened, the test cases that fail the test can be selected, and the test result parameters in the unpassed test cases can be obtained, and the possible reasons for failing the test based on the test result parameters can be presented in the test report. The test reports also include the test case functions, test conditions, and test status corresponding to the sub-test results, so that users can intuitively see the test case functions, test conditions, test status, and reasons for failing the test corresponding to each test case, and can adjust the corresponding test conditions and retest the target controller.
[0042] In another embodiment of the present application, the test method further includes: traversing each controller and using the traversed controller as the target controller; constructing a three-dimensional model of the target controller, and generating a virtual animation corresponding to the target test action represented by the target test case and a virtual icon corresponding to the sub-test result of the target test case in the three-dimensional model; wherein, the virtual icon represents whether the target test case is successfully executed; the target test case is the test case in the current test.
[0043] In this embodiment, the three-dimensional model is an appearance entity model representing the target controller. For example, the target controller can be a car door, window, headlight, ambient light, wheel, body height, seat, pedal, etc. By constructing the three-dimensional model of the target controller, the virtual animation corresponding to the target test action of the target controller during the test process can be observed, and thus the change process of the test data corresponding to the target test action can be observed. For example, when testing the function of opening the car door corresponding to the target controller, the target controller is constructed as a three-dimensional model in the shape of a car door, and during the test of opening the car door, the three-dimensional model transforms into an animation of the car door opening; the test results are displayed through virtual icons. For example, when the test result is passed, the virtual icon shows a tick, and when the test result is not passed, the virtual icon shows a cross. Users can directly judge whether the target controller passes the test through the virtual icon.
[0044] Figure 3 The structural schematic diagram of a test system for a controller provided by an embodiment of the present application is shown. Please refer to Figure 3 As shown, the test system includes: a test platform and at least two test benches. The test platform is respectively connected to each test bench, and each test bench is connected to a corresponding controller. Each test bench includes initial test resources;
[0045] The test platform is used to respond to an engineering creation instruction, create test projects for each controller, and create corresponding test action parameters and test environment models for each controller; it is also used to import the test action parameters and test environment model of the target controller into the corresponding test project to obtain a target test configuration; where the target controller is any controller; it is also used to, if the initial test resources corresponding to the target controller are insufficient, use the test resources in other cabinets as the test resources of the target controller;
[0046] The test platform is also used to test the target controller by calling the target test resources based on the target test configuration to obtain the test result of the target controller.
[0047] It should be noted that each test bench includes a test cabinet, and there are corresponding initial test resources in the test cabinet. Exemplarily, the hardware part of the test cabinet includes CAN / LIN boards, ETH Ethernet boards, voltage and current acquisition boards, programmable power supplies, fault injection boards, electronic loads, etc. Its function is to establish a hardware test environment for a single bench.
[0048] By responding to the engineering creation instruction and creating test projects for each controller, compared with the prior art that uses a single test resource to test a controller alone, this embodiment can test multiple controllers simultaneously, which can improve the test efficiency of the controller, and create the corresponding test action parameters and test environment models for each controller to realize the construction of the hardware test environment and virtual test environment for each controller. By constructing the test environment model, a test controller that does not need to interact with the target controller can be used. Compared with the prior art that uses an access entity test controller to interact with the target controller, the hardware test resources are further reduced, thereby reducing the redundancy of the test system and improving the reliability of the test; and importing the test action parameters and test environment model into the test project to obtain the target test configuration. If the initial test resources corresponding to the target controller are insufficient, the test resources corresponding to other controllers are used as the target test resources of the target controller, and the target controller is tested by calling the target test resources based on the target test configuration to obtain the test result of the target controller, which can solve the problem of insufficient test resources caused by using fixed single test resources to test the controller in the prior art, and can utilize the unused test resources corresponding to other controllers, improving the utilization rate of test resources.
[0049] In another embodiment of the present application, the test platform is further configured to construct corresponding test files according to the test cases corresponding to each controller; the test files include each test case, as well as the test conditions, test status, and sub-test results corresponding to each test case;
[0050] The test platform is further configured to generate corresponding test reports according to the sub-test results of the test cases corresponding to each controller; the test reports further include the test case functions, test conditions, and test status corresponding to each sub-test result.
[0051] In this embodiment, each controller corresponds to multiple test cases, and each test case represents a test item of the target controller. Due to different test items, each test case has corresponding test conditions, test status, and sub-test results; the test conditions are the condition parameters configured for performing this test case. For example, when testing the function of controlling the vehicle to move forward, the gear needs to be configured to the forward gear and the accelerator pedal needs to be controlled to be stepped on; the test status represents the progress status of the test process. For example, the test status includes processes such as writing the test conditions into the test resources corresponding to the target controller, waiting for the test process to run, and reading the test results. By obtaining the test status of each test case, the test process corresponding to each test case can be known, and thus the test process can be monitored; the sub-test result represents the test result parameters of the test case and whether the test is passed.
[0052] By constructing the test files, each test case included in each controller, as well as the test conditions, test status, and sub-test results corresponding to each test case, can be clearly known, which is convenient for users to find the test cases corresponding to the target test controller.
[0053] By comprehensively analyzing the sub-test results of the test cases corresponding to each controller, corresponding test reports can be obtained. Exemplarily, the test results of all test cases of each controller can be screened, the test cases that fail the test can be screened out, and the test result parameters in the test cases that fail can be obtained, and the possible reasons for failing the test according to the test result parameters can be presented in the test report. The test report also includes the test case functions, test conditions, and test status corresponding to the sub-test results, so that users can intuitively see the test case functions, test conditions, test status, and reasons for failing the test corresponding to each test case, and can adjust the corresponding test conditions and retest the target controller.
[0054] In another embodiment of the present application, the test platform is further configured to traverse each controller and use the traversed controller as the target controller; construct a three-dimensional model of the target controller, and based on the target test cases of the controller, generate a virtual animation corresponding to the target test action represented by the target test case and a virtual icon corresponding to the test result of the target test case in the three-dimensional model; wherein, the virtual icon can represent whether the target test case is successfully executed; the target test case is the test case in the current test.
[0055] In this embodiment, the three-dimensional model is an appearance entity model corresponding to the target controller. For example, the target controller can be a car door, window, headlight, ambient light, wheel, vehicle body height, seat, pedal, etc. By constructing the three-dimensional model of the target controller, the virtual animation corresponding to the target test action of the target controller during the test process can be observed, and thus the change process of the test data corresponding to the target test action can be observed. For example, when testing the function of opening the car door corresponding to the target controller, the target controller is constructed as a three-dimensional model in the shape of a car door, and during the test of opening the car door, the three-dimensional model transforms into an animation of the car door opening; the test result is displayed through a virtual icon. For example, when the test result is passed, the virtual icon is displayed as a tick, and when the test result is not passed, the virtual icon is displayed as a cross. The user can directly determine whether the target controller passes the test through the virtual icon.
[0056] It should be noted that, please refer to Figure 3 As shown, the test system further includes a display screen: for displaying the virtual animation corresponding to the target test action represented by the target test case generated by the test platform and the virtual icon corresponding to the sub-test result of the target test case.
[0057] In another embodiment of the present application, please refer to Figure 3 As shown, each test bench further includes: a host computer, a slave computer, and a test cabinet. The host computer in each test bench is connected to the slave computer, and the slave computer is arranged in the test cabinet; the host computer is further configured to configure the target communication protocol of the slave computer according to the interface of the target controller to realize communication between the test cabinet and the target controller.
[0058] In this embodiment, the initial test resources are located in the test cabinet. Since there are multiple interface types for the target controller, the interfaces of the target controller include ETH Ethernet interfaces, CAN communication interfaces, and LIN communication interfaces. For example, the communication interface of the air conditioner controller is a CAN communication interface, and the communication interface of the ambient light controller is a LIN communication interface, and signal E2E verification is added; according to the communication type of the target interface, the communication protocol of the lower computer is configured. Exemplarily, according to the interface type of the target controller, the Ethernet database file ARXML, the CAN database file DBC, the LIN database file LD, etc. are configured, and the configured files are sent to the lower computer, so as to realize the communication between the test cabinet and the target controller.
[0059] It should be noted that the upper computer in each test bench is also used to create the target test action parameters and the target test environment model corresponding to the target controller, is also used to generate the target test configuration according to the target test action parameters and the target test environment model, and is also used to call the test resources of the target cabinet based on the target test configuration to test the target controller to obtain the test result. In this embodiment, each test bench can also test the connected target controller independently without testing through the test platform.
[0060] Exemplarily, complete the configuration of the lower computer, set the IP address, MAC address, VLAN, and port information of the real-time machine of the test cabinet; complete the configuration of the controller and the test bench, actually connect each controller to the hardware board resources in its respective test cabinet, add the mapping relationship of the connection in the upper computer, and import the database files of the domain controller, including the Ethernet database file ARXML, the CAN database file DBC, and the LIN database file LDF; complete the virtual environment design, load the Simulink control simulation model by loading the.vcx file, add custom control logic according to the test requirements, create SOME IP, CAN, and LIN network models to connect the control simulation model and the hardware board, so as to realize the connection with the controller; complete the signal E2E verification algorithm, and configure the verification algorithm for those with verification requirements; start the controller test experimental environment.
[0061] In another embodiment of the present application, the test platform is set in any one of the upper computers in multiple test benches and is also used to generate an engineering creation instruction.
[0062] In this embodiment, the test system further includes a lower computer. The upper computers communicate with each other through a switch. Exemplarily, the switch maps the MAC addresses of each test cabinet to the corresponding ports, which serve as the network interfaces of the test cabinets, thereby enabling communication between various devices. A server can also be set up separately. The test platform is placed in the server. The server communicates through the switch and generates an engineering creation instruction, which is sent to the corresponding lower computer of the target controller through the switch.
[0063] Figure 4 The figure shows a schematic structural diagram of an embodiment of the electronic device of the present application, and it shows a schematic structural diagram of a computer system of the electronic device suitable for implementing the embodiments of the present application. The specific implementation of the electronic device in the specific embodiments of the present application is not limited.
[0064] Please refer to Figure 4 As shown, the electronic device includes: a controller; a memory for storing one or more programs, which, when executed by the controller, are used to execute the above-mentioned test method.
[0065] Please continue to refer to Figure 4 As shown, the computer system 500 of the electronic device includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to the programs stored in the read-only memory (ROM) 502 or the programs loaded from the storage section 508 into the random access memory (RAM) 503, such as executing the method in the above embodiment. In the RAM 503, various programs and data required for system operation are also stored. The CPU 501, ROM 502, and RAM 503 are connected to each other through a bus 504. The input / output (I / O) interface 505 is also connected to the bus 504.
[0066] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including, for example, a cathode ray tube (CRT), a liquid crystal display (LCD), etc. and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as required. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc. is mounted on the drive 510 as required so that a computer program read therefrom is installed into the storage section 508 as required.
[0067] Specifically, according to an embodiment of the present application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, an embodiment of the present application includes a computer program product including a computer program carried on a computer-readable medium, the computer program including a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 509, and / or installed from the removable medium 511. When the computer program is executed by a central processing unit (CPU) 501, various functions defined in the system of the present application are executed.
[0068] Another aspect of the present application also provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the above-described test method is implemented. The computer-readable storage medium may be included in the electronic device described in the above embodiment, or may exist separately without being assembled into the electronic device.
[0069] Another aspect of the present application also provides a computer program product or a computer program, the computer program product or the computer program including at least one executable instruction, and when the executable instruction runs on an electronic device, the electronic device is caused to execute the above-described test method.
[0070] The executable instruction can specifically be used to cause the electronic device to perform the following operations:
[0071] In response to an engineering creation instruction, create a test project for each controller, and create test action parameters and a test environment model corresponding to each controller;
[0072] Import the test action parameters and the test environment model of the target controller into the corresponding test project to obtain a target test configuration; wherein, the target controller is any one of the controllers.
[0073] If the initial test resources corresponding to the target controller are insufficient, the test resources corresponding to other controllers are used as the target test resources for the target controller;
[0074] Based on the target test configuration, the target test resources are invoked to test the target controller to obtain the test result of the target controller.
[0075] It should be noted that the computer-readable medium shown in the embodiments of the present application may be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. The computer-readable storage medium may be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, the computer-readable storage medium may be any tangible medium that contains or stores a program, and the program may be used by or in combination with an instruction execution system, apparatus, or device. In the present application, the computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable computer program. Such a propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium may also be any computer-readable medium other than the computer-readable storage medium, and the computer-readable medium may send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. The computer program included on the computer-readable medium may be transmitted by any suitable medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0076] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present application. Among them, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, and the above-mentioned module, program segment, or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in an order different from that marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, as well as the combination of blocks in the block diagram or flowchart, may be implemented by a dedicated hardware-based system that performs the specified functions or operations, or may be implemented by a combination of dedicated hardware and computer instructions.
[0077] The units described in the embodiments of the present application can be implemented in software or in hardware, and the described units can also be provided in a processor. Among them, the names of these units do not, in some cases, constitute a limitation on the unit itself.
[0078] According to one aspect of the embodiments of the present application, a computer system is further provided, including a central processing unit (CPU), which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) or the program loaded from the storage part into the random access memory (RAM), such as performing the methods in the above embodiments. In the RAM, various programs and data required for system operation are also stored. The CPU, ROM, and RAM are connected to each other through a bus. The input / output (I / O) interface is also connected to the bus.
[0079] The following components are connected to the I / O interface: an input section including a keyboard, a mouse, etc.; an output section including a cathode ray tube (CRT), a liquid crystal display (LCD), etc. and a speaker, etc.; a storage section including a hard disk, etc.; and a communication section including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section performs communication processing via a network such as the Internet. A drive is also connected to the I / O interface as needed. A removable medium such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc. is installed on the drive as needed so that a computer program read from it is installed into the storage section as needed.
[0080] The above content is only a preferred exemplary embodiment of the present application and is not used to limit the implementation of the present application. Those of ordinary skill in the art can easily make corresponding adaptations or modifications according to the main concept and spirit of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope required by the claims.
Claims
1. A controller testing method, characterized in that: Applied to a test platform, the test platform is connected to at least two controllers respectively, and the test method includes: In response to the project creation instruction, create a test project for each controller, and create test action parameters and a test environment model corresponding to each controller; Importing the test action parameters and the test environment model of the target controller into the corresponding test project to obtain a target test configuration; wherein the target controller is any controller; If the initial test resources corresponding to the target controller are insufficient, using the test resources corresponding to other controllers as the target test resources of the target controller; Based on the target test configuration, the target test resource is called to test the target controller to obtain a test result of the target controller.
2. The testing method according to claim 1, characterized in that: After the target test resource is called to test the target controller based on the target test configuration to obtain the test result of the target controller, the method further includes: The corresponding test files are constructed according to the test cases corresponding to each controller; the test files include each test case, and the test conditions, test status and sub-test results corresponding to each test case; A corresponding test report is generated according to the sub-test results of the test cases corresponding to each controller; the test report also includes the test case function, the test condition and the test status corresponding to each sub-test result.
3. The testing method according to claim 1, characterized in that: The test method also includes: Traverse each of the controllers, and use the traversed controller as the target controller; Construct a three-dimensional model of the target controller, and based on the target test case of the target controller, generate in the three-dimensional model a virtual animation corresponding to the target test action represented by the target test case, and a virtual icon corresponding to the sub-test result of the target test case; wherein the virtual icon represents whether the target test case is successfully executed; and the target test case is a test case in the current test.
4. The testing method according to claim 1, characterized in that: The testing method further includes: the engineering creation instruction is an instruction generated by any host computer; wherein each of the controllers is connected to a corresponding host computer.
5. A controller testing system, characterized in that: The test system comprises: A test platform and at least two test benches, the test platform is connected to each of the test benches respectively, each test bench is connected to a corresponding controller, and each test bench includes initial test resources; The test platform is used to create test projects for each controller in response to a project creation instruction, and to create test action parameters and test environment models corresponding to each controller; it is also used to import the test action parameters and test environment model of the target controller into the corresponding test project to obtain a target test configuration; wherein the target controller is any controller; if the initial test resources corresponding to the target controller are insufficient, the test resources corresponding to other controllers are used as the target test resources of the target controller; The test platform is further used to call the target test resource to test the target controller based on the target test configuration to obtain the test result of the target controller.
6. The test system according to claim 5, characterized in that: The test platform is also used to construct corresponding test files according to the test cases corresponding to each controller; the test files include each test case, and the test conditions, test status and sub-test results corresponding to each test case; The test platform is also used to generate a corresponding test report based on the sub-test results of the test cases corresponding to each controller; the test report also includes the test case function, the test conditions and the test status corresponding to each sub-test result.
7. The test system according to claim 5, characterized in that: The test platform is also used to traverse each of the controllers and use the traversed controller as the target controller; build a three-dimensional model of the target controller, and based on the target test case of the controller, generate a virtual animation corresponding to the target test action represented by the target test case in the three-dimensional model, and a virtual icon corresponding to the test result of the target test case; wherein the virtual icon can represent whether the target test case is successfully executed; the target test case is the case in the current test.
8. The test system according to claim 5, characterized in that: Each of the test benches further comprises: an upper computer, a lower computer and a test cabinet, wherein the upper computer in each of the test benches is connected to the lower computer, and the lower computer is arranged in the test cabinet; The upper computer is further used to configure the target communication protocol of the lower computer according to the interface of the target controller to achieve communication between the test cabinet and the target controller.
9. The test system according to claim 8, characterized in that: The test platform is arranged in any of the host computers in the plurality of test benches, and is also used to generate the engineering creation instruction.
10. An electronic device, characterized in that: include: Controller; A memory for storing one or more programs, which, when executed by a controller, enables the controller to implement the test method according to any one of claims 1 to 4.