Cabinet cable test method and device, electronic equipment and storage medium

By setting up a test switch in the cabinet, detecting and synchronizing the port status of the access switch, the cable connectivity and consistency testing is achieved, which solves the problems of high testing costs, inability to save real-time and inability to conduct consistency testing in the existing technology, and improves the testing efficiency and diversity.

CN120044441APending Publication Date: 2025-05-27TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311583551.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-24
Publication Date
2025-05-27

AI Technical Summary

Technical Problem

The prior art is expensive when conducting cabinet cable testing, the test results cannot be saved in real time, and consistency testing cannot be carried out.

Method used

By setting up the test switch in the cabinet, detecting the port status of the access switch, and synchronizing it with the test switch, triggering the corresponding test mode to achieve connectivity and consistency testing of the cable.

Benefits of technology

It reduces testing costs, improves testing efficiency, realizes connectivity and consistency testing of cables, and enhances the diversity of testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120044441A_ABST
    Figure CN120044441A_ABST
Patent Text Reader

Abstract

The invention provides a cable test method and device of a cabinet, electronic equipment and a storage medium. The method comprises the steps that port states of a plurality of access switches are detected, and the port states of the access switches are states of physical ports used for being connected with cables in the access switches; the port state of the test switch is synchronized with the port states of the multiple access switches, and the port state of the test switch is the state of a physical port used for being connected with a cable in the test switch; determining a current test mode corresponding to the synchronized port state, the current test mode being a test mode corresponding to the current port state; and executing a test operation corresponding to the current test mode to obtain a test result of the current test mode. According to the invention, the cable can be tested with low cost and high efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to computer network technology, and in particular, to a method, device, electronic device, and storage medium for testing cables of a cabinet. Background Art

[0002] In the prior art, a cable tester is used to test cables. Taking a direct attach copper cable (DAC) and an active optical cable (AOC) as examples, both ends of the DAC / AOC are modules, and the module plugging and unplugging life is generally 300 times. If a cable tester is used, since the life of the cable tester is 300 times without special design, for an access switch cluster that can connect 2000 servers, the number of tests required is greater than 4000 times, that is, more than 10 cable testers are required to complete the test, resulting in too high costs.

[0003] At the same time, although the cable tester can complete the connectivity test, the test cost is high, and the test results cannot be saved in real time. In addition, the cable tester cannot perform a consistency test. Summary of the Invention

[0004] Embodiments of the present application provide a method, device, electronic device, computer program product, and computer-readable storage medium for testing cables of a cabinet, which can replace a cable tester and test the cables in the cabinet in a low-cost and efficient manner.

[0005] The technical solution of the embodiments of the present application is implemented as follows:

[0006] Embodiments of the present application provide a method for testing cables of a cabinet, which is applied to a test switch. The test switch is arranged in the cabinet, and a plurality of access switches are also arranged in the cabinet and are respectively connected to the test switch through cables; the method includes:

[0007] Detect the port states of the plurality of access switches, where the port state of the access switch is the state of the physical port in the access switch for connecting the cable;

[0008] Synchronize the port state of the test switch with the port states of the plurality of access switches, where the port state of the test switch is the state of the physical port in the test switch for connecting the cable;

[0009] Determine the current test mode corresponding to the synchronized port state, where the current test mode is the test mode corresponding to the synchronized port state;

[0010] Execute a test operation corresponding to the current test mode to obtain a test result of the current test mode.

[0011] In the above solution, the method further includes:

[0012] Send the test result to the terminal through the access switch, so that the terminal displays the test result on the cable test page of the cabinet.

[0013] An embodiment of the present application provides a method for testing cables of a cabinet, which is applied to a terminal. The method includes:

[0014] Display the cable test page of the cabinet, where the cable test page includes a cable test control;

[0015] In response to a trigger operation on the cable test control, send a cable test command to multiple access switches in the cabinet, where the cable test command is used to trigger a test switch in the cabinet to execute a test operation corresponding to the current test mode to obtain a test result of the current test mode. The current test mode is a test mode corresponding to the current port states of the multiple access switches, and the test mode includes at least one of a consistency test mode and a connectivity test mode; and

[0016] Display the test result on the cable test page of the cabinet.

[0017] An embodiment of the present application provides a cable test device. The test switch is disposed in the cabinet, and multiple access switches are also disposed in the cabinet and are respectively connected to the test switch through cables. The device includes:

[0018] A status detection module, configured to detect the port states of the multiple access switches, where the port state of the access switch is the state of a physical port in the access switch used to connect the cable;

[0019] A status synchronization module, configured to synchronize the port state of the test switch with the port states of the multiple access switches, where the port state of the test switch is the state of a physical port in the test switch used to connect the cable;

[0020] A mode determination module, configured to determine a current test mode corresponding to the synchronized port state, where the current test mode is a test mode corresponding to the synchronized port state;

[0021] A result determination module, configured to execute a test operation corresponding to the current test mode to obtain a test result of the current test mode.

[0022] An embodiment of the present application provides a cable testing device for a cabinet, the device comprising:

[0023] A page display module, configured to display a cable testing page of the cabinet, wherein the cable testing page includes cable testing controls;

[0024] A command sending module, configured to, in response to a triggering operation on the cable testing controls, send a cable testing command to a plurality of access switches in the cabinet, wherein the cable testing command is used to trigger a test switch in the cabinet to execute a test operation corresponding to a current test mode, so as to obtain a test result of the current test mode, and the current test mode is a test mode corresponding to the current port states of the plurality of access switches, and the test mode includes at least one of a consistency test mode and a connectivity test mode; and

[0025] A result display module, configured to display the test result in the cable testing page of the cabinet.

[0026] An embodiment of the present application provides an electronic device, the electronic device comprising:

[0027] A memory, configured to store computer-executable instructions;

[0028] A processor, configured to, when executing the computer-executable instructions stored in the memory, implement the cable testing method for a cabinet provided by an embodiment of the present application.

[0029] An embodiment of the present application provides a computer-readable storage medium, storing a computer program or computer-executable instructions, which are used to implement the cable testing method for a cabinet provided by an embodiment of the present application when being executed by a processor.

[0030] An embodiment of the present application provides a computer program product, comprising a computer program or computer-executable instructions, and when the computer program or computer-executable instructions are executed by a processor, the cable testing method for a cabinet provided by an embodiment of the present application is implemented.

[0031] The embodiment of the present application has the following beneficial effects:

[0032] By using a test switch to replace a cable tester and triggering a test mode corresponding to the synchronized port state by synchronizing the port states with the access switches in the cabinet, on the one hand, since the plugging and unplugging life of the physical ports of the test switch is much higher than that of the tester, the test cost is reduced; on the other hand, different test modes of the cable are tested through the diversity of the port states. Description of the Drawings

[0033] Figure 1 is a schematic diagram of a cable tester in the prior art;

[0034] Figure 2 It is a schematic architecture diagram of the cable testing system 100 provided by an embodiment of the present application;

[0035] Figure 3A It is a schematic diagram of the on-site implementation page of the cable testing applet provided by an embodiment of the present application;

[0036] Figure 3B It is a schematic diagram of the task list page of the cable testing applet provided by an embodiment of the present application;

[0037] Figure 3C It is a schematic diagram of the cable testing page of the cabinet of the cable testing applet provided by an embodiment of the present application;

[0038] Figure 4 It is a schematic diagram of the test environment provided by an embodiment of the present application;

[0039] Figure 5 It is a schematic diagram of the cable connection in the cabinet provided by an embodiment of the present application;

[0040] Figure 6 It is a schematic diagram of the cable connection method provided by an embodiment of the present application;

[0041] Figure 7A It is a schematic structural diagram of the test switch 400 provided by an embodiment of the present application;

[0042] Figure 7B It is a schematic structural diagram of the terminal 700 provided by an embodiment of the present application;

[0043] Figure 8A It is a schematic diagram of the first process of the cable testing method for the cabinet provided by an embodiment of the present application;

[0044] Figure 8B It is a schematic diagram of the second process of the cable testing method for the cabinet provided by an embodiment of the present application;

[0045] Figure 8C It is a schematic diagram of the third process of the cable testing method for the cabinet provided by an embodiment of the present application;

