Switch testing method, device, communication equipment and storage medium

Through the automated test method of remote control module and switch, the first conversion fixture is used to control the connection and disconnection of the optical module and the switch port, which solves the problem of insufficient number of optical modules, improves the test efficiency and reduces the waste of resources, and realizes the switch Efficient testing of optical modules.

CN116094585BActive Publication Date: 2024-10-22INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310073106.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-29
Publication Date
2024-10-22
Estimated Expiration
2043-01-29

AI Technical Summary

Technical Problem

The efficiency of development and testing of switch optical modules is low. The number of optical modules is insufficient and requires manual insertion and removal verification, resulting in low development and testing efficiency and waste of resources.

Method used

Through the remote control module and switch communication, the first conversion fixture is used to automatically control the connection and disconnection of the optical module and the switch port, thereby realizing automated testing and fault simulation, and reducing the usage of optical modules.

Benefits of technology

It improves the test efficiency of switch optical modules, reduces labor and resource costs, realizes automated simulation of multiple fault scenarios, and reduces optical module losses.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116094585B_ABST
    Figure CN116094585B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a switch testing method, device, communication equipment and storage medium, which are applied to the switch, the switch is connected to the remote control module, and the switch full ports and at least one optical module are plugged in through the two ends of the first conversion fixture. The method includes: in response to the switch power-on startup, sending a test instruction to the remote control module, controlling the optical module to be connected to the current test port link of the switch through the remote control module, testing the current test port, receiving the current test port test completion signal, controlling the optical module to be disconnected from the current test port link through the remote control module, sending a test instruction to the remote control module, controlling the optical module to be connected to the next test port link of the switch, and testing the next test port. The present invention can automatically realize the remote control of the plugging and unplugging of the optical module, simulate the plugging and unplugging of the faulty optical module, etc., simulate a variety of fault scenarios, reduce the loss of the optical module, and efficiently complete the switch test.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of switches, and in particular to a switch testing method, device, communication equipment and storage medium. Background Art

[0002] During the development and testing of switches, various functional tests and performance tests are performed on the switches to ensure reliable and stable quality. Among them, there are often dozens of optical module test ports involved, and full optical modules need to be inserted for testing to achieve full testing. Optical modules are one of the core components of optical communications. They are widely used in switches, network security equipment and other equipment. They are mainly composed of optoelectronic devices, functional circuits and optical interfaces. Their main function is to realize the photoelectric conversion and electro-optical conversion functions in optical fiber communications.

[0003] The switch has many different types of interfaces, and the reliability of the module needs to be confirmed through functional and signal tests. At present, the commonly used R&D test method can only go to the laboratory environment to perform related operations of full insertion and removal of optical modules in order to ensure full testing. For different types of optical module tests, different optical modules need to be inserted for testing respectively, and relevant debugging is performed according to the test results; to ensure abnormal injection, when inserting a faulty optical module, only a fixed faulty module can be artificially created for use, and relevant debugging is performed according to the test results.

[0004] However, when testing the switch optical module, R&D testers need to fully insert the optical module to test the function of each port, but they often encounter a small number of optical modules and cannot meet the demand in time. They also need to manually go to the laboratory to plug and unplug and compare to verify the effectiveness of their functions, resulting in low development and testing efficiency. In addition, in order to debug the impact of faulty optical modules on the overall function of the switch, R&D testers artificially create optical module failures, wasting optical module resources. Summary of the invention

[0005] The purpose of the embodiments of the present invention is to provide a switch testing method, device, communication equipment and storage medium to solve the problem of low efficiency in switch optical module development and testing, so as to achieve reasonable and efficient switch testing. The specific technical solutions are as follows:

[0006] In a first aspect of the present invention, a switch testing method is first provided, which is applied to a switch, wherein the switch is communicatively connected to a remote control module, and the switch is connected to all ports of the switch and at least one optical module through two ends of a first conversion fixture, and the method comprises:

[0007] In response to the switch being powered on, sending a test instruction to the remote control module, wherein the test instruction is used to determine a test port of the switch;

[0008] Control the optical module to be connected to the current test port link of the switch through the remote control module, and test the current test port;

[0009] receiving a test completion signal of the current test port, and controlling the optical module to disconnect the link with the current test port through the remote control module;

[0010] The test instruction is sent to the remote control module to control the optical module to be connected to a link of a next test port of the switch, and to test the next test port.

[0011] Optionally, controlling the optical module to be connected to a link of a current test port of a switch by the remote control module to test the current test port includes:

[0012] Determine, according to the microcontroller circuit in the remote control module, a connected link between the optical module in the first conversion fixture and the current test port of the switch;

[0013] Regulating the connectivity link of the optical module to the current test port;

