Switch configuration management method, device, equipment and medium

By using a large language model in switch configuration management to perform keyword analysis and multi-database query on switch configuration requirements described in natural language, and determine target configuration commands, the accuracy and security problems of switch configuration command generation in the existing technology are solved, and a higher level of network management intelligence is achieved.

CN119603137APending Publication Date: 2025-03-11ISOFTSTONE INFORMATION TECHNOLOGY (GROUP) CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202411805323.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-09
Publication Date
2025-03-11

AI Technical Summary

Technical Problem

The existing switch configuration command generation scheme based on large language models has accuracy and security problems, and it is easy to generate invalid, erroneous or unsafe commands, resulting in network failures and security risks.

Method used

By obtaining the switch configuration requirements described by the user's natural language, using a large language model to analyze keywords, determining multiple target query statements, and determining target configuration commands based on multiple database query results to ensure the accuracy and security of the configuration.

Benefits of technology

It effectively reduces the error rate, ensures the accuracy and security of switch configuration commands, thereby improving the intelligence level of network management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119603137A_ABST
    Figure CN119603137A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a switch configuration management method and device, equipment and a medium. The method comprises the following steps: acquiring a switch configuration requirement input by a target object; wherein the switch configuration requirement is described based on a natural language; performing keyword analysis on the switch configuration demand by using a large language model to obtain an analysis result, and determining a plurality of target query statements according to a preset generation mode and the analysis result; wherein the preset generation mode is determined based on a database type; querying the plurality of target databases according to the target query statement to obtain a query result, and determining a target configuration command according to the query result; and sending the target configuration command to the target switch, and executing the target configuration command through the target switch to obtain an execution result. According to the technical scheme, the target configuration command is determined based on the multi-database query result by using the large language model, so that the error rate can be effectively reduced, the configuration accuracy and safety are ensured, and the intelligent level of network management is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] In modern network management, switch configuration and operation are the key to the normal operation of the network. However, the traditional command line interface (CLI) operation method requires administrators to have professional knowledge and rich experience. Due to the complexity and large number of CLI commands, human errors are prone to occur during operation, resulting in network failures and security risks.

[0003] With the development of Large Language Model (LLM), it is possible to use natural language to configure switches. Among the existing solutions for generating switch configuration commands based on LLM, the most common method is to directly use the language patterns and command syntax accumulated during LLM training to convert the user's natural language description into switch configuration commands.

[0004] However, LLM has problems such as hallucinations, that is, when the model generates text, it may output content that is inconsistent with facts or logic, such as invalid, erroneous, or unsafe commands. This phenomenon may bring risks, especially when generating technical configuration commands, because any errors in network configuration may cause service interruptions or security vulnerabilities. Therefore, the above solution cannot ensure the accuracy and security of switch configuration commands, which is not conducive to intelligent network management. Summary of the invention

[0005] The present invention provides a switch configuration management method, device, equipment and medium, which utilizes a large language model to determine the target configuration command based on multi-database query results, can effectively reduce the error rate, ensure the accuracy and security of the configuration, and thus improve the intelligence level of network management.

[0006] According to one aspect of the present invention, a switch configuration management method is provided, the method comprising:

[0007] Obtaining switch configuration requirements input by a target object; wherein the switch configuration requirements are described based on a natural language;

[0008] Using a large language model to perform keyword analysis on the switch configuration requirements to obtain analysis results, and determining multiple target query statements according to a preset generation method and the analysis results; wherein the preset generation method is determined based on a database type;

[0009] Querying multiple target databases according to the target query statement to obtain query results, and determining a target configuration command according to the query results;

[0010] The target configuration command is sent to the target switch, and the target configuration command is executed by the target switch to obtain an execution result.

[0011] According to another aspect of the present invention, a switch configuration management device is provided, the device comprising:

[0012] A switch configuration requirement acquisition module, used to acquire the switch configuration requirement input by the target object; wherein the switch configuration requirement is described based on natural language;

[0013] A target query statement determination module is used to perform keyword analysis on the switch configuration requirements using a large language model to obtain analysis results, and determine multiple target query statements according to a preset generation method and the analysis results; wherein the preset generation method is determined based on a database type;

[0014] A target configuration command determination module is used to query multiple target databases according to the target query statement to obtain query results, and determine the target configuration command according to the query results;

