Switch instruction optimization method, medium and system

Through the weighted multi-objective optimization model and large language model to optimize switch instructions, the problem of switch instructions relying on manual optimization and lack of automation in the existing technology is solved, and the automation of switch performance and multi-objective optimization are achieved, which improves the efficiency and flexibility of network operations.

CN120110897AActive Publication Date: 2025-06-06青岛网信信息科技有限公司
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202510312974.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-17
Publication Date
2025-06-06
Estimated Expiration
2045-03-17

AI Technical Summary

Technical Problem

In the prior art, switch instructions rely on manual optimization configuration, lack of automation capabilities, resulting in inefficiency, difficulty in taking into account multiple performance indicators, and difficulty in real-time optimization.

Method used

The weighted multi-objective optimization model is used to calculate the optimal switch adjustment parameters, and the preliminary switch instructions are optimized through the large language model to generate optimized instructions. The method includes collecting switch network parameters, generating preliminary instructions, inputting them into a large language model for optimization, and performing syntax and logic verification.

Benefits of technology

It realizes automation of switch performance, multi-objective optimization and interpretability, improves the comprehensive level of switch performance, and enhances the flexibility and efficiency of network operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120110897A_ABST
    Figure CN120110897A_ABST
Patent Text Reader

Abstract

The invention provides a switch instruction optimization method, medium and system, and belongs to the technical field of large language models.The method comprises the steps that network parameters of a switch are collected; calculating an optimal switch adjustment parameter by using a weighted multi-objective optimization model; generating a preliminary switch instruction according to the optimal switch adjustment parameter and a preset preliminary instruction generation template; inputting the preliminary switch instruction and the acquired network parameters of the switch into a large language model which is finely adjusted in advance to generate an optimized switch instruction; performing grammar check and logic verification on the optimized switch instruction to ensure the correctness and the performability of the instruction; and sending the verified switch instruction to operation and maintenance personnel. The invention provides a more intelligent and self-adaptive switch instruction performance optimization method, and solves the technical problem that a switch instruction in the prior art depends on manual optimization configuration and lacks automation capability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of large language models, and in particular, relates to a switch instruction optimization method, medium and system. Background Art

[0002] As the core equipment in data centers and enterprise networks, the performance of network switches directly affects the stability and throughput of the entire network. In recent years, with the rapid development of emerging technologies such as the Internet of Things and cloud computing, the scale of networks has continued to expand, and the performance requirements for switches have also increased. Switches need to process a large amount of data traffic at the same time to ensure key performance indicators such as low latency, low packet loss rate, and high bandwidth utilization. At the same time, it is also necessary to take into account the requirements of energy consumption, security, manageability, etc. to achieve efficient, stable and sustainable operation of the network.

[0003] At present, switch performance optimization mainly depends on the experience and manual configuration of network engineers. Engineers need to optimize switch performance by adjusting various switch parameters such as queue length, bandwidth allocation, routing strategy, etc. according to the actual network conditions. This method has some problems: 1. Manual configuration is inefficient. For large and complex networks, there are many parameters that need to be adjusted. It is difficult for engineers to fully grasp the relationship and impact between the parameters, and the optimization process is cumbersome and time-consuming.

[0004] 2. It is difficult to balance multiple performance indicators. Usually, there are certain contradictions and trade-offs between switch performance indicators. For example, improving throughput may sacrifice latency, and reducing energy consumption may affect bandwidth utilization. It is difficult to find the best balance between multiple indicators through manual configuration.

[0005] 3. Lack of automation capabilities. Switch performance changes dynamically with network load and requires continuous monitoring and real-time optimization. However, existing methods are difficult to automate and rely on continuous manual intervention by engineers.

[0006] In summary, the switch instructions in the prior art rely on manual optimization configuration and have the technical problem of lack of automation capability. Summary of the invention

[0007] In view of this, the present invention provides a switch instruction optimization method, medium and system, which can solve the technical problem in the prior art that switch instructions rely on manual optimization configuration and lack automation capabilities.

[0008] The present invention is achieved in that: A first aspect of the present invention provides a switch instruction optimization method, comprising the following steps: S10, collecting network parameters of the switch; S20, calculating the optimal switch adjustment parameters using a weighted multi-objective optimization model; S30, according to the optimal switch adjustment parameters, according to the preset preliminary instruction generation template, generate preliminary switch instructions; S40, inputting the preliminary switch instructions and the network parameters of the collected switch into the pre-fine-tuned large language model to generate optimized switch instructions; S50, performing syntax check and logic verification on the optimized switch instructions to ensure the correctness and executability of the instructions; S60: Send the verified switch command to the operation and maintenance personnel.

[0009] On the basis of the above technical solution, a switch instruction optimization method of the present invention can also be improved as follows: The network parameters of the switch include traffic, delay, packet loss rate, bandwidth utilization, queue length, buffer utilization, CPU utilization, memory utilization, link status, routing policy, QoS configuration, VLAN division, link aggregation, spanning tree parameters, access control list, and port mirroring settings.

[0010] Furthermore, the optimization objectives of the weighted multi-objective optimization model include minimizing network delay, minimizing packet loss rate, maximizing bandwidth utilization, minimizing energy consumption, and maximizing network throughput; the constraints include queue length limit, buffer size limit, routing table size limit, traffic balance constraint, and bandwidth allocation constraint.

[0011] Specifically, the objective function includes: 1. Minimize network latency: ; In the formula, is the number of queues; is the number of links; For the The arrival rate of the queue; For the The service rate of each queue; For the The propagation delay of the link; For the The capacity of the link; is the first error term.