[0046] Figure 8D It is a schematic diagram of the fourth process of the cable testing method for the cabinet provided by an embodiment of the present application;

[0047] Figure 8E It is a schematic diagram of the fifth process of the cable testing method for the cabinet provided by an embodiment of the present application;

[0048] Figure 9A It is a schematic diagram of the sixth process of the cable testing method for the cabinet provided by an embodiment of the present application;

[0049] Figure 9BIt is the seventh process schematic diagram of the cable testing method for the cabinet provided by the embodiments of the present application;

[0050] Figure 9C It is the eighth process schematic diagram of the cable testing method for the cabinet provided by the embodiments of the present application;

[0051] Figure 10 It is the schematic diagram of the calculation rule provided by the embodiments of the present application;

[0052] Figure 11 It is the schematic diagram of the consistency judgment provided by the embodiments of the present application;

[0053] Figure 12 It is the schematic diagram of the principle of cable testing provided by the embodiments of the present application;

[0054] Figure 13 It is the hierarchical architecture diagram of the network model provided by the embodiments of the present application;

[0055] Figure 14 It is the schematic diagram of the principle of port state switching provided by the embodiments of the present application. Detailed implementation manners

[0056] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on the present application. All other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the scope of protection of the present application.

[0057] In the following description, reference is made to "some embodiments", which describe a subset of all possible embodiments. However, it can be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments, and can be combined with each other without conflict.

[0058] If similar descriptions such as "first / second" appear in the application documents, the following explanation is added. In the following description, the terms "first\second\third" involved are only used to distinguish similar objects, and do not represent a specific order for the objects. It can be understood that "first\second\third" can be interchanged with a specific order or sequence when permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0059] Unless otherwise defined, all technical and scientific terms used in the embodiments of the present application have the same meaning as commonly understood by those of ordinary skill in the technical field to which the present application belongs. The terms used in the embodiments of the present application are only for the purpose of describing the embodiments of the present application, and are not intended to limit the present application.

[0060] Before further elaborating on the embodiments of the present application, the nouns and terms involved in the embodiments of the present application are described. The nouns and terms involved in the embodiments of the present application are applicable to the following explanations.

[0061] 1) Access switch. In a three-layer network architecture, in order to enable different levels of the network to assume different responsibilities and ensure the normal operation of the network, each layer of the network has its own hierarchical structure, role, and certain specific functions. For example, the role of the access layer is mainly to allow end-users to connect to the network, solve the mutual access requirements between adjacent users, and provide them with sufficient bandwidth.

[0062] As a physical entity (core device) of the access layer, the access switch is located at the network boundary and acts as the network interface for end-users in the network. Its main role is to provide network connections for end-users. Therefore, access switches usually have the characteristics of low cost, high port density, and plug-and-play, as well as user information collection and user management functions, such as Media Access Control (MAC) address, Internet Protocol (IP) address, address authentication, user authentication, etc.

[0063] 2) Test switch. A switch used to test the cables in the cabinet, which can be of the same or different models as the access switch set in the cabinet. The test switch can be set at the position in the cabinet originally used to set up the server (of course, the server at this position needs to be removed in advance). After the test is completed, the test switch can be removed and the server can be reinstalled at this position.

[0064] 3) Pseudo-random code, also known as pseudo-random sequence, is an artificially generated periodic sequence that can be used as a signal source in digital communication to detect the probability of bit errors in a digital communication system, that is, the bit error rate. The so-called "random code" means that no matter how long this code is, there will be no cyclic phenomenon, while the "pseudo-random code" will start to cycle from its first bit when the code length reaches a certain level. Since the cycle length that appears is quite large, for example, CDMA uses a pseudo-random code of 42, and the probability of repetition is one in 4.4 trillion, so it can be regarded as a random code for use.

[0065] 4) Cable tester. An instrument used to test the performance of cables. Cables are a general term for items such as optical fibers, wires, and cables used for optoelectronic signal transmission. Since cables are mainly used for signal transmission, certain requirements are imposed on their physical and electrical properties. During use, various tests need to be carried out on them to detect whether their performance is normal and meets the usage requirements. The general test contents include open circuit, short circuit, wiring error, insulation performance, withstand voltage performance, attenuation, and crosstalk, etc.

[0066] 5) Direct Attach Cable (DAC), also known as Twinax copper cable or high-speed cable, is a cable assembly with fixed length and fixed connectors at both ends. Direct Attach Cable includes active and passive types. Active DAC copper cable has built-in amplifier and equalizer to improve signal quality, but the cost is relatively high. In most cases, when the transmission distance is less than 5 meters, you can choose to use passive DAC copper cable, and when the transmission distance is greater than 5 meters, choose active DAC copper cable.

[0067] 6) Active Optical Cable (AOC) refers to a communication cable that requires external energy to convert electrical signals into optical signals, or convert optical signals into electrical signals during the communication process. The optical transceivers at both ends of the cable provide photoelectric conversion and optical transmission functions.

[0068] 7) Consistency: If the theoretical port number used to connect the test switch in the access switch set at the machine position obtained according to the port calculation rule is consistent with the physical port number of the physical port used by the test switch to connect to the access switch, then the cable wiring situation obtained by the port calculation rule is considered to be consistent with the on-site wiring.

[0069] 8) Connectivity: Calculate the bit error rate in the process of sending pseudo-random code streams to multiple access switches and receiving pseudo-random code streams returned by the access switches. When the bit error rate is less than a preset bit error rate threshold, the cable is considered to have connectivity.

[0070] 9) Machine position: The space in a cabinet that can be used to mount the first server is called the first machine position, and the remaining machine positions are similar. The machine position here can also be the location for placing the server.

[0071] The prior art uses a cable tester to test the cables in the cabinet, see Figure 1 , Figure 1 This is a schematic diagram of a cable tester in the prior art. Taking direct attach copper cable (DAC) and active optical cable (AOC) as examples, both ends of DAC / AOC are modules, and the plug-in life of the module is generally 300 times. If a cable tester is used, since the life of the cable tester is 300 times without special design, for an access switch cluster that can connect 2,000 servers, the number of tests required is more than 4,000 times, that is, more than 10 cable testers are needed to complete the cable test in each cabinet in the computer room, and the testing cost is too high.

[0072] Meanwhile, although the cable tester can complete the connectivity test, the test cost is high, and the test results cannot be saved in real time. In addition, the cable testers of the existing technologies cannot perform consistency tests.

[0073] Based on the above analysis, the applicant found that the cable testing methods of the cabinets in the existing technologies cannot test the cables at low cost and efficiently. In view of the above problems, the embodiments of the present application provide a cable testing method for a cabinet, which can replace the cable tester to test the cables at low cost and efficiently.

[0074] The embodiments of the present application provide a cable testing method, device, electronic device, computer-readable storage medium and computer program product for a cabinet, which can replace the cable tester to test the cables at low cost and efficiently. The following describes the exemplary applications of the electronic devices for cable testing provided by the embodiments of the present application. Next, the exemplary applications when the electronic device is implemented as a test switch will be described.

[0075] See Figure 2 , Figure 2 which is a schematic diagram of the architecture of the cable testing system 100 provided by the embodiments of the present application. To support a cable testing application, the terminal 700 is connected to the access switch 200 and the access switch 300 through the network 600. The test switch 400 is used to replace the server 500 (that is, the test switch 400 is set at the position where the server 500 was originally set in the cabinet) and is connected to the access switch 200 and the access switch 300. The network 300 can be a wide area network, a local area network, or a combination of both.

[0076] The test switch 400 is a switch used to test the cables and will be removed to set the server after the test is completed. The access switch 200 is a switch fixed in the cabinet and is used to provide network services for the server.

[0077] The terminal 700 can be used to run an instant messaging client, which includes a small program for cable testing. It is displayed on the graphical interface 710. The test is triggered through the small program, and test commands are sent to the access switch 200 and the access switch 300. After receiving the test results, they are displayed in the small program. The test switch 400 is used to synchronize the port states of the access switch 200 and the access switch 300, switch to the corresponding test mode according to the port states, and execute the test operations corresponding to the test mode to obtain the test results, and send the test results to the terminal 700 through the access switch 200 and the access switch 300 for display in the small program.

