A switch instruction optimization method, medium and system

By optimizing switch instructions using a weighted multi-objective optimization model and a large language model, the problem of switch performance optimization relying on manual configuration is solved, achieving automation, multi-objective optimization, and interpretability, thereby improving the overall performance and configuration efficiency of the switch.

CN120110897BActive Publication Date: 2026-02-06青岛网信信息科技有限公司
View PDF 1 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In existing technologies, switch performance optimization relies on manual configuration, which lacks automation capabilities, resulting in low efficiency, difficulty in balancing multiple performance indicators, and difficulty in achieving dynamic optimization.

Method used

A weighted multi-objective optimization model is used to calculate the switch adjustment parameters, and a large language model is combined to optimize the switch instructions. The optimized instructions are generated and their syntax and logic are verified to ensure the correctness and executability of the instructions.

Benefits of technology

It achieves automated optimization of switch performance, simultaneously taking into account multiple key indicators such as network latency, packet loss rate, bandwidth utilization, energy consumption, and throughput, thereby improving configuration efficiency, reducing the risk of manual intervention, and adapting to changes in network load.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120110897B_ABST
    Figure CN120110897B_ABST
Patent Text Reader

Abstract

The application provides a switch instruction optimization method, medium and system, and belongs to the technical field of large language models, and comprises the following steps: collecting network parameters of a switch; calculating optimal switch adjustment parameters by using a weighted multi-objective optimization model; generating a preliminary switch instruction according to a preset preliminary instruction generation template according to the optimal switch adjustment parameters; inputting the preliminary switch instruction and the collected network parameters of the switch into a pre-finely tuned large language model to generate an optimized switch instruction; performing syntax checking and logic verification on the optimized switch instruction to ensure the correctness and executability of the instruction; and sending the verified switch instruction to an operation and maintenance personnel. The application provides a more intelligent and adaptive switch instruction performance optimization method, and solves the technical problem that the switch instruction in the prior art depends on manual optimization configuration and lacks automatic capability.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

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

[0002] As a core device in data centers and enterprise networks, the performance of network switches directly affects the stability and throughput capacity of the entire network. In recent years, with the rapid development of emerging technologies such as the Internet of Things and cloud computing, the network scale is continuously expanding, and the performance requirements of switches are increasingly improving. Switches need to handle a large amount of data traffic simultaneously, ensuring key performance indicators such as low latency, low packet loss rate, and high bandwidth utilization. At the same time, it also needs to consider the demands of energy consumption, security, manageability, etc., to achieve efficient, stable, and sustainable operation of the network.

[0003] Currently, switch performance optimization mainly relies on the experience and manual configuration of network engineers. Engineers need to adjust various switch parameters, such as queue length, bandwidth allocation, routing strategy, etc., according to the actual network situation to optimize the performance of the switch. This method has some problems:

[0004] 1. Manual configuration is inefficient. For large and complex networks, there are numerous parameters to adjust, and engineers are difficult to fully grasp the relationship and influence between parameters, making the optimization process tedious and time-consuming.

[0005] 2. It is difficult to balance multiple performance indicators. Generally, there is a certain contradiction and trade-off between switch performance indicators, such as improving throughput may sacrifice latency, and reducing energy consumption may affect bandwidth utilization. Manual configuration is difficult to find the best balance between multiple indicators.

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

[0007] In summary, the switch instruction in the prior art relies on manual optimization and configuration, and there is a technical problem of lacking automation capability. SUMMARY

[0008] Therefore, the application provides a switch instruction optimization method, medium and system, which can solve the technical problem of the switch instruction in the prior art relying on manual optimization and configuration and lacking automation capability.

[0009] The application is implemented as follows:

[0010] The first aspect of the application provides a switch instruction optimization method, comprising the following steps:

[0011] S10. Collect network parameters of the switch;

[0012] S20. Calculate the optimal switch adjustment parameters using a weighted multi-objective optimization model;

[0013] S30. Adjust parameters according to the optimal switch, generate a template based on the preset preliminary instructions, and generate preliminary switch instructions.

[0014] S40. Input the initial switch commands and the network parameters of the acquisition switch into the pre-tuned large language model to generate optimized switch commands.

[0015] S50. Perform syntax checks and logic verifications on the optimized switch instructions to ensure the correctness and executability of the instructions;

[0016] S60: Send the verified switch command to the maintenance personnel.

[0017] Based on the above technical solution, the switch instruction optimization method of the present invention can be further improved as follows:

[0018] The network parameters of the switch include traffic, latency, packet loss rate, bandwidth utilization, queue length, buffer utilization, CPU utilization, memory utilization, link status, routing policy, QoS configuration, VLAN segmentation, link aggregation, spanning tree parameters, access control list, and port mirroring settings.

[0019] Furthermore, the optimization objectives of the weighted multi-objective optimization model include minimizing network latency, 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 balancing constraint, and bandwidth allocation constraint.

[0020] Specifically, the objective function includes:

[0021] 1. Minimize network latency:

[0022] ;