[0014] In response to the optical module being connected to the current test port link, the current test port is tested, wherein the test includes an in-place test and a low power consumption test.

[0015] Optionally, in response to the optical module being connected to the current test port link, the current test port is tested, wherein the test includes an in-place test and a low power consumption test, including:

[0016] Receiving an in-place signal, obtaining the in-place status of the optical module, and testing the connectivity between the current test port and the optical module;

[0017] A low power consumption signal is received, a power mode displayed by a flag of the optical module is obtained, and a power condition of the optical module of the current test port is tested.

[0018] Optionally, the controlling the optical module to be connected to the current test port link of the switch through the remote control module, and after testing the current test port, further comprising:

[0019] Obtaining the test result of the current test port;

[0020] If the current test port passes the test, sending a test completion signal of the current test port;

[0021] Otherwise, a prompt message is sent to enable the tester to debug the current test port.

[0022] Optionally, the controlling the optical module to be connected to the current test port link of the switch through the remote control module, after performing a functional test on the current test port, sending the test instruction to the remote controller to control the optical module to be connected to the next test port link of the switch, before performing a functional test on the next test port, further includes:

[0023] Sending a fault simulation instruction to the remote control module to control one of the optical modules to fail, thereby obtaining a faulty optical module;

[0024] Sending the test instruction to the remote control module to control the faulty optical module to be connected to at least two test port links of the switch;

[0025] Perform a fault test on at least two of the test ports to obtain test results of the at least two test ports.

[0026] Optionally, sending a fault simulation instruction to the remote controller to control a fault of one of the optical modules to obtain a faulty optical module includes:

[0027] According to the fault simulation instruction, converting the fault simulation instruction into a circuit control signal through the microcontroller of the remote control module;

[0028] According to the circuit control signal, a power pin of one of the optical modules is controlled to be grounded to obtain the faulty optical module.

[0029] Optionally, after performing a fault test on at least two of the test ports and obtaining test results of at least two of the test ports, the method further includes:

[0030] If the test port passes the fault test, the remote control module is used to control the faulty optical module to be disconnected from at least two of the test port links;

[0031] Otherwise, the faulty test port is located and a prompt message is sent to enable the tester to debug the faulty test port.

[0032] In a second aspect of the present invention, a switch testing device is provided, which is applied to a switch, wherein the switch is communicatively connected to a remote control module, and the switch is connected to all ports of the switch and at least one optical module through two ends of a first conversion fixture, wherein the device comprises:

[0033] A first sending module, configured to send a test instruction to the remote control module in response to the switch being powered on, wherein the test instruction is used to determine a test port of the switch;

[0034] A test module, used to control the optical module to be connected to the current test port link of the switch through the remote control module, and test the current test port;

[0035] A control module, used for receiving the test completion signal of the current test port, and controlling the optical module to disconnect the link with the current test port through the remote control module;

[0036] The second sending module is used to send the test instruction to the remote control module, control the optical module to be connected to the next test port link of the switch, and test the next test port.

[0037] Optionally, the test module includes:

[0038] Determine, according to the microcontroller circuit in the remote control module, a connected link between the optical module in the first conversion fixture and the current test port of the switch;

[0039] Regulating the connectivity link of the optical module to the current test port;

[0040] In response to the optical module being connected to the current test port link, the current test port is tested, wherein the test includes an in-place test and a low power consumption test.

[0041] In yet another aspect of the present invention, there is provided a communication device, comprising: a transceiver, a memory, a processor, and a program stored in the memory and executable on the processor;

[0042] The processor is used to read the program in the memory to implement any of the switch testing methods described above.

[0043] In another aspect of the present invention, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium, and when the instructions are executed on a computer, the computer executes any of the switch testing methods described above.

[0044] The switch testing method provided by the embodiment of the present invention sends a test instruction to the remote control module in response to the switch power-on startup, controls the optical module to be connected to the link of the current test port of the switch through the remote control module, tests the current test port, receives the current test port test completion signal, controls the optical module to be disconnected from the link of the current test port through the remote control module, sends a test instruction to the remote control module, controls the optical module to be connected to the link of the next test port of the switch, and tests the next test port. The embodiment of the present invention performs automated testing and simulated fault testing on the optical module port of the switch through the optical module, achieves the purpose of testing all ports of the switch with a small number of optical modules, improves the test efficiency of the optical module of the switch, reduces the cost of manpower and testing resources, can automatically realize the plugging and unplugging of remotely controlled optical modules, simulates the plugging and unplugging of faulty optical modules, etc., realizes the simulation of various fault scenarios, reduces the loss of optical modules, and can complete the switch test at low cost and high efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.

[0046] Figure 1 One of the step flow charts of a switch testing method provided by an embodiment of the present invention;

[0047] Figure 2 yes Figure 1 A method flow chart of step 102 of a switch testing method provided by an embodiment of the present invention;