[0012] 2. Minimize packet loss rate: ; In the formula, For the The packet loss probability of each queue; For the The traffic of the link; For the The capacity of the link; is the second error term.

[0013] 3. Maximize bandwidth utilization: ; In the formula, is a trade-off factor, and its value range is ; is the third error term.

[0014] 4. Minimize Energy Consumption: ; In the formula, is the number of devices; For the Basic power consumption of each device; For the Dynamic power consumption coefficient of each device; For the Utilization rate of each device; For the The power consumption of the link; For the The status of the link (0 means closed, 1 means open); is the link power consumption weight; is the fourth error term.

[0015] 5. Maximize network throughput: ; In the formula, is the congestion penalty factor; is the fifth error term.

[0016] Constraints include: 1. Queue length limit: ; In the formula, The maximum allowed queue length.

[0017] 2. Buffer size limit: ; In the formula, is the total buffer size.

[0018] 3. Routing table size limit: ; In the formula, is the number of routing entries; For the The size of the routing entry; For the The status of a routing entry (0 means disabled, 1 means enabled); The maximum routing table size.

[0019] 4. Traffic balance constraints: ; In the formula, is a collection of nodes; and Node The set of incoming edges and the set of outgoing edges.

[0020] 5. Bandwidth allocation constraints: ; In the formula, For the The priority weight of each flow; is the total allocatable bandwidth.

[0021] Parameter acquisition method: 1. and : Collect the arrival rate and service rate of the queue in real time through network monitoring tools (such as SNMP).

[0022] 2. and : Link propagation delay is obtained through ping test, and link capacity is read from switch configuration.

[0023] 3. : Calculated through the queue statistics of the switch, the calculation formula is: .

[0024] 4. and : The basic power consumption is obtained through the equipment specifications, and the dynamic power consumption coefficient is determined through energy consumption test experiments. The test steps include: (1) Measure the total power consumption of the device under different loads; (2) Use linear regression fitting ,get and .

[0025] 5. :Device utilization is calculated by weighted average of CPU utilization, memory utilization and other indicators: .

[0026] 6. : Link power consumption is obtained through testing, or refer to the typical value in the device specification.

[0027] 7. : The size of a routing entry is determined by the routing protocol and address type, such as IPv4 is usually 24 bytes and IPv6 is usually 40 bytes.

[0028] 8. : The flow priority weight is set according to business needs and QoS policies, and the range is usually .

[0029] Further, according to the optimal switch adjustment parameters, according to the preset preliminary instruction generation template, the step of generating preliminary switch instructions specifically includes: 1. Analyze the optimal parameters output by the optimization model, including queue configuration, bandwidth allocation, routing strategy, etc.; 2. Generate functions based on the switch command syntax of different manufacturers and the preset instruction template; 3. Map the optimal parameters to the corresponding switch configuration items; 4. Generate preliminary configuration instructions using templated functions; 5. Perform basic syntax check on the generated instructions; 6. Generate incremental configuration instructions based on the current configuration of the switch.

[0030] The steps of constructing the training data set for fine-tuning the language model specifically include: 1. Collect historical switch configuration instructions and corresponding network parameter data; 2. Clean the collected data to remove sensitive information and irrelevant data; 3. Structuring the data in the format of input (network parameters + preliminary instructions) and output (optimized instructions); 4. Divide the data set into training set, validation set and test set; 5. Standardize the data to ensure consistency in format; 6. According to the complexity of the task, add comprehensive examples and boundary cases appropriately; 7. Conduct quality review of the data set to ensure the accuracy and representativeness of the data; 8. Perform data augmentation, such as generating more samples through slight changes.

[0031] The method of fine-tuning the language model is as follows: 1. Select the basic model: select a suitable pre-trained large language model according to the task requirements; 2. Define the task: define the problem as a conditional text generation task; 3. Prepare training scripts: Use a suitable deep learning framework (such as PyTorch or TensorFlow) to write fine-tuning scripts. By default, you can use the fine-tuning scripts that come with the large language model. 4. Set hyperparameters: including learning rate, batch size, number of training rounds, etc. 5. Fine-tune the model using the prepared dataset; 6. Monitor and adjust: Monitor model performance during training and adjust hyperparameters if necessary; 7. Model evaluation: Use the test set to evaluate model performance; 8. Iterative optimization: Make necessary model architecture adjustments or data set optimization based on the evaluation results.

[0032] Specifically, the step S10 specifically includes the following steps: Step S101, using network monitoring tools (such as SNMP) to collect basic performance indicators of the switch in real time, such as flow, delay, packet loss rate, bandwidth utilization, queue length, buffer utilization, CPU utilization, memory utilization, etc. The performance indicators reflect the current operating status of the switch and provide a basis for subsequent multi-objective optimization.

[0033] Step S102, collecting the link status information of the switch, including parameters such as link bandwidth, link delay, and network configuration information such as routing strategy, QoS configuration, VLAN division, link aggregation, spanning tree parameters, access control list, port mirroring settings, etc. The link status and network configuration information are helpful for a comprehensive understanding of the operating environment of the switch.

[0034] Step S103: Clean and process the collected network parameter data to remove sensitive information and irrelevant data to ensure the accuracy and representativeness of the data. At the same time, structure the data in the format of input (network parameters) and output (switch instructions) to prepare for the subsequent large language model training.

[0035] Step S104, standardize the structured data set, including data normalization, feature engineering, etc., to ensure the consistency of the data format. In addition, according to the complexity of the task, appropriate comprehensive samples and boundary conditions are added to improve the generalization ability of the model.

