A method, device and system for testing internal ports of an on-board Ethernet switch

By configuring identifiers in batches and enabling the switch controller to perform autonomous testing, test image data is generated, which solves the problems of accuracy and reliability in testing internal ports of vehicle-mounted Ethernet switches and achieves efficient and stable test results.

CN122247902APending Publication Date: 2026-06-19CHONGQING CHANGAN AUTOMOBILE CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHONGQING CHANGAN AUTOMOBILE CO LTD
Filing Date
2026-04-30
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

Existing technologies cannot directly test the internal ports of vehicle-mounted Ethernet switches, resulting in low accuracy and reliability of test results. Furthermore, traditional methods cannot demonstrate the communication links between internal ports and between the internal ports and the controller and external ports.

Method used

By configuring identifiers in batches, the switch controller autonomously executes the test process, generates test image data, and directly tests the internal ports, avoiding communication timing conflicts. The host computer analyzes the test image data to determine the test results.

🎯Benefits of technology

It improves the accuracy and reliability of internal port testing of vehicle-mounted Ethernet switches, reduces time and manpower costs, and ensures the stability and accuracy of the testing process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122247902A_ABST
    Figure CN122247902A_ABST
Patent Text Reader

Abstract

This application relates to a method, apparatus, and system for testing internal ports of an in-vehicle Ethernet switch, comprising: responding to receiving a test configuration command carrying a configuration identifier sent by a host computer, determining the port configuration information corresponding to the configuration identifier; controlling each internal port of the switch to enter a configuration state matching the port configuration information; responding to receiving a test command sent by the host computer, performing tests on each internal port separately in the configuration state to obtain test data corresponding to each internal port; generating test image data corresponding to each test data, and sending the test image data to the host computer through the target external port of the switch; wherein, the host computer is used to determine the test results of the switch based on the test image data and the port configuration information corresponding to the configuration identifier, which can improve the accuracy and success rate of internal port testing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of hardware testing technology, specifically to a method, apparatus, and system for testing the internal ports of an in-vehicle Ethernet switch. Background Technology

[0002] As automotive electrical and electronic (EE) architecture evolves towards domain controllers and central computing platforms, the integration of automotive central controllers continues to increase. This necessitates the aggregation of data from multiple domains, including the cockpit, chassis, and autonomous driving systems. This directly drives a surge in the number of internal modules in automotive Ethernet switches, along with new protocol conversions (such as DDS and TSN), significantly increasing the complexity of inter-module interactions. Currently, testing internal switch ports typically involves executing multiple test cases on external ports and judging the functionality of the internal ports based on the test results. However, this method is indirect and fails to demonstrate the communication links between internal ports, between internal ports and the controller, and between internal ports and external ports, resulting in low accuracy and reliability of internal port test results. Summary of the Invention

[0003] This application provides a method, apparatus, system, computer-readable storage medium, and computer program product for testing the internal ports of an in-vehicle Ethernet switch.

[0004] In a first aspect, embodiments of this application provide a method for testing the internal ports of an in-vehicle Ethernet switch, applied to the switch's controller; the method includes: In response to receiving a test configuration command carrying a configuration identifier sent by the host computer, determine the port configuration information corresponding to the configuration identifier; Control each internal port of the switch to enter a configuration state that matches the port configuration information; In response to the test command sent by the host computer, in the configuration state, each internal port is tested separately to obtain the test data corresponding to each internal port. Generate test image data corresponding to each test data, and send the test image data to the host computer through the target external port of the switch; The host computer is used to determine the test results of the switch based on the test image data and the port configuration information corresponding to the configuration identifier; both the host computer and the controller store the data mapping between the configuration identifier and the port configuration information.

[0005] Based on the aforementioned technical means, batch configuration writing using configuration identifiers can reduce the significant time and labor costs associated with modifying configuration status item by item. Furthermore, since the testing process is executed autonomously by the switch controller, it can directly test the internal ports of the switch to generate test data. Compared to indirect testing through external ports, this improves the accuracy and reliability of the test results. Moreover, not all internal ports can communicate directly with the target external port. When the internal ports send test data back to the controller, the controller will be in a high-concurrency receiving state, which can easily lead to communication timing conflicts and thus errors in the sending system. By generating test mirror data through the controller, the controller can avoid entering a high-concurrency receiving state, thus avoiding communication timing issues caused by internal port test data being relayed through the controller. Furthermore, by using mirror data, the test data of the switch's internal ports becomes visible to the host computer, which can directly perform test analysis on the internal ports. Compared to the traditional indirect analysis using test data from external ports, this method can fully guarantee the accuracy of testing each internal port and the stability of the test process. Simultaneously, the host computer can determine the switch's test results based on the test mirror data and port configuration information. When the test mirror data matches the port configuration information, the test result is considered passed; when the test mirror data does not match the port configuration information, the test result is considered failed, thereby improving the accuracy and success rate of internal port testing.

[0006] Furthermore, in response to receiving test commands from the host computer, in the configuration state, each internal port is tested separately to obtain test data corresponding to each internal port, including: In response to receiving test commands sent by the host computer, multiple test messages carrying virtual addresses are generated; Based on the configuration status, send each test packet to the internal port that matches the virtual address, and obtain the sending results of each test packet; Based on the transmission results, determine the test data corresponding to each internal port.

[0007] Based on the above technical means, when sending test messages to internal ports that are in the open or closed state, a sending result matching the configuration state of the internal port can be obtained. Test data corresponding to each internal port can be obtained based on each sending result. This allows the test data to be correlated with the sending result of the test message, which can improve the matching degree between the test data and the configuration state of each internal port to a certain extent and improve the accuracy of the test data.

[0008] Furthermore, the configuration status includes port open and port closed status; based on each transmission result, the test data corresponding to each internal port is determined, including: If the sending result indicates that the test message was successfully sent, test data containing the test message is generated for the corresponding internal port. If the test message fails to be sent, blank test data is generated for the internal port.

[0009] Based on the above technical means, after sending test messages to each internal port, corresponding test data can be generated according to the two sending results. This can improve the matching degree between the test data and each internal port to a certain extent, and improve the accuracy and reliability of the overall test data.

[0010] Furthermore, in response to receiving a test configuration command carrying a configuration identifier sent by the host computer, the port configuration information corresponding to the configuration identifier is determined, including: In response to obtaining the mapping relationship between multiple configuration identifiers sent by the host computer and the port configuration information of the internal ports of the switch, the mapping relationship is stored in the cache space of the switch; In response to receiving a test configuration command carrying a configuration identifier sent by the host computer, the port configuration information corresponding to the configuration identifier is determined based on the mapping relationship in the cache space.

[0011] Based on the above technical means, the mapping relationship between identifiers and port configuration information can be pre-written into the switch's cache space. In this way, the port configuration information of the switch can be written in batches by configuring identifiers later, which can reduce the writing errors or writing failures caused by writing port configuration information in a single batch to a certain extent, and improve the accuracy and availability of port configuration information.

[0012] Furthermore, the test messages include predefined messages; test messages are sent to the internal port matching the virtual address, and the sending results of each test message are obtained, including: Determine the first destination virtual address of the predefined message and the second destination virtual address of the undefined message; Based on the port configuration information, determine the sending actions corresponding to the first target virtual address and the second target virtual address, respectively. Based on each of the aforementioned sending actions, attempts are made to send the predefined message and the undefined message to the internal port, and the sending results of the predefined message and the undefined message are obtained.

[0013] Based on the aforementioned technical means, when the test packets include predefined packets and undefined packets, the sending actions corresponding to the predefined packets and undefined packets can be determined according to the first target virtual address of the predefined packets and the second target virtual address of the undefined packets, combined with port configuration information. Finally, the packets are sent through these sending actions. Since each type of test packet requires its sending action to be determined individually, and different port configuration states can lead to different sending results for the same sending action, increasing the number of test packet types can improve the data diversity of the sending results, enhance the accuracy of the test packets used for testing, and improve the consistency between the final test data and the test objectives.