[0048] Figure 3 This is a second flow chart of the steps of a switch testing method provided by an embodiment of the present invention;

[0049] Figure 4 yes Figure 3 A method flow chart of step 105 of a switch testing method provided by an embodiment of the present invention;

[0050] Figure 5 This is one of the flow charts of a switch testing method provided by an embodiment of the present invention;

[0051] Figure 6 This is a second flow chart of a switch testing method provided by an embodiment of the present invention;

[0052] Figure 7 is a device block diagram of a switch testing device provided by an embodiment of the present invention;

[0053] Figure 8 is a schematic diagram of the structure of a switch testing device provided in an embodiment of the present application;

[0054] Fig. 9 It is a structural diagram of a communication device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0055] To make the purpose, technical scheme and advantages of the embodiments of the present invention clearer, the embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings. However, it will be appreciated by those skilled in the art that in the embodiments of the present invention, many technical details are proposed in order to enable the reader to better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical scheme claimed in the present application can be implemented. The division of the following embodiments is for the convenience of description, and should not constitute any limitation on the specific implementation of the present invention. The various embodiments can be combined and referenced with each other without contradiction.

[0056] Reference Figure 1 , shows one of the flow charts of the switch testing method provided by an embodiment of the present invention, which is applied to Figure 8 The switch shown is communicatively connected to the remote control module, and the switch is connected to the full port of the switch and at least one optical module through two ends of the first conversion fixture. The method may include:

[0057] Step 101 : in response to the switch being powered on, sending a test instruction to a remote control module, wherein the test instruction is used to determine a test port of the switch.

[0058] In the embodiment of the present invention, in order to solve the problem that when R&D testers test the function of the switch optical module, they need to fully insert the optical module to test the function of each port of the switch. When the number of optical modules is small, the test demand cannot be met in time, the development test efficiency is low, and the optical module failure needs to be artificially created when debugging the impact of the faulty optical module on the overall function of the switch, which wastes the optical module resources. This embodiment accesses the switch test LAN through the remote control module, so that the remote control module and the switch are in the same LAN, and the control of the internal electrical path of the first switching fixture is realized through the SSH protocol between them, so that the port of the optical module actually connected to the switch can be changed in real time, and the remote control optical module can be automatically plugged in and out, and the plugging and unplugging of simulated faulty optical modules can be simulated, and various fault scenarios can be simulated to avoid optical module loss, and the switch test can be realized at low cost and high efficiency.

[0059] Specifically, in response to the switch being powered on, the switch has a built-in automated testing software module that first sends a test instruction to the remote control module through the above-mentioned communication link, wherein the test instruction is used to determine the test port of the switch. It should be noted that the test port to be tested determined by the test instruction can be set according to the test requirements and can be a port to be tested, which is not specifically set here.

[0060] It should be noted that when the tester tests the optical module function of the switch port, he uses the first conversion fixture to insert two optical modules at one end and connect one end to the N full ports of the switch. Among them, the first conversion fixture of this embodiment can be an optical module conversion fixture, which has n optical module plugs at one end and 4 optical module interfaces at the other end. The optical module electrical connector is connected to each pin inside the circuit board to realize a 4-to-n circuit structure. The remote control module includes a small network card, a microcontroller and other components, which realize the sending and receiving of instructions through the communication method with the switch local area network, and then the internal circuit structure of the first conversion fixture, thereby ensuring that the 4-to-n path can be arbitrarily controlled, so that the port where the optical module is actually connected to the switch can change in real time.

[0061] Step 102: Control the optical module to connect to the current test port link of the switch through the remote control module, and test the current test port.

[0062] In the embodiment of the present invention, the automatic test software module of the switch sends the test instruction to the remote control module, and the remote control module controls the optical module to connect to the link of the current test port of the switch, thereby testing the current test port.

[0063] It should be noted that the switch starts testing after it is powered on. The built-in automated testing software module first sends test instructions to the microcontroller of the remote control module through the communication link, and then pulls up the conversion connection line through the IO circuit of the microcontroller to connect the various pins of the optical module to the current test port of the switch, so that the current test port link can work normally and perform relevant tests.

[0064] Step 103: receiving a test completion signal of the current test port, and controlling the optical module to disconnect the link with the current test port through the remote control module.

[0065] Specifically, if the current test port completes the test, the switch automation test module can receive the PASS feedback signal and will further send a test instruction to the microcontroller of the remote control module to control the disconnection of the current test port link, so that after the current test port test is completed, it will not affect the connection of the next test port link for related tests, and thus cycle until all ports are tested. That is, by realizing the connection of the optical module to all ports 1-N of the switch in time-sharing and testing the ports one by one, the purpose of efficient testing and verification of a small number of optical modules can be achieved.

