CN118057781A - Switch testing method, switch, readable storage medium, and vehicle - Google Patents

Switch testing method, switch, readable storage medium, and vehicle Download PDF

Info

Publication number
CN118057781A
CN118057781A CN202211448215.0A CN202211448215A CN118057781A CN 118057781 A CN118057781 A CN 118057781A CN 202211448215 A CN202211448215 A CN 202211448215A CN 118057781 A CN118057781 A CN 118057781A
Authority
CN
China
Prior art keywords
test
port
physical port
data stream
physical
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211448215.0A
Other languages
Chinese (zh)
Inventor
吴义敏
王国嘉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Rockwell Technology Co Ltd
Original Assignee
Beijing Rockwell Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Rockwell Technology Co Ltd filed Critical Beijing Rockwell Technology Co Ltd
Priority to CN202211448215.0A priority Critical patent/CN118057781A/en
Publication of CN118057781A publication Critical patent/CN118057781A/en
Pending legal-status Critical Current

Links

Landscapes

  • Small-Scale Networks (AREA)

Abstract

The application discloses a switch testing method, a switch, a readable storage medium and a vehicle, wherein the method comprises the following steps: establishing a communication connection between a first physical port and a test device; under the condition that the first physical port receives the test data stream sent by the test equipment, the test data stream is sent from the first physical port to a preset second physical port along a first preset transmission path of the test data stream, and the test data stream is reversely sent from the second physical port to the first physical port, wherein the first preset transmission path comprises at least one test port; and acquiring the first data receiving quantity of the test data stream received by each test port, and sending the first data receiving quantity to the test equipment so that the test equipment displays the first data receiving quantity of each test port. The switch testing method can obtain the data receiving quantity of the testing interface through the first physical interface and the second physical interface.

Description