[0015] The target configuration command execution module is used to send the target configuration command to the target switch, and execute the target configuration command through the target switch to obtain an execution result.

[0016] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0017] at least one processor; and,

[0018] a memory communicatively connected to the at least one processor; wherein,

[0019] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the switch configuration management method described in any embodiment of the present invention.

[0020] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the switch configuration management method described in any embodiment of the present invention when executed.

[0021] The technical solution of the embodiment of the present invention obtains the switch configuration requirements input by the target object; wherein the switch configuration requirements are described based on natural language; the switch configuration requirements are analyzed by keywords using a large language model to obtain analysis results, and multiple target query statements are determined according to a preset generation method and the analysis results; wherein the preset generation method is determined based on the database type; multiple target databases are queried according to the target query statement to obtain query results, and target configuration commands are determined according to the query results; the target configuration commands are sent to the target switch, and the target configuration commands are executed by the target switch to obtain execution results. This technical solution uses a large language model to determine the target configuration command based on the query results of multiple databases, which can effectively reduce the error rate, ensure the accuracy and security of the configuration, and thus improve the intelligence level of network management.

[0022] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of 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 creative work.

[0024] Figure 1 is a flow chart of a switch configuration management method provided according to Embodiment 1 of the present invention;

[0025] Figure 2 is a schematic diagram of a switch configuration management method provided according to Embodiment 1 of the present invention;

[0026] Figure 3 is a flow chart of a switch configuration management method provided according to Embodiment 2 of the present invention;

[0027] Figure 4 is a structural diagram of a switch configuration management device provided according to Embodiment 3 of the present invention;

[0028] Figure 5 It is a structural schematic diagram of an electronic device for implementing a switch configuration management method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0029] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings 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 should fall within the scope of protection of the present invention.

[0030] It should be noted that the terms "first", "second", "target", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0031] Embodiment 1

[0032] Figure 1 This is a flow chart of a switch configuration management method provided in the first embodiment of the present invention. This embodiment is applicable to the situation of accurately and safely configuring a switch. The method can be executed by a switch configuration management device. The switch configuration management device can be implemented in the form of hardware and / or software. The switch configuration management device can be configured in an electronic device with data processing capabilities. Figure 1 As shown, the method includes:

[0033] S110, obtaining a switch configuration requirement input by a target object; wherein the switch configuration requirement is described based on a natural language.

[0034] In this embodiment, the switch configuration requirement input by the target object in natural language is first obtained. The target object can be understood as the target user. Exemplarily, the switch configuration requirement is "please set switch port 1 to VLAN 10 and enable port security". Port security can be used to check whether the MAC address is consistent with the system's pre-stored one. If it is inconsistent, it is considered an illegal device.

[0035] S120, using the large language model to perform keyword analysis on the switch configuration requirements to obtain analysis results, and determining multiple target query statements according to a preset generation method and the analysis results.

[0036] In this embodiment, after obtaining the switch configuration requirements, the switch configuration requirements can be input into a pre-trained large language model, and the large language model is used to perform keyword parsing (such as "port", "VLAN", "port security", etc.) on the switch configuration requirements to obtain a parsing result. For example, taking the switch configuration requirement of "please set port 1 to port 10 of the switch to VLAN 20, and enable port security" as an example, the switch configuration requirement is first parsed by using LLM to obtain the following parsing results: target port: port 1 to port 10; VLAN ID: 20; operation: configure VLAN, enable port security.

[0037] After obtaining the parsing results, multiple target query statements can be determined according to the preset generation method and the parsing results. Among them, the preset generation method can be understood as a query statement generation rule pre-set based on the database type, that is, one database type corresponds to one preset generation method. The target query statement can be used to query multiple source databases. Specifically, the query statement template is determined according to the preset generation method, and the parsing result is filled into the query statement template to obtain the target query statement.

[0038] It should be noted that in this embodiment, multiple database resources are pre-established, for example: instance databases (one or more) corresponding to different services, which are used to store historical configuration instances and corresponding historical configuration commands; conflict detection databases, including detection conditions or rules that may easily cause configuration conflicts, which can be used to detect the conflicts of configuration commands; high-risk operation databases, which are used to record high-risk operations that may easily lead to network risks and their impacts; current configuration databases, which record the configuration status of the current switch (such as port status and mode, etc.), which can be used to understand the global context of the switch configuration.