[0066] In this embodiment, the switch automation test module controls the connectivity test and disconnection of the optical module and the current test port link through the remote control module, so as to achieve the purpose of testing the full port functions of the automated switch with a small number of optical modules, reduce the time of R&D test personnel to coordinate optical modules and plug and unplug optical modules, save the number of optical modules used, and reduce labor costs and testing resource costs.

[0067] Step 104, sending a test instruction to the remote control module, controlling the optical module to connect to the next test port link of the switch, and testing the next test port.

[0068] Specifically, the switch automation test module can receive the PASS feedback signal, send a test instruction to the remote control module, control the optical module to be connected to the next test port link of the switch, and test the next test port, so that after the current test port test is completed, it will not affect the connection to the next test port link for related tests, and thus the cycle is carried out until all ports are tested. In addition, the remote control module realizes the sending and receiving of instructions by communicating with the switch LAN, and then controls the internal circuit structure of the first conversion fixture, so as to ensure that the 4-to-n path can be arbitrarily controlled, so that the port of the optical module actually connected to the switch changes in real time, and the purpose of efficient testing and verification using a small number of optical modules is achieved.

[0069] The switch testing method provided by the embodiment of the present invention sends a test instruction to the remote control module in response to the switch power-on startup, controls the optical module to be connected to the link of the current test port of the switch through the remote control module, tests the current test port, receives the current test port test completion signal, controls the optical module to be disconnected from the link of the current test port through the remote control module, sends a test instruction to the remote control module, controls the optical module to be connected to the link of the next test port of the switch, and tests the next test port. The embodiment of the present invention performs automated testing and simulated fault testing on the optical module port of the switch through the optical module, achieves the purpose of testing all ports of the switch with a small number of optical modules, improves the test efficiency of the optical module of the switch, reduces the cost of manpower and testing resources, can automatically realize the plugging and unplugging of remotely controlled optical modules, simulates the plugging and unplugging of faulty optical modules, etc., realizes the simulation of various fault scenarios, reduces the loss of optical modules, and can complete the switch test at low cost and high efficiency.

[0070] Further, refer to Figure 2 , Figure 2 yes Figure 1 A method flow chart of step 102 of a switch testing method provided by an embodiment of the present invention, step 102 includes:

[0071] Step 1021: Determine the connection link between the optical module in the first conversion fixture and the current test port of the switch according to the microcontroller circuit in the remote control module.

[0072] Step 1022: Adjust the connection link of the optical module to the current test port.

[0073] Step 1023 , in response to the optical module being connected to the current test port link, the current test port is tested, wherein the test includes an in-place test and a low power consumption test.

[0074] It should be noted that in the above steps 1021-1023, the remote control module is mainly connected to the switch test LAN through the RJ45 network port, so that the remote control module and the switch are in the same LAN, and the control of the internal electrical path of the first conversion fixture is realized through the SSH protocol between them.

[0075] Specifically, first, the connection link between the optical module in the first conversion fixture and the current test port of the switch is determined according to the microcontroller circuit, and the sending and receiving of instructions is realized by communicating with the switch local area network, thereby controlling the internal circuit structure of the fixture to ensure that the 4-to-n path can be arbitrarily controlled, so that the port at which the optical module is actually connected to the switch can be changed in real time, and the connection link of the optical module is adjusted to the current test port. In response to the optical module being connected to the current test port link, the current test port is tested, wherein the test includes an in-place test and a low-power test.

[0076] Specifically, in response to the optical module being connected to the current test port link, step 1023 tests the current test port, which may include the following steps:

[0077] First, receive the in-place signal, obtain the in-place status of the optical module, and test the connectivity between the current test port and the optical module;

[0078] Secondly, receive the low power consumption signal, obtain the power mode displayed by the flag of the optical module, and test the power of the optical module of the current test port.

[0079] In this embodiment, the in-place signal represents the in-place status of the optical module. When the optical module is connected to the current test port link, the signal shows that it is in-place. When the optical module is disconnected from the current test port link, the signal shows that it is not in-place. The low-power signal represents the power mode of the optical module. The power condition of the optical module is tested by setting the flag bit through the switch to check whether the corresponding signal of the optical module changes.

[0080] Specifically, in this embodiment, step 102 controls the optical module to be connected to the current test port link of the switch through the remote control module, and after testing the current test port, it also includes:

[0081] Obtaining the test result of the current test port;

[0082] If the current test port passes the test, sending a test completion signal of the current test port;

[0083] Otherwise, a prompt message is sent to enable the tester to debug the current test port.