[0078] In some embodiments, see Figure 3A 、 Figure 3B and Figure 3C , Figure 3AIt is a schematic diagram of the on-site implementation page of the cable testing mini-program provided by an embodiment of the present application. Figure 3B It is a schematic diagram of the task list page of the cable testing mini-program provided by an embodiment of the present application. Figure 3C It is a schematic diagram of the cable testing page of the cabinet of the cable testing mini-program provided by an embodiment of the present application, all displayed on the graphical interface 710 of the terminal 700.

[0079] In response to a trigger operation on the cable acceptance control 801 in the on-site implementation page, display Figure 3B the cable items to be accepted, and the item details control 802 in each item. In response to a trigger operation on the item details control 802 of any cable item to be accepted, display Figure 3C the cable testing page of the cabinet corresponding to the cable item to be accepted in Figure 3C , as well as the connectivity test control 803, the consistency test control 804, and the reset control 805. In Figure 3C , in response to a trigger operation on different cable testing controls (such as the consistency test control 804 or the connectivity test control 803), send the corresponding test command to the access switch, synchronize the status with the test switch and the access switch, switch to the corresponding test mode, and obtain the test result of this test mode. In response to a trigger operation on the reset control 805, clear the test result to facilitate retesting the device.

[0080] In some embodiments, referring to Figure 4 , Figure 4 It is a schematic diagram of the test environment of the cabinet provided by an embodiment of the present application. Multiple servers and 2 access switches (assumed to be the switch 200 and the access switch 300 above) are set in the cabinet. The access switch 200 or the access switch 300 can be respectively provided with multiple ports. Taking each access switch having 48 ports as an example, each access switch can be connected to 48 servers, and the 48 servers can be set in 1 or more cabinets. Figure 4 It shows the layout after the servers are installed on the rack. The access switch 200 or the access switch 300 is placed in the middle of the servers, and 48 cables are connected to 48 servers. The access switch 200 or the access switch 300 can be placed at the head of the row, the end of the row, the top of the cabinet, the middle of the cabinet, etc.

[0081] In some embodiments, referring to Figure 5 , Figure 5 It is a schematic diagram of the cable connection in the cabinet provided by an embodiment of the present application. In Figure 5 , replace the original server 500 in the cabinet with the test switch 400, and place it at different positions and connect it to the access switch 200 or the access switch 300 respectively, so as to complete the cable test.

[0082] In some embodiments, referring to Figure 6 , Figure 6 is a schematic diagram of the cable connection method provided by the embodiments of the present application. In Figure 6 , the theoretical port numbers used to connect the test switch 400 in the access switches 200 or 300 set at different positions are shown.

[0083] Referring to Figure 7A , Figure 7A is a schematic structural diagram of the test switch 400 provided by the embodiments of the present application. The test switch 400 shown in Figure 7A includes: at least one processor 410, a memory 430, and at least one network interface 420. Each component in the test switch 400 is coupled together through a bus system 440. It can be understood that the bus system 440 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 440 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clear illustration, in Figure 7A all kinds of buses are labeled as the bus system 440.

[0084] The processor 410 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor or any conventional processor, etc.

[0085] The memory 430 can be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard disk drives, optical disk drives, etc. The memory 430 optionally includes one or more storage devices that are physically located away from the processor 410.

[0086] The memory 430 includes volatile memory or non-volatile memory, and can also include both volatile and non-volatile memory. The non-volatile memory can be a read-only memory (ROM, Read Only Memory), and the volatile memory can be a random access memory (Rand om Access Memory, RAM). The memory 430 described in the embodiments of the present application is intended to include any suitable type of memory.

[0087] In some embodiments, the memory 430 is capable of storing data to support various operations. Examples of these data include programs, modules, and data structures, or subsets or supersets thereof, which are described below by way of example.

[0088] The operating system 431 includes system programs for processing various basic system services and performing hardware-related tasks, such as the framework layer, the core library layer, the driver layer, etc., for implementing various basic services and processing hardware-based tasks;

[0089] The network communication module 432 is used to reach other electronic devices via one or more (wired or wireless) network interfaces 420. Exemplary network interfaces 420 include: Bluetooth, Wireless Fidelity (WiFi), and Universal Serial Bus (USB), etc.;

[0090] In some embodiments, the device provided by the embodiments of the present application can be implemented in software. Figure 7A Shown is a cable testing device 433 stored in the memory 430, which can be software in the form of a program and a plug-in, etc., including the following software modules: a status detection module 4331, a status synchronization module 4332, a mode determination module 4333, and a result determination module 4334. These modules are logical, so they can be combined arbitrarily or further split according to the functions to be implemented. The functions of each module will be described below.

[0091] See Figure 7B , Figure 7B is a schematic structural diagram of a terminal 700 provided by the embodiments of the present application. Figure 7B The shown terminal 700 includes: at least one processor 710, a memory 750, at least one network interface 720, and a user interface 730. Each component in the terminal 700 is coupled together through a bus system 740. It can be understood that the bus system 740 is used to realize the connection and communication between these components. In addition to including a data bus, the bus system 740 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clear illustration, in Figure 7B all kinds of buses are labeled as the bus system 740.

[0092] The processor 710 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a Digital Signal Processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor or any conventional processor, etc.

[0093] The user interface 730 includes one or more output devices 731 enabling the presentation of media content, including one or more speakers and / or one or more visual display screens. The user interface 730 also includes one or more input devices 732, including user interface components facilitating user input, such as a keyboard, a mouse, a microphone, a touch screen display, a camera, and other input buttons and controls.

[0094] The memory 750 can be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid state memory, hard disk drives, optical disc drives, etc. The memory 750 optionally includes one or more storage devices physically located away from the processor 710.

[0095] The memory 750 includes volatile memory or non-volatile memory, and may also include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), and the volatile memory can be random access memory (RAM). The memory 750 described in the embodiments of the present application is intended to include any suitable type of memory.

[0096] In some embodiments, the memory 750 is capable of storing data to support various operations. Examples of such data include programs, modules, and data structures, or subsets or supersets thereof, which are exemplarily described below.

[0097] The operating system 751 includes system programs for handling various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and handling hardware-based tasks;

[0098] The network communication module 752 is used to reach other electronic devices via one or more (wired or wireless) network interfaces 720. Exemplary network interfaces 720 include: Bluetooth, wireless fidelity (WiFi), and universal serial bus (USB), etc.;

[0099] The presentation module 753 is used to enable the presentation of information (such as a user interface for operating peripheral devices and displaying content and information) via one or more output devices 731 associated with the user interface 730 (such as a display screen, a speaker, etc.);

[0100] The input processing module 754 is used to detect and translate one or more user inputs or interactions from one of the one or more input devices 732.

[0101] In some embodiments, the state prediction device of the mobile terminal provided by the embodiments of the present application may be implemented in software. Figure 7B FIG. Figure 7B shows a state prediction device 755 of the mobile terminal stored in the memory 750, which may be software in the form of a program and a plug-in, etc., including the following software modules: a page display module 7551, a command sending module 7552, and a result display module 7553. These modules are logical, so they can be combined arbitrarily or further split according to the functions to be implemented. The functions of each module will be described below.

[0102] In other embodiments, the cable testing device provided by the embodiments of the present application may be implemented in hardware. As an example, the cable testing device provided by the embodiments of the present application may be a processor in the form of a hardware decoding processor, which is programmed to execute the cable testing method of the cabinet provided by the embodiments of the present application. For example, a processor in the form of a hardware decoding processor may employ one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Programmable Logic Devices (PLDs), Complex Programmable Logic Devices (CPLDs), Field-Programmable Gate Arrays (FPGAs), or other electronic components.

[0103] In some embodiments, the terminal may implement the cable testing method of the cabinet provided by the embodiments of the present application by running various computer-executable instructions or computer programs. For example, the computer-executable instructions may be commands at the microprogram level, machine instructions, or software instructions. The computer program may be a native program or a software module in the operating system; it may be a local (Native) application (APPlication, APP), that is, a program that needs to be installed in the operating system to run, such as a cable testing APP; or it may be a small program that can be embedded in any APP, that is, a program that only needs to be downloaded into the browser environment to run. In short, the above computer-executable instructions may be instructions in any form, and the above computer programs may be application programs, modules, or plug-ins in any form.