[0039] Exemplarily, if the historical configuration instance is "configure port 1 to port 10 to VLAN 20 and enable port security", the corresponding historical configuration commands are: interface range GigabitEthernet0 / 1-10; switchport mode access; switchport access vlan 20; switchport port-security. Exemplarily, the conflict detection database includes the following detection rules: Rule 1: If the port is configured in trunk mode, it cannot be configured in access mode; Rule 2: Whether the VLAN ID is already occupied to avoid duplication or conflict. Exemplarily, the high-risk operation database includes the following high-risk operations: Operation 1: Change the VLAN configuration of the core switch; Operation 2: Enable or disable port security in a production environment. Exemplarily, the current configuration database includes the following configuration status: Port status: Ports 1-5 are configured to VLAN 10, and ports 6-10 are not configured with VLAN; Port mode: All ports are in access mode by default.

[0040] In addition, in this embodiment, a natural language processing template is pre-set for LLM, specifically including a database query strategy and a database query statement generation rule (i.e., a preset generation method). Among them, the database query strategy may include the query order of multiple databases and the contribution priority of each database to the result. Exemplarily, the query order may be set to: 1. Instance database; 2. Current configuration database; 3. Conflict detection database; 4. High-risk operation database. The contribution priority may be set to: instance database and conflict detection database as high priority, and high-risk operation database and current configuration database as medium priority.

[0041] S130, querying multiple target databases according to the target query statement to obtain query results, and determining the target configuration command according to the query results.

[0042] The target database may refer to a pre-set multi-source database, which may specifically include an instance database, a current configuration database, a conflict detection database, and a high-risk operation database. The target configuration command may refer to a configuration command that is ultimately sent to the switch. In this embodiment, after determining the target query statement, each target database may be queried according to the target query statement to obtain the corresponding query result, and the LLM may be used to integrate the query results to obtain the target configuration command.

[0043] In this embodiment, optionally, the target database includes an instance database, which is used to store historical configuration instances and corresponding historical configuration commands; accordingly, multiple target databases are queried according to the target query statement to obtain query results, including: querying the historical configuration instances in the instance database according to the target query statement, and determining the historical configuration instance matching the target query statement as the target configuration instance; determining a reference configuration command according to the historical configuration command corresponding to the target configuration instance and the parsing result, and determining the reference configuration command as the first query result.

[0044] Specifically, when querying the instance database according to the target query statement, first find the historical configuration instance that matches the target query statement, and determine it as the target configuration instance. Then, based on the parsing result, modify the configuration parameters in the historical configuration command corresponding to the target configuration instance to obtain a reference configuration command, and determine the reference configuration command as the first query result. It can be understood that if the parsing result is consistent with the configuration parameters in the historical configuration command corresponding to the target configuration instance, there is no need to modify the configuration parameters, and the historical configuration command corresponding to the target configuration instance can be directly used as the reference configuration command.

[0045] For example, if the switch configuration requirement is "please set the switch ports 1 to 10 to VLAN 20 and enable port security", the corresponding parsing result is: target port: port 1 to port 10; VLAN ID: 20; operation: configure VLAN, enable port security. At this time, you can use the configuration port range, set VLAN and enable port security as the query conditions of the instance database, and obtain the following historical configuration commands after query: interface rangeGigabitEthernet0 / 1-10; switchport mode access; switchport access vlan 20; switchport port-security. Comparing the above historical configuration commands with the parsing results, it is found that the configuration parameters in the historical configuration commands are consistent with the parsing results. At this time, the above historical configuration commands can be directly determined as reference configuration commands.

[0046] Through such a setting, this solution can quickly and preliminarily determine the configuration command that matches the switch configuration requirements based on the query results of the instance database, which serves as an important basis for the final configuration command.

[0047] In this embodiment, optionally, the target database also includes a current configuration database, which is used to record the configuration status of the current switch; accordingly, querying multiple target databases according to the target query statement to obtain the query result also includes: querying the configuration status in the current configuration database according to the target query statement, and taking the configuration status matching the target query statement as the second query result.

[0048] The configuration status may include whether the port is configured and its corresponding configuration content. For example, if the switch configuration requirement is "please set the switch ports 1 to 10 to VLAN 20 and enable port security", the current configuration status of ports 1 to 10 can be obtained by querying the current configuration database according to the target query statement, for example, ports 1-5 have been configured as VLAN 10, and ports 6-10 have not been configured with VLAN. At this time, the current configuration status of ports 1 to 10 can be determined as the second query result.

