A method, device, equipment and medium for controlling a switch

By setting a wireless module in the switch and allocating the Internet protocol address, the switch access problem that lacks a specific media is solved, the wireless method management and control of wireless mode are realized, and the efficiency of operation and maintenance is improved and dependence is reduced.

CN118900470BActive Publication Date: 2025-01-24INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411367365.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-29
Publication Date
2025-01-24
Estimated Expiration
2044-09-29

AI Technical Summary

Technical Problem

In the absence of single-machine or network cable, serial cable, DHCP server and serial server, the switch cannot be connected, resulting in operation and maintenance personnel being unable to access and manage switch equipment.

Method used

Set up wireless modules in the switch. When the control platform of the main control switch is detected, the Internet protocol address is allocated, and the Internet protocol address of the same network segment is allocated and the wireless module is activated. The networking environment of the equipment realizes the access and management of the in -LAN switch.

Benefits of technology

No need to use network cables, serial lines or other external devices to manage and control the single switch, improve the efficiency of equipment operation and maintenance, reduce the dependence on other equipment, and achieve direct communication in the same subnet, reduce it, reduce Communication delay.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118900470B_ABST
    Figure CN118900470B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device, equipment and medium for controlling a switch, and relates to the technical field of switches. A wireless module is set in the switch, and for a single-machine device, a wireless terminal device can be wirelessly connected to a single-machine access environment without a medium connection, thereby realizing the operation and management of the single-machine device; for a networking environment, a slave switch and a wireless terminal device are wirelessly connected to the networking of a master switch, thereby realizing the access of the wireless terminal device to the switch in the networking. In this method, a single switch can be managed and controlled without the aid of a network cable, a serial port cable or other external devices, which greatly improves the efficiency of equipment operation and maintenance, improves the feasibility of equipment management under extreme conditions, and reduces the dependence of switch management on other devices; secondly, the Internet Protocol addresses of the devices in the networking environment are the same, so that devices in the same subnet can communicate directly, reducing communication delays and improving efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] White box switches usually connect, access, and manage devices through the Teletype Network (Telnet) or Secure Shell (SSH). The above two switch connection methods require the switch to be connected to the serial port server or the existing network environment through serial cables and network cables respectively, so that operation and maintenance or test personnel can access the device. For the scenario of multiple switches interconnected, the service ports are usually interconnected through optical modules, active optical cables (AOC), and direct attach cables (DAC) to achieve the purpose of network topology.

[0003] In both cases, whether it is a stand-alone or networked environment, serial port servers, Dynamic Host Configuration Protocol (DHCP) servers, optical fibers, optical modules and other media connections are required to enable operation and maintenance personnel to access and manage the switch. In the case of a stand-alone machine or when the network cable, serial port cable, DHCP server and serial port server are missing, the switch cannot be connected, resulting in the inability of operation and maintenance personnel to access and manage the switch equipment.

[0004] It can be seen that, for a single device and without a connection medium, how to access and connect to a switch is a technical problem that people in this field need to solve urgently. Summary of the invention

[0005] The purpose of the present invention is to provide a method, device, equipment and medium for controlling a switch to solve the technical problem that when a single machine or a network cable, a serial port cable, a DHCP server and a serial port server are missing, the switch cannot be connected, thereby causing the operation and maintenance personnel to be unable to access and manage the switch equipment.

[0006] In order to solve the above technical problems, the present invention provides a method for controlling a switch, wherein the switch includes a wireless module, and the method includes:

[0007] When it is detected that the control platform of the master switch fails to obtain the Internet Protocol address, the wireless module in the master switch is controlled to allocate the Internet Protocol address of the same network segment to the control platform of the master switch and the wireless module in the master switch is controlled to start;

[0008] Control the wireless terminal device and the slave switch to access the networking environment of the master control device in a wireless manner, and control the master control switch to allocate the Internet protocol address of the target network segment to the wireless terminal device and the slave switch respectively; wherein the target network segment is the same as the network segment of the control platform of the master control switch;

[0009] Control the access and management operation of the wireless terminal device to at least one switch in the local area network.

[0010] In one aspect, the method further comprises:

[0011] When it is detected that the control platform of the master switch obtains the Internet Protocol address, the wireless terminal device is controlled to access the networking environment of the master device in a wired manner, and the step of controlling the wireless terminal device to access and manage at least one switch in the local area network is entered.

[0012] On the other hand, detecting whether the control platform of the master switch obtains the Internet Protocol address includes:

[0013] Controlling the master switch to check the Internet Protocol address of the control platform and / or to check the network management port message;

[0014] If an Internet Protocol address and / or a network management port message is detected, it is determined that the control platform of the master switch has acquired the Internet Protocol address;

[0015] If the Internet Protocol address and the network management port message are not detected, it is determined that the control platform of the master switch has not obtained the Internet Protocol address.

[0016] On the other hand, before the wireless terminal device and the slave switch are controlled to access the networking environment of the master control device in a wireless manner, the method further includes:

[0017] When it is detected that the master switch starts the wireless module, the master switch is controlled to scan the wireless signal in the current networking environment;

[0018] If a wireless signal is detected in the current networking environment, determining that the master control device is one of the remaining switches; wherein the remaining switches are switches other than the master control switch among all switches in the current networking environment;

[0019] If it is detected that no wireless signal exists in the current networking environment, it is determined that the master control device is the master control switch.

[0020] On the other hand, after determining that the master control device is one of the remaining switches, the method further includes:

[0021] Controlling at least one slave switch to send a connection request; wherein different slave switches do not respond to connection requests sent by other slave switches;

[0022] A switch that responds to the connection request of the slave switch is obtained, and the switch that responds to the connection request of the slave switch is used as the master control device.

[0023] On the other hand, after controlling at least one slave switch to send a connection request, the method further includes:

[0024] Starting from detecting that a connection request is sent from a slave switch, if no switch that responds to the connection request of the slave switch is detected within a preset time, a prompt message for indicating setting of the master control device is sent to the user, and the step of controlling at least one slave switch to send a connection request is returned, or the master control device is used as the master control switch.

[0025] On the other hand, after controlling the master switch to allocate the Internet protocol address of the target network segment to the wireless terminal device and the slave switch respectively, it also includes:

[0026] Obtaining an Internet Protocol address of a wireless module on the wireless terminal device;

[0027] If it is detected that the Internet Protocol address of the wireless module on the wireless terminal device is the same as the Internet Protocol address of the wireless module in the master switch, it is determined that the wireless terminal device is connected to the networking environment of the master device;

