A power system node carbon emission factor prediction method and device, electronic equipment and storage medium
By using the quantum tunneling optimization algorithm to find the globally optimal combination of hyperparameters in the power system, the problem of conventional optimization algorithms getting trapped in local optima in complex solution spaces is solved, thus improving the accuracy and generalization ability of carbon emission factor prediction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- MEASUREMENT CENT OF GUANGDONG POWER GRID CO LTD
- Filing Date
- 2026-02-26
- Publication Date
- 2026-06-02
AI Technical Summary
In existing technologies, conventional hyperparameter optimization algorithms lack a mechanism to escape local optima when faced with complex solution spaces, which limits the generalization ability and prediction accuracy of power system node carbon emission factor prediction models.
The quantum tunneling optimization algorithm is used to iteratively update the initial hyperparameter population. By using the validation set error as the barrier function value in each iteration, and combining tunneling update and gradient update strategies, the globally optimal hyperparameter combination is found to construct a hybrid prediction model.
It significantly improves the generalization ability and prediction accuracy of the nodal carbon emission factor prediction model when processing high-dimensional nonlinear power data, solves the local optimum problem, and achieves more accurate carbon emission factor prediction.
Smart Images

Figure CN122133106A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power system carbon emission prediction technology, specifically to a method, apparatus, electronic device, and storage medium for predicting carbon emission factors at power system nodes. Background Technology
[0002] Currently, building a new power system with new energy sources as the mainstay has become a core task of energy transformation. Against this backdrop, the nodal carbon emission factor of the power system, as a key indicator capable of accurately quantifying the carbon emission intensity at each node of the power grid, profoundly reflects the spatiotemporal distribution characteristics of carbon flow in a complex power grid. Accurate prediction of the nodal carbon emission factor is not only the core data foundation for power users to conduct refined carbon accounting and participate in the carbon trading market, but also the basis for dispatching departments to formulate low-carbon operation strategies, guide user-side demand response, and achieve coordinated carbon reduction across power generation, grid, load, and storage. It is of great significance for improving the green and lean management level of the power system.
[0003] However, due to the high proportion of distributed renewable energy access, the operating data of the power system exhibits strong randomness, volatility, and nonlinearity, making the variation patterns of node carbon emission factors exceptionally complex. Currently, while using deep neural networks to mine the spatiotemporal features of data has become the mainstream prediction method, the predictive performance of the model is highly dependent on the reasonable configuration of hyperparameters. Existing technical solutions mostly employ empirical trial and error or conventional heuristic optimization algorithms (such as particle swarm optimization and gradient descent) when optimizing model hyperparameters. These methods lack an effective mechanism for perceiving the global positional relationships in the solution space when facing high-dimensional, non-convex, and complex parameter solution spaces. They are prone to getting trapped in local optima during the search process and cannot escape, resulting in the final determined model parameters not being globally optimal. This severely limits the generalization ability and prediction accuracy of the prediction model under complex and variable operating conditions. Summary of the Invention
[0004] This invention provides a method, apparatus, electronic device, and storage medium for predicting carbon emission factors at power system nodes. It can solve the problem that conventional hyperparameter optimization algorithms in the prior art lack a mechanism to escape local optima when facing complex solution spaces, resulting in non-globally optimal model parameters, which in turn limits the generalization ability and prediction accuracy of the prediction model.
[0005] An embodiment of the present invention provides a method for predicting node carbon emission factors in a power system, comprising: Obtain real-time node load power data of the power system at the time to be predicted; Real-time node load power data is input into a preset node carbon emission factor prediction model to generate the power system node carbon emission factor prediction results for the time to be predicted. The training steps of the node carbon emission factor prediction model include: Obtain the model training dataset containing the training and validation sets in the power system; Construct an initial hybrid prediction model containing convolutional neural network layers and long short-term memory network layers; randomly generate an initial hyperparameter population containing multiple sets of hyperparameter individuals; The initial hyperparameter population is iteratively updated using the quantum tunneling optimization algorithm based on the model training dataset until a preset termination condition is met to determine the globally optimal hyperparameter combination. In each iteration, the initial hybrid prediction model configured by each hyperparameter individual in the current hyperparameter population is trained using the training set to obtain the trained model corresponding to the current hyperparameter individual. The mean absolute error of the trained model on the validation set is calculated as the barrier function value. Based on the barrier function value, the current optimal hyperparameter individual is determined from the current hyperparameter population. If the barrier function value meets the preset tunneling trigger condition, the tunneling probability is calculated based on the distance between the current position of the hyperparameter individual and the position of the current optimal hyperparameter individual, and tunneling update based on the tunneling probability is performed. If the barrier function value does not meet the tunneling trigger condition, gradient update based on the barrier function gradient is performed. An initial hybrid prediction model is configured using the globally optimal hyperparameter combination, and the model training dataset is used to train the initial hybrid prediction model configured using the globally optimal hyperparameter combination to generate a node carbon emission factor prediction model.
[0006] Furthermore, obtain the model training dataset containing the training and validation sets from the power system, including: Obtain historical electricity consumption data and historical energy type percentage data of the power system; Fit the probability distribution of historical electricity consumption data to generate an electricity consumption probability distribution; Fit the probability distribution of historical energy type proportion data to generate an energy proportion probability distribution; The number of samples is determined based on the probability distribution of electricity consumption and the probability distribution of energy share. Latin hypercube sampling is performed on the probability distribution of electricity consumption to divide the probability distribution of electricity consumption into equal probability intervals equal to the number of sampling samples. Sample points are randomly selected in each equal probability interval to generate a sequence of electricity consumption samples. Latin hypercube sampling is performed on the probability distribution of energy share to divide the probability distribution of energy share into equal probability intervals equal to the number of sampling samples, and sample points are randomly selected in each equal probability interval to generate an energy share sample sequence. The electricity consumption sample sequence and the energy proportion sample sequence are combined to construct a comprehensive sample matrix, and the comprehensive sample matrix is normalized to generate a normalized comprehensive sample matrix. The carbon emission values of each node in the power system are calculated based on the normalized comprehensive sample matrix. The normalized comprehensive sample matrix is used as the input feature, and the carbon emission value is used as the output label to integrate and generate the model training dataset. The model training dataset is divided into a training set and a validation set according to a preset division ratio.
[0007] Furthermore, the carbon emission values of each node in the power system are calculated based on the normalized comprehensive sample matrix, including: The normalized comprehensive sample matrix is analyzed to obtain generator unit injected power data, load node injected power data, and energy type proportion sample data. The carbon emission intensity data of the generator node is determined based on the generator unit injected power data and the energy type proportion sample data. A node power injection matrix is constructed based on the generator set injected power data and the load node injected power data. Power system power flow calculation is then performed based on the node power injection matrix to generate the power flow distribution matrix of the power grid branches. Carbon flow tracing calculations are performed based on the carbon emission intensity data of generator nodes and the power flow distribution matrix of power grid branches to generate the node carbon potential distribution matrix of each node in the power system. The carbon emission values of each node in the power system are determined based on the node carbon potential distribution matrix.
[0008] Furthermore, an initial hybrid prediction model containing convolutional neural network layers and long short-term memory network layers is constructed; an initial hyperparameter population containing multiple groups of individuals with hyperparameters is randomly generated, including: Construct a convolutional neural network layer, wherein the convolutional neural network layer includes an input layer, a convolutional layer, and a pooling layer; Construct a long short-term memory network layer, wherein the long short-term memory network layer includes an input gate, a forget gate, an output gate, and a cell state unit; Connect the output of the convolutional neural network layer to the input of the long short-term memory network layer; Determine the types of parameters to be optimized in the initial hybrid prediction model; among them, the types of parameters to be optimized include the number of convolutional kernels, the number of hidden units in the long short-term memory network, and the learning rate; Each parameter sets a range of values for the number of convolutional kernels, the number of hidden units in the long short-term memory network, and the learning rate. Based on the uniform distribution of multiple sets of parameter combinations randomly generated within the range of the stated values, each set of parameter combinations is treated as a hyperparameter individual, thus generating an initial hyperparameter population containing multiple sets of hyperparameter individuals.
[0009] Furthermore, based on the model training dataset, the initial hyperparameter population is iteratively updated using the quantum tunneling optimization algorithm until a preset termination condition is met to determine the globally optimal hyperparameter combination, including: Repeatedly perform iterative optimization operations until the preset termination condition is met, and determine the hyperparameter individual with the smallest barrier function value in the current hyperparameter population as the global optimal hyperparameter combination; The iterative optimization operation includes: For each hyperparameter individual in the current hyperparameter population, an initial fusion prediction model is configured using the current hyperparameter individual to generate the current fusion prediction model; wherein, the initial hyperparameter population is the initial hyperparameter population. The current hybrid prediction model is trained using the training set to generate the corresponding post-trained model; Calculate the mean absolute error of the trained model on the validation set, and generate the barrier function value of the current hyperparameter individual; Based on the barrier function values of each hyperparameter individual in the current hyperparameter population, determine the current optimal hyperparameter individual from the current hyperparameter population; For each hyperparameter individual in the current hyperparameter population, compare the barrier function value of the current hyperparameter individual with the barrier function value of the current best hyperparameter individual; If the barrier function value of the current hyperparameter individual is greater than that of the current best hyperparameter individual, then the preset tunneling triggering condition is met. The Euclidean distance between the position of the current hyperparameter individual and the position of the current best hyperparameter individual is calculated, and the tunneling probability is calculated based on the Euclidean distance and the barrier function value of the current hyperparameter individual. Based on the tunneling probability, the position of the current hyperparameter individual, the preset basic transition amplitude, and the preset barrier sensitivity coefficient, tunneling update is performed to generate the updated hyperparameter individual. If the barrier function value of the hyperparameter individual is less than or equal to the barrier function value of the current optimal hyperparameter individual, it is determined that the preset tunneling triggering condition is not met. The value of the barrier function gradient of the current optimal hyperparameter individual is calculated using the finite difference method, and gradient update is performed according to the position of the current optimal hyperparameter individual, the preset learning rate, and the value of the barrier function gradient to generate an updated hyperparameter individual. After every hyperparameter individual in the current hyperparameter population has been updated, the current hyperparameter population is updated based on the updated results of each hyperparameter individual.
[0010] Furthermore, the Euclidean distance between the current hyperparameter individual's position and the current optimal hyperparameter individual's position is calculated, and the tunneling probability is calculated based on the Euclidean distance and the current hyperparameter individual's barrier function value. Based on the tunneling probability, the current hyperparameter individual's position, a preset base transition amplitude, and a preset barrier sensitivity coefficient, tunneling updates are performed to generate updated hyperparameter individuals, including: Calculate the Euclidean distance between the current position of the hyperparameter individual and the position of the current optimal hyperparameter individual, and generate the Euclidean distance value; Calculate the product of the Euclidean distance value and the current barrier function value of the hyperparameter individual to generate the barrier strength value; The barrier strength value is weighted using a preset barrier sensitivity coefficient, and the negative exponentiation of the natural exponent is performed on the weighted result to generate the tunneling probability. Generate a random-direction unit vector with the same dimension as the current hyperparameter individual; The actual tunneling step size is determined by multiplying the preset basic transition amplitude by the tunneling probability. The displacement correction vector is generated by scaling the random direction unit vector using the actual tunneling step length value. The displacement correction vector is superimposed with the current position of the hyperparameter individual to generate the updated hyperparameter individual.
[0011] Furthermore, an initial hybrid prediction model is configured using the globally optimal hyperparameter combination, and the model training dataset is used to train the initial hybrid prediction model configured using the globally optimal hyperparameter combination to generate a node carbon emission factor prediction model, including: The number of convolutional kernels, the number of hidden units in the long short-term memory network, and the learning rate of the initial hybrid prediction model are determined based on the globally optimal combination of hyperparameters, and a hybrid prediction model to be trained is generated. According to the preset batch size, the training set in the model training dataset is divided into several batches of training sequence samples; The training sequence samples of each batch are sequentially input into the mixed prediction model to be trained, and iterative training is performed until the preset training iteration termination condition is met. In each iteration, the hybrid prediction model to be trained performs time-series feature extraction and regression prediction calculation on the current batch of training sequence samples to generate node carbon emission factor prediction results. The prediction error between the predicted carbon emission factor of a node and the carbon emission value corresponding to the current batch of training sequence samples is calculated using a preset loss function, and a loss function value is generated. The preset Adam optimization algorithm is then used to perform backpropagation updates on the network weight parameters of the hybrid prediction model to be trained based on the loss function value.
[0012] Based on the above method embodiments, the present invention provides corresponding apparatus embodiments.
[0013] One embodiment of the present invention provides a power system node carbon emission factor prediction device, comprising: a data acquisition module, a prediction generation module, and a model building and training module; The data acquisition module is used to acquire real-time node load power data of the power system at the time to be predicted. The prediction generation module is used to input real-time node load power data into a preset node carbon emission factor prediction model to generate the power system node carbon emission factor prediction result at the time to be predicted. The model building and training module is used to acquire a model training dataset containing training and validation sets in the power system; construct an initial hybrid prediction model containing convolutional neural network layers and long short-term memory network layers; randomly generate an initial hyperparameter population containing multiple sets of hyperparameter individuals; and iteratively update the initial hyperparameter population using the quantum tunneling optimization algorithm based on the model training dataset until a preset termination condition is met to determine the globally optimal hyperparameter combination. In each iteration, the initial hybrid prediction model configured by each hyperparameter individual in the current hyperparameter population is trained using the training set to obtain the training data corresponding to the current hyperparameter individual. The model is trained; the mean absolute error of the trained model on the validation set is calculated as the barrier function value; based on the barrier function value, the current optimal hyperparameter individual is determined from the current hyperparameter population; if the barrier function value meets the preset tunneling triggering condition, the tunneling probability is calculated based on the distance between the current position of the hyperparameter individual and the position of the current optimal hyperparameter individual, and tunneling update based on the tunneling probability is performed; if the barrier function value does not meet the tunneling triggering condition, gradient update based on the barrier function gradient is performed; the initial hybrid prediction model is configured using the globally optimal hyperparameter combination, and the model training dataset is used to test the configuration using the globally optimal hyperparameter combination. Based on the above method embodiments, the present invention provides corresponding electronic device embodiments.
[0014] An embodiment of the present invention provides an electronic device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the power system node carbon emission factor prediction method of any of the above-described method embodiments.
[0015] Based on the above method embodiments, the present invention provides corresponding storage medium embodiments.
[0016] One embodiment of the present invention provides a storage medium storing a computer program thereon, wherein, when the computer program is running, it controls the device where the storage medium is located to execute any of the power system node carbon emission factor prediction methods described in the above-described method embodiments.
[0017] Compared with the prior art, the present invention has the following beneficial effects: This invention provides a method, apparatus, electronic device, and storage medium for predicting carbon emission factors at power system nodes. The method acquires real-time node load power data at the time to be predicted in the power system and inputs it into a node carbon emission factor prediction model to obtain prediction results for each node's carbon emission factor. The training process of the prediction model includes: acquiring a training dataset containing training and validation sets in the power system; constructing a hybrid prediction model composed of a convolutional neural network and a long short-term memory network, and initializing multiple sets of hyperparameter individuals to form a hyperparameter population; iteratively optimizing the hyperparameter population using a quantum tunneling optimization algorithm, training the model based on the training set in each iteration, and using the mean absolute error on the validation set as a barrier function, combined with tunneling update or gradient update strategies to search for the globally optimal hyperparameters; finally, training the hybrid prediction model using the globally optimal hyperparameters to generate a node carbon emission factor prediction model.
[0018] This invention introduces a quantum tunneling optimization algorithm into model training. In each iteration, it uses validation set error to lock in the current optimal hyperparameter individual. When the tunneling trigger condition is met, it calculates the tunneling probability based on the distance between the current position of the hyperparameter individual and the position of the current optimal hyperparameter individual, and performs tunneling updates. This constructs a global optimization mechanism that can forcibly overcome local extrema using spatial distance features, directly solving the technical problem that existing conventional optimization algorithms are prone to getting trapped in local optima in complex parameter spaces due to the lack of a jump mechanism. This method uses distance-based tunneling effects to lock in the globally optimal hyperparameter combination and combines gradient updates to ensure local search efficiency, significantly improving the generalization ability and prediction accuracy of the nodal carbon emission factor prediction model when processing high-dimensional nonlinear power data. Attached Figure Description
[0019] Figure 1 This is a flowchart illustrating a method for predicting carbon emission factors at power system nodes, provided in an embodiment of the present invention.
[0020] Figure 2 This is a schematic diagram of the structure of a power system node carbon emission factor prediction device provided in an embodiment of the present invention. Detailed Implementation
[0021] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0022] like Figure 1 As shown, to address the problem that conventional hyperparameter optimization algorithms in the prior art lack a mechanism to escape local optima when facing complex solution spaces, resulting in non-globally optimal model parameters and thus limiting the generalization ability and prediction accuracy of the prediction model, an embodiment of the present invention provides a method for predicting node carbon emission factors in power systems, comprising at least the following steps: Step S1: Obtain real-time node load power data of the power system at the time to be predicted; Specifically, as the first step in one embodiment of the present invention, the operation of acquiring real-time node load power data of the power system at the time to be predicted is performed. Real-time node load power data of the power system at the time to be predicted refers to the actual active power consumed by each load node in the power network topology at the target prediction time. This data is obtained by connecting to a power dispatch automation platform or a wide-area measurement database, and is read at a preset time sampling frequency. Real-time node load power data characterizes the instantaneous load distribution state of the power system at the time to be predicted. It is typically stored and transmitted in the form of a multi-dimensional vector or matrix, where each element corresponds to the load value of a specific node in the power network. During the acquisition process, if there are missing or corrupted data points, the real-time node load power data is preprocessed using linear interpolation or nearest-neighbor filling to ensure data integrity. As the direct input physical quantity for subsequent node carbon emission factor prediction models, the real-time performance and accuracy of the real-time node load power data directly determine the quality of the boundary conditions for carbon potential distribution calculation. By accurately acquiring real-time node load power data of the power system at the moment to be predicted, a solid data foundation can be provided for subsequent capture of power flow changes and dynamic spatiotemporal distribution characteristics of carbon flow, thereby significantly improving the real-time responsiveness and reliability of the final carbon emission factor prediction results.
[0023] Step S2: Input the real-time node load power data into the preset node carbon emission factor prediction model to generate the power system node carbon emission factor prediction result at the time to be predicted. In a preferred embodiment, the training steps of the node carbon emission factor prediction model include: Obtain the model training dataset containing the training and validation sets in the power system; Construct an initial hybrid prediction model containing convolutional neural network layers and long short-term memory network layers; randomly generate an initial hyperparameter population containing multiple sets of hyperparameter individuals; The initial hyperparameter population is iteratively updated using the quantum tunneling optimization algorithm based on the model training dataset until a preset termination condition is met to determine the globally optimal hyperparameter combination. In each iteration, the initial hybrid prediction model configured by each hyperparameter individual in the current hyperparameter population is trained using the training set to obtain the trained model corresponding to the current hyperparameter individual. The mean absolute error of the trained model on the validation set is calculated as the barrier function value. Based on the barrier function value, the current optimal hyperparameter individual is determined from the current hyperparameter population. If the barrier function value meets the preset tunneling trigger condition, the tunneling probability is calculated based on the distance between the current position of the hyperparameter individual and the position of the current optimal hyperparameter individual, and tunneling update based on the tunneling probability is performed. If the barrier function value does not meet the tunneling trigger condition, gradient update based on the barrier function gradient is performed. An initial hybrid prediction model is configured using the globally optimal hyperparameter combination, and the model training dataset is used to train the initial hybrid prediction model configured using the globally optimal hyperparameter combination to generate a node carbon emission factor prediction model.
[0024] In a preferred embodiment, obtaining a model training dataset containing a training set and a validation set from the power system includes: Obtain historical electricity consumption data and historical energy type percentage data of the power system; Fit the probability distribution of historical electricity consumption data to generate an electricity consumption probability distribution; Fit the probability distribution of historical energy type proportion data to generate an energy proportion probability distribution; The number of samples is determined based on the probability distribution of electricity consumption and the probability distribution of energy share. Latin hypercube sampling is performed on the probability distribution of electricity consumption to divide the probability distribution of electricity consumption into equal probability intervals equal to the number of sampling samples. Sample points are randomly selected in each equal probability interval to generate a sequence of electricity consumption samples. Latin hypercube sampling is performed on the probability distribution of energy share to divide the probability distribution of energy share into equal probability intervals equal to the number of sampling samples, and sample points are randomly selected in each equal probability interval to generate an energy share sample sequence. The electricity consumption sample sequence and the energy proportion sample sequence are combined to construct a comprehensive sample matrix, and the comprehensive sample matrix is normalized to generate a normalized comprehensive sample matrix. The carbon emission values of each node in the power system are calculated based on the normalized comprehensive sample matrix. The normalized comprehensive sample matrix is used as the input feature, and the carbon emission value is used as the output label to integrate and generate the model training dataset. The model training dataset is divided into a training set and a validation set according to a preset division ratio.
[0025] In a preferred embodiment, the carbon emission values of each node in the power system are calculated based on the normalized comprehensive sample matrix, including: The normalized comprehensive sample matrix is analyzed to obtain generator unit injected power data, load node injected power data, and energy type proportion sample data. The carbon emission intensity data of the generator node is determined based on the generator unit injected power data and the energy type proportion sample data. A node power injection matrix is constructed based on the generator set injected power data and the load node injected power data. Power system power flow calculation is then performed based on the node power injection matrix to generate the power flow distribution matrix of the power grid branches. Carbon flow tracing calculations are performed based on the carbon emission intensity data of generator nodes and the power flow distribution matrix of power grid branches to generate the node carbon potential distribution matrix of each node in the power system. The carbon emission values of each node in the power system are determined based on the node carbon potential distribution matrix.
[0026] In a preferred embodiment, an initial hybrid prediction model comprising convolutional neural network layers and long short-term memory network layers is constructed; an initial hyperparameter population comprising multiple groups of hyperparameter individuals is randomly generated, including: Construct a convolutional neural network layer, wherein the convolutional neural network layer includes an input layer, a convolutional layer, and a pooling layer; Construct a long short-term memory network layer, wherein the long short-term memory network layer includes an input gate, a forget gate, an output gate, and a cell state unit; Connect the output of the convolutional neural network layer to the input of the long short-term memory network layer; Determine the types of parameters to be optimized in the initial hybrid prediction model; among them, the types of parameters to be optimized include the number of convolutional kernels, the number of hidden units in the long short-term memory network, and the learning rate; Each parameter sets a range of values for the number of convolutional kernels, the number of hidden units in the long short-term memory network, and the learning rate. Based on the uniform distribution of multiple sets of parameter combinations randomly generated within the range of the stated values, each set of parameter combinations is treated as a hyperparameter individual, thus generating an initial hyperparameter population containing multiple sets of hyperparameter individuals.
[0027] In a preferred embodiment, the initial hyperparameter population is iteratively updated using the quantum tunneling optimization algorithm based on the model training dataset until a preset termination condition is met to determine the globally optimal hyperparameter combination, including: Repeatedly perform iterative optimization operations until the preset termination condition is met, and determine the hyperparameter individual with the smallest barrier function value in the current hyperparameter population as the global optimal hyperparameter combination; The iterative optimization operation includes: For each hyperparameter individual in the current hyperparameter population, an initial fusion prediction model is configured using the current hyperparameter individual to generate the current fusion prediction model; wherein, the initial hyperparameter population is the initial hyperparameter population. The current hybrid prediction model is trained using the training set to generate the corresponding post-trained model; Calculate the mean absolute error of the trained model on the validation set, and generate the barrier function value of the current hyperparameter individual; Based on the barrier function values of each hyperparameter individual in the current hyperparameter population, determine the current optimal hyperparameter individual from the current hyperparameter population; For each hyperparameter individual in the current hyperparameter population, compare the barrier function value of the current hyperparameter individual with the barrier function value of the current best hyperparameter individual; If the barrier function value of the current hyperparameter individual is greater than that of the current best hyperparameter individual, then the preset tunneling triggering condition is met. The Euclidean distance between the position of the current hyperparameter individual and the position of the current best hyperparameter individual is calculated, and the tunneling probability is calculated based on the Euclidean distance and the barrier function value of the current hyperparameter individual. Based on the tunneling probability, the position of the current hyperparameter individual, the preset basic transition amplitude, and the preset barrier sensitivity coefficient, tunneling update is performed to generate the updated hyperparameter individual. If the barrier function value of the hyperparameter individual is less than or equal to the barrier function value of the current optimal hyperparameter individual, it is determined that the preset tunneling triggering condition is not met. The value of the barrier function gradient of the current optimal hyperparameter individual is calculated using the finite difference method, and gradient update is performed according to the position of the current optimal hyperparameter individual, the preset learning rate, and the value of the barrier function gradient to generate an updated hyperparameter individual. After every hyperparameter individual in the current hyperparameter population has been updated, the current hyperparameter population is updated based on the updated results of each hyperparameter individual.
[0028] In a preferred embodiment, the Euclidean distance between the current hyperparameter individual's position and the current optimal hyperparameter individual's position is calculated, and the tunneling probability is calculated based on the Euclidean distance and the current hyperparameter individual's barrier function value. Tunneling update is then performed based on the tunneling probability, the current hyperparameter individual's position, a preset base transition amplitude, and a preset barrier sensitivity coefficient to generate an updated hyperparameter individual, including: Calculate the Euclidean distance between the current position of the hyperparameter individual and the position of the current optimal hyperparameter individual, and generate the Euclidean distance value; Calculate the product of the Euclidean distance value and the current barrier function value of the hyperparameter individual to generate the barrier strength value; The barrier strength value is weighted using a preset barrier sensitivity coefficient, and the negative exponentiation of the natural exponent is performed on the weighted result to generate the tunneling probability. Generate a random-direction unit vector with the same dimension as the current hyperparameter individual; The actual tunneling step size is determined by multiplying the preset basic transition amplitude by the tunneling probability. The displacement correction vector is generated by scaling the random direction unit vector using the actual tunneling step length value. The displacement correction vector is superimposed with the current position of the hyperparameter individual to generate the updated hyperparameter individual.
[0029] In a preferred embodiment, an initial hybrid prediction model is configured using a globally optimal hyperparameter combination, and the initial hybrid prediction model configured using the globally optimal hyperparameter combination is trained using the model training dataset to generate a node carbon emission factor prediction model, including: The number of convolutional kernels, the number of hidden units in the long short-term memory network, and the learning rate of the initial hybrid prediction model are determined based on the globally optimal combination of hyperparameters, and a hybrid prediction model to be trained is generated. According to the preset batch size, the training set in the model training dataset is divided into several batches of training sequence samples; The training sequence samples of each batch are sequentially input into the mixed prediction model to be trained, and iterative training is performed until the preset training iteration termination condition is met. In each iteration, the hybrid prediction model to be trained performs time-series feature extraction and regression prediction calculation on the current batch of training sequence samples to generate node carbon emission factor prediction results. The prediction error between the predicted carbon emission factor of a node and the carbon emission value corresponding to the current batch of training sequence samples is calculated using a preset loss function, and a loss function value is generated. The preset Adam optimization algorithm is then used to perform backpropagation updates on the network weight parameters of the hybrid prediction model to be trained based on the loss function value.
[0030] Specifically, after acquiring real-time node load power data, this data is input into a pre-defined node carbon emission factor prediction model to generate a predicted result for the power system node carbon emission factor at the time to be predicted. The node carbon emission factor prediction model establishes a nonlinear mapping relationship between input power and output carbon emission factor. The predicted result for the power system node carbon emission factor at the time to be predicted represents the carbon dioxide emissions implied by each node for every unit of electricity consumed at that time. This step enables real-time perception of the power grid's carbon emission situation, providing immediate basis for low-carbon dispatch. To ensure the accuracy of the prediction, the node carbon emission factor prediction model requires rigorous training and hyperparameter optimization. The following provides a detailed explanation of the model's construction and training process.
[0031] Model training requires high-quality data support. Therefore, a model training dataset containing both training and validation sets from the power system is needed. Since node carbon emission factors are difficult to measure directly through sensors in actual operation, historical data inversion is typically used to generate this dataset. Specifically, historical node electricity consumption data and historical energy type percentage data are obtained. Kernel density estimation or parameter estimation methods are used to fit the probability distribution of historical node electricity consumption data to generate an electricity consumption probability distribution; similarly, the probability distribution of historical energy type percentage data is fitted to generate an energy percentage probability distribution. The number of samples is determined based on the electricity consumption probability distribution and the energy percentage probability distribution. To ensure coverage of the sample space, Latin hypercube sampling is performed on the electricity consumption probability distribution. The ordinate of the cumulative distribution function of the electricity consumption probability distribution is divided into an equal number of equal probability intervals equal to the number of samples. Sample points are randomly selected within each equal probability interval, and an inverse transformation is used to generate an electricity consumption sample sequence. Similarly, Latin hypercube sampling is performed on the energy percentage probability distribution to generate an energy percentage sample sequence. The electricity consumption sample sequence and the energy proportion sample sequence are combined to construct a comprehensive sample matrix, and the comprehensive sample matrix is normalized to generate a normalized comprehensive sample matrix.
[0032] Subsequently, the carbon emission values of each node in the power system are calculated based on the normalized comprehensive sample matrix, and these values are used as labels for model training. The specific calculation logic is as follows: The normalized comprehensive sample matrix is analyzed to obtain generator injection power data, load node injection power data, and energy type proportion sample data. The carbon emission intensity data of the generator node is determined based on the generator injection power data and the energy type proportion sample data. For a specific generator node, the carbon emission intensity of the generator node is obtained by weighted summation of the output proportion of each energy type and the unit carbon emission coefficient of the corresponding energy type.
[0033] The specific calculation formula is as follows: In the formula, Indicates the first Carbon emission intensity of each generator node; Indicates the total number of energy types; Indicates the first The first generator set The output percentage of each energy type; Indicates the first The unit carbon emission coefficient for each energy type.
[0034] Next, a node power injection matrix is constructed based on the generator injection power data and the load node injection power data. Power system power flow calculation (such as the Newton-Raphson method) is then performed based on the node power injection matrix to generate the power flow distribution matrix of the power grid branches.
[0035] Carbon flow tracing calculations are performed based on the carbon emission intensity data of generator nodes and the power flow distribution matrix of power grid branches. According to the carbon flow conservation law (that the carbon flow out of any node equals the sum of the carbon flow into that node and the carbon flow generated by that node itself), a system of linear equations for carbon potential balance is constructed and solved to generate the nodal carbon potential distribution matrix for each node in the power system. Based on the proportional sharing principle, carbon flow is proportional to electricity flow from upstream to downstream nodes. Assume the first... The carbon potential of each node is Then for any node Its carbon potential balance equation can be expressed as: in, Indicates outflow node Total active power; Represents a node The carbon potential (i.e., the carbon emission factor to be determined). Indicates the injected node The set of upstream nodes; Indicates from node Flow to Node The active power; Indicates upstream node carbon potential; Represents a node The output of the connected generator set; Represents a node Carbon emission intensity of the connected generator sets.
[0036] Finally, the carbon emission values of each node in the power system are determined based on the node carbon potential distribution matrix. The normalized comprehensive sample matrix is used as the input feature, and the carbon emission values are used as the output label to generate the model training dataset. The model training dataset is then divided into a training set and a validation set according to a preset partitioning ratio.
[0037] After preparing the data, an initial hybrid prediction model containing convolutional neural network (CNN) layers and long short-term memory (LSTM) network layers is constructed, and an initial hyperparameter population containing multiple sets of hyperparameter individuals is randomly generated. A CNN layer is constructed, comprising an input layer, convolutional layers, and pooling layers. The input layer receives the time-series load data; the convolutional layers use learnable convolutional kernels to perform convolution operations on the input data to extract high-dimensional features, and the convolution operation captures local change trends in the data through a sliding window mechanism; the pooling layer is used to downsample the feature map (e.g., max pooling), reducing data dimensionality while retaining key information and reducing computational resource consumption. A LSTM network layer is constructed, comprising an input gate, a forget gate, an output gate, and cell state units. The LSTM network controls the flow of information through a gating mechanism: the forget gate determines which information to discard from the previous cell state; the input gate determines which new information to retain in the current cell state; the cell state units are responsible for storing memory information spanning long time steps; and the output gate controls the output of the hidden state at the current time step. The output of the convolutional neural network layer is connected to the input of the long short-term memory network layer to form a pipeline for spatiotemporal feature extraction. This allows the model to perceive both the local fluctuations in the load data and capture its long-term temporal dependencies. The types of parameters to be optimized in the initial hybrid prediction model are determined, including the number of convolutional kernels, the number of hidden units in the long short-term memory network, and the learning rate. Numerical ranges are set for the number of convolutional kernels, the number of hidden units in the long short-term memory network, and the learning rate. Multiple sets of parameter combinations are randomly generated based on a uniform distribution within each of these numerical ranges. Each set of parameter combinations is treated as a hyperparameter individual, generating an initial hyperparameter population containing multiple sets of hyperparameter individuals.
[0038] To address the problem of conventional optimization algorithms easily getting trapped in local optima, this invention employs an optimization strategy based on quantum mechanics principles. Using the model training dataset, the initial hyperparameter population is iteratively updated using a quantum tunneling optimization algorithm until a preset termination condition is met to determine the globally optimal hyperparameter combination. In each iteration, the initial hybrid prediction model configured by each hyperparameter individual in the current hyperparameter population is trained using the training set to obtain the trained model corresponding to the current hyperparameter individual. The mean absolute error of the trained model on the validation set is calculated as the barrier function value. Based on the barrier function value, the current optimal hyperparameter individual is determined from the current hyperparameter population.
[0039] At this point, the algorithm enters the core tunneling determination phase: for each hyperparameter individual in the current hyperparameter population, the barrier function value of the current hyperparameter individual is compared with the barrier function value of the current best hyperparameter individual. If the barrier function value of the current hyperparameter individual is greater than that of the current best hyperparameter individual (meaning the current individual is in a "high potential energy" state with high error, hindered by local extrema), then the preset tunneling triggering condition is met. Then, the Euclidean distance between the position of the current hyperparameter individual and the position of the current best hyperparameter individual is calculated, and the tunneling probability is calculated based on the Euclidean distance and the barrier function value of the current hyperparameter individual. Specifically, the product of the Euclidean distance and the barrier function value of the current hyperparameter individual is calculated to generate a barrier strength value; the barrier strength value is weighted using a preset barrier sensitivity coefficient, and the result of the weighted calculation is subjected to a negative exponentiation of the natural exponent to generate the tunneling probability.
[0040] The tunneling probability The calculation formula is as follows: in, This represents the preset barrier sensitivity coefficient, used to adjust the algorithm's sensitivity to barrier height; This represents the Euclidean distance between the current position of the hyperparameter individual and the position of the current optimal hyperparameter individual. This represents the current barrier function value of the hyperparameter individual.
[0041] After determining the tunneling probability, the calculation formula for performing the position update is as follows: In the formula, This represents the actual tunneling step length value; Indicates the preset basic transition range; This represents the updated hyperparameter individual position vector; This represents the current hyperparameter individual position vector; This represents the generated random direction unit vector.
[0042] This probability reflects the likelihood of a particle passing through a high potential barrier. The greater the distance or the larger the error, the lower the probability of direct passage, but it still exists from a quantum mechanical perspective. Subsequently, tunneling updates are performed based on the tunneling probability, the current position of the hyperparameter individual, the preset base transition amplitude, and the preset barrier sensitivity coefficient to generate an updated hyperparameter individual. This includes generating a random direction unit vector with the same dimension as the current hyperparameter individual; determining the actual tunneling step size based on the product of the preset base transition amplitude and the tunneling probability; scaling the random direction unit vector using the actual tunneling step size to generate a displacement correction vector; and performing a vector superposition operation between the displacement correction vector and the current position of the hyperparameter individual. This mechanism allows the algorithm to forcibly escape local extremum traps when the search stalls, exploring the global optimum.
[0043] Conversely, if the barrier function value of the hyperparameter individual is less than or equal to the barrier function value of the current optimal hyperparameter individual, it is determined that the preset tunneling trigger condition is not met, indicating that the current individual is already in a better region. At this time, the gradient of the barrier function of the current optimal hyperparameter individual is calculated using the finite difference method, and gradient updates are performed based on the position of the current optimal hyperparameter individual, the preset learning rate, and the value of the barrier function gradient to generate updated hyperparameter individuals, thereby achieving local fine-grained convergence. After every hyperparameter individual in the current hyperparameter population has been updated, the current hyperparameter population is updated based on the updated results of each hyperparameter individual.
[0044] Finally, an initial hybrid prediction model is configured using the globally optimal hyperparameter combination obtained through optimization, and trained using the model training dataset to generate a node carbon emission factor prediction model. The number of convolutional kernels, the number of hidden units in the long short-term memory network, and the learning rate of the initial hybrid prediction model are determined based on the globally optimal hyperparameter combination to generate a hybrid prediction model to be trained. The training set in the model training dataset is divided into several batches of training sequence samples according to a preset batch size. Each batch of training sequence samples is sequentially input into the hybrid prediction model to be trained, and iterative training is performed until a preset training iteration termination condition is met. In each iteration, the hybrid prediction model to be trained performs temporal feature extraction and regression prediction calculation on the current batch of training sequence samples to generate a node carbon emission factor prediction result. The prediction error between the node carbon emission factor prediction result and the corresponding carbon emission value of the current batch of training sequence samples is calculated using a preset loss function, generating a loss function value. The formula for calculating the loss function is as follows: In the formula, This represents the value of the loss function; This indicates the number of training sequence samples in the current batch; Indicates the first Prediction results of node carbon emission factors for each sample; Indicates the first The actual carbon emission values corresponding to each sample.
[0045] The pre-defined Adam optimization algorithm is used to perform backpropagation updates on the network weight parameters of the hybrid prediction model to be trained based on the loss function value. The Adam algorithm can dynamically adjust the learning rate of each parameter based on the first-order moment estimate and the second-order moment estimate. Through the above complete process, the final generated model has extremely high generalization ability and prediction accuracy, and can accurately reflect the carbon emission characteristics of the power system under different operating conditions.
[0046] like Figure 2 As shown, an embodiment of the present invention provides a power system node carbon emission factor prediction device, including: a data acquisition module, a prediction generation module, and a model building and training module; The data acquisition module is used to acquire real-time node load power data of the power system at the time to be predicted. The prediction generation module is used to input real-time node load power data into a preset node carbon emission factor prediction model to generate the power system node carbon emission factor prediction result at the time to be predicted. The model building and training module is used to acquire a model training dataset containing training and validation sets in the power system; construct an initial hybrid prediction model containing convolutional neural network layers and long short-term memory network layers; randomly generate an initial hyperparameter population containing multiple sets of hyperparameter individuals; iteratively update the initial hyperparameter population using the quantum tunneling optimization algorithm based on the model training dataset until a preset termination condition is met to determine the globally optimal hyperparameter combination; wherein, in each iteration, the initial hybrid prediction model configured by each hyperparameter individual in the current hyperparameter population is trained using the training set to obtain the trained model corresponding to the current hyperparameter individual; and calculate the performance of the trained model in the validation set. The mean absolute error on the evidence set is used as the barrier function value; based on the barrier function value, the current optimal hyperparameter individual is determined from the current hyperparameter population; if the barrier function value satisfies the preset tunneling triggering condition, the tunneling probability is calculated based on the distance between the current position of the hyperparameter individual and the position of the current optimal hyperparameter individual, and tunneling update based on the tunneling probability is performed; if the barrier function value does not satisfy the tunneling triggering condition, gradient update based on the barrier function gradient is performed; an initial hybrid prediction model is configured using the globally optimal hyperparameter combination, and the initial hybrid prediction model configured using the globally optimal hyperparameter combination is trained using the model training dataset to generate a node carbon emission factor prediction model.
[0047] In an optional embodiment, the data acquisition module is used to acquire real-time node load power data of the power system at the time to be predicted, including: Obtain historical electricity consumption data and historical energy type percentage data of the power system; Fit the probability distribution of historical electricity consumption data to generate an electricity consumption probability distribution; Fit the probability distribution of historical energy type proportion data to generate an energy proportion probability distribution; The number of samples is determined based on the probability distribution of electricity consumption and the probability distribution of energy share. Latin hypercube sampling is performed on the probability distribution of electricity consumption to divide the probability distribution of electricity consumption into equal probability intervals equal to the number of sampling samples. Sample points are randomly selected in each equal probability interval to generate a sequence of electricity consumption samples. Latin hypercube sampling is performed on the probability distribution of energy share to divide the probability distribution of energy share into equal probability intervals equal to the number of sampling samples, and sample points are randomly selected in each equal probability interval to generate an energy share sample sequence. The electricity consumption sample sequence and the energy proportion sample sequence are combined to construct a comprehensive sample matrix, and the comprehensive sample matrix is normalized to generate a normalized comprehensive sample matrix. The carbon emission values of each node in the power system are calculated based on the normalized comprehensive sample matrix. The normalized comprehensive sample matrix is used as the input feature, and the carbon emission value is used as the output label to integrate and generate the model training dataset. The model training dataset is divided into a training set and a validation set according to a preset division ratio.
[0048] In an optional embodiment, the model building and training module constructs an initial hybrid prediction model comprising convolutional neural network layers and long short-term memory network layers; and randomly generates an initial hyperparameter population comprising multiple groups of hyperparameter individuals, including: Construct a convolutional neural network layer, wherein the convolutional neural network layer includes an input layer, a convolutional layer, and a pooling layer; Construct a long short-term memory network layer, wherein the long short-term memory network layer includes an input gate, a forget gate, an output gate, and a cell state unit; Connect the output of the convolutional neural network layer to the input of the long short-term memory network layer; Determine the types of parameters to be optimized in the initial hybrid prediction model; among them, the types of parameters to be optimized include the number of convolutional kernels, the number of hidden units in the long short-term memory network, and the learning rate; Each parameter sets a range of values for the number of convolutional kernels, the number of hidden units in the long short-term memory network, and the learning rate. Based on the uniform distribution of multiple sets of parameter combinations randomly generated within the range of the stated values, each set of parameter combinations is treated as a hyperparameter individual, thus generating an initial hyperparameter population containing multiple sets of hyperparameter individuals.
[0049] In an optional embodiment, the model building and training module iteratively updates the initial hyperparameter population using a quantum tunneling optimization algorithm based on the model training dataset until a preset termination condition is met to determine the globally optimal hyperparameter combination, including: Repeatedly perform iterative optimization operations until the preset termination condition is met, and determine the hyperparameter individual with the smallest barrier function value in the current hyperparameter population as the global optimal hyperparameter combination; The iterative optimization operation includes: For each hyperparameter individual in the current hyperparameter population, an initial fusion prediction model is configured using the current hyperparameter individual to generate the current fusion prediction model; wherein, the initial hyperparameter population is the initial hyperparameter population. The current hybrid prediction model is trained using the training set to generate the corresponding post-trained model; Calculate the mean absolute error of the trained model on the validation set, and generate the barrier function value of the current hyperparameter individual; Based on the barrier function values of each hyperparameter individual in the current hyperparameter population, determine the current optimal hyperparameter individual from the current hyperparameter population; For each hyperparameter individual in the current hyperparameter population, compare the barrier function value of the current hyperparameter individual with the barrier function value of the current best hyperparameter individual; If the barrier function value of the current hyperparameter individual is greater than that of the current best hyperparameter individual, then the preset tunneling triggering condition is met. The Euclidean distance between the position of the current hyperparameter individual and the position of the current best hyperparameter individual is calculated, and the tunneling probability is calculated based on the Euclidean distance and the barrier function value of the current hyperparameter individual. Based on the tunneling probability, the position of the current hyperparameter individual, the preset basic transition amplitude, and the preset barrier sensitivity coefficient, tunneling update is performed to generate the updated hyperparameter individual. If the barrier function value of the hyperparameter individual is less than or equal to the barrier function value of the current optimal hyperparameter individual, it is determined that the preset tunneling triggering condition is not met. The value of the barrier function gradient of the current optimal hyperparameter individual is calculated using the finite difference method, and gradient update is performed according to the position of the current optimal hyperparameter individual, the preset learning rate, and the value of the barrier function gradient to generate an updated hyperparameter individual. After every hyperparameter individual in the current hyperparameter population has been updated, the current hyperparameter population is updated based on the updated results of each hyperparameter individual.
[0050] It should be noted that the embodiments of the apparatus described above correspond to the embodiments of the present invention described above, and can realize the power system node carbon emission factor prediction method described in any one of the above embodiments of the present invention. Furthermore, the embodiments of the apparatus described above are merely illustrative. The modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. In addition, in the accompanying drawings of the apparatus embodiments provided by the present invention, the connection relationship between modules indicates that they have a communication connection, which can be specifically implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without creative effort.
[0051] Based on the above-described method embodiments of the present invention, a corresponding embodiment of an electronic device is provided.
[0052] An embodiment of the present invention provides an electronic device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the power system node carbon emission factor prediction method according to any one of the present invention, or, when the processor executes the computer program, it implements the functions of each module in the above-described device embodiments.
[0053] For example, the computer program may be divided into one or more modules, which are stored in the memory and executed by the processor to complete the present invention. The one or more modules may be a series of computer program instruction segments capable of performing specific functions, which describe the execution process of the computer program in the terminal device.
[0054] The terminal device may be a desktop computer, laptop, handheld computer, or cloud server, etc. The terminal device may include, but is not limited to, a processor and a memory.
[0055] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the terminal device, connecting all parts of the terminal device via various interfaces and lines.
[0056] The memory can be used to store the computer programs and / or modules. The processor implements various functions of the terminal device by running or executing the computer programs and / or modules stored in the memory and by calling data stored in the memory. The memory may mainly include a program storage area and a data storage area. The program storage area may store the operating system, applications required for at least one function, etc.; the data storage area may store data created based on the use of the mobile phone, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital card (SD card), flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0057] Based on the above method embodiments, the present invention provides corresponding storage medium embodiments; Another embodiment of the present invention provides a storage medium including a stored computer program, wherein, when the computer program is running, the device where the storage medium is located controls the execution of any of the above-described power system node carbon emission factor prediction methods of the present invention.
[0058] The aforementioned storage medium is a computer-readable storage medium, and the computer program includes computer program code, which may be in the form of source code, object code, executable file, or certain intermediate forms. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.
[0059] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of those different embodiments or examples.
[0060] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A method for predicting nodal carbon emission factors in a power system, characterized in that, include: Obtain real-time node load power data of the power system at the time to be predicted; Real-time node load power data is input into a preset node carbon emission factor prediction model to generate the power system node carbon emission factor prediction results for the time to be predicted. The training steps of the node carbon emission factor prediction model include: Obtain the model training dataset containing the training and validation sets in the power system; Construct an initial hybrid prediction model containing convolutional neural network layers and long short-term memory network layers; randomly generate an initial hyperparameter population containing multiple sets of hyperparameter individuals; The initial hyperparameter population is iteratively updated using the quantum tunneling optimization algorithm based on the model training dataset until a preset termination condition is met to determine the globally optimal hyperparameter combination. In each iteration, the initial hybrid prediction model configured by each hyperparameter individual in the current hyperparameter population is trained using the training set to obtain the trained model corresponding to the current hyperparameter individual. The mean absolute error of the trained model on the validation set is calculated as the barrier function value. Based on the barrier function value, the current optimal hyperparameter individual is determined from the current hyperparameter population. If the barrier function value meets the preset tunneling trigger condition, the tunneling probability is calculated based on the distance between the current position of the hyperparameter individual and the position of the current optimal hyperparameter individual, and tunneling update based on the tunneling probability is performed. If the barrier function value does not meet the tunneling trigger condition, gradient update based on the barrier function gradient is performed. An initial hybrid prediction model is configured using the globally optimal hyperparameter combination, and the model training dataset is used to train the initial hybrid prediction model configured using the globally optimal hyperparameter combination to generate a node carbon emission factor prediction model.
2. The method for predicting carbon emission factors at power system nodes as described in claim 1, characterized in that, Obtain the model training dataset from the power system, which includes both training and validation sets, including: Obtain historical electricity consumption data and historical energy type percentage data of the power system; Fit the probability distribution of historical electricity consumption data to generate an electricity consumption probability distribution; Fit the probability distribution of historical energy type proportion data to generate an energy proportion probability distribution; The number of samples is determined based on the probability distribution of electricity consumption and the probability distribution of energy share. Latin hypercube sampling is performed on the probability distribution of electricity consumption to divide the probability distribution of electricity consumption into equal probability intervals equal to the number of sampling samples. Sample points are randomly selected in each equal probability interval to generate a sequence of electricity consumption samples. Latin hypercube sampling is performed on the probability distribution of energy share to divide the probability distribution of energy share into equal probability intervals equal to the number of sampling samples, and sample points are randomly selected in each equal probability interval to generate an energy share sample sequence. The electricity consumption sample sequence and the energy proportion sample sequence are combined to construct a comprehensive sample matrix, and the comprehensive sample matrix is normalized to generate a normalized comprehensive sample matrix. The carbon emission values of each node in the power system are calculated based on the normalized comprehensive sample matrix. The normalized comprehensive sample matrix is used as the input feature, and the carbon emission value is used as the output label to integrate and generate the model training dataset. The model training dataset is divided into a training set and a validation set according to a preset division ratio.
3. The method for predicting carbon emission factors at power system nodes as described in claim 2, characterized in that, The carbon emission values of each node in the power system are calculated based on the normalized comprehensive sample matrix, including: The normalized comprehensive sample matrix is analyzed to obtain generator unit injected power data, load node injected power data, and energy type proportion sample data. The carbon emission intensity data of the generator node is determined based on the generator unit injected power data and the energy type proportion sample data. A node power injection matrix is constructed based on the generator set injected power data and the load node injected power data. Power system power flow calculation is then performed based on the node power injection matrix to generate the power flow distribution matrix of the power grid branches. Carbon flow tracing calculations are performed based on the carbon emission intensity data of generator nodes and the power flow distribution matrix of power grid branches to generate the node carbon potential distribution matrix of each node in the power system. The carbon emission values of each node in the power system are determined based on the node carbon potential distribution matrix.
4. The method for predicting carbon emission factors at power system nodes as described in claim 3, characterized in that, Construct an initial hybrid prediction model containing convolutional neural network layers and long short-term memory network layers; randomly generate an initial hyperparameter population containing multiple groups of individuals with hyperparameters, including: Construct a convolutional neural network layer, wherein the convolutional neural network layer includes an input layer, a convolutional layer, and a pooling layer; Construct a long short-term memory network layer, wherein the long short-term memory network layer includes an input gate, a forget gate, an output gate, and a cell state unit; Connect the output of the convolutional neural network layer to the input of the long short-term memory network layer; Determine the types of parameters to be optimized in the initial hybrid prediction model; among them, the types of parameters to be optimized include the number of convolutional kernels, the number of hidden units in the long short-term memory network, and the learning rate; Each parameter sets a range of values for the number of convolutional kernels, the number of hidden units in the long short-term memory network, and the learning rate. Based on the uniform distribution of multiple sets of parameter combinations randomly generated within the range of the stated values, each set of parameter combinations is treated as a hyperparameter individual, thus generating an initial hyperparameter population containing multiple sets of hyperparameter individuals.
5. The method for predicting carbon emission factors at power system nodes as described in claim 4, characterized in that, Based on the model training dataset, the initial hyperparameter population is iteratively updated using the quantum tunneling optimization algorithm until a preset termination condition is met to determine the globally optimal hyperparameter combination, including: Repeatedly perform iterative optimization operations until the preset termination condition is met, and determine the hyperparameter individual with the smallest barrier function value in the current hyperparameter population as the global optimal hyperparameter combination; The iterative optimization operation includes: For each hyperparameter individual in the current hyperparameter population, an initial fusion prediction model is configured using the current hyperparameter individual to generate the current fusion prediction model; wherein, the initial hyperparameter population is the initial hyperparameter population. The current hybrid prediction model is trained using the training set to generate the corresponding post-trained model; Calculate the mean absolute error of the trained model on the validation set, and generate the barrier function value of the current hyperparameter individual; Based on the barrier function values of each hyperparameter individual in the current hyperparameter population, determine the current optimal hyperparameter individual from the current hyperparameter population; For each hyperparameter individual in the current hyperparameter population, compare the barrier function value of the current hyperparameter individual with the barrier function value of the current best hyperparameter individual; If the barrier function value of the current hyperparameter individual is greater than that of the current best hyperparameter individual, then the preset tunneling triggering condition is met. The Euclidean distance between the position of the current hyperparameter individual and the position of the current best hyperparameter individual is calculated, and the tunneling probability is calculated based on the Euclidean distance and the barrier function value of the current hyperparameter individual. Based on the tunneling probability, the position of the current hyperparameter individual, the preset basic transition amplitude, and the preset barrier sensitivity coefficient, tunneling update is performed to generate the updated hyperparameter individual. If the barrier function value of the hyperparameter individual is less than or equal to the barrier function value of the current optimal hyperparameter individual, it is determined that the preset tunneling triggering condition is not met. The value of the barrier function gradient of the current optimal hyperparameter individual is calculated using the finite difference method, and gradient update is performed according to the position of the current optimal hyperparameter individual, the preset learning rate, and the value of the barrier function gradient to generate an updated hyperparameter individual. After every hyperparameter individual in the current hyperparameter population has been updated, the current hyperparameter population is updated based on the updated results of each hyperparameter individual.
6. The method for predicting carbon emission factors at power system nodes as described in claim 5, characterized in that, Calculate the Euclidean distance between the current hyperparameter individual's position and the position of the current optimal hyperparameter individual, and calculate the tunneling probability based on the Euclidean distance and the current hyperparameter individual's barrier function value; perform tunneling update based on the tunneling probability, the current hyperparameter individual's position, a preset base transition amplitude, and a preset barrier sensitivity coefficient to generate an updated hyperparameter individual, including: Calculate the Euclidean distance between the current position of the hyperparameter individual and the position of the current optimal hyperparameter individual, and generate the Euclidean distance value; Calculate the product of the Euclidean distance value and the current barrier function value of the hyperparameter individual to generate the barrier strength value; The barrier strength value is weighted using a preset barrier sensitivity coefficient, and the negative exponentiation of the natural exponent is performed on the weighted result to generate the tunneling probability. Generate a random-direction unit vector with the same dimension as the current hyperparameter individual; The actual tunneling step size is determined by multiplying the preset basic transition amplitude by the tunneling probability. The displacement correction vector is generated by scaling the random direction unit vector using the actual tunneling step length value. The displacement correction vector is superimposed with the current position of the hyperparameter individual to generate the updated hyperparameter individual.
7. The method for predicting carbon emission factors at power system nodes as described in claim 6, characterized in that, An initial hybrid prediction model is configured using the globally optimal hyperparameter combination, and the model training dataset is used to train the initial hybrid prediction model configured using the globally optimal hyperparameter combination to generate a node carbon emission factor prediction model, including: The number of convolutional kernels, the number of hidden units in the long short-term memory network, and the learning rate of the initial hybrid prediction model are determined based on the globally optimal combination of hyperparameters, and a hybrid prediction model to be trained is generated. According to the preset batch size, the training set in the model training dataset is divided into several batches of training sequence samples; The training sequence samples of each batch are sequentially input into the mixed prediction model to be trained, and iterative training is performed until the preset training iteration termination condition is met. In each iteration, the hybrid prediction model to be trained performs time-series feature extraction and regression prediction calculation on the current batch of training sequence samples to generate node carbon emission factor prediction results. The prediction error between the predicted carbon emission factor of a node and the carbon emission value corresponding to the current batch of training sequence samples is calculated using a preset loss function, and a loss function value is generated. The preset Adam optimization algorithm is then used to perform backpropagation updates on the network weight parameters of the hybrid prediction model to be trained based on the loss function value.
8. A device for predicting carbon emission factors at power system nodes, characterized in that, include: Data acquisition module, prediction generation module, and model building and training module; The data acquisition module is used to acquire real-time node load power data of the power system at the time to be predicted. The prediction generation module is used to input real-time node load power data into a preset node carbon emission factor prediction model to generate the power system node carbon emission factor prediction result at the time to be predicted. The model building and training module is used to acquire a model training dataset containing a training set and a validation set in the power system; construct an initial hybrid prediction model containing convolutional neural network layers and long short-term memory network layers; randomly generate an initial hyperparameter population containing multiple sets of hyperparameter individuals; and perform iterative updates on the initial hyperparameter population using the quantum tunneling optimization algorithm based on the model training dataset until a preset termination condition is met to determine the globally optimal hyperparameter combination; wherein, in each iteration, the initial hybrid prediction model configured by each hyperparameter individual in the current hyperparameter population is trained using the training set to obtain the trained model corresponding to the current hyperparameter individual; The mean absolute error of the trained model on the validation set is calculated as the barrier function value. Based on the barrier function value, the current optimal hyperparameter individual is determined from the current hyperparameter population. If the barrier function value meets the preset tunneling triggering condition, the tunneling probability is calculated based on the distance between the current position of the hyperparameter individual and the position of the current optimal hyperparameter individual, and tunneling update based on the tunneling probability is performed. If the barrier function value does not meet the tunneling triggering condition, gradient update based on the barrier function gradient is performed. An initial hybrid prediction model is configured using the globally optimal hyperparameter combination, and the initial hybrid prediction model configured using the globally optimal hyperparameter combination is trained using the model training dataset to generate a node carbon emission factor prediction model.
9. An electronic device, characterized in that, The method includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor, when executing the computer program, implements the power system node carbon emission factor prediction method as described in any one of claims 1 to 7.
10. A storage medium, characterized in that, The storage medium includes a stored computer program, wherein, when the computer program is executed, it controls the device containing the storage medium to perform the power system node carbon emission factor prediction method as described in any one of claims 1 to 7.