[0049] Through such a setting, this solution can quickly determine the current switch configuration state that matches the switch configuration requirements based on the current configuration database query result, which serves as an important basis for subsequent conflict detection.

[0050] In this embodiment, optionally, the target database also includes a conflict detection database, which is used to store detection conditions that are likely to cause configuration conflicts; accordingly, querying multiple target databases according to the target query statement to obtain query results also includes: querying the detection conditions in the conflict detection database according to the first query result and the second query result, judging whether there is a configuration conflict in the reference configuration command, and determining a third query result based on the judgment result.

[0051] Specifically, after obtaining the first query result and the second query result, the conflict detection database can be queried based on the above two query results, and based on the detection conditions in the conflict detection database, it is determined whether there is a configuration conflict between the reference configuration command and the current configuration state of the switch, thereby determining the third query result. Exemplarily, still taking the switch configuration requirement of "please set the switch's ports 1 to 10 to VLAN 20, and enable port security" as an example, the following detection rules can be obtained by querying the conflict detection database: Ports 1-5 are changed from VLAN 10 to VLAN 20, which may affect the current network traffic; check whether VLAN 20 already exists or has a conflict.

[0052] Through such a setting, the present solution can quickly determine whether there is a configuration conflict between the reference configuration command and the current configuration state of the switch based on the query result of the conflict detection database, which serves as an important basis for judging whether the reference configuration command is correct and effective.

[0053] In this embodiment, optionally, the target database also includes a high-risk operation database, which is used to record high-risk operations that are likely to cause network risks and their impacts; accordingly, querying multiple target databases according to the target query statement to obtain query results also includes: querying the high-risk operations in the high-risk operation database according to the first query result, judging whether the reference configuration command belongs to a high-risk operation, and determining a fourth query result based on the judgment result.

[0054] For example, still taking the switch configuration requirement of "Please set port 1 to port 10 of the switch to VLAN 20 and enable port security", the following matching results can be obtained by querying the high-risk operation database: Changing the port VLAN configuration: may affect the network, but it is not a high-risk operation; Enabling port security: operate in a production environment, be cautious.

[0055] Through such a setting, this solution can quickly determine whether the reference configuration command belongs to a high-risk operation based on the query result of the high-risk operation database, which serves as an important basis for judging the security of the reference configuration command.

[0056] In this embodiment, optionally, determining the target configuration command based on the query result includes: if the reference configuration command does not have a configuration conflict and does not belong to a high-risk operation, determining the reference configuration command as the target configuration command; if the reference configuration command has a configuration conflict or belongs to a high-risk operation, generating a configuration error prompt message, and sending the configuration error prompt message to the target object.

[0057] Specifically, after obtaining the query results of each target database, LLM can be used to integrate the query results. If the reference configuration command does not have a configuration conflict and does not belong to a high-risk operation, it indicates that the reference configuration command is a correct, effective and safe configuration command. At this time, the reference configuration command can be directly determined as the target configuration command; if the reference configuration command has a configuration conflict or belongs to a high-risk operation, it indicates that the reference configuration command may have certain problems in terms of correctness, effectiveness and security. At this time, it is necessary to generate a configuration error prompt message (used to remind that the generated reference configuration command has an error), and send the configuration error prompt message to the target object, and the target object determines whether to continue the current configuration change operation. Among them, the configuration error prompt message can include the reference configuration command and its error cause, and the configuration error prompt message can be reminded in the form of a prompt box, or it can be fed back in the form of an operation log through SMS or email.

[0058] Furthermore, if the target object still confirms to continue the configuration change operation after receiving the configuration error prompt information, the reference configuration command can also be used as the target configuration command. Exemplarily, the configuration error prompt information is "Ports 1-5 have been configured as VLAN 10. Reconfiguring them as VLAN 20 will overwrite the original settings and may affect the current network traffic. Do you want to continue? (Yes / No)". In addition, LLM can also be used to provide a solution for the target object based on the configuration error prompt information, such as generating a new configuration command.