[0036] Step S105: Perform a quality review on the data set to check the accuracy and completeness of the data and remove samples that may contain errors or deviations. If necessary, more samples can be generated to enrich the data set through data enhancement techniques, such as slight changes and combinations.

[0037] Through the above steps, the key performance parameters and network configuration information of the switch are comprehensively collected and organized, laying the foundation for subsequent multi-objective optimization and large language model optimization.

[0038] Specifically, the specific implementation process of step S20 is as follows: Step S201: construct a weighted multi-objective optimization model based on the collected switch network parameters. The objective functions of the optimization model include: minimizing network delay, minimizing packet loss rate, maximizing bandwidth utilization, minimizing energy consumption, and maximizing network throughput. By comprehensively optimizing these performance indicators, the optimal adjustment parameters of the switch can be obtained.

[0039] Step S202, optimizing the objective function of network delay Solve. Among them, is the number of queues, is the number of links, For the The arrival rate of a queue, For the The service rate of a queue, For the The propagation delay of the link, For the The capacity of the link, is the error term. This function describes the sum of queue delay and link delay, and the goal is to minimize it.

[0040] Step S203, optimizing the objective function of packet loss rate Solve. Among them, For the The packet loss probability of a queue, For the The traffic of the link, For the The capacity of the link, is the error term. This function describes the overall packet loss rate, including queue loss and link congestion loss, and the goal is to minimize it.

[0041] Step S204: Optimize the bandwidth utilization objective function Solve. Among them, is a trade-off factor, and its value range is , is the error term. This function describes the average bandwidth utilization and the minimum bandwidth utilization, and the goal is to maximize the weighted sum of these two indicators.

[0042] Step S205: Optimize the energy consumption objective function Solve. Among them, is the number of devices, For the The basic power consumption of each device, For the The dynamic power consumption coefficient of each device, For the The utilization rate of the equipment, For the The power consumption of the link, For the The status of the link (0 means closed, 1 means open), is the link power consumption weight, is the error term. This function describes the weighted sum of the total power consumption of the device and the link power consumption, and the goal is to minimize it.

[0043] Step S206, optimizing the network throughput objective function Solve. Among them, is the congestion penalty factor, is the error term. This function describes the maximum throughput of the network and subtracts a penalty term related to the congestion level. The goal is to maximize it.

[0044] Step S207, construct the above-mentioned objective functions into a weighted multi-objective optimization model, and combine relevant constraints (such as queue length limit, buffer size limit, routing table size limit, flow balance constraint, bandwidth allocation constraint, etc.) to solve and obtain the optimal adjustment parameters of the switch. The parameters include queue configuration, bandwidth allocation, routing strategy, etc., which provide a basis for subsequent instruction generation.

[0045] Through the above steps, the optimal adjustment parameters of the switch were obtained based on the multi-objective optimization method, laying the foundation for further optimizing the switch instructions.

[0046] Specifically, the specific implementation process of step S30 is as follows: Step S301, analyzing the optimal parameters output by the optimization model, including queue configuration, bandwidth allocation, routing strategy, etc. The parameters provide a direct basis for subsequent instruction generation.

[0047] Step S302: design a predefined instruction template based on the switch command syntax of different manufacturers. The template can cover common switch configuration instructions and provide a standard format for generating preliminary instructions.

[0048] Step S303, mapping the optimal parameters to corresponding switch configuration items, such as queue length, bandwidth allocation ratio, routing entries, etc. The correspondence between the parameters and the configuration items ensures the consistency between the instruction content and the optimization result.

[0049] Step S304: Generate preliminary configuration instructions using a templated function. The function can automatically fill the optimal parameters into a preset instruction template to generate preliminary switch instructions.

[0050] Step S305: Perform a basic syntax check on the generated preliminary instruction to ensure that the keywords and parameter formats in the instruction comply with the switch command specifications. In addition, check whether the logic of the instruction is reasonable based on the current configuration of the switch, such as whether the queue length exceeds the buffer size.

[0051] Step S306: Analyze the part that needs to be updated based on the current configuration of the switch and generate incremental configuration instructions. The incremental instructions can minimize the impact on the existing configuration of the switch and improve execution efficiency.

[0052] Through the above steps, preliminary switch instructions were generated based on the parameters output by the optimization model, and basic verification of syntax and logic was performed, laying the foundation for subsequent large language model optimization.

[0053] Specifically, the specific implementation process of step S40 is as follows: Step S401: collect historical switch configuration instructions and corresponding network parameter data as a training data set for a large language model. The data set covers the configuration instructions of the switch in different scenarios and their corresponding performance.

[0054] Step S402: Clean and process the collected data to remove sensitive information and irrelevant data to ensure the accuracy and representativeness of the data. At the same time, structure the data in the format of input (network parameters + preliminary instructions) and output (optimized instructions).

[0055] Step S403, standardize the structured data set, including data normalization, feature engineering, etc., to ensure the consistency of the data format. In addition, according to the complexity of the task, appropriately increase comprehensive samples and boundary conditions to improve the generalization ability of the model.

[0056] Step S404, select a suitable pre-trained large language model as the basic model, and define the conditional text generation task, converting the problem into a mapping relationship from input (network parameters + preliminary instructions) to output (optimized instructions).

[0057] Step S405, write a fine-tuning script for a deep learning framework (such as PyTorch or TensorFlow) and set appropriate hyperparameters, including learning rate, batch size, number of training rounds, etc.

[0058] Step S406, use the prepared data set to fine-tune the basic model, monitor the model performance during the training process, and adjust the hyperparameters when necessary.

[0059] Step S407: Use the test set to evaluate the trained model and check its performance on new data. According to the evaluation results, make necessary model architecture adjustments or data set optimization to ensure the generalization ability of the model.

