Test method based on data switch, data switch and storage medium

By receiving configuration instructions from the host computer in the data switch and configuring the port and speed of the data switch, the problem of port configuration difficulty and rate mismatch between devices is solved, and flexible testing and monitoring is achieved.

CN118972248APending Publication Date: 2024-11-15FULIAN PRESION ELECTRONICS (TIANJIN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310547052.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-05-15
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

In existing test solutions, port configuration changes are difficult and the rate mismatch between devices makes it impossible to perform testing.

Method used

Provide a test method based on data switch, by receiving data flow parameters and rate parameters in configuration instructions sent by the upper computer, configuring the data switch, realizing the port's transceiver function and rate determination, and realizing the conversion of the rate between devices and Flexible testing.

Benefits of technology

The port configuration process is simplified, the configuration simplicity and flexibility are improved, data transmission and monitoring between devices at different speeds are realized, and the problem of rate mismatch between devices is solved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118972248A_ABST
    Figure CN118972248A_ABST
Patent Text Reader

Abstract

The invention relates to the field of testing, and provides a testing method based on a data switch, the data switch and a storage medium. The method comprises the steps that a configuration instruction sent by the upper computer is received, and the configuration instruction comprises a data flow direction parameter and a rate parameter; configuring the data switch according to the data flow direction parameter and the rate parameter; and testing based on the configured data switch. By means of the method, conversion of the data transmission rate between the devices can be achieved, and simplicity and flexibility of port configuration can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of testing technology, and in particular to a testing method based on a data switch, a data switch and a storage medium. Background Art

[0002] In the current test solution, in the face of different test requirements, it is usually necessary to repeatedly design programs to change port configurations, but the technical threshold of program design makes it difficult to change port configurations. In addition, if the speeds between devices do not match, the devices will not be able to communicate, resulting in the inability to perform tests. Summary of the invention

[0003] In view of the above, it is necessary to provide a test method based on a data switch, a data switch and a storage medium, which solve the technical problems of difficult port configuration and inability to perform testing due to rate mismatch between devices.

[0004] On the one hand, the present application provides a testing method based on a data switch, wherein the data switch communicates with a host computer, and the method comprises: receiving a configuration instruction sent from the host computer, wherein the configuration instruction comprises a data flow direction parameter and a rate parameter, configuring the data switch according to the data flow direction parameter and the rate parameter, and performing a test based on the configured data switch.

[0005] Through the above implementation, the data switch can receive the configuration instruction of the host computer, and the configuration instruction includes a data flow parameter and a rate parameter. The data flow parameter can configure the receiving / transmitting function of the port in the data switch, so that the port for receiving data and the port for sending data can be determined. The rate parameter can configure the rate of each port in the data switch, so that the rate conversion between devices can be realized, so that the configured switch can realize data transmission between devices corresponding to different rates, and the configured data switch can be flexibly tested. In addition, since the user directly sends the configuration instruction to the data switch through the host computer according to the actual test needs, the configuration of the port in the data switch can be completed, and there is no need to repeatedly design the program to configure the port. Moreover, the data flow parameter and the rate parameter can be flexibly set, so the simplicity and flexibility of the port configuration can be improved.

[0006] In some embodiments, configuring the data switch according to the data flow direction parameters and the rate parameters includes: configuring the receiving / transmitting function of the port in the data switch according to the data flow direction parameters, determining the initial receiving port and the initial sending port, configuring the rates of the initial receiving port and the initial sending port according to the rate parameters, and completing the configuration of the data switch.

[0007] In some embodiments, the testing based on the configured data switch includes: connecting multiple communication devices through the configured data switch, and if the rates between the multiple communication devices connected to each other are different, converting the rates between the multiple communication devices connected to each other through the configured data switch.

[0008] In some embodiments, if the plurality of interconnected communication devices include a first communication device and a plurality of second communication devices, the rate conversion between the plurality of interconnected communication devices through the configured data switch includes: determining a first target receiving port corresponding to the first communication device from the initial receiving port according to the first rate of the first communication device, and / or determining a first target sending port corresponding to the first communication device from the initial sending port according to the first rate, determining a second target receiving port corresponding to each second communication device from the initial receiving port according to the second rate of each second communication device, and / or determining a second target sending port corresponding to each second communication device from the initial sending port according to the second rate of each second communication device, and converting the rate between the first communication device and the plurality of second communication devices according to the first target receiving port and the plurality of second target sending ports or the first target sending port and the plurality of second target receiving ports.

[0009] In some embodiments, the rate conversion between the first communication device and the multiple second communication devices according to the first target receiving port and the multiple second target sending ports includes: receiving test data sent from the first communication device according to the first target receiving port, and storing the received test data in a buffer of the configured data switch, and when the first target receiving port is in an idle state, distributing the test data from the buffer to each second communication device through each second target sending port, so that each second communication device is tested according to the received test data.

[0010] In some embodiments, converting the rates between the first communication device and the multiple second communication devices according to the first target sending port and the multiple second target receiving ports also includes: receiving, according to each second target receiving port, the test results returned by each second communication device in response to the test data sent by the first communication device, and sending all received test results to the first communication device according to the first target sending port.

[0011] In some embodiments, the testing based on the configured data switch further comprises: monitoring data transmission of the plurality of interconnected communication devices through the configured data switch.

[0012] In some embodiments, the monitoring of the multiple interconnected communication devices through the configured data switch includes: determining the monitoring port corresponding to the host computer from the initial sending port, transmitting data between the multiple communication devices according to other ports in the initial sending port except the monitoring port and the initial receiving port, and sending the transmission data between the multiple interconnected communication devices to the host computer according to the monitoring port, so that the host computer monitors the multiple communication devices according to the received transmission data.

[0013] On the other hand, the present application provides a data switch, which includes: a storage device storing at least one instruction; and a processing device acquiring the instruction stored in the storage device to implement a test method based on the data switch.

[0014] On the other hand, the present application provides a computer-readable storage medium, wherein at least one instruction is stored in the computer-readable storage medium, and the at least one instruction is executed by a processor in a data switch to implement the data switch-based testing method. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 It is a structural diagram of a data switch provided in one embodiment of the present application.

[0016] Figure 2 It is a flow chart of a data switch-based testing method provided in one embodiment of the present application.

[0017] Figure 3 It is a schematic diagram of the connection between a configured data switch and multiple communication devices provided in an embodiment of the present application.

[0018] Figure 4 This is a flowchart of a method for converting rates between multiple communication devices provided in one embodiment of the present application.

[0019] Figure 5 It is a schematic diagram of converting the rates between multiple communication devices through a configured data switch provided by an embodiment of the present application.

[0020] Figure 6 It is a flow chart of a method for monitoring through a configured data switch provided by an embodiment of the present application.

[0021] Figure 7 It is a schematic diagram of monitoring multiple communication devices through a configured data switch provided by an embodiment of the present application. DETAILED DESCRIPTION

[0022] It should be noted that in this application, "at least one" means one or more, and "more" means two or more than two. "And / or" describes the association relationship of the associated objects, indicating that three types of relationships may exist.

[0023] For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The terms "first", "second", "third", "fourth", etc. (if any) in the specification, claims and drawings of this application are used to distinguish similar objects, rather than to describe a specific order or sequence.

[0024] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete way. The following embodiments and features in the embodiments may be combined with each other without conflict.

[0025] In some tests, the host computer needs to collect serial port data from the test equipment, but the serial port rate on the test equipment is usually very low and does not match the rate of the host computer. For example, the serial port rate in some old test equipment is only 120kbps, while the rate of the host computer can be as high as 460kbps. Therefore, the rate mismatch problem will cause the host computer and the test equipment to be unable to communicate, resulting in the inability to perform the test. In addition, in some other test scenarios, the device needs to be monitored, but it is currently difficult to collect the transmission data of the device to achieve device monitoring.

[0026] In order to solve the above problems, the embodiments of the present application provide a data switch-based test method, a data switch and a storage medium. The data switch-based test method provided in the embodiments of the present application can be applied to one or more data switches, and is described below in conjunction with the application scenarios provided in the embodiments of the present application.

[0027] like Figure 1 , which is a structural diagram of a data switch provided by an embodiment of the present application. Figure 1 In the embodiment, the data switch 1 includes, but is not limited to, a memory 12, a processor 13, and a computer program stored in the memory 12 and executable on the processor 13, such as a test program based on the data switch.

[0028] The data switch 1 is a device that can automatically calculate parameter values ​​and / or process information according to pre-set or stored instructions. Its hardware includes, but is not limited to: a microprocessor, an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), a digital signal processor (DSP), an embedded device, etc.