[0028] If it is detected that the Internet Protocol address of the wireless module on the wireless terminal device is different from the Internet Protocol address of the wireless module in the main control switch, it is determined that the wireless terminal device is not connected to the networking environment of the main control device, and the control returns to control the wireless terminal device to access the networking environment of the main control device, and controls the main control switch to allocate the Internet Protocol address of the target network segment to the wireless terminal device.

[0029] On the other hand, after controlling the master switch to allocate the Internet protocol address of the target network segment to the wireless terminal device and the slave switch respectively, it also includes:

[0030] Obtaining the Internet Protocol address of the wireless module on the slave switch;

[0031] If it is detected that the Internet Protocol address of the wireless module on the slave switch is the same as the Internet Protocol address of the wireless module in the master switch, it is determined that the slave switch is connected to the networking environment of the master device;

[0032] If it is detected that the Internet Protocol address of the wireless module on the slave switch is different from the Internet Protocol address of the wireless module in the master switch, it is determined that the slave switch is not connected to the networking environment of the master device, and the control returns to the networking environment of the master device to control the slave switch to connect, and the master switch is controlled to allocate the Internet Protocol address of the target network segment to the slave switch.

[0033] On the other hand, the wireless module in the master switch, the wireless module in the slave switch and the wireless module in the wireless terminal device are all provided with a key for indicating starting and shutting down the wireless module;

[0034] The controlling the wireless module in the master switch to start up comprises:

[0035] In response to a user's activation operation on a key on the wireless module in the master switch for indicating activation and deactivation of the wireless module, the wireless module in the master switch is activated;

[0036] Before the wireless terminal device and the slave switch are controlled to access the networking environment of the master control device in a wireless manner, the method further includes:

[0037] Responding to the user's start-up operation of a key on the wireless module in the wireless terminal device for representing the start-up and shutdown of the wireless module, so as to start the wireless module in the wireless terminal device; and responding to the user's start-up operation of a key on the wireless module in the slave switch for representing the start-up and shutdown of the wireless module, so as to start the wireless module in the slave switch; entering the step of controlling the wireless terminal device and the slave switch to access the networking environment of the master control device via wireless mode.

[0038] On the other hand, the wireless module of the switch is also provided with an indicator for indicating the connection status of the switch; the method further includes:

[0039] When it is detected that the wireless module of the master switch is not started, controlling the indicating device to display the first information;

[0040] When it is detected that the wireless module of the master switch is started and is not connected, controlling the indicating device to display second information;

[0041] After determining that the master control device is the master switch, controlling the indicating device to display third information;

[0042] After determining that the master control device is one of the remaining switches, the indicating device is controlled to display fourth information; wherein the first information, the second information, the third information and the fourth information are all different.

[0043] On the other hand, controlling the master switch to check the Internet Protocol address of the control platform and / or checking the network management port message includes:

[0044] Set a fixed inspection cycle;

[0045] The master switch is controlled to check the Internet Protocol address of the control platform and / or check the network management port message according to the fixed inspection period.

[0046] On the other hand, after the control of the wireless terminal device to access and manage at least one switch in the local area network, the method further includes:

[0047] Return to the step of controlling the master switch to check the Internet Protocol address of the control platform and / or check the network management port message, and obtain the current interaction mode in the networking environment; wherein the interaction mode includes a wireless interaction mode and a wired interaction mode;

[0048] If no Internet Protocol address and / or network management port message is detected, and the current interaction mode is a wireless interaction mode, the step of controlling the wireless module in the master switch to allocate an Internet Protocol address of the same network segment to the control platform of the master switch and controlling the wireless module in the master switch to start up is entered;

[0049] If no Internet Protocol address and / or network management port message is detected, and the current interaction mode is a wired interaction mode, the control platform of the master switch is controlled to switch from a wired interaction state to a wireless interaction state, and the step of controlling the wireless module in the master switch to allocate an Internet Protocol address of the same network segment to the control platform of the master switch and controlling the wireless module in the master switch to start is entered;

[0050] When an Internet Protocol address and / or a network management port message is detected and the current interaction mode is a wireless interaction mode, the control platform of the master switch is controlled to switch from a wireless interaction state to a wired interaction state, and the step of controlling the wireless terminal device to access the networking environment of the master device in a wired manner is entered;

[0051] When an Internet Protocol address and / or a network management port message is detected and the current interaction mode is a wired interaction mode, the step of controlling the wireless terminal device to access the networking environment of the main control device via a wired mode is entered.

[0052] In order to solve the above technical problem, the present invention further provides a computer program product, including a computer program / instruction, which implements the steps of the above method for controlling a switch when executed by a processor.

[0053] In order to solve the above technical problem, the present invention also provides a device for controlling a switch, comprising:

[0054] Memory for storing computer programs;

[0055] The processor is used to implement the steps of the above-mentioned method for controlling the switch when executing the computer program.

[0056] In order to solve the above technical problem, the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above method for controlling a switch are implemented.

[0057] The beneficial effect of the present invention is that in the method, a wireless module is set in the switch. For a single-machine device, the wireless terminal device can be wirelessly connected to the single-machine access environment without a medium connection, thereby realizing the operation and management of the single-machine device; for a networking environment, the slave switch and the wireless terminal device are wirelessly connected to the networking of the master switch, thereby realizing the access of the wireless terminal device to the switch in the networking. In this method, a single switch can be managed and controlled without the help of a network cable, a serial port cable or other external devices, which greatly improves the efficiency of equipment operation and maintenance, improves the feasibility of equipment management under extreme conditions, and reduces the dependence of switch management on other devices; secondly, the Internet Protocol address of the control platform of the master switch, the Internet Protocol address of the slave switch and the Internet Protocol address of the wireless terminal device are set to be the same, so that devices in the same subnet can communicate directly without the intervention of a router or gateway, reducing communication delays and improving efficiency.

[0058] In addition, when it is detected that the control platform of the master switch obtains the Internet Protocol address, the wireless terminal device is controlled to access the networking environment of the master device through a wired manner, thereby improving the reliability of communication.

[0059] The control master switch checks the Internet Protocol address of the control platform and / or checks the network management port message, and determines whether the control platform of the master switch has obtained or not obtained the Internet Protocol address based on the Internet Protocol address and / or the network management port message. The detection process reduces the possibility of human configuration errors and improves the stability of the network.

[0060] When determining the master control device, it is detected whether there is a wireless signal in the current networking environment. If there is no wireless signal, the master switch is determined to be the master control device, ensuring the existence of a master control device in the networking system and realizing centralized management and control of other devices in the network.