[0104] The cable testing method of the cabinet provided by the embodiments of the present application will be described in conjunction with the exemplary applications and implementations of the electronic devices provided by the embodiments of the present application.

[0105] See Figure 8A , Figure 8AFIG. 0 is a first process schematic diagram of the cable testing method for the cabinet provided by the embodiment of the present application, which is applied to test the switch and will be described in conjunction with Figure 8A the steps shown.

[0106] In step 101, the port states of multiple access switches are detected, where the port state of the access switch is the state of the physical port in the access switch for connecting the cable.

[0107] In some embodiments, in a three-layer network architecture, in order to enable different layers of the network to share different responsibilities and ensure the normal operation of the network, each layer of the network has its own hierarchical structure, role, and certain specific functions. For example, the role of the access layer is mainly to allow end-users to connect to the network, solve the mutual access requirements between adjacent users, and provide them with sufficient bandwidth.

[0108] As a physical entity (core device) of the access layer, the access switch is located at the network boundary and acts as the network interface of the end-user in the network. Its main role is to provide network connections for end-users. Therefore, the access switch usually has the characteristics of low cost, high port density, and plug-and-play, as well as user information collection and user management functions, such as MAC address, IP address, address authentication, and user authentication.

[0109] In step 102, the port state of the test switch is synchronized with the port states of multiple access switches, where the port state of the test switch is the state of the physical port in the test switch for connecting the cable.

[0110] In some embodiments, the port state of the access switch includes a first port state and a second port state.

[0111] In some embodiments, refer to Figure 8B , Figure 8B FIG. 24 is a second process schematic diagram of the cable testing method for the cabinet provided by the embodiment of the present application. Figure 8A Step 102 of " Figure 8B Synchronize the port state of the test switch with the port states of multiple access switches" can be implemented through Figure 8B steps 1021 to 1022 of Figure 8B , which will be specifically described below.

[0112] In step 1021, in response to the port states of multiple access switches all being the first port state, set the port state of the test switch to the first port state.

[0113] First, the network communication model of the access switch and the test switch will be described below. Taking the OSI seven-layer network model as an example, the lower two layers are the physical layer and the data link layer. The upper layer depends on the lower layer, and the lower layer provides services for the upper layer, that is, the data link layer communication depends on the physical layer.

[0114] For example, refer to Figure 13 , Figure 13 which is a hierarchical architecture diagram of the network model provided by an embodiment of the present application. In Figure 13 , the physical layer consists of three layers: Physical Coding Sublayer (PCS), Physical Medium Attachment (PMA), and Physical Media Dependent (PMD).

[0115] There are various status identifiers in the physical layer: including but not limited to the following status identifiers in the PMD layer: SIGNAL_DETECT (hereinafter referred to as SD), CDR_LOCK; the following status identifiers in the PCS layer: LINK, DESKEW, HI_BER, REMOTE_FAULT, LOCAL_FAULT, AM_LOCK, AMPS_LOCK, BLOCK_LOCK, etc. An embodiment of the present application selects the status identifier (SD) of the PMD layer and the status identifier (LINK) of the PCS layer as examples to reflect the port status. The status identifier of the PMD layer is not limited to SD, and it can also be CDR_LOCK; similarly, the status identifier of the PCS layer is not limited to LINK, and it can also be other status identifiers of the PCS layer. The following content takes SD and LINK as examples.

[0116] For example, the first port status can be SD = 1 and LINK = 0, indicating that the physical layer of the access switch is open at this time, but the layers above the PCS layer, such as the data link layer, are in a closed state. At this time, the test switch synchronizes the status with the access switch, and also sets the port status to SD = 1 and LINK = 0.

[0117] In step 1022, in response to the port status of some access switches among multiple access switches being the first port status and the port status of another part of the access switches being the second port status, the port status of the test switch is set to the second port status.

[0118] In some embodiments, when the link quality of a single port is poor, the first port status may also occur when the access switch has the cable plugged in. To avoid such a situation, the test switch will only set the port status to the first port status when it detects that the port status of all the connected ports of the access switch is the first port status. Since the physical layer of the unconnected ports is in a closed state, the status detection cannot be performed; when only some port statuses are the first port status, the test switch sets the port status to the second port status.

[0119] For example, the second port status can be SD = 1, LINK = 1, indicating that the physical layer of the access switch is open and the link layer is also open at this time. At this time, the test switch synchronizes the status with the access switch and also sets the port status to SD = 1, LINK = 1.

[0120] In some embodiments, the port statuses of multiple access switches are used to characterize the following information: whether the physical layer of the physical port for connecting a cable in the access switch is in an open state; whether the link layer of the physical port for connecting a cable in the access switch is in an open state; wherein, whether the physical layer is in an open state is achieved by physically plugging and unplugging the cable to the access switch, and whether the link layer is in an open state or a closed state is achieved by remotely controlling the access switch through a terminal.

[0121] In some embodiments, the port status includes a first port status and a second port status, and the test mode includes a consistency test mode and a connectivity test mode; the first port status characterizes that the physical layer of the physical port for connecting a cable in the test switch is in an open state, and the link layer of the physical port for connecting a cable in the test switch is in a closed state, and the first port status corresponds to the connectivity test mode; the second port status characterizes that the physical layer of the physical port for connecting a cable in the test switch is in an open state, and the link layer of the physical port for connecting a cable in the test switch is in an open state, and the second port status corresponds to the consistency test mode.

[0122] For example, continue to refer to Figure 13 , the Link Layer Discovery Protocol (LLDP) can be used to test consistency, and the bit error rate of the Pseudo-Random Binary Sequence (PRBS) can be used to test connectivity. Among them, the connectivity test based on the PRBS bit error rate requires a signal on the port, but there should be no data flow on the data link layer. Therefore, the PMD layer and the PM A layer need to be able to communicate normally, that is, SD = 1, but the PCS and upper layers are closed to avoid the influence of the upper layer data flow on the test, that is, LINK = 0. That is to say, when SD = 1, LINK = 0 (the first port status), it corresponds to the connectivity test mode; the consistency test based on LLDP performs data transmission on the link layer. Therefore, the data link layer needs to work normally, that is, LINK = 1. Also, because the physical layer provides services for the data link layer, the physical layer also needs to be in an open state, that is, SD = 1. That is to say, when SD = 1, LINK = 1 (the second port status), it corresponds to the consistency test mode.

[0123] In some embodiments, the port state further includes a third port state, which is the state of the physical port of the access switch when the access switch is not connected to the cable. The third port state indicates that the physical layer of the physical port used to connect the cable in the test switch is in the off state, and the link layer of the physical port used to connect the cable in the test switch is in the off state.

[0124] For example, the third port state can be SD = 0, LINK = 0. At this time, it means that the port of the access switch is not connected to the cable, and the test switch does not perform testing. Then, no data stream is generated at the physical layer, that is, the physical layer is in the off state. Since the data link layer is the upper layer of the physical layer, the data link layer is also in the off state. Among them, whether the physical layer is turned on, that is, the value of SD, is determined by whether the port is plugged with a cable. When the port is connected to the cable, SD = 1, indicating that the physical layer is turned on; when the cable is unplugged, SD = 0, indicating that the physical layer is turned off. Whether the link layer is turned on is controlled by the applet in the terminal by sending a test command. When the terminal sends a test command, LINK = 1, indicating that the link layer is turned on; when the terminal ends the test, LINK = 0, indicating that the link layer is turned off.

[0125] In some embodiments, to switch from the third port state to the first port state, it is necessary to insert a cable into the port and keep both the physical layer and the link layer of the port in the on state; to switch from the third port state to the second port state, it is necessary to insert a cable into the port and keep the physical layer of the port on but the link layer off; to switch from the first port state to the second port state, it is necessary to keep the physical layer on but turn off the link layer; to switch from the second port state to the first port state, it is necessary to turn on the link layer; to switch from the first port state or the second port state to the third port state, it is necessary to unplug the cable. Without a cable connected to the port, the physical layer will automatically turn off. Since the link layer is the upper layer of the physical layer, when the physical layer is turned off, the link layer will also turn off.

