A CAPL-based CAN gateway automatic testing system, method and testing machine
Through the CAN gateway automatic test system based on CAPL, the CAN gateway test is automatically configured and executed, which solves the problem of time-consuming and labor-intensive manual testing in the existing technology and the inability to configure test files, achieves efficient collection and storage of test information, and improves test quality. and efficiency.
Patent Information
- Application Number
- CN202211732999.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-30
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2042-12-30
AI Technical Summary
The existing vehicle gateway test system requires a large number of manual packet forwarding tests, which is time-consuming and labor-intensive, and cannot configure test files according to test needs, resulting in low test efficiency and failure to meet requirements.
Provides a CAN gateway automatic test system based on CAPL, including a control interface, environment variable module, software logic module and display output module, which can automatically configure and execute CAN gateway tests, parse test files, conduct CAN message sending and receiving tests, and output Test results.
It improves the efficiency of test monitoring, can configure parameters according to test requirements, realizes efficient collection and storage of test information, improves the quality and efficiency of CAN gateway testing, detects abnormalities in time, and improves testing level and efficiency.
Smart Images

Figure CN116032814B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of vehicle data communication, and in particular to a CAPL-based CAN gateway automatic testing system, method and testing machine. Background Art
[0002] With the increase in vehicle controllers, there is a widespread demand for communication between controllers. CAN has become the main communication network currently used by vehicles. The distributed architecture divided by vehicle functional domains is the main architecture of current vehicles. Communication between different functional domains is mainly achieved through CAN gateway message forwarding.
[0003] The prior art CN202210386278.1 discloses a vehicle gateway testing system, which discloses that the data processing module of the vehicle gateway to be tested receives the communication control signal sent by the host computer, converts the communication control signal into a communication test signal, and then forwards it through the communication module of the vehicle gateway to be tested; the data processing module of the load vehicle gateway receives the communication test signal through the communication module of the load vehicle gateway, and converts the communication test signal into a communication feedback signal, and then forwards it through the communication module of the load vehicle gateway; the data processing module of the vehicle gateway to be tested receives the communication feedback signal through the communication module of the vehicle gateway to be tested, and according to the communication feedback signal, feeds back the test result to the host computer through the signal transceiver module; the host computer generates a test report for the vehicle gateway to be tested based on the test result.
[0004] The test process executed by this file requires test message forwarding. Because the number of forwardings is huge, manual testing is time-consuming and labor-intensive, affecting test efficiency. In addition, this file cannot configure the corresponding test files according to the test needs, resulting in the test process failing to meet the requirements. Summary of the invention
[0005] The present invention provides a CAPL-based CAN gateway automatic testing system, which can test the CAN gateway and meet the testing requirements.
[0006] The system includes: control interface, environment variable module, software logic module and display output module;
[0007] The control interface is used to control the system's switch, start and stop the CAN gateway test, and process the test files;
[0008] The environment variable module is used to configure CAN gateway test parameters;
[0009] The software logic module is used to initialize the CAN gateway test, configure the CAN gateway test file to enable, parse the CAN gateway test file, perform the CAN message sending and receiving test according to the test reference time, and output the CAN gateway test results;
[0010] The display output module is used to display the CAN gateway test process information and test result information for users to view.
[0011] It should be further explained that the control interface is provided with a start-stop switch, a test selection unit, a test display light, and a test end delay time setting unit;
[0012] The start-stop switch obtains the switch control command input by the user to control the start and stop of the CAN gateway test;
[0013] The test display light is the test result display light. After the test is completed, if the light is green, the overall test result is qualified, and if the light is red, there are unqualified items in the test;
[0014] The test end delay time setting unit is used to set the delay time for the test end, which is the time required to delay before continuing to run after the trigger test ends.
[0015] It should be further explained that the CAN gateway test parameters configured by the environment variable module include: Button environment variable, EndTimer environment variable, ErrorLight environment variable and sourceName environment variable.
[0016] It should be further explained that the Button environment variable provides the start test option status of the control interface to the software logic module;
[0017] The EndTimer environment variable provides the test end delay of the control interface to the software logic module;
[0018] The ErrorLight environment variable provides the test results of the software logic module to the test display light;
[0019] The sourceName environment variable provides the path to the configuration file of the control interface to the software logic module.
[0020] It should be further explained that the test cases are configured using CAPL-like C language.
[0021] It should be further explained that the display output module is also used to output the content output by the write() function in the software logic module.
[0022] The present invention also provides a CAPL-based CAN gateway automatic testing method, the method comprising: initializing a CAN gateway testing process;
[0023] Waiting for CAN gateway test to be enabled;
[0024] Get the enable signal and read the configuration CAN gateway test file;
[0025] Parse CAN gateway test file;
[0026] Perform CAN message sending and receiving tests according to the test reference time;
[0027] Determine whether the CAN gateway test enable stop signal is received;
[0028] If received, the test is stopped and the CAN gateway test result is output.
[0029] It should be further explained that, in the method, Button environment variable, EndTimer environment variable, ErrorLight environment variable and sourceName environment variable are configured based on the environment variable module.
[0030] The present invention also provides a test machine, comprising a memory, a USB interface, CANoe or CANalyzer hardware, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the program, a CAPL-based CAN gateway automatic test system is implemented.
[0031] It can be seen from the above technical solutions that the present invention has the following advantages:
[0032] The present invention can configure CAN gateway test parameters, set test cases, and meet test requirements. Test process information and test result information are summarized to facilitate test personnel to consult, and the test process monitoring efficiency is effectively improved. Test information can also be efficiently collected, stored, and processed, and test process monitoring can be achieved, using multidimensional space to describe the entire test process. The quality and efficiency of CAN gateway testing are improved, and abnormalities of CAN gateways are discovered in a timely manner to improve the level and efficiency of CAN gateway testing, thereby achieving the timeliness and scientificity of supervision, management, and control of the entire CAN gateway testing process.
[0033] The present invention facilitates testers to quickly use the system to perform forwarding tests when testing gateway functions, and can output results to find problems in a timely manner. The system has stable tests, a simple and easy-to-understand operation interface, and tools commonly used in the industry, and the system is easy and quick to build. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the technical solution of the present invention, the accompanying drawings required for use in the description will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0035] Figure 1This is a schematic diagram of the CAN gateway automatic test system based on CAPL;
[0036] Figure 2 This is a flow chart of the automatic testing method for CAN gateway based on CAPL. DETAILED DESCRIPTION
[0037] The CAPL-based CAN gateway automatic test system provided by the present invention has both hardware-level technology and software-level technology. The hardware level of the CAPL-based CAN gateway automatic test system includes CANoe or CANalyzer equipment, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction system, host computer, etc.
[0038] Exemplarily, the CAPL-based CAN gateway automatic test system can realize normal forwarding monitoring test and abnormal data test, using CANoe or CANalyzer equipment. This system is divided into two parts: host computer software and hardware. The host computer software needs to be hosted on a computer and is the control and display part of the test system. The hardware uses CANoe or CANalyzer dedicated hardware, which is connected to the computer via USB and receives host computer software commands. There is no requirement for the hardware model, and this system is verified to be based on hardware VN1630A.
[0039] The automatic test system software technology includes, but is not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or power server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (exemplarily, using an Internet service provider to connect through the Internet).
[0040] The CAPL-based CAN gateway automatic test system is applied to one or more test machines, which are devices that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions. Its hardware includes but is not limited to microprocessors, application specific integrated circuits (ASICs), programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.
[0041] The test machine can be any electronic product that can perform human-computer interaction with a user, such as a personal computer, a tablet computer, a smart phone, a personal digital assistant (PDA), an interactive network television (IPTV), etc.
[0042] The test machine may also include network equipment and / or user equipment, wherein the network equipment includes, but is not limited to, a single network server, a server group consisting of multiple network servers, or a cloud consisting of a large number of hosts or network servers based on cloud computing.
[0043] The network where the test machine is located includes but is not limited to the Internet, wide area network, metropolitan area network, local area network, virtual private network (VPN), etc.
[0044] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0045] like Figure 1 ,The CAN gateway automatic test system based on CAPL includes: control interface, environment variable module, software logic module and display output module;
[0046] The control interface is used to control the system's switch, start and stop the CAN gateway test, and process the test files;
[0047] Among them, the control interface is provided with a start-stop switch, a test selection unit, a test display light, and a test end delay time setting unit;
[0048] The start and stop switch obtains the switch control command input by the user to control the start and stop of the CAN gateway test; Start can be set as the system start button and Stop as the system shutdown button.
[0049] The test display light is the test result display light. After the test is completed, if the light is green, the overall test result is qualified, and if the light is red, there are unqualified items in the test; the test end delay time setting unit is used to set the delay time for the end of the test. After the trigger test ends, the time required for the delay to continue running is in milliseconds (ms).
[0050] The environment variable module of the present invention is used to configure CAN gateway test parameters;
[0051] The CAN gateway test parameters configured by the environment variable module include: Button environment variable, EndTimer environment variable, ErrorLight environment variable and sourceName environment variable.
[0052] The Button environment variable provides the start test option status of the control interface to the software logic module;
[0053] The EndTimer environment variable provides the test end delay of the control interface to the software logic module;
[0054] The ErrorLight environment variable provides the test results of the software logic module to the test display light;
[0055] The sourceName environment variable provides the path to the configuration file of the control interface to the software logic module.
[0056] The software logic module of this system is the core supporting the entire system, and is mainly composed of five parts: initialization part, configuration file enabling part, configuration file parsing part, timing part, and result checking part.
[0057] Specifically, the software logic module is used to initialize the CAN gateway test, configure the CAN gateway test file to enable, parse the CAN gateway test file, perform the CAN message sending and receiving test according to the test reference time, and output the CAN gateway test results;
[0058] The display output module is used to display the CAN gateway test process information and test result information for users to view. This module mainly outputs the output of the write() function in the software logic module.
[0059] The present invention can configure CAN gateway test parameters, set test cases, and meet test requirements. Test process information and test result information are summarized to facilitate test personnel to consult, and the test process monitoring efficiency is effectively improved. Test information can also be efficiently collected, stored, and processed, and test process monitoring can be achieved, using multidimensional space to describe the entire test process. The quality and efficiency of CAN gateway testing are improved, and abnormalities of CAN gateways are discovered in a timely manner to improve the level and efficiency of CAN gateway testing, thereby achieving the timeliness and scientificity of supervision, management, and control of the entire CAN gateway testing process.
[0060] The following is an embodiment of the CAPL-based CAN gateway automatic testing method provided in the embodiments of the present disclosure. This method and the CAPL-based CAN gateway automatic testing system of the above-mentioned embodiments belong to the same inventive concept. For details not described in detail in the embodiment of the CAPL-based CAN gateway automatic testing method, reference can be made to the above-mentioned embodiment of the CAPL-based CAN gateway automatic testing system.
[0061] The method includes: initializing a CAN gateway test process;
[0062] Waiting for CAN gateway test to be enabled;
[0063] Get the enable signal and read the configuration CAN gateway test file;
[0064] Parse CAN gateway test file;
[0065] The parsed CAN gateway test file includes the expected target forwarding test file of CAN messages and the unexpected target forwarding test file of CAN messages. The main test cases are generated by the configuration file. The configuration file consists of entries, and each entry will generate a test case. The configuration entry examples of the configuration file are as follows.
[0066] {CAN0_Channel,0x0CFE6CEE,50,{CAN1_Channel,CAN3_Channel,CAN4_Ch annel,CAN5_Channel,CAN7_Channel,NO_Use,NO_Use},8}.
[0067] Perform CAN message sending and receiving tests according to the test reference time;
[0068] Determine whether the CAN gateway test enable stop signal is received;
[0069] If received, the test is stopped and the CAN gateway test result is output.
[0070] The output of this method is the output of the write() function, which is used to view the program running process and the results of specific test cases.
[0071] The above method is convenient for testers to use the system to conduct forwarding tests quickly when testing gateway functions, and can output results to find problems in a timely manner. The test of this system is stable, the operation interface is simple and easy to understand, the tools used are widely used in the industry, and the system is easy and quick to build.
[0072] The units and algorithm steps of each example described in the embodiment disclosed in the CAPL-based CAN gateway automatic testing method of the present invention can be implemented by electronic hardware, computer software or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to the function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0073] The flowchart and block diagram of the CAN gateway automatic testing method and system based on CAPL illustrate the possible architecture, functions and operations of the devices, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, which 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 box can also occur in an order different from that marked in the accompanying drawings. Exemplarily, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0074] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A CAPL-based CAN gateway automatic test system, characterized in that: include: Control interface, environment variable module, software logic module and display output module; The control interface is used to control the system's switch, start and stop the CAN gateway test, and process the test files; The environment variable module is used to configure CAN gateway test parameters; The software logic module is used to initialize the CAN gateway test, configure the CAN gateway test file to enable, parse the CAN gateway test file, perform the CAN message sending and receiving test according to the test reference time, and output the CAN gateway test results; The display output module is used to display the CAN gateway test process information and test result information for users to view; The control interface is provided with a start and stop switch, a test selection unit, a test display light, and a test end delay time setting unit; The start-stop switch obtains the switch control command input by the user to control the start and stop of the CAN gateway test; The test display light is the test result display light. After the test is completed, if the light is green, the overall test result is qualified, and if the light is red, there are unqualified items in the test; The test end delay time setting unit is used to set the delay time for the test end. After the trigger test ends, the delay time is required before the test can continue to run. The CAN gateway test parameters configured by the environment variable module include: Button environment variable, EndTimer environment variable, ErrorLight environment variable and sourceName environment variable; The Button environment variable provides the start test option status of the control interface to the software logic module; The EndTimer environment variable provides the test end delay of the control interface to the software logic module; The ErrorLight environment variable provides the test results of the software logic module to the test display light; The sourceName environment variable provides the path to the configuration file of the control interface to the software logic module.
2. The CAN gateway automatic test system based on CAPL according to claim 1, characterized in that: Use CAPL-like C language to configure test cases.
3. The CAN gateway automatic test system based on CAPL according to claim 1 is characterized in that: The display output module is also used to output the content output by the write() function in the software logic module.
4. A CAPL-based CAN gateway automatic testing method, characterized in that: The method adopts the CAPL-based CAN gateway automatic testing system as described in any one of claims 1 to 3; The method includes: initializing a CAN gateway test process; Waiting for CAN gateway test to be enabled; Get the enable signal and read the configuration CAN gateway test file; Parse CAN gateway test file; Perform CAN message sending and receiving tests according to the test reference time; Determine whether the CAN gateway test enable stop signal is received; If received, the test will be stopped and the CAN gateway test result will be output; In the method, Button environment variable, EndTimer environment variable, ErrorLight environment variable and sourceName environment variable are configured based on the environment variable module.
5. A test machine, comprising a memory, a USB interface, CANoe or CANalyzer hardware, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the CAPL-based CAN gateway automatic testing system as described in any one of claims 1 to 3 is implemented.