Switch testing method, switch, readable storage medium, and vehicle
Technical Field
The application belongs to the technical field of communication, and particularly relates to a switch testing method, a switch, a readable storage medium and a vehicle.
Background
With the intellectualization of existing vehicles, more and more vehicles need to be connected into an external network through a switch. The switch applied to the vehicle not only comprises a physical port which can be quickly plugged and unplugged by a user, but also comprises an internal port which is arranged in a switch shell and is used for being connected with other equipment of the vehicle. When testing the data forwarding performance of the switch port, the internal port cannot be physically connected with the external detection device, so that the data forwarding performance of the internal port cannot be directly detected through the external detection device.
Disclosure of Invention
The embodiment of the application aims to provide a switch testing method, a switch, a readable storage medium and a vehicle, which can acquire the data receiving quantity of an internal port and can characterize the data forwarding performance of the internal port through the data receiving quantity.
In a first aspect, an embodiment of the present application provides a method for testing a switch, where the method includes:
Establishing a communication connection between a first physical port and a test device;
Under the condition that the first physical port receives the test data stream sent by the test equipment, the test data stream is sent from the first physical port to a preset second physical port along a first preset transmission path of the test data stream, and the test data stream is reversely sent from the second physical port to the first physical port, wherein the first preset transmission path comprises at least one test port;
And acquiring the first data receiving quantity of the test data stream received by each test port, and sending the first data receiving quantity to the test equipment so that the test equipment displays the first data receiving quantity of each test port.
According to an embodiment of the first aspect of the present application, after obtaining the first data receiving amount of each test port, the method further includes:
Calculating a first data receiving amount of a test port positioned at the front end and a first variation value of the first data receiving amount of a test port positioned at the rear end in adjacent test ports on a first preset transmission path;
and generating frame loss information according to the first change value.
According to an embodiment of the first aspect of the present application, generating frame loss information according to the first variation value includes:
In the case where the first variation value is greater than 0, frame loss information about the test port located at the front end is generated.
According to an embodiment of the first aspect of the present application, after obtaining the first data receiving amount of each test port, the method further includes:
acquiring second data receiving amounts of the test data streams received by the first physical port and the second physical port each time;
calculating second variation values of the second data receiving quantity corresponding to the first physical port and the first data receiving quantity of the test port in the adjacent first physical port and test port on the first preset transmission path;
Calculating a third variation value of a second data receiving amount corresponding to the second physical port and a first data receiving amount of the test port in the adjacent second physical port and test port on the first preset transmission path;
and generating frame loss information according to the second change value and the third change value.
According to an embodiment of the first aspect of the present application, generating frame loss information according to the second variation value includes:
Generating frame loss information about the first physical port in the case that the second variation value is greater than 0;
Generating frame loss information about the test port corresponding to the second variation value under the condition that the second variation value is smaller than 0;
generating frame loss information about the second physical port in the case that the third variation value is greater than 0;
And generating frame loss information about the test port corresponding to the third variation value under the condition that the third variation value is smaller than 0.
According to an embodiment of the first aspect of the present application, the first preset transmission path comprises a first test port and a second test port; transmitting the test data stream from the first physical port to the second physical port along a first predetermined transmission path of the test data stream, and transmitting the test data stream from the second physical port to the first physical port in a reverse direction includes:
According to the first preset transmission path, the first physical port is controlled to forward the test data to the first test port, the first test port is controlled to forward the test data to the second test port, and the second test port is controlled to forward the test data to the second physical port;
According to the first preset transmission path, the second physical port is controlled to send the test data back to the second test port, the second test port is controlled to forward the test data to the first test port, and the first test port is controlled to forward the test data to the first physical port.
In a second aspect, an embodiment of the present application provides a switch, including:
The connection module is used for establishing communication connection between the first physical port and the test equipment;
The transmission module is used for transmitting the test data stream from the first physical port to a preset second physical port along a first preset transmission path of the test data stream and reversely transmitting the test data stream from the second physical port to the first physical port under the condition that the first physical port receives the test data stream transmitted by the test equipment, wherein the first preset transmission path comprises at least one test port;
And the sending module is used for obtaining the first data receiving amount of the test data stream received by each test port each time and sending the first data receiving amount to the test equipment so that the test equipment displays the first data receiving amount of each test port.
In a third aspect, embodiments of the present application provide a switch comprising a processor, a memory and a program or instructions stored on the memory and executable on the processor, the program or instructions when executed by the processor implementing the steps of the switch testing method as provided in the second aspect.
In a fourth aspect, an embodiment of the present application provides a readable storage medium, wherein a program or an instruction is stored on the readable storage medium, the program or the instruction implementing the steps of the switch testing method as provided in the second aspect when executed by a processor.
In a fifth aspect, an embodiment of the present application provides a vehicle including: a switch as provided in the second aspect, or a switch as provided in the third aspect.
In the switch testing method provided by the embodiment, by establishing communication connection between the first physical port and the testing device, the first physical port can receive the test data stream sent by the testing device, and the second physical port can send the received test data stream to the sending port in a loop; the first data receiving quantity of the test data stream received by the test port each time can be obtained by sending the test data stream among at least one test port, the first physical port and the second physical port along the first preset transmission path, and the data forwarding performance of the test port can be evaluated by sending the first data receiving quantity to the test equipment, so that a user or the test equipment can obtain the change of the size of the transmission of the test data stream among the ports through the analysis of the first data receiving quantity, and the problem of frame loss of the test port is determined through the change.
Drawings
FIG. 1 is a flow chart of a method for testing a switch according to an embodiment of the present application;
FIG. 2 is a schematic diagram of the data transmission direction of a switch and test equipment according to one embodiment of the present application;
FIG. 3 is a flow chart of a method for testing a switch according to an embodiment of the present application;
FIG. 4 is a flow chart of a method for testing a switch according to an embodiment of the present application;
FIG. 5 is a schematic diagram of the data transmission direction of a switch and test equipment according to one embodiment of the present application;
fig. 6 is a schematic diagram of a switch according to an embodiment of the present application.
Detailed Description
In order that the above objects, features and advantages of the present disclosure may be more clearly understood, a further description of aspects of the present disclosure will be provided below. It should be noted that, without conflict, the embodiments of the present disclosure and features in the embodiments may be combined with each other.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure, but the present disclosure may be practiced otherwise than as described herein; it will be apparent that the embodiments in the specification are only some, but not all, embodiments of the disclosure.
It should be noted that in this document, relational terms such as "first" and "second" and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises an element.
The switch testing method provided by the embodiment of the application is described in detail below through specific embodiments and application scenes thereof with reference to the accompanying drawings.
As shown in fig. 1 and fig. 2, an embodiment of the present application provides a method for testing a switch, which is applied to a switch in a vehicle, where the switch may be used to connect an operating system of the vehicle with ethernet, so that the vehicle may interact with a server of a vehicle management platform, other vehicles, road Side Units (RSU), and the like.
The switch testing method provided by the application can comprise the following steps:
s101, establishing communication connection between a first physical port and test equipment;
S102, under the condition that a first physical port receives a test data stream sent by test equipment, the test data stream is sent from the first physical port to a preset second physical port along a first preset transmission path of the test data stream, and the test data stream is reversely sent from the second physical port to the first physical port, wherein the first preset transmission path comprises at least one test port;
s103, obtaining the first data receiving quantity of the test data stream received by each test port each time, and sending the first data receiving quantity to the test equipment so that the test equipment displays the first data receiving quantity of each test port.
The first physical port and the second physical port are ports in the switch. For convenience of testing, the first physical port and the second physical port may be sockets exposed on the housing of the switch, so as to facilitate a user to realize physical connection of the test device and the physical port through the communication wire. The second physical port may be set to a loop back (loopback) mode such that the second physical port may return the test data stream received from the upstream port as it is to the upstream port. Any two exposed sockets in the switch may be selected as the first physical port and the second physical port.
The test data stream includes a plurality of packets, the packets including a plurality of frames. The user inputs various test data stream attribute information in the test equipment, wherein the test data stream attribute information can comprise the size of frames and the number of packets, the test equipment can generate a test data stream according to the test data stream attribute information input by the user and send the test data stream to the switch, and a first physical port of the switch receives the test data stream. The test data stream carries a first preset transmission path, namely, a port address for receiving the test data stream is defined, and the port needs to forward the test data to another port address, so that the switch can forward the test data stream among a plurality of ports to count the data receiving amount corresponding to each port. In the application, the first preset transmission path comprises a first physical port, a test port P1-a test port Pn, a second physical port, a test port Pn-a test port P1, a first physical port and test equipment which are sequentially arranged, wherein n is more than or equal to 1. The test ports P1 to Pn are a plurality of different ports in the switch, and the test ports may be ports disposed in a casing of the switch, and since the ports are not exposed to the casing, communication connection with other devices cannot be directly established through wires. Data transmission can be conducted between the first physical port and the test port based on sgmii protocol, and data transmission can be conducted between the second physical port and the test port based on sgmii protocol.
The first data receiving amount is the size of the test data stream received by the test port. The first data reception amount corresponding to the test port may be stored in a register of the switch. After the switch completes the forwarding step of the test data stream along the test path, the first physical port sends the test data stream to the test device, and the switch may send the first data reception amount to the test device. Of course, the test device may also send an acquisition request to the switch after receiving the test data stream sent by the first physical port, where the switch feeds back the first data receiving amount to the test device according to the received acquisition request.
It will be understood by those skilled in the art that the size of the test data stream sent by the test device to the first physical port is known, the size of the test data stream received by the test device may be obtained by monitoring the monitoring module in the test device, and the first data receiving amount of the test data stream received by each test port is known, so that the user may determine the data forwarding performance of the test port, that is, the frame loss condition of the test port according to the change of the size of the test data stream in the transmission process. The size of the test data stream can be set so as to pass through the frame loss condition of the test ports corresponding to the test data streams with different sizes.
For example: in the embodiment shown in fig. 2, the test device sends a test data stream of 1000000 bytes to the first physical port, the first physical port H1 sends a test data stream to the test port P1, the first data receiving amount corresponding to the test port P1 is 1000000 bytes, the test port P1 sends a test data stream to the test port P2, the first data receiving amount corresponding to the test port P2 is 998500 bytes, the test port P2 sends a test data stream to the second physical port H2, the second physical port H2 sends a test data stream to the test port P2, the first data receiving amount corresponding to the test port P2 is 998500 bytes, the test port P2 sends a test data stream to the test port P1, the first data receiving amount corresponding to the test port P1 is 998500 bytes, the test port P1 sends a test data stream to the first physical port H1, the test data stream sent by the test port P1 is monitored to the test device, and the test device obtains a received test data stream of 998500 bytes. By comparing the changes of the sizes of the test data streams, it is known that the test port P1 has a problem of frame loss in the process of forwarding the test data stream sent by the first physical port H1 to the test port P2.
In the switch testing method provided by the embodiment, by establishing communication connection between the first physical port and the testing device, the first physical port can receive the test data stream sent by the testing device, and the second physical port can send the received test data stream to the sending port in a loop; the first data receiving quantity of the test data stream received by the test port each time can be obtained by sending the test data stream among at least one test port, the first physical port and the second physical port along the first preset transmission path, and the data forwarding performance of the test port can be evaluated by sending the first data receiving quantity to the test equipment, so that a user or the test equipment can obtain the change of the size of the transmission of the test data stream among the ports through the analysis of the first data receiving quantity, and the problem of frame loss of the test port is determined through the change.
In some embodiments, after obtaining the first data reception amount of each test port, further comprising:
S301, calculating a first data receiving quantity of a test port positioned at the front end and a first change value of the first data receiving quantity of a test port positioned at the rear end in adjacent test ports on a first preset transmission path;
s302, generating frame loss information according to the first change value.
Adjacent test ports are adjacent on the transmission path, not adjacent in physical location. For example, the first test port P1 transmits a test data stream to the second test port P2, and the first test port P1 and the second test port P2 are adjacent on the transmission path. For example, the second test port P2 sends a test data stream to the second physical port H2, and the second physical port H2 sends a test data stream back to the second test port P2, and then the second test port P2 located at the front end of the second physical port H2 and the second test port P2 located at the rear end of the second physical port H2 are adjacent on the transmission path.
In this embodiment, the switch may calculate a first change value according to the first data receiving amount of each test port, determine whether a frame loss phenomenon occurs according to the first change value, and generate frame loss information to determine an occurrence position of the frame loss phenomenon. The frame loss information may include an identification of a test port on which the transmission frame loss occurred, a lost frame number, and the like. The switch may also send the frame loss information to the value test device for further analysis by the test device.
In some embodiments, S302 includes:
In the case where the first variation value is greater than 0, frame loss information about the test port located at the front end is generated.
And under the condition that the first variation value is equal to 0, the first data receiving quantity received by the adjacent test ports is not changed, and the test ports at the front end completely forward the received test data stream. When the first variation value is greater than 0, the magnitude of the first data receiving amount received by the adjacent test port is changed, and frame loss information about the test port at the front end is generated.
Referring to fig. 2 and fig. 4, in some embodiments, after obtaining the first data receiving amount of each test port, the method further includes:
S401, acquiring second data receiving quantity of the first physical port and the second physical port for receiving the test data stream each time;
S402, calculating second variation values of second data receiving quantity corresponding to the first physical port and first data receiving quantity of the test port in adjacent first physical ports and test ports on a first preset transmission path;
s403, calculating a third variation value of a second data receiving amount corresponding to the second physical port and a first data receiving amount of the test port in the adjacent second physical port and test port on the first preset transmission path;
s404, generating frame loss information according to the second change value and the third change value.
The adjacent second physical port and test port are adjacent on the transmission path, not adjacent in physical location. For example, the second test port P2 sends a test data stream to the second physical port H2, and the second physical port H2 sends a test data stream back to the second test port P2, then the second test port P2 located at the front end of the second physical port H2 is adjacent to the second physical port H2 on the transmission path, and the second physical port H2 is adjacent to the second test port P2 located at the back end.
The switch can determine whether the first physical port and the test port at the front end of the first physical port send the test data stream to generate frame loss according to the second change value, and generate frame loss information. The switch can determine whether the frame loss phenomenon occurs in the test data stream sent by the first physical port and the test port positioned at the front end of the first physical port according to the second change value, and generate frame loss information. The frame loss information may further include identification identifiers of the first physical port and the second physical port where the frame loss phenomenon occurs.
In some embodiments, S404 includes:
Generating frame loss information about the first physical port in the case that the second variation value is greater than 0;
Generating frame loss information about the test port corresponding to the second variation value under the condition that the second variation value is smaller than 0;
generating frame loss information about the second physical port in the case that the third variation value is greater than 0;
And generating frame loss information about the test port corresponding to the third variation value under the condition that the third variation value is smaller than 0.
And under the condition that the second variation value is equal to 0, the sizes of the test data streams received by the adjacent test ports and the first physical ports are unchanged, and the test ports positioned at the front ends or the first physical ports in the adjacent test ports or the first physical ports completely forward the received test data streams. And under the condition that the second variation value is larger than 0, the sizes of the test data streams received by the adjacent test ports and the first physical ports are changed, and frame loss information about the first physical ports is generated. And under the condition that the second variation value is smaller than 0, the sizes of the test data streams received by the adjacent test ports and the first physical ports are changed, and frame loss information about the test ports is generated. The setting principle of the third variation value is similar to that of the second variation value, and will not be described in detail here.
In some embodiments, the test method further comprises:
establishing communication connection between the second physical port and the test equipment, and setting the first physical port as a loop-back mode;
Under the condition that the first physical port receives the test data stream sent by the test equipment, the test data stream is sent from the second physical port to the first physical port along a second preset transmission path of the test data stream, the test data stream is reversely sent from the first physical port to the second physical port, and the second transmission path and the first transmission path comprise the same test port;
And acquiring a third data receiving amount of each test port, and transmitting the third data receiving amount to the test equipment.
The second transmission path and the first transmission path comprise the same test port, and the relative sending and receiving relation of each test port in the first transmission path and the second transmission path can be adjusted so as to flexibly test whether the same test port forwards the test data stream to different test ports or not has the frame loss phenomenon.
In S501 and S101, the functions of the first physical port and the second physical port are switched to each other, so that the data transceiving performance between the second physical port and the test device can be tested. And the frame loss information can also be generated according to the third data receiving quantity of the test port positioned at the front end and the third variation value of the third data receiving quantity of the test port positioned at the rear end in the adjacent test ports on the second preset transmission path.
Referring to fig. 5, in some embodiments, the second preset transmission path includes a first test port and a second test port; s502 includes:
according to the second preset transmission path, the second physical port is controlled to forward the test data to the second test port, the second test port is controlled to forward the test data to the first test port, and the first test port is controlled to forward the test data to the first physical port;
And according to the second preset transmission path, controlling the first physical port to send the test data back to the first test port, controlling the first test port to forward the test data to the second test port, and controlling the second test port to forward the test data to the second physical port.
The test data flow sequentially passes through the test equipment, the second physical port, the second test port, the first physical port, the first test port, the second physical port and the test equipment.
In other embodiments, the first predetermined transmission path includes a first test port and a second test port; s102 includes:
According to the first preset transmission path, the first physical port is controlled to forward the test data to the first test port, the first test port is controlled to forward the test data to the second test port, and the second test port is controlled to forward the test data to the second physical port;
According to the first preset transmission path, the second physical port is controlled to send the test data back to the second test port, the second test port is controlled to forward the test data to the first test port, and the first test port is controlled to forward the test data to the first physical port.
The test data flow sequentially passes through the test equipment, the first physical port, the first test port, the second physical port, the second test port, the first physical port and the test equipment.
In a transmission scheme corresponding to a first preset transmission path, a first test port is respectively positioned at a third bit and a seventh bit and receives a test data stream, and a second test port is respectively positioned at a fourth bit and a fifth bit and receives the test data stream; in the transmission scheme corresponding to the first preset transmission path, the second test port is respectively located at the third bit and the seventh bit and receives the test data stream, and the first test port is respectively located at the fourth bit and the fifth bit and receives the test data stream. The size of the test data stream received by each test port and the sending speed of the test data stream are influenced by the data forwarding performance of the port at the front end of the preset transmission path, so that the first test end and the second test end are arranged in the preset transmission path and have different orders, the test data stream conditions received by the first test end and the second test end are enriched, and the test coverage rate is improved.
In a second embodiment of the present application, there is provided a switch, as shown in fig. 6, which may include:
A connection module 61, configured to establish a communication connection between the first physical port and the test device, and set the second physical port to be in a loop-back mode;
A transmission module 62, configured to, in a case where the first physical port receives the test data stream sent by the test device, send the test data stream from the first physical port to the second physical port along a first preset transmission path of the test data stream, and send the test data stream from the second physical port to the first physical port in a reverse direction, where the first preset transmission path includes at least one test port;
and the sending module 63 is configured to obtain a first data receiving amount of the test data stream received by each test port each time, and send the first data receiving amount to the test device.
In an alternative embodiment, the switch may also:
A calculating module 64, configured to calculate a first variation value of a first data reception amount of a test port located at a front end and a first data reception amount of a test port located at a rear end among adjacent test ports on a first preset transmission path;
the generating module 65 is configured to generate frame loss information according to the first variation value.
In an alternative embodiment, the generating module 65 is further configured to generate frame loss information about the test port located at the front end if the first variation value is greater than 0.
In an alternative embodiment, the sending module 63 is further configured to obtain a second data receiving amount of the test data stream received by the first physical port and the second physical port each time;
the calculation module 64 is further configured to calculate a second variation value of the second data reception amount corresponding to the first physical port and the first data reception amount of the test port in the first physical port and the test port adjacent to each other on the first preset transmission path;
the calculation module 64 is further configured to calculate a third variation value of the second data receiving amount corresponding to the second physical port and the first data receiving amount of the test port in the second physical port and the test port adjacent to each other on the first preset transmission path;
the generating module 65 is further configured to generate frame loss information according to the second variation value and the third variation value.
In an alternative embodiment, the generating module 65 is further used for the connecting module 61 for
Generating frame loss information about the first physical port in the case that the second variation value is greater than 0;
Generating frame loss information about the test port corresponding to the second variation value under the condition that the second variation value is smaller than 0;
generating frame loss information about the second physical port in the case that the third variation value is greater than 0;
And generating frame loss information about the test port corresponding to the third variation value under the condition that the third variation value is smaller than 0.
In an alternative embodiment, the connection module 61 is further configured to establish a communication connection between the second physical port and the test device;
The transmission module 62 is further configured to, when the first physical port receives the test data stream sent by the test device, send the test data stream from the second physical port to the first physical port along a second preset transmission path of the test data stream, and send the test data stream from the first physical port to the preset second physical port in a reverse direction, where the second transmission path and the first transmission path include the same test port;
The sending module 63 is further configured to obtain a third data receiving amount of each test port, and send the third data receiving amount to the test device, so that the test device displays the first data receiving amount of each test port.
In an alternative embodiment, the second preset transmission path includes a first test port and a second test port; the transmission module 62 is further configured to control the second physical port to forward the test data to the second test port, control the second test port to forward the test data to the first test port, and control the first test port to forward the test data to the first physical port according to the second preset transmission path;
And according to the second preset transmission path, controlling the first physical port to send the test data back to the first test port, controlling the first test port to forward the test data to the second test port, and controlling the second test port to forward the test data to the second physical port.
In an alternative embodiment, the first preset transmission path includes a first test port and a second test port; the transmission module 62 is further configured to control the first physical port to forward the test data to the first test port, control the first test port to forward the test data to the second test port, and control the second test port to forward the test data to the second physical port according to the first preset transmission path;
According to the first preset transmission path, the second physical port is controlled to send the test data back to the second test port, the second test port is controlled to forward the test data to the first test port, and the first test port is controlled to forward the test data to the first physical port.
In a third aspect the present application provides a switch comprising a processor, a memory and a program or instruction stored on the memory and executable on the processor, the program or instruction when executed by the processor and/or electronic controller implementing the steps of the switch testing method as provided in the first aspect. The exchanger achieves the same technical effects and is not described here in detail to avoid repetition.
In a fourth aspect of the present application, there is provided a storage medium having stored thereon a computer program which when executed by a processor performs the steps of the switch test method provided in the first aspect. The storage medium achieves the same technical effects and is not described here in detail to avoid repetition.
In a fifth aspect of the application there is also provided a vehicle comprising a switch as provided in the second aspect or a switch as provided in the third aspect. The vehicle achieves the same technical effects and is not described here in detail to avoid repetition.
It is to be understood that the above-described embodiments of the present application are merely illustrative of or explanation of the principles of the present application and are in no way limiting of the application. Accordingly, any modification, equivalent replacement, improvement, etc. made without departing from the spirit and scope of the present application should be included in the scope of the present application. Furthermore, the appended claims are intended to cover all such changes and modifications that fall within the scope and boundary of the appended claims, or equivalents of such scope and boundary.
It should also be noted that the exemplary embodiments mentioned in this disclosure describe some methods or systems based on a series of steps or devices. The present application is not limited to the order of the above-described steps, that is, the steps may be performed in the order mentioned in the embodiments, or may be performed in a different order from the order in the embodiments, or several steps may be performed simultaneously.
Aspects of the present disclosure are described above with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. 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 may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions/acts specified in the flowchart and/or block diagram block or blocks. Such a processor may be, but is not limited to being, a general purpose processor, a special purpose processor, an application specific processor, or a field programmable logic circuit. It will also be understood that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware which performs the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In the foregoing, only the specific embodiments of the present application are described, and it will be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the systems, modules and units described above may refer to the corresponding processes in the foregoing method embodiments, which are not repeated herein. It should be understood that the scope of the present application is not limited thereto, and any equivalent modifications or substitutions can be easily made by those skilled in the art within the technical scope of the present application, and they should be included in the scope of the present application.