[0061] When a wireless signal is detected in the current networking environment, the master control device is determined to be one of the remaining switches. When the master control device is determined, at least one slave switch is controlled to send a connection request, and the switch that responds to the connection request of the slave switch is used as the master control device; after controlling at least one slave switch to send a connection request, starting from detecting that the slave switch sends a connection request, if no switch that responds to the connection request of the slave switch is detected within a preset time, prompt information for indicating setting the master control device is sent to the user, and the step of controlling at least one slave switch to send a connection request is returned, or the master control device is used as the master control switch, thereby accurately determining the master control device.

[0062] After controlling the master switch to allocate the Internet Protocol addresses of the target network segments to the wireless terminal device and the slave switch respectively, by verifying whether the Internet Protocol address of the wireless module on the wireless terminal device is the same as the Internet Protocol address of the wireless module in the master switch, and verifying whether the Internet Protocol address of the wireless module on the slave switch is the same as the Internet Protocol address of the wireless module in the master switch, it is ensured that both the wireless terminal device and the slave switch are connected to the network.

[0063] The wireless modules in the master switch, the slave switch and the wireless terminal device are all provided with buttons for starting and shutting down the wireless modules. By operating the buttons for starting and shutting down the wireless modules, the wireless modules on the master switch, the slave switch and the wireless terminal device are started. The wireless connection method is simple and the switch management efficiency is improved.

[0064] By arranging an indicating device on the wireless module, the connection status of the switch can be accurately reflected through the information displayed by the indicating device, so that the user can intuitively understand the status of the switch.

[0065] The control main switch is controlled to check the Internet Protocol address of the control platform and / or the network management port message according to a fixed inspection cycle, and after controlling the wireless terminal device to access and manage at least one switch in the local area network, it continues to return to the step of controlling the main switch to check the Internet Protocol address of the control platform and / or the network management port message, and according to the situation of detecting the Internet Protocol address and / or the network management port message and the current interaction mode in the networking environment, the main switch periodically checks the network management port message and the Internet Protocol address of the control platform, so that it can switch between wired and wireless states to achieve the purpose of switch management and operation and maintenance.

[0066] In addition, the present invention also provides a computer program product, a device for controlling a switch, and a computer-readable storage medium, which have the same or corresponding technical features as the above-mentioned method for controlling a switch, and have the same effects as above. BRIEF DESCRIPTION OF THE DRAWINGS

[0067] In order to more clearly illustrate the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0068] Figure 1 A schematic diagram of an interaction scenario of a switch provided in an embodiment of the present invention;

[0069] Figure 2 A flow chart of a method for controlling a switch provided by an embodiment of the present invention;

[0070] Figure 3 A schematic diagram of a wireless module on a switch provided by an embodiment of the present invention;

[0071] Figure 4 A flow chart of a switch management method based on a wireless local area network provided by an embodiment of the present invention;

[0072] Figure 5 A structural diagram of a device for controlling a switch provided in another embodiment of the present invention. DETAILED DESCRIPTION

[0073] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0074] The core of the present invention is to provide a method, device, equipment and medium for controlling a switch to solve the technical problem that when a single machine or a network cable, serial port cable, DHCP server and serial port server are missing, the switch cannot be connected, resulting in the inability of operation and maintenance personnel to access and manage the switch equipment.

[0075] Figure 1 A schematic diagram of an interactive scenario of a switch provided by an embodiment of the present invention, such as Figure 1As shown in the figure, this interactive scenario involves a master switch, a slave switch, and a wireless terminal device. The management port and serial port of the relevant switch are usually connected to the upstream DHCP server and serial port server respectively, and the operation and maintenance personnel use Telnet or SSH to connect or access the device by wire. This solution requires a complete operation and maintenance environment including network cables, serial port cables, DHCP servers, serial port servers, and terminal management devices. However, in the case of a single machine or when the network cable, serial port cable, DHCP server, or serial port server is missing, the switch cannot be connected, resulting in the inability of the operation and maintenance personnel to access and manage the device, which may cause the problem of locating or recovering the device in a timely manner.

[0076] Therefore, the present invention provides a method for controlling a switch, so that operation and maintenance personnel can complete switch connection and management without network cables, serial port cables or other devices.

[0077] In order to make the technical personnel in this field better understand the scheme of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. It is worth noting that in the present invention, both the switch and the terminal device include a wireless module. Figure 2 A flow chart of a method for controlling a switch provided by an embodiment of the present invention, such as Figure 2 As shown, the method includes:

[0078] S10: When it is detected that the control platform of the master switch fails to obtain the Internet Protocol address, the wireless module in the master switch is controlled to allocate the Internet Protocol address of the same network segment to the control platform of the master switch and the wireless module in the master switch is controlled to start;

[0079] S11: Control the wireless terminal device and the slave switch to access the networking environment of the master control device via wireless mode, and control the master control switch to allocate Internet protocol addresses of target network segments to the wireless terminal device and the slave switch, respectively; wherein the target network segment is the same as the network segment of the control platform of the master control switch;

[0080] S12: Control the access and management operation of the wireless terminal device to at least one switch in the local area network.

[0081] Each switch can be set to two roles, one is the control platform (Controller) and the other is the agent (Agent). Which device is the master switch is set by the user. When choosing the master switch, it mainly depends on the topology that the user wants to establish and whether there is another control platform in the current network environment. If there is, two control platforms cannot be set up in one networking environment at the same time.

[0082] After the master switch is determined, the other switches in the networking environment are slave switches. In order to determine the switch devices in a stand-alone or non-network environment and the devices whose network management ports are connected to the DHCP server, in implementation, the detection of whether the control platform of the master switch obtains the Internet Protocol address includes:

[0083] Control the master switch to check the Internet Protocol address of the control platform and / or check the network management port message;

[0084] If an Internet Protocol address and / or a network management port message is detected, it is determined that the control platform of the master switch has acquired the Internet Protocol address;

[0085] If the Internet Protocol address and the network management port message are not detected, it is determined that the control platform of the master switch has not obtained the Internet Protocol address.

[0086] In order to more accurately identify the switch devices in the stand-alone or non-network environment and the devices whose network management ports are connected to the DHCP server, set a fixed inspection cycle; control the main control switch to check the Internet Protocol address of the control platform and / or check the network management port message according to the fixed inspection cycle. There is no limit on the fixed inspection cycle, which is determined according to the actual situation.