[0084] In this embodiment, during the test of the current test port, the switch automation test module can obtain the test result of the current test port, and determine further to issue test instructions based on the test result. If the current test port passes the test, a current test port test completion signal is sent to conduct the test of the next test port. If the test results such as the in-place signal and the low power consumption signal do not meet expectations, the automation test module prompts the test failure, controls the optical module to test and disconnect the link connectivity with the current test port, stops the test, and sends a prompt message so that the tester can debug the current test port.

[0085] In the embodiment of the present invention, a small number of optical modules can be used to test the full port functions of an automated switch, thereby reducing the time for R&D testers to coordinate optical modules and plug and unplug optical modules, saving the number of optical modules used, and reducing labor costs and economic costs.

[0086] The second embodiment of the present invention relates to another switch testing method, which is basically the same as the switch testing method provided in the first embodiment of the present invention, except that after step 102 and before step 104, refer to Figure 3 , the method further comprises:

[0087] Step 105 , sending a fault simulation instruction to the remote control module to control a fault of one of the optical modules to obtain a faulty optical module.

[0088] In an embodiment of the present invention, one end of the first adapter fixture can be connected to two pairs of optical modules, namely A1, A2, B1, and B2, and the other end is connected to a switch. When abnormal injection is required, that is, when a port of the switch needs to insert a faulty optical module to test the impact of optical modules on other normal ports, the switch automation test module sends a fault simulation instruction to the remote control module to control the failure of one of the optical modules to obtain the faulty optical module.

[0089] Step 106: Send a test instruction to the remote control module to control the faulty optical module to be connected to at least two test port links of the switch.

[0090] In the embodiment of the present invention, the automatic test module of the switch sends a test instruction to the remote control module, controls the A1, A2, B1, and B2 modules to issue a power connection instruction, and respectively connects to the switch test port. At this time, the R&D test personnel perform relevant function tests, and if problems are found, perform relevant problem location processing.

[0091] Step 107: Perform a fault test on at least two test ports to obtain test results of the at least two test ports.

[0092] Specifically, in an embodiment of the present invention, a remote control module is used to simulate plugging and unplugging, and a fault test is performed on at least two test ports to obtain test results of at least two test ports. If no problem is found, a path disconnection instruction can be issued through the remote control module to implement a simulated unplugging instruction for the faulty optical module. Other fault scenarios can also be simulated through remote control, and R&D testers can test the relevant functions of the switch port in this state.

[0093] Specifically, in this embodiment, after step 107 performs a fault test on at least two test ports and obtains the test results of at least two test ports, the method further includes:

[0094] If the test port passes the fault test, the remote control module is used to control the faulty optical module to be disconnected from at least two of the test port links;

[0095] Otherwise, the faulty test port is located and a prompt message is sent to enable the tester to debug the faulty test port.

[0096] Compared with the prior art, the embodiments of the present invention, on the basis of achieving the beneficial effects brought by the first embodiment, can simulate the plugging and unplugging of the faulty optical module through the remote control module, and can issue the path disconnection instruction through the remote control module to realize the simulation of unplugging the faulty optical module. In addition, other fault scenarios can be simulated through remote control, and the fault scenarios can be flexibly simulated to perform relevant tests. The automated test module controls the link on and off of the next test port of the circuit through the remote control module, thereby verifying the function of the switch port. Through this method, R&D test personnel can simulate the faulty optical module and simulate various fault scenarios without deliberately causing damage to the optical module, thereby reducing the loss of the optical module. At the same time, the testing of all ports can be automatically realized, thereby improving the efficiency of testing and problem location.

[0097] Further, refer to Figure 4 , Figure 4 yes Figure 3 The method flow chart of step 105 of another switch testing method provided by an embodiment of the present invention, step 105 includes:

[0098] Step 1051, according to the fault simulation instruction, the fault simulation instruction is converted into a circuit control signal through the microcontroller of the remote control module.

[0099] Step 1052: According to the circuit control signal, control the power pin of one of the optical modules to be grounded, thereby obtaining a faulty optical module.

[0100] Specifically, in the above steps 1051-1052, instructions are sent to the microcontroller of the remote control module through the communication link between the switch and the remote control module, and the software instructions are converted into circuit on-off control. By pulling up the pin GPIO, the optical module A1 is connected to the VCC pin and the GND pin of the electrical connector, causing the optical module A1 to fail and obtaining a faulty optical module. It should be noted that the embodiment of the present invention does not specifically limit the setting of the faulty optical module. In this embodiment, according to the test requirements, a faulty optical module can meet the test. The faulty optical module can be a randomly selected optical module, which will not be elaborated here.

[0101] In order to enable those skilled in the art to more clearly understand the process of the switch testing method disclosed in the first and second embodiments of the present invention, refer to Figure 5 One of the flow charts of the switch testing method provided by the embodiment of the present invention is shown, which is described as an example.

[0102] Step 201: The switch is connected to all ports of the switch and at least one optical module through two ends of a first conversion fixture.

