Coefficient matrix fitting method, system, device and medium for demand response model
By constructing an improved perceptron model, the problem of fitting nonlinear responses and multidimensional elastic coefficient matrices in integrated energy systems using traditional single-layer perceptron models is solved, high-precision demand response model fitting is achieved, and the fitting accuracy and robustness of the model in complex scenarios are improved.
Patent Information
- Application Number
- CN202510616702.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-14
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2045-05-14
AI Technical Summary
Traditional single-layer perceptron models cannot handle nonlinear response relationships in integrated energy systems, and it is difficult to synchronously fit multidimensional elasticity coefficient matrices. In addition, noisy data can easily cause overfitting, resulting in insufficient fitting accuracy of demand response models in complex scenarios.
Construct improved perceptron models, including single-layer improved perceptron models and multi-layer improved perceptron models. By introducing hidden layers and nonlinear activation functions to handle nonlinear response relationships, the model is trained using the stochastic gradient descent method to optimize the weight matrix and bias terms and reduce the sensitivity to noise data.
The fitting accuracy and generalization ability of the demand response model in complex scenarios are improved, and it can accurately characterize load changes and multi-energy coupling effects, provide a high-precision quantitative basis for multi-energy coordinated response, and reduce the risk of overfitting.
Smart Images

Figure CN120146706B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of demand response model optimization for integrated energy systems, and in particular to a coefficient matrix fitting method, system, device, and medium for a demand response model. Background Art
[0002] As the global energy mix shifts toward cleaner, lower-carbon energy, integrated energy systems, through multi-energy complementarity and coordinated optimization, are becoming a key means of improving energy efficiency. Demand response technology, a core tool for balancing supply and demand, relies on model accuracy that directly impacts system regulation effectiveness. Accurately fitting the elasticity coefficient matrix is fundamental to establishing high-precision demand response models. Traditional methods, which rely on empirical formulas or manual experience to determine the coefficient matrix, struggle to adapt to the complex and volatile energy market environment.
[0003] Existing machine learning methods (such as single-layer perceptrons) have been explored for energy load forecasting. These methods construct linear regression models to handle the simple mapping between price and load, and use historical data to train weight parameters to achieve forecasting. For example, in electricity price elasticity analysis, single-layer perceptrons are used to fit the linear price-load relationship, and gradient descent is used to optimize the parameters to reduce forecast errors.
[0004] However, existing technologies have significant limitations: Traditional single-layer perceptron models are constrained by linear assumptions and cannot represent nonlinear responses such as energy substitution and time shifting; traditional perceptrons are designed for binary classification tasks and struggle to fit the multidimensional elasticity coefficient matrix required for integrated energy systems; and traditional single-layer perceptron models are sensitive to noisy data and prone to overfitting when data fluctuates significantly. These shortcomings result in insufficient coefficient matrix fitting accuracy in complex scenarios, hindering the practical application of demand response models. Summary of the Invention
[0005] In response to the technical problems that the existing method of using traditional single-layer perceptron model to fit the coefficient matrix of the integrated energy system demand response model cannot handle nonlinear response relationships, is difficult to synchronously fit the multidimensional elasticity coefficient matrix, and noise data easily causes overfitting, the present application provides a coefficient matrix fitting method, system, equipment and medium for the demand response model, which can handle nonlinear response behavior and perform multidimensional coefficient matrix fitting, while reducing sensitivity to noise data and overfitting risks, and further improving the fitting accuracy of the coefficient matrix and the application effect of the demand response model in complex scenarios.
[0006] In a first aspect, the present application provides a coefficient matrix fitting method for a demand response model, comprising the following steps:
[0007] S1. Acquisition Collect historical data of comprehensive energy system indicators and calculate the change rate of response indicators and the corresponding load change rate ,constitute sample pairs to form a demand response historical dataset ;
[0008] S2. Build an improved perceptron model based on the demand response model of the integrated energy system. The input of the improved perceptron model is defined as the response indicator change rate, and the output is defined as the load change rate prediction value.
[0009] Among them, a single-layer improved perceptron model is constructed for the linear demand response model, and a multi-layer improved perceptron model is constructed for the nonlinear demand response model;
[0010] The multi-layer improved perceptron model consists of an input layer, at least one hidden layer, and an output layer. The output of each hidden layer serves as the input of the next layer. The expression is:
[0011]
[0012] Where, For the The weighted input of the layer, , the 0th layer is the input layer, the Layer is the output layer;
[0013] For the The weight matrix of the layer;
[0014] For the The activation value of the layer, where Improve the input of the multi-layer perceptron model;
[0015] For the The bias term of the layer;
[0016] For the Layer activation function;
[0017] Multi-layer improved perceptron loss function for:
[0018]
[0019] Where, is the mean square error of the multilayer perceptron;
[0020] For the Layer adjustment factor;
[0021] For the The bias term of the layer;
[0022] For the The activation value of the layer values;
[0023] For the The actual value of the load change rate;
[0024] S3. Train the improved perceptron model, updating the weight matrix and bias terms until the loss function is ≤ the allowed error.
[0025] S4. Extract the weight matrix of the output layer of the trained perceptron model as the elasticity coefficient matrix of the integrated energy system demand response model.
[0026] It should be further explained that in step S1, the comprehensive energy system indicators include energy price change rate, carbon intensity change rate, and user load data before and after demand response. The calculation formula is:
[0027]
[0028] Where, For the Energy price change rate;
[0029] For the Carbon intensity change rate;
[0030] The calculation formula is:
[0031]
[0032] Where, For the User load data before demand response;
[0033] For the User load data after demand response.
[0034] It should be further explained that in step S2, the formula of the linear demand response model is:
[0035]
[0036] Where, is the elastic coefficient matrix;
[0037] The formula of the nonlinear demand response model is:
[0038]
[0039] Where, is the elastic coefficient matrix;
[0040] is the number of demand responses, .
[0041] It should be further explained that in step S2, the expression of the single-layer improved perceptron model is:
[0042]
[0043] Single-layer improved perceptron loss function for:
[0044]
[0045] Where, Improve the output of the perceptron model for a single layer;
[0046] Improve the input of the perceptron model for a single layer;
[0047] is the weight matrix;
[0048] is the mean square error of a single-layer perceptron;
[0049] is the regulating factor;
[0050] is the bias term;
[0051] For the The actual value of the load change rate.
[0052] It should be further explained that in step S2, the activation function of the hidden layer of the multi-layer improved perceptron model adopts ReLU or Sigmoid function, and the output layer adopts linear activation function.
[0053] It should be further explained that in step S2, The steps include:
[0054] Calculating demand response historical datasets middle Standard deviation :
[0055]
[0056] when hour, ;
[0057] when hour, .
[0058] It should be further explained that hour, ;
[0059] hour, The value of is 0.5-0.8;
[0060] hour, The value is 0.3-0.5.
[0061] It should be further explained that in step S3, the stochastic gradient descent method is used to train the improved perceptron model, the learning rate range is (0, 1], and the weight matrix and bias term are updated through back propagation.
[0062] It should be further explained that in step S3, when the improved perceptron model is a single-layer improved perceptron model, the training steps are:
[0063] S301. Initialize the weight matrix and bias , set the random seed;
[0064] S302 performs forward propagation on each sample to calculate the load change rate prediction value;
[0065] S303. Calculate the loss function And back-propagate the gradient;
[0066] S304. Update parameter weight matrix and bias ;
[0067] S305. Loop through S302-S304 until ≤ allowable error, training is completed.
[0068] It should be further explained that in step S3, when the improved perceptron model is a multi-layer improved perceptron model, the training steps are:
[0069] S311. Initialize the weight matrices and bias terms of each hidden layer and output layer;
[0070] S312 performs forward propagation for each sample, calculating the output of each hidden layer and the load change rate prediction value;
[0071] S313. Calculating the loss function And back-propagate the gradients of each hidden layer and output layer;
[0072] S314. Update all weight matrices and bias terms;
[0073] S315. Loop S312-S314 until ≤ allowed error, complete training.
[0074] It should be further explained that in step S3, the allowed error is 0-0.05.
[0075] In a second aspect, the application provides a coefficient matrix fitting system of a demand response model, which is used to implement the coefficient matrix fitting method of the demand response model of the comprehensive energy system, and comprises:
[0076] A data acquisition module is configured to acquire historical data of the comprehensive energy system indicators;
[0077] A data preprocessing module is configured to calculate the response indicator change rate and the corresponding load change rate according to the historical data of the comprehensive energy system indicators, form sample pairs, and form a demand response historical data set;
[0078] A model construction module is configured to construct an improved perception machine model according to the demand response model of the comprehensive energy system;
[0079] A model training module is configured to train the improved perception machine model;
[0080] A matrix extraction module is configured to extract the weight matrix of the output layer of the trained perception machine model as the elasticity coefficient matrix of the demand response model of the comprehensive energy system.
[0081] In a third aspect, the application provides an electronic device, which comprises a memory, a processor, and a computer program stored on the memory and executable on the processor, and the processor is configured to implement the steps of the coefficient matrix fitting method of the demand response model when executing the computer program.
[0082] In a fourth aspect, the application provides a storage medium, and the storage medium stores a computer program, and the steps of the coefficient matrix fitting method of the demand response model are implemented when the computer program is executed by the processor.
[0083] As can be seen from the above technical solutions, the application has the following advantages:
[0084] 1. The application constructs a single-layer improved perception machine model for a linear demand response model and a multi-layer improved perception machine model for a nonlinear demand response model, wherein the multi-layer improved perception machine model maps the response indicator change rate of the input layer through multiple layers of cascading by introducing a hidden layer and a nonlinear activation function, directly represents the nonlinear elasticity coefficient through the output layer weight matrix, can effectively capture the complex correlation between load change and multi-energy coupling effect, and improves the processing capability for complex energy response relationship.
[0085] 2. This application is based on a direct extraction mechanism of the weight matrix of the output layer of the perceptron model, which overcomes the limitations of traditional methods that rely on manual experience or single-dimensional fitting. It uses the fully connected weight parameters from the input layer to the output layer to automatically encode multi-dimensional elasticity coefficients and simultaneously generate the coefficient matrix of the demand response model, providing a high-precision quantitative basis for multi-energy coordinated response for the dynamic regulation of the integrated energy system.
[0086] 3. This application overcomes the shortcoming that noisy data easily causes overfitting by jointly optimizing the mean square error and bias penalty terms through an improved loss function. It can balance model accuracy and robustness during training, better optimize model parameters, reduce the impact of noisy data, reduce the risk of overfitting, improve the fitting accuracy of the coefficient matrix of the model in complex scenarios, and enhance the generalization ability of the coefficient matrix in fluctuating scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0087] In order to more clearly illustrate the technical solution of the present application, the following is a brief introduction to the drawings required for the description. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0088] Figure 1 This is a flow chart of a coefficient matrix fitting method for a demand response model in one embodiment of the present application.
[0089] Figure 2 It is a schematic diagram of the coefficient matrix of the residential area demand response model in one embodiment of the present application.
[0090] Figure 3 It is a schematic diagram of the coefficient matrix of the industrial zone demand response model in one embodiment of the present application.
[0091] Figure 4 It is a schematic diagram of the coefficient matrix of the commercial district demand response model in one embodiment of the present application.
[0092] Figure 5 It is a schematic block diagram of a coefficient matrix fitting system of a demand response model in one embodiment of the present application.
[0093] Figure 6 It is a schematic diagram of the hardware structure of an electronic device in one embodiment of the present application. DETAILED DESCRIPTION
[0094] In order to make the application objectives, features, and advantages of this application more obvious and easy to understand, the technical solutions protected by this application will be clearly and completely described below using specific embodiments and drawings. Obviously, the embodiments described below are only part of the embodiments of this application, not all of them. Based on the embodiments in this patent, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this patent.
[0095] The coefficient matrix fitting method of the demand response model involved in this application is mainly aimed at the technical field of optimization of the demand response model of the integrated energy system. A single-layer improved perceptron model is constructed for the linear demand response model, and a multi-layer improved perceptron model is constructed for the nonlinear demand response model. The multi-layer improved perceptron model introduces hidden layers and nonlinear activation functions, maps the change rate of the response index of the input layer through multi-layer cascade mapping, and directly represents the nonlinear elastic coefficient through the output layer weight matrix, which can effectively capture the complex correlation between load changes and multi-energy coupling effects, and improve the processing ability of complex energy response relationships; based on the direct extraction mechanism of the output layer weight matrix of the perceptron model, the transmission efficiency is improved. Traditional methods rely on manual experience or the limitations of single-dimensional fitting. The fully connected weight parameters from the input layer to the output layer are used to automatically encode multi-dimensional elastic coefficients, and the coefficient matrix of the demand response model is generated simultaneously, providing a high-precision quantitative basis for multi-energy coordinated response for the dynamic regulation of the integrated energy system; through the improved loss function, the mean square error and bias penalty terms are jointly optimized to overcome the deficiency that noisy data easily cause overfitting, and to balance the model accuracy and robustness during the training process, better optimize the model parameters, reduce the impact of noise data, reduce the risk of overfitting, improve the fitting accuracy of the coefficient matrix of the model in complex scenarios, and enhance the generalization ability of the coefficient matrix in fluctuating scenarios.
[0096] The coefficient matrix fitting method of the demand response model involved in this application mainly solves the technical problems that the existing method of using the traditional single-layer perceptron model to fit the coefficient matrix of the demand response model of the integrated energy system cannot handle nonlinear response relationships, is difficult to synchronously fit the multi-dimensional elastic coefficient matrix, and noise data easily causes overfitting.
[0097] The following describes in detail the coefficient matrix fitting method for the demand response model involved in this application. Specific details such as specific system structures and technologies are provided for illustrative purposes, not for limitation, to facilitate a thorough understanding of the embodiments of this application. However, it should be apparent to those skilled in the art that this application may also be implemented in other embodiments without these specific details.
[0098] In the coefficient matrix fitting method of the demand response model involved in this application, the term "comprising" is used to indicate the presence of the described features, entities, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, entities, steps, operations, elements, components and / or their collections. The terms "including," "comprising," "having," and their variations all mean "including but not limited to," unless otherwise specifically emphasized.
[0099] To facilitate the clear description of the technical solutions of this application, the words "first" and "second" are used to distinguish between identical or similar items with substantially the same functions and effects. Those skilled in the art will understand that the words "first" and "second" do not limit the quantity or order of execution, and the words "first" and "second" do not necessarily mean different.
[0100] The phrases "one embodiment" or "some embodiments" described in this application mean that the specific features, structures, or characteristics described in the embodiment are included in one or more embodiments of the application. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in other embodiments," etc. that appear in different places in this application do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized.
[0101] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0102] The coefficient matrix fitting method of the demand response model provided in the embodiment of the present application is executed by a computer device, and accordingly, the coefficient matrix fitting system of the demand response model runs in the computer device.
[0103] The following are some explanations of terms in this plan to facilitate a better understanding of this plan:
[0104] Integrated Energy System Demand Response Model: This model is a tool used to optimize and manage the dynamic response of user-side resources in a multi-energy system (e.g., electricity, natural gas, thermal energy, and renewable energy). Its goal is to coordinate the conversion and complementarity between different energy sources (e.g., electricity-to-heat and energy storage regulation) and, guided by electricity price signals or incentive policies, adjust user energy usage behavior to improve energy efficiency, reduce system operating costs, and enhance grid stability. For example, during peak hours, the model might guide users to increase their use of thermal storage to reduce grid load.
[0105] Coefficient matrix of demand response model: The coefficient matrix is a key component of the demand response mathematical model, quantifying the interaction relationship between variables in matrix form. The rows and columns of the matrix usually represent different variables (such as user type, time period, energy type), and the element values are the corresponding response coefficients or efficiency coefficients. For example, in the electricity price elasticity model, the coefficient matrix may describe the sensitivity of the user's electricity consumption in different time periods to changes in electricity prices and is used to calculate the load adjustment amount. This matrix is often used in linear programming or optimization models as the basis of constraints or objective functions.
[0106] Single-layer perceptron: The single-layer perceptron is the simplest feedforward neural network, consisting of only input and output layers and no hidden layers. It operates by performing a weighted summation of input features and outputting a binary classification result (e.g., 0 or 1) using an activation function (such as a step function). It is suitable for linearly separable problems (such as logical AND / OR) but cannot handle nonlinear problems (such as XOR). It is trained using the perceptron learning rule, adjusting weights to reduce classification error.
[0107] Taking the typical single-layer perceptron model for binary classification as an example, the input space is defined as yes A subset of the dimensional real numbers, is the number of features; output space , where 1 and -1 represent the two categories of output. To output space The following function:
[0108]
[0109] It is called a perceptron.
[0110] In the formula, the vector ,vector , is the weight matrix, is the bias term, is a sign function, hour Take 1, hour Take -1.
[0111] It should be noted that the parameters involved in the above typical single-layer perceptron model have nothing to do with the technical solution of this application and are only used to demonstrate the architecture of a typical single-layer perceptron model.
[0112] Figure 1 This is a flow chart of a coefficient matrix fitting method for a demand response model according to an embodiment of the present application. Figure 1 The execution subject can be a coefficient matrix fitting system of a demand response model. According to different needs, the order of the steps in the flowchart can be changed, and some steps can be omitted.
[0113] like Figure 1 As shown in Figure 2, the coefficient matrix fitting method of the demand response model includes:
[0114] Step S1, obtain Collect historical data of comprehensive energy system indicators and calculate the change rate of response indicators and the corresponding load change rate ,constitute sample pairs to form a demand response historical dataset .
[0115] By systematically collecting historical data and calculating response indicators and load change rates, a sample data set with time series characteristics and scenario coverage was constructed, providing a multi-dimensional data foundation for model training, ensuring that the demand response characteristics under different operating conditions are effectively learned, and supporting the accuracy and robustness of subsequent model training.
[0116] In some specific embodiments, the comprehensive energy system indicators include energy price change rate, carbon intensity change rate, and user load data before and after demand response. The calculation formula is:
[0117]
[0118] Where, For the Energy price change rate;
[0119] For the Carbon intensity change rate;
[0120] The calculation formula is:
[0121]
[0122] Where, For the User load data before demand response;
[0123] The first demand response after the user load data.
[0124] The calculation method and data source of the comprehensive energy system index are determined, the energy price change rate, the carbon intensity change rate and the load data standardization calculation formula are defined to ensure the dimensional uniformity and comparability of the input data, reduce the model deviation caused by data noise or magnitude difference, and improve the standardization and reliability of the data set construction.
[0125] Step S2, according to the demand response model of the comprehensive energy system, an improved perception machine model is constructed, the input of the improved perception machine model is defined as the response index change rate, and the output is defined as the load change rate prediction value;
[0126] For a linear demand response model, a single-layer improved perception machine model is constructed, and the expression is:
[0127]
[0128] The loss function of the single-layer improved perception machine is:
[0129]
[0130] In the formula, is the output of the single-layer improved perception machine model;
[0131] is the input of the single-layer improved perception machine model;
[0132] is a weight matrix;
[0133] is the mean square error of the single-layer perception machine;
[0134] is an adjustment factor;
[0135] is a bias term;
[0136] The first load change rate actual value;
[0137] For a nonlinear demand response model, a multi-layer improved perception machine model is constructed, including an input layer, at least one hidden layer and an output layer, the output of each hidden layer is used as the input of the next layer, and the expression is:
[0138]
[0139] In the formula, is the first a weighted input of the layer, the 0th layer is an input layer, the layer is an output layer;
[0140] a weight matrix of the layer;
[0141] an activation value of the layer, wherein is an input of the multi-layer improved perception machine model;
[0142] a bias term of the layer;
[0143] an activation function of the layer;
[0144] a multi-layer improved perception machine loss function is:
[0145]
[0146] in the formula, is a multi-layer perception machine mean square error;
[0147] a regulation factor of the layer;
[0148] a bias term of the layer;
[0149] an activation value of the layer; is the th value of the activation value of the
[0150] th layer; is the th actual value of the load change rate.
[0151] A single-layer and multi-layer improved perception machine structure is designed based on a linear and nonlinear demand response model respectively, a flexible network level is constructed through the combination of a weighted input and an activation function, a linear or nonlinear mapping relationship between an energy price, a carbon intensity and a load change can be accurately represented, a regulation factor is introduced to optimize a loss function, and the model complexity and fitting precision are effectively balanced.
[0152] wherein the single-layer improved perception machine model is simplified as the bias term tends to 0, that is, the default training data accuracy is high, and the data driving capability can be improved;
[0153] The multi-layer improved perceptron model introduces hidden layers and nonlinear activation functions to support complex relationship fitting.
[0154] In some specific embodiments, the linear demand response model is formulated as follows:
[0155]
[0156] Where, is the elastic coefficient matrix;
[0157] The formula of the nonlinear demand response model is:
[0158]
[0159] Where, is the elastic coefficient matrix
[0160] is the number of demand responses, .
[0161] By formulating the direct relationship between the elastic coefficient matrix and load changes in the linear demand response model, a theoretical basis is provided for the construction of a single-layer perceptron, which simplifies the linear relationship modeling process. At the same time, it lays the foundation for the subsequent physical meaning interpretation of the weight matrix, enhancing the interpretability and engineering practicality of the model.
[0162] In some specific embodiments, the activation function of the hidden layer of the multi-layer improved perceptron model adopts ReLU or Sigmoid function, and the output layer adopts linear activation function.
[0163] The hidden layer activation function type and the output layer linear activation method are limited. The ReLU or Sigmoid function is used to solve the gradient vanishing problem of the multi-layer perceptron and enhance the nonlinear expression ability. The linear design of the output layer ensures that the final output of the model matches the dimension of the actual load change rate, taking into account the model complexity and the rationality of the prediction results.
[0164] In some embodiments, determining The steps include:
[0165] Calculating demand response historical datasets middle Standard deviation :
[0166]
[0167] when hour, ;
[0168] when hour, .
[0169] By establishing a quantitative relationship between the adjustment factor λ and the standard deviation of the load change rate, dynamic adaptation of the regularization strength is achieved. When the data fluctuation is small, the bias term constraint is strengthened to avoid overfitting. When the fluctuation is significant, the constraint strength is reduced to retain the model flexibility, thereby improving the generalization performance and robustness of the model in different data distribution scenarios.
[0170] In some specific embodiments, hour, ;
[0171] hour, The value of is 0.5-0.8;
[0172] hour, The value is 0.3-0.5.
[0173] Step S3: Train the improved perceptron model and update the weight matrix and bias terms until the loss function is less than or equal to the allowed error.
[0174] The stochastic gradient descent method is combined with the back-propagation mechanism to iteratively update the weights and bias terms. The rapid convergence of the loss function is achieved by dynamically adjusting the learning rate and gradient direction, ensuring that the model gradually approaches the optimal solution during training and ultimately reaches the preset allowable error threshold, thereby improving model training efficiency and parameter optimization stability.
[0175] In some specific embodiments, the stochastic gradient descent method is used to train the improved perceptron model, the learning rate range is (0, 1], and the weight matrix and bias term are updated through back propagation.
[0176] The stochastic gradient descent method is used as the optimization algorithm. The iterative update of small batch samples is used to reduce the consumption of computing resources. The reasonable setting of the learning rate is combined to accelerate the convergence of the model. It is suitable for efficient training of large-scale historical data. At the same time, the back-propagation mechanism is used to achieve accurate calculation of parameter gradients to ensure the correct direction of weight updates.
[0177] In some specific embodiments, when the improved perceptron model is a single-layer improved perceptron model, the training steps are:
[0178] S301. Initialize the weight matrix and bias , set the random seed;
[0179] S302 performs forward propagation on each sample to calculate the load change rate prediction value;
[0180] S303. Calculate the loss function And back-propagate the gradient;
[0181] S304. updating the parameter weight matrix and the bias term ;
[0182] S305. performing S302-S304 cyclically until ≤ the allowed error, completing the training.
[0183] The training process of the improved perceptron model is improved by specification of a single layer, and the phased execution steps of parameter initialization, forward propagation, loss calculation, back propagation and parameter updating are specified to ensure that the training process of the model under the single linear structure is controllable and reproducible. The learning rate and gradient direction are dynamically adjusted to achieve efficient updating of the weight matrix and the bias term, avoiding the unstable convergence problem of the traditional perceptron caused by random initialization. At the same time, the standardized iteration mechanism ensures that the model converges quickly within the allowed error range, improving the training efficiency and parameter optimization accuracy in the linear demand response scenario.
[0184] In some embodiments, when the improved perceptron model is a multi-layer improved perceptron model, the training steps are:
[0185] S311. initializing the weight matrix and the bias term of each hidden layer and the output layer;
[0186] S312. performing forward propagation for each sample to calculate the output of each hidden layer and the load change rate prediction value;
[0187] S313. calculating the loss function and back propagating the gradient of each hidden layer and the output layer;
[0188] S314. updating all weight matrices and bias terms;
[0189] S315. performing S312-S314 cyclically until ≤ the allowed error, completing the training.
[0190] For the complex network structure of the multi-layer improved perceptron model, a hierarchical initialization and gradient back propagation mechanism is designed, which calculates the hidden layer output layer by layer and synchronously updates the weights and bias terms of each layer, effectively solving the gradient vanishing or explosion problem caused by parameter coupling in multi-layer neural networks. Combined with the non-linear mapping ability of the activation function, the high-order correlation between the demand response index and the load change is accurately fitted, and through the phased cyclic training, the loss function is stably converged in the multi-hidden layer scenario, significantly improving the generalization ability and dynamic adaptability of the nonlinear demand response model.
[0191] In some embodiments, the allowed error is 0-0.05.
[0192] By setting the allowable error range to 0-0.05, a balance is established between model accuracy and computational cost, avoiding excessive pursuit of low error leading to long training time or overfitting risk, while ensuring that the fitting result meets the accuracy requirements of actual engineering applications, enhancing the practicality and economy of model deployment.
[0193] Step S4, extracting the weight matrix of the output layer of the trained perception machine model as the elasticity coefficient matrix of the comprehensive energy system demand response model.
[0194] By extracting the output layer weight matrix to directly obtain the elasticity coefficient matrix, the complex parameter derivation process in the traditional fitting method is avoided, simplifying the model deployment process and improving the calculation efficiency, so that the comprehensive energy system can quickly respond to dynamic demand, providing high-precision coefficient basis for real-time regulation strategy formulation.
[0195] In one embodiment, the coefficient matrix fitting method of the demand response model comprises:
[0196] Step S1, obtaining historical data of the comprehensive energy system index, calculating the response index change rate and the corresponding load change rate , constituting sample pairs to form a demand response historical data set ;
[0197] The comprehensive energy system index includes energy price change rate, carbon intensity change rate, user load data before and after demand response, The calculation formula is:
[0198]
[0199] In the formula, is the energy price change rate;
[0200] is the carbon intensity change rate;
[0201] The calculation formula is:
[0202]
[0203] In the formula, is the user load data before demand response;
[0204] is the user load data after demand response;
[0205] Step S2, constructing an improved perceptron model based on the demand response model of the integrated energy system, wherein the input of the improved perceptron model is defined as the response index change rate, and the output is defined as the load change rate prediction value;
[0206] Among them, the demand response model is a nonlinear model, and the formula is:
[0207]
[0208] Where, is the elastic coefficient matrix
[0209] is the number of demand responses, ;
[0210] A multi-layer improved perceptron model is constructed for the demand response model, which includes an input layer, L-1 hidden layers, and an output layer. The output of each hidden layer serves as the input of the next layer. The expression is:
[0211]
[0212] Where, For the The weighted input of the layer, , the 0th layer is the input layer, the Layer is the output layer;
[0213] For the The weight matrix of the layer;
[0214] For the The activation value of the layer, where Improve the input of the multi-layer perceptron model;
[0215] For the The bias term of the layer;
[0216] For the Layer activation function, where the activation function of the hidden layer uses ReLU or Sigmoid function, and the output layer uses linear activation function;
[0217] Multi-layer improved perceptron loss function for:
[0218]
[0219] Where, is the mean square error of the multilayer perceptron;
[0220] For the Layer adjustment factor;
[0221] For the The bias term of the layer;
[0222] For the The activation value of the layer values;
[0223] For the The actual value of the load change rate;
[0224] Sure The steps include:
[0225] Calculating demand response historical datasets middle Standard deviation :
[0226]
[0227] hour, ;
[0228] hour, The value of is .8;
[0229] hour, The value of is 0.5;
[0230] In step S3, the stochastic gradient descent method is used to train the improved perceptron model. The learning rate range is (0, 1], and the weight matrix and bias term are updated through back propagation. The training steps are:
[0231] S311. Initialize the weight matrices and bias terms of each hidden layer and output layer;
[0232] S312 performs forward propagation for each sample, calculating the output of each hidden layer and the load change rate prediction value;
[0233] S313. Calculating the loss function And back-propagate the gradients of each hidden layer and output layer;
[0234] S314. Update all weight matrices and bias terms;
[0235] S315. Loop through S312-S314 until ≤ allowable error, the allowable error is 0.01, and the training is completed;
[0236] Step S4, extracting the weight matrix of the output layer of the trained perception machine model as the elasticity coefficient matrix of the demand response model of the integrated energy system.
[0237] The elasticity coefficient matrix of the residential, industrial and commercial three typical functional areas is fitted using the above method, Figure 2-Figure 4 The demand response model coefficient matrix of the residential area, industrial area and commercial area is shown in the schematic diagram, wherein the vertical time side represents the response ability of the current period under the response index of the current period; the horizontal time side represents the influence of the corresponding index of other periods on the current period, and the darker the color, the stronger the response ability.
[0238] Among them, Figure 2 The schematic diagram of the demand response model coefficient matrix of the residential area is shown in the following formula (1): Figure 2 It can be seen that the response ability of the residential area is weak at 7-9 o'clock and 18-20 o'clock in the morning and evening, and the response is good at other time periods;
[0239] Figure 3 The schematic diagram of the demand response model coefficient matrix of the industrial area is shown in the following formula (2): Figure 3 It can be seen that the user self-reduction load is weak during the daytime working hours of 8-18 o'clock, and the main mode is replacement and transfer; the response ability is greatly affected by the daytime working hours during the lunch break of 13 o'clock and 22-6 o'clock at night.
[0240] Figure 4 The schematic diagram of the demand response model coefficient matrix of the commercial area is shown in the following formula (3): Figure 4 It can be seen that the commercial area is in business hours from 10-21 o'clock, and the load enters the second peak period during the non-meal period, and the response ability is good during this period.
[0241] It can be seen that the elasticity coefficient matrix of each typical functional area is consistent with the space-time characteristics of the load of the functional area, and can accurately represent the response ability of each period and the interaction between periods, so that the coefficient matrix fitting method of the demand response model can correctly fit the multi-dimensional parameters of the demand response model of the integrated energy system.
[0242] The following is an embodiment of the coefficient matrix fitting system of the demand response model provided by the embodiment of the present disclosure. The coefficient matrix fitting system of the demand response model belongs to the same inventive concept as the demand response model coefficient matrix fitting method described above. Details not described in the embodiment of the coefficient matrix fitting system of the demand response model can be referred to the embodiment of the demand response model coefficient matrix fitting method described above.
[0243] As shown in Figure 5 The coefficient matrix fitting system of the demand response model comprises:
[0244] A data acquisition module configured to acquire historical data of an integrated energy system index;
[0245] The data preprocessing module is used to calculate the response indicator change rate and the corresponding load change rate based on the historical data of the integrated energy system indicators, form sample pairs, and form a demand response historical data set;
[0246] A model building module is used to build an improved perceptron model based on the demand response model of the integrated energy system;
[0247] Model training module, used to train and improve the perceptron model;
[0248] The matrix extraction module is used to extract the weight matrix of the output layer of the trained perceptron model as the elasticity coefficient matrix of the integrated energy system demand response model.
[0249] The coefficient matrix fitting system of the integrated energy system demand response model of this embodiment is used to implement the coefficient matrix fitting method of the demand response model, and the steps include:
[0250] S1. Acquisition Collect historical data of comprehensive energy system indicators and calculate the change rate of response indicators and the corresponding load change rate ,constitute sample pairs to form a demand response historical dataset ;
[0251] S2. Build an improved perceptron model based on the demand response model of the integrated energy system. The input of the improved perceptron model is defined as the response indicator change rate, and the output is defined as the load change rate prediction value.
[0252] Among them, a single-layer improved perceptron model is constructed for the linear demand response model, and the expression is:
[0253]
[0254] Single-layer improved perceptron loss function for:
[0255]
[0256] Where, Improve the output of the perceptron model for a single layer;
[0257] Improve the input of the perceptron model for a single layer;
[0258] is the weight matrix;
[0259] is the mean square error of a single-layer perceptron;
[0260] is the regulating factor;
[0261] is the bias term;
[0262] For the The actual value of the load change rate;
[0263] A multi-layer improved perceptron model is constructed for the nonlinear demand response model, which includes an input layer, at least one hidden layer, and an output layer. The output of each hidden layer serves as the input of the next layer. The expression is:
[0264]
[0265] Where, For the The weighted input of the layer, , the 0th layer is the input layer, the Layer is the output layer;
[0266] For the The weight matrix of the layer;
[0267] For the The activation value of the layer, where Improve the input of the multi-layer perceptron model;
[0268] For the The bias term of the layer;
[0269] For the Layer activation function;
[0270] Multi-layer improved perceptron loss function for:
[0271]
[0272] Where, is the mean square error of the multilayer perceptron;
[0273] For the Layer adjustment factor;
[0274] For the The bias term of the layer;
[0275] For the The activation value of the layer values;
[0276] For the The actual value of the load change rate;
[0277] S3. Train the improved perceptron model, updating the weight matrix and bias terms until the loss function is ≤ the allowed error.
[0278] S4. Extract the weight matrix of the output layer of the trained perceptron model as the elasticity coefficient matrix of the integrated energy system demand response model.
[0279] The present application also provides an electronic device for implementing various embodiments of the present application. The electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor.
[0280] Those skilled in the art will understand that the electronic device structure involved in the embodiments of the present application does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0281] Figure 6 A schematic diagram of the hardware structure of an electronic device for implementing various embodiments of the present application.
[0282] The electronic device includes, but is not limited to, components such as a processor and a memory. Those skilled in the art will appreciate that the electronic device structures described in the embodiments of the present application do not limit the electronic device, and the electronic device may include more or fewer components than shown, or may combine certain components or arrange the components differently.
[0283] In the embodiments of the present application, electronic devices include, but are not limited to, laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic devices may also represent various forms of mobile devices and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the embodiments of the present application described and / or claimed herein.
[0284] In the embodiment of the present application, the processor can be implemented by using at least one of an application-specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a processor, a controller, a microcontroller, a microprocessor, and an electronic unit designed to perform the functions described herein. In some cases, such an embodiment can be implemented in a controller. For software implementation, an embodiment such as a process or function can be implemented with a separate software module that allows the execution of at least one function or operation. The software code can be implemented by a software application (or program) written in any appropriate programming language, and the software code can be stored in a memory and executed by a controller.
[0285] In addition, the electronic device includes some functional modules not shown, which will not be described here.
[0286] Those skilled in the art will appreciate that various aspects of the electronic device provided herein may be implemented as a system, method, or program product. Therefore, various aspects of the present disclosure may be implemented in the following forms: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software implementations, which may be collectively referred to herein as "circuits," "modules," or "systems."
[0287] The present application also provides a storage medium storing a program product capable of implementing a coefficient matrix fitting method for a demand response model. In some possible implementations, various aspects of the present disclosure may also be implemented in the form of a program product comprising program code. When the program product is executed on a terminal device, the program code is configured to cause the terminal device to execute the steps described in the "Exemplary Methods" section above according to various exemplary implementations of the present disclosure.
[0288] The storage medium can be any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0289] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present application. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments shown herein, but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A coefficient matrix fitting method for a demand response model, characterized in that: include: S1. Acquisition Collect historical data of comprehensive energy system indicators and calculate the change rate of response indicators and the corresponding load change rate ,constitute sample pairs to form a demand response historical dataset ; Comprehensive energy system indicators include energy price change rate, carbon intensity change rate, and user load data before and after demand response. The calculation formula is: Where, For the Energy price change rate; For the Carbon intensity change rate; The calculation formula is: Where, For the User load data before demand response; For the User load data after demand response; S2. Build an improved perceptron model based on the demand response model of the integrated energy system. The input of the improved perceptron model is defined as the response indicator change rate, and the output is defined as the load change rate prediction value. Among them, a single-layer improved perceptron model is constructed for the linear demand response model, and a multi-layer improved perceptron model is constructed for the nonlinear demand response model; The formula for the linear demand response model is: Where, is the elastic coefficient matrix; The expression of the single-layer improved perceptron model is: Single-layer improved perceptron loss function for: Where, Improve the output of the perceptron model for a single layer; Improve the input of the perceptron model for a single layer; is the weight matrix; is the mean square error of a single-layer perceptron; As the adjustment factor, determine The steps include: Calculating demand response historical datasets middle Standard deviation : when hour, ; when hour, ; is the bias term; For the The actual value of the load change rate; The formula of the nonlinear demand response model is: Where, is the elastic coefficient matrix; is the number of demand responses, ; The multi-layer improved perceptron model includes an input layer, at least one hidden layer, and an output layer. The output of each hidden layer serves as the input of the next layer, and the expression is: Where, For the The weighted input of the layer, , the 0th layer is the input layer, the Layer is the output layer; For the The weight matrix of the layer; For the The activation value of the layer, where Improve the input of the multi-layer perceptron model; For the The bias term of the layer; For the Layer activation function; Multi-layer improved perceptron loss function for: Where, is the mean square error of the multilayer perceptron; For the Layer adjustment factor; For the The bias term of the layer; For the The activation value of the layer values; For the The actual value of the load change rate; S3. Train the improved perceptron model, updating the weight matrix and bias terms until the loss function is ≤ the allowed error. S4. Extract the weight matrix of the output layer of the trained perceptron model as the elasticity coefficient matrix of the integrated energy system demand response model.
2. The coefficient matrix fitting method according to claim 1, wherein: In step S3, the stochastic gradient descent method is used to train the improved perceptron model, the learning rate range is (0, 1], and the weight matrix and bias term are updated through back propagation.
3. The coefficient matrix fitting method according to claim 2, wherein: In step S3, when the improved perceptron model is a single-layer improved perceptron model, the training steps are: S301. Initialize the weight matrix and bias , set the random seed; S302 performs forward propagation on each sample to calculate the load change rate prediction value; S303. Calculate the loss function And back-propagate the gradient; S304. Update parameter weight matrix and bias ; S305. Loop through S302-S304 until ≤ allowable error, training is completed.
4. The coefficient matrix fitting method according to claim 2, wherein: In step S3, when the improved perceptron model is a multi-layer improved perceptron model, the training steps are: S311. Initialize the weight matrices and bias terms of each hidden layer and output layer; S312 performs forward propagation for each sample, calculating the output of each hidden layer and the load change rate prediction value; S313. Calculating the loss function And back-propagate the gradients of each hidden layer and output layer; S314. Update all weight matrices and bias terms; S315. Loop through S312-S314 until ≤ allowable error, training is completed.
5. A coefficient matrix fitting system for a demand response model, characterized in that: A method for implementing a coefficient matrix fitting method according to any one of claims 1 to 4, comprising: Data acquisition module, used to obtain historical data of comprehensive energy system indicators; The data preprocessing module is used to calculate the response indicator change rate and the corresponding load change rate based on the historical data of the integrated energy system indicators, form sample pairs, and form a demand response historical data set; A model building module is used to build an improved perceptron model based on the demand response model of the integrated energy system; Model training module, used to train and improve the perceptron model; The matrix extraction module is used to extract the weight matrix of the output layer of the trained perceptron model as the elasticity coefficient matrix of the integrated energy system demand response model.
6. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor is configured to implement the steps of the coefficient matrix fitting method as claimed in any one of claims 1 to 4 when executing the computer program.
7. A storage medium, characterized in that: The storage medium stores a computer program, which, when executed by a processor, implements the steps of the coefficient matrix fitting method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Load and price prediction method
CN112862143A
Micro-grid low-carbon economic dispatching method, system, equipment and medium
CN116780546A