[0060] Through the above steps, the optimization method based on the large language model obtains more optimized switch instructions, providing high-quality input for subsequent syntax and logic verification.

[0061] Specifically, the specific implementation process of step S50 is as follows: Step S501, check the optimized switch instructions to ensure that the keywords, parameter formats, etc. in the instructions comply with the switch command specifications. The syntax check ensures that the instructions can be correctly parsed and executed by the switch.

[0062] Step S502: Verify whether the optimized instructions are consistent with the existing configuration in combination with the current configuration information of the switch, for example, check whether the queue length exceeds the buffer size, whether the routing table size exceeds the limit, etc.

[0063] Step S503, analyzing the causes of the potential problems found, and appropriately adjusting the training of the optimization model or the large language model to optimize the instruction generation process.

[0064] Step S504: Final confirmation of the switch instructions that have been syntax and logic verified to ensure the correctness and executability of the instructions.

[0065] Step S505: Generate a configuration file containing optimized instructions for the operation and maintenance personnel to directly send to the switch to achieve performance optimization. The configuration file can be in a format specific to the switch manufacturer or in a general text format.

[0066] Through the above steps, the optimized switch instructions undergo strict syntax and logic verification to ensure that the instructions can be executed smoothly and will not cause switch failures or network interruptions, laying the foundation for subsequent configuration updates.

[0067] A second aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores program instructions, and when the program instructions are run in a computer, they are used to execute the above-mentioned switch instruction optimization method.

[0068] A third aspect of the present invention provides a switch instruction optimization system, which includes the above-mentioned computer-readable storage medium.

[0069] Compared with the prior art, the switch instruction optimization method, medium and system provided by the present invention have the following beneficial effects: 1. Multi-objective optimization: This invention adopts a weighted multi-objective optimization model, taking into account multiple key performance indicators such as network delay, packet loss rate, bandwidth utilization, energy consumption and throughput. By weighing these indicators, the optimal balance point of switch performance can be found to meet the comprehensive needs of network operations. Compared with single indicator optimization, this method significantly improves the overall level of switch performance.

[0070] 2. Adaptive optimization: The optimization model of the present invention can collect the performance data of the switch in real time and dynamically adjust the optimization target and constraints. As the network load changes, the model can automatically generate the latest optimization configuration to achieve continuous optimization of the switch performance and meet the dynamic needs of the network environment. Compared with regular manual optimization, this method is more agile and efficient.

[0071] 3. Explainability: Unlike the "black box" model based on machine learning, the multi-objective optimization model of the present invention has a clear mathematical form and physical meaning. Each optimization goal and constraint has a clear performance meaning, and operation and maintenance personnel can understand its internal optimization mechanism and enhance their trust in the optimization strategy. At the same time, the generated switch instructions also have corresponding parameter explanations, which is convenient for manual verification and adjustment.

[0072] 4. Large language model optimization: The present invention inputs preliminary switch instructions and network parameters into a pre-trained large language model for optimization. The model can combine historical configuration experience to generate more optimized switch instructions. Compared with preliminary instructions, the optimized instructions can better meet network performance requirements and reduce the workload of manual fine-tuning.

[0073] 5. Automatic command generation: The present invention can automatically generate switch commands and verify the syntax and logic to ensure the correctness and executability of the commands. Compared with manually written commands, this method greatly improves the efficiency of configuration and reduces the risk of manual intervention.

[0074] In summary, the switch performance optimization method proposed in the present invention can effectively solve the problems of the prior art, realize the automation, multi-objective optimization and explainability of network performance, and solve the technical problems in the prior art that the switch instructions rely on manual optimization configuration and lack automation capabilities. BRIEF DESCRIPTION OF THE DRAWINGS

[0075] Figure 1 A flow chart of the method provided by the present invention; Figure 2 This is a network delay distribution diagram before and after optimization in Example 2; Figure 3 This is a diagram showing the packet loss rate changes before and after optimization in Example 2. DETAILED DESCRIPTION

[0076] In order to make the purpose, technical solution and advantages of the embodiments of the present invention more clear, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention.

[0077] like Figure 1 FIG. 1 is a flow chart of a switch instruction optimization method provided by the present invention. The method comprises the following steps: S10, collecting network parameters of the switch; S20, calculating the optimal switch adjustment parameters using a weighted multi-objective optimization model; S30, according to the optimal switch adjustment parameters, according to the preset preliminary instruction generation template, generate preliminary switch instructions; S40, inputting the preliminary switch instructions and the network parameters of the collected switches into the pre-fine-tuned large language model to generate optimized switch instructions; S50, performing syntax check and logic verification on the optimized switch instructions to ensure the correctness and executability of the instructions; S60: Send the verified switch command to the operation and maintenance personnel.

[0078] The specific implementation methods of the above steps are described in detail below: Step S10, collecting the network parameters of the switch is to obtain the current operating status of the switch. First, the basic performance indicators such as flow, delay, packet loss rate, bandwidth utilization, queue length, buffer utilization, CPU utilization, memory utilization, etc. of the switch are collected in real time through network monitoring tools (such as SNMP). Secondly, the link status information of the switch is collected, including link bandwidth, link delay, etc., as well as network configuration information such as routing strategy, QoS configuration, VLAN division, link aggregation, spanning tree parameters, access control list, port mirroring settings, etc. The collection of these parameters provides the necessary basis for subsequent multi-objective optimization.

[0079] Step S20, using a weighted multi-objective optimization model to calculate the optimal switch adjustment parameters. The objective functions of the optimization model include: minimizing network delay, minimizing packet loss rate, maximizing bandwidth utilization, minimizing energy consumption, and maximizing network throughput.