[0014] Secondly, embodiments of this application provide a method for testing the internal ports of an in-vehicle Ethernet switch, applied to a host computer; the method includes: Send a test configuration command carrying a configuration identifier to the switch controller; Send test commands to the controller; In response to obtaining test image data from the target external port of the switch, the test results of the switch are determined based on the test image data and configuration status; The controller is used to respond to the test configuration command, determine the port configuration information corresponding to the configuration identifier; control each internal port of the switch to enter the configuration state that matches the port configuration information; respond to the test command, perform tests on each internal port based on the configuration state, and obtain test data corresponding to each internal port; generate test image data corresponding to each test data; both the host computer and the controller store the data mapping between the configuration identifier and the port configuration information.

[0015] Based on the aforementioned technical methods, the internal port testing process can be performed by controlling the switch through a host computer. Configuration identifiers are used to quickly write port configuration information, and test commands are used to control the switch to complete the test and generate test image data. Finally, the host computer determines the switch's test results based on the test image data and port configuration information. This approach can, to some extent, reduce the significant time and manpower costs associated with modifying configuration status item by item. Furthermore, batch writing greatly reduces the number of complete configuration writes, significantly minimizing the errors that can occur with modifying configuration status item by item. This, in turn, improves the stability and reliability of configuration writing during the test preparation phase, thereby enhancing the accuracy and success rate of the test.

[0016] Furthermore, based on the test image data and the port configuration information corresponding to the configuration identifier, the test results of the switch are determined, including: Determine the number of target internal ports corresponding to the port configuration information, and the number of virtual addresses contained in the test image data; where the target internal ports are internal ports that are open during the test. If the number of ports and the number of addresses are the same, the test result of the switch is determined to be a pass. If the number of ports differs from the number of addresses, the switch test result is determined to be a failure.

[0017] Based on the above technical means, the number of ports in the port configuration information and the number of virtual addresses in the test image data can be compared, and the test result can be determined as either a pass or a fail based on the comparison result. This allows for two different test results for the switch, which can improve the accuracy and reliability of the test results to a certain extent.

[0018] Thirdly, embodiments of this application provide an Ethernet switch internal port testing device, applied to the switch controller, the device comprising: The configuration module is used to respond to the test configuration command carrying the configuration identifier sent by the host computer and determine the port configuration information corresponding to the configuration identifier. The control module is used to control each internal port of the switch to enter a configuration state that matches the port configuration information. The testing module is used to respond to test commands sent by the host computer. In the configuration state, it tests each internal port separately and obtains the test data corresponding to each internal port. The generation and sending module is used to generate test image data corresponding to each test data and send the test image data to the host computer through the target external port of the switch; The host computer is used to determine the test results of the switch based on the test image data and the port configuration information corresponding to the configuration identifier; both the host computer and the controller store the data mapping between the configuration identifier and the port configuration information.

[0019] Fourthly, embodiments of this application provide an Ethernet switch internal port testing device, applied to a host computer, the device comprising: The first sending module is used to send a test configuration command carrying a configuration identifier to the controller of the switch. The second sending module is used to send test commands to the controller; The determination module is used to determine the test result of the switch in response to obtaining test image data from the target external port of the switch, based on the test image data and the port configuration information corresponding to the configuration identifier; The controller is used to respond to the test configuration command, determine the port configuration information corresponding to the configuration identifier; control each internal port of the switch to enter the configuration state that matches the port configuration information; respond to the test command, perform tests on each internal port based on the configuration state, and obtain test data corresponding to each internal port; generate test image data corresponding to each test data; and store the data mapping between the configuration identifier and the port configuration information in both the host computer and the controller.

[0020] Fifthly, embodiments of this application provide an Ethernet switch internal port testing system, the system comprising: The host computer and the switch; the switch includes multiple internal ports, target external ports, and a controller; the controller communicates with the multiple internal ports; the multiple internal ports communicate with the target external ports. The host computer is used to send test configuration commands to the controller; The controller is used to respond to the test configuration command carrying the configuration identifier sent by the host computer, determine the port configuration information corresponding to the configuration identifier, and control each internal port of the switch to enter the configuration state that matches the port configuration information. The host computer is used to send test commands to the controller; The controller is used to respond to the test commands sent by the host computer, perform tests on each internal port based on the configuration status, obtain the test data corresponding to each internal port, generate test image data corresponding to each test data, and send the test image data to the host computer through the target external port of the switch. The host computer is used to respond to test image data obtained from the target external port, and to determine the test results of the switch based on the test image data and configuration status; both the host computer and the controller store data mapping between configuration identifiers and port configuration information.

[0021] Sixthly, embodiments of this application provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the aforementioned method for testing internal ports of an Ethernet switch.

[0022] In a seventh aspect, embodiments of this application provide a computer program product, including a computer program or instructions, which, when executed by a processor of an electronic device, implement the aforementioned method for testing internal ports of an Ethernet switch.

[0023] The beneficial effects of this application are: In the embodiments of this application, batch configuration writing by configuration identifiers can reduce the time and manpower costs caused by modifying configuration status item by item to a certain extent. Since the test process is executed autonomously by the switch controller, the internal ports of the switch can be tested directly to form test data. Compared with indirect testing through external ports, the accuracy and reliability of the test results can be improved. Furthermore, since not all internal ports can communicate directly with the target external port, when the internal ports send test data back to the controller, the controller will be in a high-concurrency receiving state. At this time, communication timing conflicts are very likely to occur, resulting in sending system errors. By generating test mirror data through the controller, the controller can avoid entering a high-concurrency receiving state, thus avoiding communication timing issues caused by internal port test data being relayed through the controller. Furthermore, by using mirror data, the test data of the switch's internal ports becomes visible to the host computer, which can directly perform test analysis on the internal ports. Compared to the traditional indirect analysis using test data from external ports, this method can fully guarantee the accuracy of testing each internal port and the stability of the test process. Simultaneously, the host computer can determine the switch's test results based on the test mirror data and port configuration information. When the test mirror data matches the port configuration information, the test result is considered passed; when the test mirror data does not match the port configuration information, the test result is considered failed, thereby improving the accuracy and success rate of internal port testing. Attached Figure Description

[0024] Figure 1 A flowchart illustrating an Ethernet switch internal port testing method provided in this application embodiment; Figure 2 A flowchart illustrating another method for testing internal ports of an Ethernet switch provided in this application embodiment; Figure 3 A schematic diagram of an in-vehicle switch controller and its peripheral architecture design provided in an embodiment of this application; Figure 4 A schematic diagram of an automatic testing system based on the internal port of an in-vehicle Ethernet switch, provided for an embodiment of this application; Figure 5 A schematic diagram of an automatic testing process for an internal port of an in-vehicle Ethernet switch provided in an embodiment of this application; Figure 6 A schematic diagram of a test process for broadcasting and multicasting on an internal port of an in-vehicle Ethernet switch, provided for an embodiment of this application; Figure 7 A schematic diagram of a test process based on unicast on an internal port of an in-vehicle Ethernet switch, provided for an embodiment of this application; Figure 8 A logic block diagram of an internal port testing device for an in-vehicle Ethernet switch applied to a switch, provided in an embodiment of this application; Figure 9 A logic block diagram of an internal port testing device for an in-vehicle Ethernet switch applied to a host computer, provided in an embodiment of this application; Figure 10 This application provides a schematic diagram of the basic structure of an Ethernet switch internal port testing system according to an embodiment of the present application. Detailed Implementation

