Network device inspection method, device, system and network link inspection method

By connecting to the optical module via the optical module interface, setting the loopback mode, and comparing test signals, the complex link verification problem of optical modules and optical patch cords connecting network devices in existing technologies is solved, enabling rapid location of communication anomalies and improving troubleshooting efficiency.

CN123055170APending Publication Date: 2026-11-06JD DIGITS HAIYI INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611140427.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-29
Publication Date
2026-11-06

AI Technical Summary

Technical Problem

Existing technologies for inspecting network device links connected by optical modules and optical patch cords are complex and time-consuming, making it difficult to quickly locate communication problems.

Method used

Connect to the optical module via the optical module interface, set the loopback mode, directly return the test signal, and compare the signals to determine if the network device is malfunctioning.

Benefits of technology

It reduces the complexity and time required for troubleshooting network devices and improves the efficiency of troubleshooting end-to-end links.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123055170A_ABST
    Figure CN123055170A_ABST
Patent Text Reader

Abstract

The application discloses a network device inspection method, device and system and a network link inspection method, and relates to the technical field of computers. A specific implementation manner of the method comprises the following steps: connecting with an optical module through an optical module interface; sending a write request to the optical module through the optical module interface, and setting the optical module to a loopback mode according to the write request, wherein the loopback mode is a mode of receiving any signal and directly returning the original signal without passing through a signal conversion device; sending a test signal to the optical module through the optical module interface, and receiving the test signal returned by the optical module; comparing the returned test signal with the sent test signal, and determining that the network device is abnormal in response to the fact that the comparison result satisfies an abnormal condition. The implementation manner reduces the complexity and period of troubleshooting of the network device, and improves the troubleshooting efficiency of an end-to-end link.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, and in particular to a network device inspection method, device and system, and a network link inspection method. BACKGROUND

[0002] Currently, optical modules and optical patch cords are mainly used as connection media between network devices such as switches. When the existing technology inspects network devices / links using optical module and optical patch cord connection media, the following problems exist: after a complete link is built, if communication problems are found in end-to-end traffic testing, all links and all network devices, optical modules and optical patch cords need to be checked through cross verification, which has high overall checking complexity and a long checking period. SUMMARY

[0003] Therefore, the embodiments of the present application provide a network device inspection method, device and system, and a network link inspection method, which can reduce the complexity and period of network device checking and improve the checking efficiency of end-to-end links.

[0004] To achieve the above object, according to an aspect of the embodiments of the present application, a network device inspection method is provided, which is applied to a network device and includes the following steps. connecting with an optical module through an optical module interface; sending a write request to the optical module through the optical module interface, and setting the optical module to a loopback mode according to the write request, wherein the loopback mode is a mode of receiving any signal and directly returning the original signal without passing through a signal conversion device; sending a test signal to the optical module through the optical module interface, and receiving a test signal returned by the optical module; comparing the returned test signal with the sent test signal, and determining the network device as abnormal in response to an abnormal condition of the comparison result.

[0005] Optionally, after connecting with the optical module through the optical module interface, the method further includes the following steps. reading register data of the optical module through the optical module interface; determining whether the optical module meets the following conditions according to the register data: whether a data channel of the optical module is enabled; and whether the optical module supports the loopback mode; determining the optical module as abnormal in response to not meeting any condition.

[0006] Optionally, sending the write request to the optical module through the optical module interface, and setting the optical module to the loopback mode according to the write request includes the following steps. sending the write request to the optical module through the optical module interface, and writing preset data in a position corresponding to the loopback mode in a register of the optical module according to the write request; reading data in a position corresponding to the loopback mode from a register of the optical module through the optical module interface, and verifying whether the loopback mode is set successfully; In response to the loopback mode not being set successfully, determining the network device and / or the optical module as abnormal.

[0007] Optionally, the returned test signal is compared with the sent test signal, and in response to the comparison result satisfying an abnormal condition, the network device is determined as abnormal, including: statistically obtaining a bit error rate of the probability that the returned test signal is inconsistent with the sent test signal within a preset time period; In response to the bit error rate being greater than or equal to a preset threshold, the network device is determined as abnormal.