[0080] The network delay optimization objective function is: ; in, is the number of queues, is the number of links, For the The arrival rate of a queue, For the The service rate of a queue, For the The propagation delay of the link, For the The capacity of the link, is the first error term. This function describes the sum of queue delay and link delay, and the goal is to minimize it.

[0081] The packet loss rate optimization objective function is: ; in, For the The packet loss probability of a queue, For the The traffic of the link, For the The capacity of the link, is the second error term. This function describes the overall packet loss rate, including queue loss and link congestion loss, and the goal is to minimize it.

[0082] The bandwidth utilization optimization objective function is: ; in, is a trade-off factor, and its value range is , is the third error term. This function describes the average bandwidth utilization and the minimum bandwidth utilization, and the goal is to maximize the weighted sum of these two indicators.

[0083] The energy consumption optimization objective function is: ; in, is the number of devices, For the The basic power consumption of each device, For the The dynamic power consumption coefficient of each device, For the The utilization rate of the equipment, For the The power consumption of the link, For the The status of the link (0 means closed, 1 means open), is the link power consumption weight, is the fourth error term. This function describes the weighted sum of the total power consumption of the device and the link power consumption, and the goal is to minimize it.

[0084] The network throughput optimization objective function is: ; in, is the congestion penalty factor, is the fifth error term. This function describes the maximum throughput of the network and subtracts a penalty term related to the congestion level. The goal is to maximize it.

[0085] The above five error terms play the role of adjustment factors in the solution process of the weighted multi-objective optimization model.

[0086] The constraints of the optimization model include: 1. Queue length limit: ,in The maximum allowed queue length.

[0087] 2. Buffer size limit: ,in is the total buffer size.

[0088] 3. Routing table size limit: ,in is the number of routing entries, For the The size of a routing entry, For the The status of the routing entry (0 means disabled, 1 means enabled), The maximum routing table size.

[0089] 4. Traffic balance constraints: ,in is a node set, and Node The set of incoming edges and the set of outgoing edges.

[0090] 5. Bandwidth allocation constraints: ,in For the The priority weight of each flow, is the total allocatable bandwidth.

[0091] By solving this multi-objective optimization problem, the optimal adjustment parameters of the switch can be obtained, including queue configuration, bandwidth allocation, routing strategy, etc.

[0092] Step S30, generate preliminary switch instructions based on the optimal switch adjustment parameters. First, parse the optimal parameters output by the optimization model, including queue configuration, bandwidth allocation, routing strategy, etc. Then, design predefined instruction templates based on the switch command syntax of different manufacturers. Next, map the optimal parameters to the corresponding switch configuration items, and use the templated function to generate preliminary configuration instructions. Finally, perform basic syntax checks on the generated instructions to ensure the correctness of the instructions.

[0093] For example, for queue configuration optimization, the following preliminary instructions can be generated: interface GigabitEthernet0 / 1 queue-limit 50 tx-ring-limit 32priority-queue out num-of-queues 4 queue-limit queue-num 0 50 queue-limitqueue-num 1 30 queue-limit queue-num 2 20 queue-limit queue-num 3 10 Here, according to the output of the optimization model, the number of queues is set to 4, and the length limit of each queue is set separately. At the same time, the size of the ring buffer is also adjusted.

[0094] Step S40, input the preliminary switch instructions and the collected network parameters into the pre-fine-tuned large language model to generate optimized switch instructions. The training data set of the large language model includes historical switch configuration instructions and corresponding network parameter data. After cleaning, structuring and standardization, the format of input (network parameters + preliminary instructions) and output (optimized instructions) is formed. During the fine-tuning process, it is necessary to set appropriate hyperparameters, such as learning rate, batch size, etc., and make necessary adjustments by monitoring model performance. After iterative optimization, the final large language model can generate optimized switch instructions based on the input network parameters and preliminary instructions.

[0095] For example, for the previous queue configuration instructions, the optimized instructions are: interface GigabitEthernet0 / 1 queue-limit 40 tx-ring-limit 28priority-queue out num-of-queues 4 queue-limit queue-num 0 45 queue-limitqueue-num 1 35 queue-limit queue-num 2 15 queue-limit queue-num 3 8 Compared with the preliminary instructions, the queue length limit and ring buffer size are further optimized here to better meet the network performance goals.

[0096] Step S50, perform syntax check and logic verification on the optimized switch instructions to ensure the correctness and executability of the instructions. First, check whether the syntax of the instructions conforms to the command specifications of the switch, including keyword spelling, parameter format, etc. Then, verify whether the logic of the instructions is reasonable in combination with the current configuration of the switch, for example, check whether the queue length exceeds the buffer size, whether the routing table size exceeds the limit, etc. Through these checks and verifications, it can be ensured that the generated switch instructions can be executed smoothly without causing switch failure or network interruption.

[0097] Step S60: Send the verified switch instructions to the operation and maintenance personnel. The operation and maintenance personnel can update the switch configuration remotely or on-site according to these instructions to optimize the switch performance.

[0098] In general, this invention proposes a switch instruction optimization method based on multi-objective optimization and large language model. Among them, the key performance parameters of the switch are collected, and the optimal adjustment parameters are calculated using the weighted multi-objective optimization model, and then preliminary switch instructions are generated. Next, the preliminary instructions and network parameters are input into the pre-trained large language model for optimization to generate more optimized switch instructions. Finally, the optimized instructions are checked for syntax and logic to ensure the correctness and executability of the instructions, and then handed over to the operation and maintenance personnel for execution.