Claims (10)

1. A method of testing a switch, the method comprising:
Establishing a communication connection between a first physical port and a test device;
Under the condition that the first physical port receives a test data stream sent by test equipment, the test data stream is sent from the first physical port to a preset second physical port along a first preset transmission path of the test data stream, and the test data stream is reversely sent from the second physical port to the first physical port, wherein the first preset transmission path comprises at least one test port;
And acquiring a first data receiving amount of the test data stream received by each test port, and sending the first data receiving amount to the test equipment so that the test equipment displays the first data receiving amount of each test port.
2. The switch testing method of claim 1, wherein after the obtaining the first data receiving amount of each of the test ports, further comprising:
Calculating a first variation value of the first data receiving quantity of the test port positioned at the front end and the first data receiving quantity of the test port positioned at the rear end in the adjacent test ports on the first preset transmission path;
And generating frame loss information according to the first change value.
3. The switch testing method of claim 2, wherein the generating the frame loss information according to the first variation value comprises:
and generating the frame loss information about the test port at the front end in the case that the first variation value is greater than 0.
4. The switch testing method of claim 3, wherein after said obtaining the first data reception amount of each of said test ports, further comprising:
Acquiring second data receiving amounts of the test data streams received by the first physical port and the second physical port each time;
calculating a second variation value of the second data receiving quantity corresponding to the first physical port and the first data receiving quantity of the test port in the adjacent first physical port and the test port on the first preset transmission path;
Calculating a third variation value of the second data receiving amount corresponding to the second physical port and the first data receiving amount of the test port in the second physical port and the test port adjacent to each other on the first preset transmission path;
and generating the frame loss information according to the second change value and the third change value.
5. The switch testing method of claim 4, wherein the generating the frame loss information according to the second variation value comprises:
generating the frame loss information about the first physical port in the case where the second variation value is greater than 0;
Generating the frame loss information about the test port corresponding to the second variation value under the condition that the second variation value is smaller than 0;
generating the frame loss information about the second physical port in a case where the third variation value is greater than 0;
and generating the frame loss information of the test port corresponding to the third variation value under the condition that the third variation value is smaller than 0.
6. The switch testing method of claim 1, wherein the first preset transmission path comprises a first test port and a second test port; the transmitting the test data stream from the first physical port to a second physical port along a first preset transmission path of the test data stream, and reversely transmitting the test data stream from the second physical port to the first physical port includes:
According to the first preset transmission path, the first physical port is controlled to forward the test data to the first test port, the first test port is controlled to forward the test data to the second test port, and the second test port is controlled to forward the test data to the second physical port;
And according to the first preset transmission path, controlling the second physical port to send the test data back to the second test port, controlling the second test port to forward the test data to the first test port, and controlling the first test port to forward the test data to the first physical port.
7. A switch, comprising:
The connection module is used for establishing communication connection between the first physical port and the test equipment;
A transmission module, configured to, when the first physical port receives a test data stream sent by a test device, send the test data stream from the first physical port to a preset second physical port along a first preset transmission path of the test data stream, and send the test data stream from the second physical port to the first physical port in a reverse direction, where the first preset transmission path includes at least one test port;
And the sending module is used for obtaining the first data receiving quantity of the test data stream received by each test port each time and sending the first data receiving quantity to the test equipment so that the test equipment displays the first data receiving quantity of each test port.
8. A switch comprising a processor, a memory and a program or instruction stored on the memory and executable on the processor, which when executed by the processor implements the steps of the switch testing method of any of claims 1-6.
9. A readable storage medium, characterized in that it has stored thereon a program or instructions which, when executed by a processor, implement the steps of the switch testing method according to any of claims 1-6.
10. A vehicle, characterized by comprising:
The switch of claim 7, or the switch of claim 8.
CN202211448215.0A 2022-11-18 2022-11-18 Switch testing method, switch, readable storage medium, and vehicle Pending CN118057781A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211448215.0A CN118057781A (en) 2022-11-18 2022-11-18 Switch testing method, switch, readable storage medium, and vehicle

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211448215.0A CN118057781A (en) 2022-11-18 2022-11-18 Switch testing method, switch, readable storage medium, and vehicle