[0008] In a second aspect, an embodiment of the present application provides a verification method of a network device, applied to an optical module, including: receiving a write request sent by the network device, and setting the optical module as a loopback mode according to the write request, the loopback mode being a mode of receiving any signal and directly returning the original signal without passing through a signal conversion device; receiving a test signal sent by the network device, and returning the test signal to the network device; the sent test signal and the returned test signal are used for the network device to determine whether the network device is abnormal.

[0009] In a third aspect, an embodiment of the present application provides a verification method of a network device link, including: verifying the first network device by using the method of any of the above embodiments; verifying the second network device by using the method of any of the above embodiments; In response to the first network device and the second network device passing the verification, connecting a first optical module connected to the first network device and a second optical module connected to the second network device; verifying a link between the first optical module and the second optical module; and in response to the link not passing the verification, determining the link as abnormal.

[0010] In a fourth aspect, an embodiment of the present application provides a network device for verification, including: an optical module interface, configured to be connected to an optical module; a communication module, configured to send a write request to the optical module through the optical module interface, and set the optical module as a loopback mode according to the write request, the loopback mode being a mode of receiving any signal and directly returning the original signal without passing through a signal conversion device; a test signal generator, configured to send a test signal to the optical module through the optical module interface; The test signal detector is used to receive the test signal returned by the optical module and compare the returned test signal with the sent test signal. If the comparison result meets the abnormal conditions, the network device is judged as abnormal.

[0011] Fifthly, embodiments of the present invention provide an optical module for network device testing, comprising: The register module is used to receive write requests sent by network devices and set the optical module to loopback mode according to the write request. Loopback mode is a mode in which the optical module receives any signal and returns the original signal directly without going through the signal conversion device. The loopback module is used to receive test signals sent by network devices and return test signals to the network devices; the sent and returned test signals are used by the network devices to determine whether they are abnormal.

[0012] Sixthly, embodiments of the present invention provide a network device inspection system, comprising: a network device and an optical module, wherein: The network device is used to connect to the optical module via the optical module interface; it sends write requests to the optical module via the optical module interface, and sets the optical module to loopback mode according to the write request. Loopback mode is a mode in which the optical module receives any signal and returns the original signal directly without passing through the signal conversion device; it sends test signals to the optical module via the optical module interface and receives test signals returned by the optical module; it compares the returned test signals with the sent test signals, and determines the network device as abnormal if the comparison result meets the abnormal conditions; The optical module is used to receive write requests sent by network devices and set the optical module to loopback mode according to the write request. Loopback mode is a mode in which the optical module receives any signal and returns the original signal directly without going through the signal conversion device. It also receives test signals sent by network devices and returns test signals to the network devices. The sent test signals and returned test signals are used by the network devices to determine whether they are abnormal.

[0013] In a seventh aspect, embodiments of the present invention provide an electronic device, comprising: One or more processors; A storage device for storing one or more programs that, when executed by one or more processors, cause the one or more processors to implement the methods of any of the above embodiments.

[0014] Eighthly, embodiments of the present invention provide a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the method of any of the above embodiments.

[0015] Ninthly, embodiments of the present invention provide a computer program product, including a computer program, wherein the computer program, when executed by a processor, implements the method of any of the above embodiments.

[0016] One embodiment of the above invention has the following advantages or beneficial effects: by connecting to the optical module via the optical module interface and sending a write request, the optical module is set to loopback mode; the test signals received and returned by the optical module are numerically compared and analyzed using loopback mode to determine whether the network device is abnormal. Therefore, the network device inspection method, device, system, and network link inspection method of the above embodiments can reduce the complexity and cycle of network device troubleshooting and improve the efficiency of end-to-end link troubleshooting.

[0017] The further effects of the aforementioned unconventional alternative methods will be explained below in conjunction with specific implementation methods. Attached Figure Description