[0099] A second aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores program instructions, and when the program instructions are run in a computer, they are used to execute the above-mentioned switch instruction optimization method.

[0100] A third aspect of the present invention provides a switch instruction optimization system, which includes the above-mentioned computer-readable storage medium.

[0101] Specifically, the principle of the present invention is to use a weighted multi-objective optimization model to calculate the optimal switch adjustment parameters. The optimization model simultaneously considers multiple key performance indicators such as network delay, packet loss rate, bandwidth utilization, energy consumption and throughput, and by weighing these indicators, the best balance point of switch performance can be found.

[0102] Network delay is one of the most sensitive performance indicators of user experience. The optimization model of the present invention models delay as the sum of queue delay and link delay. By minimizing this indicator, the user-perceived response time can be effectively shortened.

[0103] The packet loss rate reflects the reliability of the network. Too high a packet loss rate will seriously affect the normal operation of the application. The optimization model models the packet loss rate as a combination of queue loss and link congestion loss. Minimizing this indicator can ensure the reliability of data transmission.

[0104] Bandwidth utilization is an important indicator to measure the efficiency of network resource utilization. The optimization model not only considers the average bandwidth utilization, but also introduces the minimum bandwidth utilization as the optimization goal to ensure that the bandwidth resources of each link are fully utilized.

[0105] Energy consumption optimization reflects the economic and environmental friendliness of switch operation. The optimization model models the power consumption of the device itself and the link power consumption. Minimizing the overall energy consumption helps reduce operating costs and achieve a green network.

[0106] Finally, network throughput reflects the overall business carrying capacity. In addition to maximizing the throughput index, the optimization model also introduces congestion penalty items to ensure that while pursuing high throughput, the overall stability of the network can also be taken into account.

[0107] It should be pointed out that there are usually certain contradictions and trade-offs between these optimization goals. For example, improving throughput may sacrifice delay performance, and reducing energy consumption may affect bandwidth utilization. Therefore, the present invention adopts a weighted multi-objective optimization method, and by setting reasonable weight coefficients, it can seek the best balance between these indicators to meet the comprehensive needs of network operations.

[0108] In the process of multi-objective optimization, the present invention also introduces a series of constraints, such as queue length limit, buffer size limit, routing table size limit, etc. These constraints ensure that the optimization results are feasible and executable in the actual switch configuration, avoiding the "ideal" solution that is out of touch with reality.

[0109] It should be noted that the optimization model of the present invention can not only calculate the optimal switch adjustment parameters, but also provide corresponding mathematical expressions and physical explanations. This interpretability greatly helps operation and maintenance personnel understand the internal mechanism of the optimization strategy and enhance their trust in the optimization results.

[0110] In addition, the present invention also introduces an instruction optimization method based on a large language model. By collecting historical switch configuration instructions and corresponding network performance data as a training set, the pre-trained large language model can learn the empirical rules of manually written instructions. On this basis, the model can generate a more optimized switch configuration based on the current network parameters and preliminary instructions, further improving the performance of the switch. This method is conducive to giving full play to the potential of artificial intelligence in network operation and maintenance, and realizing the automation and intelligence of instruction generation.

[0111] In order to better understand and implement the present invention, a specific embodiment 1 of the method of the present invention is provided below, and each step in this embodiment is described in detail as follows: Step S10: Collect the network parameters of the switch. First, use a network monitoring tool (such as SNMP) to collect the flow of the switch in real time. ,Delay , Packet loss rate , Bandwidth Utilization , queue length , Buffer usage 、CPU utilization , memory usage And other basic performance indicators. Among them, is the number of queues, is the number of links, For the The service rate of a queue, For the The capacity of the link.

[0112] Secondly, collect the link status information of the switch, including link bandwidth , Link Delay etc., as well as network configuration information such as routing strategy, QoS configuration, VLAN division, link aggregation, spanning tree parameters, access control list, port mirroring settings, etc. The collection of these parameters provides the necessary basis for subsequent multi-objective optimization.

[0113] For equipment utilization The calculation of can be done by weighted average: ,in , and is the weight coefficient, which reflects the contribution of different indicators to equipment utilization.

[0114] Step S20, using a weighted multi-objective optimization model to calculate the optimal switch adjustment parameters. The objective function of the optimization model includes: minimizing network delay , minimize packet loss rate , maximize bandwidth utilization , minimize energy consumption , maximize network throughput .

[0115] The network delay optimization objective function is: ; in, is the error term. This function describes the sum of queue delay and link delay, and the goal is to minimize it.

[0116] The packet loss rate optimization objective function is: ; in, is the error term. This function describes the overall packet loss rate, including queue loss and link congestion loss, and the goal is to minimize it.

[0117] The bandwidth utilization optimization objective function is: ; in, is a trade-off factor, and its value range is , is the error term. This function describes the average bandwidth utilization and the minimum bandwidth utilization, and the goal is to maximize the weighted sum of these two indicators.

[0118] The energy consumption optimization objective function is: ; in, is the number of devices, For the The basic power consumption of each device, For the The dynamic power consumption coefficient of each device, For the The power consumption of the link, For the The status of the link (0 means closed, 1 means open), is the link power consumption weight, is the error term. This function describes the weighted sum of the total power consumption of the device and the link power consumption, and the goal is to minimize it.

[0119] The network throughput optimization objective function is: ; in, is the congestion penalty factor, is the error term. This function describes the maximum throughput of the network and subtracts a penalty term related to the congestion level. The goal is to maximize it.

[0120] The constraints of the optimization model include: 1. Queue length limit: ; in, The maximum allowed queue length. This constraint ensures that the queue length does not exceed the set upper limit.