[0029] The data switch 1 may be a single-chip microcomputer (Microcontrollers), for example, the data switch may be an STM32 single-chip microcomputer, a PIC single-chip microcomputer, an 8051 single-chip microcomputer or an AVR single-chip microcomputer, etc. The present application does not limit the data switch 1 .

[0030] The network where the data switch 1 is located includes but is not limited to: the Internet, a wide area network, a metropolitan area network, a local area network, a virtual private network (Virtual Private Network, VPN), etc.

[0031] like Figure 2 FIG. 1 is a flow chart of a test method based on a data switch provided by an embodiment of the present application. According to different requirements, the order of each step in the flow chart can be adjusted according to actual requirements, and some steps can be omitted. The execution subject of the method is a data switch, for example Figure 1 The data switch 1 is shown.

[0032] S11, receiving a configuration instruction sent from the host computer, wherein the configuration instruction includes a data flow direction parameter and a rate parameter.

[0033] In some embodiments, the data switch communicates with the host computer, for example, the data switch can communicate with the host computer via Bluetooth, hotspot, Wi-Fi, etc. The host computer includes, but is not limited to: any device that can generate and send control commands, such as a personal computer, a tablet computer or a smart phone, and this application does not limit the host computer.

[0034] In some embodiments, the configuration instructions can be input by the user on the host computer according to actual needs, and then the data switch can accept the configuration instructions sent from the host computer. The data flow direction parameter is used to configure the receiving / transmitting function (data flow direction) of the port in the data switch, and the rate parameter is used to configure the number of code element symbols transmitted per unit time of the port in the data switch (signal transmission rate). The port can be an asynchronous serial communication port (UART port), or the port can also be other ports, which is not limited in this application.