[0018] The accompanying drawings are provided to better understand the invention and are not intended to unduly limit the scope of the invention. Wherein: Figure 1 This is a schematic diagram of the main flow of a network device testing method provided in one embodiment of the present invention; Figure 2 This is a flowchart illustrating a network device testing method provided in another embodiment of the present invention; Figure 3 This is a schematic diagram of a method for troubleshooting network devices and links using existing technology; Figure 4 This is a schematic diagram of the test setup for a network device testing method provided in one embodiment of the present invention; Figure 5 This is a schematic flowchart of a network device testing method provided in one embodiment of the present invention; Figure 6 This is a schematic diagram of a general data path of an optical module provided in one embodiment of the present invention; Figure 7 This is a schematic diagram of the loopback mode data path of an optical module provided in one embodiment of the present invention; Figure 8 This is a flowchart illustrating a network device testing method according to another embodiment of the present invention; Figure 9 This is a flowchart illustrating a network device link verification method provided in one embodiment of the present invention; Figure 10 This is a schematic diagram of the main modules of a network device for testing provided in one embodiment of the present invention; Figure 11 Another embodiment of the present invention provides a schematic diagram of the main modules of a network device for testing; Figure 12 This is a schematic diagram of the main modules of an optical module for network device testing provided in an embodiment of the present invention; Figure 13 This is a schematic diagram of the main modules of a network device inspection system provided in one embodiment of the present invention; Figure 14 This is an exemplary system architecture diagram in which embodiments of the present invention can be applied; Figure 15 This is a schematic diagram of the structure of a computer system suitable for implementing terminal devices or servers of the present invention. Detailed Implementation

[0019] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of the present invention, including various details to aid understanding. These details should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the invention. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0020] It should be noted that the collection, gathering, updating, analysis, processing, use, transmission, and storage of user personal information involved in this disclosed technical solution all comply with relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. Necessary measures are taken to prevent unauthorized access to user personal information data and to safeguard user personal information security, network security, and national security.

[0021] Figure 1 This is an embodiment of the present invention providing a method for testing network devices, applied to network devices such as... Figure 1 As shown, it includes the following steps: Step S101: Connect to the optical module via the optical module interface.

[0022] The network device in this embodiment of the invention can be any network device with an optical module structure, including but not limited to network adapters, host bus adapters (HBAs), host channel adapters (HCAs), switches, routers, repeaters, bridges, and hubs. The optical module can be any optical module with loopback functionality, including but not limited to SFP, SFP+, SFP28, QSFP, QSFP+, QSFP28, QSFP-DD, OSFP, CFP, CFP2, CFP4, and CXP package types.

[0023] Connecting to an optical module via an optical module interface refers to establishing an electrical (signal) connection between the optical module and the network device through the internal bus, printed circuit board (PCB) circuitry, etc., without needing to establish a connection through an additional fiber optic link or electrical link.

[0024] In some embodiments, after connecting to the optical module via the optical module interface, the method further includes: reading the register data of the optical module via the optical module interface; determining whether the optical module meets the following conditions based on the register data: whether the data channel of the optical module is enabled; whether the optical module supports loopback mode; and determining the optical module as abnormal in response to not meeting any of the conditions.

[0025] The optical module can have multiple data channels, and all or some of the data channels can be checked. For example, the activation of a certain data channel can be determined by reading the data in the register of the corresponding data channel in the optical module register.

[0026] In some embodiments, the network device has multiple optical module interfaces that can connect to multiple optical modules. When determining whether an optical module meets the above conditions, the abnormality of multiple optical modules can be determined independently.

[0027] Among them, optical module malfunction refers to optical modules that are not suitable for testing network equipment or that have communication problems.

[0028] Step S102: Send a write request to the optical module through the optical module interface, and set the optical module to loopback mode according to the write request. Loopback mode is a mode in which the optical module receives any signal and returns the original signal directly without going through the signal conversion device.

[0029] Among them, signal conversion devices refer to transmitting optical sub-assembly (TOSA) devices that convert electrical signals into optical signals, and receiving optical sub-assembly (ROSA) devices that convert optical signals into electrical signals.

[0030] In some embodiments, a write request is sent to the optical module via the optical module interface through the I2C (Inter-Integrated Circuit) controller and the I2C bus, and the optical module is set to loopback mode according to the write request. The I2C controller and the I2C bus are also used to read / write register data of the optical module.