[0023] In the formula, Number of queues; Number of links; For the first Arrival rate of each queue; For the first Service rate of each queue; For the first Propagation delay of the link; For the first The capacity of each link; This is the first error term.

[0024] 2. Minimize packet loss rate:

[0025] ;

[0026] In the formula, For the first The probability of packet loss for each queue; For the first Traffic on each link; For the first The capacity of each link; This is the second error term.

[0027] 3. Maximize bandwidth utilization:

[0028] ;

[0029] In the formula, As a weighting factor, its value range is ; This is the third error term.

[0030] 4. Minimize energy consumption:

[0031] ;

[0032] In the formula, For the number of devices; For the first Basic power consumption of each device; For the first Dynamic power consumption coefficient of each device; For the first Utilization rate of each device; For the first Power consumption of the link; For the first The status of each link (0 indicates closed, 1 indicates open); For link power consumption weights; This is the fourth error term.

[0033] 5. Maximize network throughput:

[0034] ;

[0035] In the formula, Congestion penalty factor; This is the fifth error term.

[0036] The constraints include:

[0037] 1. Queue length limit:

[0038] ;

[0039] where, is the maximum allowed queue length.

[0040] 2. Buffer size limit:

[0041] ;

[0042] where, is the total buffer size.

[0043] 3. Routing table size limit:

[0044] ;

[0045] where, is the number of routing entries; is the size of the th routing entry; is the status of the th routing entry (0 means not enabled, 1 means enabled); is the maximum routing table size.

[0046] 4. Traffic balancing constraint:

[0047] ;

[0048] where, is the set of nodes; and are the in-edge set and out-edge set of node , respectively.

[0049] 5. Bandwidth allocation constraint:

[0050] ;

[0051] where, is the priority weight of the th flow; is the total allocatable bandwidth.

[0052] Parameter acquisition method:

[0053] 1. and : The arrival rate and service rate of the queue are collected in real time through network monitoring tools (such as SNMP).

[0054] 2. and : The link propagation delay is obtained through ping testing, and the link capacity is read from the switch configuration.

[0055] 3. : The queue statistics information of the switch is calculated by the formula: .

[0056] 4. and : The basic power consumption is obtained from the device specifications, and the dynamic power consumption coefficient is determined by energy consumption test experiments. The test steps include:

[0057] (1) Measure the total power consumption of the device under different loads;

[0058] (2) Use linear regression to fit , get and .

[0059] 5. : The device utilization is calculated by the weighted average of CPU usage, memory usage, etc.: .

[0060] 6. : The link power consumption is obtained by testing or referring to the typical value in the device specifications.

[0061] 7. : The routing entry size is determined according to the routing protocol and address type, such as 24 bytes for IPv4 and 40 bytes for IPv6.

[0062] 8. : The flow priority weight is set according to the service requirements and QoS policy, usually in the range of .

[0063] Further, according to the optimal switch adjustment parameters, a template is generated according to the preset preliminary instructions to generate preliminary switch instructions, which specifically includes:

[0064] 1. Analyze the optimal parameters output by the optimization model, including queue configuration, bandwidth allocation, routing strategy, etc.

[0065] 2. According to the switch command syntax of different manufacturers, generate a function according to the preset instruction template;

[0066] 3. Map the optimal parameters to the corresponding switch configuration items;

[0067] 4. Use the templated function to generate preliminary configuration instructions;

[0068] 5. Perform basic syntax checking on the generated instructions;

[0069] 6. According to the current configuration of the switch, generate incremental configuration instructions.

[0070] The language model fine-tuning training data set construction step specifically includes:

[0071] 1. Collect historical switch configuration instructions and corresponding network parameter data;

[0072] 2. Clean the collected data to remove sensitive information and irrelevant data;

[0073] 3. Structure the data according to the input (network parameters + preliminary instructions) and output (optimized instructions) format;

[0074] 4. Divide the data set, including training set, validation set and test set;

[0075] 5. Standardize the data to ensure consistency;

[0076] 6. According to the complexity of the task, appropriately increase the comprehensive examples and boundary conditions;

[0077] 7. Quality audit of the data set to ensure the accuracy and representativeness of the data;

[0078] 8. Data augmentation, such as generating more samples through slight changes.

[0079] The language model fine-tuning method specifically includes:

[0080] 1. Select the base model: select a suitable pre-trained large language model according to the task requirements;

[0081] 2. Define the task: define the problem as a conditional text generation task;

[0082] 3. Prepare the training script: use a suitable deep learning framework (such as PyTorch or TensorFlow) to write the fine-tuning script, which can use the default fine-tuning script of the large language model by default;

[0083] 4. Set the hyperparameters: including learning rate, batch size, training rounds, etc.

[0084] 5. Implement fine-tuning: use the prepared data set to fine-tune the model;

[0085] 6. Monitor and adjust: monitor the model performance during training and adjust the hyperparameters if necessary;

[0086] 7. Model evaluation: evaluate the model performance using the test set;

