Switch parameter automatic configuration method suitable for intelligent power distribution terminal
By combining CNN and an improved Transformer neural network, the standardization and dynamic configuration of parameters for intelligent power distribution terminal switches are realized, solving the problems of poor scenario adaptability and insufficient dynamic configuration in existing technologies, and improving the adaptability of configuration and the adaptive optimization capability of the model.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- XUCHANG DEKANG TECHNOLOGY CO LTD
- Filing Date
- 2026-01-21
- Publication Date
- 2026-05-01
AI Technical Summary
Existing technologies suffer from poor scenario adaptability and lack of dynamic configuration and online optimization capabilities in the parameter configuration of intelligent power distribution terminal switches, making it difficult to meet the real-time and complex requirements of flexible loads such as distributed photovoltaics and electric vehicles.
A standardized parameter configuration model pre-trained by a convolutional neural network (CNN) and a dynamic parameter configuration model of an improved Transformer neural network are used to perform hierarchical parameter updates in conjunction with performance feedback data, thereby achieving the standardization and dynamic configuration of switch parameters.
It achieves efficient and dynamic adaptation of switch parameters, improves the comprehensive adaptability of configuration, and ensures the continuous evolution and efficient operation of the model through online adaptive optimization.
Smart Images

Figure CN121960596A_ABST
Abstract
Description
Automatic configuration method for switch parameters applicable to intelligent power distribution terminals Technical Field
[0001] This invention relates to the field of intelligent power distribution automation technology, and specifically to an automatic configuration method for switch parameters applicable to intelligent power distribution terminals, which realizes the standardization and dynamic automatic configuration of switch parameters in intelligent power distribution terminal access scenarios. Background Technology
[0002] With the deep transformation of intelligent power distribution automation towards digitalization and intelligence, and the explosive growth of flexible loads such as distributed photovoltaics and electric vehicles, higher demands are being placed on the real-time performance, adaptability, and self-optimization capabilities of power distribution terminal switches in terms of parameter configuration. Traditional manual configuration methods can no longer meet the operation and maintenance needs of large-scale terminals, while automated configuration solutions integrating technologies such as artificial intelligence and edge computing have become an industry trend, and their application in the power system field has shown a diversified trend.
[0003] Chinese patent (publication number CN120652821A) discloses a method for adjusting control parameters of thermal power units based on large models and digital twins, which achieves parameter optimization through massive data learning and virtual simulation verification; however, it focuses on thermal power unit control scenarios, does not involve dynamic configuration of switches, and does not design a dedicated model for the time-series coupling characteristics of power distribution conditions, making it difficult to directly adapt to the real-time requirements of terminal data transmission.
[0004] Chinese patent (publication number CN110110905A) discloses a CNN-based method for judging and warning of power equipment faults. By constructing a multi-layer convolutional neural network model, it extracts features and predicts faults from multi-dimensional operating data of coal mills, thus achieving accurate monitoring of equipment status. However, the model only has offline training and static prediction capabilities, lacks an online adaptive optimization mechanism, and cannot dynamically adjust the output results according to real-time operating condition changes, making it difficult to cope with the volatility and complexity of distribution network operating conditions.
[0005] In summary, while existing technologies have verified the effectiveness of artificial intelligence in data processing and status monitoring, their application in configuring parameters of intelligent power distribution terminal switches still suffers from poor scenario adaptability and a lack of dynamic configuration and online optimization capabilities. Therefore, there is an urgent need for a highly efficient, dynamically adaptable, and stable solution to meet the high-efficiency operation requirements of intelligent power distribution terminals. Summary of the Invention
[0006] Based on the above-mentioned technical problems, this application discloses an automatic configuration method for switch parameters applicable to intelligent power distribution terminals, specifically including:
[0007] When the intelligent power distribution terminal is started, the first model is triggered to run. The first model is a standardized parameter configuration model pre-trained by a convolutional neural network (CNN).
[0008] Read the terminal model and scenario information, encode it into a two-dimensional feature matrix, input it into the first model, generate a unique standardized configuration, and send it to the switch to achieve parameter configuration standardization, while reserving an interface for the second model;
[0009] After completing the parameter standardization settings, the first model is closed, and the second model is triggered to run through the reserved interface. The second model is a dynamic parameter configuration model trained by an improved Transformer neural network.
[0010] Real-time acquisition of switch operating status data is input into the second model. With the goal of maximizing network throughput and minimizing configuration response latency, the optimal switch configuration parameters are output and sent to the switch to achieve dynamic parameter configuration.
[0011] Based on the configured performance feedback data, the parameters of the dynamically configured model are fine-tuned through a hierarchical parameter update strategy to achieve online adaptive optimization of the model;
[0012] When the terminal is shut down, the operating condition characteristics of the second model during long-term operation are fed back to the database of the first model, and the first model is updated when the smart power distribution terminal is restarted.
[0013] Preferably, the first model is as follows:
[0014] The first model includes an offline pre-training stage and an online real-time inference stage;
[0015] Offline work, including model building and training during the offline pre-training phase, and the ability to adapt and generate parameters for multiple types and scenarios of power distribution terminals in CNN models, forms the basis for online inference.
[0016] During the online real-time inference phase, a customized standardized configuration template is generated in real time using the pre-trained model.
[0017] Preferably, the offline pre-training stage specifically includes:
[0018] Based on the historical configuration data of different models of intelligent power distribution terminals in different application scenarios, a historical input feature set and a historical output tag set are constructed.
[0019] The historical input feature set is converted into a two-dimensional historical feature matrix that can be received by the CNN. Combined with the historical output label set, and after preprocessing, the first model is pre-trained offline. Key information in the feature matrix is extracted using a two-layer convolutional structure combined with max pooling. The formula is as follows:
[0020]
[0021]
[0022] in , They are two convolutional layers, For max pooling operation, It is the ReLU activation function. A historical two-dimensional feature matrix, , These are the convolution kernels of the first and second convolutional layers, respectively. , These are the bias terms;
[0023] During training, hyperparameters are optimized using the Adam optimizer, and the error between the output of the first model and the true label is measured using the mean squared error loss function to adapt the regression prediction to the configured parameters.
[0024] After each training round, the accuracy is evaluated using a validation set. When the validation set loss value exceeds the preset accuracy threshold for multiple consecutive rounds, training is stopped, and the weight file of the pre-trained CNN model is saved.
[0025] Preferably, the online real-time inference stage specifically includes:
[0026] When the terminal starts up, the first model reads the original information of the terminal and the scene and generates the original feature information set;
[0027] According to the encoding rules of the offline training stage, the original feature information set is one-hot encoded to generate a two-dimensional feature matrix. After preprocessing, it is input into the first model and outputs the normalized parameter configuration.
[0028] The normalized parameters output by the model are denormalized to restore them to standardized configuration parameters;
[0029] The standardized configuration parameters are combined into a standardized configuration template specific to the terminal, which is then sent to the switch, and a dynamic parameter receiving interface for the second model is reserved.
[0030] Preferably, the second model is as follows:
[0031] The output parameters of the second model are determined by the core parameters of the switch.
[0032] Based on historical data, a set of historical time-series feature matrices is obtained after preprocessing. The second model is then trained offline using a Transformer neural network to obtain a dynamic parameter configuration model.
[0033] Based on real-time acquired time-series data, a time-series feature matrix is obtained after preprocessing. This matrix is then input into the trained dynamic parameter configuration model, and the normalized values of the dynamic configuration parameters are output. After inverse normalization, the dynamic configuration parameters are obtained.
[0034] Dynamic configuration parameters are sent to the switch to complete the dynamic parameter configuration and verify the real-time effect.
[0035] Preferably, the core parameters of the switch are as follows:
[0036] Based on the hardware configuration interface reserved in the first model, the core variable parameters of the switch are determined as the output parameters of the second model, including port buffer size, QoS priority weight, forwarding rate threshold, link retransmission timeout threshold, and load balancing strategy coefficient.
[0037] Preferably, the offline training specifically involves: a second model used to accurately capture the temporal dependence and multi-dimensional coupling relationship of working conditions, divided into three stages: temporal local attention, cross-dimensional attention, and fusion output. The formula for calculating the weights of the temporal local attention is as follows:
[0038]
[0039] in, This is the temporal local attention weight matrix. The time window size, , These are the time-series query vector and the key vector, respectively. For vector dimensions, It is a timing mask matrix;
[0040] Cross-dimensional attention weights The calculation formula is:
[0041]
[0042] in, For the number of working condition dimensions, Corresponding to the working condition dimension, , These are the dimension query vector and the key vector, respectively. For dimension and The Pearson correlation coefficient, The weights are the correlation coefficients.
[0043] Fusion attention output for:
[0044]
[0045]
[0046] in, To fuse the attention weight matrix, This is the value vector of temporal attention;
[0047] The Transformer neural network uses the dual objectives of maximizing network throughput and minimizing configuration response latency as the criteria for model training and inference. The training process uses AdamW to optimize hyperparameters, and the loss function employs a hybrid loss combining the dual-objective optimization functions, as shown in the formula:
[0048]
[0049] in, Weights for mean squared error loss. These are the predicted configuration parameter vector and the true optimal parameter vector, respectively. These are configured as predicted compliance rates and actual labels, respectively. Mean square error, This represents the standard error.
[0050] Preferably, the real-time effect verification specifically includes:
[0051] Preset throughput target threshold and latency compliance threshold Through the dynamic interface reserved in the first model, the verified parameters are sent to the switch, and a dual-objective optimization function is constructed. The formula is:
[0052]
[0053] in, For dynamically configured parameter vectors, , These are the weights for throughput and latency metrics, respectively. Configure parameters The corresponding actual throughput This represents the minimum throughput value from historical data. Configure parameters The corresponding response latency, This represents the minimum delay.
[0054] monitor If the target is not met, the process of re-reasoning, issuing, and verifying will be triggered, with a preset maximum number of retries. At most, try again If the target is still not met, an alarm will be sent to the power distribution dispatch center.
[0055] Preferably, the online adaptive optimization of the model specifically involves: pre-setting the number of samples to trigger model fine-tuning. Each accumulation Each feedback sample triggers a model fine-tuning.
[0056] The core of the Transformer neural network with improved attention mechanism is the attention layer and the output layer. Therefore, a hierarchical parameter update strategy is adopted during fine-tuning, specifically:
[0057] Freeze the bottom feature extraction layer, fix the parameters of the temporal embedding layer and the basic convolutional layer, and there is no need to update the layer responsible for extracting general working condition features;
[0058] Fine-tune the core attention layer, updating only the weight parameters of temporal local attention and cross-dimensional attention, to optimize the model's ability to focus on the features of the current working condition;
[0059] Adjusting the weights of the fully connected output layer optimizes the mapping relationship between operating conditions and optimal configuration parameters, directly improving configuration accuracy.
[0060] Preferably, updating the first model when the intelligent power distribution terminal restarts specifically involves: extracting common operating condition features with reusable value through a two-dimensional screening strategy of frequency statistics and influence weight assessment, obtaining a set of common operating condition features for the current operating cycle, and sending it to the first model in the form of a data packet;
[0061] After the intelligent power distribution terminal restarts, before executing the standardized configuration, the first model will first check whether there is a valid feedback data packet. If there is, it will start the pre-trained model database update process, add the pre-processed common working condition feature two-dimensional matrix incrementally to the database of the first model's pre-trained CNN model; at the same time, it will retrieve expired invalid data from the database and control the database capacity.
[0062] The first model in the first stage is updated through a lightweight incremental fine-tuning.
[0063] Compared with the prior art, the technical solution of this application has the following technical effects:
[0064] This invention generates a dedicated standardized configuration by pre-training a CNN model using a first model, ensuring the standardization and uniformity of the configuration during the startup phase.
[0065] This invention improves the Transformer model through a second model attention mechanism, which dynamically adapts to changes in operating conditions and outputs dynamic parameters in real time. This solves the problems of insufficient adaptability of single static configuration and lack of standardized benchmarks for single dynamic configuration in existing technologies, and greatly enhances the comprehensive adaptability of switch parameter configuration.
[0066] This invention employs a hierarchical parameter update strategy driven by performance feedback data. After the first model completes standardization, an interface is reserved for the second model. When the terminal is closed, the second model feeds back data to the model database of the first model, thereby achieving dual-model data updates and enabling the model to continuously absorb operational experience and evolve.
[0067] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the preferred embodiments of this application are described in detail below with reference to the accompanying drawings.
[0068] The above and other objects, advantages and features of this application will become more apparent to those skilled in the art from the following detailed description of specific embodiments in conjunction with the accompanying drawings. Attached Figure Description
[0069] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. In all drawings, similar elements or parts are generally identified by similar reference numerals. In the drawings, the elements or parts are not necessarily drawn to scale.
[0070] Based on the description of the figures and their corresponding technical content in the document, the titles of the figures are as follows:
[0071] Figure 1 is a flowchart of the automatic configuration method for switch parameters applicable to intelligent power distribution terminals;
[0072] Figure 2 is the overall architecture diagram of the automatic configuration method for switch parameters applicable to intelligent power distribution terminals;
[0073] Figure 3 shows the neural network architecture of the first model;
[0074] Figure 4 shows the neural network architecture of the second model;
[0075] Figure 5 shows the experimental architecture diagram of the industrial Ethernet switch that is matched with the smart terminal using this method.
[0076] Figure 6 shows the trend of parameter configuration effect of the intelligent power distribution terminal switch after using this method;
[0077] Figure 7 shows a comparison of data from laboratory simulation tests of various methods;
[0078] Figure 8 is a comparison chart of the compliance rates of various methods under different working conditions;
[0079] Figure 9 is a comparison chart of throughput data distribution for each method under different operating conditions; Detailed Implementation
[0080] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. In the following description, specific details such as specific configurations and components are provided merely to help fully understand the embodiments of this application. Therefore, those skilled in the art should understand that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this application. In addition, for clarity and brevity, descriptions of known functions and structures are omitted in the embodiments.
[0081] It should be understood that the phrase "an embodiment" or "this embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this application. Therefore, "an embodiment" or "this embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments.
[0082] Furthermore, reference numerals and / or letters may be repeated in different examples within this application. Such repetition is for the purpose of simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or settings discussed.
[0083] In this article, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, B exists alone, and A and B exist simultaneously. The term " / and" in this article describes another type of relationship between related objects, indicating that two relationships can exist. For example, A / and B can mean: A exists alone, and A and B exist alone. In addition, the character " / " in this article generally indicates that the related objects before and after it are in an "or" relationship.
[0084] In this article, the term "at least one" is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, "at least one of A and B" can mean: A exists alone, A and B exist simultaneously, or B exists alone.
[0085] It should also be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion.
[0086] Example 1 describes an automatic configuration method for switch parameters applicable to intelligent power distribution terminals, as shown in Figures 1 and 2. Specifically, it includes:
[0087] Based on the above-mentioned technical problems, this application discloses an automatic configuration method for switch parameters applicable to intelligent power distribution terminals, specifically including:
[0088] When the intelligent power distribution terminal is started, the first model is triggered to run. The first model is a standardized parameter configuration model pre-trained by a convolutional neural network (CNN).
[0089] Read the terminal model and scenario information, encode it into a two-dimensional feature matrix, input it into the first model, generate a unique standardized configuration, and send it to the switch to achieve parameter configuration standardization, while reserving an interface for the second model;
[0090] After completing the parameter standardization settings, the first model is closed, and the second model is triggered to run through the reserved interface. The second model is a dynamic parameter configuration model trained by an improved Transformer neural network.
[0091] Real-time acquisition of switch operating status data is input into the second model. With the goal of maximizing network throughput and minimizing configuration response latency, the optimal switch configuration parameters are output and sent to the switch to achieve dynamic parameter configuration.
[0092] Based on the configured performance feedback data, the parameters of the dynamically configured model are fine-tuned through a hierarchical parameter update strategy to achieve online adaptive optimization of the model;
[0093] When the terminal is shut down, the operating condition characteristics of the second model during long-term operation are fed back to the database of the first model, and the first model is updated when the smart power distribution terminal is restarted.
[0094] Furthermore, the first model is specifically as follows:
[0095] The first model includes an offline pre-training stage and an online real-time inference stage;
[0096] Offline work, including model building and training during the offline pre-training phase, and the ability to adapt and generate parameters for multiple types and scenarios of power distribution terminals in CNN models, forms the basis for online inference.
[0097] During the online real-time inference phase, a customized standardized configuration template is generated in real time using the pre-trained model.
[0098] Furthermore, the offline pre-training phase specifically includes:
[0099] Based on the historical configuration data of different models of intelligent power distribution terminals in different application scenarios, a historical input feature set and a historical output tag set are constructed.
[0100] The historical input feature set is converted into a two-dimensional historical feature matrix that can be received by the CNN. Combined with the historical output label set, and after preprocessing, the first model is pre-trained offline. Its core encoding formula is:
[0101]
[0102] in, For the input two-dimensional feature matrix, For terminal model, For communication interface type, For network layers, As a scene type, It is a one-hot encoding function;
[0103] The key information in the feature matrix is extracted by combining two convolutional layers with a max pooling structure. The formula is as follows:
[0104]
[0105]
[0106] in , They are two convolutional layers, For max pooling operation, It is the ReLU activation function. A historical two-dimensional feature matrix, , These are the convolution kernels for the first and second convolutional layers, respectively. , These are the bias terms;
[0107] During training, hyperparameters are optimized using the Adam optimizer, and the error between the output of the first model and the true label is measured using the mean squared error loss function to adapt the regression prediction to the configured parameters.
[0108] After each training round, the accuracy is evaluated using a validation set. When the validation set loss value exceeds the preset accuracy threshold for multiple consecutive rounds, training is stopped, and the weight file of the pre-trained CNN model is saved.
[0109] Furthermore, the input feature set includes the terminal hardware model, communication interface type (Ethernet / RS485), access to the power distribution network level, and application scenario type; the output tag set corresponds to the optimal standardized configuration parameters.
[0110] Furthermore, the specific operation of converting the input feature set into a two-dimensional feature matrix (M×N) that can be accepted by the CNN is as follows:
[0111] Each feature dimension (terminal model, interface type, network layer, scene type) is encoded using one-hot encoding to obtain its respective one-dimensional feature vector;
[0112] Arrange the one-dimensional feature vectors in a fixed order to form an M×N two-dimensional feature matrix;
[0113] After normalizing the two-dimensional feature matrices, they are combined into a two-dimensional feature matrix set;
[0114] The two-dimensional feature matrix set is divided into training set, validation set, and test set in a ratio of 7:2:1.
[0115] Furthermore, as shown in Figure 3, the neural network structure of the first model is as follows: the input layer receives an M×N two-dimensional feature matrix; the first convolutional layer contains 3×3 convolutional kernels with 32 kernels; the first max pooling layer contains 2×2 pooling kernels with a stride of 2; the second convolutional layer contains 3×3 convolutional kernels with 64 kernels; the second max pooling layer contains 2×2 pooling kernels with a stride of 2; there are two fully connected layers, with 128 neurons in the first layer and 64 neurons in the second layer; the number of neurons in the output layer equals the dimension of the configuration parameters.
[0116] Furthermore, the Adam optimizer was used, with a learning rate of 0.0001-0.001, a mean squared error loss function, a batch size of 32-64, and 50-100 iterations to perform offline training hyperparameter settings for the CNN model.
[0117] Furthermore, the online real-time reasoning stage specifically includes:
[0118] When the terminal starts up, the first model reads the original information of the terminal and the scene and generates the original feature information set;
[0119] According to the encoding rules of the offline training stage, the original feature information set is one-hot encoded to generate a two-dimensional feature matrix. After preprocessing, it is input into the first model and outputs the normalized parameter configuration.
[0120] The normalized parameters output by the model are denormalized to restore them to standardized configuration parameters;
[0121] The standardized configuration parameters are combined into a standardized configuration template specific to the terminal, which is then sent to the switch, and a dynamic parameter receiving interface for the second model is reserved.
[0122] Furthermore, the second model is as follows:
[0123] The output parameters of the second model are determined by the core parameters of the switch.
[0124] Based on historical data, a set of historical time-series feature matrices is obtained after preprocessing. The second model is then trained offline using a Transformer neural network to obtain a dynamic parameter configuration model.
[0125] Based on real-time acquired time-series data, a time-series feature matrix is obtained after preprocessing. This matrix is then input into the trained dynamic parameter configuration model, and the normalized values of the dynamic configuration parameters are output. After inverse normalization, the dynamic configuration parameters are obtained.
[0126] Dynamic configuration parameters are sent to the switch to complete the dynamic parameter configuration and verify the real-time effect.
[0127] Furthermore, the preprocessing process is as follows: collect time-series operating condition data under normal load, peak load, network fluctuation, and terminal failure precursors. Each data point corresponds to the optimal configuration parameters and dual target indicators, and is divided into training set and test set in an 8:2 ratio.
[0128] Outlier removal involves deleting outlier data, filling missing data with linear interpolation, and normalizing to a unified dimension, ultimately outputting a time-series feature matrix with dimensions T×D.
[0129] Furthermore, the core parameters of the switch are as follows:
[0130] Based on the hardware configuration interface reserved in the first model, the core variable parameters of the switch are determined as the output parameters of the second model, including port buffer size, QoS priority weight, forwarding rate threshold, link retransmission timeout threshold, and load balancing strategy coefficient.
[0131] Furthermore, the offline training specifically involves the second model, which is used to accurately capture the temporal dependencies and multi-dimensional coupling relationships of operating conditions. It consists of three stages: temporal local attention, cross-dimensional attention, and fusion output. The formula for calculating the weights of the temporal local attention is as follows:
[0132]
[0133] in, This is the temporal local attention weight matrix. The time window size, , These are the time-series query vector and the key vector, respectively. For vector dimensions, It is a timing mask matrix;
[0134] Cross-dimensional attention weights The calculation formula is:
[0135]
[0136] in, For the number of working condition dimensions, Corresponding to the working condition dimension, , These are the dimension query vector and the key vector, respectively. For dimension and The Pearson correlation coefficient, The weights are the correlation coefficients.
[0137] Fusion attention output for:
[0138]
[0139]
[0140] in, To fuse the attention weight matrix, This is the value vector of temporal attention;
[0141] The Transformer neural network uses the dual objectives of maximizing network throughput and minimizing configuration response latency as the criteria for model training and inference. The training process uses AdamW to optimize hyperparameters, and the loss function employs a hybrid loss combining the dual-objective optimization functions, as shown in the formula:
[0142]
[0143] in, Weights for mean squared error loss. These are the predicted configuration parameter vector and the true optimal parameter vector, respectively. These are configured as predicted compliance rates and actual labels, respectively. Mean square error, This represents the standard error.
[0144] Furthermore, as shown in the second model architecture diagram in Figure 4, the input layer of the targeted Transformer neural network receives a T×D temporal feature matrix (T=30, D=11); the embedding dimension of the temporal embedding layer is 64, which, combined with positional encoding, maps the original temporal data into a high-dimensional feature vector, preserving temporal correlation; the temporal local attention window size of the targeted attention layer is 5, the number of cross-dimensional attention mechanism heads is 8, and the hidden layer dimension is 256; the 1D convolutional kernel size of the multi-scale feature fusion layer is 3, 5, and 7; the FeedForward network layer is a two-layer fully connected layer with 512→256 neurons and the activation function is GELU; the output layer is a fully connected layer with 256→5 neurons and the activation function is Sigmoid.
[0145] Furthermore, real-time effect verification is conducted, specifically as follows:
[0146] Preset throughput target threshold and latency compliance threshold Through the dynamic interface reserved in the first model, the verified parameters are sent to the switch, and a dual-objective optimization function is constructed. The formula is:
[0147]
[0148] in, For dynamically configured parameter vectors, , These are the weights for throughput and latency metrics, respectively. Configure parameters The corresponding actual throughput This represents the minimum throughput value from historical data. Configure parameters The corresponding response latency, This represents the minimum delay.
[0149] monitor If the target is not met, the process of re-reasoning, issuing, and verifying will be triggered, with a preset maximum number of retries. At most, try again If the target is still not met, an alarm will be sent to the power distribution dispatch center.
[0150] Once the target is met, immediately collect the configured dual-target metrics: actual throughput. Response latency Verify whether the following conditions are met:
[0151]
[0152]
[0153] in, This is the minimum threshold coefficient for throughput. This represents the ideal throughput under this operating condition. The maximum threshold coefficient for time delay. This represents the ideal time delay under this operating condition.
[0154] Furthermore, the model undergoes online adaptive optimization, specifically by pre-setting the number of samples to trigger model fine-tuning. Each accumulation Each feedback sample triggers a model fine-tuning.
[0155] The core of the Transformer neural network with improved attention mechanism is the attention layer and the output layer. Therefore, a hierarchical parameter update strategy is adopted during fine-tuning, specifically:
[0156] Freeze the bottom feature extraction layer, fix the parameters of the temporal embedding layer and the basic convolutional layer, and there is no need to update the layer responsible for extracting general working condition features;
[0157] Fine-tuning the core attention layer, updating only the weight parameters of temporal local attention and cross-dimensional attention, allows the model to optimize its ability to focus on the features of the current working condition. Adjusting the weights of the fully connected output layer optimizes the mapping relationship between working condition features and optimal configuration parameters, directly improving configuration accuracy.
[0158] Furthermore, the online fine-tuning hyperparameters for adaptive learning are as follows: the AdamW optimizer is used, with weight decay of 0.001; the learning rate is 1 / 10 to 1 / 5 of the offline training learning rate; the batch size is 8 to 16 to adapt to the computing resources of the terminal / edge node and reduce the fine-tuning time; and the number of iteration rounds is 3 to 5.
[0159] Furthermore, when the intelligent power distribution terminal restarts, the first model is updated. Specifically, through a two-dimensional screening strategy of frequency statistics and impact weight assessment, common operating condition features with reusable value are extracted to obtain a set of common operating condition features for the current operating cycle, which is then sent to the first model in the form of a data packet.
[0160] After the intelligent power distribution terminal restarts, before executing the standardized configuration, the first model will first check whether there is a valid feedback data packet. If there is, it will start the pre-trained model database update process, add the pre-processed common working condition feature two-dimensional matrix incrementally to the database of the first model's pre-trained CNN model; at the same time, it will retrieve expired invalid data from the database and control the database capacity.
[0161] The first model in the first stage is updated through a lightweight incremental fine-tuning.
[0162] Further, the specific operation of lightweight incremental fine-tuning is as follows: using the incremental data in the database as the training set, and following the structure and hyperparameters of the original pre-trained model;
[0163] Adopting the mean square error loss function to fine-tune the fully connected layer of the CNN model, and freezing the parameters of the convolutional layer during the fine-tuning process to avoid forgetting historical rules;
[0164] After the fine-tuning is completed, verify the model accuracy through the validation set. If it is qualified, save the weights of the fine-tuned model; if it is unqualified, follow the original model weights and only retain the updated database.
[0165] This embodiment details the automatic switch parameter configuration method applicable to intelligent distribution terminals. At startup, the first model encodes the terminal model and scenario information into a two-dimensional feature matrix through a pre-trained CNN model, generates and issues a dedicated standardized configuration, and closes after reserving the interface of the second model; the second model is a Transformer model improved by an attention mechanism. Based on the real-time collected working condition data, it outputs dynamic configuration parameters with the dual objectives of maximizing throughput and minimizing latency, and uses a hierarchical update strategy to achieve online adaptive optimization of the model; and when the terminal is closed, the second model feeds back the common working condition characteristics, and updates the database of the first model's CNN model when restarting.
[0166] Embodiment 2, based on Embodiment 1, this embodiment details the application of the industrial Ethernet switch supporting the intelligent terminal as the application object, and uses this method to achieve the automatic configuration of switch parameters. This terminal is used to collect the operation data of photovoltaic inverters, energy storage devices, and smart meters and transmit it to the distribution network dispatching center. It is required that the switch parameter configuration has high real-time performance, high reliability, and the ability to adapt to the working condition changes caused by the fluctuation of photovoltaic output. As shown in the experimental architecture diagram in Figure 5, the specific process is as follows:
[0167] Collect historical configuration data of the intelligent terminal in six typical scenarios: high-load acquisition scenario, low-load monitoring scenario, photovoltaic output fluctuation scenario, energy storage charge-discharge switching scenario, extreme low-temperature operation scenario, and sudden change of load in the distribution area. Each piece of data contains an input feature set and an output label set.
[0168] Perform one-hot encoding on the input feature set. The encoding length of the terminal model is 20, the encoding length of the interface type is 2, the encoding length of the network layer is 3, and the encoding length of the scenario type is 6. Arrange them in the order of terminal model, interface type, network layer, and scenario type to generate a 4×20 two-dimensional feature matrix.
[0169] A CNN model with two convolutional layers was constructed. The first convolutional layer has 32 kernels and the second convolutional layer has 64 kernels. Both layers are equipped with 2×2 max pooling layers. The Adam optimizer was used with a learning rate of 0.0005 and a mean squared error loss function. The batch size was 32, and the model was iterated for 60 rounds. Training was stopped after the validation set loss did not decrease for 10 consecutive rounds. The weights of the pre-trained model were saved, and the first model was constructed.
[0170] The system collects time-series data from the switch under conditions such as photovoltaic power output fluctuations and load changes, including 11 operating condition dimensions. Each data point corresponds to the optimal dynamic configuration parameters and dual target indicators of throughput and latency.
[0171] An improved Transformer model combining temporal local attention and cross-dimensional attention was used, with an embedding dimension of 64, 8 attention heads, 256 neurons in the FeedForward network (from 512 to 256), and 5 neurons in the output layer, corresponding to 5 dynamic parameters.
[0172] Using the bi-objective optimization function ω1=0.7, ω2=0.3 as criteria, the AdamW optimizer was adopted with a learning rate of 0.0001, weight decay of 0.01, mixed loss function λ=0.3, batch size of 64, and 80 iterations. Training was stopped after the bi-objective achievement rate on the validation set was ≥92%, the model weights were saved, and a second model was constructed.
[0173] The first model is deployed on the local storage of the smart terminal in the distribution area, and the second model is deployed on the edge computing module of the terminal; a data acquisition module, a parameter distribution module, and a feedback storage module are configured.
[0174] When the terminal starts, the first model automatically reads the hardware model as DTU-6300, the communication interface type as Ethernet, and the network layer as the substation layer. It then determines the scene type as photovoltaic fluctuation scene through feature matching, generates a 4×20 two-dimensional feature matrix according to the training stage rules, and inputs it into the pre-trained CNN model.
[0175] The model inference outputs normalized parameters, which are then denormalized to obtain the actual configuration: baud rate 9600bps, VLAN ID=10, IP address range 192.168.5.0 / 24, port speed baseline 100Mbps, and basic fault tolerance retransmission count 3 times. These are integrated into a dedicated standardized configuration template and distributed to the switch.
[0176] Perform ping tests (100% connectivity) and port speed tests (meeting the standard of 100Mbps). After the verification is passed, the parameters are fixed. Reserve dynamic interfaces, clarify the range of adjustable parameters, close the first model, and start the second model.
[0177] The data acquisition module collects operating data every 0.125 seconds. At a certain moment, the following data was collected: throughput 85Mbps, forwarding delay 4ms, photovoltaic power output fluctuation 15%. After outliers were removed by the 3σ criterion and linear interpolation was used to complete the data, a 30×11 time series feature matrix was generated by normalization.
[0178] The time-series feature matrix is input into the second model. The model is based on bi-objective optimization function inference and outputs normalized dynamic parameters. After inverse normalization, the following parameters are obtained: port buffer 256KB, QoS priority weight 8, forwarding rate threshold 90Mbps, retransmission timeout threshold 20ms, and load balancing coefficient 0.6.
[0179] Parameter distribution and effect verification: Parameters are distributed through the reserved interface, and the configured indicators are collected in real time: throughput 98Mbps≥0.9×100Mbps, latency 3.2ms≤1.1×3ms, ideal minimum latency 3ms, both indicators are met, and the next round of monitoring is started.
[0180] Fine-tuning is triggered every 1000 accumulated feedback samples, employing a hierarchical update strategy. The temporal embedding layer is frozen, while the attention and output layers are fine-tuned. The AdamW optimizer has a learning rate of 1e-5 and undergoes 4 iterations. A weighted sample sampling strategy is used during fine-tuning, with the core sampling weight formula as follows:
[0181]
[0182] in, Let be the sampling weight of the s-th sample. This is the weighting adjustment coefficient. Let be the value of the biobjective optimization function corresponding to the s-th sample. This represents the average function value across all samples.
[0183] When the terminal receives the shutdown command, the second model retrieves all the operating data, and extracts three common operating condition features of photovoltaic power output fluctuation, high throughput and high weight through K-Means clustering, frequency screening N≥50 and weight screening W≥0.3. It then associates the corresponding optimal standardized configuration parameters and stores them in Flash with encryption.
[0184] The terminal restarts, the first model detects the feedback data packet, decrypts it, encodes the common working condition features into a 4×20 two-dimensional matrix, adds it incrementally to the CNN model database, and deletes invalid data from 3 months ago; it performs a light fine-tuning of the CNN model, and takes effect after the validation set accuracy is ≥96%, and subsequent standardized configurations directly call the updated model.
[0185] After running this embodiment for one month, the following indicators were verified: (Table 1 below)
[0186] Table 1 Verification data for each indicator
[0187] Monitoring cycle standard configuration time (seconds) Dynamic configuration delay (ms) Throughput improvement (%) Packet loss rate (%) Photovoltaic fluctuation condition compliance rate (%) Extreme condition failure probability (%) Proportion of reduced operation and maintenance cost (%) When not regulated -12.50 2.36 58.50 In the 1st week 0.8 3.83 0 0.39 21.26 0 In the 2nd week 0.8 3.63 2 0.25 94 1.06 2 In the 3rd week 0.8 3.53 4 0.22 96 0.96 4 In the 4th week 0.8 3.43 5 0.29 7 0.86 5 Table
[0188] As can be seen from the trend chart of the parameter configuration effect of the intelligent distribution terminal switch shown in Table 1 and Figure 6, after using this method, the time taken for standard configuration generation is 0.8 seconds, the dynamic configuration response delay ≤ 3.5 ms, the throughput is increased by 35%, the packet loss rate is 0.2%, the configuration compliance rate under complex photovoltaic fluctuation conditions is 97%, which is 6% higher than the initial model, the operation and maintenance cost is reduced by 65%, and the configuration failure probability under extreme conditions is 0.8%, verifying the high performance of this method.
[0189] This embodiment details an experiment on the intelligent regulation of a switch using this method with the industrial Ethernet switch supporting the intelligent terminal as the application object. During a one-month test cycle, the performance of the switch is significantly improved, fully verifying the stability and continuous optimization ability of this method.
[0190] Example 3, based on Example 1 or 2, this embodiment details an experiment of building a test platform consistent with the Example 2 substation area in a laboratory environment, simulating 6 typical working conditions, and comparing with existing mainstream technologies. The existing mainstream technologies include the configuration method LBC based on long short-term memory network, which uses the LSTM model to process time series working condition data to achieve dynamic parameter configuration; and the configuration method GTC based on general Transformer, which uses the standard Transformer model without introducing time series local attention and cross-dimensional attention mechanisms; using the preset configuration script method SBC in the unregulated state as the reference data. The specific experimental process is as follows:
[0191] Install the DTU-6300 terminal and switch, and simulate the load changes and data transmission requirements of 6 working conditions through simulation software;
[0192] Record the following evaluation indicators during the experiment: dynamic configuration response delay (ms), average throughput improvement ratio (%), average value of configuration compliance rate under 6 working conditions (%), extreme condition configuration failure probability (%);
[0193] Experiment duration: Each operating condition was run independently for 2 hours, with adjustments made every 30 seconds during the period. The average values of various indicators were recorded, and the comparative experimental results are shown in Tables 2 and 3 below:
[0194] Table 2 Comparison of experimental results
[0195] Indicator Type SBCLBCGTC Dynamic Configuration Response Latency (ms) 10.2 6.5 5.1 3.4 Average Throughput Improvement Rate (%) 15 22 28 356 Average Compliance Rate of Configurations under 6 Operating Conditions (%) 72 85 90 97 Total Failure Probability of Configurations under Extreme Operating Conditions (%) 7.8 3.5 2.1 0.8 surface
[0196] Table 3 Experimental data under six working conditions
[0197] The following table lists the compliance rates for different scenarios and their associated metrics: SBC, CGB, GTC, and TC. The table lists the compliance rates for different scenarios and their associated metrics. The table includes: 68828896; 75889398; 70848997; 67818795; 65798594; 77899397. surface
[0198] According to the comparison data of the various methods shown in Table 2 and Figure 7, this method is significantly better than the two existing methods in terms of dynamic configuration response latency, average throughput improvement ratio, average compliance rate of configuration under 6 operating conditions, and total failure probability of configuration under extreme operating conditions, and is significantly improved compared with the benchmark method.
[0199] According to Table 3 and Figure 8, which show the comparison of the achievement rates of each method under different operating conditions, and Figure 9, which shows the throughput data distribution of each method, it can be seen that the proposed method maintains an achievement rate of over 94% under all six operating conditions. This verifies the design advantages of the proposed method's dual-model collaborative architecture, where the first model is standardized and adapted according to the operating conditions, and the second model is dynamically adjusted in real time. It also demonstrates the ability of the Transformer model with improved attention mechanism to accurately capture the temporal characteristics and coupling relationships of the operating conditions.
[0200] This embodiment describes in detail the experiment comparing the proposed method with existing methods in a laboratory environment. The experiment fully verifies the high robustness and versatility of the proposed method's dual-model collaborative architecture, and proves the adaptability and superiority of the proposed method in various working conditions.
[0201] The above are merely preferred embodiments of the present invention and are not intended to limit the scope of protection of the present invention. For those skilled in the art, the present invention can have various modifications and variations. Any changes, modifications, substitutions, integrations, and parameter changes made to these embodiments within the spirit and principles of the present invention, without departing from the principles and spirit of the present invention, through conventional substitutions or to achieve the same function, fall within the scope of protection of the present invention.
Claims
1. An automatic configuration method for switch parameters applicable to intelligent power distribution terminals, characterized in that, include: When the intelligent power distribution terminal is started, the first model is triggered to run. The first model is a standardized parameter configuration model pre-trained by a convolutional neural network (CNN). The terminal model and scenario information are read and encoded into a two-dimensional feature matrix, which is input into the first model to generate a unique standardized configuration and send it to the switch, thus achieving parameter configuration standardization. At the same time, an interface for the second model is reserved. After the parameter standardization settings are completed, the first model is shut down, and the second model is triggered to run through the reserved interface. The second model is a dynamic parameter configuration model trained by an improved Transformer neural network. Switch operating condition data is collected in real time and input into the second model. With the goal of maximizing network throughput and minimizing configuration response latency, the optimal switch configuration parameters are output and sent to the switch, thus achieving dynamic parameter configuration. Based on the performance feedback data after configuration, the parameters of the dynamic parameter configuration model are fine-tuned through a hierarchical parameter update strategy to achieve online adaptive optimization of the model. When the terminal is shut down, the operating condition characteristics of the second model during long-term operation are fed back to the first model database, and the first model is updated when the intelligent power distribution terminal restarts.
2. The method according to claim 1, characterized in that, The first model specifically includes an offline pre-training stage and an online real-time inference stage. The offline pre-training stage involves offline model building and training, training the CNN model to adapt and generate parameters for multiple models and scenarios of power distribution terminals, which is the foundation for online inference. In the online real-time inference stage, the trained model generates a dedicated standardized configuration template in real time.
3. The method according to claim 2, characterized in that, The offline pre-training stage specifically involves: constructing a historical input feature set and a historical output label set based on historical configuration data of different models of intelligent power distribution terminals in different application scenarios; converting the historical input feature set into a historical two-dimensional feature matrix that can be received by a CNN; combining it with the historical output label set; and after preprocessing, offline pre-training the first model; extracting key information from the feature matrix through a two-layer convolutional structure combined with a maximum pooling structure, using the following formula: in 、 They are two convolutional layers, For max pooling operation, It is the ReLU activation function. A historical two-dimensional feature matrix, 、 These are the convolution kernels of the first and second convolutional layers, respectively. 、 These are the bias terms; during training, hyperparameters are optimized using the Adam optimizer, and the error between the output of the first model and the true label is measured using the mean squared error loss function to adapt the regression prediction to the configured parameters; After each training round, the accuracy is evaluated using a validation set. When the validation set loss value exceeds the preset accuracy threshold for multiple consecutive rounds, training is stopped, and the weight file of the pre-trained CNN model is saved.
4. The method according to claim 2, characterized in that, The online real-time inference stage specifically involves: when the terminal starts, the first model reads the original information of the terminal and the scene, and generates an original feature information set; According to the encoding rules of the offline training stage, the original feature information set is one-hot encoded to generate a two-dimensional feature matrix. After preprocessing, it is input into the first model and outputs normalized parameter configuration. The normalized parameters output by the model are denormalized to restore the standardized configuration parameters. The standardized configuration parameters are combined into a terminal-specific standardized configuration template, which is sent to the switch, and a dynamic parameter receiving interface for the second model is reserved.
5. The method according to claim 1, characterized in that, The second model is specifically as follows: the output parameters of the second model are determined by the core parameters of the switch; based on historical data, a set of historical time-series feature matrices is obtained after preprocessing, and the second model is trained offline through a Transformer neural network to obtain a dynamic parameter configuration model; Based on real-time acquired time-series data, a time-series feature matrix is obtained after preprocessing. This matrix is then input into the trained dynamic parameter configuration model, which outputs the normalized values of the dynamic configuration parameters. After inverse normalization, the dynamic configuration parameters are obtained. The dynamic configuration parameters are then sent to the switch to complete the dynamic parameter configuration and to verify the real-time effect.
6. The method according to claim 5, characterized in that, The core parameters of the switch are as follows: based on the hardware configuration interface reserved in the first model, the core variable parameters of the switch are determined as the output parameters of the second model, including port buffer size, QoS priority weight, forwarding rate threshold, link retransmission timeout threshold, and load balancing strategy coefficient.
7. The method according to claim 5, characterized in that, The offline training specifically involves the second model, which is used to accurately capture the temporal dependencies and multi-dimensional coupling relationships of operating conditions. It consists of three stages: temporal local attention, cross-dimensional attention, and fusion output. The formula for calculating the weights of the temporal local attention is as follows: in, This is the temporal local attention weight matrix. The time window size, 、 These are the time-series query vector and the key vector, respectively. For vector dimensions, Temporal mask matrix; cross-dimensional attention weights The calculation formula is: in, For the number of working condition dimensions, Corresponding to the working condition dimension, 、 These are the dimension query vector and the key vector, respectively. For dimension and The Pearson correlation coefficient, The correlation coefficient is weighted; the attention output is fused. for: in, To fuse the attention weight matrix, This represents the value vector of temporal attention. The Transformer neural network uses the dual objectives of maximizing network throughput and minimizing configuration response latency as the criteria for model training and inference. During training, AdamW is used to optimize hyperparameters, and the loss function employs a hybrid loss combining the dual-objective optimization functions, as shown in the formula: in, Weights for mean squared error loss. These are the predicted configuration parameter vector and the true optimal parameter vector, respectively. These are configured as predicted compliance rates and actual labels, respectively. Mean square error, This represents the standard error.
8. The method according to claim 5, characterized in that, The real-time performance verification specifically involves: setting a threshold for the percentage of throughput that meets the target. and latency compliance threshold Through the dynamic interface reserved in the first model, the verified parameters are sent to the switch, and a dual-objective optimization function is constructed. The formula is: in, For dynamically configured parameter vectors, 、 These are the weights for throughput and latency metrics, respectively. Configure parameters The corresponding actual throughput This represents the minimum throughput value from historical data. Configure parameters The corresponding response latency, This represents the minimum delay; monitoring. If the target is not met, the process of re-reasoning, issuing, and verifying will be triggered, with a preset maximum number of retries. At most, try again If the target is still not met, an alarm will be sent to the power distribution dispatch center.
9. The method according to claim 1, characterized in that, The online adaptive optimization of the model specifically involves: pre-setting the number of samples to trigger model fine-tuning. Each accumulation Each feedback sample triggers a model fine-tuning. The core of the Transformer neural network with improved attention mechanism is the attention layer and the output layer. Therefore, a hierarchical parameter update strategy is adopted during fine-tuning. Specifically, the bottom feature extraction layer is frozen, and the parameters of the temporal embedding layer and the basic convolutional layer are fixed. There is no need to update the layer responsible for extracting general working condition features. The core attention layer is fine-tuned, and only the weight parameters of temporal local attention and cross-dimensional attention are updated to optimize the model's ability to focus on the current working condition features. The weights of the fully connected output layer are adjusted to optimize the mapping relationship between working condition features and optimal configuration parameters, directly improving the configuration accuracy.
10. The method according to claim 1, characterized in that, The process of updating the first model upon restarting the intelligent power distribution terminal involves: extracting reusable common operating condition features using a dual-dimensional screening strategy of frequency statistics and impact weight evaluation to obtain a set of common operating condition features for the current operating cycle, which is then sent to the first model in the form of data packets; after the intelligent power distribution terminal restarts, before executing standardized configuration, the first model will first check whether there are valid feedback data packets. If so, it will initiate the pre-trained model database update process, incrementally adding the pre-processed common operating condition feature two-dimensional matrix to the database of the first model's pre-trained CNN model; Simultaneously, expired and invalid data are retrieved from the database to control database capacity; the first model of the first stage is updated through a lightweight incremental fine-tuning.
Citation Information
Patent Citations
CNN-based power equipment fault judgment and early warning method, terminal and readable storage medium
CN110110905A
Thermal power generating unit control parameter adjusting method and device based on large model and digital twinning
CN120652821A