[0035] In this embodiment, the configuration instruction may include more configuration parameters of the port.

[0036] S12: Configure the data switch according to the data flow direction parameter and the rate parameter.

[0037] In some embodiments, the data switch configures the data switch according to the data flow direction parameter and the rate parameter, including: the data switch configures the receiving / transmitting function of the port in the data switch according to the data flow direction parameter, determines the initial receiving port and the initial sending port, and the data switch configures the rate of the initial receiving port and the initial sending port according to the rate parameter to complete the configuration of the data switch.

[0038] Among them, the port can be a UART port, and according to actual configuration requirements, the initial receiving port and the initial sending port can be multiple.

[0039] In this embodiment, since the data switch can be directly configured according to the received configuration instruction without repeatedly designing the single-chip computer program, the port configuration convenience can be improved. In addition, since the parameters in the configuration instruction can be flexibly set according to actual test needs, the port configuration flexibility can be improved.

[0040] S13, performing a test based on the configured data switch.

[0041] In some embodiments, multiple communication devices are connected through the configured data switch. If the rates between the multiple communication devices connected to each other are different, the rates between the multiple communication devices connected to each other can be converted through the configured data switch, or the multiple communication devices connected to each other can be monitored through the configured data switch.

[0042] The multiple communication devices include, but are not limited to: computers, mobile phones, FPGAs or programming chips and other devices, and this application does not limit the multiple communication devices. When there is no need to convert the rates between the multiple communication devices, the configured data switch can realize data transmission between the multiple interconnected communication devices according to the initial sending port and the initial receiving port. The configured data switch can use other initial sending ports other than those used for data transmission as monitoring ports, and monitor the multiple interconnected communication devices through the monitoring port.