[0031] In some embodiments, sending a write request to the optical module through the optical module interface and setting the optical module to loopback mode according to the write request includes: sending a write request to the optical module through the optical module interface, writing preset data in the optical module's register at the position corresponding to the loopback mode according to the write request; reading the data in the optical module's register at the position corresponding to the loopback mode through the optical module interface, and verifying whether the loopback mode is set successfully; and determining the network device and / or optical module as abnormal in response to the failure of the loopback mode setting.

[0032] Unsuccessful loopback mode setting typically indicates an abnormality in the optical module, or in the network device's internal PCB wiring, I2C communication bus, or I2C controller. To further pinpoint the location of the abnormality, write requests can be sent to multiple optical modules connected to the network device. Based on these requests, preset data is written to the registers of these optical modules at the positions corresponding to the loopback mode. The data at the corresponding positions in the registers of these optical modules is then read through their interfaces to verify whether the loopback mode of these optical modules has been successfully set. If the loopback mode of some optical modules is successfully set, the optical modules that failed to set the mode are considered abnormal. If the loopback mode of all optical modules fails to set, the entire network device is considered abnormal.

[0033] Step S103: Send a test signal to the optical module through the optical module interface and receive the test signal returned by the optical module.

[0034] In some embodiments, network devices can transmit and receive test signals through a test signal generator and test signal detector integrated into an Ethernet PHY (Physical Layer) chip.

[0035] The test signal can be a pseudo-random binary sequence (PBRS) signal, or other test signals with statistically significant parameters such as bit error rate, eye diagram, and signal-to-noise ratio. If necessary, hardware modifications can be made according to the requirements of the test signal; for example, an oscilloscope can be added to display the eye diagram.

[0036] In some embodiments, the network device can switch between a test mode and a normal mode. The normal mode is the normal usage mode, used to transmit service signals; the test mode is used to enable the PHY chip and transmit PBRS test signals.

[0037] Step S104: Compare the returned test signal with the sent test signal. If the comparison result meets the abnormal conditions, determine the network device as abnormal.

[0038] In some embodiments, the returned test signal is compared with the sent test signal, and the network device is determined to be abnormal in response to the comparison result meeting the abnormal condition. This includes: calculating the probability that the returned test signal and the sent test signal are inconsistent within a preset time period to obtain the bit error rate; and determining the network device to be abnormal in response to the bit error rate being greater than or equal to a preset threshold.

[0039] In some embodiments, the returned test signal is compared with the sent test signal, and the network device is determined to be abnormal in response to the comparison result meeting the abnormal conditions. The method may further include: obtaining the eye diagram and / or signal-to-noise ratio of the test signal returned within a preset time period; and determining the network device to be abnormal in response to the eye diagram indicators (such as eye height, eye width, etc.) and / or signal-to-noise ratio being less than a preset threshold.

[0040] A network device being flagged as abnormal usually refers to a problem with its optical module interface. However, it could also be due to a problem with other components within the network device. In actual troubleshooting, it's not always necessary to pinpoint the specific faulty component. When a network device (optical module interface) is flagged as abnormal, the corresponding optical module interface can be indicated by an indicator light, such as displaying a red light.

[0041] Figure 2 This is another embodiment of the network device testing method provided by the present invention, applied to network devices, such as... Figure 2 As shown, it includes the following steps: Step S201: Connect to the optical module via the optical module interface.

[0042] like Figure 3 As shown, when troubleshooting end-to-end network devices, the existing technology requires sending traffic from network device A to network device B. When a communication problem occurs, the devices that may be problematic are network device A, network device B, optical module 1, and optical module 2. The links that may be problematic are the electrical link between network device A and optical module 1, the optical fiber link between optical module 1 and optical module 2, and the electrical link between optical module 2 and network device B. A total of 4 devices and 3 links need to be checked 7 times.

