A method for testing a communication port and a test system for vehicle-mounted Ethernet
Patent Information
- Application Number
- CN202510498157.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-21
- Publication Date
- 2026-10-23
AI Technical Summary
因此,普通标准以太网的测试设备无法用于车载以太网,需要采用车载以太网专用测试设备对车载以太网进行测试
[0012]本发明中将发生端的测试报文回传给发送端,不论发送端是存在发送故障还是接收故障,都将无法接收到回传的测试报文;只有当发送端的发送功能和接收功能均正常时,发送端才能接收到回传的测试报文,因此根据所述测试报文的接收数据量就判断是否故障,即只需采集发送端单侧的收发数据即可对通信端口进行验证,简化了测试流程,提高了测试效率。
Smart Images

Figure CN122969955A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of communication testing technology. Background Technology
[0002] More and more automotive controllers are adopting in-vehicle Ethernet communication solutions. Compared with CAN bus communication solutions, in-vehicle Ethernet has advantages such as larger bandwidth and support for SomeIP communication protocols, and therefore it is being used on a large scale.
[0003] The physical layer design of automotive Ethernet differs from that of standard Ethernet. Automotive Ethernet (T1) uses one pair of twisted-pair cables for data transmission, while standard Ethernet (Tx) uses two pairs of twisted-pair cables—one for sending data and one for receiving data. Therefore, standard Ethernet testing equipment cannot be used for automotive Ethernet; dedicated automotive Ethernet testing equipment is required.
[0004] Currently, although communication between a computer and a vehicle controller can be achieved through a T1-Tx converter, it requires two-way operation and the testing process is cumbersome: First, the vehicle controller sends a test message to the computer through the T1-Tx converter to determine whether the computer receives the data to verify the transmission function of the vehicle Ethernet. Then, the computer sends a test message to the vehicle controller through the T1-Tx converter to determine whether the vehicle controller receives the data to verify the reception function of the vehicle Ethernet. Summary of the Invention
[0005] This application provides a testing method for communication ports to solve related technical problems.
[0006] This invention is achieved through the following technical solution:
[0007] A method for testing a communication port includes the following steps:
[0008] The sending end sends a test message to the receiving end through the communication port to be tested;
[0009] The receiving end receives the test message;
[0010] The receiving end returns the test message to the sending end;
[0011] The test port's malfunction is determined by the amount of data received by the sender from the test message.
[0012] In this invention, the test message from the sending end is sent back to the sending end. Regardless of whether the sending end has a sending or receiving fault, it will not be able to receive the returned test message. Only when the sending and receiving functions of the sending end are normal can the sending end receive the returned test message. Therefore, the fault can be determined based on the amount of data received in the test message. That is, the communication port can be verified by collecting the sending and receiving data on only one side of the sending end, which simplifies the testing process and improves testing efficiency.
[0013] Furthermore, each time the receiving end finishes receiving a frame of data in the test message, it returns a frame of data to the sending end.
[0014] This invention returns test messages in units of data frames, eliminating the need to wait for the data packet (containing several data frames) to be received before returning the test message, thus efficiently returning data and improving testing efficiency.
[0015] Furthermore, if the amount of data received by the sending end from the test message is 0, then the communication port to be tested is determined to be faulty.
[0016] If the amount of data received by the sending end for the test message is 0, it means that the test message was not received. This may be caused by a receiving failure of the communication port under test or a sending failure. However, there is no need to distinguish the cause. It is sufficient to determine that there is a fault, which makes it easy to quickly eliminate the faulty communication port.
[0017] Furthermore, when the amount of data received by the sending end from the test message is greater than 0, the packet loss rate of the communication port to be tested is calculated.
[0018] This invention can not only quickly determine whether a fault exists, but also evaluate the performance of the communication port by calculating the packet loss rate. The lower the packet loss rate, the better the performance.
[0019] Furthermore, the formula for calculating the packet loss rate is as follows: In the formula, D represents the packet loss rate, M1 represents the number of data packets sent by the sender, and M2 represents the number of data packets received by the sender.
[0020] Compared to existing technologies that require separate data transmission and reception data collection at the sending and receiving ends to calculate packet loss rate, this invention only requires data collection at the sending end to calculate packet loss rate. Furthermore, since the data transmission and reception data are from the same entity, it can more accurately reflect the packet loss rate at the sending end.
[0021] Furthermore, the communication port to be tested is an in-vehicle Ethernet port.
[0022] This invention also provides a testing system for in-vehicle Ethernet, comprising:
[0023] The sending end has an in-vehicle Ethernet port and sends test messages through the in-vehicle Ethernet port;
[0024] A conversion device is used to establish a communication link between the sending end and the receiving end, and can bidirectionally convert the message format of the sending end and the message format of the receiving end.
[0025] The receiving end is used to receive the test message and return the test message to the sending end.
[0026] Furthermore, the transmitting end is an on-board controller; the receiving end is a computer; and the conversion device is a T1-TX conversion device.
[0027] The receiving end is a computer, which can be programmed to return the received test messages to the sending end. However, computers are expensive and require a certain amount of space.
[0028] Furthermore, the transmitting end is an on-board controller; the receiving end is a mirror switch; and the conversion device is a T1-TX conversion device.
[0029] The receiving end is a mirror switch, which has a lower cost and occupies less space in the test site.
[0030] Furthermore, the T1 port of the T1-TX conversion device is connected to the vehicle Ethernet port of the vehicle controller, and the TX port of the T1-TX conversion device is connected to the first port of the mirror switch; the second port of the mirror switch is connected to the third port via a network cable; the first port is the mirror port, the second port is the mirrored port, and the mirror port is used to copy the transmitted data of the mirrored port.
[0031] The vehicle controller's Ethernet port has one pair of twisted-pair cables, while the mirror switch has two pairs of twisted-pair cables. Therefore, a T1-TX converter is used to establish the communication connection between the vehicle Ethernet and the mirror switch. In the mirror switch, the mirror port and the mirrored port are on the same local area network (LAN). Therefore, the first port (mirror port) and the second port (mirrored port) can exchange data within the mirror switch. However, the second port and the third port are not on the same LAN, so they are connected via an external network cable.
[0032] Furthermore, the mirror switch returns test packets in the following manner:
[0033] The first port receives the test message and forwards it to the second port;
[0034] The second port receives test messages and forwards them to the third port;
[0035] The first port mirrors and copies the test message sent from the second port to the third port, and returns the test message to the sending end through the T1-TX conversion device.
[0036] Since the mirror switch itself does not have a data return function, this invention cleverly utilizes the mirror function of the mirror switch to realize the return of test messages, thus meeting the requirement of the test system based on the mirror switch to return test messages.
[0037] Furthermore, it also includes a host computer, which is a computer and is communicatively connected to the vehicle controller.
[0038] This invention abandons the traditional testing method of verifying the sending and receiving functions separately. By sending the test message back from the sending end to the receiving end, faulty communication ports can be quickly identified, simplifying the testing process and improving testing efficiency. The testing system of this invention is plug-and-play and can collect the amount of data sent and received from a single end, making it convenient and fast. Attached Figure Description
[0039] To more clearly illustrate the technical solutions in the specific embodiments of this application or the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0040] Figure 1 This is an architecture diagram of an existing vehicle-mounted Ethernet testing system;
[0041] Figure 2 This is a flowchart of the testing method for the communication port in this specific embodiment;
[0042] Figure 3 This is an architecture diagram of the vehicle-mounted Ethernet testing system in this specific implementation. Detailed Implementation
[0043] The technical solutions of this application will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0044] refer to Figure 1 As shown, standard Ethernet testing equipment cannot be used for automotive Ethernet; a dedicated automotive Ethernet testing device, the T1 Tester, is required to test automotive Ethernet.
[0045] Although a communication connection between a computer and a vehicle controller can be established through a T1-Tx converter, it requires two-way operation and the testing process is cumbersome: First, the vehicle controller sends a test message to the computer through the T1-Tx converter to determine whether the computer receives the data to verify the transmission function of the vehicle Ethernet. Then, the computer sends a test message to the vehicle controller through the T1-Tx converter to determine whether the vehicle controller receives the data to verify the reception function of the vehicle Ethernet.
[0046] To simplify the testing process and improve testing efficiency, refer to Figure 2 As shown in the figure, this specific embodiment provides a method for testing a communication port, including the following steps:
[0047] S1: The sending end sends a test message to the receiving end through the communication port to be tested;
[0048] S2: The receiving end receives the test message;
[0049] S3: The receiving end returns the test message to the sending end;
[0050] S4: Determine whether the communication port to be tested is faulty based on the amount of data received by the sending end from the test message.
[0051] In this specific embodiment, the test message from the sending end is sent back to the sending end. Regardless of whether the sending end has a sending or receiving failure, it will not be able to receive the returned test message. Only when the sending and receiving functions of the sending end are normal can the sending end receive the returned test message. Therefore, the failure can be determined based on the amount of data received in the test message. That is, the communication port can be verified by collecting the sending and receiving data on only one side of the sending end, which simplifies the testing process and improves testing efficiency.
[0052] In this specific implementation, the message used for testing can be a UDP protocol, a TCP protocol, or other protocols.
[0053] In some embodiments of the present invention, each time the receiving end finishes receiving a frame of data in the test message, it returns a frame of data to the sending end.
[0054] This specific implementation returns test messages in units of data frames, eliminating the need to wait for the data packet (containing several data frames) to be received before returning the test message, thus efficiently returning data and improving testing efficiency.
[0055] In some embodiments of the present invention, when the amount of data received by the sending end from the test message is 0, the communication port to be tested is determined to be faulty.
[0056] If the amount of data received by the sending end for the test message is 0, it means that the test message was not received. This may be caused by a receiving failure of the communication port under test or a sending failure. However, there is no need to distinguish the cause. It is sufficient to determine that there is a fault, which makes it easy to quickly eliminate the faulty communication port.
[0057] In some embodiments of the present invention, when the amount of data received by the sending end from the test message is greater than 0, the packet loss rate of the communication port to be tested is calculated.
[0058] This specific implementation method can not only quickly determine whether a fault exists, but also evaluate the performance of the communication port by calculating the packet loss rate. The lower the packet loss rate, the better the performance.
[0059] In some embodiments of the present invention, the formula for calculating the packet loss rate is as follows: In the formula, D represents the packet loss rate, M1 represents the number of data packets sent by the sender, and M2 represents the number of data packets received by the sender.
[0060] Compared to existing technologies that require separate data transmission and reception data collection at the sending and receiving ends to calculate packet loss rate, this specific implementation only requires collecting transmission and reception data at the sending end to calculate packet loss rate. Furthermore, the data transmission and reception data are from the same entity, which can more accurately reflect the packet loss rate at the sending end.
[0061] In some embodiments of the present invention, the communication port to be tested is an in-vehicle Ethernet port.
[0062] refer to Figure 3 As shown in the figure, this specific embodiment also provides a test system for in-vehicle Ethernet, including:
[0063] Sending end 1, the sending end 1 has an in-vehicle Ethernet port, and sends test messages through the in-vehicle Ethernet port;
[0064] The conversion device 2 is used to establish a communication link between the sending end 1 and the receiving end, and can bidirectionally convert the message format of the sending end 1 and the message format of the receiving end;
[0065] Receiver 3 is used to receive the test message and return the test message to sender 1;
[0066] Host computer 4, which is a computer and is communicatively connected to the vehicle controller.
[0067] When the sending end does not have computing capabilities, the host computer is used to determine whether the communication port under test is working properly based on the amount of data received by the sending end 1 from the test message.
[0068] When the sending end has its own computing function, such as a controller, the sending end can determine whether the communication port under test is working properly based on the amount of data received by the sending end 1 from the test message, and then send the diagnostic results to the host computer for display and recording.
[0069] In some embodiments of the present invention, the transmitting end 1 is an on-board controller; the receiving end 3 is a computer; and the conversion device 2 is a T1-TX conversion device 2.
[0070] Receiver 3 is a computer. The computer can be programmed to return the received test messages to sender 1, but computers are expensive and require considerable space. The software program can include the following steps: storing the received test messages in memory, such as a cache; and then sending the test files back to the receiver.
[0071] In some embodiments of the present invention, the transmitting end 1 is an on-board controller; the receiving end 3 is a mirror switch; and the conversion device 2 is a T1-TX conversion device 2.
[0072] The T1 to TX device can be single-channel or multi-channel. The switch has at least 3 ports or more. The connection between the vehicle controller and the computer can be a CAN Tester or other communication interfaces.
[0073] Receiver 3 is a mirror switch. Mirror switches have lower costs and require less space in the test site.
[0074] In some embodiments of the present invention, the T1 port of the T1-TX conversion device 2 is connected to the vehicle Ethernet port of the vehicle controller, and the TX port of the T1-TX conversion device 2 is connected to the first port of the mirror switch; the second port of the mirror switch is connected to the third port via a network cable; the first port is the mirror port, the second port is the mirrored port, and the mirror port is used to copy the transmitted data of the mirrored port.
[0075] The vehicle controller's Ethernet port has one pair of twisted-pair cables, while the mirror switch has two pairs of twisted-pair cables. Therefore, a T1-TX converter 2 is used to establish the communication connection between the vehicle Ethernet and the mirror switch. In the mirror switch, the mirror port and the mirrored port are on the same local area network (LAN). Therefore, the first port (mirror port) and the second port (mirrored port) can exchange data within the mirror switch. However, the second port and the third port are not on the same LAN, so they are connected via an external network cable.
[0076] In some embodiments of the present invention, the mirror switch returns test packets in the following manner:
[0077] The first port receives the test message and forwards it to the second port;
[0078] The second port receives test messages and forwards them to the third port;
[0079] The first port mirrors and copies the test message sent from the second port to the third port, and returns the test message to the sending end 1 through the T1-TX conversion device 2.
[0080] Since the mirror switch itself does not have a data return function, this specific implementation method cleverly utilizes the mirror function of the mirror switch to realize the return of test messages, thus meeting the requirement of the test system based on the mirror switch to return test messages.
[0081] In some embodiments of the present invention, the host computer 4 is a computer and is communicatively connected to the vehicle controller. The vehicle controller determines whether the vehicle Ethernet is working properly and obtains information such as packet loss rate by monitoring the transmission status, transmission quantity, and reception quantity, and sends the diagnostic results to the host computer for display and recording via CAN Tester.
[0082] This specific implementation method abandons the traditional testing approach of verifying the sending and receiving functions separately. By sending the test message from the transmitting end back to the sending end 1, faulty communication ports can be quickly identified, simplifying the testing process and improving testing efficiency. The testing system of this specific implementation method is plug-and-play and can collect the amount of data sent and received from a single end, which is convenient and fast.
[0083] Obviously, the above embodiments are merely illustrative examples for clear explanation and are not intended to limit the implementation. Those skilled in the art will recognize that other variations or modifications can be made based on the above description. It is neither necessary nor possible to exhaustively list all possible implementations here. However, obvious variations or modifications derived therefrom are still within the scope of protection of this application.
Claims
1. A method for testing a communication port, characterized in that, Includes the following steps: The sending end sends a test message to the receiving end through the communication port to be tested; The receiving end receives the test message; The receiving end returns the test message to the sending end; The test port's malfunction is determined by the amount of data received by the sender from the test message.
2. The testing method for a communication port according to claim 1, characterized in that, Each time the receiving end finishes receiving a frame of data in the test message, it returns a frame of data to the sending end.
3. The testing method for a communication port according to claim 1, characterized in that, When the amount of data received by the sending end from the test message is 0, the communication port to be tested is determined to be faulty.
4. The testing method for a communication port according to claim 1, characterized in that, When the amount of data received by the sending end from the test message is greater than 0, the packet loss rate of the communication port to be tested is calculated.
5. The testing method for a communication port according to claim 1, characterized in that, The formula for calculating the packet loss rate is as follows: In the formula, D represents the packet loss rate, M1 represents the number of data packets sent by the sender, and M2 represents the number of data packets received by the sender.
6. The testing method for a communication port according to any one of claims 1 to 5, characterized in that, The communication port to be tested is an in-vehicle Ethernet port.
7. A testing system for in-vehicle Ethernet, characterized in that, include: The sending end has an in-vehicle Ethernet port and sends test messages through the in-vehicle Ethernet port; A conversion device is used to establish a communication link between the sending end and the receiving end, and can bidirectionally convert the message format of the sending end and the message format of the receiving end. The receiving end is used to receive the test message and return the test message to the sending end.
8. The vehicle-mounted Ethernet testing system according to claim 7, characterized in that, The transmitting end is an on-board controller; the receiving end is a computer; and the conversion device is a T1-TX conversion device.
9. The vehicle-mounted Ethernet testing system according to claim 7, characterized in that, The transmitting end is an on-board controller; the receiving end is a mirror switch; and the conversion device is a T1-TX conversion device.
10. The vehicle-mounted Ethernet testing system according to claim 9, characterized in that, The T1 port of the T1-TX converter is connected to the vehicle Ethernet port of the vehicle controller, and the TX port of the T1-TX converter is connected to the first port of the mirror switch; the second port of the mirror switch is connected to the third port via a network cable; the first port is the mirror port, the second port is the mirrored port, and the mirror port is used to copy the transmitted data of the mirrored port.
11. The vehicle-mounted Ethernet testing system according to claim 10, characterized in that, The mirror switch returns test packets in the following manner: The first port receives the test message and forwards it to the second port; The second port receives test messages and forwards them to the third port; The first port mirrors and copies the test message sent from the second port to the third port, and returns the test message to the sending end through the T1-TX conversion device.
12. The vehicle-mounted Ethernet testing system according to claim 7, characterized in that, It also includes a host computer, which is a computer and is communicatively connected to the vehicle controller.