Publications (1)

Publication Number Publication Date
CN118057781A true CN118057781A (en) 2024-05-21

Family

ID=91068870

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211448215.0A Pending CN118057781A (en) 2022-11-18 2022-11-18 Switch testing method, switch, readable storage medium, and vehicle

Country Status (1)

Country Link
CN (1) CN118057781A (en)

Similar Documents

Publication Publication Date Title
CN101404599B (en) Network fault detection method, primary device, slave device, control terminal and system
EP2903213B1 (en) Throughput test method and apparatus
US7843836B2 (en) Systems, methods and computer program products for controlling high speed network traffic in server blade environments
JP2557176B2 (en) Network connection and topology map generator
CN102984035A (en) Loopback test method and system of packet loss probability of network data
CN106685693A (en) Network anomaly detection method, system and network device
CN111385163A (en) Flow analysis and detection method and device
CN110417687B (en) Message sending and receiving method and device
CN109660436B (en) Dual-CAN channel data processing method, gateway equipment and system
CN115426284A (en) Network quality detection method, device, terminal equipment and storage medium
CN109617763B (en) Pressure testing method and device for FC-AE bus
CN112015163B (en) Method and device for quickly identifying diagnostic subject on CAN bus
CN110855566B (en) Method and device for dragging upstream flow
CN109831335B (en) Data monitoring method, monitoring terminal, storage medium and data monitoring system
CN113810238A (en) Network monitoring method, electronic device and storage medium
CN118057781A (en) Switch testing method, switch, readable storage medium, and vehicle
CN111181810A (en) Performance test method and system for MoCA equipment
CN115129021B (en) Method and device for testing vehicle-mounted Ethernet
CN112637055B (en) Multi-link aggregation method, system and storage medium based on VPN tunnel
US5778172A (en) Enhanced real-time topology analysis system or high speed networks
CN115396529A (en) Multichannel communication method, device, terminal equipment and storage medium
CN113009246B (en) PSE device detection device and PSE device detection method
CN109981394B (en) Communication method and device based on enhanced CAN bus protocol analyzer
CN102291266A (en) Loopback (LB) detection method and device
CN115242693A (en) Network detection method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
SE01 Entry into force of request for substantive examination