[0103] Specifically, one end of the first conversion fixture has n optical module plugs and the other end has 4 optical module interfaces. The pins of the optical module electrical connector are connected through the inside of the circuit board to realize a 4-to-n circuit structure. The instructions are sent and received through communication with the switch LAN, and then the internal circuit structure of the first conversion fixture is controlled, thereby ensuring that the 4-to-n path can be arbitrarily controlled, and the port at which the optical module is actually connected to the switch can be changed in real time.

[0104] Step 202: In response to the switch being powered on, a test instruction is sent to the remote control module.

[0105] Specifically, in response to the switch being powered on, the switch has a built-in automated testing software module that first sends a testing instruction to the remote control module via the communication link, wherein the testing instruction is used to determine the test port of the switch.

[0106] Step 203: Test the current test port.

[0107] Step 204, determine whether the current test port test passes.

[0108] It should be noted that the current test port is tested to determine whether the current test port test passes, and the determination is made based on the test result of the current test port obtained. If the current test port passes the test, a current test port test completion signal is sent, and step 205 is entered to send a test instruction to the remote control module to control the optical module to connect to the next test port link of the switch to perform the test of the next port. Otherwise, step 206 is entered to send a prompt message to enable the tester to debug the current test port.

[0109] Step 205: Send a test instruction to the remote control module to control the optical module to connect to the next test port link of the switch.

[0110] It should be noted that a test instruction is sent to the remote control module to control the optical module to be connected to the next test port link of the switch, and then go to step 203 to test the current test port, so as to repeat this cycle until all ports are tested. The optical module can be connected to the switch ports 1-N by time sharing, and the test function can be verified port by port. This can achieve the purpose of efficient testing and verification of a small number of optical modules.

[0111] Step 206, locating the test port.

[0112] In the embodiments of the present invention, a small number of optical modules can be used to test the full port functions of an automated switch, thereby reducing the time for R&D test personnel to coordinate optical modules and plug and unplug optical modules, saving the number of optical modules used, reducing labor costs and economic costs, and automatically realizing remote control of optical module plug-in simulation, locating test ports, and efficiently completing switch testing.

[0113] In order to enable those skilled in the art to more clearly understand the process of the switch testing method disclosed in the first and second embodiments of the present invention, refer to Figure 6 The second flowchart of the switch testing method provided by the embodiment of the present invention is taken as an example for explanation.

[0114] Step 301: The switch is connected to all ports of the switch and at least one optical module through two ends of a first conversion fixture.

[0115] For example, one end of the first adapter can be connected to two pairs of optical modules, namely A1, A2, B1, and B2, and the other end is connected to a switch. When a faulty optical module is inserted into a port of the switch, the impact of optical modules on other normal ports is tested.

[0116] Step 302: Send a fault simulation instruction to control the faulty optical module to be connected to at least two test port links of the switch.

[0117] Specifically, the switch automation test module can use the device to send fault simulation instructions through the remote control module, that is, send the instructions to the microcontroller of the remote control module through the communication link between the switch and the remote control module, convert the software instructions into circuit on-off control, and connect the VCC pin and GND pin of the optical module A1 by pulling up the GPIO pin, causing the optical module A1 to fail.

[0118] Step 303: Perform a fault test on at least two test ports.

[0119] Step 304: determine whether the test port fault test passes.

[0120] It should be noted that a fault test is performed on at least two test ports to determine whether the test port fault test passes. If the test port passes the fault test, the process proceeds to step 305, and the remote control module is used to control the faulty optical module to be disconnected from at least two of the test port links; otherwise, the process proceeds to step 306, and the faulty test port is located, and a prompt message is sent to enable the tester to debug the faulty test port.

[0121] Step 305: Control the faulty optical module to disconnect links with at least two test ports.

[0122] It should be noted that, when the test port passes the fault test, after controlling the faulty optical module to be disconnected from at least two test port links, it indicates that the current test port test is completed, then the process goes to step 302, and a fault simulation instruction is sent to control the faulty optical module to be connected to at least two test port links of the switch. It should be noted that at least two test ports of the switch that enter step 302 again are different from the test ports of the last time, and are specifically set according to the test requirements, which will not be elaborated here.

[0123] Step 306: locate the faulty test port.

[0124] In the embodiment of the present invention, a fault simulation instruction can be sent through the remote control module to control the faulty optical module to be connected to at least two test port links of the switch, and the fault simulation is implemented using the faulty optical module. R&D testers can test the relevant functions of the switch port in this state, and can flexibly simulate fault scenarios to perform relevant tests. The automated test module controls the next test port link of the circuit through the remote control module to verify the function of the switch port.