[0043] like Figure 4 The diagram shown illustrates the test setup for inspecting network devices in this embodiment. A single test verifies network device A, optical module 1, and the electrical link between network device A and optical module 1. If an anomaly is detected, the faulty device or link can be directly located. Therefore, during end-to-end troubleshooting, only three inspections are needed: one on the network device A side, one on the network device B side, and one on the fiber optic link between optical module 1 and optical module 2.

[0044] The following is combined with Figure 2 and Figure 5(Flowchart of the program) This paper describes an embodiment of the present invention.

[0045] Step S202: Read the register data of the optical module through the optical module interface; determine whether the optical module meets the following conditions based on the register data: whether the data channel of the optical module is enabled; whether the optical module supports loopback mode; if any condition is not met, determine the optical module as abnormal.

[0046] The I2C controller reads data from register Page 11h, byte 128 to byte 137 (the register positions for the status of 8 data channels) of the optical module connected to the optical module interface. Based on the read data, it determines whether the requested data channel is enabled. For example, if the data is 4, the status of the data channel is DPActivated, and the data channel is enabled.

[0047] The input of bit 0 (the register position corresponding to loopback mode) of byte 128 data in register Page 13h of the optical module connected to the optical module interface is read by the I2C controller. If the data is 1, it means that the optical module supports loopback mode (Media Side Output Loopback).

[0048] If not all data channels are enabled or the optical module does not support loopback mode, the optical module will be identified as abnormal and can be replaced or repaired.

[0049] Step S203: Send a write request to the optical module through the optical module interface, and set the optical module to loopback mode according to the write request. Loopback mode is a mode in which the optical module receives any signal and returns the original signal directly without going through the signal conversion device.

[0050] The I2C controller writes the data 11111111b to the Page 13h, byte 180 register of the optical module to enable loopback mode for all data channels.

[0051] By reading the data at byte 180 of register Page 13h of the optical module through the I2C controller, if the data is 11111111b, it is confirmed that the loopback mode of all data channels of the optical module has been enabled.

[0052] Step S204: Send a test signal to the optical module through the optical module interface and receive the test signal returned by the optical module.

[0053] The PRBS test signal is sent by configuring the test signal generator of the Ethernet PHY chip.

[0054] For the photoelectric conversion mode of normal use of optical modules (such as...) Figure 6As shown), the signal transmitted by the network device (direction Tx) is converted into an optical signal by the TOSA and connected to the external optical signal end face through the internal short fiber or prism group for transmitting and receiving optical signals. The received optical signal is converted into an electrical signal by the ROSA and returned to the network device (direction Rx).

[0055] In this embodiment, the optical module adopts a loopback mode (such as...). Figure 7 As shown, the received test signal will loop back in the DSP / CDR chip inside the optical module (DSP stands for Digital Signal Processing, and CDR stands for Clock and Data Recovery), thus returning the test signal to the receiving end of the network device.

[0056] Step S205: Compare the returned test signal with the sent test signal. If the comparison result meets the abnormal conditions, determine the network device as abnormal.

[0057] The network device monitors the bit error rate of the returned test signal over a period of time using a test signal detector. If the bit error rate is greater than or equal to a preset threshold (e.g., 1e-6), the optical module interface of the network device is judged as abnormal and is replaced or repaired. If the bit error rate is less than the preset threshold, the test is passed.

[0058] When conducting end-to-end troubleshooting and testing of network devices, only the optical fibers between optical modules need to be tested.

[0059] Figure 8 This is another embodiment of the network device testing method provided by the present invention, applied to optical modules, such as... Figure 8 As shown, it includes the following steps: Step S801: Receive a write request sent by the network device, and set the optical module to loopback mode according to the write request. Loopback mode is a mode in which the optical module receives any signal and returns the original signal directly without going through the signal conversion device.

[0060] Step S802: Receive the test signal sent by the network device and return a test signal to the network device; the sent test signal and the returned test signal are used by the network device to determine whether it is abnormal.

[0061] Figure 9 This is another embodiment of the network device link verification method provided by the present invention, such as... Figure 9 As shown, it includes the following steps: Step S901: The first network device is tested using the method of any of the above embodiments.

[0062] Step S902: The second network device is tested using the method of any of the above embodiments.