[0087] That is, after the master switch is powered on, it checks the Internet Protocol (IP) address of the control platform (such as the baseboard management controller (BMC)) and the DHCP message of the network management port. The check results are divided into two situations: 1) For stand-alone or non-network switch devices, the BMC cannot obtain the address assigned by the upstream server, and the terminal device cannot access the switch through a wired method; 2) For devices with a DHCP server connected to the network management port, the control platform of the master switch can dynamically obtain the Internet Protocol address, and the terminal device can access and manage the switch through a wired method.

[0088] When it is detected that the control platform of the master switch obtains the Internet Protocol address, the wireless terminal device is controlled to access the networking environment of the master device via a wired manner, and the access and management operations of the wireless terminal device to at least one switch in the local area network are controlled.

[0089] When it is detected that the control platform of the master switch has not obtained the Internet Protocol address, the wireless module in the master switch is first controlled to allocate the Internet Protocol address of the same network segment to the control platform of the master switch and control the wireless module in the master switch to start, and then the wireless terminal device and the slave switch are controlled to access the networking environment of the master device through wireless means.

[0090] It is worth noting that before controlling the wireless terminal device and the slave switch to access the networking environment of the master device through wireless means, the master device in the networking environment must be determined first. The user can specify the master device in the networking environment. In order to determine the master device, in the implementation, when it is detected that the master switch starts the wireless module, the master switch is controlled to scan the wireless signal in the current networking environment;

[0091] If a wireless signal is detected in the current networking environment, the master control device is determined to be one of the remaining switches; wherein the remaining switches are switches other than the master control switch among all switches in the current networking environment;

[0092] If it is detected that there is no wireless signal in the current networking environment, it is determined that the master control device is the master switch.

[0093] When it is determined that the master device is one of the remaining switches, the user inputs information of the current master device to the master switch and the slave switch. In order to realize the automation of the interaction scene, after determining that the master device is one of the remaining switches, the following is also included:

[0094] Controlling at least one slave switch to send a connection request; wherein different slave switches do not respond to connection requests sent by other slave switches;

[0095] The switch that responds to the connection request of the slave switch is obtained, and the switch that responds to the connection request of the slave switch is used as a master control device.

[0096] That is, in this method, the master control device is determined by the switch sending a connection request and responding to the connection request, thereby improving the efficiency and accuracy of determining the master control device.

[0097] In practice, although a wireless signal is detected in the current networking environment, no switch responds to the connection request when a connection request is sent, and the master device cannot be determined. To avoid this situation, after controlling at least one slave switch to send a connection request, the following steps are further included:

[0098] Since the detection of the connection request sent by the slave switch, if no switch responding to the connection request of the slave switch is detected within the preset time, a prompt message for indicating the setting of the master control device is sent to the user, and the step of controlling at least one slave switch to send a connection request is returned, or the master control device is used as the master switch.

[0099] There is no limit on the preset time length, which is determined according to the actual situation. If no switch responding to the connection request of the slave switch is detected within the preset time length, the user can be prompted to set the master device, or the master switch can be directly used as the master device, ensuring that there is a master device in the networking environment, so that other devices in the network can be centrally managed and controlled.

[0100] After the master control device is determined, the wireless terminal device and the slave switch are controlled to access the networking environment of the master control device by wireless means, and the master control switch is controlled to allocate the Internet protocol address of the target network segment to the wireless terminal device and the slave switch respectively; wherein the target network segment is the same as the network segment of the control platform of the master control switch. That is, the wireless terminal device and the slave switch both start the corresponding wireless module and join the networking environment of the master control device.

[0101] In order to determine whether the wireless terminal device is connected to the network, in implementation, after controlling the master switch to allocate the Internet protocol address of the target network segment to the wireless terminal device and the slave switch respectively, it also includes:

[0102] Obtaining the Internet Protocol address of the wireless module on the wireless terminal device;

[0103] If it is detected that the Internet Protocol address of the wireless module on the wireless terminal device is the same as the Internet Protocol address of the wireless module in the main control switch, it is determined that the wireless terminal device is connected to the networking environment of the main control device;

[0104] If it is detected that the Internet Protocol address of the wireless module on the wireless terminal device is different from the Internet Protocol address of the wireless module in the main control switch, it is determined that the wireless terminal device is not connected to the networking environment of the main control device, and the control returns to the networking environment of the wireless terminal device to access the main control device, and controls the main control switch to allocate the Internet Protocol address of the target network segment to the wireless terminal device.

[0105] Similarly, judging whether the slave switch is connected to the network, in implementation, after controlling the master switch to allocate the Internet protocol address of the target network segment to the wireless terminal device and the slave switch respectively, further includes:

[0106] Get the Internet Protocol address of the wireless module from the switch;

[0107] If it is detected that the Internet Protocol address of the wireless module on the slave switch is the same as the Internet Protocol address of the wireless module in the master switch, it is determined that the slave switch is connected to the networking environment of the master device;

[0108] If it is detected that the Internet Protocol address of the wireless module on the slave switch is different from the Internet Protocol address of the wireless module in the master switch, it is determined that the slave switch is not connected to the networking environment of the master device, and the control returns to the networking environment of the slave switch to connect to the master device, and controls the master switch to allocate the Internet Protocol address of the target network segment to the slave switch.

[0109] In the method, after controlling the master switch to allocate the Internet Protocol address of the target network segment to the wireless terminal device and the slave switch respectively, by verifying whether the Internet Protocol address of the wireless module on the wireless terminal device is the same as the Internet Protocol address of the wireless module in the master switch, and verifying whether the Internet Protocol address of the wireless module on the slave switch is the same as the Internet Protocol address of the wireless module in the master switch, it is ensured that the wireless terminal device and the slave switch are both connected to the network.

[0110] In order to start the wireless module in the master switch, the wireless module of the slave switch and the wireless terminal device. In implementation, controlling the wireless module startup in the master switch includes:

[0111] Enter the feature code (i.e. network password) into the wireless module in the master switch;

[0112] When it is detected that the input feature code is the same as the preset feature code, determining to start the wireless module in the main control switch;

[0113] When it is detected that the input feature code is different from the preset feature code, a new feature code is obtained, and the process returns to the step of inputting the feature code into the wireless module in the master switch.

[0114] Before controlling the wireless terminal device and the slave switch to access the networking environment of the master device through wireless mode, it also includes:

[0115] Inputting a characteristic code (i.e., a network password) into a wireless module in each device, wherein each device includes a slave switch and a wireless terminal device;

[0116] When it is detected that the input feature code is the same as the preset feature code, the wireless module in the startup device is determined; and the steps of controlling the wireless terminal device and the slave switch to access the networking environment of the main control device through wireless mode are entered;

