Switch performance test method and device, storage medium and processor
By obtaining switch hardware attribute information, determining the test topology structure and performing automated testing, the problem of low test efficiency of vehicle switches is solved, and the accuracy and comprehensiveness of test results are achieved.
Patent Information
- Application Number
- CN202510828039.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-19
- Publication Date
- 2025-08-12
AI Technical Summary
The test efficiency of vehicle switches is low and the test results are inconsistent, mainly due to the differences in topology and traffic generation schemes caused by different experiences and habits of the testers.
By obtaining the hardware attribute information of the switch, determining its test topology, including the minimum and maximum communication rates, designing and combining the test topology, performing automated tests, and generating test reports.
It improves the efficiency and consistency of switch testing, reduces the test cycle, and ensures the accuracy and comprehensiveness of test results.
Smart Images

Figure CN120474969A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of vehicles, and in particular to a method, device, storage medium and processor for testing switch performance. Background Art
[0002] With the continuous advancement of automotive technology, sensors, cameras, entertainment systems, and advanced driver assistance systems used in modern vehicles require high-speed and reliable data transmission. Ethernet switches play a critical role in in-vehicle networks, ensuring efficient communication between various systems. Furthermore, the complex operating environment of vehicles demands extremely high reliability and security in-vehicle networks. Testing ensures that switches can operate properly under diverse environmental conditions and effectively defend against potential cyberattacks, protecting the security of automotive electronic systems. Switches are evaluated for compliance with benchmarks by measuring throughput, latency, frame loss rate, back-to-back, full mesh communication, many-to-one mesh communication, one-to-many mesh communication, partial mesh communication, congestion control, address caching, address learning rate, error frame filtering, broadcast frame forwarding, and latency. Testing of automotive Ethernet switches requires connecting the switch's external interfaces to test station ports, selecting different network topologies for traffic generation, and using the traffic generation results to determine whether the switch's performance and functionality meet requirements.
[0003] In the current state of the art, switch testing relies entirely on test stations. Different test stations utilize different solutions for network topology selection and traffic generation. These topologies and traffic generation schemes can lead to discrepancies in test results. Even within the same test station, different testers may employ different testing methods due to varying experience and habits. These different testing methods can also lead to inconsistent test results, such as latency. Consequently, this leads to low efficiency in vehicle switch testing.
[0004] Currently, no effective solution has been proposed to the above-mentioned technical problem of low efficiency in testing switches in vehicles. Summary of the Invention
[0005] Embodiments of the present invention provide a method, device, storage medium, and processor for testing switch performance, to at least solve the technical problem of low switch testing efficiency in a vehicle.
[0006] According to one aspect of an embodiment of the present invention, a method for testing switch performance is provided. The method may include: obtaining hardware attribute information of a switch to be tested; determining a test topology for the switch based on the hardware attribute information, wherein the test topology indicates the topology used by the switch corresponding to the hardware attribute information during performance testing; and testing the switch based on the test topology to obtain a test result, wherein the test result indicates the performance of the switch.
[0007] Optionally, based on the hardware attribute information, determining the test topology of the switch includes: determining the communication rates corresponding to multiple ports of the switch based on the hardware attribute information; determining the lowest communication rate and the highest communication rate among the multiple communication rates; and determining the test topology based on the lowest communication rate and the highest communication rate.
[0008] Optionally, based on the minimum communication rate and the maximum communication rate, a test topology is determined, including: based on the minimum communication rate, determining a first test topology of the switch, wherein the first test topology is used to indicate that data flow testing is performed on all ports of the switch using the minimum communication rate; based on the maximum communication rate, determining a second test topology of the switch, wherein the second test topology is used to indicate that data flow testing is performed on some communication rate ports of the switch using the highest communication rate; and merging the first test topology with the second test topology to obtain a test topology.
[0009] Optionally, based on the test topology, the switch is tested to obtain a test result, including: extracting test traffic from the test topology; sending the test traffic to the switch; in response to the switch receiving the test traffic, determining the received traffic received by the switch; and determining the test result based on the received traffic.
[0010] Optionally, determining the test result based on the received traffic includes: determining a test indicator based on the received traffic, wherein the test indicator is used to indicate the performance indicator of the switch; comparing the test indicator with the standard indicator to obtain a comparison result, wherein the comparison result is used to indicate the degree of matching between the test indicator and the standard indicator; and determining the test result based on the comparison result.
[0011] Optionally, after testing the switch based on the test topology and obtaining the test results, the switch performance testing method further includes: generating a test report based on the test results.
[0012] According to another aspect of an embodiment of the present invention, a switch performance testing device is provided. The device may include: an acquisition unit configured to acquire hardware attribute information of a switch to be tested; a determination unit configured to determine a test topology for the switch based on the hardware attribute information, wherein the test topology indicates a topology used by the switch corresponding to the hardware attribute information during a performance test; and a testing unit configured to test the switch based on the test topology and obtain a test result, wherein the test result indicates the performance of the switch.
[0013] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium includes a stored program, wherein when the program is executed by a processor, the device where the storage medium is located is controlled to execute the switch performance testing method in the embodiment of the present invention.
[0014] According to another aspect of an embodiment of the present invention, a processor is provided, which is configured to run a program, wherein the program, when running, executes the switch performance testing method according to an embodiment of the present invention.
[0015] According to another aspect of an embodiment of the present invention, a vehicle is provided, which is used to perform the switch performance testing method according to an embodiment of the present invention.
[0016] In an embodiment of the present invention, hardware attribute information of a switch to be tested is obtained; based on the hardware attribute information, a test topology of the switch is determined, wherein the test topology is used to indicate the topology used by the switch corresponding to the hardware attribute information during a performance test; based on the test topology, the switch is tested to obtain a test result, wherein the test result is used to indicate the performance of the switch. That is, in an embodiment of the present invention, the test topology of the switch is determined based on the hardware attribute information of the switch, and the switch is tested according to the determined test topology. Because the present invention takes the hardware attribute information of the switch into consideration, it avoids the problem of testers using different test methods due to different experiences and habits, resulting in a long test cycle, thereby solving the technical problem of low test efficiency of vehicle switches and achieving the technical effect of improving the test efficiency of vehicle switches. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0018] Figure 1 is a flow chart of a method for testing switch performance according to an embodiment of the present invention;
[0019] Figure 2 is a flow chart of a method for testing the performance of an in-vehicle Ethernet switch according to an embodiment of the present invention;
[0020] Figure 3 is a schematic diagram of a testing system principle according to an embodiment of the present invention;
[0021] Figure 4 is a schematic diagram of a switch performance testing device according to an embodiment of the present invention;
[0022] Figure 5is a schematic diagram of a vehicle according to an embodiment of the present invention. DETAILED DESCRIPTION
[0023] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0024] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, functional component or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, functional components or devices.
[0025] According to an embodiment of the present invention, an embodiment of a method for testing switch performance is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0026] Figure 1 FIG. 1 is a flow chart of a method for testing switch performance according to an embodiment of the present invention. Figure 1 As shown, the method may include the following steps:
[0027] Step S101: Obtain hardware attribute information of the switch to be tested.
[0028] In the technical solution provided in step S101 of the present invention, hardware attribute information of the switch to be tested is obtained, wherein the hardware attribute information at least includes the number of ports and the communication rate of the switch to be tested. The switch can also be called a device under test (DUT).
[0029] In this embodiment, the hardware attribute information of the switch to be tested is obtained, for example, through a command line interface. This is only an example and does not limit the specific method of obtaining the hardware attribute information of the switch to be tested.
[0030] Optionally, by understanding the hardware properties, test resources can be better allocated, redundant testing of irrelevant features can be avoided, time and manpower can be saved, and the technical effect of improving the efficiency of vehicle switch testing can be achieved.
[0031] Step S102: Determine the test topology of the switch based on the hardware attribute information.
[0032] In the technical solution provided in the above step S102 of the present invention, the test topology structure is used to indicate the topology structure used by the switch corresponding to the hardware attribute information during the performance test process, wherein the test topology structure may also be referred to as a test topology.
[0033] In this embodiment, after obtaining the hardware attribute information of the switch to be tested in step S101, the minimum and maximum communication rates of the switch, as well as the communication rates of each port of the switch, are determined based on the hardware attribute information, thereby determining the test topology of the switch. For example, the test topology can be an all-port bidirectional topology, where each port in the switch network performs bidirectional data communication; or the test topology can be a maximum communication rate port bidirectional topology, where some ports in the switch perform bidirectional data communication at the maximum communication rate. This is merely an example and does not limit the specific method of determining the test topology of the switch.
[0034] For example, assuming the switch hardware attributes include two 100M ports and two 100M ports, two test topologies can be determined. The first test topology is a bidirectional topology with four 100M ports, with a passing benchmark such as a throughput of 100M and an average latency of less than 100µs, i.e., an all-port bidirectional topology. The second test topology is a bidirectional topology with two 100M ports, with a passing benchmark such as a throughput of 1000M and an average latency of less than 100µs, i.e., a bidirectional topology with ports at the maximum communication rate.
[0035] Alternatively, understanding the switch's hardware properties allows for the design of a more precise test topology, ensuring that every hardware component and functional module is fully tested. This precision helps quickly identify potential issues and reduces false positives and missed negatives. Furthermore, a reasonable test topology can optimize the testing process, reduce unnecessary retesting, and shorten overall testing time, thereby improving vehicle switch testing efficiency.
[0036] Step S103: testing the switch based on the test topology to obtain a test result.
[0037] In the technical solution provided in the above step S103 of the present invention, the test result is used to indicate the performance of the switch.
[0038] In this embodiment, after the switch test topology is determined in step S102, the switch is tested according to the determined test topology to obtain test data, which is then integrated to obtain a test result. For example, the switch is tested according to the determined test topology to obtain test data such as the switch's outbound throughput and latency, and the test data is integrated to obtain a test result. This is merely an example and does not limit the specific method for obtaining the test result.
[0039] For example, a test station runs a test flow according to a predefined test topology. The test station then feeds the traffic received by the DUT switch port back to the test host. Based on the test results, the test host calculates whether throughput, latency, and other parameters meet project requirements and generates a test report, also known as the test result.
[0040] Optionally, by optimizing the test process and consolidating test data, the test time for each switch can be significantly reduced, thereby speeding up the entire production and testing cycle.
[0041] It should be noted that the above embodiment can be executed by a switch performance testing device.
[0042] In the above-mentioned steps S101 to S103 of the present invention, the hardware attribute information of the switch to be tested is obtained; based on the hardware attribute information, the test topology of the switch is determined, wherein the test topology is used to indicate the topology used by the switch corresponding to the hardware attribute information during the performance test; based on the test topology, the switch is tested to obtain a test result, wherein the test result is used to indicate the performance of the switch. That is, in an embodiment of the present invention, the test topology of the switch is determined based on the hardware attribute information of the switch, and the switch is tested according to the determined test topology. Because the present invention takes the hardware attribute information of the switch into consideration, the problem of testers using different test methods due to different experiences and habits, resulting in a long test cycle, is avoided, thereby solving the technical problem of low test efficiency of vehicle switches and achieving the technical effect of improving the test efficiency of vehicle switches.
[0043] The above method of this embodiment is further introduced below.
[0044] As an optional embodiment, the test topology of the switch is determined based on the hardware attribute information, including: determining the communication rates corresponding to multiple ports of the switch based on the hardware attribute information; determining the lowest communication rate and the highest communication rate among the multiple communication rates; and determining the test topology based on the lowest communication rate and the highest communication rate.
[0045] In this embodiment, the communication rates corresponding to the multiple ports of the switch are determined based on the hardware attribute information. For example, this can be done by consulting the user manual or product specifications of the switch. Determining the communication rate supported by each port of the switch is merely an example and does not limit the specific method for determining the communication rates corresponding to the multiple ports of the switch.
[0046] Optionally, after determining the communication rates corresponding to multiple ports of the switch, the multiple communication rates are compared to determine the minimum and maximum communication rates of the switch. The minimum communication rate is the minimum rate supported by the switch, typically 10 Mbps or 100 Mbps. The maximum communication rate is the maximum rate supported by the switch, which may be 1 Gbps, 10 Gbps, or even higher, depending on the design and purpose of the switch.
[0047] Optionally, after determining the minimum communication rate and the maximum communication rate of the switch, a test topology is determined according to the minimum communication rate and the maximum communication rate. The specific determination method is described below.
[0048] Alternatively, by determining the minimum and maximum communication rates, a more targeted test plan can be designed. Testers can set reasonable test cases based on these rates to ensure the comprehensiveness and effectiveness of the test.
[0049] As an optional embodiment, a test topology is determined based on a minimum communication rate and a maximum communication rate, including: determining a first test topology of the switch based on the minimum communication rate, wherein the first test topology is used to indicate that a data flow test is performed on all ports of the switch using the minimum communication rate; determining a second test topology of the switch based on the maximum communication rate, wherein the second test topology is used to indicate that a data flow test is performed on some communication rate ports of the switch using the highest communication rate; and merging the first test topology with the second test topology to obtain a test topology.
[0050] In this embodiment, the rate of each port of the switch is determined, and the rate of each port of the switch is matched with the minimum communication rate, so as to determine the first test topology of the switch according to the rate of each port. The first test topology can be a 4-gigabit port bidirectional topology, which passes a benchmark such as a throughput of 100M and an average delay of less than 100us.
[0051] For example, determine the minimum required rate supported by the switch ports, taking into account the switch's backplane bandwidth and forwarding capacity to meet overall network performance requirements. Ensure that all connected links support the minimum communication rate. Configure the switch ports to match the required rate, and conduct thorough testing after deployment to ensure that the network topology meets the minimum communication rate requirements.
[0052] Optionally, the port rates of the switch are matched with the maximum communication rate, thereby determining a second test topology of the switch based on the rates of the ports, wherein the second test topology can be a 2-gigabit port bidirectional topology, passing a benchmark such as a throughput of 1000M and an average delay of less than 100us.
[0053] Optionally, after determining the first test topology and the second test topology, the first test topology and the second test topology are merged to determine the test topology. For example, the final test topology is a four-gigabit port bidirectional topology that passes a benchmark such as a throughput of 100M and an average latency of less than 100us, and a two-gigabit port bidirectional topology that passes a benchmark such as a throughput of 1000M and an average latency of less than 100us.
[0054] Optionally, combining tests at different communication rates ensures that all ports operate correctly under varying load conditions. This comprehensive testing approach better verifies switch performance and stability. Combining test topologies reduces duplication and redundancy, saving time. A single test can cover multiple scenarios, eliminating the hassle of repeatedly setting up and executing multiple independent tests.
[0055] As an optional embodiment, based on the test topology, the switch is tested to obtain the test results, including: extracting test traffic from the test topology; sending the test traffic to the switch; in response to the switch receiving the test traffic, determining the received traffic received by the switch; and determining the test results based on the received traffic.
[0056] In this embodiment, the test topology is split, and test traffic is extracted from the test topology. After the test traffic is extracted, the test traffic is sent to the switch. For example, a switch port of an in-vehicle Ethernet switch is connected to a corresponding rate port of a test station. The test host sends traffic to the switch port through the test station. In other words, the test host sends the test traffic to the switch. The test station can be any network test traffic meter.
[0057] Optionally, after the switch receives the test traffic, the traffic received by the switch, that is, the received traffic, is determined based on the feedback from the switch. For example, the received traffic is fed back to the test host through the test station, and the test host determines the received traffic based on the received traffic. This is only an illustrative example and does not limit the specific method of determining the received traffic.
[0058] Optionally, after determining the received traffic, the test result is determined, and the specific determination method is described later.
[0059] Optionally, automated testing processes and faster test result analysis can reduce manual involvement and testing time, thereby lowering testing costs.
[0060] As an optional embodiment, determining the test result based on the received traffic includes: determining the test indicator based on the received traffic, wherein the test indicator is used to indicate the switch performance indicator; comparing the test indicator with the standard indicator to obtain a comparison result, wherein the comparison result is used to indicate the degree of matching between the test indicator and the standard indicator; and determining the test result based on the comparison result.
[0061] In this embodiment, after the received traffic is determined, the received traffic is analyzed to determine various test indicators of the switch. For example, the test host calculates test indicators such as throughput and latency.
[0062] Optionally, after determining the test indicators, the test indicators are compared with standard indicators to obtain comparison results, wherein the standard indicators can also be called project requirement indicators. The test indicators are compared with the indicators required by the project, and the test results are determined based on the comparison results.
[0063] For example, the throughput in the test indicator is compared with the throughput in the project requirement indicator to determine whether the throughput in the test indicator meets the throughput in the project requirement. Assuming that the throughput in the test indicator does not meet the throughput in the project requirement, it can be determined that the test result of the throughput of the switch does not meet the requirement. This is only an illustrative example and does not limit the specific method of determining the test result.
[0064] Optionally, the test result of the switch is determined based on the comparison result. For example, assuming that the throughput in the test indicator does not meet the throughput in the project requirement, it can be determined that the test result of the throughput of the switch does not meet the requirement. This is only an illustrative example and does not limit the specific method of determining the test result.
[0065] Optionally, automated and rapid metric comparisons can reduce manual intervention and analysis time, accelerating the test cycle. This flow-based metric comparison method can significantly improve vehicle switch testing efficiency, resulting in a faster and more reliable testing process and supporting higher-quality product development.
[0066] As an optional embodiment, after testing a switch based on a test topology and obtaining a test result, the method for testing switch performance includes: generating a test report based on the test result.
[0067] In this embodiment, a test report is generated based on the test results. For example, the test report may include but is not limited to: performance indicators, error logs, throughput, delay, packet loss rate, etc. of the switch.
[0068] Optionally, test reports can systematically summarize and analyze test data, making test results more intuitive and easy to understand. This helps quickly identify problems and trends, leading to better decision-making and optimization.
[0069] It should be noted that the above embodiment can be executed by a switch performance testing device.
[0070] In this embodiment, hardware attribute information of the switch to be tested is obtained; based on the hardware attribute information, a test topology of the switch is determined, wherein the test topology indicates the topology used by the switch corresponding to the hardware attribute information during the performance test; based on the test topology, the switch is tested to obtain a test result, wherein the test result indicates the performance of the switch. That is, in this embodiment of the present invention, the test topology of the switch is determined based on the hardware attribute information of the switch, and the switch is tested according to the determined test topology. Because the present invention takes the hardware attribute information of the switch into consideration, the problem of testers using different test methods due to different experience and habits, resulting in a long test cycle, is avoided, thereby solving the technical problem of low test efficiency of vehicle switches and achieving the technical effect of improving vehicle switch test efficiency.
[0071] The technical solutions of the embodiments of the present invention are described below with reference to preferred implementation methods.
[0072] With the continuous advancement of automotive technology, sensors, cameras, entertainment systems, and advanced driver assistance systems used in modern vehicles require high-speed and reliable data transmission. Ethernet switches play a critical role in in-vehicle networks, ensuring efficient communication between various systems. Furthermore, the complex operating environment of vehicles demands extremely high reliability and security in-vehicle networks. Testing ensures that switches can operate properly under diverse environmental conditions and effectively defend against potential cyberattacks, protecting the security of automotive electronic systems. Switches are evaluated for compliance with benchmarks by measuring throughput, latency, frame loss rate, back-to-back, full mesh communication, many-to-one mesh communication, one-to-many mesh communication, partial mesh communication, congestion control, address caching, address learning rate, error frame filtering, broadcast frame forwarding, and latency. Testing of automotive Ethernet switches requires connecting the switch's external interfaces to test station ports, selecting different network topologies for traffic generation, and using the traffic generation results to determine whether the switch's performance and functionality meet requirements.
[0073] In the related art, switch testing currently relies entirely on test stations. Different test stations use different solutions for selecting network topologies and generating traffic. These different topologies and traffic generation schemes lead to discrepancies in test results. Even within the same test station, different testers may employ different testing methods due to varying experience and habits. Different testing methods can also lead to inconsistent test results, such as latency. Consequently, there is a technical problem of low vehicle switch testing efficiency. Currently, no effective solution has been proposed to address this technical issue.
[0074] However, the present invention proposes a method for testing the performance of an in-vehicle Ethernet switch. This method considers the varying communication rates of switch ports and uses the minimum communication rate to test traffic interoperability at both low and high rates, thereby improving testing efficiency. Furthermore, when selecting the test topology, the method switches from unidirectional to bidirectional flow, minimizing the test cycle and addressing the technical issue of low vehicle switch testing efficiency.
[0075] The following is a further introduction to the embodiments of the present invention.
[0076] Figure 2 FIG. 1 is a flow chart of a method for testing the performance of an in-vehicle Ethernet switch according to an embodiment of the present invention. Figure 2 As shown, the method for testing the performance of the vehicle-mounted Ethernet switch includes the following steps:
[0077] Step S201: Determine the number of ports and the communication rate of the switch.
[0078] In this embodiment, the number of ports and the communication rate of the switch are determined, and the number of ports and the communication rate of the switch can be determined based on the hardware information of the switch.
[0079] Optionally, the number of ports: Small switches typically have 5 to 24 ports and are suitable for homes or small offices. Medium switches may have 24 to 48 ports and are suitable for medium-sized enterprises or departmental networks. Large enterprise-class switches can have more than 48 ports and support modular expansion.
[0080] Optional communication rates include: 100 Mbps, which is still used in older or less demanding networks; 1 Gbps, which has become the standard for most modern networks; and 10 Gbps, which is commonly used in data centers or environments requiring high bandwidth.
[0081] The specific number of ports and speed of a switch depends on its design objectives and application scenarios. When selecting a switch, you should evaluate and decide based on actual network requirements, budget, and future expansion plans.
[0082] Step S202: Setting the test topology and traffic.
[0083] In this embodiment, two test topologies are set. Taking two 100M ports and two Gigabit ports as an example, the first test topology can be a four-Gigabit port bidirectional topology, which passes the benchmark such as a throughput of 100M and an average delay of less than 100us.
[0084] Optionally, the second test topology may be a two-gigabit port bidirectional topology, passing a benchmark such as a throughput of 1000M and an average delay of less than 100us.
[0085] Alternatively, given that an automotive Ethernet switch may have ports operating at multiple speeds, such as 10Mbps, 100Mbps, and 1Gbps, the test topology should cover the bidirectional communication capabilities of all ports to fully evaluate their performance. For example, if the switch has a 10Mbps port, the test topology would construct a bidirectional communication link from the 10Mbps port to a higher-speed port (such as 1Gbps). By sending and receiving data packets, the test would check the integrity, speed, and latency of data transmission, ensuring efficient data exchange even on lower-speed ports.
[0086] Optionally, this optimized test topology ensures full verification of the data transmission capabilities of the automotive Ethernet switch between ports of varying speeds. In automotive electronics networks, low-speed ports are typically used to connect non-critical devices such as in-car entertainment systems, while high-speed ports are used to connect critical components such as ADAS systems and radar sensors. Bidirectional traffic testing verifies smooth data transmission between high- and low-speed ports, avoiding information delays or loss due to network bottlenecks, thereby improving the robustness of the entire in-vehicle network system and the user experience.
[0087] Alternatively, a switch test topology refers to the network structure or layout designed and constructed within a network environment to test the switch's functionality, performance, and stability. This topology can help network engineers and testers simulate different network conditions to verify the switch's performance in real-world applications. A test topology typically includes the following aspects:
[0088] Optionally, topology: Select an appropriate network topology, such as star, ring, or tree, to simulate actual application scenarios.
[0089] Optionally, device connection: Connect multiple switches and other network devices (such as routers, firewalls, servers, etc.) in a topology to test the interoperability of the switches.
[0090] Optionally, traffic generation: Use traffic generation tools to simulate network traffic of different types and sizes to test the switch's performance indicators such as throughput, latency, and jitter.
[0091] Optionally, functional testing: By configuring different network protocols and functions (such as spanning tree protocol, link aggregation, etc.), the switch's functional support and correctness are tested.
[0092] Optionally, fault simulation: introduce faults (such as port failure, network loop) to test the switch's fault recovery capability and stability.
[0093] Optionally, by designing a reasonable test topology, you can ensure that the switch can work properly in various network environments and meet the expected performance and functional requirements.
[0094] Step S203: traffic is set according to the set traffic and test topology.
[0095] In this embodiment, traffic is generated according to the traffic and test topology set in step S202, including performing throughput and latency tests on each group of ports of the vehicle-mounted Ethernet switch.
[0096] Alternatively, a continuous bidirectional traffic flow test strategy can simulate the actual operation of an in-vehicle network under high data traffic conditions, particularly for applications requiring real-time data exchange, such as sensor data transmission in autonomous driving systems. This automated control eliminates the need for manual intervention by testers, significantly improving test efficiency and reducing test errors due to operator error. This test strategy is crucial for verifying the performance stability of automotive Ethernet switches under high loads, helping to ensure safe vehicle operation in complex network environments.
[0097] Alternatively, in computer networking, "streaming" refers to transmitting a large number of data packets through the ports of a network device to test its performance or stability. The two situations you mentioned involve streaming at the minimum and maximum communication rates respectively:
[0098] Optionally, traffic is sent at the minimum communication rate across all ports of the switch: this means that packets are sent at the lowest possible rate through each port of the switch.
[0099] Optionally, traffic can be run on all ports of the switch at the minimum traffic rate to check the switch's performance under low load conditions and its ability to handle traffic on all ports simultaneously. This can help identify potential configuration issues or hardware failures.
[0100] Optionally, maximum communication rate port individual flow: This means selecting a specific port through which to send data packets at the maximum possible rate.
[0101] Optionally, this test is designed to evaluate the performance of the switch under high load conditions, especially when a single port is fully utilized. This can help confirm that the performance of that port and the switch as a whole is within specifications and check stability under high traffic.
[0102] Alternatively, through these two testing methods, you can fully understand the performance of the switch under different load conditions, which helps optimize network equipment and improve network reliability.
[0103] In step S204, the test station feeds back the traffic received by the switch port to the test host.
[0104] In this embodiment, the test station feeds back the traffic received by the DUT switch port to the test host.
[0105] Step S205: Determine the test result based on the fed-back flow rate.
[0106] In this embodiment, based on the traffic fed back in step S204, the test host calculates whether the throughput / latency etc. meet the project requirements and generates a test report.
[0107] Alternatively, switch throughput refers to the amount of data a switch can process per unit time, typically measured in bits per second (bps), bytes per second (Bps), kilobits per second (kbps), megabits per second (Mbps), or gigabits per second (Gbps). Throughput is a key indicator of switch performance, especially in network environments that require efficient processing of large amounts of data.
[0108] Alternatively, the throughput of a switch may be affected by a variety of factors, including port speed. The speed of a switch port directly affects its maximum throughput. For example, the maximum throughput of a Gigabit Ethernet port is 1 Gbps.
[0109] Alternatively, switching capacity: The total switching capacity (or backplane bandwidth) of a switch is the maximum amount of data it can process simultaneously. A higher switching capacity generally means the switch can support more concurrent data flows.
[0110] Optionally, latency: The delay in processing packets by the switch also affects actual throughput. Lower latency generally means higher throughput.
[0111] Optionally, packet size: larger packets will generally achieve higher throughput than smaller packets for the same bandwidth, because the overhead per packet is relatively low.
[0112] Optionally, network protocols and configurations: Different network protocols and switch configurations (such as VLAN, QoS, etc.) may affect data processing efficiency and throughput.
[0113] Alternatively, switch latency refers to the time it takes for a packet to enter a switch port and leave the switch. Latency is a key indicator of switch performance. Switch latency can be affected by various factors, including the following.
[0114] Optionally, switch architecture: Different switch architectures (such as store-and-forward, cut-through, and bufferless switching) will affect latency. Store-and-forward switches typically have higher latency because they need to receive a complete packet before forwarding it.
[0115] Optionally, packet processing speed: The processing power of the switch directly affects latency, including processes such as looking up the forwarding table and performing access control list checks.
[0116] Optionally, network load: During peak network traffic periods, switches may face congestion, which increases latency.
[0117] Optionally, port speed and type: ports of different speeds and types (eg, Gigabit Ethernet, 10 Gigabit Ethernet, Fibre Channel, etc.) may have different processing delays.
[0118] Optionally, set the switch's quality of service (QoS): Enabling QoS may increase latency because the switch needs to classify and queue packets.
[0119] Typically, modern switches have latency ranging from a few microseconds to tens of microseconds, but the specific value varies depending on the device and network environment. Understanding the latency characteristics of a switch when selecting it is crucial to building a high-performance network.
[0120] Figure 3 FIG. 1 is a schematic diagram of a test system according to an embodiment of the present invention. Figure 3 As shown, the test system includes: a switch 301 , a test station 302 and a test host 303 .
[0121] In this embodiment, the test host 303 includes a processor 3031 and a memory 3032. A switch port of the in-vehicle Ethernet switch 301 is connected to a corresponding rate port of a test station 302. The test host 303 sends traffic to the switch port through the test station 302. The switch port then feeds the received traffic back to the test host 303 through the test station 302. The test station 302 can be any network test traffic meter.
[0122] Optionally, the test station, in this case typically a network test device or test platform, is used to verify the performance and functionality of the automotive Ethernet switch. This test station can simulate network traffic at different rates and test the switch ports to ensure that the switch can correctly process and forward data.
[0123] Optionally, during the test, the test station sends data streams to the switch's ports, then receives and analyzes the traffic returned by the switch to evaluate its performance indicators such as transmission rate, latency, and packet loss rate.
[0124] Alternatively, in switch testing scenarios, the test host is typically a device used to generate and receive network traffic. It can be a computer connected to a test station or a dedicated network test device. The test host's primary function is to send data streams to the ports of the automotive Ethernet switch through the test station and receive return traffic from the switch ports to verify the switch's performance and functionality.
[0125] In this embodiment, the present invention solves the problems of unifying test results and improving test efficiency with the optimal test topology by setting up the environment, configuring ports, optimizing the test topology, and setting up the flow.
[0126] Optionally, the core of this method is to ensure comprehensiveness and objectivity by constructing a test topology that precisely matches the characteristics of an automotive Ethernet switch, along with an automated, standardized test process. For example, for an automotive Ethernet switch with 10 ports, each supporting a 1 Gbps transmission rate, the test topology would be designed as a ring or star structure to cover all possible communication paths. Traffic generation can be set to either a constant bit rate or burst mode to verify switch performance under varying load conditions.
[0127] Optionally, through the combination of the above technical features, this method can effectively detect key performance indicators of vehicle-mounted Ethernet switches in network communications, such as throughput, packet loss rate and latency, which are crucial to ensuring the stability and reliability of the vehicle's internal network. In intelligent driving systems, high-precision sensor data needs to be transmitted to the central processor in real time, and any degradation in network performance may lead to serious safety issues. This method eliminates the inconsistencies and errors of traditional manual testing through automated control and standardized processes, thereby improving testing efficiency. In addition, by simulating different network conditions, such as network jitter and congestion, the performance stability of vehicle-mounted Ethernet switches in harsh environments can be evaluated, thereby discovering and resolving potential network failure points in advance and ensuring driving safety.
[0128] In this embodiment, the present invention proposes a method for testing the performance of an in-vehicle Ethernet switch. Taking into account the varying communication rates of switch ports, traffic is run at the minimum communication rate to cover both low and high-rate traffic interoperability testing, thereby improving testing efficiency. Furthermore, when selecting the test topology, unidirectional traffic is switched to bidirectional traffic, minimizing the test cycle and addressing the technical issue of low vehicle switch testing efficiency.
[0129] According to an embodiment of the present invention, a switch performance testing device is also provided. It should be noted that the switch performance testing device can be used to execute the switch performance testing method in the method embodiment.
[0130] Figure 4 FIG. 1 is a schematic diagram of a switch performance testing device according to an embodiment of the present invention. Figure 4 As shown, the switch performance testing device 400 may include: an acquiring unit 401 , a determining unit 402 and a testing unit 403 .
[0131] The acquiring unit 401 is configured to acquire hardware attribute information of the switch to be tested.
[0132] The determining unit 402 is configured to determine a test topology of the switch based on the hardware attribute information, wherein the test topology indicates a topology used by the switch corresponding to the hardware attribute information during a performance test.
[0133] The testing unit 403 is configured to test the switch based on the test topology and obtain a test result, wherein the test result is used to indicate the performance of the switch.
[0134] Optionally, the determination unit 402 may include: a first determination module, used to determine the communication rates corresponding to multiple ports of the switch based on hardware attribute information; a second determination module, used to determine the lowest communication rate and the highest communication rate among the multiple communication rates; and a third determination module, used to determine the test topology based on the lowest communication rate and the highest communication rate.
[0135] Optionally, the third determination module may include: a first determination submodule, used to determine a first test topology of the switch based on the minimum communication rate, wherein the first test topology is used to indicate that data traffic testing is performed on all ports of the switch using the minimum communication rate; a second determination submodule, used to determine a second test topology of the switch based on the maximum communication rate, wherein the second test topology is used to indicate that data traffic testing is performed on some communication rate ports of the switch using the highest communication rate; and a third determination submodule, used to merge the first test topology with the second test topology to obtain a test topology.
[0136] Optionally, the test unit 403 may include: an extraction module for extracting test traffic from the test topology structure; a sending module for sending the test traffic to the switch; a fourth determination module for determining the received traffic received by the switch in response to the switch receiving the test traffic; and a fifth determination module for determining the test result based on the received traffic.
[0137] Optionally, the fifth determination module may include: a fourth determination submodule, used to determine the test indicator based on the received traffic, wherein the test indicator is used to indicate the switch performance indicator; a comparison submodule, used to compare the test indicator with the standard indicator to obtain a comparison result, wherein the comparison result is used to indicate the degree of matching between the test indicator and the standard indicator; a fifth determination submodule, used to determine the test result based on the comparison result.
[0138] Optionally, the switch performance testing device 400 may further include: a generating unit configured to generate a test report based on the test result.
[0139] In this embodiment, hardware attribute information of the switch to be tested is obtained; based on the hardware attribute information, a test topology of the switch is determined, wherein the test topology indicates the topology used by the switch corresponding to the hardware attribute information during the performance test; based on the test topology, the switch is tested to obtain a test result, wherein the test result indicates the performance of the switch. That is, in this embodiment of the present invention, the test topology of the switch is determined based on the hardware attribute information of the switch, and the switch is tested according to the determined test topology. Because the present invention takes the hardware attribute information of the switch into consideration, the problem of testers using different test methods due to different experience and habits, resulting in a long test cycle, is avoided, thereby solving the technical problem of low test efficiency of vehicle switches and achieving the technical effect of improving vehicle switch test efficiency.
[0140] According to an embodiment of the present invention, a computer-readable storage medium is further provided. The storage medium includes a stored program, wherein the program executes the switch performance testing method in the method embodiment.
[0141] Computer-readable storage media may also be referred to as computer storage media. They may include data signals transmitted in baseband or as part of a carrier wave, carrying readable program code. Such transmitted data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable storage media may transmit, propagate, or transfer programs for use by or in conjunction with an instruction execution system, apparatus, or device.
[0142] The program code contained in the computer-readable storage medium can be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, radio frequency, etc., or any suitable combination of the foregoing.
[0143] According to an embodiment of the present invention, a processor is further provided. The processor is configured to run a program. When the program is run, the method for testing switch performance in the method embodiment is executed.
[0144] An embodiment of the present application also provides a vehicle. Figure 5 is a schematic diagram of a vehicle according to an embodiment of the present invention, such as Figure 5 As shown, vehicle 500 may include a memory 510 and a processor 520, wherein the memory 510 is used to store computer programs; and the processor 520 is used to execute the programs stored in the memory 510 to implement the switch performance testing method of the present application. The serial numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the advantages or disadvantages of the embodiments.
[0145] In this application, a plurality refers to two or more.
[0146] In this application, unless otherwise expressly defined, the terms "mounted," "connected," and "connected" should be interpreted broadly. For example, they can refer to fixed, detachable, or integral connections; mechanical or electrical connections; direct or indirect connections through an intermediary; and internal communication between two components. A person of ordinary skill in the art will understand the specific meanings of these terms in this application.
[0147] The terms "first," "second," "third," "fourth," etc. (if any) in this application are used to distinguish similar objects and are not necessarily used to describe a particular sequential order.
[0148] The term "and / or" in this application simply describes an association between related objects, indicating that three possible relationships exist. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this application generally indicates that the related objects are in an "or" relationship.
[0149] Unless otherwise specified, all steps of the present application may be performed sequentially or randomly. For example, the switch performance testing method of the present application may include step S101 and step S102, which means that the switch performance testing method of the present application may include steps S101 and S102 performed sequentially, or may include steps S102 and S101 performed sequentially.
[0150] For example, the switch performance testing method of the present application may further include step S103, indicating that step S103 may be added to the method in any order. For example, the switch performance testing method of the present application may include step S101, step S102, and step S103, or may include step S101, step S103, and step S102, or may include step S103, step S101, and step S102, etc. This is merely an example and is not specifically limited.
[0151] According to an embodiment of the present invention, a computer program product is further provided. The computer program product includes a computer program. When the computer program is executed by a processor, the method for testing the performance of the switch in the embodiment is implemented.
[0152] According to an embodiment of the present invention, a computer program product is also provided, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium is used to store a computer program, and when the computer program is executed by a processor, the switch performance testing method of the embodiment is implemented.
[0153] According to an embodiment of the present invention, a computer program is further provided. When the computer program is executed by a processor, the method for testing the performance of the switch in the embodiment is implemented.
[0154] Optionally, the computer program, when executed by a processor, implements program code for the following steps: obtaining hardware attribute information of the switch to be tested; determining a test topology of the switch based on the hardware attribute information, wherein the test topology is used to indicate a topology used by the switch corresponding to the hardware attribute information during a performance test; and testing the switch based on the test topology to obtain a test result, wherein the test result is used to indicate the performance of the switch.
[0155] In the above embodiments of the present invention, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0156] In the several embodiments provided by the present invention, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are merely illustrative. For example, the division of units can be a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, and can be electrical or other forms.
[0157] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple units. Some or all of the units may be selected to achieve the purpose of the present embodiment according to actual needs.
[0158] In addition, the functional units in the various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0159] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent functional component, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software functional component, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the various embodiments of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0160] The above are only preferred embodiments of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for testing switch performance, characterized in that: include: Obtain the hardware attribute information of the switch to be tested; Determine a test topology of the switch based on the hardware attribute information, wherein the test topology indicates a topology used by the switch corresponding to the hardware attribute information during a performance test; The switch is tested based on the test topology to obtain a test result, wherein the test result is used to indicate the performance of the switch.
2. The method according to claim 1, characterized in that Determining a test topology of the switch based on the hardware attribute information includes: Determining communication rates corresponding to the plurality of ports of the switch based on the hardware attribute information; determining a lowest communication rate and a highest communication rate among a plurality of said communication rates; The test topology is determined based on the lowest communication rate and the highest communication rate.
3. The method according to claim 2, characterized in that Determining the test topology based on the lowest communication rate and the highest communication rate includes: Determining a first test topology of the switch based on the minimum communication rate, wherein the first test topology is used to indicate that a data flow test is performed on all ports of the switch using the minimum communication rate; Determining a second test topology of the switch based on the highest communication rate, wherein the second test topology is used to indicate that a data flow test is performed on some communication rate ports of the switch using the highest communication rate; The first test topology structure and the second test topology structure are merged to obtain the test topology structure.
4. The method according to claim 1, wherein Testing the switch based on the test topology to obtain a test result includes: extracting test traffic from the test topology; Sending the test traffic to the switch; In response to the switch receiving the test traffic, determining a received traffic volume received by the switch; The test result is determined based on the received traffic.
5. The method according to claim 4, characterized in that Determining the test result based on the received traffic includes: Determining a test indicator based on the received traffic, wherein the test indicator is used to indicate a performance indicator of the switch; Comparing the test indicator with the standard indicator to obtain a comparison result, wherein the comparison result is used to indicate the degree of matching between the test indicator and the standard indicator; Based on the comparison result, the test result is determined.
6. The method according to any one of claims 1 to 5, characterized in that After testing the switch based on the test topology and obtaining a test result, the method further includes: Based on the test results, a test report is generated.
7. A switch performance testing device, characterized in that: include: An acquisition unit, configured to acquire hardware attribute information of the switch to be tested; a determining unit, configured to determine a test topology of the switch based on the hardware attribute information, wherein the test topology indicates a topology used by the switch corresponding to the hardware attribute information during a performance test; The testing unit is configured to test the switch based on the test topology to obtain a test result, wherein the test result is used to indicate the performance of the switch.
8. A computer-readable storage medium, characterized in that The computer-readable storage medium includes a stored program, wherein when the program is executed by a processor, the device where the storage medium is located is controlled to execute the switch performance testing method according to any one of claims 1 to 6.
9. A processor, characterized in that: The processor is used to run a program, wherein when the program is run, the method for testing the performance of a switch according to any one of claims 1 to 6 is executed.
10. A vehicle, characterized in that: include: a memory storing an executable program; A processor is configured to run the program, wherein the program, when running, executes the method for testing the performance of a switch according to any one of claims 1 to 6.
Citation Information
Patent Citations
Tool for testing Ethernet port rate and duplex mode of switch
CN113630292A
Test system, test method, terminal equipment and computer readable storage medium
CN117255044A
Vehicle-mounted Ethernet full-load test system and method based on intelligent gateway
CN118714035A