Test communication method, device, switch and storage medium for electronic control unit

Through the internal software control logic of the Ethernet switch, the communication conflict problem caused by the same IP address and MAC address of multiple ECUs in the car, realizing the isolation and communication of the ECU, and reducing the test cost.

CN118827492BActive Publication Date: 2025-01-28GUANGZHOU ZHIYUAN ELECTRONICS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411307809.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-19
Publication Date
2025-01-28
Estimated Expiration
2044-09-19

AI Technical Summary

Technical Problem

In an on-board Ethernet system, multiple electronic control units (ECUs) are prone to communication conflicts during testing due to the same preset of the IP address and MAC address. The existing solutions require additional configuration of AR virtual routers and on-board Ethernet conversion. Box, cost is high.

Method used

Software control logic is realized inside the vehicle Ethernet switch, receiving the test data packet sent by the terminal device, according to the address information and preset mapping relationship in the packet, determine the address information and communication channels of the target ECU, and replace it to the data to the data In the package, the communication of the target ECU.

Benefits of technology

No additional configuration of other devices can beolate the ECU of the same communication address, reducing test costs and improving the reliability and efficiency of testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118827492B_ABST
    Figure CN118827492B_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses a test communication method, device, switch and storage medium for an electronic control unit, which are used for an in-vehicle Ethernet switch. The test communication method for the electronic control unit includes: receiving a first test data packet sent by a terminal device, the first test data packet including first address information; determining, according to the first address information and a preset mapping relationship, second address information and a target communication channel of a target electronic control unit corresponding to the first test data packet; replacing the first address information in the first test data packet with the second address information to obtain a second test data packet; sending the second test data packet through the target communication channel; the technical problem of high test cost of electronic control units with the same communication address in a vehicle can be solved, and isolation of electronic control units with the same communication address can be achieved based on software inside the in-vehicle Ethernet switch, without the need to configure other equipment additionally, thereby reducing test cost investment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of automobile technology, and in particular to a test communication method, device, switch, and storage medium for an electronic control unit. Background Art

[0002] With the development of automobile intelligence, automotive Ethernet, as a high-speed and wide-bandwidth communication technology, is widely used in the communication between various ECUs (Electronic Control Units) inside the car. In the automotive Ethernet system, each ECU requires a unique IP address and MAC address so that other devices in the network can identify and access it.

[0003] However, in production, due to the large number of ECUs and the preset IP addresses and MAC addresses, multiple ECUs are usually set to the same IP address and MAC address to save communication address resources for batch testing. Due to the same IP address and MAC address, there will be conflicts during testing, so the same IP address and MAC address need to be isolated to achieve communication.

[0004] When testing multiple ECUs with the same IP address and MAC address, the AR virtual router and the vehicle Ethernet conversion box are usually used. The AR virtual router forwards the network request to the vehicle Ethernet conversion box, and then the conversion box converts the network into the vehicle Ethernet signal corresponding to the ECU. This method requires additional configuration of AR virtual routers and Ethernet conversion boxes corresponding to the number of ECUs, which is costly. Summary of the invention

[0005] The embodiments of the present application provide a test communication method, device, switch and storage medium for an on-board electronic control unit, which can solve the technical problem of high testing cost of electronic control units with the same communication address in the vehicle. The electronic control units with the same communication address can be isolated based on the software inside the on-board Ethernet switch, without the need to configure other equipment, thereby reducing the test cost investment.

[0006] In a first aspect, an embodiment of the present application provides a test communication method for an electronic control unit, which is used for an in-vehicle Ethernet switch. The test communication method for the electronic control unit includes:

[0007] Receiving a first test data packet sent by a terminal device, where the first test data packet includes first address information;

[0008] Determine, according to the first address information and the preset mapping relationship, the second address information and the target communication channel of the target electronic control unit corresponding to the first test data packet;

[0009] Replacing the first address information in the first test data packet with the second address information to obtain a second test data packet;

[0010] A second test data packet is sent through the target communication channel.

[0011] In one embodiment, the first address information includes a first source IP address, a first source MAC address, a first target IP address, and a first target MAC address, the first target MAC address is a target MAC address of a target electronic control unit, and the first source IP address and the first source MAC address are source address information of a terminal device corresponding to sending the first test data packet;

[0012] Determining, according to the first address information and the preset mapping relationship, the second address information and the target communication channel of the target electronic control unit corresponding to the first test data packet, including:

[0013] According to the first target IP address in the first test data packet and the preset mapping relationship, determine the second source IP address, the second source MAC address, the second target IP address of the corresponding target electronic control unit, and the target communication channel, the second source IP address and the second source MAC address are the source address information preset by the vehicle Ethernet switch, and the source address information is used to communicate with the corresponding electronic control unit;

[0014] The second address information is generated according to the second source IP address, the second source MAC address, the second destination IP address and the first destination MAC address.

[0015] In one embodiment, the first test data packet includes first verification information;

[0016] Replacing the first address information in the first test data packet with the second address information to generate a second test data packet includes:

[0017] Obtain second verification information by calculation according to the second address information;

[0018] The first address information in the first test data packet is replaced by the second address information, and the first verification information is updated to the second verification information to obtain a second test data packet.

[0019] In one embodiment, the method further comprises:

[0020] receiving a first feedback data packet through the first communication channel, where the first feedback data packet includes third address information;

[0021] Acquire first channel information of a first communication channel;

[0022] Determine, according to the first channel information and the preset mapping relationship, fourth address information of the target terminal device corresponding to the first feedback data packet;

[0023] Determining a target communication port corresponding to the target terminal device according to the fourth address information and a preset mapping relationship;

[0024] Replacing the third address information in the first feedback data packet with the fourth address information to generate a second feedback data packet;

[0025] A second feedback data packet is sent through the target communication port.

[0026] In one embodiment, the third address information includes a third source IP address, a third source MAC address, a third target IP address and a third target MAC address, and the third source IP address and the third source MAC address are source address information of the electronic control unit corresponding to sending the first feedback data packet;

[0027] Determining fourth address information of a target terminal device corresponding to the first feedback data packet according to the first channel information and the preset mapping relationship includes:

[0028] Determine, according to the first channel information and the preset mapping relationship, a fourth source IP address, a fourth target IP address of the corresponding target terminal device, and a fourth target MAC address, wherein the fourth source IP address is a preset source IP address of the vehicle Ethernet switch, and the source IP address is used to communicate with the corresponding terminal device;

[0029] The fourth address information is generated according to the third source MAC address, the fourth source IP address, the fourth destination IP address, and the fourth destination MAC address.

[0030] In one embodiment, determining the target communication port corresponding to the target terminal device according to the fourth address information and the preset mapping relationship includes:

[0031] The target communication port is determined by performing analysis based on the fourth target IP address in the fourth address information and the preset mapping relationship.

[0032] In one embodiment, the first feedback data packet includes third verification information;

[0033] Replacing the third address information in the first feedback data packet with the fourth address information to generate a second feedback data packet, including:

[0034] Obtain fourth verification information by calculation according to the fourth address information;

[0035] The third address information in the first feedback data packet is replaced by the fourth address information, and the third verification information is updated to the fourth verification information to obtain a second feedback data packet.

[0036] In a second aspect, an embodiment of the present application provides a test communication device for an electronic control unit, which is used for an in-vehicle Ethernet switch. The test communication device for the electronic control unit includes:

[0037] A test packet receiving module, used to receive a first test data packet sent by a terminal device, where the first test data packet includes first address information;

[0038] An address mapping module, used to determine the second address information and the target communication channel of the target electronic control unit corresponding to the first test data packet according to the first address information and the preset mapping relationship;

[0039] A test packet updating module, used to replace the first address information in the first test data packet with the second address information to generate a second test data packet;

[0040] The test packet sending module is used to send a second test data packet through a target communication channel.

[0041] In a third aspect, an embodiment of the present application provides a test communication device for an electronic control unit, comprising:

[0042] memory and one or more processors;

[0043] The memory is used to store one or more programs;

[0044] When the one or more programs are executed by the one or more processors, the one or more processors implement the test communication method for the electronic control unit as described in the first aspect.

[0045] In a fourth aspect, an embodiment of the present application provides a storage medium storing computer executable instructions, which, when executed by a computer processor, are used to execute the test communication method for an electronic control unit as described in the first aspect.

[0046] In the embodiment of the present application, when testing the electronic control unit in the vehicle, the vehicle Ethernet switch receives the first test data packet sent by the terminal device, wherein the first test data packet includes the first address information; according to the first address information in the first test data packet and the preset mapping relationship, the second address information and the target communication channel of the target electronic control unit corresponding to the first test data packet are determined; the second address information replaces the first address information in the first test data packet with the second address information to obtain the second test data packet; and the second test data packet is sent through the target communication channel. By adopting the above technical means, the second address information and the target communication channel corresponding to the target electronic control unit corresponding to the first test data packet can be found by receiving the first address information in the first test data packet and the preset mapping relationship, and the second test data packet is sent to the target electronic control unit based on the target communication channel. Different electronic control units each correspond to a communication channel to achieve isolation, thereby avoiding the high cost technical problem caused by introducing other devices to achieve address isolation during the test process of the electronic control units with the same communication address in the vehicle. In this embodiment, the communication isolation of the electronic control units with the same communication address can be achieved through the software control logic inside the vehicle Ethernet switch, and no additional configuration of other devices is required to achieve communication isolation, thereby reducing the test cost of the electronic control units with the same communication address in the vehicle. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 It is a test communication schematic diagram in a related technology provided by an embodiment of the present application;

[0048] Figure 2 is a flow chart of a test communication method of an electronic control unit provided in an embodiment of the present application;

[0049] Figure 3 is a schematic diagram of the format of a test data packet provided in this embodiment;

[0050] Figure 4 This is a test communication schematic diagram provided by an embodiment of the present application;

[0051] Figure 5 is a schematic diagram of the format of a first test data packet provided in an embodiment of the present application;

[0052] Figure 6 is a schematic diagram of the format of a second test data packet provided in an embodiment of the present application;

[0053] Figure 7 is a flow chart of another test communication method of an electronic control unit provided in an embodiment of the present application;

[0054] Figure 8 is a schematic diagram of the format of a first feedback data packet provided in an embodiment of the present application;

[0055] Fig. 9 is a schematic diagram of the format of a second feedback data packet provided in an embodiment of the present application;

[0056] Fig.10 It is a structural schematic diagram of a test communication device for an electronic control unit provided in an embodiment of the present application;

[0057] Fig.11 It is a structural diagram of a test communication device for an electronic control unit provided in an embodiment of the present application. DETAILED DESCRIPTION

[0058] In order to make the purpose, technical scheme and advantages of the present application clearer, the specific embodiments of the present application are further described in detail below in conjunction with the accompanying drawings. It is understood that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for the convenience of description, only part of the present application is shown in the accompanying drawings, but not all of the content. Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow chart describes each operation (or step) as a sequential process, many of the operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of the operations can be rearranged. The process can be terminated when its operation is completed, but it can also have additional steps not included in the accompanying drawings. The process can correspond to a method, a function, a procedure, a subroutine, a subprogram, etc.

[0059] When producing vehicle-based electronic control units, the number of electronic control units is relatively large, and during testing, the communication address of each electronic control unit is preset, that is, the IP address and MAC address of each electronic control unit during testing are preset. During the test process, in order to save communication address resources, the communication addresses of multiple electronic control units are usually set to be the same, that is, multiple electronic control units are set to the same IP address and MAC address, which is convenient for batch testing. Due to the existence of multiple electronic control units with the same communication address, when sending test data packets based on the same communication address during testing, conflicts will occur, and it will be unknown which of the electronic control units with the same communication address is sent, so communication isolation is required to achieve normal communication.

[0060] In the related art, in order to achieve communication isolation of electronic control units with the same communication address, an AR virtual router and an on-board Ethernet conversion box are usually used. The AR virtual router forwards the network request to the on-board Ethernet conversion box, and then the conversion box converts the network into the on-board Ethernet signal corresponding to the electronic control unit. Figure 1This is a schematic diagram of a test communication in a related technology provided by an embodiment of the present application, referring to Figure 1 , the IP addresses of the four electronic control units ECU (ECU) are all 192.168.45.10, and the MAC addresses are all 009ACD000607. AR router 20 uses static routing mode, and binds IP addresses 192.168.0.101~192.168.0.104 to the four communication channels a~d respectively. Two network card drivers are set in the vehicle Ethernet conversion box 30 to correspond to the terminal device end and the electronic control unit ECU end respectively, where the terminal device end corresponds to the RJ45 port in the figure, where the RJ45 port IP is 192.168.0.101, and the RJ45 port MAC is 669ACD000609, and the electronic control unit ECU end corresponds to a T1 port in the figure, where the T1 port IP is 192.168.45.08, and the T1 port MAC is 009ACD000609. Through two network card drivers, the vehicle Ethernet conversion box 30 can configure the communication information (IP address and MAC address) of the communication channel of the AR router 20 through the RJ45 port, and the vehicle Ethernet conversion box 30 can configure the communication address information (IP address and MAC address) of the electronic control unit ECU through the T1 port. Through the settings of the AR router 20 and the vehicle Ethernet conversion box 30, the terminal device 10 (i.e., the PC end) can access 192.168.0.101~192.168.0.104, transmit to the corresponding vehicle Ethernet conversion box 30 through the corresponding communication channel in the AR router 20, and access the corresponding target electronic control unit ECU (such as ECU1) through the corresponding vehicle Ethernet conversion box 30. This method requires additional configuration of the AR router 20 and the vehicle Ethernet conversion box 30, and requires the AR router 20 to configure IP static routing, which requires more manpower and material resources, resulting in a higher overall cost of testing.

[0061] Based on this, a test communication method, device, switch and storage medium of a vehicle-mounted electronic control unit in an embodiment of the present application are provided to solve the technical problem that the test cost of electronic control units with the same communication address in the existing vehicle is high. The test communication method, device, switch and storage medium of the vehicle-mounted electronic control unit provided by the present application are intended to test the electronic control unit in the vehicle, by receiving the first address information and the preset mapping relationship in the first test data packet, find the second address information and the target communication channel corresponding to the target electronic control unit corresponding to the first test data packet, send the second test data packet to the target electronic control unit based on the target communication channel, and different electronic control units each correspond to a communication channel to achieve isolation, thereby avoiding the technical problem of high cost caused by introducing other devices to achieve address isolation during the test process of the electronic control units with the same communication address in the vehicle. In this embodiment, the isolation of the electronic control units with the same communication address can be achieved through the software control logic inside the vehicle Ethernet switch, and no additional configuration of other devices (such as AR routers or Ethernet conversion boxes 30, etc.) is required to achieve communication isolation, thereby reducing the test cost of the electronic control units with the same communication address in the vehicle.