[0117] If it is detected that the input feature code is different from the preset feature code, a new feature code is obtained, and the process returns to the step of inputting the feature code into the wireless module in each device.

[0118] There is no limitation on the feature code, which is determined according to the actual situation. The wireless module corresponding to each device is started by inputting the feature code into each wireless module, thereby ensuring the security of starting the wireless module and the security of the device.

[0119] In addition to the above-mentioned method of starting the wireless module of each device by inputting a feature code, in order to improve the efficiency of starting the wireless module, the wireless module in the master switch, the wireless module of the slave switch and the wireless module of the wireless terminal device are all provided with a key for indicating starting and shutting down the wireless module. Controlling the start of the wireless module in the master switch includes:

[0120] In response to the user's start-up operation on a key on the wireless module in the master switch, which is used to indicate starting and shutting down the wireless module, the wireless module in the master switch is started.

[0121] Before controlling the wireless terminal device and the slave switch to access the networking environment of the master device through wireless mode, it also includes:

[0122] Responding to the user's start-up operation of a key on the wireless module in the wireless terminal device, which is used to represent the start-up and shutdown of the wireless module, to start the wireless module in the wireless terminal device; and responding to the user's start-up operation of a key on the wireless module in the slave switch, which is used to represent the start-up and shutdown of the wireless module, to start the wireless module in the slave switch; entering the steps of controlling the wireless terminal device and the slave switch to access the networking environment of the main control device through wireless mode.

[0123] In the embodiment of the present invention, the button used to represent starting and shutting down the wireless module is called Wireless Fidelity (Wi-Fi) Security Protection Setup (Wi-Fi Protected Setup), or WPS for short. WPS enables a device to connect to a Wi-Fi network by pressing a button without having to manually enter the Wi-Fi network password, making connecting to a Wi-Fi network more convenient and faster.

[0124] At the same time, in order to facilitate the user to intuitively understand the connection status of the switch, the wireless module of the switch is also provided with an indicator device for indicating the connection status of the switch. The indicator device is not limited, such as an indicator light. Figure 3 A schematic diagram of a wireless module on a switch provided by an embodiment of the present invention, such as Figure 3 As shown, an indicator device and a button for indicating starting and shutting down the wireless module are provided on the wireless module of the switch.

[0125] When it is detected that the wireless module of the master switch is not started, the control indicating device displays the first information;

[0126] When it is detected that the wireless module of the master switch is started and is not connected, the control indicating device displays the second information;

[0127] After determining that the master control device is the master switch, controlling the indicating device to display the third information;

[0128] After determining that the master control device is one of the remaining switches, the control indicating device displays fourth information; wherein the first information, the second information, the third information and the fourth information are all different.

[0129] The above only lists the displays of the indicating device in several scenarios. In practice, the indicating device may also display different information in other scenarios to indicate the connection status of the switch.

[0130] In practice, there are serial port servers, Dynamic Host Configuration Protocol (DHCP) servers, optical fibers, optical modules and other media that enable access and management of switches; however, one or more of the above media may fail, resulting in failure to connect to the switch, and after a period of time, the failed media returns to normal, allowing the switch to be connected by wire. Therefore, after controlling the access and management operations of the wireless terminal device to at least one switch in the local area network, it also includes:

[0131] Return to the step of controlling the main control switch to check the Internet Protocol address of the control platform and / or check the network management port message, and obtain the current interaction mode in the networking environment; wherein the interaction mode includes a wireless interaction mode and a wired interaction mode;

[0132] If no Internet Protocol address and / or network management port message is detected and the current interaction mode is a wireless interaction mode, the step of controlling the wireless module in the master switch to allocate an Internet Protocol address of the same network segment to the control platform of the master switch is entered;

[0133] If no Internet Protocol address and / or network management port message is detected, and the current interaction mode is a wired interaction mode, the control platform of the master switch is controlled to switch from a wired interaction state to a wireless interaction state, and the step of controlling the wireless module in the master switch to allocate an Internet Protocol address of the same network segment to the control platform of the master switch is entered;

[0134] When an Internet Protocol address and / or a network management port message is detected and the current interaction mode is a wireless interaction mode, the control platform of the control main switch is switched from a wireless interaction state to a wired interaction state, and the step of controlling the wireless terminal device to access the networking environment of the main control device through a wired mode is entered;

[0135] When an Internet Protocol address and / or a network management port message is detected and the current interaction mode is a wired interaction mode, the step of controlling the wireless terminal device to access the networking environment of the main control device through a wired mode is entered.

[0136] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. In the embodiment of the present invention, a solution for a switch under stand-alone and networking conditions is proposed, where the switch is used as a wireless access point (AP) hotspot, a wireless module is added, and the wireless module has a button for indicating the start and stop of the wireless module and an indicator for indicating the connection status of the switch.

[0137] The following takes the case where the button used to represent starting and shutting down the wireless module is a wireless fidelity security protection setting button (i.e., a WPS button), and the indicator device used to represent the connection status of the switch is a light emitting diode (LED) as an example to illustrate the overall solution for controlling the switch provided by the present invention.

[0138] The switch has a new wireless module, which has a WPS button and an LED indicator light. The LED indicator light has three colors:

[0139] When the wireless module of the switch is not started, the LED indicator lights up red;

[0140] When the switch starts the wireless module but is not connected, the LED indicator flashes yellow;

[0141] When the switch is connected to the networking environment as a master device, the LED indicator lights up green. When the switch is connected to the networking environment as a controlled device, the LED lights up yellow.

[0142] When the wireless module of the master switch is started, the terminal devices and slave switches can access the wireless network of the switch through WPS, thereby achieving access to the switches in the network.

[0143] Figure 4 A flow chart of a switch management method based on a wireless local area network provided by an embodiment of the present invention, such as Figure 4 As shown, the method includes:

[0144] S13: The master switch checks the Internet protocol address of the baseboard management controller and the message of the network management port;

[0145] S14: Determine whether the baseboard management controller obtains the address; if so, proceed to step S15; if not, proceed to step S21;

[0146] S15: The device automatically assigns an Internet Protocol address in the same network segment as the wireless module to the baseboard management controller;

[0147] S16: The master switch presses the wireless fidelity security protection setting button;

[0148] S17: The wireless terminal device presses the wireless fidelity security protection setting button to access the networking environment of the master control device;

[0149] S18: The switch acts as a wireless hotspot to assign Internet Protocol addresses to wireless terminal devices, and the network segment is consistent with the baseboard management controller network segment;

[0150] S19: Access the networking environment of the master switch from the slave switch to obtain the same Internet Protocol address as the wireless terminal device and the master device;