[0125] Reference Figure 7 , shows a device block diagram of a switch testing device provided by an embodiment of the present invention, wherein the switch is communicatively connected to a remote control module, and the switch is connected to all ports of the switch and at least one optical module through two ends of a first conversion fixture, and the device may include:

[0126] A first sending module 401, configured to send a test instruction to the remote control module in response to the switch being powered on, wherein the test instruction is used to determine a test port of the switch;

[0127] A test module 402, configured to control the optical module to be connected to a link of a current test port of the switch through the remote control module, and to test the current test port;

[0128] The control module 403 is used to receive the test completion signal of the current test port, and control the optical module to disconnect the link with the current test port through the remote control module;

[0129] The second sending module 404 is used to send the test instruction to the remote control module, control the optical module to be connected to the next test port link of the switch, and test the next test port.

[0130] Furthermore, the test module 402 includes:

[0131] A determination submodule, configured to determine a connection link between the optical module in the first conversion fixture and a current test port of the switch according to a microcontroller circuit in the remote control module;

[0132] A regulating submodule, used for regulating the connected link of the optical module to the current test port;

[0133] The test submodule is used for testing the current test port in response to the optical module being connected to the current test port link, wherein the test includes an in-place test and a low power consumption test.

[0134] Furthermore, the test submodule includes:

[0135] A first test unit, configured to receive an in-place signal, obtain an in-place status of the optical module, and test connectivity between the current test port and the optical module;

[0136] The second test unit is used to receive the low power consumption signal, obtain the power mode displayed by the flag of the optical module, and test the power status of the optical module of the current test port.

[0137] Optionally, the device further comprises:

[0138] A first acquisition module, used to acquire the test result of the current test port;

[0139] A third sending module, configured to send a test completion signal of the current test port if the current test port passes the test;

[0140] The fourth sending module is used for sending a prompt message to enable the tester to debug the current test port otherwise.

[0141] Furthermore, the device further comprises:

[0142] a fifth sending module, configured to send a fault simulation instruction to the remote control module to control a fault of one of the optical modules to obtain a faulty optical module;

[0143] A sixth sending module, used to send the test instruction to the remote control module to control the faulty optical module to be connected to at least two test port links of the switch;

[0144] The second acquisition module performs a fault test on at least two of the test ports to obtain test results of the at least two test ports.

[0145] Furthermore, the fifth sending module includes:

[0146] a conversion submodule, configured to convert the fault simulation instruction into a circuit control signal through the microcontroller of the remote control module according to the fault simulation instruction;

[0147] The control submodule is used to control the power supply pin of one of the optical modules to be grounded according to the circuit control signal, so as to obtain the faulty optical module.

[0148] Furthermore, the device further comprises:

[0149] A second control module, configured to control the faulty optical module to be disconnected from at least two of the test port links through the remote control module if the test port passes the fault test;

[0150] The seventh sending module is used for locating the faulty test port and sending prompt information so that the test personnel can debug the faulty test port.

[0151] The switch testing device provided by the embodiment of the present invention sends a test instruction to the remote control module in response to the switch power-on startup, controls the optical module to be connected to the current test port link of the switch through the remote control module, tests the current test port, receives the current test port test completion signal, controls the optical module to be disconnected from the current test port link through the remote control module, sends a test instruction to the remote control module, controls the optical module to be connected to the next test port link of the switch, and tests the next test port. The embodiment of the present invention performs automated testing and simulated fault testing on the optical module port of the switch through the optical module, achieves the purpose of testing all ports of the switch with a small number of optical modules, improves the test efficiency of the optical module of the switch, reduces the cost of manpower and testing resources, can automatically realize the plugging and unplugging of remotely controlled optical modules, simulates the plugging and unplugging of faulty optical modules, etc., realizes the simulation of various fault scenarios, reduces the loss of optical modules, and can complete the switch test at low cost and high efficiency.

[0152] The embodiment of the present invention also provides a communication device, such as Fig. 9 As shown, it includes a processor 501, a communication interface 502, a memory 503 and a communication bus 504, wherein the processor 501, the communication interface 502, and the memory 503 communicate with each other through the communication bus 504.

[0153] Memory 503, used for storing computer programs;

[0154] The processor 501 is used to execute the program stored in the memory 503, and implements the following steps:

[0155] In response to the switch being powered on, a test instruction is sent to the remote control module, wherein the test instruction is used to determine the test port of the switch; the optical module is controlled to be connected to the current test port link of the switch through the remote control module, and the current test port is tested; a test completion signal of the current test port is received, and the optical module is controlled to be disconnected from the current test port link through the remote control module; a test instruction is sent to the remote control module, and the optical module is controlled to be connected to the next test port link of the switch, and the next test port is tested.

[0156] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0157] The communication interface is used for communication between the above terminal and other devices.

[0158] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0159] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.