[0126] For example, see Figure 14 , Figure 14It is a schematic diagram of the principle of port status switching provided by an embodiment of the present application. When no cable is connected to the test switch, SD = 0 and LINK = 0 at this time, and no test is performed at this time, which belongs to the third port status, that is, the default state; when the test switch detects that the port status of the access switch has switched to the second port status, SD = 1 and LINK = 1 at this time, synchronize with the access switch, and switch the test mode to the consistency test mode to perform the consistency test; when the test switch detects that the port status of the access switch has switched to the first port status SD = 1 and LINK = 0, synchronize with the access switch, and switch the test mode to the connectivity test mode to perform the connectivity test; when the cable is unplugged, it is determined that the test is over, no further test is performed, and the port status is adjusted to the third port status SD = 0 and LINK = 0.

[0127] In the embodiment of the present application, through physical plugging and unplugging operations and terminal remote control, the transformation of the port status is realized, so that different test modes can be automatically switched, which is convenient for corresponding tests on different performances of the cable.

[0128] Continue to refer to Figure 8A In step 103, determine the current test mode corresponding to the synchronized port status, where the current test mode is the test mode corresponding to the synchronized port status.

[0129] In some embodiments, the first port status corresponds to the connectivity test mode, and the second port status corresponds to the consistency test mode.

[0130] Exemplarily, when SD = 1 and LINK = 0, the test switch enters the connectivity test mode; when SD = 1 and LINK = 1, the test switch enters the consistency test mode.

[0131] In the embodiment of the present application, the cable is tested by the test switch. Only by changing the port status can the corresponding test be completed, which improves the test efficiency. Both the consistency test and the connectivity test can be performed, increasing the diversity of the test.

[0132] In step 104, perform the test operation corresponding to the current test mode to obtain the test result of the current test mode.

[0133] In some embodiments, refer to Figure 8C , Figure 8C It is the third process schematic diagram of the cable test method for the cabinet provided by the embodiment of the present application. Figure 8A Step 104 of Figure 8C can be implemented by steps 1041A to 1043A of

[0134] In step 1041A, in response to the current test mode being the consistency test mode, a virtual port number in the test switch for connecting to the access switch is determined.

[0135] In some embodiments, the virtual port number is a theoretical port number for connecting to a test switch in an access switch disposed on a machine position obtained according to a port calculation rule.

[0136] For example, the space in a cabinet available for mounting the first server is called the first rack position, and the remaining rack positions are similar. The rack position here can also be a location for placing a server.

[0137] In some embodiments, when the number of access switches is two, the virtual port number includes a first port number and a second port number corresponding to the two access switches respectively.

[0138] In some embodiments, when the total number of slots in the cabinet is less than or equal to the maximum access quantity of the test switch, one test switch may be provided in the cabinet, and when the total number of slots in the cabinet is greater than the maximum access quantity of the test switch, multiple test switches may be provided in the cabinet. The maximum access quantity is determined by the number of ports of the test switch.

[0139] For example, when the total number of machine positions in the cabinet is greater than the maximum access capacity of the test switch, the ratio of the total number of machine positions in the cabinet to the maximum access capacity of the test switch is determined, and the ratio is rounded up as the number of test switches that need to be set in the cabinet. For example: if the total number of machine positions in the cabinet is 56 and the maximum access capacity of the test switch is 20, then the number of test switches that need to be set in the cabinet is 3.

[0140] In some embodiments, in most cases, the total number of slots in the cabinet will not exceed twice the maximum access capacity of the test switch, so generally only two test switches are set. If the total number of slots in the cabinet exceeds twice the maximum access capacity of the test switch, the calculation rules for the virtual port numbers of other numbers of test switches can be obtained by analogy according to the calculation rules for the virtual port numbers of one or two test switches described below.

[0141] In some embodiments, see Figure 8D , Figure 8D This is a fourth process diagram of the cable testing method for a cabinet provided in an embodiment of the present application. Figure 8C Step 1041A of "determining the virtual port number in the test switch for connecting to the access switch" can be accomplished by Figure 8D Steps 1041A1 to 1041A3 are implemented as described in detail below.

[0142] In step 1041A1, the slot number of the current slot of the test switch in the cabinet is determined.

[0143] In some embodiments, the position in the cabinet where the test switch is currently set (i.e., the current position) can be any one, that is, the current position where the test switch is set can be variable, and the position number can be variable. When the current position changes, the corresponding position number also changes accordingly.

[0144] In step 1041A2, when there is one test switch set in the cabinet, twice the position number is used as the first port number of the test switch, and the port number immediately following the first port number is used as the second port number of the test switch.

[0145] Exemplarily, refer to Figure 10 , Figure 10 which is a schematic diagram of the calculation rule provided by the embodiments of the present application. For example, the total number of positions is 7, and the maximum access amount of the test switch is 8. At this time, the total number of positions is less than the maximum access amount of the test switch. Therefore, only one test switch is needed. When the position number is 1, the first port number is 2, and the second port number is 1.

[0146] In step 1041A3, when there are two test switches set in the cabinet, in response to the position number being less than or equal to half of the total number of positions, twice the position number is used as the first port number of the first test switch, and the port number immediately following the first port number is used as the second port number of the first test switch; in response to the position number being greater than half of the total number of positions, the difference between the position number and half of the total number of positions is determined, and twice the difference is used as the first port number of the second test switch, and the port number immediately following the first port number is used as the second port number of the second test switch.

[0147] In some embodiments, when the total number of positions is odd, half of the total number of positions is rounded up.

[0148] Exemplarily, continue to refer to Figure 10 , for example, the total number of positions is 15, and the maximum access amount of the test switch is 8. At this time, the total number of positions is greater than the maximum access amount of the test switch. Therefore, two test switches are needed. Half of the total number of positions rounded up is 8. When the position number is equal to 3, the first port number of the first test switch is 6, and the second port number of the first test switch is 5.

[0149] Exemplarily, continue to refer to Figure 10 , for example, the total number of positions is 15, and the maximum access amount of the test switch is 8. At this time, the total number of positions is greater than the maximum access amount of the test switch. Therefore, two test switches are needed. Half of the total number of positions rounded up is 8. When the position number is equal to 10, the first port number of the second test switch is 4, and the second port number of the second test switch is 3.

[0150] Continue to refer toFigure 8C In step 1042A, the virtual port number is compared with the physical port number of the physical port used by the test switch to connect to the access switch, where the physical port of the test switch is used to connect to the access switch set at the cabinet position through a cable.

[0151] Exemplarily, refer to Figure 11 , Figure 11 is a schematic diagram of consistency judgment provided by an embodiment of the present application. In Figure 11 , it is determined whether the virtual port number determined according to the calculation rule is consistent with the physical port number obtained based on LLDP.

[0152] In step 1043A, in response to the virtual port number being the same as the physical port number, it is determined that the test results of the consistency test mode are that the cables respectively connected by multiple access switches are consistent.

[0153] In some embodiments, when the virtual port number is the same as the physical port number, it means that the virtual port number used by the test switch to connect to the access switch calculated according to the port calculation rule is consistent with the real physical port number during the on-site wiring process when the test switch is connected to the access switch, that is, the virtual wiring method obtained according to the port calculation rule is consistent with the on-site wiring method, that is, it has consistency.

[0154] Exemplarily, continue to refer to Figure 11 , if the virtual port number and the physical port number are consistent, it is considered that the plan obtained through the calculation rule (cable connection according to the virtual port number) is consistent with the on-site wiring (cable connection according to the physical port number).

[0155] The embodiment of the present application obtains neighbor information through the LLDP protocol, thereby judging whether the port numbers of the access switches and the test switch connected to different positions are consistent with the on-site wiring, reducing the test cost and enhancing the test efficiency.

[0156] In some embodiments, refer to Figure 8E , Figure 8E is the fifth process schematic diagram of the cable test method for the cabinet provided by the embodiment of the present application. Figure 8A Step 104 of Figure 8E can also be implemented through steps 1041B to 1046B of

[0157] In step 1041B, in response to the current test mode being the connectivity test mode, receive the pseudo-random code stream sent by the access switch.