[0151] S20: The wireless terminal device accesses the master and slave switch baseboard management controllers through the secure shell protocol to upload images, restart, upgrade, etc. to the switches;

[0152] S21: The baseboard management controller obtains the address, and the wireless terminal device accesses the switch in a wired manner;

[0153] S22: The wireless terminal device accesses the baseboard management controller through a wired secure shell protocol connection to manage the device.

[0154] After step S20 and step S22, the process may return to step S13.

[0155] The method proposes a method in which a switch is used as an AP hotspot and a wireless terminal device operates, maintains and manages the switch by accessing the switch local area network. The method specifically includes:

[0156] Step 1: After the master switch is powered on, periodically check the BMC IP address and the DHCP message of the network management port;

[0157] Step 2: When the BMC fails to obtain an address, the main switch automatically configures the BMC's IP address to a static IP address in the same network segment as the wireless module.

[0158] Step 3. Press the WPS button on the master switch to start the wireless module. The master switch periodically scans nearby wireless signals to check whether there is a master device in the current environment. If there is a master device, it will automatically join the networking environment. If there is no master device, it will act as a Controller to network, and the indicator light will turn green and flash;

[0159] Step 4. Press the WPS button of the wireless terminal device and wait for the wireless terminal device to access the switch LAN. During the waiting process, the wireless indicator light flashes green. After the wireless indicator light turns green, check the connection status and IP address of the wireless terminal device. The wireless terminal device acts as an AP Client and the switch acts as a hotspot AP Server. The wireless module of the switch assigns an address in the same network segment as the BMC.

[0160] Step 5. Press the WPS button on the slave switch and wait for access. When access is completed, the master switch assigns an address to the slave switch.

[0161] Step 6: The wireless terminal device accesses the master switch BMC and slave switch BMC through SSH to upload images, restart, and upgrade the switches;

[0162] Step 7: The main control device performs periodic detection. If the DHCP message received by the network management port is detected, the BMC switches from the wireless state to the wired state, disconnects the connection with the wireless module of the switch, and obtains the IP address from the network management port instead. The wireless module indicator light is always red. If the address is still not obtained, the wireless terminal device still manages and operates the switch in a wireless manner. If the address has been obtained, the devices are accessed through wired.

[0163] In the method provided by the embodiment of the present invention, a wireless module is added to the switch, and the module includes a WPS button and a wireless status indicator light, and the master switch is set as an AP hotspot in the networking environment. The wireless terminal and the slave switch quickly access the switch local area network through the WPS method, thereby connecting to the switch's BMC. In response to the operation and maintenance of stand-alone equipment and networking environments, a single switch can be managed and controlled without the help of a network cable, a serial port cable or other external devices, which greatly improves the efficiency of equipment operation and maintenance, improves the feasibility of equipment management under extreme conditions, reduces the dependence of switch management on other devices, and saves equipment management costs; the WPS button method is used to allow terminal devices to access, simplify wireless connections, and do not require the input of complex passwords, which is an improvement in the efficiency of switch management; the master switch periodically checks the network management port message and the IP address of the BMC, so that it can switch between wired and wireless states to achieve the purpose of switch management and operation and maintenance.

[0164] In the above embodiments, the method for controlling a switch is described in detail, and the present invention also provides embodiments of a device for controlling a switch and a device for controlling a switch. It should be noted that the present invention describes the embodiments of the device part from two perspectives, one is based on the perspective of the functional module, and the other is based on the perspective of the hardware.

[0165] An embodiment of the present invention provides a device for controlling a switch, based on the perspective of a functional module, including:

[0166] The first control module is used to control the wireless module in the master switch to allocate the Internet Protocol address of the same network segment to the control platform of the master switch and control the wireless module in the master switch to start when it is detected that the control platform of the master switch has not obtained the Internet Protocol address;

[0167] The second control module is used to control the wireless terminal device and the slave switch to access the networking environment of the master control device by wireless means, and control the master control switch to allocate the Internet protocol address of the target network segment to the wireless terminal device and the slave switch respectively; wherein the target network segment is the same as the network segment of the control platform of the master control switch;

[0168] The third control module is used to control the access and management operation of the wireless terminal device to at least one switch in the local area network.

[0169] In some embodiments, the device for controlling the switch further includes:

[0170] The fourth control module is used to control the wireless terminal device to access the networking environment of the main control device in a wired manner and trigger the third control module when it is detected that the control platform of the main control switch obtains the Internet Protocol address.

[0171] In some embodiments, the device for controlling the switch includes a detection module for detecting whether the control platform of the master switch obtains the Internet Protocol address. The detection module specifically includes:

[0172] A checking module, used to control the main control switch to check the Internet Protocol address of the control platform and / or check the network management port message;

[0173] A first determination module is used to determine that the control platform of the master switch has acquired the Internet Protocol address if an Internet Protocol address and / or a network management port message is detected;

[0174] The second determination module is used to determine that the control platform of the master switch has not obtained the Internet Protocol address if the Internet Protocol address and the network management port message are not detected.

[0175] In some embodiments, the device for controlling the switch further includes:

[0176] The scanning module is used to control the main control switch to scan the wireless signal in the current networking environment when it is detected that the main control switch starts the wireless module;

[0177] A third determination module is used to determine that the master control device is one of the remaining switches if a wireless signal is detected in the current networking environment; wherein the remaining switches are switches other than the master control switch in all switches in the current networking environment;

[0178] The fourth determining module is used to determine that the master control device is a master control switch if it is detected that there is no wireless signal in the current networking environment.

[0179] In some embodiments, the device for controlling the switch further includes:

[0180] A first sending module, used to control at least one slave switch to send a connection request; wherein different slave switches do not respond to connection requests sent by other slave switches;

[0181] The acquisition and serving module is used to acquire the switch that responds to the connection request of the slave switch, and use the switch that responds to the connection request of the slave switch as the master control device.

[0182] In some embodiments, the device for controlling the switch further includes:

[0183] The second sending module, or serving as a module, is used to send a prompt message for indicating the setting of the master device to the user, and return to trigger the first sending module, or use the master device as the master switch, starting from detecting that the slave switch sends a connection request. If no switch responding to the connection request of the slave switch is detected within a preset time, the second sending module, or serving as a module, is used to send a prompt message for indicating the setting of the master device to the user, and return to trigger the first sending module, or use the master device as the master switch.

[0184] In some embodiments, the device for controlling the switch further includes:

[0185] A first acquisition module, used to acquire an Internet Protocol address of a wireless module on a wireless terminal device;