[0059] Through such a setting, the present solution can quickly and accurately determine the target configuration command based on the reference configuration command when it is determined that the reference configuration command does not have a configuration conflict and does not belong to a high-risk operation; when it is determined that the reference configuration command has a configuration conflict or belongs to a high-risk operation, a configuration error prompt message is generated to remind the user that there is a configuration error.

[0060] S140, sending the target configuration command to the target switch, and executing the target configuration command through the target switch to obtain an execution result.

[0061] In this embodiment, after obtaining a correct, effective and secure target configuration command, the target configuration command can be sent to the target switch, and the target switch executes the target configuration command to obtain an execution result. The target switch can be understood as a switch with a configuration requirement. Exemplarily, the execution result can include whether the execution is successful and the corresponding execution change content.

[0062] Figure 2 Schematic diagram of a switch configuration management method provided in Embodiment 1 of the present invention. Figure 2 As shown, first determine whether the input command from the command line / WEB interface is in natural language mode. If so, use the internal or third-party LLM to perform natural language processing on the input command based on the switch natural language processing framework; otherwise, determine the command line sequence manually, and send the command lines to the switch configuration interface in batches after manual confirmation, so that the switch can perform business processing according to the sent command lines. For example, switch business processing can be performed based on HAL (Hardware Abstraction Layer) and SDK (Software Development Kit) API (Application Programming Interface).

[0063] Exemplarily, if the input command is "please configure VLAN 20 of port 1 to port 10 of the switch and enable port security", it can be determined that the input command belongs to the natural language mode, and the natural language processing process will be started at this time. Specifically, firstly, the LLM is obtained through the communication interface, and then the input command is task-decomposed through the LLM (that is, the input command is keyword-parsed, and multiple target query statements are generated based on the parsing results), and then a sub-task query is performed based on a pre-set multi-source switch database (including each business instance database, conflict detection database, high-risk operation database and current configuration database, etc.) (that is, the above multiple databases are queried according to the target query statement), and then task merging and optimization are performed (that is, the query results of multiple databases are integrated) to obtain the target configuration command. After obtaining the target configuration command, the target configuration command can be sent to the target switch, and the target configuration command is executed by the target switch to obtain the execution result.

[0064] The technical solution of the embodiment of the present invention obtains the switch configuration requirements input by the target object; wherein the switch configuration requirements are described based on natural language; the switch configuration requirements are analyzed by keywords using a large language model to obtain analysis results, and multiple target query statements are determined according to a preset generation method and the analysis results; wherein the preset generation method is determined based on the database type; multiple target databases are queried according to the target query statement to obtain query results, and target configuration commands are determined according to the query results; the target configuration commands are sent to the target switch, and the target configuration commands are executed by the target switch to obtain execution results. This technical solution uses a large language model to determine the target configuration command based on the query results of multiple databases, which can effectively reduce the error rate, ensure the accuracy and security of the configuration, and thus improve the intelligence level of network management.

[0065] Embodiment 2

[0066] Figure 3 A flow chart of a switch configuration management method provided in Embodiment 2 of the present invention, this embodiment is optimized based on the above embodiment. The specific optimization is: after executing the target configuration command through the target switch to obtain the execution result, it also includes: determining whether the target configuration command is executed successfully according to the execution result, and determining whether the current network status is normal; if the target configuration command fails to execute or the current network status is abnormal, a configuration failure prompt message is generated, and the configuration failure prompt message is sent to the target object.

[0067] like Figure 3 As shown, the method of this embodiment specifically includes the following steps:

[0068] S210, obtaining a switch configuration requirement input by a target object; wherein the switch configuration requirement is described based on a natural language.

[0069] S220, using the large language model to perform keyword analysis on the switch configuration requirements to obtain analysis results, and determining multiple target query statements according to a preset generation method and the analysis results.

[0070] Among them, the preset generation method is determined based on the database type.

[0071] S230, query multiple target databases according to the target query statement to obtain query results, and determine the target configuration command according to the query results.

[0072] S240, sending the target configuration command to the target switch, and executing the target configuration command through the target switch to obtain an execution result.

[0073] Among them, the specific implementation method of S210-S240 can refer to the relevant description in the above-mentioned embodiment 1, and will not be repeated here.

[0074] S250, determining whether the target configuration command is executed successfully according to the execution result, and determining whether the current network status is normal.

[0075] It should be noted that in order to prevent errors generated during the configuration command execution process from affecting the switch configuration change, this embodiment adds an execution result monitoring link, that is, determining whether the target configuration command is executed successfully and determining whether the current network status is normal based on the execution result.