[0025] The embodiments of this application will be described below with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of this application from the content disclosed in this specification. This application can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this application. It should be understood that the preferred embodiments are only for illustrating this application and are not intended to limit the scope of protection of this application.

[0026] As automotive electrical and electronic (EE) architecture evolves towards domain controllers and central computing platforms, the integration of automotive central controllers continues to increase. This requires the aggregation of data from multiple domains, including the vehicle cockpit, chassis, and autonomous driving, which directly drives a surge in the number of internal modules of in-vehicle Ethernet switches. Furthermore, there are new protocol conversions (such as DDS and TSN), leading to increased interaction content and complexity between modules.

[0027] The current situation is that switch testing still mainly relies on the OPEN Alliance TC8 / TC11 specifications, focusing on physical layer electrical characteristics, single-function modules, and protocol conformance testing. An effective testing mechanism has not yet been established for module collaboration scenarios with increased integration. Traditional existing switch testing methods primarily involve simulated monitoring tests through external ports. Since internal switch ports are encapsulated within the controller, conditions cannot be directly triggered, and data cannot be directly collected through bus devices. This lack of methods and approaches for testing internal switch ports results in incomplete testing of intelligent connected switches and insufficient switch reliability.

[0028] To address the aforementioned technical problems, this application provides a method for testing the internal ports of an in-vehicle Ethernet switch, applied to the switch's controller. Figure 1 This is a flowchart illustrating a method for testing internal ports of an Ethernet switch, as provided in an embodiment of this application. Figure 1 As shown, the method includes the following steps S101 to S104: Step S101: In response to obtaining the test configuration command carrying the configuration identifier sent by the host computer, determine the port configuration information corresponding to the configuration identifier.

[0029] In the embodiments of this application, the host computer refers to an intelligent terminal with control and data processing capabilities, such as a mobile phone, computer, industrial control computer, or dedicated testing terminal (e.g., diagnostic instrument). A communication connection can be established between the host computer and the switch (switch). To ensure stable communication and sufficient signal distribution by the switch, the communication connection is typically set as a wired communication connection (e.g., fiber optic cable or straight-through cable), but it can also be set as a wireless communication connection with a separate channel.

[0030] A switch is a network device used for forwarding electrical (optical) signals. Through connections between its internal ports and between internal and external ports, a dedicated electrical signal path can be provided to any two network nodes connected to the switch. A switch can connect to a host computer via its external ports to conduct communication activities. Each switch contains at least one controller for performing signal processing activities.

[0031] In the embodiments of this application, the configuration identifier is a type of encoding with a specific format and length, such as a 4-digit octal encoding or a 4-digit hexadecimal encoding. Each configuration identifier can typically represent port configuration information formed by a set of configuration parameters, and different configuration identifiers typically represent different port configuration information.

[0032] When the switch controller receives a test configuration command carrying a configuration identifier from the host computer, the controller can respond to the command and determine the port configuration information corresponding to the configuration identifier. The data mapping between the configuration identifier and the port configuration information can be pre-written to the switch by the host computer, or it can be written to the switch when it is powered on using a dedicated writing device (for example, if the switch has a USB interface, when the switch is powered on, data stored in the device connected to that interface can be read through the USB interface, which is equivalent to writing this data to the switch).

[0033] Step S102: Control each internal port of the switch to enter a configuration state that matches the port configuration information.

[0034] In embodiments of this application, the port configuration information may include the port address of at least one internal port, and the configuration status of the internal port. For example, the port configuration information may specify that internal port A is in an open state, and may also specify that internal port B is in a closed state.

[0035] Once the switch controller receives the port configuration information, it can control each internal port of the switch to enter a configuration state that matches the port configuration information. The controller can modify the configuration state of each internal port one by one, according to the order in which the internal ports are included in the port configuration information.

[0036] Following the example above, after configuration, internal port A will be open, allowing data to be sent and received; while internal port B will be closed, preventing data transmission and reception. By default, all internal ports in the switch are closed. Therefore, internal port B does not require any configuration control. However, it's important to note that internal port B differs from other closed internal ports in that the controller will attempt to perform data transmission and reception tests through internal port B and obtain the results, while other closed internal ports will not be tested.

[0037] Step S103: In response to receiving the test command sent by the host computer, in the configuration state, test each internal port separately to obtain the test data corresponding to each internal port.

[0038] In the embodiments of this application, after the switch controller completes the configuration of the internal ports, it enters a command waiting state. In this state, the switch maintains its current configuration state without performing any additional actions. When the controller receives a test command sent by the host computer, it can begin testing each internal port individually in the aforementioned configuration state, thereby obtaining test data corresponding to each internal port. The testing method can be a message transmission and reception test, for example, the switch can attempt to send test messages to the host computer through the internal ports; or it can be a specific data transmission and reception test, where the specific data can be the virtual address of each internal port, or predefined strings, specific base encodings, etc.

[0039] Test data can be the transmission results of each internal port. For example, when internal port A is open, the test data for internal port A can be "successful transmission" (indicating that the communication link of internal port A is normal) or "failed transmission" (indicating that the communication link of internal port A is abnormal). When internal port B is closed, the test data for internal port B can be "successful transmission" (indicating that the communication link of internal port B is abnormal) or "failed transmission" (indicating that the communication link of internal port B is normal). Test data can also be the transmission logs of each internal port. For example, when internal port A successfully sends a test message once, the transmission log for internal port A can be "A succ 1"; when internal port A sends once successfully and once failed, the transmission log can be "A succ 1; failure 1".

[0040] Specifically, if the test process includes all internal ports, the test mode is broadcast mode; if it includes some internal ports, the test mode is multicast mode; if the test process includes one internal port, or each test section in the test queue includes one internal port, the test mode is unicast mode.

[0041] Step S104: Generate test image data corresponding to each test data, and send the test image data to the host computer through the target external port of the switch; wherein, the host computer is used to determine the test result of the switch based on the test image data and the port configuration information corresponding to the configuration identifier; both the host computer and the controller store the data mapping between the configuration identifier and the port configuration information.

[0042] In the embodiments of this application, the test mirror data is a copy of the test data. In addition to including all the test data, it also carries a mirror marker. The test mirror data carrying the mirror marker is sent to the host computer by the controller, while the original test data is either retained or destroyed. The reason for not directly sending the test data is that the storage location of the test data is different from that of the test mirror data. The test data is stored in the internal port's cache space, while the test mirror data is stored in the controller's cache space. Data in the internal port's cache space cannot be directly transmitted to the host computer via the communication link. Therefore, in this embodiment, the test mirror data is used for communication feedback, and the controller sends the test mirror data to the host computer through the target external port.

[0043] The target external port is the communication connection port between the host computer and the switch.

[0044] The host computer can determine the switch's test result based on the received test image data and the port configuration information stored in the host computer corresponding to the configuration identifier. For example, if the test data for each internal port in the test image data matches its port configuration information, the switch's test result is "test passed"; if at least one internal port's test data in the test image data does not match its port configuration information, the switch's test result is "test failed". For example, if the port configuration information for internal port A is "port open", but its test image data is blank, it indicates that its test data does not match its port configuration information; if the test image data contains the port address of internal port A, it indicates that its test data matches its port configuration information.

[0045] In addition, the host computer can generate test logs based on the test image data and port configuration information, and use the test logs as the test results of the switch. These test logs can at least be used to record which internal ports of the switch failed the test, and can also be used to record which internal ports passed the test.

[0046] In addition, the data mapping between configuration identifiers and port configuration information is shown in Table 1 below: Table 1