[0043] like Figure 3 FIG. 1 is a schematic diagram of a connection between a configured data switch and multiple communication devices provided by an embodiment of the present application. Figure 3 In the embodiment, the plurality of communication devices include a first communication device 2 and a plurality of second communication devices 3, and the first communication device 2 is connected to the plurality of second communication devices 3 via a configured data switch 1.

[0044] In this embodiment, the configured data switch can not only realize data transfer and rate conversion between the multiple communication devices, but also monitor the multiple communication devices.

[0045] Before testing based on the configured data switch, the method also includes: the configured data switch sets the priority of internally received data to the highest, so that the configured data switch can first receive the data and then send the data, thereby avoiding data reception errors (for example, incomplete data reception) caused by receiving and sending data at the same time. Problems such as.

[0046] In some other embodiments of the present application, the configured data switch can also implement more testing functions.

[0047] Through the above implementation, the data switch can receive the configuration instruction of the host computer, and the configuration instruction includes a data flow parameter and a rate parameter. The data flow parameter can configure the receiving / transmitting function of the port in the data switch, so that the port for receiving data and the port for sending data can be determined. The rate parameter can configure the rate of each port in the data switch, so that the rate conversion between devices can be realized, so that the configured switch can realize data transmission between devices corresponding to different rates, and the configured data switch can be flexibly tested. In addition, since the user directly sends the configuration instruction to the data switch through the host computer according to the actual test needs, the configuration of the port in the data switch can be completed, and there is no need to repeatedly design the program to configure the port. Moreover, the data flow parameter and the rate parameter can be flexibly set, so the simplicity and flexibility of the port configuration can be improved.

[0048] In some embodiments, if the rates of the plurality of interconnected communication devices are different and the plurality of interconnected communication devices include a first communication device and a plurality of second communication devices, such as Figure 4 FIG. 1 is a flow chart of a method for converting the rates between multiple communication devices provided in an embodiment of the present application. Specifically, the method includes the following steps:

[0049] S131, the configured data switch determines a first target receiving port corresponding to the first communication device from the initial receiving port according to the first rate of the first communication device, and / or the configured data switch determines a first target sending port corresponding to the first communication device from the initial sending port according to the first rate.

[0050] In some embodiments, the configured data switch determines the initial receiving port corresponding to the rate same as the first rate in the configured data switch as the first target receiving port, and / or, the configured data switch determines the initial sending port corresponding to the rate same as the first rate in the configured data switch as the first target sending port. The first communication device may be a host computer such as a computer and a mobile phone that can generate and send control commands, and the first rate may be the signal transmission rate of a port in the first communication device. The ports in the first communication device include, but are not limited to: a serial port, a UART port, a COM port, and a USB port.

[0051] In this embodiment, the rates of the first target receiving port and the first target sending port are the same as the first rate of the first communication device, and data sent from the first communication device can be received at the first rate through the first target receiving port, and data can be sent to the first communication device at the first rate through the first target sending port.

[0052] S132, the configured data switch determines a second target receiving port corresponding to each second communication device from the initial receiving port according to the second rate of each second communication device, and / or the configured data switch determines a second target sending port corresponding to each second communication device from the initial sending port according to the second rate of each second communication device.

[0053] In some embodiments, the configured data switch determines the initial receiving port corresponding to the rate same as the second rate in the configured data switch as the second target receiving port, and / or, the configured data switch determines the initial sending port corresponding to the rate same as each second rate in the configured data switch as the second target sending port. Wherein, the multiple second communication devices can be lower computers such as FPGA, ARM and PLC for receiving and feeding back instructions from the upper computer, and each second rate can be the signal transmission rate of the port in each second communication device. The ports in each second communication device include, but are not limited to: serial port, UART port, COM port and USB port.

[0054] In this embodiment, the rate of each of the second target receiving ports and each of the second target sending ports is the same as the second rate of the corresponding second communication device, and data sent from the corresponding second communication device can be received at the corresponding second rate through any of the second target receiving ports, and data can be sent to the corresponding second communication device at the corresponding second rate through any of the second target sending ports.