[0062] Figure 2 A flow chart of a test communication method for an electronic control unit provided in an embodiment of the present application is given. The test communication method for an electronic control unit provided in this embodiment can be executed by a test communication device of the electronic control unit. The test communication device of the electronic control unit can be implemented by software and / or hardware. The test communication device of the electronic control unit can be composed of two or more physical entities, or can be composed of one physical entity. Generally speaking, the test communication device of the electronic control unit can be a device that communicates via an in-vehicle Ethernet, such as an in-vehicle Ethernet switch.

[0063] The following description is made by taking the vehicle Ethernet switch as the main body of the test communication method for executing the electronic control unit as an example. Figure 2 The test communication method of the electronic control unit is used for an in-vehicle Ethernet switch, and the test communication method of the electronic control unit specifically includes:

[0064] S101. Receive a first test data packet sent by a terminal device, where the first test data packet includes first address information.

[0065] The vehicle Ethernet switch provided in this embodiment has a mapping function of address and channel information. When a terminal device (i.e., a PC) needs to access multiple electronic control units with the same IP address and MAC address, the terminal device only needs to access a virtual IP / MAC address, and the vehicle Ethernet switch will obtain the target IP / MAC address and target communication channel corresponding to the corresponding target electronic control unit based on the virtual IP / MAC address mapping, and communicate with the target electronic control unit based on the target communication channel and the target IP / MAC address. For example, the IP / MAC address and communication channel 1 corresponding to ECU1 are mapped, and communication with ECU1 is performed based on communication channel 1.

[0066] Take one of the electronic control units as the target electronic control unit for example. When the terminal device needs to send a test data packet to the target electronic device, a first test data packet is generated based on the preset virtual address information, and the header of the first test data packet includes the first address information, and the first address information includes the preset virtual address information. The terminal device sends the first test data packet to the vehicle Ethernet switch based on the corresponding network port (for example, an RJ45 port). The vehicle Ethernet switch receives the first test data packet, and subsequently performs corresponding mapping according to the first address information in the first test data packet to obtain the target address information and the target communication channel corresponding to the corresponding target electronic control unit. It should be noted that there is a one-to-one mapping relationship between the virtual address information and the communication channel, and there is a one-to-one mapping relationship between the virtual address information and the electronic control unit.

[0067] Figure 3 This is a schematic diagram of a test data packet provided in this embodiment, in which the test data packet includes a header part and a content part, wherein the content part is the specific test data content, and the header part includes address information (source address information and target address information), serial number, confirmation number, URG field, ACK field, PSH field, PST field, SYN field, FIN field, window size, check information, and emergency pointer, etc. The aforementioned preset virtual address information corresponds to the target address information, and the first source address information in the first address information is the source address information corresponding to the terminal device, such as the source IP address and source MAC address corresponding to the terminal device.

[0068] S102: Determine, according to the first address information and the preset mapping relationship, the second address information and the target communication channel of the target electronic control unit corresponding to the first test data packet.

[0069] After receiving the first test data packet sent by the terminal device, the vehicle Ethernet switch intercepts the first address information from the first test data packet, where the first address information includes source address information and target address information. According to the first address information and the preset mapping relationship, the second address information and the target communication channel of the target electronic control unit corresponding to the first test data packet are determined.

[0070] In one embodiment, the first address information includes a first source IP address, a first source MAC address, a first target IP address and a first target MAC address, the first target MAC address is the target MAC address of the target electronic control unit, and the first source IP address and the first source MAC address are the source address information of the terminal device corresponding to the first test data packet. After the vehicle Ethernet switch receives the first test data packet sent by the terminal device, the second source IP address, the second source MAC address, the second target IP address of the corresponding target electronic control unit and the target communication channel are determined according to the first target IP address in the first test data packet and the preset mapping relationship. The second source IP address and the second source MAC address are the source address information preset by the vehicle Ethernet switch. Based on the electronic control unit only communicating with the device corresponding to the address information, the second source IP address and the second source MAC address can also be understood as the source address information that can communicate with the electronic control unit. The source address information is used to communicate with the corresponding electronic control unit. The second address information is generated according to the second source IP address, the second source MAC address, the second target IP address and the first target MAC address.

[0071] For example, Figure 4 This is a test communication schematic diagram provided in an embodiment of the present application, referring to Figure 4, the source address information of the terminal device 10 includes a first source IP address and a first source MAC address, wherein the first source IP address is 192.168.0.100, and the first source MAC address is FC3497A4E534. In this embodiment, four electronic control units with the same communication address are taken as an example for explanation, and the four electronic control units are ECU1, ECU2, ECU3 and ECU4. The IP addresses corresponding to ECU1, ECU2, ECU3 and ECU4 are all 192.168.45.10, and the MAC addresses corresponding to ECU1, ECU2, ECU3 and ECU4 are all 009ACD000607. At this time, if the terminal device 10 accesses one of the ECUs, for example, ECU1, if the corresponding data packet is directly generated and sent with the IP address: 192.168.45.10 and the MAC address: 009ACD000607 as the target address information, based on the same communication address information of the four ECUs, it is impossible to know which ECU it is sent to, that is, a communication conflict will be sent, resulting in the inability to send the data packet normally. Therefore, the present embodiment presets that each ECU corresponds to a virtual IP address, for example, the virtual IP address corresponding to ECU1 is 192.168.0.101, the virtual IP address corresponding to ECU2 is 192.168.0.102, the virtual IP address corresponding to ECU3 is 192.168.0.103, and the virtual IP address corresponding to ECU4 is 192.168.0.104. Therefore, the terminal device 10 can use the virtual IP address of the corresponding ECU as the target IP address to generate a corresponding data packet, and can subsequently determine which target electronic control unit is based on the target IP address in the data packet. In addition, the present embodiment also presets that each ECU corresponds to a communication channel, for example, ECU1 corresponds to channel a, ECU2 corresponds to channel b, ECU3 corresponds to channel c, and ECU4 corresponds to channel d. Therefore, according to the aforementioned preset comparison relationship, a unique mapping relationship between ECU (identification or mark), virtual IP address (i.e., first target IP address / ECU IP address) and communication channel (identification or mark) can be established to obtain a preset mapping relationship. The preset mapping relationship is stored in the vehicle Ethernet switch 40. For example, an IP / MAC address mapping module 401 is set in the vehicle Ethernet switch 40 to store the aforementioned preset mapping relationship, and corresponding mapping processing can be performed based on the preset mapping relationship when the corresponding test data packet is subsequently forwarded.