[0087] 8. Iterative optimization: according to the evaluation results, make necessary model architecture adjustments or data set optimization.

[0088] Specifically, the step S10 specifically includes the following steps:

[0089] Step S101, real-time collection of switch traffic, delay, packet loss rate, bandwidth utilization, queue length, buffer usage, CPU utilization, memory usage, etc. basic performance indicators using network monitoring tools (such as SNMP). The performance indicators reflect the current running state of the switch, providing the basis for subsequent multi-objective optimization.

[0090] Step S102, collect the link state information of the switch, including link bandwidth, link delay, etc. Parameters, as well as routing strategy, QoS configuration, VLAN division, link aggregation, spanning tree parameters, access control list, port mirror setting, etc. Network configuration information. The link state and network configuration information help to fully understand the running environment of the switch.

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

[0092] 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.

[0093] Step S105, quality audit of the data set, check the accuracy and integrity of the data, and eliminate samples that may have errors or biases. If necessary, more samples can be generated to enrich the data set through data enhancement techniques such as slight changes, combinations, etc.

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

[0095] Specifically, the specific implementation process of step S20 is as follows:

[0096] Step S201, according to the collected switch network parameters, a weighted multi-objective optimization model is constructed. The objective function of the optimization model includes: minimizing network delay, minimizing packet loss rate, maximizing bandwidth utilization, minimizing energy consumption, and maximizing network throughput. By optimizing these performance indicators comprehensively, the optimal adjustment parameters of the switch can be obtained.

[0097] Step S202, solve the network delay optimization objective function where is the number of queues, is the number of links, For the first Arrival rate of each queue For the first Service rate of each queue For the first Propagation delay of the link, For the first The capacity of each link, This is the error term. This function describes the sum of queue latency and link latency, and its goal is to minimize it.

[0098] Step S203: Optimize the objective function for packet loss rate. Solve the problem. Among them, For the first The probability of packet loss for each queue. For the first Traffic on each link For the first The capacity of each link, This is the error term. This function describes the overall packet loss rate, including queue packet loss and link congestion packet loss, and its goal is to minimize it.

[0099] Step S204: Optimize the objective function for bandwidth utilization. Solve the problem. Among them, As a weighting factor, its value range is , This is the error term. The function describes average bandwidth utilization and minimum bandwidth utilization, and the goal is to maximize the weighted sum of these two metrics.

[0100] Step S205, optimize the energy consumption objective function. Solve the problem. Among them, For the number of devices, For the first The basic power consumption of each device For the first Dynamic power consumption coefficient of each device For the first Utilization rate of each device For the first Power consumption of each link For the first The status of each link (0 indicates closed, 1 indicates open). For link power consumption weights, This is the error term. This function describes the weighted sum of the device's total power consumption and the link power consumption, and its goal is to minimize it.

[0101] Step S206, optimize the objective function for network throughput. Solve the problem. Among them, a congestion penalty factor, is an error term. This function describes the maximum throughput of the network and subtracts a penalty term related to the congestion level, aiming to maximize it.

[0102] Step S207, the above objective functions are constructed into a weighted multi-objective optimization model, and combined with relevant constraints (such as queue length limit, buffer size limit, routing table size limit, traffic balance constraint, bandwidth allocation constraint, etc.), the optimal adjustment parameters of the switch are obtained. The parameters include queue configuration, bandwidth allocation, routing strategy, etc., which provide the basis for subsequent instruction generation.

[0103] Through the above steps, the optimal adjustment parameters of the switch are obtained based on the multi-objective optimization method, which lays the foundation for further optimization of switch instructions.

[0104] Specifically, the specific implementation process of step S30 is as follows:

[0105] Step S301, analyze 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.

[0106] Step S302, according to the command syntax of different manufacturers' switches, design a pre-defined instruction template. The template can cover common switch configuration instructions, providing a standard format for generating preliminary instructions.

[0107] Step S303, map the optimal parameters to the corresponding switch configuration items, such as queue length, bandwidth allocation ratio, routing entry, etc. Through the correspondence between parameters and configuration items, the consistency of instruction content and optimization results is guaranteed.

[0108] Step S304, use the templating function to generate preliminary configuration instructions. The function can automatically fill the optimal parameters into the pre-set instruction template to generate preliminary switch instructions.

[0109] Step S305, perform basic syntax checking on the generated preliminary instructions to ensure that keywords, parameter formats, etc. in the instructions conform to the command specifications of the switch. In addition, combined with the current configuration of the switch, check whether the logic of the instructions is reasonable, such as whether the queue length exceeds the buffer size, etc.

[0110] Step S306, according to the current configuration of the switch, analyze the parts that need to be updated, and generate incremental configuration instructions. The incremental instructions can minimize the impact on the existing configuration of the switch, improving execution efficiency.

[0111] Through the above steps, the preliminary switch instructions are generated based on the parameters output by the optimization model, and the syntax and logic are verified, laying the foundation for subsequent large language model optimization.

[0112] Specifically, the specific implementation process of the step S40 is as follows:

[0113] Step S401, collect historical switch configuration instructions and corresponding network parameter data as training data set of large language model. The data set covers the configuration instructions of switch in different scenarios and the corresponding performance.

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

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

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

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

[0118] Step S406, use the prepared data set to fine-tune the base model, and monitor the model performance during training, and adjust the hyperparameters if necessary.

[0119] 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 adjustments to the model architecture or optimize the data set to ensure the generalization ability of the model.

[0120] Through the above steps, the large language model optimization method gets more optimized switch instructions, which provides high-quality input for subsequent syntax and logic verification.

[0121] Specifically, the specific implementation process of the step S50 is as follows:

[0122] Step S501, check the optimized switch instructions to ensure that the keywords, parameter formats, etc. in the instructions conform to the command specifications of the switch. The syntax check ensures that the instructions can be correctly parsed and executed by the switch.

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

[0124] Step S503, for the potential problems found, analyze the causes and adjust the optimization model or the training of the large language model as appropriate to optimize the generation process of the instructions.

[0125] Step S504, the switch instructions that have passed the syntax and logic verification are finally confirmed to ensure the correctness and executability of the instructions.

[0126] Step S505, generate a configuration file containing the optimized instructions for the operation and maintenance personnel to directly issue 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.

[0127] Through the above steps, the optimized switch instructions are strictly verified in syntax and logic to ensure that the instructions can be executed smoothly and will not cause switch failure or network interruption, laying a foundation for subsequent configuration updates.

[0128] The second aspect of the application provides a computer readable storage medium, wherein the computer readable storage medium stores program instructions, and the program instructions are used to execute the above-mentioned switch instruction optimization method when running in a computer.

[0129] The third aspect of the application provides a switch instruction optimization system, which comprises the above-mentioned computer readable storage medium.

[0130] Compared with the prior art, the switch instruction optimization method, medium and system provided by the application have the following advantages:

[0131] 1. Multi-objective optimization: The application adopts a weighted multi-objective optimization model, considering multiple key performance indicators such as network delay, packet loss rate, bandwidth utilization, energy consumption and throughput. By balancing these indicators, the best balance point of switch performance can be found to meet the overall needs of network operation. Compared with single indicator optimization, this method significantly improves the overall level of switch performance.

[0132] 2. Adaptive optimization: The optimization model of the present application can collect performance data of the switch in real time, dynamically adjust the optimization target and constraint condition. With the change of network load, the model can automatically generate the latest optimization configuration, realize the continuous optimization of switch performance, and meet the dynamic demand of network environment. Compared with periodic manual optimization, this method is more agile and efficient.

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

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

[0135] 5. Instruction generation automation: The present application can automatically generate switch instructions and pass syntax and logic verification to ensure the correctness and executability of the instructions. Compared with manually writing instructions, this method greatly improves the efficiency of configuration and reduces the risk of human intervention.

[0136] In summary, the switch performance optimization method proposed by the present application can effectively solve the problems of the prior art, realize the automation, multi-objective optimization and interpretability of network performance, and solve the technical problems of the prior art that switch instructions depend on manual optimization configuration and lack of automation capability. BRIEF DESCRIPTION OF DRAWINGS

[0137] Figure 1 The flowchart of the method provided by the present application;

[0138] Figure 2 The network delay distribution graph before and after optimization in Example 2;

[0139] Figure 3 The packet loss rate change graph before and after optimization in Example 2. DETAILED DESCRIPTION

[0140] In order to make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application.

[0141] As Figure 1As shown, the application provides a switch instruction optimization method flow chart, the method includes the following steps:

[0142] S10, collect the network parameters of the switch;

[0143] S20, calculate the optimal switch adjustment parameter using a weighted multi-objective optimization model;

[0144] S30, generate a preliminary switch instruction according to the optimal switch adjustment parameter and the preset preliminary instruction generation template;

[0145] S40, input the preliminary switch instruction and the collected network parameters of the switch into a pre-tuned large language model to generate an optimized switch instruction;

[0146] S50, perform syntax checking and logical verification on the optimized switch instruction to ensure its correctness and executability;

[0147] S60, send the verified switch instruction to the operation and maintenance personnel.

[0148] The specific implementation of the above steps is described in detail as follows:

[0149] Step S10, collecting the network parameters of the switch is to obtain the current running state of the switch. First, real-time collection of the traffic, delay, packet loss rate, bandwidth utilization, queue length, buffer usage, CPU utilization, memory usage, and other basic performance indicators of the switch is performed through network monitoring tools (such as SNMP). Second, link state information of the switch is collected, including link bandwidth, link delay, and other network configuration information such as routing strategy, QoS configuration, VLAN division, link aggregation, spanning tree parameters, access control list, and port mirroring settings. The collection of these parameters provides the necessary basis for subsequent multi-objective optimization.

[0150] Step S20, the optimal switch adjustment parameter is calculated using a weighted multi-objective optimization model. The objective function of the optimization model includes: minimizing network delay, minimizing packet loss rate, maximizing bandwidth utilization, minimizing energy consumption, and maximizing network throughput.

