Electricity consumption prediction method and device based on artificial intelligence and Bayes correction
By combining artificial intelligence and Bayes correction methods, the accuracy and credibility of electricity consumption prediction have been gradually improved, and the challenges of electricity enterprises in electricity consumption prediction have been solved and more reliable decision-making references are provided.
Patent Information
- Application Number
- CN202510315784.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-18
- Publication Date
- 2025-04-18
AI Technical Summary
How to accurately predict electricity consumption to support the strategic decisions of power companies and medium- and long-term planning of power systems.
The power consumption prediction method based on artificial intelligence and Bayes correction is adopted, and the accuracy and credibility of power consumption prediction are gradually improved through gray neural network training, particle swarm optimization algorithm optimization, Markov chain model correction and Bayes method dynamic correction.
It has achieved the improvement of the accuracy and credibility of electricity consumption prediction, provided more reliable reference data for the decision-making of power enterprises, and improved the planning and operation stability of the power system.
Smart Images

Figure CN119850252A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information security technology, and in particular to a method and device for predicting power consumption based on artificial intelligence and Bayes correction. Background Art
[0002] With the development of power technology and the deepening of smart grid construction, the accurate prediction of medium- and long-term electricity consumption in a certain power consumption area plays an increasingly important role in the strategic decision-making and deployment of power companies related to the area.
[0003] For power sales entities, accurate regional power consumption forecast results are conducive to guiding them to carry out business activities in the power market in the region under the spot power market mechanism, and provide effective decision-making reference for their related investment activities. For power grid companies, accurate regional power consumption forecast results can provide security for the medium- and long-term planning and reliable and stable operation of the power system in the region.
[0004] Therefore, how to accurately predict electricity consumption is a technical problem to be solved in this field. Summary of the invention
[0005] The present invention provides a method and device for predicting electricity consumption based on artificial intelligence and Bayes correction, which can solve at least one of the above technical problems.
[0006] According to one aspect of the present invention, there is provided a method for predicting power consumption based on artificial intelligence and Bayes correction, comprising: Determine a historical power consumption sequence and a historical power consumption related data sequence based on a first historical power consumption in a first power consumption area at a first historical time and first historical power consumption related data; Based on the historical power consumption sequence and the historical power consumption related data sequence, a grey neural network is trained to obtain a first power consumption prediction model for the first power consumption area; Based on the improved particle swarm optimization algorithm, the model parameters of the first power consumption prediction model are optimized to obtain a second power consumption prediction model; The second power consumption prediction model is used to process the first power consumption related data of the first power consumption area at the first time to obtain a first power consumption point prediction value of the first power consumption area at the first time; Using an improved Markov chain model, the first power consumption point prediction value is corrected to obtain a first predicted power consumption interval of the first power consumption area at the first time and a probability of belonging to the first predicted power consumption interval; Using the Bayes method, an error term is estimated for the error value between the first power consumption point prediction value and the corresponding actual power consumption, and based on the estimated error term, a second predicted power consumption interval determined based on the prior distribution is dynamically corrected to obtain a third predicted power consumption interval; Based on the first power consumption point prediction value, the first predicted power consumption interval and the probability of belonging to the first predicted power consumption interval, and the third predicted power consumption interval, a power consumption prediction result of the first power consumption area at the first time is determined.
[0007] According to another aspect of the present invention, there is provided a power consumption prediction device based on artificial intelligence and Bayes correction, comprising: A sequence determination module, configured to determine a historical power consumption sequence and a historical power consumption related data sequence based on a first historical power consumption in a first power consumption area at a first historical time and first historical power consumption related data; A model training module, used for training a grey neural network based on the historical power consumption sequence and the historical power consumption related data sequence to obtain a first power consumption prediction model for the first power consumption area; A model optimization module, configured to optimize the model parameters of the first power consumption prediction model based on an improved particle swarm optimization algorithm to obtain a second power consumption prediction model; A power consumption point prediction module, configured to use the second power consumption prediction model to process the first power consumption related data of the first power consumption area at the first time, and obtain a first predicted power consumption point prediction value of the first power consumption area at the first time; A first interval estimation module, configured to use an improved Markov chain model to correct the first power consumption point prediction value, and obtain a first predicted power consumption interval of a first power consumption area at a first time and a probability of belonging to the first predicted power consumption interval; A second interval estimation module is used to use the Bayes method to estimate the error term of the error value between the first power consumption point prediction value and the corresponding actual power consumption, and based on the estimated error term, dynamically correct the second predicted power consumption interval determined based on the prior distribution to obtain a third predicted power consumption interval; A prediction result determination module is used to determine the power consumption prediction result of the first power consumption area at the first time based on the first power consumption point prediction value, the first predicted power consumption interval and the probability of belonging to the first predicted power consumption interval, and the third predicted power consumption interval.
[0008] By adopting the technical solution of the present invention, based on the first historical power consumption of the first power consumption area at the first historical time and the first historical power consumption related data, the historical power consumption sequence and the historical power consumption related data sequence are determined; based on the historical power consumption sequence and the historical power consumption related data sequence, the gray neural network is trained to obtain the first power consumption prediction model of the first power consumption area; based on the improved particle swarm optimization algorithm, the model parameters of the first power consumption prediction model are optimized to obtain the second power consumption prediction model; using the second power consumption prediction model, the first power consumption related data of the first power consumption area at the first time are processed to obtain the first power consumption point prediction value of the first power consumption area at the first time. In this way, the particle swarm algorithm can be used to optimize the model parameters in the trained power consumption prediction model, extract the accuracy of the power consumption prediction model, and improve the accuracy of power consumption prediction.
[0009] Subsequently, the improved Markov chain model is used to correct the first power consumption point prediction value, and the first predicted power consumption interval and the probability of belonging to the first predicted power consumption interval of the first power consumption area at the first time are obtained; the Bayes method is used to estimate the error term of the error value between the first power consumption point prediction value and its corresponding actual power consumption, and based on the estimated error term, the second predicted power consumption interval determined based on the prior distribution is dynamically corrected to obtain the third predicted power consumption interval; based on the first power consumption point prediction value, the first predicted power consumption interval and the probability of belonging to the first predicted power consumption interval, and the third predicted power consumption interval, the power consumption prediction result of the first power consumption area at the first time is determined. In this way, the credibility of the prediction result is further increased, and accurate reference data of power consumption point prediction value and power consumption prediction interval are provided for power decision-making.
[0010] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The accompanying drawings are used to better understand the present invention and do not constitute a limitation of the present invention. Figure 1 It is a flow chart of a method for predicting power consumption based on artificial intelligence and Bayes correction according to an embodiment of the present invention; Figure 2 is a schematic diagram of a neural network according to an embodiment of the present invention; Figure 3 is a flow chart of a method for predicting power consumption according to another embodiment of the present invention; Figure 4 It is a structural block diagram of a power consumption prediction device based on artificial intelligence and Bayes correction according to an embodiment of the present invention; Figure 5 The block diagram is a block diagram of an electronic device for implementing the method according to the embodiment of the present invention. DETAILED DESCRIPTION
[0012] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be appreciated by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope of the present invention. Similarly, for clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0013] Figure 1 It is a flow chart of a method for predicting electricity consumption based on artificial intelligence and Bayes correction according to an embodiment of the present invention.
[0014] like Figure 1 As shown, the power consumption prediction method based on artificial intelligence and Bayes correction may include: S110, determining a historical power consumption sequence and a historical power consumption related data sequence based on a first historical power consumption of a first power consumption area at a first historical time and first historical power consumption related data; S120, training a grey neural network based on a historical power consumption sequence and a historical power consumption related data sequence to obtain a first power consumption prediction model for a first power consumption area; S130, optimizing the model parameters of the first power consumption prediction model based on the improved particle swarm optimization algorithm to obtain a second power consumption prediction model; S140, using a second power consumption prediction model to process first power consumption related data of a first power consumption area at a first time, to obtain a first power consumption point prediction value of the first power consumption area at a first time; S150, using an improved Markov chain model to correct the predicted value of the first power consumption point, to obtain a first predicted power consumption interval of the first power consumption area at the first time and a probability of belonging to the first predicted power consumption interval; S160, using the Bayes method, estimating an error term for the error value between the first power consumption point prediction value and the corresponding actual power consumption, and dynamically correcting the second predicted power consumption interval determined based on the prior distribution based on the estimated error term to obtain a third predicted power consumption interval; S170, determining a power consumption prediction result of a first power consumption area at a first time based on the first power consumption point prediction value, the first predicted power consumption interval and the probability of belonging to the first predicted power consumption interval, and the third predicted power consumption interval.
[0015] According to the above implementation, based on the first historical power consumption of the first power consumption area at the first historical time and the first historical power consumption related data, determine the historical power consumption sequence and the historical power consumption related data sequence; based on the historical power consumption sequence and the historical power consumption related data sequence, train the gray neural network to obtain the first power consumption prediction model of the first power consumption area; based on the improved particle swarm optimization algorithm, optimize the model parameters of the first power consumption prediction model to obtain the second power consumption prediction model; use the second power consumption prediction model to process the first power consumption related data of the first power consumption area at the first time to obtain the first power consumption point prediction value of the first power consumption area at the first time. In this way, the particle swarm algorithm can be used to optimize the model parameters in the trained power consumption prediction model to improve the precision and accuracy of the point prediction results of the power consumption prediction model. At the same time, the improved Markov chain model is used to correct the predicted value of the first power consumption point, and the first predicted power consumption interval and the probability of belonging to the first predicted power consumption interval of the first power consumption area at the first time are obtained. The Bayes method is used to estimate the error term of the error value between the predicted value of the first power consumption point and its corresponding actual power consumption, and based on the estimated error term, the second predicted power consumption interval determined based on the prior distribution is dynamically corrected to obtain the third predicted power consumption interval. In this way, combining the Markov chain and Bayes interval estimation method, the prediction error distribution of the power consumption point prediction results and the interval estimation results of the predicted values can be obtained, which further enhances the credibility of the prediction results and provides accurate reference data for subsequent power decisions.
[0016] In one embodiment, in the above step S120, the gray neural network is trained based on the historical power consumption sequence and the historical power consumption related data sequence to obtain the first power consumption prediction model for the first power consumption area, which may include: determining the gray correlation between the historical power consumption sequence and each power consumption influencing factor based on the historical power consumption sequence and the historical power consumption related data sequence, wherein the historical power consumption related data sequence includes multiple data sequences, and each data sequence corresponds to one power consumption influencing factor; based on the gray correlation between the historical power consumption sequence and each power consumption influencing factor, multiple main power consumption influencing factors are determined among each power consumption influencing factor; based on the historical power consumption related data sequence corresponding to each of the main power consumption influencing factors, and the historical power consumption sequence, the gray neural network is trained to obtain the first power consumption prediction model for the first power consumption area.
[0017] For example, Figure 2 As shown, the first historical power consumption at the first historical time is used as a reference sequence to construct a corresponding historical power consumption sequence, for example: .
[0018] Exemplarily, the first historical power consumption related data includes historical data of multiple different power consumption influencing factors, and the historical data of each factor is used to construct a comparison sequence, that is, a historical power consumption related data sequence. For example, the comparison sequence is , is the total number of factors affecting electricity consumption.
[0019] Exemplarily, for the above-mentioned reference sequence and comparison sequence, dimensionless processing is adopted to reduce the absolute numerical difference of the data through averaging and focus on its changes and trends.
[0020] For example, the reference sequence Compare with each sequence The correlation coefficient It can be expressed as: ; in, is the resolution coefficient, ranging from [0,1].
[0021] For example, and Grey relational degree It can be expressed as: ; It can be understood that the grey relationship degree can measure the degree of association between each influencing factor and the main behavioral factor, and then the main influencing factors can be screened out by sorting. Using the data of the main influencing factors to train the model can improve the accuracy of the model and improve the prediction accuracy of electricity consumption.
[0022] During model training, the Gray Neural Network Model (GNNM) maps the whitening equation of the gray model to the BP neural network training, and continuously corrects the weights through the reverse error conduction of the neural network. When the network reaches the set accuracy convergence, the weight coefficients of each connection are extracted from it, and each parameter is calculated according to the corresponding relationship to obtain a better whitening differential equation, and this differential equation is used to predict the future behavior of the system.
[0023] In this example, in order to improve learning and optimization performance, a prediction model IPSO-GNNM based on the improved particle swarm optimization (IPSO) algorithm and the grey neural network is proposed. The following improvement strategies are mainly introduced: 1) A nonlinear dynamic adjustment strategy is adopted for the inertia weight ω of the algorithm to effectively balance the global and local search capabilities of the algorithm; 2) In order to avoid the algorithm from falling into the dilemma of local optimality in the later iteration, a mutation crossover operation is introduced to update the position of the particles, which increases the diversity of the particle population in the later iteration and improves the possibility of the algorithm jumping out of the local optimality.
[0024] In one embodiment, based on the historical power consumption related sequences corresponding to each main influencing factor of power consumption and the historical power consumption sequence, a gray neural network is trained to obtain a first power consumption prediction model for the first power consumption area, including: determining a historical variable sequence based on the historical power consumption related sequences corresponding to each main influencing factor of power consumption and the historical power consumption sequence; performing an accumulation operation on the historical variable sequence to obtain an accumulation sequence; constructing a differential equation based on the number of multiple main influencing factors of power consumption and the accumulation sequence; solving the differential equation to obtain an approximate time response formula; determining the topological structure of the gray neural network based on the number of multiple main influencing factors of power consumption; mapping the approximate time response formula to the gray neural network corresponding to the topological structure, and training the gray neural network to obtain the first power consumption prediction model.
[0025] For example, the historical variable sequence is .in, represents the variable to be predicted, ,…, are the historical electricity consumption related sequences corresponding to the main influencing factors of electricity consumption.
[0026] Exemplarily, an accumulation operation is performed on the historical variable sequence to obtain an accumulation sequence as follows: .
[0027] Exemplarily, according to the number of main influencing factors, a differential equation is constructed as follows: .
[0028] Exemplarily, the differential equation is solved to obtain the approximate time response as follows: .
[0029] For example, the GNNM network structure topology is determined according to the number of influencing factors. Figure 2As shown, the GNNM network has 4 layers, including L1 to L4, the number of hidden units in the middle layer is N-1, and the network topology diagram of GNNM.
[0030] like Figure 3 As shown, k is the input parameter of the network.
[0031] like Figure 3 As shown, is the weight of each layer of GNNM, It is the threshold of the network layer L4; is the input variable of the network; The fitted values of the target forecast series.
[0032] For example, the above approximate time response formula is mapped to the above GNNM neural network, and the GNNM neural network is trained, and the network connection weights are continuously adjusted through back propagation to determine the parameter sequence to be determined. The specific mapping operations are as follows: make , the above approximate time response formula requires Make the following transformations: .
[0033] Map the formula obtained by the above transformation to the GNNM network to obtain the training weights of the network as follows: ; in, .
[0034] From the calculation formula of the above training weights, we can see that the three weights of GNNM are only related to the parameter sequence Related.
[0035] The following introduces the parameter list combined with the IPSO algorithm An example of pre-optimization. Thus, the weight values of GNNM are assigned and initialized based on the optimization results, making the output results of the GNNM network more stable.
[0036] In one embodiment, based on the improved particle swarm optimization algorithm, the model parameters of the first power consumption prediction model are optimized to obtain the second power consumption prediction model, including: determining the initial position and initial speed of each particle in the initial population based on the model parameters of the first power consumption prediction model, wherein the initial position represents the model parameter to be optimized; performing the following iterative operations starting from the initial population: determining the fitness of each particle in the current iteration population based on the model prediction error corresponding to the model parameter corresponding to each particle in the current iteration population; updating the optimal individual fitness based on the fitness of each particle in the current iteration population; When the optimal individual fitness does not meet the preset fitness conditions, the particle inertia weight is updated based on the number of population iterations, and the speed of each particle in this iteration population is updated based on the updated particle inertia weight, and the position of each particle in this iteration population is updated based on the updated speed of each particle in this iteration population by using a differential mutation operation to obtain the next iteration population; when the optimal individual fitness meets the preset fitness conditions, the target model parameters are determined based on the position of the particle corresponding to the optimal individual fitness, and the second power consumption prediction model is determined based on the target model parameters.
[0037] For example, Figure 2 As shown, the normal distribution initialization operation is used to initialize the IPSO parameters, including: scale N, maximum number of iterations , the particle's dimension D, the particle's initial position and initial velocity wait.
[0038] Exemplarily, the initial state of the particle is determined by the following operation. Indicates the parameter column to be optimized. In this example, the parameter column is .
[0039] For example, the optimal value is updated cyclically, and the fitness value of all particles in the population and the optimal value of the population are calculated. Compare the fitness value of the particle and the individual optimal value and replace it with a better one.
[0040] Exemplarily, the particle inertia weight is updated as follows. , Represent the maximum and minimum values of the inertia weight respectively, t represents the number of iterations, Indicates the maximum number of iterations. Details are as follows: .
[0041] Exemplarily, the particle velocity is updated as follows: ; in, and is the learning factor of the algorithm, for example, the value is 1.5. and are two random numbers that are uniformly distributed on [0,1].
[0042] For example, initialize a random individual ,in ; And use the differential mutation operation to determine whether the particle position needs to be updated, as follows: ; Wherein, F is a scaling factor, for example, a value of 0.5. is the crossover probability, for example, =0.1. rand is a random number in [0,1].
[0043] In this example, when rand is less than the crossover probability When , the mutation operation is used to update the particle position; when rand is greater than the crossover probability The position of the particle remains unchanged.
[0044] Exemplarily, the particle state is updated using the updated particle position and particle velocity as follows: .
[0045] This cycle is repeated to determine whether the termination condition is met. If so, the parameters corresponding to the optimal individual fitness are output; if not, the cycle continues.
[0046] For example, after the above iterative optimization, the target parameters are listed as follows: . Using this parameter column, the weights and thresholds of each layer of the GNNM network layer can be further optimized.
[0047] According to the above implementation, on the basis of the basic particle swarm optimization algorithm (PSO), the mutation and crossover operations in the differential evolution algorithm are introduced, and the nonlinear reduction strategy of the inertia weight is combined, and the initial threshold and weight of the grey neural network model (GNNM) are optimized based on the improved particle swarm optimization algorithm (IPSO), thereby improving the accuracy of the electricity consumption prediction model.
[0048] In one embodiment, determining a second power consumption prediction model based on target model parameters also includes: determining a corresponding third power consumption prediction model based on the target model parameters; determining a prediction error of each network layer based on the prediction results of each network layer in the third power consumption prediction model; adjusting the weights and thresholds of each network layer based on the prediction errors of each network layer; and determining a second power consumption prediction model based on the adjusted third power consumption prediction model when the accuracy of the adjusted third power consumption prediction model meets preset accuracy conditions.
[0049] For example, Figure 2 As shown in the figure, the target model parameters optimized by the particle swarm optimization algorithm are used to calculate the output of each layer of the GNNM network. The details are as follows: L2 layer: ; L3 layer: ; L4 layer: .
[0050] Exemplarily, the error of each layer is determined according to the fitted value and the true value output by each layer of the GNNM network, as follows: The L2 layer error is: ; The L3 layer error is: ; The L4 layer error is: .
[0051] For example, according to the errors of each layer, the weights and thresholds of each layer of the network are adjusted inversely. The details are as follows: Update formula: ; Update formula: ; and so on, Update formula: .in, Update formula: .
[0052] The threshold update formula is: .
[0053] In one embodiment, in the above step S150, an improved Markov chain model is used to correct the predicted value of the first electricity consumption point to obtain the first predicted electricity consumption interval of the first electricity consumption area at the first time and the probability of belonging to the first predicted electricity consumption interval, including: based on the second electricity consumption prediction model, the electricity consumption is predicted for the second historical electricity consumption related data of the first electricity consumption area at the second historical time, and the fitted electricity consumption of the first electricity consumption area at the second historical time is obtained, wherein the second historical time is continuous with the first time and is earlier than the first time; based on the second historical electricity consumption and the fitted electricity consumption of the first power consumption area at the second historical time, a state transition probability matrix is determined; based on the state transition probability matrix and the first electricity consumption related data at the first time, the probability of belonging to the first predicted electricity consumption interval and the first predicted electricity consumption interval of the first power consumption area at the first time is determined.
[0054] From the above examples, we can see that the second electricity consumption prediction model can obtain relatively accurate "point prediction" results. However, the factors affecting electricity consumption are becoming increasingly complex and diverse, and show obvious volatility. In actual operation, accurate "point prediction" results are difficult to meet the needs of electricity consumption-related decision-making in a dynamic environment. To this end, an improved Markov chain model is constructed. First, define the fitting accuracy index sequence To reflect the degree of deviation of the fitted value from the original sequence, as follows: ; in, Represents the original value of the power consumption series, Represents the fitted value of the electricity consumption sequence. This sequence can represent the dynamic time-varying situation of the indicator sequence in the historical electricity consumption. Its changing trend shows the characteristics of a non-stationary random process. Combined with the Markov chain's no aftereffect, it can effectively handle the random fluctuations of the sequence. By dividing the sequence into states and finding the range of each value in the relative value sequence, a Markov chain model can be constructed for the relative value sequence to correct the results of the point prediction.
[0055] For example, in view of the shortcoming that the data source of the traditional grey-Markov model transfer matrix is fixed, this example adopts the method of sliding transfer probability matrix, removes the earliest data in the sequence during the prediction process, and supplements it with the latest data to update the state transfer matrix. For example, when predicting the state of t+1, remove the first state value and add the state value of the predicted object t to obtain a new 1-step state transfer matrix, and then use the state of the predicted object t as the initial state to find the state of t+1. Since the various states of the predicted object t have their own probabilities, the states of various probabilities are regarded as the state values of t, and the probabilities of being in various states are regarded as corresponding weights, and a new 1-step probability transfer matrix is constructed with this state value.
[0056] For example, using represents the initial distribution of the prediction object at time 1 in state i with probability 1, represents the sliding 1-step state probability matrix when the predicted object is in state i, then the state probability distribution of the predicted object at time 2 is: .
[0057] According to the above implementation mode, combined with the improved Markov chain model, the point prediction result of electricity consumption is corrected to obtain the predicted electricity consumption interval corresponding to the predicted electricity consumption and the probability of the interval, which provides a more flexible reference space for making relevant power dispatching decisions based on electricity consumption.
[0058] In this example, since the improved Markov chain model is only based on the correction of the predicted value, it does not provide a credible interval that includes the true value, which is also not conducive to the prediction of power consumption and related power dispatch with regional individual preferences and adapting to dynamic environmental changes. At the same time, due to the influence of other unpredictable factors, the prediction error of the model will also have a certain degree of random volatility.
[0059] To this end, this example further performs Bayes analysis on the power consumption prediction results: It is regarded as a random variable, and the final prediction result of the second electricity consumption prediction model is dynamically corrected through the Bayes method suitable for small sample estimation.
[0060] Exemplarily, the error vector of the prediction result obtained by the second power consumption prediction model (IPSO-GNNM) is recorded as ,in Normal distribution . Further, its mean With standard deviation Make an estimate.
[0061] For example, assuming The prior distribution of , and It can be estimated through historical sample data. and , first use the second type of maximum likelihood estimation method (ML-Ⅱ) to get The value of Estimating random variables in the case of , and finally the modified confidence interval is obtained based on the distribution function obtained by Bayes estimation.
[0062] Exemplarily, there are n prediction error samples, and the density function of the samples is expressed as: .
[0063] Depend on The prior distribution of , combined with the above formula, the marginal distribution likelihood function can be obtained as follows: ; In the above formula, , .
[0064] make , then the ML-Ⅱ method is used to Taking the derivative and setting it equal to zero, we get the following likelihood equation: .
[0065] Solving the above likelihood equation, we get ML-Ⅱ estimation , as follows: .
[0066] Further, and The joint density function is as follows: .
[0067] Depend on is known, then The posterior distribution of can be expressed as follows: .
[0068] In the above formula, , . We can further obtain Bayesian estimation of , as follows: .
[0069] Figure 4 It is a structural block diagram of an electricity consumption prediction device based on artificial intelligence and Bayes correction according to an embodiment of the present invention.
[0070] like Figure 4 As shown, the power consumption prediction device based on artificial intelligence and Bayes correction may include: A sequence determination module 510, configured to determine a historical power consumption sequence and a historical power consumption related data sequence based on a first historical power consumption in a first power consumption area at a first historical time and first historical power consumption related data; A model training module 520, configured to train a grey neural network based on the historical power consumption sequence and the historical power consumption related data sequence to obtain a first power consumption prediction model for the first power consumption area; A model optimization module 530, configured to optimize the model parameters of the first power consumption prediction model based on an improved particle swarm optimization algorithm to obtain a second power consumption prediction model; The power consumption point prediction module 540 is used to use the second power consumption prediction model to process the first power consumption related data of the first power consumption area at the first time to obtain a first predicted power consumption point prediction value of the first power consumption area at the first time.
[0071] A first interval estimation module 550 is used to modify the first power consumption point prediction value by using an improved Markov chain model to obtain a first predicted power consumption interval of a first power consumption area at a first time and a probability of belonging to the first predicted power consumption interval; The second interval estimation module 560 is used to use the Bayes method to estimate the error term of the error value between the first power consumption point prediction value and the corresponding actual power consumption, and based on the estimated error term, dynamically correct the second predicted power consumption interval determined based on the prior distribution to obtain a third predicted power consumption interval; The prediction result determination module 570 is used to determine the power consumption prediction result of the first power consumption area at the first time based on the first power consumption point prediction value, the first predicted power consumption interval and the probability of belonging to the first predicted power consumption interval, and the third predicted power consumption interval.
[0072] In one embodiment, the model training module 520 includes: A grey correlation calculation unit, configured to determine the grey correlation between the historical power consumption sequence and each power consumption influencing factor based on the historical power consumption sequence and the historical power consumption related data sequence, wherein the historical power consumption related data sequence includes a plurality of data sequences, each of which corresponds to one of the power consumption influencing factors; A main factor determination unit, configured to determine a plurality of main power consumption influencing factors from among the power consumption influencing factors based on the grey correlation between the historical power consumption sequence and each of the power consumption influencing factors; The model training unit is used to train the grey neural network based on the historical power consumption related data sequences corresponding to each of the main power consumption influencing factors and the historical power consumption sequence to obtain the first power consumption prediction model of the first power consumption area.
[0073] In one embodiment, the model training unit includes: A variable sequence determination unit, configured to determine a historical variable sequence based on the historical power consumption related sequences corresponding to the main power consumption influencing factors and the historical power consumption sequence; An accumulation sequence determination unit, used for performing an accumulation operation on the historical variable sequence to obtain an accumulation sequence; A differential equation determination unit, configured to construct a differential equation based on the number of the plurality of main influencing factors of power consumption and the 1-time accumulation sequence; An equation solving unit, used for solving the differential equation to obtain an approximate time response equation; A network topology determination unit, configured to determine a topology structure of a grey neural network based on the number of the plurality of main influencing factors of the power consumption; A mapping training unit is used to map the approximate time response formula to a grey neural network corresponding to the topological structure, and train the grey neural network to obtain the first power consumption prediction model.
[0074] In one embodiment, the model optimization module 530 includes: an initialization unit, configured to determine an initial position and an initial velocity of each particle in an initial population based on a model parameter of the first power consumption prediction model, wherein the initial position represents a model parameter to be optimized; A population iteration unit is used to perform the following iterative operations starting from the initial population: Determining the fitness of each particle in the current iteration population based on the model prediction error corresponding to the model parameter corresponding to each particle in the current iteration population; Based on the fitness of each particle in this iteration population, update the optimal individual fitness; When the optimal individual fitness does not meet the preset fitness condition, based on the number of population iterations, the particle inertia weight is updated, and based on the updated particle inertia weight, the speed of each particle in this iteration population is updated, and the position of each particle in this iteration population is updated based on the updated speed of each particle in this iteration population by using a differential mutation operation, so as to obtain the next iteration population; When the optimal individual fitness meets the preset fitness condition, the target model parameters are determined based on the position of the particle corresponding to the optimal individual fitness, and the second power consumption prediction model is determined based on the target model parameters.
[0075] In one implementation, the determining the second power consumption prediction model based on the target model parameters further includes: Based on the target model parameters, determining a corresponding third power consumption prediction model; Determining prediction errors of each network layer based on prediction results of each network layer in the third power consumption prediction model; Based on the prediction errors of each of the network layers, adjusting the weights and thresholds of each of the network layers; When the accuracy of the adjusted third power consumption prediction model meets the preset accuracy condition, the second power consumption prediction model is determined based on the adjusted third power consumption prediction model.
[0076] In one implementation, the first interval estimation module 550 includes: a fitting value determination unit, configured to perform power consumption prediction on second historical power consumption related data of the first power consumption area at a second historical time based on a second power consumption prediction model, to obtain a fitting power consumption of the first power consumption area at the second historical time, wherein the second historical time is continuous with the first time and earlier than the first time; a matrix determination unit, configured to determine a state transition probability matrix based on a second historical power consumption of the first power consumption area at the second historical time and the fitted power consumption; A prediction interval determination module is used to determine the first predicted power consumption interval and the probability of belonging to the first predicted power consumption interval of the first power consumption area at the first time based on the state transition probability matrix and the first power consumption related data at the first time.
[0077] For the description of specific functions and examples of each module and submodule of the system in the embodiment of the present invention, reference can be made to the relevant description of the corresponding steps in the above method embodiment, which will not be repeated here.
[0078] In the technical solution of the present invention, the acquisition, storage and application of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0079] According to an embodiment of the present invention, the present invention also provides a system and a readable storage medium.
[0080] Figure 5 A schematic block diagram of an example electronic device 800 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable 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 present invention described and / or required herein.
[0081] like Figure 5As shown, the electronic device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 to a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the device 800 can also be stored. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0082] Multiple components in the electronic device 800 are connected to the I / O interface 805, including: an input unit 806, such as a keyboard, a mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a disk, an optical disk, etc.; and a communication unit 809, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 809 allows the device 800 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0083] The computing unit 801 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 801 performs the various methods and processes described above, such as a power consumption prediction method based on artificial intelligence and Bayes correction. For example, in some embodiments, the power consumption prediction method based on artificial intelligence and Bayes correction may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 808. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 800 via the ROM 802 and / or the communication unit 809. When the computer program is loaded into the RAM 803 and executed by the computing unit 801, one or more steps of the power consumption prediction method based on artificial intelligence and Bayes correction described above may be performed. Alternatively, in other embodiments, the computing unit 801 may be configured to execute the power consumption prediction method based on artificial intelligence and Bayes correction in any other appropriate manner (for example, by means of firmware).
[0084] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0085] The program code for implementing the method of the present invention can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code can be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or server.
[0086] In the context of the present invention, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer 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 of the foregoing.
[0087] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0088] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0089] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0090] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution disclosed in the present invention can be achieved, and this document does not limit this.
[0091] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for predicting power consumption based on artificial intelligence and Bayesian correction, characterized in that: include: Determine a historical power consumption sequence and a historical power consumption related data sequence based on a first historical power consumption in a first power consumption area at a first historical time and first historical power consumption related data; Based on the historical power consumption sequence and the historical power consumption related data sequence, a grey neural network is trained to obtain a first power consumption prediction model for the first power consumption area; Based on the improved particle swarm optimization algorithm, the model parameters of the first power consumption prediction model are optimized to obtain a second power consumption prediction model; The second power consumption prediction model is used to process the first power consumption related data of the first power consumption area at the first time to obtain a first power consumption point prediction value of the first power consumption area at the first time; Using an improved Markov chain model, the first power consumption point prediction value is corrected to obtain a first predicted power consumption interval of the first power consumption area at the first time and a probability of belonging to the first predicted power consumption interval; Using the Bayes method, an error term is estimated for the error value between the first power consumption point prediction value and the corresponding actual power consumption, and based on the estimated error term, a second predicted power consumption interval determined based on the prior distribution is dynamically corrected to obtain a third predicted power consumption interval; Based on the first power consumption point prediction value, the first predicted power consumption interval and the probability of belonging to the first predicted power consumption interval, and the third predicted power consumption interval, a power consumption prediction result of the first power consumption area at the first time is determined.
2. The method according to claim 1, characterized in that The step of training a grey neural network based on the historical power consumption sequence and the historical power consumption related data sequence to obtain a first power consumption prediction model for the first power consumption area includes: Based on the historical power consumption sequence and the historical power consumption related data sequence, determine the grey correlation between the historical power consumption sequence and each power consumption influencing factor, wherein the historical power consumption related data sequence includes multiple data sequences, and each of the data sequences corresponds to one of the power consumption influencing factors; Based on the grey correlation between the historical power consumption sequence and each of the power consumption influencing factors, a plurality of main power consumption influencing factors are determined from among the power consumption influencing factors; Based on the historical power consumption related data sequences corresponding to each of the main power consumption influencing factors and the historical power consumption sequence, a grey neural network is trained to obtain a first power consumption prediction model for the first power consumption area.
3. The method according to claim 2, characterized in that The method of training a grey neural network based on the historical power consumption related sequences corresponding to the main power consumption influencing factors and the historical power consumption sequences to obtain a first power consumption prediction model for the first power consumption area includes: Determine a historical variable sequence based on the historical power consumption related sequences corresponding to the main power consumption influencing factors and the historical power consumption sequence; Performing an accumulation operation on the historical variable sequence to obtain an accumulation sequence; Constructing a differential equation based on the number of the multiple main influencing factors of power consumption and the 1st cumulative sequence; Solving the differential equation to obtain an approximate time response formula; Determining a topological structure of a grey neural network based on the number of the plurality of main influencing factors of the power consumption; The approximate time response formula is mapped to a grey neural network corresponding to the topological structure, and the grey neural network is trained to obtain the first power consumption prediction model.
4. The method according to claim 1, characterized in that: The method of optimizing the model parameters of the first power consumption prediction model based on the improved particle swarm optimization algorithm to obtain the second power consumption prediction model includes: Based on the model parameters of the first power consumption prediction model, determining the initial position and initial velocity of each particle in the initial population, wherein the initial position represents the model parameters to be optimized; Starting from the initial population, the following iterative operations are performed: Determining the fitness of each particle in the current iteration population based on the model prediction error corresponding to the model parameter corresponding to each particle in the current iteration population; Based on the fitness of each particle in this iteration population, update the optimal individual fitness; When the optimal individual fitness meets the preset fitness condition, the target model parameters are determined based on the position of the particle corresponding to the optimal individual fitness, and the second power consumption prediction model is determined based on the target model parameters.
5. The method according to claim 4, characterized in that The iterative operation also includes: When the optimal individual fitness does not meet the preset fitness condition, the particle inertia weight is updated based on the number of population iterations, and the speed of each particle in this iteration population is updated based on the updated particle inertia weight, and the position of each particle in this iteration population is updated based on the updated speed of each particle in this iteration population by using a differential mutation operation to obtain the next iteration population.
6. The method according to claim 4, characterized in that The determining the second power consumption prediction model based on the target model parameters further includes: Based on the target model parameters, determining a corresponding third power consumption prediction model; Determining prediction errors of each network layer based on prediction results of each network layer in the third power consumption prediction model; Based on the prediction errors of each of the network layers, adjusting the weights and thresholds of each of the network layers; When the accuracy of the adjusted third power consumption prediction model meets the preset accuracy condition, the second power consumption prediction model is determined based on the adjusted third power consumption prediction model.
7. The method according to claim 1, characterized in that The improved Markov chain model is used to correct the first power consumption point prediction value to obtain the first predicted power consumption interval of the first power consumption area at the first time and the probability of belonging to the first predicted power consumption interval, including: Based on the second power consumption prediction model, power consumption prediction is performed on second historical power consumption related data of the first power consumption area at a second historical time to obtain fitted power consumption of the first power consumption area at the second historical time, wherein the second historical time is continuous with the first time and earlier than the first time; Determine a state transition probability matrix based on the second historical power consumption of the first power consumption area at the second historical time and the fitted power consumption; Based on the state transition probability matrix and the first power consumption related data at the first time, the first predicted power consumption interval and the probability of belonging to the first predicted power consumption interval of the first power consumption area at the first time are determined.
8. A power consumption prediction device based on artificial intelligence and Bayes correction, characterized in that: include: A sequence determination module, configured to determine a historical power consumption sequence and a historical power consumption related data sequence based on a first historical power consumption in a first power consumption area at a first historical time and first historical power consumption related data; A model training module, used for training a grey neural network based on the historical power consumption sequence and the historical power consumption related data sequence to obtain a first power consumption prediction model for the first power consumption area; A model optimization module, configured to optimize the model parameters of the first power consumption prediction model based on an improved particle swarm optimization algorithm to obtain a second power consumption prediction model; A power consumption point prediction module, configured to use the second power consumption prediction model to process the first power consumption related data of the first power consumption area at the first time, and obtain a first predicted power consumption point prediction value of the first power consumption area at the first time; A first interval estimation module, configured to use an improved Markov chain model to correct the first power consumption point prediction value, and obtain a first predicted power consumption interval of a first power consumption area at a first time and a probability of belonging to the first predicted power consumption interval; A second interval estimation module is used to use the Bayes method to estimate the error term of the error value between the first power consumption point prediction value and the corresponding actual power consumption, and based on the estimated error term, dynamically correct the second predicted power consumption interval determined based on the prior distribution to obtain a third predicted power consumption interval; A prediction result determination module is used to determine the power consumption prediction result of the first power consumption area at the first time based on the first power consumption point prediction value, the first predicted power consumption interval and the probability of belonging to the first predicted power consumption interval, and the third predicted power consumption interval.
9. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-7.
Citation Information
Patent Citations
Line loss rate prediction method based on non-isometric weighted grey model and fuzzy clustering sorting
CN104751254A
Method and device for predicting medium-and-long-term loads of power system
CN110222882A
Power demand prediction method based on multi-dimensional gray-neural network hybrid coordination
CN112330046A
Random inertia weight particle swarm optimization method
CN112633455A
Power load prediction method of improved gray model based on particle swarm optimization
CN112749838A