[0055] S133: The configured data switch converts the rates between the first communication device and the multiple second communication devices according to the first target receiving port and the multiple second target sending ports or the first target sending port and the multiple second target receiving ports.

[0056] In some embodiments, the configured data switch converts the rate between the first communication device and the multiple second communication devices according to the first target receiving port and the multiple second target sending ports, including: the configured data switch receives test data sent from the first communication device according to the first target receiving port, and stores the received test data in a buffer of the configured data switch; when the first target receiving port is in an idle state, the configured data switch distributes the test data from the buffer to each second communication device through each second target sending port, so that each second communication device is tested according to the received test data.

[0057] The test data is used to test the multiple second communication devices, and the test data may include data such as test cases or test programs, and the present application does not limit the test data.

[0058] For example, Figure 5 FIG. 1 is a schematic diagram of converting the rates between multiple communication devices through a configured data switch provided by an embodiment of the present application. Figure 5 In the embodiment, the plurality of communication devices include a first communication device 2 and a plurality of second communication devices 3, and the configured data switch 1 connects the first communication device 2 and the plurality of second communication devices 3. If the first rate of the port of the first communication device 2 is greater than the second rate of the port of each second communication device 3, the port on the first communication device 2 is determined as a high-speed data port, and the port on each second communication device 3 is determined as a low-speed data port. The configured data switch 1 can receive the test data sent from the high-speed data port on the first communication device 2 at the first rate through the first target receiving port, and store the received test data in a buffer until the reception is completed, and then send the test data from the buffer to the low-speed data port of each second communication device 3 at the second rate through each second target sending port, thereby realizing the rate conversion between the plurality of communication devices.

[0059] In this embodiment, since the priority of receiving data inside the configured data switch is set to the highest, when the first target receiving port is in an idle state, the configured data switch will distribute the test data from the buffer to each second communication device through each second target sending port, thereby avoiding the problem of data reception errors caused by receiving and sending data at the same time. In addition, the test data can be sent to the multiple second communication devices at the same time through the multiple second target sending ports, thereby realizing the diversion of test data (one test data is distributed to multiple second communication devices at the same time). The configured data switch simultaneously plays the role of data transfer and rate conversion.

[0060] Continuing from the above embodiment, the configured data switch converts the rate between the first communication device and the multiple second communication devices according to the first target sending port and the multiple second target receiving ports, and also includes: the configured data switch receives the test results returned by each second communication device for the test data sent by the first communication device according to each second target receiving port, and sends all received test results to the first communication device according to the first target sending port.

[0061] In this embodiment, the test results returned by multiple second communication devices can be collected simultaneously through the multiple second target receiving ports. After the multiple test results are received, the multiple test results are sent to the first communication device through the first target sending port, thereby realizing the collection of test results.

[0062] In some other embodiments of the present application, the data received and / or sent by the configured data switch is not limited to the test data and the test results. The above test data and test results are only examples, and actual usage is not limited thereto.

[0063] In some embodiments of the present application, the detailed steps of monitoring the interconnected multiple communication devices through the configured data switch can be referred to as follows Figure 6 The process shown is described.

[0064] like Figure 6 FIG. 1 is a flow chart of a method for monitoring through a configured data switch provided by an embodiment of the present application. Specifically, the method includes the following steps:

[0065] S134, the configured data switch determines a monitoring port corresponding to the host computer from the initial sending port.

[0066] In some embodiments, the monitoring port is determined in a manner substantially the same as the first target sending port or the second target sending port described above, and thus the present application will not repeat the description here.

[0067] S135, the configured data switch performs data transmission between the multiple communication devices according to the other ports of the initial sending port except the monitoring port and the initial receiving port.

[0068] In some embodiments, the configured data switch sends data through other ports of the initial sending port except the monitoring port, and receives data through the initial receiving port, thereby realizing data transmission between the multiple communication devices.

[0069] In some other embodiments, if the rates between the multiple communication devices are different, the configured data switch also performs a rate conversion function. The specific rate conversion steps can refer to steps S131-S133 above, and this application will not repeat the description here.