[0121] 2. Buffer size limit: ; in, is the total buffer size. This constraint ensures that the buffer usage does not exceed the total capacity.

[0122] 3. Routing table size limit: ; in, is the number of routing entries, For the The size of a routing entry, For the The status of the routing entry (0 means disabled, 1 means enabled), is the maximum routing table size. This constraint ensures that the routing table size does not exceed the limit.

[0123] 4. Traffic balance constraints: ; in, is a node set, and Node The set of incoming edges and outgoing edges of . This constraint ensures that the traffic of each node in the network is balanced.

[0124] 5. Bandwidth allocation constraints: ; in, For the The priority weight of each flow, is the total allocatable bandwidth. This constraint ensures that bandwidth allocation meets priority requirements.

[0125] By solving this multi-objective optimization problem, the optimal adjustment parameters of the switch can be obtained, including queue configuration, bandwidth allocation, routing strategy, etc.

[0126] Step S30: Generate preliminary switch instructions based on the optimal switch adjustment parameters. First, analyze the optimal parameters output by the optimization model, including queue configuration , Bandwidth Allocation , routing strategy wait.

[0127] Then, based on the switch command syntax of different manufacturers, predefined instruction templates are designed. For example, for queue configuration optimization, the following preliminary instructions can be generated: interface GigabitEthernet0 / 1 queue-limit ; priority-queue out num-of-queues ; queue-limit queue-num 0 ; queue-limit queue-num 1 ; … queue-limit queue-num ; Here, according to the output of the optimization model, the number of queues is set to The length limit of each queue is set separately. At the same time, the size of the ring buffer is also adjusted. .

[0128] Next, the optimal parameters are mapped to the corresponding switch configuration items, and the template function is used to generate preliminary configuration instructions. Finally, a basic syntax check is performed on the generated instructions to ensure the correctness of the instructions.

[0129] Step S40, input the preliminary switch instructions and the collected network parameters into the pre-fine-tuned large language model to generate optimized switch instructions. The training data set of the large language model includes historical switch configuration instructions and corresponding network parameter data, which are cleaned, structured and standardized to form the format of input (network parameters + preliminary instructions) and output (optimized instructions).

[0130] During fine-tuning, you need to set appropriate hyperparameters, such as learning rate , batch size And make necessary adjustments by monitoring the model performance. After iterative optimization, the final large language model can generate optimized switch instructions based on the input network parameters and preliminary instructions.

[0131] For example, for the previous queue configuration instructions, the optimized instructions are: interface GigabitEthernet0 / 1 queue-limit ; priority-queue out num-of-queues ; queue-limit queue-num 0 ; queue-limit queue-num 1 ; … queue-limit queue-num ; Compared with the preliminary instructions, the queue length limit is further optimized here to better meet the network performance goals.

[0132] Step S50: Check the syntax and logic of the optimized switch command to ensure the correctness and executability of the command. First, check whether the syntax of the command complies with the switch command specification, including keyword spelling, parameter format, etc. Then, verify whether the logic of the command is reasonable in combination with the current configuration of the switch, for example, check the queue length. Whether the buffer size is exceeded , routing table size Exceeding the limit Through these checks and verifications, it can be ensured that the generated switch instructions can be executed smoothly without causing switch failure or network interruption.

[0133] Step S60: Send the verified switch instructions to the operation and maintenance personnel. The operation and maintenance personnel can update the switch configuration remotely or on-site according to these instructions to optimize the switch performance.

[0134] The following is an example 2 of a specific application scenario of the present invention: an Internet company has a large data center with dozens of core switches deployed. With the rapid development of business, these switches are facing huge network load pressure, and the performance indicators have dropped significantly, seriously affecting the normal operation of the business. Therefore, the company decided to use the switch performance optimization method proposed in the present invention to perform intelligent optimization on the switches in the data center.

[0135] First, the company used network monitoring tools (such as SNMP) to collect real-time performance indicator data of the switch, including: Table 1 Performance indicators of a data center switch of an Internet enterprise

[0136] As can be seen from Table 1, the performance indicators of these switches have a large fluctuation range, especially during peak traffic periods, where latency and packet loss rates increase significantly and bandwidth utilization approaches saturation, which poses a major challenge to the stable operation of the business.

[0137] Based on the collected performance data, the company built a weighted multi-objective optimization model as follows: Network delay optimization objective function: ; in, is the number of queues in the switch, is the number of links, For the The arrival rate of a queue, For the The service rate of a queue, For the The propagation delay of the link, For the The capacity of the link, is the error term.

[0138] Packet loss rate optimization objective function: ; in, For the The packet loss probability of a queue, For the The traffic of the link, For the The capacity of the link, is the error term.

[0139] Bandwidth utilization optimization objective function: ; in, is a trade-off factor, and its value range is , is the error term.

[0140] Energy consumption optimization objective function: ; in, is the number of switches, For the The basic power consumption of a switch, For the The dynamic power consumption coefficient of a switch, For the The utilization rate of the switches, For the The power consumption of the link, For the The status of the link (0 means closed, 1 means open), is the link power consumption weight, is the error term.

[0141] Network throughput optimization objective function: ; in, is the congestion penalty factor, is the error term.

[0142] The constraints of the optimization model include: 1. Queue length limit: ,in The maximum allowed queue length.

[0143] 2. Buffer size limit: ,in is the total buffer size.

[0144] 3. Routing table size limit: ,in is the number of routing entries, For the The size of a routing entry, For the The status of the routing entry (0 means disabled, 1 means enabled), The maximum routing table size.