[0072] Figure 5 This is a schematic diagram of the format of a first test data packet provided in an embodiment of the present application, referring to Figure 4 and Figure 5, assuming that the terminal device 10 needs to access ECU1, that is, ECU1 is the current target electronic control unit. Based on the preset virtual IP address corresponding to ECU1 is 192.168.0.101, that is, the first target IP address is 192.168.0.101. The MAC address 009ACD000607 of ECU1 is used as the first target MAC address. Based on the source address information of the terminal device 10, the IP address is 192.168.0.100 (that is, the first source IP address) and the MAC address is FC3497A4E534 (that is, the first source MAC address). Therefore, the first source address information in the header part of the first test data packet generated based on accessing ECU1 is the first source IP address and the first source MAC address, that is, the first source address information includes IP: 192.168.0.100, MAC: FC3497A4E534; the first target address information in the header part of the first test data packet is the first target IP address and the first target MAC address, that is, the first target address information includes IP: 192.168.0.101, MAC: 009ACD000607. The first verification information is calculated based on the first source address information and the first target address information in the first test data packet, and recorded in the verification field corresponding to the first test data packet. The specific format of the first test data packet is as follows: Figure 5 The terminal device 10 sends the first test data packet through the corresponding communication port (eg, RJ45).

[0073] It should be noted that this embodiment presets a mapping relationship between the terminal device and the communication port. For example, the IP address of the terminal device is 192.168.0.100, which is mapped to the RJ45 port connecting the terminal device 10 and the vehicle Ethernet switch 40. Subsequently, as long as the source IP address is 192.168.0.100 or the target IP address is 192.168.0.100, it is forwarded through the RJ45 port connecting the terminal device 10 and the vehicle Ethernet switch 40.

[0074] It should be noted that the storage device in the vehicle Ethernet switch will store the aforementioned first source address information, that is, store IP: 192.168.0.100, MAC: FC3497A4E534, update the preset mapping relationship, establish a unique mapping relationship between ECU (identification or tag), virtual IP address (i.e., first target IP address), communication channel (identification or tag) and terminal device address information (i.e., first source address information), obtain an updated preset mapping relationship, and store the updated preset mapping relationship for subsequent use. Exemplarily, the updated preset mapping relationship is stored in the IP / MAC address mapping module.

[0075] After receiving the first test data packet through the corresponding communication port (e.g., RJ45), the vehicle Ethernet switch intercepts the first target IP address in the first test data packet, for example, IP: 192.168.0.101. According to the preset mapping relationship stored in the first target IP address (i.e., IP: 192.168.0.101) and the IP / MAC address mapping module, it can be determined that the corresponding target electronic control unit is EC1, the corresponding communication channel is channel a (i.e., the target communication channel is channel a), and the corresponding IP address of EC1 is 192.168.45.10. It should be noted that, based on the fact that the electronic control unit only communicates with the data packet with the MAC address of 009ACD000609 and the IP address of 192.168.45.08, it can be determined that the second source IP address is determined to be 192.168.45.08, and the second source MAC address is determined to be 009ACD000609, that is, these two address information are used as the second source address information. The second address information is generated according to the second source IP address, the second source MAC address, the second destination IP address and the first destination MAC address. That is, the second source address information in the second address information at this time is Figure 4 SRC_IP: 192.168.45.08, SRC_MAC: 009ACD000609; the target address information is Figure 4 DST_IP:192.168.45.10,DST_MAC:009ACD00060.

[0076] It should be noted that the first target MAC address in the first address information is used as the second target MAC address in the second address information, that is, the MAC address of the target electronic control unit is used as the target MAC address, and there is no change. For example, the MAC address corresponding to ECU1 is 009ACD000607, and the first target MAC address and the second target MAC address are both 009ACD000607.

[0077] As described above, based on the first address information in the first test data packet and the preset mapping relationship, the second address information and the target communication channel of the target electronic control unit corresponding to the first test data packet are determined, and the test data packet can be subsequently sent to the corresponding target electronic control unit based on the target communication channel and the second communication address information, and the communication channels of the electronic control units with the same address information are isolated based on the mapping relationship, so as to avoid communication conflicts when batch testing the electronic control units with the same address information, and avoid the failure of normal testing due to communication conflicts, thereby improving the reliability of the electronic control unit test, and further improving the work efficiency of the electronic control unit test.

[0078] S103: Replace the first address information in the first test data packet with the second address information to obtain a second test data packet.

[0079] After determining the second address information and target channel of the target electronic control unit corresponding to the first test data packet according to the first address information and the preset mapping relationship, the second address information replaces the first address information in the first test data packet to obtain the second test data packet. It should be noted that based on the change of the address information in the test data packet, the verification information in the corresponding data packet is also changed synchronously. As described above, through the address mapping and address replacement processing, the generated second test data packet contains the source address information (i.e., the second source address information, the second source IP address, and the second source MAC address) with which the target electronic control unit can communicate, so that the second test data packet can be sent based on the corresponding target communication channel in the future to achieve communication with the corresponding target electronic control unit, complete the corresponding test operation, and feedback the corresponding test result information.

[0080] Figure 6 is a schematic diagram of the format of a second test data packet provided in an embodiment of the present application, referring to Figure 4-6 After replacing the first address information in the first test data packet with the second address information, the second source address information in the header part of the second test data packet is obtained as the second source IP address and the second source MAC address, that is, Figure 6 The second source address information in includes IP: 192.168.45.08, MAC: 009ACD000609, corresponding to Figure 4 The second target address information in the header of the second test data packet is the second target IP address and the second target MAC address (the second target MAC address is the same as the first target MAC address), that is, Figure 6 The second target address information in includes IP: 192.168.45.10, MAC: 009ACD000607; corresponding to Figure 4 DST_IP:192.168.45.10,DST_MAC:009ACD000607.

[0081] In one embodiment, the first test data packet includes first verification information. The second address information replaces the first address information in the first test data packet, and the second verification information is calculated based on the second address information. Exemplarily, the second source address information in the header part of the second test data packet is IP: 192.168.45.08, MAC: 009ACD000609; the second destination address information is IP: 192.168.45.10, MAC: 009ACD000607. Then, the header CHECKSUM (checksum) of the IP field of the second test data packet, the header CHECKSUM (checksum) of the TCP field and the UDP field, and CRC (CyclicRedundancy Check) are calculated to obtain the second verification information. The first verification information is updated with the second verification information to obtain the second test data packet, for example, Figure 6 It should be noted that the second test data packet (i.e. Figure 6 ) and the first test packet (i.e. Figure 5 ) are only different in the address information and verification information in the header part, and the corresponding test content data is the same. In other words, the in-vehicle Ethernet switch can only map and modify the communication address information and update the verification information, but cannot change the actual data content (i.e., the test content data).

[0082] S104: Send a second test data packet through the target communication channel.

[0083] After the target communication channel (e.g., channel a) is determined and the second test data packet is obtained, the second test data packet is sent through the corresponding target communication channel to send the second test data packet to the corresponding target electronic control unit. After receiving the second test data packet, the corresponding target electronic control unit obtains the address information (i.e., the second address information) in the second test data packet, verifies the address information, performs parsing after passing the verification, and obtains the corresponding test content data in the second test data packet. Based on the IP address and MAC address (e.g., IP: 192.168.45.10, MAC: 009ACD000607) corresponding to the target electronic control unit (e.g., ECU1) in the second address information as the target address information, and the IP address and MAC address (e.g., IP: 192.168.45.08, MAC: 009ACD000609) that can communicate with the target electronic control unit as the source address information. Therefore, the target electronic control unit verifies the address information of the second test data packet, and based on the verification, performs corresponding parsing to obtain the corresponding test content data. Afterwards, the target electronic control unit can perform corresponding test processing based on the test content data, obtain test results and feed back the test results to the corresponding terminal device. The specific execution process of the feedback test data packet is as follows S201-S206.