[0070] In this embodiment, the configured data switch can simultaneously perform the functions of data transfer and rate conversion.

[0071] S136, the configured data switch sends the transmission data between the multiple interconnected communication devices to the host computer according to the monitoring port, so that the host computer monitors the multiple communication devices according to the received transmission data.

[0072] For example, Figure 7 FIG. 1 is a schematic diagram of monitoring multiple communication devices through a configured data switch provided by an embodiment of the present application. Figure 7 In the embodiment, the plurality of communication devices include a first communication device 2 and a plurality of second communication devices 3, the configured data switch 1 is connected to the first communication device 2 and the plurality of second communication devices 3, the configured data switch 1 is connected to a host computer 4 via a monitoring port, the configured data switch 1 receives the first data sent from the first communication device 2, and distributes the first data to each second communication device 3, the configured data switch 1 receives the second data sent from each second communication device 3, and sends a plurality of second data to the first communication device 2, and the configured data switch 1 also sends the first data and each second data to the host computer 4 via the monitoring port. The first data may be the test data in the above embodiment, and the second data may be the test result in the above embodiment.

[0073] In this embodiment, the host computer can analyze the transmission data, thereby monitoring the communication process of the multiple communication devices, so as to handle abnormalities in the multiple communication devices in a timely manner.

[0074] In one embodiment, following the above description, Figure 1 In the description of the data switch in FIG, the processor 13 can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc. The processor 13 is the computing core and control center of the data switch 1, and uses various interfaces and lines to connect various parts of the entire data switch 1, and obtain the operating system of the data switch 1 and various installed applications, program codes, etc.

[0075] The processor 13 obtains the operating system of the data switch 1 and various installed applications. The processor 13 obtains the application to implement the steps in the above-mentioned various data switch-based test method embodiments, for example Figure 2 , Figure 4 as well as Figure 6 Steps shown.

[0076] Exemplarily, the computer program may be divided into one or more modules / units, such as an acceleration unit, and one or more modules / units are stored in the memory 12 and acquired by the processor 13 to complete the present application. One or more modules / units may be a series of computer program instruction segments capable of completing a specific function, and the instruction segments are used to describe the acquisition process of the computer program in the data switch 1.

[0077] The memory 12 can be used to store computer programs and / or modules. The processor 13 implements various functions of the data switch 1 by running or acquiring computer programs and / or modules stored in the memory 12, and calling data stored in the memory 12. The memory 12 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the server, etc. In addition, the memory 12 can include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (SmartMediaCard, SMC), a secure digital (SecureDigital, SD) card, a flash card (FlashCard), at least one disk storage device, a flash memory device, or other non-volatile solid-state storage devices.

[0078] The memory 12 may be an external memory and / or an internal memory of the data switch 1. Furthermore, the memory 12 may be a memory in a physical form, such as a memory stick and the like.

[0079] If the module / unit integrated in the data switch 1 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also instruct the relevant hardware to complete it through a computer program. The computer program can be stored in a computer-readable storage medium, and when the computer program is obtained by the processor, it can implement the steps of each of the above-mentioned method embodiments.

[0080] The computer program includes computer program code, which may be in source code form, object code form, accessible file or some intermediate form, etc. Computer readable media may include: any entity or device capable of carrying computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM).

[0081] Combination Figure 2 The memory 12 in the data switch 1 stores multiple instructions to implement a test method based on the data switch, and the processor 13 can obtain multiple instructions to achieve: receiving configuration instructions sent from the host computer, wherein the configuration instructions include data flow parameters and rate parameters; configuring the data switch according to the data flow parameters and the rate parameters; and testing the configured data switch.

[0082] Specifically, the specific implementation method of the processor 13 for the above instructions can refer to Figure 2The description of the relevant steps in the corresponding embodiments will not be repeated here.

[0083] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules is only a logical function division, and there may be other division methods in actual implementation.

[0084] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0085] In addition, each functional module in each embodiment of the present application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional modules.