[0145] 4. Traffic balance constraints: ,in is a node set, and Node The set of incoming edges and the set of outgoing edges.

[0146] 5. Bandwidth allocation constraints: ,in For the The priority weight of each flow, is the total allocatable bandwidth.

[0147] By solving this multi-objective optimization problem, we can obtain the optimal adjustment parameters of the switch, including queue configuration, bandwidth allocation, routing strategy, etc.

[0148] Based on the output of the optimization model, the company generated preliminary switch configuration instructions, such as: interface GigabitEthernet0 / 1 queue-limit 100 tx-ring-limit 32 priority-queue out num-of-queues 4 queue-limit queue-num 0 50 queue-limit queue-num 1 30 queue-limit queue-num 2 20 queue-limit queue-num 3 10 These preliminary instructions and the collected performance data are then fed into the pre-tuned GPT-3 model for optimization. After training, the model is able to generate more optimized switch instructions, such as: interface GigabitEthernet0 / 1 queue-limit 80 tx-ring-limit 28 priority-queue out num-of-queues 4 queue-limit queue-num 0 45 queue-limit queue-num 1 35 queue-limit queue-num 2 15 queue-limit queue-num 3 8 Compared with the preliminary instructions, the optimized configuration further adjusts the queue length and ring buffer size to better meet the optimization goals of latency, packet loss rate, and bandwidth utilization.

[0149] Finally, the company conducted strict syntax checks and logic verification on the optimized switch instructions to ensure the correctness and executability of the instructions. After verification, the instructions were sent to the switch, realizing the automatic optimization of switch performance. During this optimization process, the company used the following key performance indicators to evaluate the optimization effect: Figure 2 The results show that after optimization, the network delay distribution of the switch shifted significantly to the left, the average delay was reduced from 20ms to 15ms, and the fluctuation range of the delay was also greatly reduced. This means that the response time felt by users has been significantly improved. Figure 3 The results show that after optimization, the packet loss rate of the switch has been significantly reduced from 2%-5% before optimization to 1%-3%. This means that the reliability of the network has been improved and the stability of the application will also be improved.

[0150] After implementing the optimization method of the present invention, the performance of the enterprise's data center switch has been comprehensively improved, the network delay and packet loss rate indicators have reached the industry's leading level, and the bandwidth utilization rate has also been well balanced. At the same time, the overall energy consumption of the switch has also decreased, and the operating cost has been controlled.

[0151] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.

Claims

1. A switch instruction optimization method, characterized in that: The following steps are involved: S10, collecting network parameters of the switch; S20, calculating the optimal switch adjustment parameters using a weighted multi-objective optimization model; S30, according to the optimal switch adjustment parameters, according to the preset preliminary instruction generation template, generate preliminary switch instructions; S40, inputting the preliminary switch instructions and the network parameters of the collected switch into the pre-fine-tuned large language model to generate optimized switch instructions; S50, performing syntax check and logic verification on the optimized switch instructions to ensure the correctness and executability of the instructions; S60: Send the verified switch command to the operation and maintenance personnel.

2. A switch instruction optimization method according to claim 1, characterized in that: The network parameters of the switch include traffic, delay, packet loss rate, bandwidth utilization, queue length, buffer utilization, CPU utilization, memory utilization, link status, routing policy, QoS configuration, VLAN division, link aggregation, spanning tree parameters, access control list, and port mirroring settings.

3. A switch instruction optimization method according to claim 2, characterized in that: The optimization objectives of the weighted multi-objective optimization model include minimizing network delay, minimizing packet loss rate, maximizing bandwidth utilization, minimizing energy consumption, and maximizing network throughput; the constraints include queue length limit, buffer size limit, routing table size limit, traffic balance constraint, and bandwidth allocation constraint.

4. A switch instruction optimization method according to claim 3, characterized in that: The optimization objective function for minimizing network delay is: ; In the formula, is the number of queues; is the number of links; For the The arrival rate of the queue; For the The service rate of each queue; For the The propagation delay of the link; For the The capacity of the link; is the first error term.

5. A switch instruction optimization method according to claim 4, characterized in that: The optimization objective function for minimizing the packet loss rate is: ; In the formula, For the The packet loss probability of each queue; For the The traffic of the link; For the The capacity of the link; is the second error term.

6. A switch instruction optimization method according to claim 5, characterized in that: The optimization objective function for maximizing bandwidth utilization is: ; In the formula, is a trade-off factor, and its value range is ; is the third error term.

7. A switch instruction optimization method according to claim 6, characterized in that: The objective function of minimizing energy consumption optimization is: ; In the formula, is the number of devices; For the Basic power consumption of each device; For the Dynamic power consumption coefficient of each device; For the Utilization rate of each device; For the The power consumption of the link; For the The status of the link, where 0 means closed and 1 means open; is the link power consumption weight; is the fourth error term.

8. A switch instruction optimization method according to claim 7, characterized in that: The optimization objective function for maximizing network throughput is: ; In the formula, is the congestion penalty factor; is the fifth error term.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program instructions, and when the program instructions are executed in a computer, the method for optimizing switch instructions according to any one of claims 1 to 8 is executed.

10. A switch instruction optimization system, characterized in that: A computer-readable storage medium comprising the computer-readable storage medium of claim 9.

Citation Information

Patent Citations

  • Concentrator optimal configuration method based on deep learning and concentrator

    CN117560287A

  • Anti-interference method of wireless communication in industrial application

    CN117596602A

  • Automatic scheduling report generation method based on large language model

    CN118446193A

  • Concentrator optimal configuration method and system based on deep learning

    CN118659972A

  • Congestion control method and device, storage medium and electronic equipment

    CN118740738A