[0047] The configuration identifier consists of 20 bits, including Data0, Data1, ..., Data19. Except for Data1, each bit uses 00 or 01 to indicate whether its function is disabled or enabled. For example, when Data2 is 01, it indicates that test mirroring data needs to be generated for ports 0 to 15 during testing. Data1 uses different values ​​to represent different internal modules, where each internal module includes several internal ports. Data0 indicates whether switch port mirroring is enabled / disabled (1 byte), and Data2 indicates whether to add a mirroring tag (1 byte, enumeration type, 00: no tag added, 01: tag added). Default values: byte0 defaults to disabled, and the rest default to 00. All values ​​are restored to their default values ​​upon power-on and after power-off / sleep.

[0048] Based on the above embodiments disclosed in this application, batch configuration writing using configuration identifiers can reduce the time and manpower costs associated with modifying configuration states item by item to a certain extent. Furthermore, since the testing process is executed autonomously by the switch controller, it can directly test the internal ports of the switch to generate test data. Compared with indirect testing through external ports, this can improve the accuracy and reliability of the test results. Moreover, since not all internal ports can communicate directly with the target external port, when the internal ports send test data back to the controller, the controller will be in a high-concurrency receiving state. At this time, communication timing conflicts are very likely to occur, which may lead to errors in the sending system. By generating test mirror data through the controller, the controller can avoid entering a high-concurrency receiving state, thus avoiding communication timing issues caused by internal port test data being relayed through the controller. Furthermore, by using mirror data, the test data of the switch's internal ports becomes visible to the host computer, which can directly perform test analysis on the internal ports. Compared to the traditional indirect analysis using test data from external ports, this method can fully guarantee the accuracy of testing each internal port and the stability of the test process. Simultaneously, the host computer can determine the switch's test results based on the test mirror data and port configuration information. When the test mirror data matches the port configuration information, the test result is considered passed; when the test mirror data does not match the port configuration information, the test result is considered failed, thereby improving the accuracy and success rate of internal port testing.

[0049] In some embodiments, step S103 can be implemented by steps S131 to S133: S131, in response to receiving the test command sent by the host computer, generates multiple test messages carrying virtual addresses.

[0050] In embodiments of this application, the test message can be the address data corresponding to the virtual address itself, or it can be virtual address data with a specific marker. This specific marker is used to distinguish the test message from other normal communication messages, i.e., a test marker. The controller can identify the test marker and determine the communication message with the test marker as a test message.

[0051] In one possible implementation, the test packets can also be generated by a host computer and sent to the switch controller. In this case, the switch controller needs to read the virtual address in the test packets to determine the destination of each test packet.

[0052] S132, in configuration mode, sends each test packet to the internal port that matches the virtual address and obtains the sending results of each test packet.

[0053] In the embodiments of this application, the virtual address is the address of the internal port of the switch. Since the switch has already completed test configuration, it can send corresponding test packets to each internal port in the configured state. Each test packet is sent to the internal port corresponding to its contained virtual address, so that the internal port with that virtual address can receive the corresponding test packet. After all test packets have been sent, the sending result of each test packet can be obtained. The sending result can include at least two results: sending successful and sending failed. Considering that the switch may also generate test packets containing the addresses of internal ports that have not been configured, the sending result can also include a third result: not sent.

[0054] S133, based on each transmission result, determines the test data corresponding to each internal port.

[0055] In the embodiments of this application, for internal ports that have undergone test configuration, if the port status is open, and the transmission result is successful, test data indicating a successful test can be obtained; otherwise, test data indicating a failed test can be obtained. For internal ports that have not undergone test configuration, if the transmission result is no transmission, test data indicating a successful test can be obtained.

[0056] Based on the above technical means, when sending test messages to internal ports that are in the open or closed state, a sending result matching the configuration state of the internal port can be obtained. Test data corresponding to each internal port can be obtained based on each sending result. This allows the test data to be correlated with the sending result of the test message, which can improve the matching degree between the test data and the configuration state of each internal port to a certain extent and improve the accuracy of the test data.

[0057] In some embodiments, the configuration state includes a port open state and a port closed state; step S133 can be implemented through steps S331 and S332: S331: If the sending result indicates that the test message was successfully sent, generate test data containing the test message for the corresponding internal port.

[0058] In the embodiments of this application, if the sending result indicates that the test message was successfully sent, the successfully sent test message can be encapsulated as test data for the internal port. Encapsulation refers to adding a predetermined marker to the test message to indicate that the test message has been successfully sent. This allows the marked test message to be identified as test data and prevents it from being sent repeatedly.

[0059] S332 generates blank test data for the internal port if the test message fails to be sent.

[0060] In embodiments of this application, if the transmission result indicates that the test message transmission failed, blank test data can be generated. Blank test data can include at least the following two forms: using the aforementioned predetermined flag and using a default value to replace the test message data to form blank test data; or encapsulating the test message with another predetermined flag, which, in addition to indicating that the test message of the internal port has been sent, also enables the controller not to read the virtual address in the test message, that is, it is represented as blank data at the reading end.

[0061] Based on the above technical means, after sending test messages to each internal port, corresponding test data can be generated according to the two sending results. This can improve the matching degree between the test data and each internal port to a certain extent, and improve the accuracy and reliability of the overall test data.

[0062] In some embodiments, step S101 can be implemented by steps S111 and S112: S111, in response to obtaining the mapping relationship between multiple configuration identifiers sent by the host computer and the port configuration information of the internal ports of the switch, stores the mapping relationship in the cache space of the switch.

[0063] In the embodiments of this application, the switch's cache space can refer to the controller's cache space or the cache space formed by the switch's external cache device. Before the switch enters the testing process, the host computer can first send the mapping relationship between configuration identifiers and port configuration information to the switch (the host computer will also save this mapping relationship). This mapping relationship contains multiple configuration identifiers and multiple port configuration information, wherein the configuration identifiers and port configuration information correspond one-to-one. The switch receives this mapping relationship and finally stores the mapping relationship in the switch's cache space.

[0064] If the switch is connected to an external cache device, the controller can preferentially store the above mapping relationship in the external cache device; if the switch is not connected to an external cache device, the controller can store the above mapping relationship in the controller's cache space.

[0065] S112, in response to obtaining the test configuration command carrying the configuration identifier sent by the host computer, determines the port configuration information corresponding to the configuration identifier based on the mapping relationship in the cache space.

[0066] In the embodiments of this application, when the switch stores the mapping relationship between configuration identifiers and port configuration information, if the switch receives a test configuration command carrying a configuration identifier, it can find the port configuration information corresponding to the configuration identifier according to the mapping relationship. Typically, a test configuration command may include only one configuration identifier. However, if the test configuration command is defined to perform batch testing, it may also include an identifier queue formed by multiple configuration identifiers, and the test process corresponding to the current configuration identifier and the test process corresponding to the next configuration identifier are controlled by timing signals.

[0067] Based on the above technical means, the mapping relationship between identifiers and port configuration information can be pre-written into the switch's cache space. In this way, the port configuration information of the switch can be written in batches by configuring identifiers later, which can reduce the writing errors or writing failures caused by writing port configuration information in a single batch to a certain extent, and improve the accuracy and availability of port configuration information.

[0068] In some embodiments, the test message includes a predefined message; step S132 can be implemented through steps S321 to S323: S321, determine the first destination virtual address of the predefined message and the second destination virtual address of the undefined message.

[0069] In the embodiments of this application, addresses conforming to the virtual address format are not all virtual addresses of the switch's internal ports. Therefore, the generated test packets may include illegal addresses outside the preset virtual address definition. Thus, a matching query can be performed on the test packets according to the switch's preset virtual address definition to obtain predefined packets conforming to the preset virtual address definition. Other undefined packets included in the test packets will not be processed further by the controller.