[0151] The network delay optimization objective function is:

[0152] ;

[0153] Wherein, is the number of queues, is the number of links, is the arrival rate of the i-th queue, is the energy consumption of the i-th queue, is the network throughput of the i-th queue, is the bandwidth of the i-th link.Service rate of each queue For the first Propagation delay of the link, For the first The capacity of each link, This is the first error term. This function describes the sum of queue latency and link latency, and its goal is to minimize it.

[0154] The objective function for optimizing packet loss rate is:

[0155] ;

[0156] in, For the first The probability of packet loss for each queue. For the first Traffic on each link For the first The capacity of each link, This is the second error term. This function describes the overall packet loss rate, including queue packet loss and link congestion packet loss, and its goal is to minimize it.

[0157] The objective function for bandwidth utilization optimization is:

[0158] ;

[0159] in, As a weighting factor, its value range is , This 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 metrics.

[0160] The energy consumption optimization objective function is:

[0161] ;

[0162] in, For the number of devices, For the first The basic power consumption of each device For the first Dynamic power consumption coefficient of each device For the first Utilization rate of each device For the first Power consumption of each link For the first The status of each link (0 indicates closed, 1 indicates open). For link power consumption weights, This is the fourth error term. This function describes the weighted sum of the device's total power consumption and the link power consumption, and its goal is to minimize it.

[0163] The network throughput optimization objective function is:

[0164] ;

[0165] where, is a 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 degree of congestion, aiming to maximize it.

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

[0167] The constraint conditions of the optimization model include:

[0168] 1. Queue length limit: , where is the maximum allowed queue length.

[0169] 2. Buffer size limit: , where is the total buffer size.

[0170] 3. Routing table size limit: , where is the number of routing entries, is the size of the th routing entry, is the state of the th routing entry (0 means not enabled, 1 means enabled), is the maximum routing table size.

[0171] 4. Traffic balance constraint: , where is the set of nodes, and are the incoming edge set and outgoing edge set of node , respectively.

[0172] 5. Bandwidth allocation constraint: , where is the priority weight of the th flow, is the total allocatable bandwidth.

[0173] 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.

[0174] Step S30, generate preliminary switch instructions according to the optimal switch adjustment parameters. First, analyze the optimal parameters output by the optimization model, including queue configuration, bandwidth allocation, routing strategy, etc. Then, design a pre-defined instruction template according to the command syntax of different manufacturers' switches. Next, map the optimal parameters to the corresponding switch configuration items and generate preliminary configuration instructions using templating functions. Finally, perform basic syntax checking on the generated instructions to ensure their correctness.

[0175] For example, for queue configuration optimization, the following preliminary instructions can be generated:

[0176] interface GigabitEthernet0 / 1 queue-limit 50 tx-ring-limit 32priority-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

[0177] 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. At the same time, the size of the ring buffer is also adjusted.

[0178] Step S40, input the preliminary switch instructions and the collected network parameters into the pre-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 processed through cleaning, structuring and standardization to form the input (network parameters + preliminary instructions) and output (optimized instructions) format. During the fine-tuning process, appropriate hyperparameters such as learning rate and batch size need to be set, and necessary adjustments are made by monitoring the model performance. After iterative optimization, the final large language model can generate optimized switch instructions according to the input network parameters and preliminary instructions.

[0179] For example, for the previous queue configuration instructions, the optimized instructions are:

[0180] interface GigabitEthernet0 / 1 queue-limit 40 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

[0181] Compared with the preliminary instructions, the queue length limit and the ring buffer size are further optimized here to better meet the network performance targets.

[0182] Step S50, syntax checking and logical verification are performed on the optimized switch instructions to ensure their correctness and executability. First, the syntax of the instructions is checked to see if it conforms to the command specifications of the switch, including keyword spelling, parameter format, etc. Then, in combination with the current configuration of the switch, the logic of the instructions is verified to see if it is reasonable, such as checking if the queue length exceeds the buffer size, if the size of the routing table 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.

[0183] Step S60, the verified switch instructions are sent to the operation and maintenance personnel. The operation and maintenance personnel can update the configuration of the switch according to these instructions through remote or on-site methods to optimize the performance of the switch.

[0184] In summary, this invention proposes a switch instruction optimization method based on multi-objective optimization and large language models. Among them, the key performance parameters of the switch are collected, the weighted multi-objective optimization model is used to calculate the optimal adjustment parameters, and then the 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 their correctness and executability, and are handed over to the operation and maintenance personnel for execution.

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

[0186] The third aspect of the invention provides a switch instruction optimization system, which contains the above-mentioned computer-readable storage medium.

[0187] Specifically, the principle of the present application is to use a weighted multi-objective optimization model to calculate the optimal switch adjustment parameters. This optimization model considers multiple key performance indicators such as network delay, packet loss rate, bandwidth utilization, energy consumption, and throughput, and by balancing these indicators, it can find the best balance point of switch performance.