[0186] a fifth determination module, configured to determine that the wireless terminal device is connected to the networking environment of the master control device if it is detected that the Internet Protocol address of the wireless module on the wireless terminal device is the same as the Internet Protocol address of the wireless module in the master control switch;

[0187] a sixth determination module, configured to determine that the wireless terminal device is not connected to the networking environment of the master control device if it is detected that the Internet Protocol address of the wireless module on the wireless terminal device is different from the Internet Protocol address of the wireless module in the master control switch;

[0188] The first allocation module is used to control the wireless terminal device to access the networking environment of the main control device, and control the main control switch to allocate the Internet protocol address of the target network segment to the wireless terminal device.

[0189] In some embodiments, the device for controlling the switch further includes:

[0190] A second acquisition module is used to acquire the Internet Protocol address of the wireless module on the slave switch;

[0191] a seventh determination module, for determining that the slave switch is connected to the networking environment of the master device if it is detected that the Internet Protocol address of the wireless module on the slave switch is the same as the Internet Protocol address of the wireless module in the master switch;

[0192] an eighth determination module, configured to determine that the slave switch is not connected to the networking environment of the master device if it is detected that the Internet Protocol address of the wireless module on the slave switch is different from the Internet Protocol address of the wireless module in the master switch;

[0193] The second allocation module is used to control the slave switch to access the networking environment of the master device, and control the master switch to allocate the Internet Protocol address of the target network segment to the slave switch.

[0194] In some embodiments, the device for controlling the switch includes a startup module for controlling the startup of the wireless module in the master switch;

[0195] The startup module is specifically used to respond to the user's startup operation on the key on the wireless module in the master switch, which is used to represent startup and shutdown of the wireless module, so as to start the wireless module in the master switch.

[0196] In some embodiments, the device for controlling the switch further includes:

[0197] The response module is used to respond to the user's start-up operation on the key used to start and shut down the wireless module in the wireless terminal device, so as to start the wireless module in the wireless terminal device; and respond to the user's start-up operation on the key used to start and shut down the wireless module in the wireless module in the slave switch, so as to start the wireless module in the slave switch.

[0198] In some embodiments, the device for controlling the switch further includes:

[0199] A first display module, used to control the indicating device to display the first information when it is detected that the wireless module of the master switch is not started;

[0200] A second display module is used to control the indicating device to display second information when it is detected that the wireless module of the master switch is started and is not connected;

[0201] A third display module, used to control the indicating device to display third information after determining that the master control device is the master switch;

[0202] The fourth display module is used to control the indicating device to display fourth information after determining that the main control device is one of the remaining switches; wherein the first information, the second information, the third information and the fourth information are all different.

[0203] Since the embodiments of the apparatus part correspond to the embodiments of the method part, please refer to the description of the embodiments of the method part for the embodiments of the apparatus part, which will not be repeated here.

[0204] Figure 5 This is a structural diagram of a device for controlling a switch provided by another embodiment of the present invention. This embodiment is based on the hardware perspective, such as Figure 5 As shown, the devices controlling the switch include:

[0205] A memory 20, used for storing computer programs;

[0206] The processor 21 is used to implement the steps of the method for controlling a switch mentioned in the above embodiment when executing a computer program.

[0207] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 can be implemented in at least one hardware form of a digital signal processor (DSP), a field-programmable gate array (FPGA), and a programmable logic array (PLA). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 may be integrated with a graphics processing unit (GPU), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.

[0208] The memory 20 may include one or more computer-readable storage media, which may be non-transitory. The memory 20 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 20 is at least used to store the following computer program 201, wherein, after the computer program is loaded and executed by the processor 21, it can implement the relevant steps of the method for controlling the switch disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 202 may include Windows, Unix, Linux, etc. The data 203 may include, but is not limited to, the data involved in the method for controlling the switch mentioned above, etc.

[0209] In some embodiments, the device for controlling the switch may further include a display screen 22 , an input / output interface 23 , a communication interface 24 , a power supply 25 , and a communication bus 26 .

[0210] Those skilled in the art will understand that Figure 5 The structure shown in the figure does not constitute a limitation on the device for controlling the switch, and may include more or fewer components than those shown in the figure.

[0211] The device for controlling a switch provided by an embodiment of the present invention includes a memory and a processor. When the processor executes a program stored in the memory, it can implement the following method: The method for controlling a switch has the same effect as above.

[0212] An embodiment of the present invention further provides a computer program product, including a computer program / instruction, which implements the steps of the above-mentioned method for controlling a switch when executed by a processor.

[0213] Finally, the present invention also provides an embodiment corresponding to a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps recorded in the above method embodiment are implemented.

[0214] It is understandable that if the method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc. Various media that can store program codes.

[0215] The computer-readable storage medium provided by the present invention includes the above-mentioned method for controlling a switch, and the effect is the same as above.

[0216] The above is a detailed introduction to a method, device, equipment and medium for controlling a switch provided by the present invention. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principle of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the scope of protection of the present invention.

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

Claims

1. A method for controlling a switch, characterized in that: The switch includes a wireless module, and the method includes: When it is detected that the control platform of the master switch fails to obtain the Internet Protocol address, the wireless module in the master switch is controlled to allocate the Internet Protocol address of the same network segment to the control platform of the master switch and the wireless module in the master switch is controlled to start; Control the wireless terminal device and the slave switch to access the networking environment of the master control device in a wireless manner, and control the master control switch to allocate the Internet protocol address of the target network segment to the wireless terminal device and the slave switch respectively; wherein the target network segment is the same as the network segment of the control platform of the master control switch; Control the access and management operation of the wireless terminal device to at least one switch in the local area network.

2. The method for controlling a switch according to claim 1, characterized in that: The method further comprises: When it is detected that the control platform of the master switch obtains the Internet Protocol address, the wireless terminal device is controlled to access the networking environment of the master device in a wired manner, and the step of controlling the wireless terminal device to access and manage at least one switch in the local area network is entered.

3. The method for controlling a switch according to claim 2, characterized in that: Detecting whether the control platform of the master switch obtains the Internet Protocol address includes: Controlling the master switch to check the Internet Protocol address of the control platform and / or to check the network management port message; If an Internet Protocol address and / or a network management port message is detected, it is determined that the control platform of the master switch has acquired the Internet Protocol address; If the Internet Protocol address and the network management port message are not detected, it is determined that the control platform of the master switch has not obtained the Internet Protocol address.