[0086] Therefore, no matter from which point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present application is limited by the appended claims rather than the above description, so it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present application. Any attached figure mark in the claims should not be regarded as limiting the claims involved.

[0087] In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in this application can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.

[0088] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present application and are not intended to limit it. Although the present application has been described in detail with reference to the preferred embodiments, a person of ordinary skill in the art should understand that the technical solution of the present application may be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present application.

Claims

1. A test method based on a data switch, It is characterized in that The data switch communicates with the host computer, and the method includes: Receiving a configuration instruction sent from the host computer, wherein the configuration instruction includes a data flow direction parameter and a rate parameter; Configuring the data switch according to the data flow direction parameter and the rate parameter; The data switch after the configuration is tested.

2. The data switch-based testing method according to claim 1, It is characterized in that The configuring the data switch according to the data flow direction parameter and the rate parameter includes: According to the data flow direction parameters, configure the receiving / transmitting function of the port in the data switch, and determine the initial receiving port and the initial sending port; According to the rate parameter, the rates of the initial receiving port and the initial sending port are configured to complete the configuration of the data switch.

3. The data switch-based testing method according to claim 2, It is characterized in that The testing based on the configured data switch includes: Connecting multiple communication devices through the configured data switch; If the rates of the multiple communication devices connected to each other are different, the rates of the multiple communication devices connected to each other are converted by the configured data switch.

4. The data switch-based testing method according to claim 3, It is characterized in that If the plurality of interconnected communication devices include a first communication device and a plurality of second communication devices, the converting the rates between the plurality of interconnected communication devices through the configured data switch includes: Determine a first target receiving port corresponding to the first communication device from the initial receiving port according to a first rate of the first communication device, and / or determine a first target sending port corresponding to the first communication device from the initial sending port according to the first rate; Determine a second target receiving port corresponding to each second communication device from the initial receiving port according to the second rate of each second communication device, and / or determine a second target sending port corresponding to each second communication device from the initial sending port according to the second rate of each second communication device; The rates between the first communication device and the plurality of second communication devices are converted according to the first target receiving port and the plurality of second target sending ports or the first target sending port and the plurality of second target receiving ports.

5. The data switch-based testing method according to claim 4, It is characterized in that The converting of the rates between the first communication device and the plurality of second communication devices according to the first target receiving port and the plurality of second target sending ports comprises: receiving test data sent from the first communication device according to the first target receiving port, and storing the received test data in a buffer of the configured data switch; When the first target receiving port is in an idle state, the test data is distributed from the buffer to each second communication device through each second target sending port, so that each second communication device performs a test according to the received test data.

6. The data switch-based testing method according to claim 4, It is characterized in that The converting the rates between the first communication device and the plurality of second communication devices according to the first target sending port and the plurality of second target receiving ports further comprises: The test result returned by each second communication device in response to the test data sent by the first communication device is received according to each second target receiving port, and all the received test results are sent to the first communication device according to the first target sending port.

7. The data switch-based testing method according to claim 3, It is characterized in that The testing based on the configured data switch further includes: The data transmission of the plurality of interconnected communication devices is monitored through the configured data switch.

8. The data switch-based testing method according to claim 7, It is characterized in that The monitoring of the plurality of interconnected communication devices through the configured data switch comprises: Determine a monitoring port corresponding to the host computer from the initial sending port; Perform data transmission between the plurality of communication devices according to other ports of the initial sending port except the monitoring port and the initial receiving port; The transmission data between the multiple communication devices connected to each other are sent to the host computer according to the monitoring port, so that the host computer monitors the multiple communication devices according to the received transmission data.

9. A data switch, It is characterized in that The data switch communicates with the host computer to change the configuration in real time A memory storing at least one instruction; and a processor acquiring the instruction stored in the memory to implement the data switch-based testing method as claimed in any one of claims 1 to 8.

10. A computer-readable storage medium, Features: The computer-readable storage medium stores at least one instruction, and the at least one instruction is acquired by a processor in the data switch to implement the data switch-based testing method according to any one of claims 1 to 8.