[0160] In another embodiment of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium stores instructions. When the instructions are executed on a computer, the computer executes the switch testing method described in any one of the above embodiments.

[0161] In another embodiment of the present invention, a computer program product including instructions is provided. When the computer program product is run on a computer, the computer executes the switch testing method described in any one of the above embodiments.

[0162] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk SolidStateDisk (SSD)), etc.

[0163] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0164] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0165] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims

1. A switch testing method, characterized in that: Applied to a switch, the switch is communicatively connected with a remote control module, the switch is connected to all ports of the switch and at least one optical module through two ends of a first conversion fixture, and the method includes: In response to the switch being powered on, sending a test instruction to the remote control module, wherein the test instruction is used to determine a test port of the switch; Control the optical module to be connected to the current test port link of the switch through the remote control module, and test the current test port; receiving a test completion signal of the current test port, and controlling the optical module to disconnect the link with the current test port through the remote control module; Sending a fault simulation instruction to the remote control module to control one of the optical modules to have a fault, and obtaining the faulty optical module, comprising: converting the fault simulation instruction into a circuit control signal through a microcontroller of the remote control module according to the fault simulation instruction, and controlling the power supply pin of one of the optical modules to be grounded according to the circuit control signal, and obtaining the faulty optical module; Sending the test instruction to the remote control module to control the faulty optical module to be connected to at least two test port links of the switch; Performing a fault test on at least two of the test ports to obtain test results of at least two of the test ports; The test instruction is sent to the remote control module to control the optical module to be connected to a link of a next test port of the switch, and to test the next test port.

2. The method according to claim 1, characterized in that The step of controlling the optical module to be connected to the current test port link of the switch by the remote control module to test the current test port includes: Determine, according to the microcontroller circuit in the remote control module, a connected link between the optical module in the first conversion fixture and the current test port of the switch; Regulating the connectivity link of the optical module to the current test port; In response to the optical module being connected to the current test port link, the current test port is tested, wherein the test includes an in-place test and a low power consumption test.

3. The method according to claim 2, characterized in that In response to the optical module being connected to the current test port link, the current test port is tested, wherein the test includes an in-place test and a low power consumption test, including: Receiving an in-place signal, obtaining the in-place status of the optical module, and testing the connectivity between the current test port and the optical module; A low power consumption signal is received, a power mode displayed by a flag of the optical module is obtained, and a power condition of the optical module of the current test port is tested.

4. The method according to claim 1, characterized in that After controlling the optical module to be connected to the current test port link of the switch through the remote control module and testing the current test port, the method further includes: Obtaining the test result of the current test port; If the current test port passes the test, sending a test completion signal of the current test port; Otherwise, a prompt message is sent to enable the tester to debug the current test port.

5. The method according to claim 1, characterized in that After performing a fault test on at least two of the test ports and obtaining test results of at least two of the test ports, the method further includes: If the test port passes the fault test, the remote control module is used to control the faulty optical module to be disconnected from at least two of the test port links; Otherwise, the faulty test port is located and a prompt message is sent to enable the tester to debug the faulty test port.

6. A switch testing device, characterized in that: Applied to a switch, the switch is communicatively connected with a remote control module, the switch is connected to all ports of the switch and at least one optical module through two ends of a first conversion fixture, and the device includes: A first sending module, configured to send a test instruction to the remote control module in response to the switch being powered on, wherein the test instruction is used to determine a test port of the switch; A test module, used to control the optical module to be connected to the current test port link of the switch through the remote control module, and test the current test port; A control module, used for receiving the test completion signal of the current test port, and controlling the optical module to disconnect the link with the current test port through the remote control module; A fifth sending module, used for sending a fault simulation instruction to the remote control module, controlling one of the faults of the optical modules, and obtaining a faulty optical module, the fifth sending module comprising: a conversion submodule, used for converting the fault simulation instruction into a circuit control signal through the microcontroller of the remote control module according to the fault simulation instruction; a control submodule, used for controlling the grounding of a power supply pin of one of the optical modules according to the circuit control signal, and obtaining the faulty optical module; A sixth sending module, used to send the test instruction to the remote control module to control the faulty optical module to be connected to at least two test port links of the switch; A second acquisition module performs a fault test on at least two of the test ports to obtain test results of at least two of the test ports; The second sending module is used to send the test instruction to the remote control module, control the optical module to be connected to the next test port link of the switch, and test the next test port.

7. A communication device, characterized in that: include: A transceiver, a memory, a processor, and a program stored on the memory and executable on the processor; The processor is used to read the program in the memory to implement the steps in the switch testing method according to any one of claims 1 to 5.

8. A readable storage medium for storing a program, characterized in that: When the program is executed by a processor, the steps in the switch testing method according to any one of claims 1 to 5 are implemented.