Automatic test method for whole vehicle gateway access authentication
By writing CAN message VI program in LabView and calling through Teststand, automated testing of vehicle gateway access authentication is realized, solving the existing problem of low manual testing efficiency and improving testing convenience and security.
Patent Information
- Application Number
- CN202411637494.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-15
- Publication Date
- 2025-02-14
AI Technical Summary
The existing vehicle gateway access certification test adopts manual testing, which has inconvenience problems, resulting in low testing efficiency.
Write a VI program to send CAN message and a VI program to read CAN message in LabView, and use Teststand to call it to realize the sending and reading of packets between the upper computer and the gateway ECU, monitor the feedback packets of the gateway ECU, and automatically complete the access Certification process.
It improves the convenience and safety of testing, improves testing efficiency, and reduces the time and error rate of manual operation.
Smart Images

Figure CN119449646A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of vehicle information security, and more specifically, to an automated testing method for vehicle gateway access authentication. Background Art
[0002] In 2024, the EU will implement the R155 Information Security and Information Security Management System Regulation. The new regulation strengthens the requirements for vehicle information security, and the gateway adds a new secure access authentication function. If external devices need to communicate with gateway components, they need to meet the gateway's access authentication. After the access authentication is passed, the gateway opens the diagnostic CAN and diagnostic routing related functions. In the current industry, the test of gateways with secure access authentication generally uses Vector's CANoe tool for manual testing. When testing the gateway diagnostic routing function, a secure access authentication communication environment needs to be built. During the test, it is necessary to simulate the internal ECU to receive the diagnostic request and initiate the diagnostic response. Generally, Vector's CANoe tool is used to build the test environment, develop the test project, and manually simulate the internal ECU to initiate and receive messages according to the secure access authentication process. After passing the secure access authentication, the interaction test between the simulated ECU and the gateway is performed. This traditional testing technology requires manual or semi-automatic access authentication when testing gateways with information security access authentication, and the access time generally only lasts for a few seconds. After the timeout, the access authentication needs to be re-operated. The test steps are cumbersome and the test efficiency is low. Therefore, it is of great significance to automate the test of gateway access authentication and improve the convenience and safety of the test. Summary of the invention
[0003] The present invention provides an automated testing method for whole vehicle gateway access authentication, which solves the problem that the existing whole vehicle gateway access authentication test adopts manual testing and is inconvenient, can improve the convenience and safety of the test, and improve the test efficiency.
[0004] To achieve the above objectives, the present invention provides the following technical solutions:
[0005] An automated testing method for vehicle gateway access authentication, comprising:
[0006] Write VI programs for sending CAN messages and reading CAN messages in LabView;
[0007] Call the sending CAN message VI program and the reading CAN message VI program through Teststand to send a request to enter the extended mode frame to the vehicle gateway ECU and read the ECU feedback message;
[0008] The gateway ECU enters the extended mode, and the host computer sends a request sequence number and flow control frame to the gateway ECU, and then performs key calculation according to the corresponding message returned by the gateway ECU to calculate the key;
[0009] The host computer sends the key to the gateway ECU and determines whether to unlock it based on the frame returned by the gateway ECU. If so, the host computer sends a network selection frame to the gateway ECU and confirms whether to open network communication based on the frame returned by the gateway ECU.
[0010] Preferably, it also includes:
[0011] After the ECU network communication is opened, the host computer sends a call hold frame to the ECU. At this time, network communication with the ECU can be carried out. If the host computer does not send a hold session within 5S, it will exit and return to the unauthenticated state.
[0012] Preferably, calling the sending CAN message VI program and the reading CAN message VI program through Teststand includes:
[0013] When Teststand calls the VI program for sending CAN messages, the host computer sends a request to the gateway ECU to enter the extended mode frame, and the host computer receives the feedback frame sent by the ECU, monitors the feedback frame ID and whether the first byte is "50";
[0014] If yes, it is determined that the network ECU has entered the extended mode. If no, it is determined that it has not entered the extended mode, the Teststand program is stopped, and a failure result is returned.
[0015] Preferably, the host computer sends a request sequence number and a flow control frame to the gateway ECU, including:
[0016] The gateway ECU enters the extended mode, the host computer sends a request serial number to the gateway ECU, the host computer receives the request response message sent by the gateway ECU, and the host computer monitors the message ID and determines whether the 0th byte of the message is "10";
[0017] If yes, it is determined that the gateway ECU sends the first frame message of the multi-frame message. If no, the Teststand program is stopped and a failure result is returned.
[0018] Preferably, the host computer sends a request sequence number and a flow control frame to the gateway ECU, further comprising:
[0019] The host computer sends a flow control frame to the gateway ECU, and the gateway ECU returns a continuous frame of multiple frames. The host computer monitors the last four bytes of the last frame of the message returned by the gateway ECU and saves it in an array for subsequent key calculation.
[0020] Preferably, the host computer sends a request sequence number and a flow control frame to the gateway ECU, further comprising:
[0021] The host computer sends a request seed frame to the gateway ECU, and the gateway ECU responds with a return seed frame. The host computer monitors the last four bytes of the message and saves them in an array for subsequent key calculations.
[0022] Preferably, the key calculation is performed according to the corresponding message returned by the gateway ECU response, including:
[0023] The arrays saved in the return messages of the gateway ECU's response flow control frame and request seed frame are passed to the service algorithm module in the host computer to calculate the key and save it in array form.
[0024] Preferably, judging whether to unlock according to the gateway ECU return frame includes:
[0025] After the host computer sends the key to the gateway ECU, it monitors the gateway ECU return frame, monitors the ID of the returned message and determines whether the first byte of the message is "67". If so, it determines to be unlocked. If not, it stops running the Teststand program and returns a failure result.
[0026] Preferably, the step of confirming whether to open the network communication according to the gateway ECU return frame includes:
[0027] After the gateway ECU is unlocked, the host computer calls the Send CAN Message VI program to send a network selection open message to the gateway ECU. The gateway ECU returns the network selection open message, monitors the message ID and determines whether the second byte of the message is "02". If so, the network communication is opened. If not, the Teststand program is stopped and a failure result is returned.
[0028] Preferably, it also includes:
[0029] Run the automated test program for diagnostic routing during the time period when the gateway ECU is in call, and repeat and alternately run the automated test program for gateway access authentication and the automated test program for gateway diagnostic routing to achieve automated testing of the gateway diagnostic routing function.
[0030] The present invention provides an automated testing method for vehicle gateway access authentication, which writes a VI program for sending CAN messages and a VI program for reading CAN messages in LabView, and calls them through Teststand to realize message sending and reading between a host computer and a gateway ECU, and realizes monitoring of gateway ECU feedback messages. The existing vehicle gateway access authentication test adopts manual testing, which is inconvenient, and can improve the convenience and safety of the test and improve the test efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the specific embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below.
[0032] Figure 1 It is a schematic diagram of an automated testing method for vehicle gateway access authentication provided by the present invention.
[0033] Figure 2 It is a schematic diagram of a secure access authentication process provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0034] In order to enable persons skilled in the art to better understand the solutions of the embodiments of the present invention, the embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings and implementation modes.
[0035] In view of the inconvenience of the current testing of vehicle gateway access authentication, the present invention provides an automated testing method for vehicle gateway access authentication, which solves the inconvenience of the existing manual testing of vehicle gateway access authentication, improves the convenience and safety of the testing, and improves the testing efficiency.
[0036] like Figure 1 and Figure 2 As shown, an automated testing method for vehicle gateway access authentication includes:
[0037] S1: Write the VI program for sending CAN messages and the VI program for reading CAN messages in LabView.
[0038] S2: Call the sending CAN message VI program and the reading CAN message VI program through Teststand to send a request to enter the extended mode frame to the vehicle gateway ECU and read the ECU feedback message.
[0039] S3: The gateway ECU enters the extended mode, and the host computer sends a request sequence number and flow control frame to the gateway ECU, and then performs key calculation according to the corresponding message returned by the gateway ECU to calculate the key.
[0040] S4: The host computer sends the key to the gateway ECU and determines whether to unlock based on the frame returned by the gateway ECU. If yes, the host computer sends a network selection frame to the gateway ECU and confirms whether to open the network communication based on the frame returned by the gateway ECU.
[0041] Specifically, the steps for developing automated testing for secure access authentication based on TestStand and LabView are as follows:
[0042] 1. Write a VI program for sending CAN messages in LabView. Teststand calls this program to send a request to the gateway ECU to enter the extended mode frame.
[0043] 2. Write a VI program for reading CAN messages in LabView, and Teststand calls this program to read ECU feedback messages.
[0044] 3. The gateway ECU enters the extended mode, the host computer sends a request serial number to the ECU, and the host computer receives the request response message sent by the ECU.
[0045] 4. The host computer sends a flow control frame to the gateway ECU, and the ECU returns a continuous frame of multi-frame messages.
[0046] 5. The host computer sends a request seed frame to the gateway ECU, and the ECU responds with a return seed frame.
[0047] 6. The host computer sends the key to the gateway ECU and monitors the ECU's return frame.
[0048] 7. After the gateway ECU is unlocked, the host computer sends a network selection frame to the ECU, and the host computer monitors the ECU return frame.
[0049] The test execution program software TestStand can help engineers accelerate development in the verification and production stages and realize automated testing of secure access authentication. This method can solve the problem of inconvenience caused by manual testing of existing vehicle gateway access authentication tests, and can improve the convenience and safety of testing and enhance testing efficiency.
[0050] The method also includes: after the ECU network communication is opened, the host computer sends a call hold frame to the ECU, at which time network communication with the ECU can be carried out. If the host computer does not send a hold session within 5S, it will exit and restore the unauthenticated state.
[0051] Further, calling the sending CAN message VI program and the reading CAN message VI program through Teststand includes:
[0052] When Teststand calls the VI program for sending CAN messages, the host computer sends a request frame to the gateway ECU to enter the extended mode. The host computer receives the feedback frame sent by the ECU, monitors the feedback frame ID and whether the first byte is "50"; if so, it is determined that the network ECU has entered the extended mode, if not, it is determined that it has not entered the extended mode, the Teststand program is stopped, and a failure result is returned.
[0053] Further, the host computer sends a request sequence number and a flow control frame to the gateway ECU, including:
[0054] The gateway ECU enters the extended mode, the host computer sends a request serial number to the gateway ECU, and the host computer receives the request response message sent by the gateway ECU. The host computer monitors the message ID and determines whether the 0th byte of the message is "10"; if so, it determines that the gateway ECU sends the first frame message of the multi-frame message. If not, the Teststand program is stopped and a failure result is returned.
[0055] Further, the host computer sends a request sequence number and a flow control frame to the gateway ECU, and also includes:
[0056] The host computer sends a flow control frame to the gateway ECU, and the gateway ECU returns a continuous frame of multiple frames. The host computer monitors the last four bytes of the last frame of the message returned by the gateway ECU and saves it in an array for subsequent key calculation.
[0057] Further, the host computer sends a request sequence number and a flow control frame to the gateway ECU, and also includes:
[0058] The host computer sends a request seed frame to the gateway ECU, and the gateway ECU responds with a return seed frame. The host computer monitors the last four bytes of the message and saves them in an array for subsequent key calculations.
[0059] Further, the key calculation is performed according to the corresponding message returned by the gateway ECU response, including:
[0060] The arrays saved in the return messages of the gateway ECU's response flow control frame and request seed frame are passed to the service algorithm module in the host computer to calculate the key and save it in array form.
[0061] Further, judging whether to unlock according to the gateway ECU return frame includes:
[0062] After the host computer sends the key to the gateway ECU, it monitors the gateway ECU return frame, monitors the ID of the returned message and determines whether the first byte of the message is "67". If so, it determines to be unlocked. If not, it stops running the Teststand program and returns a failure result.
[0063] Further, the step of confirming whether to open the network communication according to the frame returned by the gateway ECU includes:
[0064] After the gateway ECU is unlocked, the host computer calls the Send CAN Message VI program to send a network selection open message to the gateway ECU. The gateway ECU returns the network selection open message, monitors the message ID and determines whether the second byte of the message is "02". If so, the network communication is opened. If not, the Teststand program is stopped and a failure result is returned.
[0065] The method also includes: running an automated test program for diagnostic routing during a time period when the gateway ECU maintains a call, and repeatedly and alternately running a gateway access authentication automated test program and a gateway diagnostic routing automated test program to implement automated testing of the gateway diagnostic routing function.
[0066] It can be seen that the present invention provides an automated testing method for vehicle gateway access authentication, writes a VI program for sending CAN messages and a VI program for reading CAN messages in LabView, and calls them through Teststand to realize message sending and reading between the host computer and the gateway ECU, and realizes monitoring of the feedback message of the gateway ECU. The existing test of vehicle gateway access authentication adopts manual testing, which is inconvenient, and can improve the convenience and safety of the test and improve the test efficiency.
[0067] The above describes in detail the structure, features and effects of the present invention based on the embodiments shown in the drawings. The above is only a preferred embodiment of the present invention, but the present invention is not limited to the scope of implementation shown in the drawings. Any changes made in accordance with the concept of the present invention, or modifications to equivalent embodiments with equivalent changes, which still do not exceed the spirit covered by the description and drawings, should be within the protection scope of the present invention.
Claims
1. An automated testing method for vehicle gateway access authentication, characterized in that: include: Write VI programs for sending CAN messages and reading CAN messages in LabView; Call the sending CAN message VI program and the reading CAN message VI program through Teststand to send a request to enter the extended mode frame to the vehicle gateway ECU and read the ECU feedback message; The gateway ECU enters the extended mode, and the host computer sends a request sequence number and flow control frame to the gateway ECU, and then performs key calculation according to the corresponding message returned by the gateway ECU to calculate the key; The host computer sends the key to the gateway ECU and determines whether to unlock it based on the frame returned by the gateway ECU. If so, the host computer sends a network selection frame to the gateway ECU and confirms whether to open network communication based on the frame returned by the gateway ECU.
2. The automated testing method for vehicle gateway access authentication according to claim 1 is characterized in that: Also includes: After the ECU network communication is opened, the host computer sends a call hold frame to the ECU. At this time, network communication with the ECU can be carried out. If the host computer does not send a hold session within 5S, it will exit and return to the unauthenticated state.
3. The automated testing method for vehicle gateway access authentication according to claim 2 is characterized in that: The calling of the sending CAN message VI program and the reading CAN message VI program through Teststand includes: When Teststand calls the VI program for sending CAN messages, the host computer sends a request to the gateway ECU to enter the extended mode frame, and the host computer receives the feedback frame sent by the ECU, monitors the feedback frame ID and whether the first byte is "50"; If yes, it is determined that the network ECU has entered the extended mode. If no, it is determined that it has not entered the extended mode, the Teststand program is stopped, and a failure result is returned.
4. The automated testing method for vehicle gateway access authentication according to claim 3 is characterized in that: The host computer sends a request sequence number and a flow control frame to the gateway ECU, including: The gateway ECU enters the extended mode, the host computer sends a request serial number to the gateway ECU, and the host computer receives the request response message sent by the gateway ECU. The host computer monitors the message ID and determines whether the 0th byte of the message is "10"; If yes, it is determined that the gateway ECU sends the first frame message of the multi-frame message. If no, the Teststand program is stopped and a failure result is returned.
5. The automated testing method for vehicle gateway access authentication according to claim 4 is characterized in that: The host computer sends a request sequence number and a flow control frame to the gateway ECU, and also includes: The host computer sends a flow control frame to the gateway ECU, and the gateway ECU returns a continuous frame of multiple frames. The host computer monitors the last four bytes of the last frame of the message returned by the gateway ECU and saves it in an array for subsequent key calculation.
6. The automated testing method for vehicle gateway access authentication according to claim 5 is characterized in that: The host computer sends a request sequence number and a flow control frame to the gateway ECU, and also includes: The host computer sends a request seed frame to the gateway ECU, and the gateway ECU responds with a return seed frame. The host computer monitors the last four bytes of the message and saves them in an array for subsequent key calculations.
7. The automated testing method for vehicle gateway access authentication according to claim 6, characterized in that: The key calculation is performed according to the corresponding message returned by the gateway ECU response, including: The arrays saved in the return messages of the gateway ECU's response flow control frame and request seed frame are passed to the service algorithm module in the host computer to calculate the key and save it in array form.
8. The automated testing method for vehicle gateway access authentication according to claim 7, characterized in that: The step of judging whether to unlock according to the gateway ECU return frame includes: After the host computer sends the key to the gateway ECU, it monitors the gateway ECU return frame, monitors the ID of the returned message and determines whether the first byte of the message is "67". If so, it determines to be unlocked. If not, it stops running the Teststand program and returns a failure result.
9. The automated testing method for vehicle gateway access authentication according to claim 8, characterized in that: The step of confirming whether to open the network communication according to the gateway ECU return frame includes: After the gateway ECU is unlocked, the host computer calls the Send CAN Message VI program to send a network selection open message to the gateway ECU. The gateway ECU returns the network selection open message, monitors the message ID and determines whether the second byte of the message is "02". If so, the network communication is opened. If not, the Teststand program is stopped and a failure result is returned.
10. The automated testing method for vehicle gateway access authentication according to claim 9, characterized in that: Also includes: Run the automated test program for diagnostic routing during the time period when the gateway ECU is in call, and repeat and alternately run the automated test program for gateway access authentication and the automated test program for gateway diagnostic routing to achieve automated testing of the gateway diagnostic routing function.