[0063] Step S903: In response to the first network device and the second network device passing the verification, connect the first optical module connected to the first network device to the second optical module connected to the second network device.

[0064] Step S904: Inspect the link between the first optical module and the second optical module; if the link fails the inspection, determine the link as abnormal.

[0065] Figure 10 This is a schematic diagram of the main modules of a network device for testing provided in an embodiment of the present invention, as shown below. Figure 10 As shown, the network device 1000 used for testing includes: Optical module interface 1010 is used to connect to optical module 1200; The communication module 1020 is used to send a write request to the optical module 1200 through the optical module interface, and set the optical module 1200 to loopback mode according to the write request. Loopback mode is a mode in which the optical module receives any signal and returns the original signal directly without going through the signal conversion device. The test signal generator 1030 is used to send test signals to the optical module 1200 through the optical module interface; The test signal detector 1040 is used to receive the test signal returned by the optical module 1200 and compare the returned test signal with the sent test signal. In response to the comparison result meeting the abnormal conditions, the network device 1000 is determined to be abnormal.

[0066] In some embodiments, the network device 1000 further includes a logic control and computing module; wherein the logic control and computing module is connected to the (I2C) communication module 1020, the test signal generator 1030, and the test signal detector 1040 via a control bus; the (I2C) communication module 1020 is connected to the optical module interface 1010 via an I2C communication bus, the test signal generator 1030 is connected to the optical module interface 1010 via a test signal transmission path, and the test signal generator 1030 is connected to the optical module interface 1010 via a test signal receiving path (e.g., ...). Figure 11 (As shown).

[0067] Figure 12 This is a schematic diagram of the main modules of an optical module for network device testing provided in one embodiment of the present invention, as shown below. Figure 12 As shown, the optical module 1200 used for network device testing includes: Register module 1210 is used to receive write requests sent by network device 1000 and set optical module 1200 to loopback mode according to the write request. Loopback mode is a mode in which the original signal is returned directly after receiving any signal without going through the signal conversion device. The loopback module 1220 is used to receive test signals sent by the network device 1000 and return test signals to the network device 1000; the sent test signals and the returned test signals are used by the network device 1000 to determine whether it is abnormal.

[0068] Figure 13 This is a schematic diagram of the main modules of a network device inspection system provided in one embodiment of the present invention, as shown below. Figure 13 As shown, the network device testing system 1300 includes a network device 1000 and an optical module 1200, wherein: Network device 1000 is used to connect to optical module 1200 via optical module interface; it sends a write request to optical module 1200 via optical module interface, and sets optical module 1200 to loopback mode according to the write request. Loopback mode is a mode in which any signal is received and returned directly to the original signal without going through a signal conversion device; it sends a test signal to optical module 1200 via optical module interface and receives the test signal returned by optical module 1200; it compares the returned test signal with the sent test signal, and in response to the comparison result meeting the abnormal conditions, it determines that network device 1000 is abnormal; The optical module 1200 is used to receive write requests sent by the network device 1000, and set the optical module 1200 to loopback mode according to the write request. Loopback mode is a mode in which the optical module 1200 receives any signal and returns the original signal directly without going through the signal conversion device. It also receives test signals sent by the network device 1000 and returns test signals to the network device 1000. The sent test signals and returned test signals are used by the network device 1000 to determine whether it is abnormal.

[0069] Figure 14 An exemplary system architecture 1400 for testing network devices or network devices and optical modules to which embodiments of the present invention can be applied is shown.

[0070] like Figure 14 As shown, system architecture 1400 may include terminal devices 1401, 1402, and 1403, network 1404, and server 1405. Network 1404 is used as a medium to provide a communication link between terminal devices 1401, 1402, and 1403 and server 1405. Network 1404 may include various connection types, such as wired or wireless communication links or fiber optic cables, etc.

[0071] Users can use terminal devices 1401, 1402, and 1403 to interact with server 1405 via network 1404 to receive or send messages, etc. Various communication client applications, such as testing applications and command-line applications, can be installed on terminal devices 1401, 1402, and 1403.