[0158] In some embodiments, the pseudo-random code, also known as the pseudo-random sequence, is an artificially generated periodic sequence that can be used as a signal source in digital communication to detect the probability of error codes in a digital communication system, i.e., the bit error rate. The so-called "random code" means that there will be no cyclic phenomenon no matter how long the code is, while the "pseudo-random code" will start to cycle from its first bit when the code length reaches a certain degree. Since the cycle length that appears is quite large, for example, CDMA uses a pseudo-random code of 42, and the probability of repetition is one in 4.4 trillion, so it can be used as a random code.

[0159] In step 1042B, a pseudo-random code stream is sent to multiple access switches.

[0160] In some embodiments, the PRBS technology can be used to generate a PRBS code stream, which is packet-sent and received on the CES service channel.

[0161] In step 1043B, the number of error bits and the total number of bits of the pseudo-random code stream in the receiving process and the sending process are counted.

[0162] In step 1044B, the ratio of the number of error bits to the total number of bits is determined.

[0163] In some embodiments, the ratio of the number of error bits to the total number of bits is also called the bit error rate, which refers to the probability of error when binary data bits are transmitted and is an index to measure the transmission reliability of a data communication system under normal working conditions.

[0164] In step 1045B, in response to the ratio being less than a preset bit error rate threshold, it is determined that the test result of the current test mode is that the cable between the access switch and the test switch has connectivity.

[0165] For example, if the ratio of the number of error bits to the total number of bits is 0.17 and the preset bit error rate threshold is 0.3, it is considered that the cable between the access switch and the test switch has connectivity.

[0166] In step 1046B, in response to the ratio being greater than a preset bit error rate threshold, it is determined that the test result of the current test mode is that the cable between the access switch and the test switch does not have connectivity.

[0167] For example, if the ratio of the number of error bits to the total number of bits is 0.66 and the preset bit error rate threshold is 0.3, it is considered that the cable between the access switch and the test switch does not have connectivity.

[0168] In some embodiments, after step 104 is executed, the test result is sent to the terminal through the access switch so that the terminal can display the test result on the cable test page of the cabinet.

[0169] In some embodiments, after the test is completed, the test switch will be removed from the corresponding position and used to set up the server, which is connected to the access switch through a cable.

[0170] In the embodiments of the present application, by comparing the PRBS bit error rate with a preset bit error rate threshold, the transmission performance of the cable can be obtained more quickly and accurately, so as to realize the judgment of the cable connectivity.

[0171] The following describes the implementation manner of triggering the above-mentioned cable test in the terminal and displaying the test result. Refer to Figure 9A , Figure 9A is the sixth process schematic diagram of the cable test method for the cabinet provided by the embodiments of the present application, which is applied to the terminal and will be described in combination with the steps shown in Figure 9A shown.

[0172] In step 201, a cable test page of the cabinet is displayed, where the cable test page includes cable test controls.

[0173] Exemplarily, refer to Figure 3C , Figure 3C the page in is the cable test page of the cabinet, and both the connectivity test control and the consistency test control are cable test controls.

[0174] In some embodiments, refer to Figure 9B , Figure 9B is the seventh process schematic diagram of the cable test method for the cabinet provided by the embodiments of the present application. Before step 201, steps 301 to 302 of Figure 9B are executed, which are specifically described below.

[0175] In step 301, in response to the triggering operation on the cable acceptance control in the on-site implementation page, a task list page is displayed, where the task list page includes a plurality of cables to be accepted and corresponding project details controls for each cable to be accepted.

[0176] Exemplarily, refer to Figure 3A and Figure 3B , Figure 3A is the schematic diagram of the on-site implementation page of the cable test applet provided by the embodiments of the present application, Figure 3B is the schematic diagram of the task list page of the cable test applet provided by the embodiments of the present application. In response to the triggering operation on the cable acceptance control 801 in the on-site implementation page, the cables to be accepted shown in Figure 3B are displayed, as well as the project details control 802 in each project.

[0177] In step 302, in response to the triggering operation on the project details control of any cable to be accepted, the cable test page of the cabinet corresponding to the cable to be accepted is displayed.

[0178] For example, refer to Figure 3B and Figure 3C , Figure 3B FIG. is a schematic diagram of a task list page of a cable testing applet provided by an embodiment of the present application, Figure 3C FIG. is a schematic diagram of a cable testing page of a cabinet of a cable testing applet provided by an embodiment of the present application. In response to a trigger operation on a project details control 802 of any cable project to be accepted, display Figure 3C the corresponding cable testing page of the cabinet of the cable project to be accepted in, as well as a connectivity testing control 803, a consistency testing control 804, and a reset control 805.

[0179] Continue to refer to Figure 9A , in step 202, in response to a trigger operation on a cable testing control, send a cable testing command to multiple access switches in the cabinet, where the cable testing command is used to trigger a test switch in the cabinet to perform a test operation corresponding to the current test mode, obtain a test result of the current test mode, the current test mode is a test mode corresponding to the current port status of multiple access switches, and the test mode includes at least one of a consistency test mode and a connectivity test mode.

[0180] In some embodiments, the cable testing control includes a consistency testing control and a connectivity testing control.

[0181] For example, refer to Figure 3C , Figure 3C There is a consistency testing control 804 and a connectivity testing control 803 in. In response to a trigger operation on different cable testing controls, send corresponding test commands to the access switches. The test switch synchronizes the status with the access switches, switches to the corresponding test mode, and obtains a test result of the test mode. In response to a trigger operation on the reset control 805, clear the test result to facilitate retesting the device.

[0182] In some embodiments, refer to Figure 9C , Figure 9C FIG. is an eighth process schematic diagram of a cable testing method for a cabinet provided by an embodiment of the present application. Figure 9A Step 202 of "In response to a trigger operation on a cable testing control, send a cable testing command to multiple access switches in the cabinet" in can be implemented by Figure 9C Steps 2021 to 2022 of, which are specifically described below.

[0183] In step 2021, in response to a trigger operation on the consistency testing control, send a consistency testing command to multiple access switches in the cabinet.

[0184] For example, refer toFigure 3C , on the cable test page of the cabinet, when the consistency test control is clicked, the test command is sent to the access switch, the test switch synchronizes the status with the access switch, switches to the consistency test mode, and obtains the test result of the consistency test mode.

[0185] In step 2022, in response to the triggering operation on the connectivity test control, a connectivity test command is sent to multiple access switches in the cabinet.

[0186] Exemplarily, refer to Figure 3C , on the cable test page of the cabinet, when the connectivity test control is clicked, the test command is sent to the access switch, the test switch synchronizes the status with the access switch, switches to the connectivity test mode, and obtains the test result of the connectivity test mode.

[0187] In step 203, the test result is displayed on the cable test page of the cabinet.

[0188] In some embodiments, when the test switch enters the corresponding test mode, the test result is obtained, and the test result is sent to the applet through the access switch. The applet displays the received test result on the cable test page of the cabinet.

[0189] Exemplarily, refer to Figure 3C , in Figure 3C the connectivity and consistency test results of different cable items to be accepted are shown.

[0190] As Figure 9A an example of the cable test method for the cabinet provided by the embodiments of the present application shown, refer to Figure 12 , Figure 12 is a schematic diagram of the principle of cable test provided by the embodiments of the present application. In Figure 12 , in response to the click operation on the test control in the applet, the test command is sent to the access switch. After receiving the test command, the access switch switches the corresponding port status. The test switch synchronizes the status with the access switch, enters the corresponding test mode for testing according to the port status. When the test is completed, the test switch obtains the test result and returns the test result to the applet through the access switch. The applet displays the test result.

[0191] In the embodiments of the present application, the performance of the cable is tested by using a test switch instead of a cable tester, which reduces the test cost. The test mode is controlled by the test command to achieve rapid switching between different types of tests, increasing the diversity of tests and improving the test efficiency. At the same time, by synchronizing the port status of the access switch and performing the corresponding test operations, the flexibility of test mode conversion is enhanced, and the automatic switching of different test modes is realized.

[0192] Next, the implementation of the cable testing device 433 provided in the embodiments of the present application as a software module will be further described. In some embodiments, as Figure 7A shown, the software module in the cable testing device 433 stored in the memory 430 may include:

[0193] A status detection module 4331, configured to detect the port statuses of multiple access switches, where the port status of an access switch is the status of a physical port in the access switch for connecting a cable.

[0194] A status synchronization module 4332, configured to synchronize the port status of a test switch with the port statuses of multiple access switches, where the port status of the test switch is the status of a physical port in the test switch for connecting a cable.

[0195] A mode determination module 4333, configured to determine the current test mode corresponding to the synchronized port status, where the current test mode is the test mode corresponding to the synchronized port status.

[0196] A result determination module 4334, configured to perform a test operation corresponding to the current test mode to obtain the test result of the current test mode.

[0197] In some embodiments, the port status includes a first port status and a second port status.

[0198] In some embodiments, the status synchronization module 4332 is further configured to, in response to the port statuses of multiple access switches all being the first port status, set the port status of the test switch to the first port status; and in response to the port statuses of some of the multiple access switches being the first port status and the port statuses of the other part of the access switches being the second port status, set the port status of the test switch to the second port status.

[0199] In some embodiments, the port statuses of multiple access switches are used to characterize the following information: whether the physical layer of the physical port in the access switch for connecting a cable is in an enabled state; whether the link layer of the physical port in the access switch for connecting a cable is in an enabled state; where whether the physical layer is in an enabled state is achieved by physically plugging and unplugging the cable to the access switch, and whether the link layer is in an enabled state or a disabled state is achieved by remotely controlling the access switch through a terminal.

[0200] In some embodiments, the port status includes a first port status and a second port status, and the test mode includes a compliance test mode and a connectivity test mode; the first port status indicates that the physical layer of the physical port for connecting a cable in the test switch is in an on state, and the link layer of the physical port for connecting a cable in the test switch is in an off state, and the first port status corresponds to the connectivity test mode; the second port status indicates that the physical layer of the physical port for connecting a cable in the test switch is in an on state, and the link layer of the physical port for connecting a cable in the test switch is in an on state, and the second port status corresponds to the compliance test mode.

[0201] In some embodiments, the port status further includes a third port status, which is the status of the physical port of the access switch when the access switch is not connected to the cable, and the third port status indicates that the physical layer of the physical port for connecting a cable in the test switch is in an off state, and the link layer of the physical port for connecting a cable in the test switch is in an off state.

[0202] In some embodiments, the result determination module 4334 is further configured to, in response to the current test mode being the compliance test mode, determine the virtual port number used by the test switch to connect to the access switch; compare the virtual port number with the physical port number of the physical port of the test switch used to connect to the access switch, where the physical port of the test switch is used to connect to the access switch set at the position of the cabinet through a cable; in response to the virtual port number being the same as the physical port number, determine that the test result of the compliance test mode is that the cables respectively connected by multiple access switches are consistent.

[0203] In some embodiments, the virtual port number is the theoretical port number used to connect the test switch in the access switch set at the position of the cabinet obtained according to the port calculation rule.

[0204] In some embodiments, when the number of access switches is two, the virtual port number includes a first port number and a second port number respectively corresponding to the two access switches.

[0205] In some embodiments, when the total number of positions in the cabinet is less than or equal to the maximum access amount of the test switch, one test switch is set in the cabinet; when the total number of positions in the cabinet is greater than the maximum access amount of the test switch and less than or equal to twice the maximum access amount, two test switches are set in the cabinet.

[0206] In some embodiments, the result determination module 4334 is further configured to determine the rack position number of the current rack position of the test switch in the cabinet; when there is one test switch in the cabinet, double the rack position number is used as the first port number of the test switch, and the port number immediately after the first port number is used as the second port number of the test switch; when there are two test switches in the cabinet, in response to the rack position number being less than or equal to half of the total number of rack positions, double the rack position number is used as the first port number of the first test switch, and the port number immediately after the first port number is used as the second port number of the first test switch; in response to the rack position number being greater than half of the total number of rack positions, determine the difference between the rack position number and half of the total number of rack positions, and double the difference is used as the first port number of the second test switch, and the port number immediately after the first port number is used as the second port number of the second test switch.

[0207] In some embodiments, the result determination module 4334 is further configured to, in response to the current test mode being the connectivity test mode, receive the pseudo-random code stream sent by the access switch; send the pseudo-random code stream to multiple access switches; count the number of error bits and the total number of bits of the pseudo-random code stream during the receiving process and the sending process; determine the ratio of the number of error bits to the total number of bits; in response to the ratio being less than the preset bit error rate threshold, determine that the test result of the current test mode is that the cable between the access switch and the test switch is connected; in response to the ratio being greater than the preset bit error rate threshold, determine that the test result of the current test mode is that the cable between the access switch and the test switch is not connected.

[0208] Next, the implementation of the cable testing device 755 provided by the embodiments of the present application as a software module will be continued. In some embodiments, as Figure 7B shown, the software module in the cable testing device 755 stored in the memory 750 may include:

[0209] The page display module 7551 is configured to display the cable test page of the cabinet, where the cable test page includes cable test controls.

[0210] The command sending module 7552 is configured to, in response to a trigger operation on the cable test control, send a cable test command to multiple access switches in the cabinet, where the cable test command is used to trigger the test switch in the cabinet to execute a test operation corresponding to the current test mode to obtain the test result of the current test mode, and the current test mode is a test mode corresponding to the current port status of multiple access switches, and the test mode includes at least one of a consistency test mode and a connectivity test mode.

[0211] The result display module 7553 is configured to display the test result in the cable test page of the cabinet.

[0212] In some embodiments, before displaying the cable test page of the display cabinet, the page display module 7551 is further configured to, in response to a triggering operation on the cable acceptance control in the on-site implementation page, display a task list page, where the task list page includes a plurality of cable items to be accepted and item detail controls corresponding to each cable item to be accepted; and in response to a triggering operation on the item detail control of any cable item to be accepted, display the cable test page of the cabinet of the corresponding cable item to be accepted.

[0213] In some embodiments, the command sending module 7552 is further configured to, in response to a triggering operation on the consistency test control, send a consistency test command to a plurality of access switches in the cabinet; and in response to a triggering operation on the connectivity test control, send a connectivity test command to a plurality of access switches in the cabinet.

[0214] An embodiment of the present application provides a computer program product, which includes a computer program or computer-executable instructions, and the computer program or computer-executable instructions are stored in a computer-readable storage medium. A processor of an electronic device reads the computer-executable instructions from the computer-readable storage medium, and the processor executes the computer-executable instructions, so that the electronic device executes the cable test method of the cabinet in the embodiments of the present application as described above.

[0215] An embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions, where computer-executable instructions or a computer program are stored, and when the computer-executable instructions or the computer program are executed by a processor, the processor will be caused to execute the cable test method of the cabinet provided by the embodiments of the present application. For example, Figure 8A or Figure 9A the cable test method of the cabinet shown.

[0216] In some embodiments, the computer-readable storage medium may be a memory such as RAM, ROM, flash memory, magnetic surface memory, optical disc, or CD-ROM; or may be various devices including one or any combination of the above memories.

[0217] In some embodiments, the computer-executable instructions may be in the form of a program, software, software module, script, or code, and may be written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including being deployed as an independent program or being deployed as a module, component, subroutine, or other unit suitable for use in a computing environment.

[0218] As an example, the computer-executable instructions may or may not correspond to files in a file system, and may be stored as part of a file that holds other programs or data. For example, they may be stored in one or more scripts in a Hyper Text Markup Language (HTML) document, stored in a single file dedicated to the program under discussion, or stored in multiple cooperating files (such as files that store one or more modules, subroutines, or portions of code).

[0219] As an example, the computer-executable instructions may be deployed to execute on one electronic device, or on multiple electronic devices located at one location, or on multiple electronic devices distributed at multiple locations and interconnected via a communication network.

[0220] In summary, through the embodiments of the present application, by using a test switch instead of a cable tester, the test cost is reduced. By controlling the test mode through test commands, the diversity of testing is increased and the test efficiency is improved. At the same time, by synchronizing the port states of the access switch and performing corresponding test operations, the flexibility of test mode switching is enhanced, and automatic switching between different test modes is achieved.