[0188] Network delay is one of the most sensitive performance indicators for user experience. The optimization model of the present application models the delay as the sum of queue delay and link delay, and by minimizing this indicator, it can effectively shorten the user-perceived response time.

[0189] Packet loss rate reflects the reliability of the network, and excessive packet loss rate can seriously affect the normal operation of application programs. The optimization model models the packet loss rate as a combination of queue packet loss and link congestion packet loss, and minimizing this indicator can ensure the reliability of data transmission.

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

[0191] Energy consumption optimization reflects the economy and environmental friendliness of switch operation. The optimization model models the power consumption of the device itself and the power consumption of the link, and minimizing the overall energy consumption helps to reduce operating costs and achieve green networks.

[0192] Finally, network throughput reflects the overall traffic carrying capacity. In addition to maximizing the throughput indicator, the optimization model also introduces a congestion penalty term to ensure that high throughput is pursued while also considering the overall stability of the network.

[0193] It should be noted that there is usually some contradiction and trade-off between these optimization objectives. For example, increasing throughput may sacrifice delay performance, and reducing energy consumption may affect bandwidth utilization. Therefore, the present application uses a weighted multi-objective optimization method to seek the best balance between these indicators by setting reasonable weight coefficients to meet the comprehensive needs of network operation.

[0194] In the process of multi-objective optimization, the present application also introduces a series of constraints, such as queue length limits, buffer size limits, and routing table size limits. These constraints ensure that the optimization results are feasible and executable in actual switch configurations, avoiding "ideal" solutions that are detached from reality.

[0195] It should be particularly noted that the optimization model of the present application not only calculates the optimal switch adjustment parameters, but also provides corresponding mathematical expressions and physical explanations. This interpretability greatly helps operations and maintenance personnel to understand the internal mechanism of the optimization strategy and enhances the trust in the optimization results.

[0196] In addition, the application also introduces a large language model-based instruction optimization method. By collecting historical switch configuration instructions and corresponding network performance data as a training set, a pre-trained large language model can learn the experience of manually written instructions. On this basis, the model can generate more optimized switch configurations according to the current network parameters and preliminary instructions, further improving the performance of the switch. This method is conducive to the potential of artificial intelligence in network operation and maintenance, and realizes the automation and intelligentization of instruction generation.

[0197] In order to better understand and implement the application, a specific embodiment 1 of the method of the application is provided below, and each step in this embodiment is described in detail as follows:

[0198] Step S10, collecting network parameters of the switch. First, real-time collection of basic performance indicators such as traffic , delay , packet loss rate , bandwidth utilization , queue length , buffer usage , CPU utilization , and memory usage of the switch through network monitoring tools (such as SNMP). Among them, is the number of queues, is the number of links, is the service rate of the th queue, is the capacity of the th link.

[0199] Secondly, the link state information of the switch is collected, including link bandwidth , link delay , and network configuration information such as routing strategy, QoS configuration, VLAN division, link aggregation, spanning tree parameters, access control list, and port mirroring settings. The collection of these parameters provides the necessary basis for subsequent multi-objective optimization.

[0200] For the calculation of device utilization , a weighted average method can be used: , wherein , and are weight coefficients reflecting the contribution of different indicators to device utilization.

[0201] 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 , minimizing packet loss rate , maximize bandwidth utilization , minimize energy consumption , maximize network throughput .

[0202] The network latency optimization objective function is:

[0203] ;

[0204] where is the error term. This function describes the sum of queue latency and link latency, with the goal of minimizing it.

[0205] The packet loss rate optimization objective function is:

[0206] ;

[0207] where is the error term. This function describes the overall packet loss rate, including queue loss and link congestion loss, with the goal of minimizing it.

[0208] The bandwidth utilization optimization objective function is:

[0209] ;

[0210] where is the trade-off factor, taking values in the range , is the error term. This function describes the average bandwidth utilization and the minimum bandwidth utilization, with the goal of maximizing their weighted sum.

[0211] The energy consumption optimization objective function is:

[0212] ;

[0213] where is the number of devices, is the base power consumption of the th device, is the dynamic power consumption coefficient of the th device, is the power consumption of the th link, is the state of the th link (0 for off, 1 for on), is the link power consumption weight, is the error term. This function describes the weighted sum of device total power consumption and link power consumption, with the goal of minimizing it.

[0214] The network throughput optimization objective function is:

[0215] ;

[0216] where, is the congestion penalty factor, is the error term. This function describes the network maximum throughput and subtracts a penalty term related to the congestion level, aiming to maximize it.

[0217] The constraints of the optimization model include:

[0218] 1. Queue length limit:

[0219] ;

[0220] where, is the maximum allowed queue length. This constraint ensures that the queue length does not exceed the set upper limit.

[0221] 2. Buffer size limit:

[0222] ;

[0223] where, is the total buffer size. This constraint ensures that the buffer usage does not exceed the total capacity.

[0224] 3. Routing table size limit:

[0225] ;

[0226] where, is the number of routing entries, is the size of the th routing entry, is the status of the th routing entry (0 for not enabled, 1 for enabled), is the maximum routing table size. This constraint ensures that the routing table size does not exceed the limit.