[0084] It should be noted that after receiving the data packet, the ECU will check the IP address and MAC address of the data packet to ensure that it only communicates with a specific device. Since the second test data contains the IP address and MAC address that can communicate with the target electronic control unit as source address information, communication with the target electronic control unit can be achieved based on the second test data packet.

[0085] It should be noted that if any of the source address information and the target address information in the received test data packet does not match, the verification fails, and the target electronic control unit does not respond to or parse the test data packet.

[0086] In the above, when testing the electronic control unit in the vehicle, the vehicle Ethernet switch receives the first test data packet sent by the terminal device, wherein the first test data packet includes the first address information; according to the first address information in the first test data packet and the preset mapping relationship, the second address information and the target communication channel of the target electronic control unit corresponding to the first test data packet are determined; the second address information is replaced by the first address information in the first test data packet to obtain the second test data packet; and the second test data packet is sent through the target communication channel. By adopting the above technical means, the second address information and the target communication channel corresponding to the target electronic control unit corresponding to the first test data packet can be found by receiving the first address information in the first test data packet and the preset mapping relationship, and the second test data packet is sent to the target electronic control unit based on the target communication channel. Different electronic control units each correspond to a communication channel to achieve isolation, thereby avoiding the technical problem of high cost caused by introducing other devices to achieve address isolation during the test process of the electronic control units with the same communication address in the vehicle. In this embodiment, the communication isolation of the electronic control units with the same communication address can be achieved through the software control logic inside the vehicle Ethernet switch, and no additional configuration of other devices is required to achieve communication isolation, thereby reducing the test cost of the electronic control units with the same communication address in the vehicle.

[0087] Figure 7 is a flowchart of another electronic control unit test communication method provided in an embodiment of the present application, referring to Figure 7 The test communication method of the electronic control unit is used for an in-vehicle Ethernet switch. The test communication method of the electronic control unit specifically includes:

[0088] S201. Receive a first feedback data packet through a first communication channel, where the first feedback data packet includes third address information.

[0089] Through the aforementioned S101-S104, the terminal device sends a first test data packet, and the corresponding target electronic control unit receives the corresponding second test data packet. The target electronic control unit verifies the address information of the second test data packet, verifies whether the target address information is the address information corresponding to itself, and verifies whether the source address information is the address information that can communicate with it. After the verification is passed, the target electronic control unit performs corresponding parsing processing on the second test data packet to obtain the corresponding test content data. After that, the target electronic control unit can perform corresponding test processing based on the test content data to obtain the test result, and generate the result content data based on the test result, and generate the first feedback data packet based on the result content data and the third address information. Based on the need to feed back the first feedback data packet to the vehicle Ethernet switch, the address information of the vehicle Ethernet switch is used as the third target address information in the third address information, and the address information of the (electronic control unit) itself is used as the third source address information. Exemplarily, the third address information includes a third source IP address, a third source MAC address, a third target IP address and a third target MAC address, the third source IP address and the third source MAC address are the source address information of the electronic control unit corresponding to the sending of the first feedback data packet (i.e., the third source address information), and the third target IP information and the third target MAC information are the target address information of the device (i.e., the on-board Ethernet switch in this embodiment) that receives the first feedback data packet (i.e., the third target address information).

[0090] In one embodiment, Figure 8 This is a schematic diagram of the format of a first feedback data packet provided in an embodiment of the present application, referring to Figure 8, taking the target electronic control unit as ECU1 as an example for explanation. According to the above, the address information corresponding to ECU1 is IP: 192.168.45.10, MAC: 009ACD000607, then 192.168.45.10 is used as the third source IP address, and 009ACD000607 is used as the third source MAC address. According to the above, the address information of the vehicle Ethernet switch 40 is IP: 192.168.45.08, MAC: 009ACD000609, then 192.168.45.08 is used as the third target IP address, and 009ACD000609 is used as the third target MAC address. Therefore, the third source address information obtained in the header part of the first feedback data packet is the third source IP address and the third source MAC address, that is, the third source address information includes IP: 192.168.45.10, MAC: 009ACD000607; the third destination address information in the header part of the first feedback data packet is the third destination IP address and the third destination MAC address, that is, the third destination address information includes IP: 192.168.45.08, MAC: 009ACD000609. The third verification information is calculated based on the third source address information and the third destination address information in the first feedback data packet, and recorded in the verification field corresponding to the first feedback data packet. The specific format of the first feedback data packet is as follows: Figure 8 shown.

[0091] The first communication channel can be understood as the target communication channel corresponding to the communication channel in the preset target electronic control unit and the vehicle Ethernet switch. The aforementioned second test data packet is sent based on the target communication channel, and the corresponding first feedback data packet is also fed back through the corresponding target communication channel. At this time, the communication channel that feeds back the first feedback data packet becomes the first communication channel. After the target electronic control unit performs the test processing and generates the corresponding first feedback data packet, it is fed back to the vehicle Ethernet switch through the first communication channel. The vehicle Ethernet switch receives the first feedback data packet through the first communication channel.

[0092] As described above, the vehicle Ethernet switch receives the first feedback data packet through the first communication channel, and can subsequently determine which electronic control unit fed back the data packet based on the first communication channel. For example, if the first feedback data packet is received through channel a, it can be determined that the electronic control unit that sent the first feedback data packet is ECU1. The vehicle Ethernet switch can subsequently determine the communication address information of the corresponding target terminal device based on the first channel information corresponding to the first communication channel by mapping, so as to send the corresponding feedback data packet to the corresponding target terminal device, so that in the process of feedback of test results of multiple electronic control units with the same address information, the communication channels of each electronic control unit are isolated, and communication conflicts are avoided when multiple electronic control units with the same address information batch feedback test result data packets, and the inability to normally feedback test results due to communication conflicts is avoided, thereby improving the reliability of the test feedback of the electronic control unit, and further improving the overall efficiency of the test work of the electronic control unit.

[0093] S202: Acquire first channel information of a first communication channel.