[0221] The above is only the embodiments of the present application and is not intended to limit the protection scope of the present application. Any modifications, equivalent replacements, and improvements made within the spirit and scope of the present application are included in the protection scope of the present application.

Claims

1. A method for testing cables of a cabinet, characterized in that, it is applied to test a switch, the test switch is arranged in the cabinet, and a plurality of access switches are also arranged in the cabinet and are respectively connected to the test switch through cables; the method includes: detecting the port states of the plurality of access switches, wherein the port state of the access switch is the state of the physical port in the access switch for connecting the cable; synchronizing the port state of the test switch with the port states of the plurality of access switches, wherein the port state of the test switch is the state of the physical port in the test switch for connecting the cable; determining a current test mode corresponding to the synchronized port state, wherein the current test mode is a test mode corresponding to the synchronized port state; performing a test operation corresponding to the current test mode to obtain a test result of the current test mode.

2. The method according to claim 1, characterized in that, the port state includes a first port state and a second port state; the synchronizing the port state of the test switch with the port states of the plurality of access switches includes: in response to the port states of the plurality of access switches all being the first port state, setting the port state of the test switch to the first port state; in response to the port states of some of the plurality of access switches being the first port state and the port states of the other part of the access switches being the second port state, setting the port state of the test switch to the second port state.

3. The method according to claim 1 or 2, characterized in that, the port states of the plurality of access switches are used to represent the following information: whether the physical layer of the physical port in the access switch for connecting the cable is in an open state, and whether the link layer of the physical port in the access switch for connecting the cable is in an open state; wherein, whether the physical layer is in an open state is achieved by physically plugging and unplugging the cable to the access switch, and whether the link layer is in an open state or a closed state is achieved by remotely controlling the access switch through a terminal.

4. The method according to claim 1, characterized in that, the port state includes a first port state and a second port state; the test mode includes a consistency test mode and a connectivity test mode; the first port state corresponds to the connectivity test mode, and the first port state is used to represent that the physical layer of the physical port in the test switch for connecting the cable is in an open state, and the link layer of the physical port in the test switch for connecting the cable is in a closed state; the second port state corresponds to the consistency test mode, and the first port state is used to represent that the physical layer of the physical port in the test switch for connecting the cable is in an open state, and the link layer of the physical port in the test switch for connecting the cable is in an open state.

5. The method according to claim 2 or 4, wherein, the port state further includes a third port state, which is the state of the physical port of the access switch when the access switch is not connected to the cable, and the third port state indicates that the physical layer of the physical port of the test switch for connecting the cable is in a closed state, and the link layer of the physical port of the test switch for connecting the cable is in a closed state.

6. The method according to any one of claims 1 to 4, wherein, performing a test operation corresponding to the current test mode to obtain a test result of the current test mode, includes: in response to the current test mode being the conformance test mode, determining a virtual port number of the test switch for connecting the access switch; comparing the virtual port number with a physical port number of the physical port of the test switch for connecting the access switch, wherein the physical port of the test switch is used to connect to the access switch provided at the cabinet position through the cable; in response to the virtual port number being the same as the physical port number, determining that the test result of the conformance test mode is that the cables respectively connected by the multiple access switches have conformance.

7. The method according to claim 6, wherein, when the number of access switches is two, the virtual port number includes a first port number and a second port number respectively corresponding to the two access switches; when the total number of cabinet positions is less than or equal to the maximum access amount of the test switch, one test switch is provided in the cabinet, and when the total number of cabinet positions is greater than the maximum access amount of the test switch and less than or equal to twice the maximum access amount, two test switches are provided in the cabinet; determining the virtual port number of the test switch for connecting the access switch includes: determining the position number of the current position of the test switch in the cabinet; when one test switch is provided in the cabinet, taking twice the position number as the first port number of the test switch, and taking the port number next to the first port number as the second port number of the test switch; when two test switches are provided in the cabinet, in response to the position number being less than or equal to half of the total number of positions, taking twice the position number as the first port number of the first test switch, and taking the port number next to the first port number as the second port number of the first test switch; in response to the position number being greater than half of the total number of positions, determining the difference between the position number and half of the total number of positions, taking twice the difference as the first port number of the second test switch, and taking the port number next to the first port number as the second port number of the second test switch.

8. The method according to any one of claims 1 to 4, wherein, Performing a test operation corresponding to the current test mode to obtain a test result of the current test mode, including: In response to the current test mode being the connectivity test mode, receiving a pseudo-random code stream sent by the access switch; Sending the pseudo-random code stream to the multiple access switches; Counting the number of error bits and the total number of bits of the pseudo-random code stream during the receiving process and the sending process; Determining a ratio of the number of error bits to the total number of bits; In response to the ratio being less than a preset bit error rate threshold, determining that the test result of the current test mode is that the cable between the access switch and the test switch has connectivity; In response to the ratio being greater than the preset bit error rate threshold, determining that the test result of the current test mode is that the cable between the access switch and the test switch does not have connectivity.

9. A method for testing cables of a cabinet, characterized in that, applied to a terminal, the method includes: Displaying a cable test page of the cabinet, where the cable test page includes cable test controls; In response to a trigger operation on the cable test controls, sending a cable test command to multiple access switches in the cabinet, where the cable test command is used to trigger a test switch in the cabinet to perform a test operation corresponding to the current test mode to obtain a test result in the current test mode, and the current test mode is a test mode corresponding to the current port states of the multiple access switches, and the test mode includes at least one of a consistency test mode and a connectivity test mode; and Displaying the test result in the cable test page of the cabinet.

10. The method according to claim 9, characterized in that, the cable test controls include a consistency test control and a connectivity test control; The step of, in response to a trigger operation on the cable test controls, sending a cable test command to multiple access switches in the cabinet includes: In response to a trigger operation on the consistency test control, sending a consistency test command to multiple access switches in the cabinet; In response to a trigger operation on the connectivity test control, sending a connectivity test command to multiple access switches in the cabinet.

11. The method according to claim 9 or 10, characterized in that, before displaying the cable test page of the cabinet, the method further includes: In response to a trigger operation on a cable acceptance control in a field implementation page, displaying a task list page, where the task list page includes multiple cable items to be accepted and item detail controls corresponding to each cable item to be accepted; In response to a trigger operation on an item detail control of any one of the cable items to be accepted, displaying the cable test page of the corresponding cabinet of the cable item to be accepted.

12. A cable test device for a cabinet, characterized in that, the test switch is arranged in the cabinet, and multiple access switches are also arranged in the cabinet and are respectively connected to the test switch through cables; the device includes: A status detection module, configured to detect the port status of the multiple access switches, where the port status of the access switch is the status of the physical port in the access switch for connecting the cable; A status synchronization module, configured to synchronize the port status of the test switch with the port status of the multiple access switches, where the port status of the test switch is the status of the physical port in the test switch for connecting the cable; A mode determination module, configured to determine the current test mode corresponding to the synchronized port status, where the current test mode is the test mode corresponding to the synchronized port status; A result determination module, configured to perform a test operation corresponding to the current test mode to obtain the test result of the current test mode.

13. A cable testing device for a cabinet Characterized in that The device includes: A page display module, configured to display a cable test page of the cabinet, where the cable test page includes cable test controls; A command sending module, configured to, in response to a trigger operation on the cable test control, send a cable test command to multiple access switches in the cabinet, where the cable test command is used to trigger the test switch in the cabinet to perform a test operation corresponding to the current test mode to obtain the test result of the current test mode, the current test mode is the test mode corresponding to the current port status of the multiple access switches, and the test mode includes at least one of a consistency test mode and a connectivity test mode; and A result display module, configured to display the test result in the cable test page of the cabinet.

14. An electronic device Characterized in that The electronic device includes: A memory, configured to store computer-executable instructions; A processor, configured to, when executing the computer-executable instructions stored in the memory, implement the cable testing method for the cabinet according to any one of claims 1 to 8, or implement the cable testing method for the cabinet according to any one of claims 9 to 11.

15. A computer-readable storage medium storing computer-executable instructions or a computer program Characterized in that When the computer-executable instructions or the computer program are executed by a processor, the cable testing method for the cabinet according to any one of claims 1 to 8 is implemented, or the cable testing method for the cabinet according to any one of claims 9 to 11 is implemented.