[0070] When generating test messages, the controller can generate predefined messages that conform to the preset address definition of the internal port and undefined messages that do not conform to the preset address definition of the internal port. Specifically, the first target virtual address conforms to the preset address definition of the internal port, while the second target virtual address does not conform to the preset address definition of the internal port.

[0071] S322, Based on the port configuration information, determine the sending actions corresponding to the first target virtual address and the second target virtual address respectively.

[0072] In the embodiments of this application, since each predefined message can be matched with a corresponding internal port, but not all internal ports have been configured through port configuration information, the sending actions corresponding to the first target virtual address and the second target virtual address can be determined through port configuration information.

[0073] Specifically, for the first target virtual address, the sending action for predefined packets corresponding to virtual addresses within the port configuration information range is to execute sending, while the sending action for predefined packets corresponding to virtual addresses outside the port configuration information range is to prohibit sending; the sending action for undefined packets corresponding to the second target virtual address is to prohibit sending.

[0074] S323, based on each of the sending actions, attempt to send the predefined message and the undefined message to the internal port, and obtain the sending results of the predefined message and the undefined message.

[0075] In the embodiments of this application, for undefined packets, since their second target virtual address cannot match the corresponding port, the controller can actively (without attempting to send) execute a transmission prohibition action. For predefined packets that do not match the port configuration information, the controller can also actively execute a transmission prohibition action. For predefined packets that match the port configuration information, the controller will execute a sending action. After traversing all test packets, the controller can generate the sending result for each test packet. For predefined packets that match the port configuration information, the sending result is either successful or failed, depending on the configuration status of each internal port; for predefined packets that do not match the port configuration information, and for undefined packets, the sending result is that no sending was performed.

[0076] Based on the aforementioned technical means, when the test packets include predefined packets and undefined packets, the sending actions corresponding to the predefined packets and undefined packets can be determined according to the first target virtual address of the predefined packets and the second target virtual address of the undefined packets, combined with port configuration information. Finally, the packets are sent through these sending actions. Since each type of test packet requires its sending action to be determined individually, and different port configuration states can lead to different sending results for the same sending action, increasing the number of test packet types can improve the data diversity of the sending results, enhance the accuracy of the test packets used for testing, and improve the consistency between the final test data and the test objectives.

[0077] This application also provides a method for testing the internal ports of an in-vehicle Ethernet switch, applied to a host computer, such as... Figure 2 As shown, Figure 2 A flowchart illustrating a method for testing internal ports of an in-vehicle Ethernet switch provided in this application embodiment. Figure 2 The method includes: Step S201: Send a test configuration command carrying a configuration identifier to the switch controller.

[0078] In the embodiments of this application, the test configuration command can be generated by a host computer; in addition to carrying a configuration identifier, the test configuration command may also include a command flag, which is used to cause the switch to trigger the test process and perform port configuration operations based on the configuration identifier in the test configuration command.

[0079] Step S202: Send a test command to the controller.

[0080] In the embodiments of this application, after sending the test configuration command, the host computer can continue to send test commands to the switch controller. These test commands can be used to enable the switch to continue performing port testing operations after the port configuration operation has been completed.

[0081] Specifically, if the switch has not yet completed the port configuration operation when the host computer sends the test command, the switch controller will respond to the test command immediately after completing the port configuration operation; if the switch has already completed the port configuration operation when the host computer sends the test command, the controller can respond to the test command immediately after receiving the test command.

[0082] Step S203: In response to obtaining test image data from the target external port of the switch, determine the test result of the switch based on the test image data and the port configuration information corresponding to the configuration identifier; The controller is used to respond to the test configuration command, determine the port configuration information corresponding to the configuration identifier; control each internal port of the switch to enter the configuration state that matches the port configuration information; respond to the test command, perform tests on each internal port based on the configuration state, and obtain test data corresponding to each internal port; generate test image data corresponding to each test data; and store the data mapping between the configuration identifier and the port configuration information in both the host computer and the controller.

[0083] In the embodiments of this application, the test image data is generated by the switch controller based on the obtained test data after completing the internal port test operation. The host computer can obtain the test image data generated by the controller through the target external port of the switch, and derive the test result of the switch based on the test image data and the port configuration information corresponding to the configuration identifier. Specifically, if the test data of each internal port in the test image data matches its port configuration information, the switch's test result is a pass; if at least one internal port in the test image data does not match its port configuration information, the switch's test result is a fail. In addition, the host computer can also generate a test log based on the test image data and port configuration information, and use the test log as the switch's test result. This test log can at least record which internal ports of the switch failed the test, and can also record which internal ports passed the test.

[0084] Based on the aforementioned technical methods, the internal port testing process can be performed by controlling the switch through a host computer. Configuration identifiers are used to quickly write port configuration information, and test commands are used to control the switch to complete the test and generate test image data. Finally, the host computer determines the switch's test results based on the test image data and port configuration information. This approach can, to some extent, reduce the significant time and manpower costs associated with modifying configuration status item by item. Furthermore, batch writing greatly reduces the number of complete configuration writes, significantly minimizing the errors that can occur with modifying configuration status item by item. This, in turn, improves the stability and reliability of configuration writing during the test preparation phase, thereby enhancing the accuracy and success rate of the test.

[0085] In some embodiments, step S203 can be implemented by steps S231 to S233: Step S231: Determine the number of target internal ports corresponding to the port configuration information and the number of virtual addresses contained in the test image data; wherein, the target internal port is the internal port that is in the port open state during the test.

[0086] In the embodiments of this application, since the host computer cannot directly know the port address of the internal port of the switch, the port configuration information may include the number of internal ports used to perform test configuration operations; and the test image data includes the virtual address of each internal port, so the number of virtual addresses can be determined based on the test image data.

[0087] Furthermore, since the test image data for internal ports that are in a closed state is blank, the virtual addresses included in the test image data can only correspond to target internal ports that are in a port open state. Therefore, the number of target internal ports that are in a port open state can be further obtained from the various internal ports included in the port configuration information.

[0088] Step S232: If the number of ports and the number of addresses are the same, determine that the test result of the switch is a successful test.

[0089] In the embodiments of this application, the number of ports and the number of addresses are the same, which means that the virtual address and the port address are the same. That is, there is no address in the virtual address that is not in the port address, and there is no address in the port address that is not in the virtual address.

[0090] In one possible embodiment, the blank test image data can also be judged. If the number of blank test image data received by the host computer is the same as the number of internal ports in the port closed state, then the test result of the switch can be determined as a pass by combining the above conditions.

[0091] Step S233: If the number of ports and the number of addresses are different, determine that the test result of the switch is a test failure.

[0092] In the embodiments of this application, the number of ports differs from the number of addresses, meaning that there is at least one address other than a port address among the virtual addresses, or at least one address other than a virtual address among the port addresses. In this case, the test result of the switch can be considered as a test failure.

[0093] In one possible embodiment, the blank test image data can also be judged. If the number of blank test image data received by the host computer is not the same as the number of internal ports in the port closed state, for example, if an internal port that should be configured to be open is damaged, the transmission result of the internal port will be a transmission failure, resulting in the number of blank test image data being higher than the number of internal ports in the port closed state. In this case, it can be considered that the test image data does not match the port configuration information, and the test result of the switch is determined to be a test failure.

[0094] In another possible embodiment, if the controller performs a sending action on a predefined message that does not match the port configuration information or an undefined message, the sending result will eventually be reflected in the form of blank image data. During the final comparison, it will still show that the number of blank test image data is different from the number of internal ports in the port closed state. Therefore, this situation can also be considered as the test image data not matching the port configuration information, thus determining the test result as a test failure.

[0095] Based on the above technical means, the number of ports in the port configuration information and the number of virtual addresses in the test image data can be compared, and the test result can be determined as either a pass or a fail based on the comparison result. This allows for two different test results for the switch, which can improve the accuracy and reliability of the test results to a certain extent.

