A multi-ECU testing system and method with the same IP address
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-16
- Publication Date
- 2026-08-14
AI Technical Summary
该方案逻辑直观,理论上可同时接入多台同IP设备,但其在车载ECU测试场景下存在以下缺陷:一是硬件成本高,需采购支持多VLAN、三层NAT、精细化ACL策略的企业级路由器,产线批量部署投入较大;二是车载私有协议适配能力差,路由器仅原生支持TFTP、FTP 等通用传输协议,而车载ECU普遍搭载的是SOME/IP、DoIP、双层VLAN、TSN等车载私有以太网协议,甚至有些车企会使用自定义的通信协议、使用自定义报文,针对每一类私有协议均需单独配置NAT穿透、访问控制策略,调试配置流程繁杂,甚至会破坏车载私有报文的封装结构与载荷校验逻辑,导致出现报文出错、通信中断的问题,因此也难以满足ECU批量生产的测试需求
[0024]上述技术方案具有如下有益效果:该测试系统在上位机中设置地址中转模块,与交换机 VLAN 二层隔离机制相配合,实现多台相同IP地址一致的ECU同步测试,有效解决多设备同IP地址冲突问题;其中地址中转模块通过软件方式仅改写报文中的帧头、IP地址,不对报文进行解析、过滤,能保证报文的实质内容不会被篡改;交换机仅对携带 VLAN 标签的报文做二层转发,不解析三层 IP、四层传输层协议,不存在硬件地址转换带来的协议兼容局限,能够适配各类车载以太网协议,通用性强,可稳定满足具有相同IP地址 ECU模块的批量测试要求。
Smart Images