[0076] S260: If the target configuration command fails to execute or the current network status is abnormal, a configuration failure prompt message is generated and sent to the target object.

[0077] In this embodiment, after determining that the target configuration command execution fails or the current network status is abnormal, configuration failure prompt information (used to remind the switch configuration change failure) can be generated in time, and the configuration failure prompt information is sent to the target object. Among them, the configuration failure prompt information may include the content of the configuration failure and the cause of the error, and the configuration failure prompt information can be reminded in the form of a prompt box, or can be fed back in the form of an operation log through SMS or email.

[0078] The technical solution of the embodiment of the present invention, after executing the target configuration command through the target switch to obtain the execution result, determines whether the target configuration command is executed successfully and determines whether the current network status is normal according to the execution result; if the target configuration command fails to execute or the current network status is abnormal, a configuration failure prompt message is generated and sent to the target object. This technical solution can quickly determine whether the switch configuration change is successful through execution result monitoring, so as to promptly remind the user in case of configuration change failure, which helps to improve the success rate of configuration change.

[0079] Embodiment 3

[0080] Figure 4 This is a schematic diagram of the structure of a switch configuration management device provided in Embodiment 3 of the present invention. The device can execute the switch configuration management method provided in any embodiment of the present invention and has the corresponding functional modules and beneficial effects of the execution method. Figure 4 As shown, the device comprises:

[0081] The switch configuration requirement acquisition module 310 is used to acquire the switch configuration requirement input by the target object; wherein the switch configuration requirement is described based on natural language;

[0082] The target query statement determination module 320 is used to perform keyword analysis on the switch configuration requirements using a large language model to obtain analysis results, and determine multiple target query statements according to a preset generation method and the analysis results; wherein the preset generation method is determined based on a database type;

[0083] A target configuration command determination module 330 is used to query multiple target databases according to the target query statement to obtain query results, and determine the target configuration command according to the query results;

[0084] The target configuration command execution module 340 is used to send the target configuration command to the target switch, and execute the target configuration command through the target switch to obtain an execution result.

[0085] Optionally, the target database includes an instance database, and the instance database is used to store historical configuration instances and corresponding historical configuration commands;

[0086] Accordingly, the target configuration command determination module 330 is used to:

[0087] Querying the historical configuration instances in the instance database according to the target query statement, and determining the historical configuration instances matching the target query statement as target configuration instances;

[0088] A reference configuration command is determined according to the historical configuration command corresponding to the target configuration instance and the parsing result, and the reference configuration command is determined as the first query result.

[0089] Optionally, the target database further includes a current configuration database, and the current configuration database is used to record the configuration status of the current switch;

[0090] Accordingly, the target configuration command determination module 330 is further used to:

[0091] The configuration status in the current configuration database is queried according to the target query statement, and the configuration status matching the target query statement is used as the second query result.

[0092] Optionally, the target database further includes a conflict detection database, and the conflict detection database is used to store detection conditions that are likely to cause configuration conflicts;

[0093] Accordingly, the target configuration command determination module 330 is further used to:

[0094] The detection conditions in the conflict detection database are queried according to the first query result and the second query result to determine whether there is a configuration conflict in the reference configuration command, and a third query result is determined according to the determination result.

[0095] Optionally, the target database further includes a high-risk operation database, which is used to record high-risk operations that are likely to cause network risks and their impacts;

[0096] Accordingly, the target configuration command determination module 330 is further used to:

[0097] The high-risk operations in the high-risk operation database are queried according to the first query result to determine whether the reference configuration command belongs to a high-risk operation, and a fourth query result is determined according to the determination result.

[0098] Optionally, the target configuration command determination module 330 is further configured to:

[0099] If the reference configuration command does not have a configuration conflict and does not belong to a high-risk operation, determining the reference configuration command as a target configuration command;

[0100] If the reference configuration command has a configuration conflict or is a high-risk operation, a configuration error prompt message is generated and sent to the target object.

[0101] Optionally, the device further comprises: an execution result monitoring module, configured to:

[0102] After executing the target configuration command through the target switch to obtain an execution result, determining whether the target configuration command is successfully executed and determining whether the current network status is normal according to the execution result;

[0103] If the target configuration command fails to execute or the current network state is abnormal, configuration failure prompt information is generated and sent to the target object.