[0096] The following describes the application of the vehicle-mounted Ethernet switch internal port testing method provided in this application embodiment in a real-world scenario.

[0097] As automotive electrical / electronic architecture (EE) evolves towards domain controllers and central computing platforms, the integration of automotive central controllers continues to increase. They need to aggregate data from multiple domains, such as the vehicle cockpit, chassis, and autonomous driving, which directly drives a surge in the number of internal modules of in-vehicle Ethernet switches. In addition, there are new protocol conversions (such as DDS and TSN), increasing the content of interactions between modules and raising the complexity.

[0098] The current situation is that switch testing still mainly relies on the OPEN Alliance TC8 / TC11 specifications, focusing on physical layer electrical characteristics, single-function modules, and protocol conformance testing. An effective testing mechanism has not yet been established for module collaboration scenarios with increased integration. Traditional existing switch testing methods primarily involve simulated monitoring tests through external ports. Since internal switch ports are encapsulated within the controller, conditions cannot be directly triggered, and data cannot be directly collected through bus devices. This lack of methods and approaches for testing internal switch ports leads to incomplete testing of intelligent connected switches.

[0099] As described above, the inability to directly trigger conditions or directly collect data from the internal ports of the switch via bus devices leads to incomplete switch testing. This application provides a method for testing the internal ports of an in-vehicle Ethernet switch to solve the aforementioned technical problems.

[0100] This application provides a method for testing the internal ports of an in-vehicle Ethernet switch, which can quickly and accurately test and verify the data content exchanged between internal ports and between internal and external ports of the switch, so as to ensure the reliable use of functions in the fields of intelligent connected vehicle cockpit, autonomous driving, and chassis.

[0101] This application provides a method for testing the internal ports of an in-vehicle Ethernet switch, the method comprising: This application provides a schematic diagram of an in-vehicle switch controller and its peripheral architecture design. The switch node includes internal ports for connecting to internal modules such as wireless communication, driver and cockpit modules, external ports for connecting to external modules such as maps and vehicle body modules, and reserved external ports for debugging and testing. Data exchange between different external and internal ports can be transmitted through the switch.

[0102] This application provides a method for triggering switch mirroring based on diagnostic commands to activate internal modules of a switch. It adds a configuration identifier (Data Identifier, DID), and uses the values ​​of different bytes in the data field of the configuration identifier to enable / disable mirroring, select the target and source ports, and determine whether to add a mirroring label, as shown in Table 1 above.

[0103] This application provides a method for triggering internal modules of a switch to send test data based on diagnostic commands. It adds a test identifier and enables / disables the test mode, sets the number of multicast & broadcast test message transmissions, and sets the number of unicast test message transmissions by configuring the value of the asynchronous byte in the DID data field, as shown in Table 2 below.

[0104] Table 2

[0105] In this dataset, Data0 represents the test mode being enabled / disabled (1 byte), Data1 represents the source port (1 byte, enumerated type, with different values ​​representing different internal modules), Data2 represents the number of multicast or broadcast test messages sent (1 byte, unsigned), and Data3 represents the number of unicast test messages sent (1 byte, unsigned). The default value is byte0, which is disabled by default, and the rest are 00 by default. All values ​​are restored to their default values ​​upon power-on and after power-off / sleep.

[0106] Multicast refers to testing a specified group of internal ports simultaneously; broadcast refers to testing all internal ports simultaneously; unicast refers to testing a single internal port simultaneously.

[0107] This application also provides an automatic testing system based on the internal ports of an in-vehicle Ethernet switch, including a host computer, a power supply board, a bus simulation acquisition device, a programmable power supply, and a controller for the switch under test. The host computer controls the power supply board to automatically power on and off, and controls the bus acquisition device or directly sends commands to the Ethernet node under test via a serial port to obtain the Ethernet bus data of the Ethernet switch node under test. The host computer's data analysis unit automatically tests and analyzes the data and generates a test report.

[0108] This application's testing capability enables multiple consecutive automated tests, quickly verifying the correctness of data exchanged between internal ports and between internal and external ports of the switch. It can automatically acquire and save data, and automatically analyze the data to obtain test results and identify problem areas.

[0109] This application provides a test procedure for broadcasting and multicasting on the internal ports of an in-vehicle Ethernet switch.

[0110] The bus simulation acquisition device simulates sending configuration identifiers. The configuration includes enabling switch mirroring, specifying the source port as the port for internal modules (e.g., cockpit) to forward data via the switch, and the target port as a reserved external port. A mirroring tag is added. Simulated sending of test identifiers enables the internal module (e.g., cockpit) test mode, counts of multicast and broadcast test message transmissions, and monitors data from each network segment. Upon receiving the diagnostic message, the switch controller sends the Media Access Control Address (MAC) defined in the vehicle configuration table, containing all FF characters (two-digit hexadecimal strings, 255 characters in total), and sends three undefined multicast MAC messages. Each MAC message changes VLAN from 0-20 and is sent once, with an interval of 100ms. Data analysis checks that the switch broadcast and multicast port forwarding defined in the configuration table is correct, and undefined messages are not forwarded. The MAC address is the virtual address or port address of the internal port. This process is repeated sequentially to trigger the mirroring of data from the remaining internal ports and all ports requiring forwarding to the reserved ports for testing.

[0111] This application also provides a test process based on unicast on internal ports of an in-vehicle Ethernet switch. A bus simulation acquisition device simulates sending configuration identifiers. The configuration includes enabling switch mirroring, specifying the source port as the port through which internal modules (e.g., cockpit) forward data, and the target port as a reserved external port. A mirroring tag is added. Simulated sending of test identifiers enables the internal module (e.g., cockpit) test mode, counts of unicast test message transmissions, and monitors data from each network segment. After receiving diagnostic messages, the switch controller sends ARP packets for all unicast MAC addresses defined in the vehicle configuration table. Each MAC address, without VLAN or with a single VLAN, is sent N (predefined) times, changing the VLAN from 0 to 4095, with an interval of 100ms. Data analysis checks that the unicast MAC addresses and VLANs for the corresponding ports defined in the configuration table are forwarded correctly; otherwise, they are not forwarded. This process is repeated sequentially to trigger data mirroring to the reserved ports from the remaining internal ports and all ports requiring forwarding.

[0112] Figure 3 This is a schematic diagram of an in-vehicle switch controller and its peripheral architecture design provided in an embodiment of this application. The switch 300 includes: a switch controller 301; internal modules connected to the switch's internal ports: wireless communication 303, driving 304, cockpit 305, etc. (where Port3, Port4, and Port5 are internal ports of the switch); external modules connected to the switch's external ports: map 302, vehicle body 303 (where Port1 and Port2 are external ports of the switch); and at least one external reserved port 307 (Port6), which can be used for debugging and testing. Data exchange between different external and internal ports can be transmitted through the switch.

[0113] Figure 4 This is a schematic diagram of an automatic testing system based on the internal port of an in-vehicle Ethernet switch, provided in an embodiment of this application. The system includes: a host computer 401, a bus simulation acquisition device 402, a controller for the Ethernet switch under test 403, a power supply board 404, and a programmable power supply 405. The host computer 401 controls the power supply board 404 to automatically power on and off. The host computer 401 controls the bus acquisition device or directly sends commands to the Ethernet node under test via serial port to obtain the Ethernet bus data of the Ethernet switch node under test. The data analysis unit in the host computer 401 can automatically test and analyze the data and generate a test report.

[0114] Figure 5 A schematic diagram of an automatic testing process for an internal port of an in-vehicle Ethernet switch provided in this application embodiment includes steps S501 to S504: In step S501, the host computer receives the test parameters and other configuration information filled in by the human-machine interface, and sends instructions and obtains responses to the test object through network devices or directly.