Figure CN122569335A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of ECU testing technology, and in particular to a testing system and method for testing multiple ECUs with the same IP address. Background Technology
[0002] To ensure the quality of automotive electronic control units (ECUs) before they leave the factory, batch testing is typically required. This includes pre-shipment aging tests, where multiple ECUs of the same model are placed in an aging chamber for high and low temperature cyclic testing. The test bench establishes Ethernet communication with the ECU under test to read its internal operating status in real time, thus determining whether the ECU is functioning correctly. During ECU mass production, firmware is uniformly burned into ECUs of the same model on the production line, and all ECUs under test are configured with the same IP address (but different MAC addresses). If multiple ECUs are directly connected to the same network, IP address conflicts will occur, preventing the host computer from addressing and communicating correctly. Currently, there are three main testing solutions in the industry to address this problem, but all have significant drawbacks.
[0003] The first approach involves a one-to-one connection between an industrial control computer and the ECU for testing. Each ECU under test is equipped with a separate small industrial control device, and testing is conducted independently using a point-to-point network. The advantages of this approach are its simple network architecture, communication logic consistent with the single ECU debugging scenario, and native compatibility with various automotive Ethernet protocols. However, the hardware procurement and maintenance costs of the entire system are high, and the stacking of multiple industrial control devices occupies a large amount of production line space. It is only suitable for small-batch synchronous testing of ECUs and cannot meet the testing requirements of mass production lines.
[0004] The second approach uses a managed switch for time-sharing port testing. All ECUs are connected to the same managed switch, with only a single communication port open and the rest closed at any given time, allowing for sequential testing of a single ECU. This approach requires only one switch, resulting in low hardware investment and a simple network topology. However, after port switching, the network link needs several seconds to re-negotiate and establish, and since it can only perform serial testing, large-scale polling tests significantly lengthen the overall testing cycle, making it unsuitable for ECU mass production testing.
[0005] The third approach is to configure multiple IP addresses from different network segments for the test machine's network ports, and then use multiple routers to map these IP addresses to the network segment where the ECU is located. Specifically, as disclosed in invention patent 202110108492.6, a testing system and method for devices with the same IP address, this approach configures multiple network segment IP addresses on a host computer, uses a Layer 3 access router to perform NAT address translation, assigns an independent virtual IP to each ECU access port, and isolates the devices under test with the same backend IP. The solution is logically intuitive and theoretically can connect multiple devices with the same IP address simultaneously. However, it has the following drawbacks in the context of vehicle ECU testing: First, the hardware cost is high, requiring the purchase of enterprise-grade routers that support multiple VLANs, Layer 3 NAT, and fine-grained ACL policies, resulting in significant investment in mass production line deployment. Second, it has poor compatibility with vehicle-specific protocols. The router only natively supports common transmission protocols such as TFTP and FTP, while vehicle ECUs generally use vehicle-specific Ethernet protocols such as SOME / IP, DoIP, dual-layer VLAN, and TSN. Some automakers even use custom communication protocols and custom packets. Each type of private protocol requires separate configuration of NAT traversal and access control policies, making the debugging and configuration process complex and potentially damaging the encapsulation structure and payload verification logic of vehicle-specific packets, leading to packet errors and communication interruptions. Therefore, it is difficult to meet the testing requirements of mass production of ECUs.
[0006] In summary, none of the existing three types of testing schemes can fully meet the testing requirements of ECU mass production. Therefore, it is necessary to further improve the existing ECU testing methods and systems to meet the testing needs of a large number of ECUs with the same IP address. Summary of the Invention
[0007] To address the aforementioned issues, this invention provides a multi-ECU testing method and system with the same IP address that offers good compatibility and can meet the testing requirements of various communication protocols.
[0008] A multi-ECU testing system with the same IP address includes: multiple ECU modules to be tested; a switch, wherein the downlink ports of the switch are configured in Access mode, each downlink port is assigned a corresponding VLAN tag according to its port number, and the uplink ports of the switch are configured in Trunk mode, with each downlink port of the switch communicating with one-to-one with the ECU module to be tested; a host computer, which is connected to the uplink port of the switch via an Ethernet interface card, and is used to run test programs, virtual network cards, and an address relay module; the test program is used to execute test services for the ECU modules; the virtual network card is used to construct an independent virtual subnet and provide the test program with an independent virtual IP address that distinguishes each ECU module under test; the host computer has an ARP cache table for the virtual network card, which stores the mapping relationship between the virtual IP address of each ECU module and its corresponding hardware MAC address; the address relay module is used to rewrite the virtual IP address of the ECU module in the access packet to the real IP address and add a VLAN tag, or in the reply packet, rewrite the real IP address of the ECU module to the virtual IP address according to the VLAN tag and remove the VLAN tag. The host computer running test program accesses the virtual IP address of the ECU module through the upper-layer communication protocol, queries the ARP cache table to obtain the corresponding hardware MAC address, and automatically encapsulates it into an Ethernet frame to complete the data interaction with the ECU module.
[0009] Preferably, the virtual network card assigns a virtual IP address to the ECU module based on the port number of the downlink port connecting the ECU module and the switch and predefined rules.
[0010] Preferably, the address relay module stores a mapping table of virtual IP addresses, real IP addresses, and VLAN tags for each ECU module.
[0011] Preferably, the address relay module is used to rewrite the virtual IP address and virtual MAC address of the sender in the access message to the physical IP address and physical MAC address of the Ethernet interface card; or to modify the physical IP address and physical MAC address of the receiver in the reply message to the virtual IP address and virtual MAC address of the virtual network card.
[0012] Preferably, it includes multiple switches, with the host computer connected to the uplink port of one of the switches, and the uplink ports of the other switches connected to the downlink ports of that switch.
[0013] Preferably, the uplink port of the switch uses a 100 / 1000-BaseT interface, and the downlink port uses a 100 / 1000-BaseT1 interface.
[0014] This invention also discloses a testing method based on the above-mentioned multi-ECU testing system with the same IP address, which specifically includes the following steps:
[0015] S1: The host computer assigns virtual IP addresses to each ECU module under test through a virtual network card;
[0016] S2: The host computer operating system sends an ARP request through the virtual network card. The ARP request message carries the virtual IP address of the ECU module to be accessed.
[0017] S3: The address relay module rewrites the ARP request message, changing the virtual IP address of the ECU module in the message to the real IP address of the ECU and adding a VLAN tag. After completion, it sends the message to the uplink port of the switch.
[0018] S4: The switch forwards the packet to the corresponding downlink port based on the VLAN tag carried in the packet. The downlink port automatically removes the VLAN tag and sends the ARP request to the corresponding ECU module.
[0019] S5: After receiving an ARP request, the ECU module generates an ARP response message. The response message carries the ECU module's real IP address and its own hardware MAC address, and is sent to the switch through the corresponding downlink port.
[0020] S6: The switch adds the corresponding VLAN tag to the ARP response packet based on the downlink port of the sent packet, and then forwards it to the address relay module through the uplink port;
[0021] S7: The address relay module rewrites the real IP address of the ECU in the ARP response packet to the corresponding virtual IP address according to the VLAN tag and removes the VLAN tag. After processing, the ARP response packet is sent to the virtual network card.
[0022] S8: The host computer reads the ARP response message received by the virtual network card, extracts the mapping relationship between the virtual IP address of the ECU module and the hardware MAC address, writes it into the ARP cache table bound to the virtual network card, and updates the ARP cache table.
[0023] S9: The test program running on the host computer accesses the virtual IP of the ECU module through the upper-layer communication protocol. The host computer operating system queries the ARP cache table corresponding to the virtual network card to obtain the corresponding hardware MAC address, and automatically encapsulates it into an Ethernet frame for communication, completing the data interaction with the ECU module.
[0024] The above technical solution has the following beneficial effects: The testing system sets up an address relay module in the host computer, which works in conjunction with the VLAN Layer 2 isolation mechanism of the switch to achieve synchronous testing of multiple ECUs with the same IP address, effectively solving the problem of multiple devices having the same IP address; the address relay module only rewrites the frame header and IP address in the packet through software, without parsing or filtering the packet, ensuring that the actual content of the packet is not tampered with; the switch only performs Layer 2 forwarding on packets carrying VLAN tags, without parsing Layer 3 IP or Layer 4 transport layer protocols, and there are no protocol compatibility limitations caused by hardware address translation. It can adapt to various automotive Ethernet protocols, has strong versatility, and can stably meet the batch testing requirements of ECU modules with the same IP address. Attached Figure Description
[0025] Figure 1 This is a system block diagram for performing ECU aging tests according to an embodiment of the present invention.
[0026] Figure 2 This is a flowchart of the ECU aging test method according to an embodiment of the present invention.
[0027] Figure 3 This is a flowchart illustrating how the host computer communicates with the ECU using the IP protocol, according to an embodiment of the present invention. Detailed Implementation
[0028] The following specific embodiments illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification.
[0029] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided to make the invention more comprehensive and complete, and to fully convey the concept of the exemplary embodiments to those skilled in the art. The described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a full understanding of embodiments of the invention. However, those skilled in the art will recognize that the technical solutions of the invention may be practiced with one or more of these specific details omitted, or other methods, components, apparatus, steps, etc., may be employed. In other instances, well-known technical solutions are not shown or described in detail to avoid obscuring various aspects of the invention.
[0030] This invention discloses a multi-ECU testing system with the same IP address, mainly used to simultaneously test multiple ECU modules with the same IP address during the ECU module production process. The technical solution of this invention will be described in detail below using batch aging tests before ECUs leave the factory as an example.
[0031] like Figure 1 As shown, this embodiment is a multi-ECU aging test system with the same IP address. It mainly includes a host computer 100, a switch 200, multiple ECU modules 300 to be tested, and an aging device 400. All ECU modules 300 are housed within the aging device 400, which provides a high and low temperature aging test environment for the ECU modules. The switch 200 has at least one uplink port and multiple downlink ports. The host computer 100 is equipped with an Ethernet interface card, which communicates with the uplink port of the switch 200. The downlink ports of the switch 200 are connected one-to-one with each ECU module 300. The network cables connecting the downlink ports of the switch 200 to the ECU modules 300 should be heat-resistant to prevent data transmission disruption during aging tests.
[0032] Switch 200 should support the IEEE 802.1Q (i.e., VLAN) protocol. The uplink port should be set to Trunk mode, and the downlink port should be set to Access mode. In Access mode, the uplink port will be set with a dedicated VLAN tag. When the downlink port receives an untagged packet, it will add a VLAN tag to the packet. When the downlink port sends a tagged packet, it will remove the VLAN tag. The VLAN tag corresponds to the PVID of the downlink port. The VLAN tag of the downlink port is defined as VLAN(1)-VLAN(n). Since the ECU module 300 uses a vehicle-specific Ethernet physical layer interface, while the host computer's Ethernet interface card uses a regular Ethernet interface, the uplink port of the switch should use a 100 / 1000-BaseT interface, and the downlink port should use a 100 / 1000-BaseT1 interface.
[0033] The host computer 100 is used to run test programs, virtual network cards, and address relay modules. The test programs execute test services during the aging test of the ECU modules. The virtual network card is a network interface simulated by the host computer operating system. It is used to build independent virtual subnets and provide the test program with independent virtual IP addresses to distinguish each ECU module under test. Each ECU module is assigned a unique virtual IP address. In this way, the test software only needs to access different virtual IP addresses to distinguish devices, without worrying about conflicts caused by identical real IP addresses of the backend ECU modules, thus achieving transparency to the upper-layer test program.
[0034] The host computer's operating system also has a dedicated ARP cache table for this virtual network card. This ARP cache table is used to store the mapping relationship between the virtual IP address of each ECU module and the corresponding hardware MAC address. This mapping relationship can be obtained by sending an ARP request through the host computer's operating system.
[0035] As a specific implementation, the virtual IP address of the ECU module can be defined based on the port number of the downlink port connecting the ECU module and the switch, and predefined rules. For example, assuming the real IP address of the ECU module is 192.168.0.100, then the virtual IP address of the ECU module connected to port number 1 is defined as 192.168.0.101, the virtual IP address of the ECU module connected to port number 2 is defined as 192.168.0.102, and so on. The predefined rules for the virtual IP address can be formulated according to actual needs.
[0036] The address relay module, also a software module, is primarily used for bidirectional network packet conversion. For downlink access packets, it rewrites the virtual IP address of the ECU module to its real IP address and adds a VLAN tag. Simultaneously, it rewrites the sender's virtual IP address and virtual MAC address to the Ethernet interface card's physical IP address and physical MAC address. For uplink reply packets, it rewrites the ECU module's real IP address to a virtual IP address based on the VLAN tag and removes the VLAN tag. It also modifies the receiver's physical IP address and physical MAC address to the virtual network card's virtual IP address and virtual MAC address. For IP packets, if the IP address in the IP header is rewritten, the address relay module must recalculate the IP checksum to ensure normal communication. If UDP or TCP protocols are used, the UDP and TCP checksums must also be recalculated after modifying the IP header.
[0037] As one specific implementation, a mapping table storing the virtual IP address, real IP address, and VLAN tag of each ECU module can be set in the address relay module. In this way, the virtual IP address, real IP address, and VLAN tag of the ECU module in the access message or reply message can be directly rewritten through the mapping table.
[0038] During testing, the host computer operating system first sends ARP requests to each ECU module through the virtual network card to obtain the mapping relationship between the virtual IP address of each ECU module and the corresponding hardware MAC address. In this way, when the upper-layer communication protocol of the host computer running the test program accesses the virtual IP address of the ECU module, it can obtain the corresponding hardware MAC address by querying the ARP cache table and automatically encapsulate it into an Ethernet frame, thereby completing the data interaction with the ECU module.
[0039] As an embodiment of the present invention, in order to simultaneously meet the testing needs of more ECU modules, the testing system can be configured with multiple switches. The host computer is connected to the uplink port of one of the switches, and both the uplink and downlink ports of this switch use 100 / 1000-BaseT interfaces. The uplink ports of the remaining switches are connected to the downlink ports of this switch, and the uplink ports of the remaining switches use 100 / 1000-BaseT interfaces, while the downlink ports use 100 / 1000-BaseT1 interfaces. The ports connecting the switches to the ECU modules are set to Access mode, while the other ports can be set to Trunk mode.
[0040] This invention also discloses a test method using the above-mentioned multi-ECU test system with the same IP address. The test method will be described in detail below with reference to specific embodiments.
[0041] First, define the virtual network card's IP address as Virt-IP and its physical address as Virt-MAC; the Ethernet interface card's IP address as Phy-IP and its physical address as Phy-MAC; the ECU module's real IP address as DUT-IP (the same for each ECU module); the ECU module's virtual IP address as IP(K); the ECU module's corresponding switch downlink interface as port(k); and its corresponding VLAN tag as VLAN(k). Virt-IP and IP(k) are located in the same subnet, Virt-Net; Phy-IP and DUT-IP are located in the same subnet, Phy-Net. In the packet, Sender represents the sender, Target represents the receiver, Destination represents the destination, Source represents the source, and VLAN tag represents the VLAN tag.
[0042] like Figure 2 As shown, the multi-ECU testing method with the same IP address includes the following steps:
[0043] S1: The host computer assigns a virtual IP address (IP(K)) to each ECU module under test through a virtual network card. The virtual IP address can be defined according to the port number of the downlink port connecting the ECU module and the switch and the predefined rules. Each ECU module corresponds to a different virtual IP address.
[0044] S2: The host computer operating system sends an ARP request through the virtual network card. The ARP request message carries the virtual IP address of the ECU module to be accessed.
[0045] The ARP request message contains the following information: Sender MAC=Virt-MAC, Sender IP=Virt-IP, Target MAC=Broadcast Address, Target IP=IP(k); Ethernet frame header: Destination=Broadcast Address, Source=Virt-MAC;
[0046] S3: The address relay module rewrites the ARP request message, changing the virtual IP address of the ECU module in the message to the real IP address of the ECU and adding a VLAN tag. At the same time, the virtual IP address and virtual MAC address of the sender in the message are rewritten to the physical IP address and physical MAC address of the Ethernet interface card.
[0047] Specifically, modify the following: Sender MAC=Phy-MAC, Sender IP=Phy-IP, Target MAC=Broadcast Address, Target IP=DUT-IP; Ethernet Frame Header Destination=Broadcast Address, Source=Phy-MAC, and add VLAN tag=VLAN(k). After modification, send it to the switch uplink port.
[0048] S4: The switch forwards the packet to the corresponding downlink port port(k) based on the VLAN tag carried in the packet. After the downlink port port(k) automatically removes the VLAN tag, it sends the ARP request to the ECU module corresponding to the downlink port.
[0049] S5: After receiving the ARP request, the ECU module generates an ARP response message, which is then sent to the switch via the corresponding downlink port (k).
[0050] The response message content is: Sender MAC=MAC(k), Sender IP=DUT-IP, Target MAC=Phy-MAC, Target IP=Phy-IP; Ethernet frame header: Destination=Phy-MAC, Source=MAC(k);
[0051] S6: The switch adds the corresponding VLAN tag VLAN(k) to the ARP response packet based on the port number port(k) of the downlink port that sent the packet, and then forwards it to the address relay module through the uplink port;
[0052] S7: The address relay module rewrites the ARP response message. Based on the VLAN tag, it rewrites the ECU's real IP address in the ARP response message to the corresponding virtual IP address and removes the VLAN tag. At the same time, it modifies the physical IP address and physical MAC address of the receiver in the reply message to the virtual IP address and virtual MAC address of the virtual network card. After processing, it sends the ARP response message to the virtual network card.
[0053] The specific response message is modified as follows: Sender MAC=MAC(k), Sender IP=IP(k), Target MAC=Virt-MAC, Target IP=Virt-IP; Ethernet frame header Destination=Virt-MAC, Source=MAC(k), and VLAN tag is removed;
[0054] S8: The host computer reads the ARP response message received by the virtual network card, extracts the mapping relationship between the virtual IP address of the ECU module and the hardware MAC address, writes it into the ARP cache table bound to the virtual network card, and updates the ARP cache table.
[0055] Repeat the above steps to send ARP requests to the virtual IP addresses of all ECU modules in sequence, and the mapping between the virtual IP addresses and hardware MAC addresses of all ECU modules will be completed.
[0056] S9: When the test program running on the host computer accesses the virtual IP address of the ECU module through the upper-layer communication protocol, the host computer operating system queries the ARP cache table corresponding to the virtual network card, obtains the corresponding hardware MAC address, and automatically encapsulates it into an Ethernet frame for communication, thereby completing the data interaction with the ECU module.
[0057] like Figure 3 As shown in the figure, in a specific embodiment of the present invention, the specific steps of step S9, in which the test program of the host computer of the test system uses the IP protocol to access the ECU(k) module for data interaction, are as follows:
[0058] S91: The test program tests the ECU(k) module and sends test data to the virtual IP address IP(k). The host computer operating system first encapsulates the IP data, and in the IP header, Source IP=Virt-IP and Destination IP=IP(k);
[0059] S92: The operating system encapsulates IP data into Ethernet frames to form data frames. The hardware MAC address in the Ethernet frame is obtained through the correspondence between the virtual IP address and the ARP cache table. The encapsulated Ethernet header is Destination=MAC(k) and Source=Virt-MAC.
[0060] S93: The address relay module reads and rewrites the data frame, modifying SourceIP=Phy-IP and Destination IP=DUT-IP in the data frame IP header and recalculating the IP checksum; it also modifies Destination=MAC(k) and Source=Phy-MAC in the data frame Ethernet header and adds VLAN tag=VLAN(k). The address relay module then sends the modified data frame to the uplink port of the switch through the Ethernet interface card.
[0061] S94: The switch sends the data frame to the downlink port Port(k) according to the VLAN tag. The downlink port Port(k) removes the VLAN tag from the data frame and sends the data frame to the corresponding ECU(k) module.
[0062] S95: The ECU(k) module reads the test data in the data frame, generates a response frame, and sends it to the switch. In the IP header of the response frame, Source IP=DUT-IP, Destination IP=Phy-IP; in the Ethernet header, Destination=Phy-MAC, Source=MAC(k);
[0063] S96: The switch adds a VLAN tag to the response frame based on the downlink port Port(k) from which the response frame was sent, VLANtag=VLAN(k), and sends it to the host computer through the uplink port;
[0064] S97: After receiving the response frame, the host computer address relay module rewrites it. Specifically, the IP header is modified as follows: Source IP=IP(k), Destination IP=Virt-IP, and the IP checksum is recalculated; the Ethernet frame header is modified as Destination=Virt-MAC, Source=MAC(k), and the VLAN tag is removed.
[0065] S98: The address relay module writes the modified response frame to the virtual network card;
[0066] S99: The host computer's operating system protocol stack extracts IP data from the modified response frame through the virtual network card and passes it to the test program to complete the test.
[0067] The test program uses other upper-layer communication protocols to communicate with the ECU module in a manner basically the same as the IP protocol. Both involve rewriting the Ethernet frame header and IP header of the protocol in software via an address relay component. If UDP or TCP protocols are used, the UDP and TCP checksums need to be recalculated after modifying the IP header; the remaining steps are basically the same as the IP protocol. In-vehicle application protocols such as SOME / IP and DoIP are all based on TCP, UDP, and IP protocols, with dual-layer VLANs and TSNs serving as Ethernet Layer 2 transport mechanisms. In this invention, the address relay module can fully process IP, TCP, and UDP packets, only rewriting the IP header address and updating the IP checksum, while fully preserving the TCP / UDP header and upper-layer application packet payload. Simultaneously, it transparently transmits dual-layer VLAN tags and TSN Layer 2 scheduling information. Therefore, it does not require separate adaptation for various in-vehicle protocols and is compatible with various in-vehicle Ethernet protocols.
[0068] This testing system incorporates an address relay module in the host computer, which works in conjunction with the VLAN Layer 2 isolation mechanism of the switch to enable synchronous testing of multiple ECUs with identical real IP addresses, effectively resolving the issue of multiple devices sharing the same IP address. The address relay module, through software, only rewrites the frame header and IP address in the packets without parsing or filtering them, ensuring that the actual content of the packets remains unaltered. The switch only performs Layer 2 forwarding on packets carrying VLAN tags, without parsing Layer 3 IP or Layer 4 transport layer protocols. This eliminates the protocol compatibility limitations caused by hardware address translation, allowing it to adapt to various automotive Ethernet protocols. Its strong versatility and stable performance meet the batch testing requirements of ECU modules with the same IP address.
[0069] The above embodiments are merely illustrative of the principles and effects of the present invention and are not intended to limit the invention. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in the present invention should still be covered by the claims of the present invention.
Claims
1. A multi-ECU testing system with the same IP address, characterized in that, It includes: Multiple ECU modules to be tested; The switch has its downlink ports set to Access mode, and each downlink port is assigned a corresponding VLAN tag based on its port number. The uplink ports of the switch are set to Trunk mode, and the downlink ports of the switch are connected to the ECU module to be tested in a one-to-one communication connection. The host computer is connected to the uplink port of the switch via an Ethernet interface card. The host computer is used to run test programs, virtual network cards, and address relay modules. The test program is used to perform test operations on the ECU module; The virtual network card is used to construct an independent virtual subnet and provide the test program with an independent virtual IP address that distinguishes each ECU module under test; the host computer has an ARP cache table for the virtual network card, which stores the mapping relationship between the virtual IP address of each ECU module and the corresponding hardware MAC address. The address relay module is used to rewrite the virtual IP address of the ECU module in the access message to the real IP address and add a VLAN tag, or in the reply message, rewrite the real IP address of the ECU module to the virtual IP address according to the VLAN tag and remove the VLAN tag; When the host computer runs the test program to access the virtual IP address of the ECU module through the upper-layer communication protocol, it queries the ARP cache table to obtain the corresponding hardware MAC address and automatically encapsulates it into an Ethernet frame to complete the data interaction with the ECU module.
2. The multi-ECU testing system with the same IP address according to claim 1, characterized in that, The virtual network card assigns a virtual IP address to the ECU module based on the port number of the downlink port connecting the ECU module and the switch and predefined rules.
3. The multi-ECU testing system with the same IP address according to claim 1, characterized in that, The address relay module stores a mapping table of virtual IP addresses, real IP addresses, and VLAN tags for each ECU module.
4. The multi-ECU testing system with the same IP address according to claim 1, characterized in that, The address relay module is used to rewrite the virtual IP address and virtual MAC address of the sender in the access message to the physical IP address and physical MAC address of the Ethernet interface card; or to modify the physical IP address and physical MAC address of the receiver in the reply message to the virtual IP address and virtual MAC address of the virtual network card.
5. The multi-ECU testing system with the same IP address according to claim 1, characterized in that, It includes multiple switches, with the host computer connected to the uplink port of one of the switches, and the uplink ports of the other switches connected to the downlink ports of that switch.
6. The multi-ECU testing system with the same IP address as described in claim 1, characterized in that, The switch uses 100 / 1000-BaseT interfaces for its uplink ports and 100 / 1000-BaseT1 interfaces for its downlink ports.
7. A test method for a multi-ECU test system with the same IP address as described in claim 1, characterized in that, It includes the following steps: S1: The host computer assigns virtual IP addresses to each ECU module under test through a virtual network card; S2: The host computer operating system sends an ARP request through the virtual network card. The ARP request message carries the virtual IP address of the ECU module to be accessed. S3: The address relay module rewrites the ARP request message, changing the virtual IP address of the ECU module in the message to the real IP address of the ECU and adding a VLAN tag. After completion, it sends the message to the uplink port of the switch. S4: The switch forwards the packet to the corresponding downlink port based on the VLAN tag carried in the packet. The downlink port automatically removes the VLAN tag and sends the ARP request to the corresponding ECU module. S5: After receiving an ARP request, the ECU module generates an ARP response message. The response message carries the ECU module's real IP address and its own hardware MAC address, and is sent to the switch through the corresponding downlink port. S6: The switch adds the corresponding VLAN tag to the ARP response packet based on the port number of the downlink port of the received packet, and then forwards it to the address relay module through the uplink port; S7: The address relay module rewrites the real IP address of the ECU in the ARP response packet to the corresponding virtual IP address according to the VLAN tag and removes the VLAN tag. After processing, the ARP response packet is sent to the virtual network card. S8: The host computer reads the ARP response message received by the virtual network card, extracts the mapping relationship between the virtual IP address of the ECU module and the hardware MAC address, and writes it into the ARP cache table bound to the virtual network card; S9: The test program running on the host computer accesses the virtual IP of the ECU module through the upper-layer communication protocol. The host computer operating system queries the ARP cache table corresponding to the virtual network card to obtain the corresponding hardware MAC address, and automatically encapsulates it into an Ethernet frame for communication, completing the data interaction with the ECU module.
Citation Information
Patent Citations
System and method for testing equipment with same IP address
CN112953790A