[0227] 4. Traffic balance constraint:

[0228] ;

[0229] where, is the set of nodes, and are the sets of incoming and outgoing edges of node . This constraint ensures the traffic balance of each node in the network.

[0230] 5. Bandwidth allocation constraint:

[0231] ;

[0232] where, is the priority weight of the th flow, is the total bandwidth available. This constraint ensures that the bandwidth allocation satisfies the priority requirement.

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

[0234] Step S30, according to the optimal switch adjustment parameters, generate preliminary switch instructions. First, analyze the optimal parameters output by the optimization model, including queue configuration , bandwidth allocation , routing strategy , etc.

[0235] Then, according to the command syntax of different manufacturers' switches, design pre-defined instruction templates. For example, for queue configuration optimization, the following preliminary instructions can be generated:

[0236] interface GigabitEthernet0 / 1

[0237] queue-limit ;

[0238] priority-queue out num-of-queues ;

[0239] queue-limit queue-num 0 ;

[0240] queue-limit queue-num 1 ;

[0241]

[0242] queue-limit queue-num ;

[0243] Here, according to the output of the optimization model, the number of queues is set to , and the length limit of each queue is set. At the same time, the size of the ring buffer is also adjusted .

[0244] Next, map the optimal parameters to the corresponding switch configuration items, and use the templating function to generate preliminary configuration instructions. Finally, perform basic syntax checking on the generated instructions to ensure their correctness.

[0245] Step S40, input the preliminary switch instructions and the collected network parameters into the pre-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 processed through cleaning, structuring and standardization to form the input (network parameters + preliminary instructions) and output (optimized instructions) formats.

[0246] During the fine-tuning process, appropriate hyperparameters such as learning rate , batch size , etc. need to be set and adjusted through monitoring model performance. After iterative optimization, the final large language model can generate optimized switch instructions based on input network parameters and preliminary instructions.

[0247] For example, for the previous queue configuration instructions, the optimized instructions are:

[0248] interface GigabitEthernet0 / 1

[0249] queue-limit ;

[0250] priority-queue out num-of-queues ;

[0251] queue-limit queue-num 0 ;

[0252] queue-limit queue-num 1 ;

[0253]

[0254] queue-limit queue-num ;

[0255] Compared with the preliminary instructions, the queue length limit is further optimized to better meet the network performance goals.

[0256] Step S50, perform syntax checking and logical verification on the optimized switch instructions to ensure correctness and executability. First, check if the syntax of the instructions conforms to the command specifications of the switch, including keyword spelling, parameter format, etc. Then, combined with the current configuration of the switch, verify the reasonableness of the instructions, such as checking if the queue length exceeds the buffer size , the size of the routing table exceeds the limit These checks and verifications ensure that the generated switch commands can be executed smoothly without causing switch malfunctions or network outages.

[0257] Step S60: Send the verified switch commands to the maintenance personnel. The maintenance personnel can then use these commands to update the switch configuration remotely or on-site, thereby optimizing switch performance.

[0258] The following is a specific application scenario of the present invention, Example 2: An internet company owns a large data center with dozens of core switches deployed. With the rapid development of its business, these switches are facing enormous network load pressure, and their performance indicators have declined significantly, seriously affecting the normal operation of the business. Therefore, the company decided to adopt the switch performance optimization method proposed in this invention to intelligently optimize the switches in the data center.

[0259] First, the company used network monitoring tools (such as SNMP) to collect real-time data on various performance metrics of the switches, including:

[0260] Table 1 Performance Indicators of Data Center Switches of an Internet Company

[0261]

[0262] As shown in Table 1, the performance indicators of these switches exhibit significant fluctuations, especially during peak traffic periods, when latency and packet loss rates rise markedly, and bandwidth utilization approaches saturation. This poses a major challenge to the stable operation of services.

[0263] Based on the collected performance data, the company constructed a weighted multi-objective optimization model, as follows:

[0264] Network latency optimization objective function:

[0265] ;

[0266] in, The number of queues in the exchange. For the number of links, For the first Arrival rate of each queue For the first Service rate of each queue For the first Propagation delay of the link, For the first The capacity of each link, This is the error term.

[0267] Packet loss rate optimization objective function:

[0268] ;

[0269] where, is the packet loss probability of the th queue, is the traffic of the th link, is the capacity of the th link, is the error term.

[0270] Bandwidth utilization optimization objective function:

[0271] ;

[0272] where, is the trade-off factor, which is in the range of , is the error term.

[0273] Energy consumption optimization objective function:

[0274] ;

[0275] where, is the number of switches, is the base power consumption of the th switch, is the dynamic power consumption coefficient of the th switch, is the utilization rate of the th switch, is the power consumption of the th link, is the state of the th link (0 for off, 1 for on), is the link power consumption weight, is the error term.

[0276] Network throughput optimization objective function:

[0277] ;

[0278] where, is the congestion penalty factor, is the error term.