[0104] A switch configuration management device provided by an embodiment of the present invention can execute a switch configuration management method provided by any embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution method.

[0105] Embodiment 4

[0106] Figure 5 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0107] like Figure 5 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0108] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0109] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a switch configuration management method.

[0110] In some embodiments, the switch configuration management method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the switch configuration management method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the switch configuration management method in any other appropriate manner (e.g., by means of firmware).

[0111] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0112] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0113] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0114] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0115] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0116] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0117] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0118] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A switch configuration management method, characterized in that: The method comprises: Obtaining switch configuration requirements input by a target object; wherein the switch configuration requirements are described based on a natural language; Using a large language model to perform keyword analysis on the switch configuration requirements to obtain analysis results, and determining multiple target query statements according to a preset generation method and the analysis results; wherein the preset generation method is determined based on a database type; Querying multiple target databases according to the target query statement to obtain query results, and determining a target configuration command according to the query results; The target configuration command is sent to the target switch, and the target configuration command is executed by the target switch to obtain an execution result.

2. The method according to claim 1, characterized in that: The target database includes an instance database, and the instance database is used to store historical configuration instances and corresponding historical configuration commands; Correspondingly, querying multiple target databases according to the target query statement to obtain query results includes: Querying the historical configuration instances in the instance database according to the target query statement, and determining the historical configuration instances matching the target query statement as target configuration instances; A reference configuration command is determined according to the historical configuration command corresponding to the target configuration instance and the parsing result, and the reference configuration command is determined as the first query result.

3. The method according to claim 2, characterized in that The target database also includes a current configuration database, and the current configuration database is used to record the configuration status of the current switch; Correspondingly, querying multiple target databases according to the target query statement to obtain query results also includes: The configuration status in the current configuration database is queried according to the target query statement, and the configuration status matching the target query statement is used as the second query result.

4. The method according to claim 3, characterized in that The target database also includes a conflict detection database, which is used to store detection conditions that are likely to cause configuration conflicts; Correspondingly, querying multiple target databases according to the target query statement to obtain query results also includes: The detection conditions in the conflict detection database are queried according to the first query result and the second query result to determine whether there is a configuration conflict in the reference configuration command, and a third query result is determined according to the determination result.

5. The method according to claim 4, characterized in that The target database also includes a high-risk operation database, which is used to record high-risk operations that are likely to cause network risks and their impacts; Correspondingly, querying multiple target databases according to the target query statement to obtain query results also includes: The high-risk operations in the high-risk operation database are queried according to the first query result to determine whether the reference configuration command belongs to a high-risk operation, and a fourth query result is determined according to the determination result.

6. The method according to claim 5, characterized in that Determining a target configuration command according to the query result includes: If the reference configuration command does not have a configuration conflict and does not belong to a high-risk operation, determining the reference configuration command as a target configuration command; If the reference configuration command has a configuration conflict or is a high-risk operation, a configuration error prompt message is generated and sent to the target object.

7. The method according to claim 1, characterized in that After the target switch executes the target configuration command to obtain an execution result, the method further includes: Determining whether the target configuration command is executed successfully and determining whether the current network status is normal according to the execution result; If the target configuration command fails to execute or the current network state is abnormal, configuration failure prompt information is generated and sent to the target object.

8. A switch configuration management device, characterized in that: The device comprises: A switch configuration requirement acquisition module, used to acquire the switch configuration requirement input by the target object; wherein the switch configuration requirement is described based on natural language; A target query statement determination module is used to perform keyword analysis on the switch configuration requirements using a large language model to obtain analysis results, and determine multiple target query statements according to a preset generation method and the analysis results; wherein the preset generation method is determined based on a database type; A target configuration command determination module is used to query multiple target databases according to the target query statement to obtain query results, and determine the target configuration command according to the query results; The target configuration command execution module is used to send the target configuration command to the target switch, and execute the target configuration command through the target switch to obtain an execution result.

9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the switch configuration management method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the switch configuration management method according to any one of claims 1 to 7 when executed.

Citation Information

Cited By

  • Switch automatic configuration method and system, and medium

    CN120710861A

  • A method, system, and medium for automatic configuration of a switch

    CN120710861B

  • Configuration method and device of storage cluster, electronic equipment and storage medium

    CN120762781A