4. The method for controlling a switch according to any one of claims 1 to 3, characterized in that: Before the wireless terminal device and the slave switch are controlled to access the networking environment of the master control device in a wireless manner, the method further includes: When it is detected that the master switch starts the wireless module, the master switch is controlled to scan the wireless signal in the current networking environment; If a wireless signal is detected in the current networking environment, determining that the master control device is one of the remaining switches; wherein the remaining switches are switches other than the master control switch among all switches in the current networking environment; If it is detected that no wireless signal exists in the current networking environment, it is determined that the master control device is the master control switch.

5. The method for controlling a switch according to claim 4, characterized in that: After determining that the master control device is one of the remaining switches, the method further includes: Controlling at least one slave switch to send a connection request; wherein different slave switches do not respond to connection requests sent by other slave switches; A switch that responds to the connection request of the slave switch is obtained, and the switch that responds to the connection request of the slave switch is used as the master control device.

6. The method for controlling a switch according to claim 5, characterized in that: After controlling at least one slave switch to send a connection request, the method further includes: Starting from detecting that a connection request is sent from a slave switch, if no switch that responds to the connection request of the slave switch is detected within a preset time, a prompt message for indicating setting of the master control device is sent to the user, and the step of controlling at least one slave switch to send a connection request is returned, or the master control device is used as the master control switch.

7. The method for controlling a switch according to claim 1, characterized in that: After controlling the master switch to allocate the Internet protocol address of the target network segment to the wireless terminal device and the slave switch respectively, the method further includes: Obtaining an Internet Protocol address of a wireless module on the wireless terminal device; If it is detected that the Internet Protocol address of the wireless module on the wireless terminal device is the same as the Internet Protocol address of the wireless module in the master switch, it is determined that the wireless terminal device is connected to the networking environment of the master device; If it is detected that the Internet Protocol address of the wireless module on the wireless terminal device is different from the Internet Protocol address of the wireless module in the main control switch, it is determined that the wireless terminal device is not connected to the networking environment of the main control device, and the control returns to control the wireless terminal device to access the networking environment of the main control device, and controls the main control switch to allocate the Internet Protocol address of the target network segment to the wireless terminal device.

8. The method for controlling a switch according to claim 1, characterized in that: After controlling the master switch to allocate the Internet protocol address of the target network segment to the wireless terminal device and the slave switch respectively, the method further includes: Obtaining the Internet Protocol address of the wireless module on the slave switch; If it is detected that the Internet Protocol address of the wireless module on the slave switch is the same as the Internet Protocol address of the wireless module in the master switch, it is determined that the slave switch is connected to the networking environment of the master device; If it is detected that the Internet Protocol address of the wireless module on the slave switch is different from the Internet Protocol address of the wireless module in the master switch, it is determined that the slave switch is not connected to the networking environment of the master device, and the control returns to the networking environment of the master device to control the slave switch to connect, and the master switch is controlled to allocate the Internet Protocol address of the target network segment to the slave switch.

9. The method for controlling a switch according to claim 4, characterized in that: The wireless module in the master switch, the wireless module in the slave switch and the wireless module in the wireless terminal device are all provided with a key for starting and shutting down the wireless module; The controlling the wireless module in the master switch to start up comprises: In response to a user's activation operation on a key on the wireless module in the master switch for indicating activation and deactivation of the wireless module, the wireless module in the master switch is activated; Before the wireless terminal device and the slave switch are controlled to access the networking environment of the master control device in a wireless manner, the method further includes: Responding to the user's start-up operation of a key on the wireless module in the wireless terminal device for representing the start-up and shutdown of the wireless module, so as to start the wireless module in the wireless terminal device; and responding to the user's start-up operation of a key on the wireless module in the slave switch for representing the start-up and shutdown of the wireless module, so as to start the wireless module in the slave switch; entering the step of controlling the wireless terminal device and the slave switch to access the networking environment of the master control device via wireless mode.

10. The method for controlling a switch according to claim 9, characterized in that: The wireless module of the switch is also provided with an indicator device for indicating the connection status of the switch; the method further comprises: When it is detected that the wireless module of the master switch is not started, controlling the indicating device to display the first information; When it is detected that the wireless module of the master switch is started and is not connected, controlling the indicating device to display second information; After determining that the master control device is the master switch, controlling the indicating device to display third information; After determining that the master control device is one of the remaining switches, the indicating device is controlled to display fourth information; wherein the first information, the second information, the third information and the fourth information are all different.

11. The method for controlling a switch according to claim 3, characterized in that: The controlling the master switch to check the Internet protocol address of the control platform and / or the network management port message includes: Set a fixed inspection cycle; The master switch is controlled to check the Internet Protocol address of the control platform and / or check the network management port message according to the fixed inspection period.

12. The method for controlling a switch according to claim 3, characterized in that: After the control of the wireless terminal device to access and manage at least one switch in the local area network, the method further includes: Return to the step of controlling the master switch to check the Internet Protocol address of the control platform and / or check the network management port message, and obtain the current interaction mode in the networking environment; wherein the interaction mode includes a wireless interaction mode and a wired interaction mode; If no Internet Protocol address and / or network management port message is detected, and the current interaction mode is a wireless interaction mode, the step of controlling the wireless module in the master switch to allocate an Internet Protocol address of the same network segment to the control platform of the master switch and controlling the wireless module in the master switch to start up is entered; If no Internet Protocol address and / or network management port message is detected, and the current interaction mode is a wired interaction mode, the control platform of the master switch is controlled to switch from a wired interaction state to a wireless interaction state, and the step of controlling the wireless module in the master switch to allocate an Internet Protocol address of the same network segment to the control platform of the master switch and controlling the wireless module in the master switch to start is entered; When an Internet Protocol address and / or a network management port message is detected and the current interaction mode is a wireless interaction mode, the control platform of the master switch is controlled to switch from a wireless interaction state to a wired interaction state, and the step of controlling the wireless terminal device to access the networking environment of the master device in a wired manner is entered; When an Internet Protocol address and / or a network management port message is detected and the current interaction mode is a wired interaction mode, the step of controlling the wireless terminal device to access the networking environment of the main control device via a wired mode is entered.

13. A computer program product, characterized in that A computer program / instruction is stored therein, and when the computer program / instruction is executed by a processor, the steps of the method for controlling a switch as claimed in any one of claims 1 to 12 are implemented.

14. A device for controlling a switch, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the method for controlling a switch according to any one of claims 1 to 12 when executing the computer program.

15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for controlling a switch according to any one of claims 1 to 12 are implemented.

Citation Information

Patent Citations

  • Configuration-free WiFi network system based on OpenFlow protocol and networking method

    CN105530599A

  • Method for testing terminal equipment based on test switch and test switch network

    CN116760756A