Switch management method, system, device and medium
By generating switch machine code and instantiating driver agent classes, the problem of switch management in the virtualization platform is solved, unified management of physical switches and network topology updates are realized, and detailed operation and maintenance support is provided.
Patent Information
- Application Number
- CN202310548107.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-12
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2043-05-12
AI Technical Summary
In the virtualization management platform, it is impossible to intuitively view the physical switches connected to the underlying layer, it is impossible to manage physical switch systems of multiple different manufacturers in a unified manner, and it is difficult to update the network topology.
By generating machine codes that match the switch type, registering to the cloud platform, and creating instantiated driver instances of driver agent classes, obtaining switch operating status data and managing them to the cloud platform.
It realizes unified management of physical switch systems of multiple manufacturers, displays network card configuration and aggregation information in detail, automatically updates the network topology structure, and provides a unified operation and maintenance interface.
Smart Images

Figure CN116566833B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computers, and in particular relates to a switch management method, system, device and medium. Background Art
[0002] Data traffic between hosts and virtual machines in the virtualization management platform relies on underlying physical switch links. Currently, the virtualization platform lacks direct visibility into the underlying physical switches, nor is it able to view the mapping between host network cards and physical switch ports, aggregation status, LLDP information, and real-time bandwidth utilization. Furthermore, physical switch systems from multiple vendors may not be integrated into the virtualization management platform for unified management and operation.
[0003] In other words, traditional implementations make it impossible to manage data center switches within the cloud platform, nor is it possible to establish a clear network topology between switches and specific servers. Furthermore, when both servers and switches change, it's difficult to effectively update the network topology.
[0004] Therefore, an effective method is urgently needed to solve the above problems. Summary of the Invention
[0005] To solve the above problems, the present invention proposes a switch management method, comprising:
[0006] Generate a machine code that uniquely matches the switch type based on the switch's device information and register the machine code with the cloud platform;
[0007] Creating a driver proxy class for each type of switch, and instantiating the driver proxy class into a corresponding driver instance based on the machine code of each type of switch;
[0008] The operating status data of the switch is obtained through the driver instance and the operating status data is managed in the cloud platform.
[0009] In some embodiments of the present invention, generating a machine code that uniquely matches the switch type based on the device information of the switch and registering the machine code with the cloud platform includes:
[0010] The switch device information is used to generate a unique machine code according to a predetermined algorithm, and a mapping relationship is established between one or more unique identification information in the device information and the machine code.
[0011] In some embodiments of the present invention, the method further comprises:
[0012] A query interface is provided for the user, and the machine code of the switch corresponding to the unique identification is determined according to the unique identification information input by the user, and the corresponding driver instance is called according to the machine code.
[0013] In some embodiments of the present invention, creating a driver proxy class for each type of switch and instantiating the driver proxy class into a corresponding driver instance based on the machine code of each type of switch includes:
[0014] Generate a driver class that calls the functional interface according to the switch's functional interface, instantiate the driver proxy class into a driver instance, and establish a mapping relationship between the instantiated driver instance of each type of switch and the machine code of each type;
[0015] In response to using a switch of a corresponding type, the switch is accessed by calling a driver instance corresponding to the switch through the machine code.
[0016] In some embodiments of the present invention, obtaining the operating status data of the switch through the driver instance and managing the operating status data in the cloud platform includes:
[0017] Obtaining the switch management address and management configuration data of the switch input by the user, and accessing the first interface of the switch based on the management configuration data through the first method of the corresponding driver instance and verifying whether the switch matches;
[0018] In response to a match as a result of the verification, a second interface of the switch is accessed through the second method of the driver instance to enable a link layer discovery function of the switch.
[0019] In some embodiments of the present invention, the method further comprises:
[0020] In response to the link layer discovery function of the switch being enabled, collecting link layer discovery data sent by the switch on each host of the cloud platform;
[0021] The link layer discovery data is parsed to obtain the port address of the corresponding switch, and a network topology relationship between the switch and the cloud host is created on the cloud platform based on the port address of the switch and the network address of the cloud host.
[0022] In some embodiments of the present invention, the method further comprises:
[0023] Access the third interface of the switch through the third method of the driver instance to obtain the operating status data of each port on the switch, and save the operating status data to the cloud platform.
[0024] Another aspect of the present invention further provides a switch management system, comprising:
[0025] A machine code generation module, configured to generate a machine code uniquely matching the switch type according to the device information of the switch and register the machine code with the cloud platform;
[0026] A driver instance application module configured to create a driver proxy class for each type of switch and instantiate the driver proxy class into a corresponding driver instance based on the machine code of each type of switch;
[0027] A switch management module is configured to obtain the operating status data of the switch through the driver instance and manage the operating status data in the cloud platform.
[0028] Yet another aspect of the present invention provides a computer device, comprising:
[0029] at least one processor; and
[0030] A memory storing computer instructions executable on the processor, wherein the instructions, when executed by the processor, implement the steps of any one of the methods described in the above embodiments.
[0031] Another aspect of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any one of the methods described in the above embodiments are implemented.
[0032] Through the switch management method proposed by the present invention, the user only needs to enter the corresponding switch model and other related information, and the corresponding driver instance can be automatically called to perform automatic management operations on the switch entered by the user, obtain switch information and manage it to the cloud platform. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. 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 any creative work.
[0034] Figure 1 A schematic diagram of a flow chart of a switch management method provided by an embodiment of the present invention;
[0035] Figure 2 A schematic diagram of the structure of a switch management system provided by an embodiment of the present invention;
[0036] Figure 3A schematic diagram of the structure of a computer device provided in an embodiment of the present invention;
[0037] Figure 4 A schematic diagram of the structure of a computer-readable storage medium provided in an embodiment of the present invention;
[0038] Figure 5 A schematic diagram of the management process of a switch management method provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0039] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the embodiments of the present invention are further described in detail below in conjunction with specific embodiments and with reference to the accompanying drawings.
[0040] It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are for distinguishing two non-identical entities with the same name or non-identical parameters. It can be seen that "first" and "second" are only for the convenience of expression and should not be understood as limitations on the embodiments of the present invention. Subsequent embodiments will not explain this one by one.
[0041] The present invention aims to solve the problem of switch management in traditional cloud platforms. In traditional implementation methods, the management of switches by cloud platforms is mostly done manually, and only the switches are displayed, but the role of the switches in the server cluster and the relationship between the switches and the network connections between the servers cannot be displayed.
[0042] like Figure 1 To solve the above problems, the present invention proposes a switch management method, comprising:
[0043] Step S1: Generate a machine code that uniquely matches the switch type based on the device information of the switch and register the machine code to the cloud platform;
[0044] Step S2: Create a driver proxy class for each type of switch, and instantiate the driver proxy class into a corresponding driver instance based on the machine code of each type of switch;
[0045] Step S3: Obtain the operating status data of the switch through the driver instance and manage the operating status data in the cloud platform.
[0046] In this embodiment, in step S1, the manufacturer, model, version, specifications, etc. of the switch system adapted by the cloud platform are first registered in the PSWitchProductType class within the cloud platform. After registration, a unique MachineCode is generated to distinguish the physical switch information.
[0047] In step S2, the cloud platform provides the MultiPSwitchSupportManagerImpl driver proxy class. Therefore, according to the switch model registered in step S1, a corresponding driver proxy class can be written for each switch to load different driver classes according to different switch information and initialize instances. Each time a machine code corresponding to a switch is generated, the driver proxy class corresponding to the switch model can be determined according to the machine code, and the proxy class can be instantiated into a driver instance.
[0048] In some implementations of the present invention, after the driver instance is instantiated, it is bound to the machine code. A HashMap data interface is added to the cloud platform, using the MachineCode generated in the first step as the key to store the generated driver class instance. This creates a key-value pair with the machine code as the key and the corresponding switch driver instance as the value. Furthermore, a corresponding query interface is provided on the cloud platform, namely the PSwitchDriverFactory connection factory class, which can retrieve driver instance information based on the switch model. This interface first finds the corresponding machine code based on the switch model, then determines the corresponding driver instance based on the machine code, or directly finds the corresponding driver instance based on the machine code.
[0049] In step S3, by driving the management address of the switch corresponding to the instance location and calling the device / devices API provided by the physical switch, the ManuFacture (manufacturer), SystemType (system type), and version (version information) of a physical switch device can be obtained, and the IP, user name, password, and manufacturer model can be verified to be legal.
[0050] Furthermore, by calling the corresponding API, the status information of each active port on the switch is obtained, and the status information of each port of the switch is managed to the cloud platform and matched with the corresponding server node according to the network connection, that is, the server and the switch that provides network support for the server are matched on the cloud platform.
[0051] Traditional cloud platforms can only detect the PCI device layer of the managed host nodes. However, the switch management method proposed in the present invention can manage the physical switch system functions of various manufacturers. There is no need to log in to the physical switch system platform one by one. The actual physical link topology information of the computer room can be detected, and the configuration information and aggregation information of each network card set on the physical switch end can be viewed in detail.
[0052] Specifically, Figure 5As shown, the switch driver class is pre-created based on the existing switch. After the cloud platform is deployed, the administrator can enter the switch model and other related information in the cloud platform to obtain the corresponding driver instance. Based on the specific switch management address entered by the user, the driver instance executes the relevant call operations on the switch, automatically completes the activation of the switch function and the collection of corresponding information, integrates the collected information into the cloud platform, and establishes the corresponding network topology relationship with the server based on the network information of the switch.
[0053] In some embodiments of the present invention, generating a machine code that uniquely matches the switch type based on the device information of the switch and registering the machine code with the cloud platform includes:
[0054] The switch device information is used to generate a unique machine code according to a predetermined algorithm, and a mapping relationship is established between one or more unique identification information in the device information and the machine code.
[0055] In some embodiments of the present invention, the method further comprises:
[0056] A query interface is provided for the user, and the machine code of the switch corresponding to the unique identification is determined according to the unique identification information input by the user, and the corresponding driver instance is called according to the machine code.
[0057] In some embodiments of the present invention, creating a driver proxy class for each type of switch and instantiating the driver proxy class into a corresponding driver instance based on the machine code of each type of switch includes:
[0058] Generate a driver class that calls the functional interface according to the switch's functional interface, instantiate the driver proxy class into a driver instance, and establish a mapping relationship between the instantiated driver instance of each type of switch and the machine code of each type;
[0059] In response to using a switch of a corresponding type, the switch is accessed by calling a driver instance corresponding to the switch through the machine code.
[0060] In some embodiments of the present invention, obtaining the operating status data of the switch through the driver instance and managing the operating status data in the cloud platform includes:
[0061] Obtaining the switch management address and management configuration data of the switch input by the user, and accessing the first interface of the switch based on the management configuration data through the first method of the corresponding driver instance and verifying whether the switch matches;
[0062] In response to a match as a result of the verification, a second interface of the switch is accessed through the second method of the driver instance to enable a link layer discovery function of the switch.
[0063] In some embodiments of the present invention, the method further comprises:
[0064] In response to the link layer discovery function of the switch being enabled, collecting link layer discovery data sent by the switch on each host of the cloud platform;
[0065] The link layer discovery data is parsed to obtain the port address of the corresponding switch, and a network topology relationship between the switch and the cloud host is created on the cloud platform based on the port address of the switch and the network address of the cloud host.
[0066] In this embodiment, the LLDP configuration API of the physical switch is called through the driver instance corresponding to the switch to enable the global LLDP function. Through the LLDP link layer discovery method, the information of the device connected to the bottom layer of the cloud platform host (including main capabilities, management address, device identification, interface identification, etc.) can be organized into different TLVs, and reported to the cloud platform through the host's LinkDiscoveryFeedBack. That is, after the LLDP function is turned on, the server connected to the corresponding port of the switch can obtain the device information and port information of the switch, and then the server reports it to the cloud platform, and further analyzes the network topology relationship between the server and the switch on the cloud platform. According to the switch information reported by the server, the corresponding switch is associated with the server on the cloud platform, and the corresponding associated port is set, that is, which network port on the server is connected to the server, to form such a network topology structure to realize the management of the switch on the cloud platform.
[0067] In some embodiments of the present invention, the method further comprises:
[0068] Access the third interface of the switch through the third method of the driver instance to obtain the operating status data of each port on the switch, and save the operating status data to the cloud platform.
[0069] In this embodiment, after adapting the corresponding driver instance to each type of switch, richer remote control of the switch can be achieved on the cloud platform. For example, by calling the physical switch's configuration loop detection / loops API, the global loop detection configuration can be turned off to reduce the switch system load; or by calling the physical switch's port / ports and / vlans APIs, the port, VLan, optical module, rate and other information of each switch device can be obtained, synchronized and saved to the cloud platform; or by calling the physical switch's aggregation / port_channels API, the aggregation port and algorithm information of each switch device can be obtained, synchronized and saved to the cloud platform.
[0070] Furthermore, on the cloud platform, the PCI information of the host network card and the physical link structure information detected by LLDP are used to perform port matching through IP and MAC matching rules, intuitively displaying the link topology used by each host in the computer room on the cloud platform.
[0071] The switch management method provided by the present invention provides a unified configuration interface on the virtualization platform, loads corresponding driver classes according to different manufacturers, and then synchronizes the underlying devices, ports, aggregations and utilization of the physical switches. At the same time, the real physical link information is detected through the physical switch LLDP and reported to the virtualization platform. Then, according to the IP and MAC matching rules, the corresponding underlying physical switch port detailed information can be more intuitively displayed from the host network card. In addition, a unified view is provided to display the physical switch IP, port, aggregation, and device information of all hosts connected to the virtualization platform, thereby improving system availability and facilitating customer operation and maintenance.
[0072] like Figure 2 As shown, another aspect of the present invention further provides a switch management system, comprising:
[0073] A machine code generation module 1 is configured to generate a machine code that uniquely matches the switch type based on the device information of the switch and register the machine code with the cloud platform;
[0074] A driver instance application module 2 is configured to create a driver proxy class for each type of switch and instantiate the driver proxy class into a corresponding driver instance based on the machine code of each type of switch;
[0075] The switch management module 3 is configured to obtain the operating status data of the switch through the driver instance and manage the operating status data in the cloud platform.
[0076] In some embodiments of the present invention, generating a machine code that uniquely matches the switch type based on the device information of the switch and registering the machine code with the cloud platform includes:
[0077] The switch device information is used to generate a unique machine code according to a predetermined algorithm, and a mapping relationship is established between one or more unique identification information in the device information and the machine code.
[0078] In some embodiments of the present invention, the method further comprises:
[0079] A query interface is provided for the user, and the machine code of the switch corresponding to the unique identification is determined according to the unique identification information input by the user, and the corresponding driver instance is called according to the machine code.
[0080] In some embodiments of the present invention, creating a driver proxy class for each type of switch and instantiating the driver proxy class into a corresponding driver instance based on the machine code of each type of switch includes:
[0081] Generate a driver class that calls the functional interface according to the switch's functional interface, instantiate the driver proxy class into a driver instance, and establish a mapping relationship between the instantiated driver instance of each type of switch and the machine code of each type;
[0082] In response to using a switch of a corresponding type, the switch is accessed by calling a driver instance corresponding to the switch through the machine code.
[0083] In some embodiments of the present invention, obtaining the operating status data of the switch through the driver instance and managing the operating status data in the cloud platform includes:
[0084] Obtaining the switch management address and management configuration data of the switch input by the user, and accessing the first interface of the switch based on the management configuration data through the first method of the corresponding driver instance and verifying whether the switch matches;
[0085] In response to a match as a result of the verification, a second interface of the switch is accessed through the second method of the driver instance to enable a link layer discovery function of the switch.
[0086] In some embodiments of the present invention, the method further comprises:
[0087] In response to the link layer discovery function of the switch being enabled, collecting link layer discovery data sent by the switch on each host of the cloud platform;
[0088] The link layer discovery data is parsed to obtain the port address of the corresponding switch, and a network topology relationship between the switch and the cloud host is created on the cloud platform based on the port address of the switch and the network address of the cloud host.
[0089] In some embodiments of the present invention, the method further comprises:
[0090] Access the third interface of the switch through the third method of the driver instance to obtain the operating status data of each port on the switch, and save the operating status data to the cloud platform.
[0091] like Figure 3 As shown, another aspect of the present invention further provides a computer device, comprising:
[0092] at least one processor 21; and
[0093] A memory 22 storing computer instructions 23 executable on the processor 21, wherein the instructions 23, when executed by the processor 21, implement a switch management method, including:
[0094] Generate a machine code that uniquely matches the switch type based on the switch's device information and register the machine code with the cloud platform;
[0095] Creating a driver proxy class for each type of switch, and instantiating the driver proxy class into a corresponding driver instance based on the machine code of each type of switch;
[0096] The operating status data of the switch is obtained through the driver instance and the operating status data is managed in the cloud platform.
[0097] In some embodiments of the present invention, generating a machine code that uniquely matches the switch type based on the device information of the switch and registering the machine code with the cloud platform includes:
[0098] The switch device information is used to generate a unique machine code according to a predetermined algorithm, and a mapping relationship is established between one or more unique identification information in the device information and the machine code.
[0099] In some embodiments of the present invention, the method further comprises:
[0100] A query interface is provided for the user, and the machine code of the switch corresponding to the unique identification is determined according to the unique identification information input by the user, and the corresponding driver instance is called according to the machine code.
[0101] In some embodiments of the present invention, creating a driver proxy class for each type of switch and instantiating the driver proxy class into a corresponding driver instance based on the machine code of each type of switch includes:
[0102] Generate a driver class that calls the functional interface according to the switch's functional interface, instantiate the driver proxy class into a driver instance, and establish a mapping relationship between the instantiated driver instance of each type of switch and the machine code of each type;
[0103] In response to using a switch of a corresponding type, the switch is accessed by calling a driver instance corresponding to the switch through the machine code.
[0104] In some embodiments of the present invention, obtaining the operating status data of the switch through the driver instance and managing the operating status data in the cloud platform includes:
[0105] Obtaining the switch management address and management configuration data of the switch input by the user, and accessing the first interface of the switch based on the management configuration data through the first method of the corresponding driver instance and verifying whether the switch matches;
[0106] In response to a match as a result of the verification, a second interface of the switch is accessed through the second method of the driver instance to enable a link layer discovery function of the switch.
[0107] In some embodiments of the present invention, the method further comprises:
[0108] In response to the link layer discovery function of the switch being enabled, collecting link layer discovery data sent by the switch on each host of the cloud platform;
[0109] The link layer discovery data is parsed to obtain the port address of the corresponding switch, and a network topology relationship between the switch and the cloud host is created on the cloud platform based on the port address of the switch and the network address of the cloud host.
[0110] In some embodiments of the present invention, the method further comprises:
[0111] Access the third interface of the switch through the third method of the driver instance to obtain the operating status data of each port on the switch, and save the operating status data to the cloud platform.
[0112] like Figure 4 As shown, another aspect of the present invention further provides a computer-readable storage medium 401, wherein the computer-readable storage medium 401 stores a computer program 402. When the computer program 402 is executed by a processor, a switch management method is implemented, including:
[0113] Generate a machine code that uniquely matches the switch type based on the switch's device information and register the machine code with the cloud platform;
[0114] Creating a driver proxy class for each type of switch, and instantiating the driver proxy class into a corresponding driver instance based on the machine code of each type of switch;
[0115] The operating status data of the switch is obtained through the driver instance and the operating status data is managed in the cloud platform.
[0116] In some embodiments of the present invention, generating a machine code that uniquely matches the switch type based on the device information of the switch and registering the machine code with the cloud platform includes:
[0117] The switch device information is used to generate a unique machine code according to a predetermined algorithm, and a mapping relationship is established between one or more unique identification information in the device information and the machine code.
[0118] In some embodiments of the present invention, the method further comprises:
[0119] A query interface is provided for the user, and the machine code of the switch corresponding to the unique identification is determined according to the unique identification information input by the user, and the corresponding driver instance is called according to the machine code.
[0120] In some embodiments of the present invention, creating a driver proxy class for each type of switch and instantiating the driver proxy class into a corresponding driver instance based on the machine code of each type of switch includes:
[0121] Generate a driver class that calls the functional interface according to the switch's functional interface, instantiate the driver proxy class into a driver instance, and establish a mapping relationship between the instantiated driver instance of each type of switch and the machine code of each type;
[0122] In response to using a switch of a corresponding type, the switch is accessed by calling a driver instance corresponding to the switch through the machine code.
[0123] In some embodiments of the present invention, obtaining the operating status data of the switch through the driver instance and managing the operating status data in the cloud platform includes:
[0124] Obtaining the switch management address and management configuration data of the switch input by the user, and accessing the first interface of the switch based on the management configuration data through the first method of the corresponding driver instance and verifying whether the switch matches;
[0125] In response to a match as a result of the verification, a second interface of the switch is accessed through the second method of the driver instance to enable a link layer discovery function of the switch.
[0126] In some embodiments of the present invention, the method further comprises:
[0127] In response to the link layer discovery function of the switch being enabled, collecting link layer discovery data sent by the switch on each host of the cloud platform;
[0128] The link layer discovery data is parsed to obtain the port address of the corresponding switch, and a network topology relationship between the switch and the cloud host is created on the cloud platform based on the port address of the switch and the network address of the cloud host.
[0129] In some embodiments of the present invention, the method further comprises:
[0130] Access the third interface of the switch through the third method of the driver instance to obtain the operating status data of each port on the switch, and save the operating status data to the cloud platform.
[0131] The above are exemplary embodiments disclosed in the present invention, but it should be noted that various changes and modifications may be made without departing from the scope of the embodiments disclosed in the claims. The functions, steps and / or actions of the method claims according to the disclosed embodiments described herein do not need to be performed in any particular order. In addition, although the elements disclosed in the embodiments of the present invention may be described or required in individual form, they may also be understood as multiple unless expressly limited to the singular.
[0132] It should be understood that, as used herein, the singular forms "a" and "an" are intended to include the plural forms as well, unless the context clearly supports an exception. It should also be understood that, as used herein, "and / or" is intended to include any and all possible combinations of one or more of the associated listed items.
[0133] The serial numbers of the embodiments disclosed in the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0134] Those skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware, or by a program to instruct the relevant hardware, and the program may be stored in a computer-readable storage medium, which may be a read-only memory, a disk, or an optical disk, etc.
[0135] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the disclosure of the embodiments of the present invention (including the claims) is limited to these examples. Within the spirit of the embodiments of the present invention, the technical features of the above embodiments or different embodiments may be combined, and there are many other variations of the different aspects of the embodiments of the present invention described above, which are not provided in detail for the sake of clarity. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present invention should be included within the scope of protection of the embodiments of the present invention.
Claims
1. A switch management method, characterized in that: include: Generate a machine code that uniquely matches the switch type based on the switch's device information and register the machine code with the cloud platform; Creating a driver proxy class for each type of switch, and instantiating the driver proxy class into a corresponding driver instance based on the machine code of each type of switch; Obtaining the operating status data of the switch through the driver instance and managing the operating status data in the cloud platform; The step of obtaining the operating status data of the switch through the driver instance and managing the operating status data in the cloud platform includes: Obtaining the switch management address and management configuration data of the switch input by the user, and accessing the first interface of the switch based on the management configuration data through the first method of the corresponding driver instance and verifying whether the switch matches; In response to a match as a result of the verification, a second interface of the switch is accessed through the second method of the driver instance to enable a link layer discovery function of the switch.
2. The method according to claim 1, characterized in that Generating a machine code that uniquely matches the switch type according to the device information of the switch and registering the machine code with the cloud platform includes: The switch device information is used to generate a unique machine code according to a predetermined algorithm, and a mapping relationship is established between one or more unique identification information in the device information and the machine code.
3. The method according to claim 2, characterized in that Also includes: A query interface is provided for the user, and the machine code of the switch corresponding to the unique identification is determined according to the unique identification information input by the user, and the corresponding driver instance is called according to the machine code.
4. The method according to claim 1, wherein The step of creating a driver proxy class for each type of switch and instantiating the driver proxy class into a corresponding driver instance based on the machine code of each type of switch includes: Generate a driver class that calls the functional interface according to the switch's functional interface, instantiate the driver proxy class into a driver instance, and establish a mapping relationship between the instantiated driver instance of each type of switch and the machine code of each type; In response to using a switch of a corresponding type, the switch is accessed by calling a driver instance corresponding to the switch through the machine code.
5. The method according to claim 1, wherein Also includes: In response to the link layer discovery function of the switch being enabled, collecting link layer discovery data sent by the switch on each host of the cloud platform; The link layer discovery data is parsed to obtain the port address of the corresponding switch, and a network topology relationship between the switch and the cloud host is created on the cloud platform based on the port address of the switch and the network address of the cloud host.
6. The method according to claim 1, characterized in that Also includes: Access the third interface of the switch through the third method of the driver instance to obtain the operating status data of each port on the switch, and save the operating status data to the cloud platform.
7. A switch management system, characterized in that: include: A machine code generation module, configured to generate a machine code uniquely matching the switch type according to the device information of the switch and register the machine code with the cloud platform; A driver instance application module configured to create a driver proxy class for each type of switch and instantiate the driver proxy class into a corresponding driver instance based on the machine code of each type of switch; A switch management module, configured to obtain operating status data of the switch through the driver instance and manage the operating status data in the cloud platform; The obtaining of the operating status data of the switch through the driver instance and managing the operating status data into the cloud platform includes: obtaining the switch management address input by the user and the management configuration data of the switch, and accessing the first interface of the switch based on the management configuration data through the first method of the corresponding driver instance and verifying whether the switch matches; in response to the verification result being a match, accessing the second interface of the switch through the second method of the driver instance to enable the switch link layer discovery function.
8. A computer device, characterized in that: include: at least one processor; as well as A memory storing computer instructions executable on the processor, wherein the instructions, when executed by the processor, implement the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
physical machine password setting method based on Openstack
CN109871680A
Method, device and system for receiving and managing physical server and storage medium
CN115567522A