[0072] Terminal devices 1401, 1402, and 1403 can be various electronic devices with displays and web browsing capabilities, including but not limited to smartphones, tablets, laptops, and desktop computers.

[0073] Server 1405 can be a server that provides various services, such as a backend management server that supports test applications browsed by users using terminal devices 1401, 1402, and 1403. The backend management server can analyze and process received test signals and other data, and feed back the processing results (such as abnormal results) to the terminal devices.

[0074] It should be noted that the network device testing method provided in this embodiment of the invention is generally executed by server 1405, and correspondingly, the network device and optical module are generally located in server 1405.

[0075] It should be understood that Figure 14 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0076] The following is for reference. Figure 15 It shows a schematic diagram of the structure of a computer system 1500 suitable for implementing a terminal device of the present invention. Figure 15 The terminal device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.

[0077] like Figure 15 As shown, the computer system 1500 includes a central processing unit (CPU) 1501, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 1502 or programs loaded from storage section 1508 into random access memory (RAM) 1503. The RAM 1503 also stores various programs and data required for the operation of the system 1500. The CPU 1501, ROM 1502, and RAM 1503 are interconnected via a bus 1504. An input / output (I / O) interface 1505 is also connected to the bus 1504.

[0078] The following components are connected to I / O interface 1505: an input section 1506 including a keyboard, mouse, etc.; an output section 1507 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 1508 including a hard disk, etc.; and a communication section 1509 including a network interface card such as a LAN card, modem, etc. The communication section 1509 performs communication processing via a network such as the Internet. A drive 1510 is also connected to I / O interface 1505 as needed. Removable media 1511, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 1510 as needed so that computer programs read from them can be installed into storage section 1508 as needed.

[0079] In particular, according to embodiments disclosed in this invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 1509, and / or installed from removable medium 1511. When the computer program is executed by central processing unit (CPU) 1501, it performs the functions defined above in the system of this invention.

[0080] It should be noted that the computer-readable medium shown in this invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0081] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0082] The modules described in the embodiments of the present invention can be implemented in software or hardware. The described modules can also be housed in a processor; for example, a processor can be described as including a connection module, a communication module, a test signal generation module, and a test signal monitoring module. The names of these modules do not necessarily limit the module itself; for example, a connection module can also be described as "a module connected to an optical module."

[0083] In another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiments; or it may exist independently and not assembled into the device. The computer-readable medium carries one or more programs, which, when executed by the device, cause the device to perform the network device verification method of the first aspect, including: Connect to the optical module via the optical module interface; Send a write request to the optical module through the optical module interface, and set the optical module to loopback mode according to the write request. Loopback mode is a mode in which the optical module receives any signal and returns the original signal directly without going through the signal conversion device. Send test signals to the optical module through the optical module interface, and receive test signals returned by the optical module; The returned test signal is compared with the sent test signal. If the comparison result meets the abnormal conditions, the network device is determined to be abnormal.

[0084] Alternatively, when one or more of the aforementioned programs are executed by the device, the device performs the network device verification method of the second aspect, including: Receive write requests sent by network devices, and set the optical module to loopback mode according to the write requests. Loopback mode is a mode in which the optical module receives any signal and returns the original signal directly without going through the signal conversion device. It receives test signals sent by network devices and returns test signals to network devices; the sent and returned test signals are used by network devices to determine whether they are abnormal.

[0085] Alternatively, when one or more of the aforementioned programs are executed by the device, the device performs a third-party network device link verification method, including: The first network device is tested using the method of any of the above embodiments; The second network device is tested using the method of any of the above embodiments; In response to the first network device and the second network device passing the verification, the first optical module connected to the first network device is connected to the second optical module connected to the second network device. The link between the first optical module and the second optical module is checked; if the link fails the check, the link is determined to be abnormal.

[0086] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A method for testing network devices, characterized in that, Applied to network devices, including: Connect to the optical module via the optical module interface; A write request is sent to the optical module through the optical module interface. The optical module is set to loopback mode according to the write request. Loopback mode is a mode in which the original signal is returned directly after receiving any signal without going through the signal conversion device. The test signal is sent to the optical module through the optical module interface, and the test signal returned by the optical module is received. The returned test signal is compared with the sent test signal. If the comparison result meets the abnormal conditions, the network device is determined to be abnormal.