[0094] After the vehicle-mounted Ethernet switch receives the first feedback data packet through the first communication channel, it obtains the first channel information of the first communication channel. The first channel information can be understood as the identifier or mark of the corresponding communication channel. Based on the preset mapping relationship stored in the IP / MAC address mapping module, that is, the unique mapping relationship between ECU (identifier or mark), virtual IP address (that is, the first target IP address / ECU's IP address), communication channel (identifier or mark) and terminal device address information (that is, the first source address information), the address information of the corresponding terminal device can be determined based on the comparison between the first channel information and the preset mapping relationship to update the target address information in the first feedback data packet, so that the corresponding feedback data packet can be sent to the corresponding terminal device that initiates the access (that is, sends the first test data packet), thereby completing the feedback of the test results.

[0095] S203: Determine fourth address information of the target terminal device corresponding to the first feedback data packet according to the first channel information and the preset mapping relationship.

[0096] Based on the preset mapping relationship stored in the IP / MAC address mapping module, that is, the unique mapping relationship between ECU (identifier or tag), virtual IP address (that is, the first target IP address / ECU's IP address), communication channel (identifier or tag) and terminal device address information (that is, the first source address information), the fourth address information of the target terminal device corresponding to the first feedback data packet can be determined according to the first channel information and the preset mapping relationship, that is, the terminal device that sends the first test data packet to the target electronic control unit is determined, and the terminal device serves as the target terminal device that feeds back the first feedback data packet.

[0097] The third address information includes a third source IP address, a third source MAC address, a third target IP address and a third target MAC address. The third source IP address and the third source MAC address are the source address information of the electronic control unit corresponding to the first feedback data packet. According to the first channel information and the preset mapping relationship, the fourth source IP address corresponding to the fourth address information, the fourth target IP address and the fourth target MAC address of the corresponding target terminal device can be determined. The fourth source IP address is the preset source IP address of the vehicle Ethernet switch. The source IP address (i.e., the fourth source IP address) is used to communicate with the corresponding terminal device (i.e., the target terminal device). The fourth address information is generated according to the third source MAC address, the fourth source IP address, the fourth target IP address, and the fourth target MAC address. It should be noted that the third source MAC address in the third address information is used as the fourth source MAC address in the fourth address information, that is, the MAC address of the electronic control unit that sends the first feedback data packet is used as the source MAC address, and there is no change. For example, the MAC address of ECU1 that sends the first feedback data packet is 009ACD000607, and the third source MAC address and the fourth source MAC address are both 009ACD000607.

[0098] In one embodiment, assuming that the first communication channel is channel a, the address information of the corresponding target terminal device can be determined as IP: 192.168.0.100, MAC: FC3497A4E534 according to the preset mapping relationship stored in the IP / MAC address mapping module, and the address information is used as the fourth target address information, that is, the previous first source address information is used as the current fourth target address information. Therefore, the fourth target IP address is 192.168.0.100, and the fourth target MAC address is FC3497A4E534. In addition, according to the preset mapping relationship stored in the IP / MAC address mapping module, the virtual IP address corresponding to channel a (that is, the aforementioned first target IP address, 192.168.0.101) can also be determined, and the virtual IP address is used as the fourth source IP address, that is, the fourth source IP address is 192.168.0.101. In addition, based on the third source MAC address in the third address information as the fourth source MAC address in the fourth address information, the fourth source MAC address is the MAC address of ECU1, that is, the fourth source MAC address is 009ACD000607. Therefore, it can be obtained that the fourth target IP address in the fourth address information obtained by the first feedback data packet sent by ECU1 according to the preset mapping relationship is 192.168.0.100, the fourth target MAC address is FC3497A4E534, the fourth source IP address is 192.168.0.101, and the fourth source MAC address is 009ACD000607.

[0099] In the above, the first channel information of the first communication channel corresponding to the first feedback data packet is obtained, and the fourth address information of the target terminal device corresponding to the first feedback data packet is determined according to the first channel information and the preset mapping relationship. Subsequently, the corresponding feedback data packet can be sent to the corresponding target terminal device based on the fourth address information, so that in the process of feedback of test results of multiple electronic control units with the same address information, the communication channels of each electronic control unit are isolated, and communication conflicts are avoided when multiple electronic control units with the same address information batch feed back test result data packets, and the inability to normally feed back test results due to communication conflicts is avoided, thereby improving the reliability of test feedback of the electronic control unit, and further improving the overall efficiency of the testing work of the electronic control unit.

[0100] S204: Determine a target communication port corresponding to the target terminal device according to the fourth address information and a preset mapping relationship.

[0101] According to the foregoing, the present embodiment presets the mapping relationship between the terminal device and the communication port. For example, if the IP address of the terminal device is 192.168.0.100 and is mapped to the RJ45 port connecting the terminal device 10 and the vehicle Ethernet switch 40, then as long as the source IP address is 192.168.0.100 or the target IP address is 192.168.0.100, it is forwarded through the RJ45 port connecting the terminal device 10 and the vehicle Ethernet switch 40. Therefore, after determining the fourth address information corresponding to the target terminal device in S203, the target communication port can be determined based on the fourth target IP address in the fourth address information and the preset mapping relationship. For example, if the fourth target IP address is 192.168.0.100, the corresponding target communication port can be determined to be the RJ45 port connecting the terminal device 10 and the vehicle Ethernet switch 40 according to the preset mapping relationship.

[0102] S205: Replace the third address information in the first feedback data packet with the fourth address information to generate a second feedback data packet.

[0103] After determining the fourth address information of the target terminal device corresponding to the first feedback data packet according to the first channel information and the preset mapping relationship, the fourth address information replaces the corresponding third address information in the first feedback data packet to obtain a second feedback data packet. It should be noted that based on the change of the address information in the feedback data packet, the verification information in the corresponding data packet will also change synchronously. As described above, through the address mapping and address replacement processing, it is possible to subsequently realize communication with the corresponding terminal device (i.e., the target terminal device) based on the fourth communication address information, and complete the feedback of the corresponding test results.

[0104] Fig. 9is a schematic diagram of the format of a second feedback data packet provided in an embodiment of the present application, referring to Figure 4-9 After replacing the third address information in the first feedback data packet with the fourth address information, the fourth source address information in the header part of the second feedback data packet is obtained as the fourth source IP address and the fourth source MAC address, that is, Fig. 9 The fourth source address information in includes IP:192.168.0.101, MAC:009ACD000607; corresponding Figure 4 The SRC_MAC in the second feedback packet is: 009ACD000607, SRC_IP: 192.168.0.101. The fourth target address information in the header of the second feedback packet is the fourth target IP address and the fourth target MAC address, that is, Fig. 9 The fourth target address information in includes IP: 192.168.0.100, MAC: FC3497A4E534; corresponding Figure 4 DST_MAC: FC3497A4E534, DST_IP: 192.168.0.100.

[0105] In one embodiment, the first feedback data packet includes third verification information. The fourth verification information is calculated based on the fourth address information; the third address information in the first feedback data packet is replaced by the fourth address information, and the third verification information is updated to the fourth verification information to obtain a second feedback data packet. Exemplarily, the fourth source address information in the header part of the second feedback data packet is IP: 192.168.0.101, MAC: 009ACD000607, and the fourth destination address information is IP: 192.168.0.100, MAC: FC3497A4E534. Then, the header CHECKSUM (checksum) of the IP field of the second feedback data packet, the header CHECKSUM (checksum) of the TCP field and the UDP field, and CRC (Cyclic Redundancy Check) are calculated to obtain the fourth verification information. The third verification information is updated to the fourth verification information to obtain a second feedback data packet, for example, as Figure 6 It should be noted that the second feedback data packet (i.e. Fig. 9 ) and the first feedback packet (i.e. Figure 8 ) are only different in the address information and verification information in the header part, and the corresponding test content data is the same. In other words, the in-vehicle Ethernet switch can only map and modify the communication address information and update the verification information, but cannot change the actual data content (i.e., the test content data).

[0106] S206: Send a second feedback data packet through the target communication port.

[0107] After the target communication port (e.g., the RJ45 port connecting the terminal device 10 and the vehicle Ethernet switch 40) is determined and the second feedback data packet is obtained, the second feedback data packet is sent through the corresponding target communication port to send the second feedback data packet to the corresponding target terminal device. After the corresponding target terminal device receives the second feedback data packet, it obtains the address information (i.e., the fourth address information) in the second feedback data packet, verifies the address information, performs parsing after the verification, obtains the corresponding result content data in the second feedback data packet, and uses the result information of the corresponding test processing. Based on the fourth address information, the IP address and MAC address corresponding to the target terminal device (e.g., IP: 192.168.0.100, MAC: FC3497A4E534) are used as the target address information, so the target terminal device verifies the address information of the second feedback data packet, and based on the verification, performs corresponding parsing to obtain the corresponding result content data.

[0108] It should be noted that, if any of the source address information and the target address information in the received feedback data packet does not match, the verification fails, and the target terminal device does not respond to or parse the feedback data packet.

[0109] In the above, when the test result is fed back to the corresponding electronic control unit in the vehicle, the vehicle Ethernet switch receives a first feedback data packet through the first communication channel, wherein the first feedback data packet includes the third address information; determines the fourth address information of the target terminal device corresponding to the first feedback data packet according to the first channel information of the first communication channel and the preset mapping relationship; determines the target communication port corresponding to the target terminal device according to the fourth address information and the preset mapping relationship, replaces the third address information in the first feedback data packet with the fourth address information to generate a second feedback data packet; and sends the second feedback data packet through the target communication port. By adopting the above-mentioned technical means, the first channel information of the first communication channel of the first feedback data packet and the preset mapping relationship can be received to find the fourth address information and the target communication port corresponding to the target terminal device corresponding to the first feedback data packet, and the second feedback data packet can be sent to the target terminal device based on the target communication port. Different electronic control units each correspond to a communication channel to achieve isolation, thereby avoiding the technical problem of high cost caused by introducing other devices to achieve address isolation during the test process of electronic control units with the same communication address in the vehicle. This embodiment can achieve communication isolation of electronic control units with the same communication address through the software control logic inside the vehicle Ethernet, and there is no need to additionally configure other terminal devices to achieve communication isolation, thereby reducing the testing cost of electronic control units with the same communication address in the vehicle.

[0110] Based on the above embodiments, Fig.10This is a schematic diagram of the structure of a test communication device for an electronic control unit provided in an embodiment of the present application. Fig.10 The test communication device of the electronic control unit provided in this embodiment is used for a vehicle Ethernet switch. The test communication device of the electronic control unit specifically includes: a test packet receiving module 21, an address mapping module 22, a test packet updating module 23 and a test packet sending module 24.

[0111] The test packet receiving module 21 is used to receive a first test data packet sent by the terminal device, where the first test data packet includes first address information;

[0112] An address mapping module 22, used to determine the second address information and the target communication channel of the target electronic control unit corresponding to the first test data packet according to the first address information and the preset mapping relationship;

[0113] A test packet updating module 23, configured to replace the first address information in the first test data packet with the second address information to generate a second test data packet;

[0114] The test packet sending module 24 is used to send a second test data packet through a target communication channel.

[0115] In one embodiment, the first address information includes a first source IP address, a first source MAC address, a first target IP address, and a first target MAC address, the first target MAC address is a target MAC address of a target electronic control unit, and the first source IP address and the first source MAC address are source address information of a terminal device corresponding to sending the first test data packet;

[0116] The address mapping module 22 includes a mapping submodule and an address generating submodule;

[0117] A mapping submodule, configured to determine a second source IP address, a second source MAC address, a second target IP address of a corresponding target electronic control unit, and a target communication channel according to a first target IP address in a first test data packet and a preset mapping relationship, wherein the second source IP address and the second source MAC address are source address information preset by the vehicle Ethernet switch, and the source address information is used to communicate with the corresponding electronic control unit;

[0118] The address generation submodule is used to generate second address information according to the second source IP address, the second source MAC address, the second target IP address and the first target MAC address.

[0119] In one embodiment, the first test data packet includes first verification information;

[0120] The test package update module 23 includes a first verification calculation submodule and a test package update submodule;

[0121] A first verification calculation submodule, used to calculate and obtain second verification information according to the second address information;

[0122] The test packet updating submodule is used to replace the first address information in the first test data packet with the second address information, and to update the first verification information with the second verification information to obtain the second test data packet.

[0123] In one embodiment, the test communication device of the electronic control unit further comprises:

[0124] A feedback packet receiving module, configured to receive a first feedback data packet through a first communication channel, wherein the first feedback data packet includes third address information;

[0125] A channel information acquisition module, used to acquire first channel information of a first communication channel;

[0126] The address mapping module 22 is further used to determine fourth address information of the target terminal device corresponding to the first feedback data packet according to the first channel information and the preset mapping relationship;

[0127] A target port determination module, used to determine a target communication port corresponding to a target terminal device according to the fourth address information and a preset mapping relationship;

[0128] A feedback packet updating module, configured to replace the third address information in the first feedback data packet with the fourth address information to generate a second feedback data packet;

[0129] The feedback packet sending module is used to send a second feedback data packet through a target communication port.

[0130] In one embodiment, the third address information includes a third source IP address, a third source MAC address, a third target IP address and a third target MAC address, and the third source IP address and the third source MAC address are source address information of the electronic control unit corresponding to sending the first feedback data packet;

[0131] The mapping submodule is further used to determine a fourth source IP address, a fourth target IP address and a fourth target MAC address of a corresponding target terminal device according to the first channel information and a preset mapping relationship, wherein the fourth source IP address is a source IP address preset by the vehicle Ethernet switch, and the source IP address is used to communicate with the corresponding terminal device;

[0132] The address generation submodule is further used to generate fourth address information according to the third source MAC address, the fourth source IP address, the fourth target IP address, and the fourth target MAC address.

[0133] In one embodiment, the port determination module is further used to perform parsing processing according to the fourth target IP address in the fourth address information and the preset mapping relationship to determine the target communication port.

[0134] In one embodiment, the first feedback data packet includes third verification information;

[0135] The feedback package generation module includes a second verification calculation submodule and a feedback package update submodule;

[0136] A second verification calculation submodule, used to calculate and obtain fourth verification information according to the fourth address information;

[0137] The feedback packet updating submodule is used to replace the third address information in the first feedback data packet with the fourth address information, and update the third verification information to the fourth verification information to obtain a second feedback data packet.

[0138] The test communication device for an electronic control unit provided in an embodiment of the present application can be used to execute the test communication method for an electronic control unit provided in the above-mentioned embodiment, and has corresponding functions and beneficial effects.

[0139] The present application embodiment provides a test communication device for an electronic control unit, referring to Fig.11 The test communication device of the electronic control unit includes: a processor 31, a memory 32, a communication module 33, an input device 34 and an output device 35. The number of processors in the test communication device of the electronic control unit can be one or more, and the number of memories in the test communication device of the electronic control unit can be one or more. The processor, memory, communication module, input device and output device of the test communication device of the electronic control unit can be connected through a bus or other methods.

[0140] The memory 32, as a computer-readable storage medium, can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the test communication method of the electronic control unit described in any embodiment of the present application (for example, the test packet receiving module, address mapping module, test packet update module and test packet sending module in the test communication device of the electronic control unit). The memory may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the device, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device or other non-volatile solid-state storage device. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network and a combination thereof.

[0141] The communication module 33 is used for data transmission.

[0142] The processor 31 executes various functional applications and data processing of the device by running the software programs, instructions and modules stored in the memory, that is, realizes the above-mentioned test communication method of the electronic control unit.

[0143] The input device 34 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the device. The output device 35 may include a display device such as a display screen.

[0144] The test communication device for the electronic control unit provided above can be used to execute the test communication method for the electronic control unit provided in the above embodiment, and has corresponding functions and beneficial effects.

[0145] An embodiment of the present application also provides a storage medium storing computer executable instructions, which, when executed by a computer processor, are used to execute a test communication method for an electronic control unit, the test communication method for the electronic control unit comprising: receiving a first test data packet sent by a terminal device, the first test data packet comprising first address information; determining, based on the first address information and a preset mapping relationship, second address information and a target communication channel of a target electronic control unit corresponding to the first test data packet; replacing the first address information in the first test data packet with the second address information to obtain a second test data packet; and sending the second test data packet through the target communication channel.

[0146] Storage medium - any of various types of memory devices or storage devices. The term "storage medium" is intended to include: installation media, such as CD-ROM, floppy disk or tape device; computer system memory or random access memory, such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; non-volatile memory, such as flash memory, magnetic media (such as hard disk or optical storage); registers or other similar types of memory elements, etc. Storage media may also include other types of memory or combinations thereof. In addition, the storage medium may be located in the first computer system in which the program is executed, or may be located in a different second computer system, which is connected to the first computer system via a network (such as the Internet). The second computer system can provide program instructions to the first computer for execution. The term "storage medium" may include two or more storage media residing in different locations (for example, in different computer systems connected by a network). The storage medium may store program instructions (for example, embodied as a computer program) that can be executed by one or more processors.

[0147] Of course, the storage medium storing computer executable instructions provided in an embodiment of the present application, whose computer executable instructions are not limited to the test communication method of the electronic control unit as described above, can also execute related operations in the test communication method of the electronic control unit provided in any embodiment of the present application.

[0148] The test communication device, storage medium and test communication equipment of the electronic control unit provided in the above embodiments can execute the test communication method of the electronic control unit provided in any embodiment of the present application. For technical details not described in detail in the above embodiments, please refer to the test communication method of the electronic control unit provided in any embodiment of the present application.

[0149] The above are only preferred embodiments of the present application and the technical principles used. The present application is not limited to the specific embodiments described herein, and various obvious changes, readjustments and substitutions that can be made by those skilled in the art will not deviate from the scope of protection of the present application. Therefore, although the present application is described in more detail through the above embodiments, the present application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the claims.

Claims

1. A test communication method for an electronic control unit, characterized in that: For an in-vehicle Ethernet switch, the test communication method of the electronic control unit includes: Receive a first test data packet sent by a terminal device, where the first test data packet includes first address information; Determining, according to the first address information and the preset mapping relationship, second address information and a target communication channel of a target electronic control unit corresponding to the first test data packet; Replace the first address information in the first test data packet with the second address information to obtain a second test data packet; Sending the second test data packet through the target communication channel; The method further comprises: receiving a first feedback data packet through a first communication channel, wherein the first feedback data packet includes third address information; Acquire first channel information of the first communication channel; Determine, according to the first channel information and the preset mapping relationship, fourth address information of the target terminal device corresponding to the first feedback data packet; Determining a target communication port corresponding to the target terminal device according to the fourth address information and a preset mapping relationship; Replacing the third address information in the first feedback data packet with the fourth address information to generate a second feedback data packet; The second feedback data packet is sent through the target communication port.

2. The method according to claim 1, characterized in that The first address information includes a first source IP address, a first source MAC address, a first target IP address and a first target MAC address, the first target MAC address is the target MAC address of the target electronic control unit, and the first source IP address and the first source MAC address are source address information of a terminal device corresponding to sending the first test data packet; The step of determining the second address information and the target communication channel of the target electronic control unit corresponding to the first test data packet according to the first address information and the preset mapping relationship includes: Determine, according to the first target IP address in the first test data packet and the preset mapping relationship, a second source IP address, a second source MAC address, a second target IP address of a corresponding target electronic control unit, and a target communication channel, wherein the second source IP address and the second source MAC address are source address information preset by the vehicle Ethernet switch, and the source address information is used to communicate with the corresponding electronic control unit; The second address information is generated according to the second source IP address, the second source MAC address, the second destination IP address and the first destination MAC address.

3. The method according to claim 1, characterized in that The first test data packet includes first verification information; The step of replacing the first address information in the first test data packet with the second address information to generate a second test data packet includes: Calculate and obtain second verification information according to the second address information; The second address information replaces the first address information in the first test data packet, and the first verification information is updated to the second verification information to obtain the second test data packet.

4. The method according to claim 1, characterized in that: The third address information includes a third source IP address, a third source MAC address, a third target IP address and a third target MAC address, wherein the third source IP address and the third source MAC address are source address information of the electronic control unit corresponding to sending the first feedback data packet; The determining, according to the first channel information and the preset mapping relationship, fourth address information of the target terminal device corresponding to the first feedback data packet includes: Determine, according to the first channel information and the preset mapping relationship, a fourth source IP address, a fourth target IP address of the corresponding target terminal device, and a fourth target MAC address, wherein the fourth source IP address is a preset source IP address of the vehicle Ethernet switch, and the source IP address is used to communicate with the corresponding terminal device; The fourth address information is generated according to the third source MAC address, the fourth source IP address, the fourth destination IP address, and the fourth destination MAC address.

5. The method according to claim 4, characterized in that The step of determining the target communication port corresponding to the target terminal device according to the fourth address information and the preset mapping relationship includes: The target communication port is determined by performing parsing processing based on the fourth target IP address in the fourth address information and a preset mapping relationship.

6. The method according to claim 1, characterized in that The first feedback data packet includes third verification information; The replacing the third address information in the first feedback data packet with the fourth address information to generate a second feedback data packet includes: Calculate and obtain fourth verification information according to the fourth address information; The third address information in the first feedback data packet is replaced by the fourth address information, and the third verification information is updated to the fourth verification information to obtain the second feedback data packet.

7. A test communication device for an electronic control unit, characterized in that: For an in-vehicle Ethernet switch, the test communication device of the electronic control unit comprises: A test packet receiving module, configured to receive a first test data packet sent by a terminal device, wherein the first test data packet includes first address information; An address mapping module, configured to determine, according to the first address information and a preset mapping relationship, second address information and a target communication channel of a target electronic control unit corresponding to the first test data packet; A test packet updating module, used to replace the first address information in the first test data packet with the second address information to generate a second test data packet; A test packet sending module, used for sending the second test data packet through the target communication channel; The test communication device of the electronic control unit also includes: A feedback packet receiving module, configured to receive a first feedback data packet through a first communication channel, wherein the first feedback data packet includes third address information; A channel information acquisition module, used to acquire first channel information of a first communication channel; The address mapping module is further used to determine fourth address information of the target terminal device corresponding to the first feedback data packet according to the first channel information and the preset mapping relationship; A target port determination module, used to determine a target communication port corresponding to a target terminal device according to the fourth address information and a preset mapping relationship; A feedback packet updating module, configured to replace the third address information in the first feedback data packet with the fourth address information to generate a second feedback data packet; The feedback packet sending module is used to send a second feedback data packet through a target communication port.

8. An in-vehicle Ethernet switch, characterized in that: include: memory and one or more processors; The memory is used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.

9. A storage medium storing computer executable instructions, characterized in that: When the computer executable instructions are executed by a processor, they are used to perform the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Batch testing system and method

    CN115002817A

  • Method for testing terminal equipment based on test switch and test switch network

    CN116760756A