[0115] In step S502, the host computer controls the power supply board to automatically control the power on and off of the switch.

[0116] Step S503: The host computer saves the test data or controls the test sample to save the data and retrieve the data to the local machine.

[0117] Step S504: The host computer's data analysis system imports the data and automatically analyzes and generates test results and reports.

[0118] Figure 6 A schematic diagram of a test process based on internal port broadcast and multicast of an in-vehicle Ethernet switch, provided for embodiments of this application, includes steps S601 to S605: Step S601: The host computer simulates sending a configuration identifier to configure the switch mirroring, source port, target port, and add a mirroring tag.

[0119] Step S602: The host computer simulates sending test identifiers and configures the internal module (such as the cockpit) test mode to be enabled and the number of times multicast & broadcast test messages are sent.

[0120] In step S603, after receiving the diagnostic command, the switch controller sends defined broadcast and multicast MAC messages and undefined multicast MAC messages. Each MAC message changes VLAN from 0 to 20 and is sent once in a rolling manner, with an interval of 100ms.

[0121] Step S604: The host computer analyzes and checks the switch broadcast and multicast ports defined in the configuration table to ensure they are forwarding correctly, and does not forward non-defined ports.

[0122] Step S605: Repeat the process of sequentially traversing and triggering the data mirroring of the remaining internal ports and all ports that need to be forwarded to the reserved ports for testing.

[0123] Figure 7 A schematic diagram of a test process based on unicast on an internal port of an in-vehicle Ethernet switch, provided for embodiments of this application, includes steps S701 to S705: Step S701: The host computer simulates sending a configuration identifier to configure the switch mirroring, source port, destination port, and add a mirroring tag.

[0124] Step S702: The host computer simulates sending test identifiers and configures the internal module (such as the cockpit) test mode to be enabled and the number of unicast transmissions.

[0125] In step S703, after receiving the diagnostic command, the switch controller sends ARP packets for all unicast MAC addresses defined in the vehicle configuration table. Each MAC address, whether without a VLAN or with a single VLAN, is sent N (customizable) times, with the VLAN changing from 0 to 4095, at 100ms intervals.

[0126] Step S704: The host computer analyzes and checks the unicast MAC and VLAN forwarding of the corresponding ports of the switch defined in the configuration table. If they are not defined, they are not forwarded.

[0127] Step S705: Repeat the process of sequentially traversing and triggering the data mirroring of the remaining internal ports and all ports that need to be forwarded to the reserved ports for testing.

[0128] This application provides an embodiment of a testing device for internal ports of an in-vehicle Ethernet switch, such as... Figure 8 As shown, Figure 8 A logic block diagram of an internal port testing device 800 for an in-vehicle Ethernet switch provided in this application embodiment. The in-vehicle Ethernet switch internal port testing device 800 includes: The configuration module 801 is used to respond to the test configuration command carrying the configuration identifier sent by the host computer and determine the port configuration information corresponding to the configuration identifier. The control module 802 is used to control each internal port of the switch to enter a configuration state that matches the port configuration information. The test module 803 is used to respond to the test commands sent by the host computer, and in the configuration state, to test each internal port separately and obtain the test data corresponding to each internal port. The generation and transmission module 804 is used to generate test image data corresponding to each test data, and send the test image data to the host computer through the target external port of the switch. The host computer is used to determine the test results of the switch based on the test image data and the port configuration information corresponding to the configuration identifier; both the host computer and the controller store the data mapping between the configuration identifier and the port configuration information.

[0129] In some embodiments, the test module 803 includes: The generation submodule is used to generate multiple test messages carrying virtual addresses in response to the test instructions sent by the host computer. The first sending submodule is used to send each test packet to the internal port that matches the virtual address in the configuration state, and obtain the sending result of each test packet; The first determination submodule is used to determine the test data corresponding to each internal port based on each sending result.

[0130] In some embodiments, the configuration state includes a port open state and a port closed state; the first determining submodule includes: The first generation unit is used to generate test data containing the test message corresponding to the internal port when the sending result indicates that the test message was successfully sent. The second generation unit is used to generate blank test data corresponding to the internal port when the test message sending result indicates that the sending failed.

[0131] In some embodiments, the configuration module 801 includes: The storage submodule is used to store the mapping relationship between multiple configuration identifiers sent by the host computer and the port configuration information of the internal ports of the switch in the cache space of the switch in response to obtaining the mapping relationship. The second determining submodule is used to respond to the test configuration command carrying the configuration identifier sent by the host computer, and determine the port configuration information corresponding to the configuration identifier based on the mapping relationship in the cache space.

[0132] In some embodiments, the test message includes a predefined message; the second sending submodule includes: The first determining unit is used to determine a predefined packet from the test packets based on the preset virtual address definition of the switch. The second determining unit is used to determine the target virtual address of the predefined message; The sending unit is used to send predefined messages to the target internal port that matches the target virtual address, and obtain the sending results of each test message.

[0133] This application provides a device for testing the internal ports of an in-vehicle Ethernet switch applied to a host computer, such as... Figure 9 As shown, Figure 9 A logic block diagram of an internal port testing device 900 for a host computer applied to an in-vehicle Ethernet switch is provided in this application embodiment. The in-vehicle Ethernet switch internal port testing device 900 includes: The first sending module 801 is used to send a test configuration command carrying a configuration identifier to the controller of the switch. The second sending module 902 is used to send test commands to the controller; The determination module 903 is used to determine the test result of the switch in response to obtaining test image data from the target external port of the switch, based on the test image data and the port configuration information corresponding to the configuration identifier; The controller is used to respond to the test configuration command, determine the port configuration information corresponding to the configuration identifier; control each internal port of the switch to enter the configuration state that matches the port configuration information; respond to the test command, perform tests on each internal port based on the configuration state, and obtain test data corresponding to each internal port; generate test image data corresponding to each test data; and store the data mapping between the configuration identifier and the port configuration information in both the host computer and the controller.

[0134] In some embodiments, the determining module 903 includes: The first determination submodule is used to determine the number of target internal ports corresponding to the port configuration information and the number of virtual addresses contained in the test image data; wherein, the target internal ports are internal ports that are in the open state during the test. The third determination submodule is used to determine whether the switch's test result is passed when the number of ports and the number of addresses are the same. The fourth determination submodule is used to determine the test result of the switch as "test failed" when the number of ports and the number of addresses are different.

[0135] The vehicle-mounted Ethernet switch internal port testing device provided in this application embodiment can realize any of the above-described vehicle-mounted Ethernet switch internal port testing methods and achieve the same technical effect as the aforementioned method embodiments, which will not be repeated here.

[0136] Figure 10 This application provides a schematic diagram of the basic structure of an Ethernet switch internal port testing system, the system 1000 including: The host computer 1001 and the switch 1002 are included. The switch 1002 includes multiple internal ports 1021, a target external port 1022, and a controller 1023. The controller is communicatively connected to the multiple internal ports. The multiple internal ports are communicatively connected to the target external port. The host computer 1001 is used to send test configuration commands to the controller; The controller 1023 is used to respond to the test configuration command carrying the configuration identifier sent by the host computer, determine the port configuration information corresponding to the configuration identifier, and control each internal port of the switch to enter the configuration state that matches the port configuration information. The host computer 1001 is used to send test commands to the controller; The controller 1023 is used to respond to the test command sent by the host computer, perform tests on each internal port based on the configuration status, obtain test data corresponding to each internal port, generate test image data corresponding to each test data, and send the test image data to the host computer through the target external port of the switch. The host computer 1001 is used to respond to test image data obtained from the target external port, and to determine the test results of the switch based on the test image data and configuration status; both the host computer and the controller store data mapping between configuration identifiers and port configuration information.