[0279] The constraints of the optimization model include:

[0280] 1. Queue length limit: , where is the maximum allowed queue length.

[0281] 2. Buffer size limit: , wherein is the total buffer size.

[0282] 3. Routing table size limit: , wherein is the number of routing entries, is the size of the th routing entry, is the state of the th routing entry (0 means not enabled, 1 means enabled), is the maximum routing table size.

[0283] 4. Traffic balancing constraint: , wherein is the set of nodes, and are the in-edge set and out-edge set of node , respectively.

[0284] 5. Bandwidth allocation constraint: , wherein is the priority weight of the th flow, is the total allocatable bandwidth.

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

[0286] According to the output of the optimization model, the enterprise generates preliminary switch configuration instructions, such as:

[0287] interface GigabitEthernet0 / 1

[0288] queue-limit 100

[0289] tx-ring-limit 32

[0290] priority-queue out num-of-queues 4

[0291] queue-limit queue-num 0 50

[0292] queue-limit queue-num 1 30

[0293] queue-limit queue-num 2 20

[0294] queue-limit queue-num 3 10

[0295] These preliminary instructions and collected performance data are then input into a pre-tuned GPT-3 model for optimization. After training, the model can generate more optimized switch instructions, such as:

[0296] interface GigabitEthernet0 / 1

[0297] queue-limit 80

[0298] tx-ring-limit 28

[0299] priority-queue out num-of-queues 4

[0300] queue-limit queue-num 0 45

[0301] queue-limit queue-num 1 35

[0302] queue-limit queue-num 2 15

[0303] queue-limit queue-num 3 8

[0304] Compared with the preliminary instructions, the optimized configuration further adjusts the queue length and ring buffer size to better meet the optimization goals of delay, packet loss rate, and bandwidth utilization.

[0305] Finally, the enterprise conducts strict syntax checking and logical verification on the optimized switch instructions to ensure their correctness and executability. After verification, the instructions are issued to the switch to achieve automatic optimization of switch performance. In this optimization process, the enterprise uses 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 shifts significantly to the left, with the average delay reduced from 20ms to 15ms and the fluctuation range of delay significantly reduced. This means that the user's response time has been significantly improved. The Figure 3 The results show that after optimization, the switch's packet loss rate is significantly reduced from 2%-5% to 1%-3%. This means that the network's reliability has been improved, and the stability of the application will also be improved.

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

[0307] The above merely provides the specific implementation of the present application, but the protection scope of the present application is not limited thereto, any person skilled in the art can easily think of the changes or replacements within the technical range disclosed by the present application, which should be covered within the protection scope of the present application.

Claims

1. A method for optimizing switch instructions, characterized in that, Includes the following steps: S10. Collect network parameters of the switch; S20. Calculate the optimal switch adjustment parameters using a weighted multi-objective optimization model; S30. Adjust parameters according to the optimal switch, generate a template based on the preset preliminary instructions, and generate preliminary switch instructions. S40. Input the initial switch commands and the network parameters of the acquisition switch into the pre-tuned large language model to generate optimized switch commands. S50. Perform syntax checks and logic verifications on the optimized switch instructions to ensure the correctness and executability of the instructions; S60. Send the verified switch command to the maintenance personnel; The network parameters of the switch include traffic, latency, packet loss rate, bandwidth utilization, queue length, buffer utilization, CPU utilization, memory utilization, link status, routing policy, QoS configuration, VLAN segmentation, link aggregation, spanning tree parameters, access control list, and port mirroring settings. The optimization objectives of the weighted multi-objective optimization model include minimizing network latency, 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 balancing constraint, and bandwidth allocation constraint. The objective function for minimizing network latency is: ; In the formula, Number of queues; Number of links; For the first Arrival rate of each queue; For the first Service rate of each queue; For the first Propagation delay of the link; For the first The capacity of each link; This is the first error term; The objective function for minimizing packet loss rate is: ; In the formula, For the first The probability of packet loss for each queue; For the first Traffic on each link; For the first The capacity of each link; This is the second error term; The objective function for maximizing bandwidth utilization is: ; In the formula, As a weighting factor, its value range is ; This is the third error term; The objective function for minimizing energy consumption is: ; In the formula, For the number of devices; For the first Basic power consumption of each device; For the first Dynamic power consumption coefficient of each device; For the first Utilization rate of each device; For the first Power consumption of the link; For the first The status of each link, where 0 indicates off and 1 indicates on; Link power consumption weight; This is the fourth error term; The objective function for maximizing network throughput is: ; In the formula, Congestion penalty factor; This is the fifth error term; The flow balancing constraints are as follows: ; In the formula, For a set of nodes; and They are nodes The set of incoming edges and the set of outgoing edges.

2. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores program instructions, which, when executed in a computer, are used to perform the switch instruction optimization method according to claim 1.

3. A switch instruction optimization system, characterized in that, It includes the computer-readable storage medium as described in claim 2.

Citation Information

Patent Citations

  • Concentrator optimal configuration method and system based on deep learning

    CN118659972A