2. The method according to claim 1, characterized in that, After connecting to the optical module via the optical module interface, the method further includes: The register data of the optical module is read through the optical module interface; Based on the register data, determine whether the optical module meets the following conditions: whether the data channel of the optical module is enabled; whether the optical module supports loopback mode. If any of the conditions are not met, the optical module is determined to be abnormal.

3. The method according to claim 1, characterized in that, Sending a write request to the optical module through the optical module interface, and setting the optical module to loopback mode according to the write request, includes: A write request is sent to the optical module through the optical module interface, and preset data is written to the optical module's register at the position corresponding to the loopback mode according to the write request; The data corresponding to the loopback mode in the register of the optical module is read through the optical module interface to verify whether the loopback mode is set successfully. If the loopback mode setting fails, the network device and / or optical module will be determined to be abnormal.

4. The method according to claim 1, characterized in that, The returned test signal is compared with the sent test signal. If the comparison result meets an abnormal condition, the network device is determined to be abnormal, including: The bit error rate is obtained by statistically analyzing the probability that the returned test signal is inconsistent with the sent test signal within a preset time period. In response to the bit error rate being greater than or equal to a preset threshold, the network device is determined to be abnormal.

5. A method for testing network devices, characterized in that, Applied to optical modules, including: Receive a write request sent by a network device, and set the optical module to loopback mode according to the write request. The loopback mode is a mode in which the optical module receives any signal and returns the original signal directly without going through a signal conversion device. The device receives a test signal sent by the network device and returns a test signal to the network device; the sent test signal and the returned test signal are used by the network device to determine whether it is abnormal.

6. A method for verifying network device links, characterized in that, include: The first network device is tested using the method described in any one of claims 1-5; The second network device is tested using the method described in any one of claims 1-5; In response to the first network device and the second network device passing the verification, the first optical module connected to the first network device is connected to the second optical module connected to the second network device. The link between the first optical module and the second optical module is inspected. In response to the link failing the inspection, the link is determined to be abnormal.

7. A network device for testing, characterized in that, include: Optical module interface, used to connect to optical modules; The communication module is used to send a write request to the optical module through the optical module interface, and set the optical module to loopback mode according to the write request. The loopback mode is a mode in which the optical module receives any signal and returns the original signal directly without going through the signal conversion device. A test signal generator is used to send test signals to the optical module through the optical module interface; A test signal detector is used to receive the test signal returned by the optical module, compare the returned test signal with the sent test signal, and determine the network device as abnormal in response to the comparison result meeting the abnormal conditions.

8. An optical module for testing network devices, characterized in that, include: The register module is used to receive write requests sent by network devices and set the optical module to loopback mode according to the write requests. The loopback mode is a mode in which the optical module receives any signal and returns the original signal directly without going through the signal conversion device. The loopback module is used to receive test signals sent by the network device and return test signals to the network device; the sent test signals and the returned test signals are used by the network device to determine whether it is abnormal.

9. A network device inspection system, characterized in that, include: Network equipment and optical modules, including: The network device is configured to connect to an optical module via an optical module interface; send a write request to the optical module via the optical module interface; set the optical module to loopback mode based on the write request; the loopback mode is a mode in which the received signal returns directly to the original signal without passing through a signal conversion device; send a test signal to the optical module via the optical module interface and receive a test signal returned by the optical module; compare the returned test signal with the sent test signal; and determine the network device as abnormal if the comparison result meets the abnormal conditions. The optical module is used to receive write requests sent by the network device, and to set the optical module to loopback mode according to the write requests. The loopback mode is a mode in which the optical module receives any signal and returns the original signal directly without going through a signal conversion device. The optical module also receives test signals sent by the network device and returns test signals to the network device. The sent test signals and returned test signals are used by the network device to determine whether it is abnormal.

10. An electronic device, characterized in that, include: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-6.

11. A computer-readable medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-6.

12. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-6.