[0137] This application provides a computer-readable storage medium storing a computer program thereon. The computer-readable storage medium stores one or more programs, which can be executed by one or more processors. The computer program implements the above-described method for testing the internal ports of an in-vehicle Ethernet switch.

[0138] This application provides a computer program product, including a computer program or instructions, which, when executed by a processor, implement the above-described method for testing the internal ports of an in-vehicle Ethernet switch.

[0139] Those skilled in the art will understand that embodiments of this application can be provided as methods, apparatus, or computer program products. Therefore, this application can take the form of hardware embodiments, software embodiments, or embodiments combining software and hardware aspects. Furthermore, this application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage) containing computer-usable program code.

[0140] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (devices), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable electronic device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable electronic device, generate instructions for implementing the process in the flowchart. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0141] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable electronic device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0142] These computer program instructions may also be loaded onto a computer or other programmable electronic device, causing a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable device for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0143] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application, such as redundant parallel implementation of collision unlocking at the application layer and basic software layer based on the AUTOSAR architecture, should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for testing internal ports of an in-vehicle Ethernet switch, characterized in that, A controller applied to a switch; the method includes: In response to receiving a test configuration command carrying a configuration identifier sent by the host computer, determine the port configuration information corresponding to the configuration identifier; Control each internal port of the switch to enter a configuration state that matches the port configuration information; In response to receiving a test command sent by the host computer, in the configuration state, each of the internal ports is tested to obtain test data corresponding to each of the internal ports. Generate test image data corresponding to each of the test data, and send the test image data to the host computer through the target external port of the switch; The host computer is used to determine the test result of the switch based on the test image data and the port configuration information corresponding to the configuration identifier; both the host computer and the controller store the data mapping between the configuration identifier and the port configuration information.

2. The method for testing internal ports of an in-vehicle Ethernet switch according to claim 1, characterized in that, In response to receiving a test command sent by the host computer, in the configured state, each of the internal ports is tested to obtain test data corresponding to each internal port, including: In response to receiving test commands sent by the host computer, multiple test messages carrying virtual addresses are generated; In the configured state, each test packet is sent to the internal port that matches the virtual address, and the sending result of each test packet is obtained; Based on the sending results, the test data corresponding to each internal port is determined.

3. The method for testing the internal ports of an in-vehicle Ethernet switch according to claim 1, characterized in that, The configuration status includes port open status and port closed status; the determination of the test data corresponding to each internal port based on each transmission result includes: If the sending result indicates that the test message was successfully sent, test data containing the test message is generated for the internal port. If the sending result indicates that the test message has failed to be sent, blank test data corresponding to the internal port is generated.

4. The method for testing internal ports of an in-vehicle Ethernet switch according to claim 1, characterized in that, The step of responding to the test configuration command carrying a configuration identifier sent by the host computer and determining the port configuration information corresponding to the configuration identifier includes: In response to obtaining the mapping relationship between the multiple configuration identifiers sent by the host computer and the port configuration information of the internal ports of the switch, the mapping relationship is stored in the cache space of the switch; In response to receiving a test configuration command carrying a configuration identifier sent by the host computer, the port configuration information corresponding to the configuration identifier is determined based on the mapping relationship in the cache space.

5. The method for testing the internal ports of an in-vehicle Ethernet switch according to claim 2, characterized in that, The test message includes predefined messages and undefined messages; the step of sending the test message to the internal port matching the virtual address and obtaining the sending results of each test message includes: Determine the first destination virtual address of the predefined message and the second destination virtual address of the undefined message; Based on the port configuration information, determine the sending actions corresponding to the first target virtual address and the second target virtual address, respectively. Based on each of the aforementioned sending actions, attempts are made to send the predefined message and the undefined message to the internal port, and the sending results of the predefined message and the undefined message are obtained.

6. A method for testing internal ports of an in-vehicle Ethernet switch, characterized in that, Applied to a host computer; the method includes: Send a test configuration command carrying a configuration identifier to the switch controller; Send a test command to the controller; In response to obtaining the test image data from the target external port of the switch, the test result of the switch is determined based on the test image data and the port configuration information corresponding to the configuration identifier; The controller is configured to, in response to receiving the test configuration instruction, determine the port configuration information corresponding to the configuration identifier; control each internal port of the switch to enter a configuration state matching the port configuration information; in response to receiving the test instruction, perform tests on each internal port based on the configuration state to obtain test data corresponding to each internal port; generate test image data corresponding to each of the test data; and both the host computer and the controller store a data mapping between the configuration identifier and the port configuration information.

7. The method for testing internal ports of an in-vehicle Ethernet switch according to claim 6, characterized in that, The step of determining the test result of the switch based on the test image data and the port configuration information corresponding to the configuration identifier includes: The number of target internal ports corresponding to the port configuration information and the number of virtual addresses contained in the test image data are determined respectively; wherein, the target internal port is the internal port that is in the port open state during the test; If the number of ports is the same as the number of addresses, the test result of the switch is determined to be a successful test. If the number of ports differs from the number of addresses, the test result for the switch is determined to be a test failure.

8. A device for testing internal ports of an Ethernet switch, characterized in that, A controller applied to a switch, the device comprising: The configuration module is used to respond to a test configuration command carrying a configuration identifier sent by the host computer and determine the port configuration information corresponding to the configuration identifier; The control module is used to control each internal port of the switch to enter a configuration state that matches the port configuration information; The testing module is used to respond to the test command sent by the host computer, and in the configuration state, to test each of the internal ports respectively and obtain the test data corresponding to each of the internal ports respectively; A generation and transmission module is used to generate test image data corresponding to each of the test data, and send the test image data to the host computer through the target external port of the switch; The host computer is used to determine the test result of the switch based on the test image data and the port configuration information corresponding to the configuration identifier; both the host computer and the controller store the data mapping between the configuration identifier and the port configuration information.

9. A device for testing internal ports of an Ethernet switch, characterized in that, Applied to a host computer, the device includes: The first sending module is used to send a test configuration command carrying a configuration identifier to the controller of the switch. The second sending module is used to send test commands to the controller; A determination module is configured to, in response to obtaining the test image data from the target external port of the switch, determine the test result of the switch based on the test image data and the port configuration information corresponding to the configuration identifier; The controller is configured to, in response to receiving the test configuration instruction, determine the port configuration information corresponding to the configuration identifier; control each internal port of the switch to enter a configuration state matching the port configuration information; in response to receiving the test instruction, perform tests on each internal port based on the configuration state to obtain test data corresponding to each internal port; generate test image data corresponding to each of the test data; and both the host computer and the controller store a data mapping between the configuration identifier and the port configuration information.

10. An Ethernet switch internal port testing system, characterized in that, The system includes: A host computer and a switch; the switch includes multiple internal ports, a target external port, and a controller; the controller is communicatively connected to the multiple internal ports; the multiple internal ports are communicatively connected to the target external port; The host computer is used to send test configuration commands to the controller; The controller is used to respond to a test configuration command carrying a configuration identifier sent by a host computer, determine the port configuration information corresponding to the configuration identifier, and control each internal port of the switch to enter a configuration state that matches the port configuration information. The host computer is used to send test commands to the controller; The controller is used to respond to the test command sent by the host computer, and in the configuration state, to test each of the internal ports respectively to obtain test data corresponding to each of the internal ports; generate test image data corresponding to each of the test data, and send the test image data to the host computer through the target external port of the switch; The host computer is used to respond to obtaining the test image data from the target external port, and determine the test result of the switch based on the test image data and the configuration status; both the host computer and the controller store data mapping between the configuration identifier and the port configuration information.