Power demand situation awareness method and system based on user behavior model

By constructing user electricity consumption behavior and meteorological datasets, and using genetic algorithms and particle swarm optimization algorithms to select model combinations, the problem of integrating time-series and user-level electricity consumption data in electricity demand forecasting was solved, achieving accurate forecasting of electricity demand trends and support for grid dispatch.

CN121882633APending Publication Date: 2026-04-17国网福建省电力有限公司营销服务中心 +1
View PDF 5 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
国网福建省电力有限公司营销服务中心
Filing Date
2026-03-17
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

Existing technologies lack time-series optimization of demand-side data in electricity demand forecasting, making it difficult to support refined management. Furthermore, they lack the ability to integrate user-level electricity consumption data, resulting in a slow response of forecast results to changes in actual electricity demand.

Method used

By constructing user electricity consumption behavior datasets and meteorological datasets, and using genetic algorithms and particle swarm optimization algorithms, the optimal model combination is automatically selected and its weights are calculated to form a combined model. Combining the advantages of multiple heterogeneous neural network models, accurate prediction of electricity demand trends can be achieved.

Benefits of technology

It significantly improves the accuracy and reliability of prediction models, adapts to the needs of large-scale data processing, supports power grid dispatch and energy management decisions, and enables accurate prediction of residential electricity consumption behavior.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121882633A_ABST
    Figure CN121882633A_ABST
Patent Text Reader

Abstract

The invention relates to a power demand situation perception method and system based on a user behavior model, and belongs to the technical field of power demand prediction. Comprising the following steps: acquiring historical power consumption data of a plurality of users and corresponding historical meteorological data, and constructing a sample set; training a plurality of basic models constructed by adopting different machine learning algorithms by using the sample set, wherein each basic model is used for predicting future user power consumption data through historical power consumption data and meteorological data; screening out a plurality of optimal models from the plurality of basic models by utilizing a genetic algorithm; carrying out weighted fusion processing on each optimal model, and adjusting the weight of each optimal model based on an error output by fusion through a particle swarm optimization algorithm to form a combined model; and predicting future user power consumption data of each user in the target area through the combined model, and integrating the future user power consumption data into a power demand situation of the target area.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a method and system for sensing power demand situation based on user behavior models, belonging to the field of power demand forecasting technology. Background Technology

[0002] With the development of artificial intelligence technology, user behavior models trained based on user behavior data are being used to perceive and predict future electricity demand trends. However, due to the proliferation of various models, user behavior models based on different model architectures and principles have been proposed.

[0003] For example, Chinese invention patent application CN102184337A discloses a dynamic combination analysis method for new energy power generation capacity affected by meteorological information, including the following steps: First, data preprocessing is performed, splitting historical measured data or weather forecasts into multiple sample sets according to different terrain altitudes. Each sample set is given an initial weight distribution. Multiple analysis models are generated by training different sample sets using a particle swarm optimization algorithm and multiple learning algorithms. The purpose of using the particle swarm optimization algorithm is to automatically optimize the algorithm parameters. Each learning algorithm adjusts the weight distribution of samples in the corresponding sample set according to its accuracy. To highlight samples with large errors, their weights are increased, and vice versa. Simultaneously, the weights between the various learning algorithms are adjusted according to the calculation accuracy of each model, decreasing the weights of models with large errors and increasing them. Finally, prediction is made based on the final generated multiple training models and their weight distribution. However, this patent does not optimize for the temporal sequence of demand-side data, which may lead to a slow response of the prediction results to changes in actual electricity demand; furthermore, it lacks the ability to integrate user-level electricity data, making it difficult to support refined demand-side management.

[0004] There is an urgent need for a method and system that can select a more suitable user behavior model from known user behavior models, and can fully utilize the advantages of multiple user behavior models to more accurately perceive the future power demand situation. Summary of the Invention

[0005] To address the problems existing in the prior art, this invention proposes a power demand situational awareness method and system based on user behavior models.

[0006] The technical solution of the present invention is as follows: On the one hand, this invention proposes a power demand situational awareness method based on a user behavior model, comprising the following steps: Historical electricity consumption data and corresponding historical meteorological data of multiple users were obtained and constructed into a sample set; Multiple basic models built with different machine learning algorithms are trained using a sample set. Each basic model is used to predict future user electricity consumption data based on historical electricity consumption data and corresponding historical meteorological data. A genetic algorithm is used to select several preferred models from multiple basic models; the preferred models are then weighted and fused, and the weights of each preferred model are adjusted using a particle swarm optimization algorithm to form a combined model. By combining models to predict future electricity consumption data for each user in the target area, and integrating this data into a power demand profile for the target area, the following information is provided: A genetic algorithm is used to select several optimal models from multiple basic models, specifically: Construct chromosome vectors and define each basic model on different bits of the chromosome vectors; initialize the population constructed based on the chromosome vectors as the parent population, and perform crossover and mutation operations on the chromosome vectors in the parent population to obtain the child population corresponding to the parent population. Define a first fitness function to calculate the fitness of chromosome vectors in the parent population and its corresponding child population. Sort the chromosome vectors in ascending order of fitness, and select chromosome vectors with the same number of chromosome vectors as the parent population to form a new parent population. Iterate a preset number of times to obtain multiple new parent populations. Select the first bit from each new parent population as the preferred model. Traverse the first bits of multiple new parent populations to obtain several preferred models, and among them, The first fitness function is expressed by the formula: ; In the formula, Denotes the first fitness function. Indicates weight, Indicates the first Individual user electricity consumption model Indicates the first Mean square error of individual user electricity consumption models Indicates the first The computational cost of a user's electricity consumption model Indicates the first The bit, corresponding to the th bit Individual user electricity consumption model This indicates the maximum number of user electricity consumption models.

[0007] Preferably, historical electricity consumption data and corresponding historical meteorological data from multiple users are acquired and used to construct a sample set, specifically: For any user, read the user's electricity meter data, obtain the electricity consumption information for the corresponding date, divide the electricity consumption information of the day into different time periods according to the preset time period, collect the electricity consumption distribution of the same user for multiple working days at fixed time periods, and combine them in time order to obtain the user's electricity consumption behavior dataset. Acquire historical meteorological data for the same time period as the user's electricity consumption behavior dataset; divide the historical meteorological data into dimensions according to different data types, with each dimension containing a meteorological vector, and each meteorological vector consisting of meteorological data feature values ​​of the corresponding data type from multiple time periods; combine the meteorological vectors of all dimensions from multiple consecutive working days in chronological order to obtain the meteorological dataset; A sample set was constructed based on a dataset of all users' electricity consumption behavior and a meteorological dataset.

[0008] Preferably, multiple base models using different machine learning algorithms are trained, specifically: For any base model, the input sample set contains the historical electricity consumption data of the corresponding user in a certain period and the corresponding historical meteorological data. The base model outputs the predicted value of the user's electricity consumption data for the next period. The mean square error between the predicted value and the true value in the sample set is used as the loss function. The backpropagation algorithm is used to iteratively update and complete the training of the base model.

[0009] Preferably, the weights of each preferred model are adjusted based on the error of the fusion output using a particle swarm optimization algorithm to form a combined model, specifically: Define particle vectors as weight vectors, with each particle vector corresponding to an optimal model; construct a particle swarm based on the particle vectors; iteratively update the position and velocity of each particle vector based on the particle swarm optimization algorithm, and then normalize the particle vectors after the update; Define a second fitness function and calculate the second fitness value for each particle vector. Each particle vector compares its current second fitness value with its historical best second fitness value. If the current second fitness value is higher, the current position of the particle with higher fitness is updated to its individual historical best position. At the same time, if the current second fitness value of each particle vector exceeds the historical best second fitness value of the population, the current position of the particle will be updated to the historical best position of the entire population. Based on the updated individual historical best position and the group historical best position, after iterating a preset number of times, the particle vector corresponding to the group historical best position is output, and the weight values ​​in the particle vector are sequentially assigned to the optimal model to obtain the combined model.

[0010] Preferably, the second fitness function is expressed by the formula: ; in, This represents the second fitness function. Indicates mean square error. Indicates the number of particles in the swarm. particle vectors The combined model of weighted summation of weights in the model , Represents the first particle in the swarm. Particle vectors.

[0011] On the other hand, this invention also proposes a power demand situational awareness system based on a user behavior model, comprising the following modules: Data acquisition and preprocessing module: acquires historical electricity consumption data and corresponding historical meteorological data from multiple users, and constructs a sample set; Electricity consumption behavior model training module: Uses a sample set to train multiple basic models using different machine learning algorithms. Each basic model is used to predict future user electricity consumption data based on historical electricity consumption data and meteorological data. Combined model construction module: Uses genetic algorithm to select several preferred models from multiple basic models; weights and fuses each preferred model, and adjusts the weights of each preferred model through particle swarm optimization algorithm to form a combined model; Prediction Execution and Output Module: This module predicts future electricity consumption data for each user in the target area using a combined model, integrating it into a power demand profile for the target area. A genetic algorithm is used to select several optimal models from multiple basic models, specifically: Construct chromosome vectors and define each basic model on different bits of the chromosome vectors; initialize the population constructed based on the chromosome vectors as the parent population, and perform crossover and mutation operations on the chromosome vectors in the parent population to obtain the child population corresponding to the parent population. Define a first fitness function to calculate the fitness of chromosome vectors in the parent population and its corresponding child population. Sort the chromosome vectors in ascending order of fitness, and select chromosome vectors with the same number of chromosome vectors as the parent population to form a new parent population. Iterate a preset number of times to obtain multiple new parent populations. Select the first bit from each new parent population as the preferred model. Traverse the first bits of multiple new parent populations to obtain several preferred models, and among them, The first fitness function is expressed by the formula: ; In the formula, Denotes the first fitness function. Indicates weight, Indicates the first Individual user electricity consumption model Indicates the first Mean square error of individual user electricity consumption models Indicates the first The computational cost of a user's electricity consumption model Indicates the first The bit, corresponding to the th bit Individual user electricity consumption model This indicates the maximum number of user electricity consumption models.

[0012] In another aspect, the present invention also proposes an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method as described in any embodiment of the present invention.

[0013] In another aspect, the present invention also proposes a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in any embodiment of the present invention.

[0014] The present invention has the following beneficial effects: (1) This invention is a power demand situation perception method and system based on user behavior model. By constructing user electricity consumption behavior dataset and meteorological dataset and ensuring that the two are fully aligned in time period, this invention can capture the deep correlation between user electricity consumption behavior and meteorological conditions, providing high-quality, multi-dimensional input data for model training, thereby significantly improving the accuracy and reliability of the prediction model.

[0015] (2) This invention is a power demand situation perception method and system based on user behavior model. By adopting a dual optimization strategy of genetic algorithm and particle swarm optimization algorithm, the optimal model combination is automatically selected and its weight is calculated, which effectively balances prediction error and calculation cost, avoids the subjectivity and tediousness of manual parameter adjustment, and makes the model both accurate and efficient, adaptable to the needs of large-scale data processing.

[0016] (3) This invention is a power demand situation perception method and system based on user behavior model. The combined model constructed by weighted summation integrates the advantages of multiple heterogeneous neural network models. Through ensemble learning, the robustness and generalization ability of the prediction are improved, and finally the accurate prediction of the electricity consumption behavior of residents on the next date is realized, providing a scientific basis for power demand situation perception and supporting power grid dispatch and energy management decisions. Attached Figure Description

[0017] Figure 1 This is a flowchart of the method provided in Embodiment 1 of the present invention; Figure 2 This is a schematic diagram of a user behavior model based on a simple neural network provided in Embodiment 1 of the present invention; Figure 3This is a schematic diagram of a user behavior model based on RNN provided in Embodiment 1 of the present invention; Figure 4 This is a schematic diagram of a user behavior model based on a general dual-channel input user behavior model provided in Embodiment 1 of the present invention; Figure 5 This is a schematic diagram of a user behavior model based on a complex dual-channel input, provided in Embodiment 1 of the present invention. Detailed Implementation

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

[0019] It should be understood that the step numbers used in the text are for ease of description only and are not intended to limit the order in which the steps are performed.

[0020] It should be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.

[0021] The terms “comprising” and “including” indicate the presence of the described feature, whole, step, operation, element and / or component, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or collections thereof.

[0022] The term “and / or” refers to any combination of one or more of the associated listed items, as well as all possible combinations, and includes these combinations.

[0023] Example 1: See Figure 1 This embodiment proposes a power demand situational awareness method based on a user behavior model, including the following steps: S100. Read the user's household electricity meter data to obtain the user's household electricity consumption behavior information for the day; further, break down the daily electricity consumption behavior information into hourly electricity consumption distribution, expressed by the formula: ; In the formula, This represents a vector of user electricity consumption behavior for the current household over the next 24 hours. They represent Electricity consumption distribution over these 24 time periods; Furthermore, in this embodiment, to obtain accurate prediction results, the user behavior vector is constructed by selecting the time period from 18:00 to 24:00 from the 24 time periods, expressed by the formula: ; In the formula, This represents a vector of user electricity consumption behavior for a user household during the time period from 18:00 to 24:00 on the current date. This indicates the electricity consumption during the period from 18:00 to 19:00. This indicates the electricity consumption during the period from 19:00 to 20:00. This indicates the electricity consumption during the period from 20:00 to 21:00. This indicates the electricity consumption during the period from 21:00 to 22:00. This indicates the electricity consumption during the period from 22:00 to 23:00. This indicates the electricity consumption during the period from 23:00 to 24:00; Furthermore, for the same user household, continuous reading Electricity consumption behavior information during the period from 18:00 to 24:00 on each working day, to construct User behavior vectors ;according to A dataset of electricity consumption behavior for a user's household is built using user behavior vectors.

[0024] S101. Based on the preset electricity consumption data analysis platform and meteorological data platform, map user behavior vectors from 18:00 to 24:00 with different meteorological information. In this embodiment, meteorological information is divided into four dimensions: temperature, humidity, illuminance, and wind force, and corresponding meteorological vectors are constructed, which are expressed by the formula: ; In the formula, Represents the user behavior vector for the current date. The corresponding temperature vector, They represent Temperature corresponding to the time period Represents the user behavior vector for the current date. The corresponding humidity vector, They represent Humidity corresponding to the time period Represents the user behavior vector for the current date. The corresponding illuminance vector, They represent Illuminance corresponding to the time period Represents the user behavior vector for the current date. The corresponding wind force vector, They represent Wind force corresponding to the time period; Furthermore, according to User behavior vectors correspond Temperature vector , Humidity vector , Illuminance vectors , Wind force vector Based on the above and Each user behavior vector corresponds to a meteorological vector, and a meteorological dataset corresponding to the user's household electricity consumption behavior dataset is established.

[0025] S200. Based on the user's household electricity consumption behavior dataset and its corresponding meteorological dataset, a user behavior model is constructed using various neural network structures. In this embodiment, a user behavior model is constructed using four neural network structures as examples: a simple neural network, a combination of a recurrent neural network and a fully connected layer, a combination of a dual-channel input and a feedforward neural network, and a combination of a dual-channel model with an attention mechanism, convolutional layers, and fully connected layers. S201, see also Figure 2 A user behavior model is established based on a simple neural network, and the user's electricity consumption behavior vector during the time period from 18:00 to 24:00 on the current date is denoted as... The input information is fed into a multi-layer neural network. The neural network contains multiple hidden layers, and each hidden layer contains multiple neurons. Each neuron in the hidden layer performs a nonlinear transformation on the received input information, calculates the weighted sum of the input information, and outputs the output information of the current neuron through an activation function. After computation and feature transformation through multiple hidden layers within a simple neural network, the final layer outputs a vector of user household electricity consumption behavior for the next date during the time period from 18:00 to 24:00 on the current date. Each value in the output user electricity consumption behavior vector corresponds one-to-one with each value in the input user electricity consumption behavior vector, representing the prediction value of user electricity consumption behavior for the next date by the user behavior model based on a simple neural network.

[0026] S202, see also Figure 3A user behavior model is established based on a combination of recurrent neural networks and fully connected layers. This model reads household electricity meter data to obtain multiple user electricity consumption behavior vectors for the four days preceding the current date, from 18:00 to 24:00, forming a sequence of user electricity consumption behavior vectors. ; The user's electricity consumption behavior sequence is input into the RNN recurrent neural network. Five high-dimensional feature vectors are output through five parallel time series feature extraction branches. At the same time, a skip connection mechanism is set between the five parallel time series extraction branches so that the high-dimensional feature vector of the next date can be fused with the high-dimensional feature of the previous date, which alleviates the long-range dependency problem and avoids the loss of historical feature information. Furthermore, the five high-dimensional feature vectors are fed into a fully connected layer, and the high-dimensional feature vectors output from different parallel branches are concatenated to form a layer containing... Date to date The high-dimensional feature vector of user electricity consumption behavior information; the fully connected layer performs linear combination and non-linear activation on the received aggregated high-dimensional feature vector, maps it to the target output space, and outputs the user household's electricity consumption behavior vector for the current date from 18:00 to 24:00.

[0027] S203, see also Figure 4 Based on a general dual-channel neural network model, the user's electricity consumption behavior vector during the period from 18:00 to 24:00 on the current date, along with the corresponding temperature, humidity, illuminance, and wind speed vectors, are input into the first channel of the dual-channel input neural network model. All first-channel input vectors are concatenated into a comprehensive feature vector, expressed by the formula: ; In the formula, This represents the comprehensive feature vector of the first channel. This represents a vector representing the user's electricity consumption behavior during the period from 18:00 to 24:00 on the current date. The temperature vector representing the current date. Humidity vector for the current date, This represents the illuminance vector for the current date. The wind vector representing the current date; In the dual-channel neural network model, feedforward neural network 1 receives the comprehensive feature vector from the first channel, performs a linear transformation and nonlinear activation on the comprehensive feature vector, as expressed by the formula: ; In the formula, This represents a high-dimensional abstract feature of user electricity consumption behavior. This represents the activation function of the hidden layer. This represents the weight matrix of the second linear transformation layer. This represents the activation function of the output layer. This represents the weight matrix of the first linear transformation layer. This represents the bias vector of the first linear transformation layer. This represents the bias vector of the first linear transformation layer; Furthermore, the temperature vector of the next day predicted by the preset meteorological data platform will be used. Humidity vector Illuminance vector and wind force vector The input is fed into the second channel of the dual-channel input neural network model; all second-channel input vectors are concatenated into a future meteorological feature vector, expressed by the formula: ; In the formula, This represents the future meteorological feature vector of the second channel. This represents the temperature vector for the next date. Humidity vector for the next date, This represents the illuminance vector for the next date. The wind vector for the next date; In the dual-channel neural network model, feedforward neural network 2 receives the future meteorological feature vector from the second channel, performs linear transformation and nonlinear activation on the feature vector, as expressed by the formula: ; In the formula, Represents the high-dimensional abstract characteristics of future weather; High-dimensional abstract features of user electricity consumption behavior and high-dimensional abstract features of future weather After feature fusion through a multilayer perceptron (MLP), the user's electricity consumption behavior vector for the next date's 18:00-24:00 time period is output through a fully connected layer.

[0028] S204, see also Figure 5 Based on a complex dual-channel neural network model, the electricity consumption behavior vectors of multiple users in the user households, including the time period from 18:00 to 24:00 four days prior to the current date, and the meteorological vectors for the corresponding dates, are input into a multivariate historical sequence processing channel. The input meteorological vectors are concatenated along the feature dimensions to form a multi-channel matrix, expressed by the formula: ; In the formula, Represents a multi-channel matrix; The attention score matrix based on the multi-channel matrix is ​​calculated as follows: ;

[0029] In the formula, Represents the attention weight matrix. Represents the normalization function. This represents the dimension of the key matrix. Represents the query matrix. Represents the key matrix. Represents a value matrix, This represents three different learnable weight matrices; Using the attention matrix as weights, the value matrix is ​​weighted and summed to obtain the output matrix of the attention mechanism, expressed by the formula: ; In the formula, The output matrix represents the attention mechanism; The output matrix of the attention mechanism is input into a one-dimensional convolutional layer, and after convolution and feature extraction, the output is a convolutional feature tensor.

[0030] Furthermore, the convolutional feature tensor is flattened, and the flattened convolutional feature vector is fused with the future meteorological feature vector of the second channel in step S203 through a multilayer perceptron (MLP). After fusion, the feature vector is output through a fully connected layer to generate the user's electricity consumption behavior vector for the next date from 18:00 to 24:00.

[0031] S205. Based on the neural network structure of steps S201-S204, or a similar neural network structure, construct... A user behavior model.

[0032] S206. Divide the user household electricity consumption behavior dataset constructed in step S100 into a training set, a validation set, and a test set in a ratio of 7:2:1. Among them, the training set and validation set are used to... Each user behavior model is trained to obtain the deviation index MSE for each user behavior model.

[0033] S300, using a genetic algorithm, from Select several suitable models from the user behavior models, specifically: Define a chromosome vector, expressed by the formula: ; In the formula, Represents chromosome vectors, Representing bits, respectively associated with different models correspond, To represent the transpose of a matrix, Indicates the number of user electricity consumption models; Define the first fitness function as follows: ; In the formula, Denotes the first fitness function. Indicates the first weight. Indicates the second weight. Indicates the user's electricity consumption model index. Indicates the first Mean square error of individual user electricity consumption models Indicates the first The computational cost of a user's electricity consumption model Indicates the first The bit, corresponding to the th bit Individual user electricity consumption model.

[0034] S301. Construct and initialize a population based on the defined chromosome vector; the initial population includes... Different chromosome vectors Among these, the initial population can be defined as the initial parent population. The parent population includes chromosome vectors. ; Perform crossover and mutation operations on the chromosome vectors in the parent population to generate a child population corresponding to the parent population. Subpopulations include Chromosome vectors ; The chromosome vectors from the parent population and the child population are used to determine the chromosome vectors based on the fitness function. Calculate the corresponding fitness for each; Sort the chromosome vectors in the parent population and the child population in ascending order of first fitness, and select the top... Each chromosome vector is used as the chromosome vector of the new parent population. Under the condition that the iteration terminates, determine the optimal chromosome vector, and set the bits in the optimal chromosome vector to 1. of The model corresponding to each bit is considered a suitable model and is denoted as the preferred model. ; If the iteration termination condition is not met, return to the operation of crossover and mutation on the chromosome vectors in the parent population.

[0035] Therefore, in this embodiment, a genetic algorithm is used to automatically select suitable models from N user models to construct a combined model. Existing technologies typically involve manual selection of models. For example, technicians rely on their experience to select multiple suitable models from N user models for combination. However, this has the following drawbacks: 1) Because existing technologies rely on the experience of technical personnel to select suitable models, there is a significant degree of subjectivity involved. Specifically, different technical personnel use different selection criteria, resulting in different selected models.

[0036] 2) Because the selection of models relies on the experience of technical personnel, the accuracy of the selection varies from person to person. Experienced technical personnel may select more accurate user models. However, for less experienced technical personnel, the selected user models may not be the most suitable models.

[0037] 3) Because it relies on manual operation, the model selection process is inefficient. If there are many models, it is difficult to go through every model by relying solely on manual selection.

[0038] Therefore, in this embodiment, a genetic algorithm is used to automatically select suitable models from multiple user electricity consumption models, thereby replacing manual model selection. The dimension of the chromosome vector can be defined according to the number of electricity consumption models to be selected, allowing for flexible configuration of the chromosome vector based on the actual number of trained user models.

[0039] Furthermore, the fitness function can be configured based on objective indicators of the model selection. For example, in this application, the fitness function is configured based on the mean square error and computational cost of the user's electricity consumption model, thereby balancing the model's accuracy and computational efficiency.

[0040] Therefore, by using the above methods, suitable models can be selected efficiently and accurately from a large number of user electricity consumption models.

[0041] S302. Define the output of the combined model, expressed by the formula: ; In the formula, Representing the combinatorial model, Indicates the first The user behavior vectors output by the optimal model Indicates the first The weights corresponding to the preferred models; It should be noted that the combined model determines the user behavior vector by weighted summation of the outputs of the optimized model.

[0042] S303. Based on the combination model, define the particle vector, expressed by the formula: ; In the formula, Represents the particle vector. Representation and Optimization Model The corresponding weights, and The sum is 1 and ; Based on the particle vectors, a particle swarm is constructed, which contains... The particle vector is expressed by the formula:

[0043] ; In the formula, Represents a swarm of particles. Represents the first particle in the swarm. Particle vectors Representation of the combined model The weights; Define a second fitness function that reflects the accuracy of a combined model that uses a weighted sum of the weights in the particle vectors, expressed as: ; in, This represents the second fitness function. Indicates mean square error. Represented by particle vector The combined model of weighted summation of weights in the model .

[0044] S304. Based on the particle swarm optimization algorithm, the position and velocity coefficient of each particle vector are updated, as expressed by the formula: ; ; In the formula, Indicates particle index, Indicates the first The particle vector at time... The velocity vector, Indicates the first The particle vector at time... The velocity vector, Indicates inertia weight, Represents the learning factor. Represents a random number within the range [0,1]. Indicates the first Each particle at time The best historical position Indicates at time The historical best position of the entire particle swarm Indicates the first Each particle at time Location, Indicates the first Each particle at time Location; According to the constraints: The sum is 1 and The updated particle vectors are then filtered. Based on the selected particle vectors, the optimal function value corresponding to each particle vector and the optimal function value of all particle vectors are updated according to the second fitness function. Determine if the termination condition is met. If the iteration termination condition is not met, then re-evaluate each particle vector. and speed coefficient Perform an update; if the iteration termination condition is met, output the result. ; Based on the optimized particle vector The weights in the model are used to determine the weights of the combined model, thereby determining the combined model.

[0045] S400: Based on the electricity consumption behavior data of each household user in the test set and the corresponding meteorological data, use a combined model to predict the electricity consumption behavior vector of each household user in the corresponding time period of the next date; and integrate the electricity consumption behavior vectors of each household user in the corresponding time period of the next date to realize the power demand situation perception of residential electricity consumption in the next date.

[0046] Example 2: This embodiment proposes a power demand situational awareness system based on a user behavior model, which includes the following modules: Data acquisition and preprocessing module: acquires historical electricity consumption data and corresponding historical meteorological data from multiple users, and constructs a sample set; Electricity consumption behavior model training module: Uses a sample set to train multiple basic models using different machine learning algorithms. Each basic model is used to predict future user electricity consumption data based on historical electricity consumption data and meteorological data. Combined model construction module: Uses genetic algorithm to select several preferred models from multiple basic models; weights and fuses each preferred model, and adjusts the weights of each preferred model through particle swarm optimization algorithm to form a combined model; Prediction Execution and Output Module: Predicts future electricity consumption data of each user in the target area through a combined model, and integrates it into the electricity demand situation of the target area.

[0047] Example 3: This embodiment proposes an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the method described in any embodiment of the present invention.

[0048] Example 4: This embodiment proposes a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the method described in any embodiment of the present invention.

[0049] In this application embodiment, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent the existence of A alone, A and B simultaneously, or B alone. A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of singular or plural items. For example, at least one of a, b, and c can represent: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b, and c can be single or multiple.

[0050] Those skilled in the art will recognize that the units and algorithm steps described in the embodiments disclosed herein can be implemented using electronic hardware, computer software, or a combination of electronic hardware and software. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0051] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0052] In the several embodiments provided in this application, any function, if implemented as a software functional unit and sold or used as an independent product, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0053] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. A method for power demand situational awareness based on user behavior models, characterized in that, Includes the following steps: Historical electricity consumption data and corresponding historical meteorological data from multiple users are acquired to construct a sample set. Multiple basic models built using different machine learning algorithms are trained using this sample set. Each basic model is used to predict future user electricity consumption data based on historical electricity consumption data and corresponding historical meteorological data. A genetic algorithm is used to select several optimal models from the multiple basic models. These optimal models are then weighted and fused, and their weights are adjusted using a particle swarm optimization algorithm to form a combined model. This combined model is used to predict future user electricity consumption data for each user in the target area, integrating it into a power demand situation for the target area. Specifically, the genetic algorithm is used to select several optimal models from the multiple basic models, including: constructing a colorimetric... The body vectors define each basic model on different bits of the chromosome vectors; the population built based on the chromosome vectors is initialized as the parent population, and crossover and mutation operations are performed on the chromosome vectors in the parent population to obtain the child populations corresponding to the parent populations; a first fitness function is defined to calculate the fitness of the chromosome vectors of the parent population and its corresponding child populations respectively; the chromosome vectors are sorted in ascending order of fitness, and chromosome vectors with the same number of chromosome vectors as the parent population are selected according to the sorting from smallest to largest to form a new parent population; the process is iterated a preset number of times to obtain multiple new parent populations; the first bit of each new parent population is selected as the preferred model, and the first bits of multiple new parent populations are traversed to obtain several preferred models, and among them, The first fitness function is expressed by the formula: ; In the formula, Denotes the first fitness function. Indicates weight, Indicates the first Individual user electricity consumption model Indicates the first Mean square error of individual user electricity consumption models Indicates the first The computational cost of a user's electricity consumption model Indicates the first The bit, corresponding to the th bit Individual user electricity consumption model This indicates the maximum number of user electricity consumption models.

2. The power demand situational awareness method based on a user behavior model according to claim 1, characterized in that, Historical electricity consumption data and corresponding historical meteorological data from multiple users were obtained and constructed into a sample set, specifically: For any user, read the user's electricity meter data, obtain the electricity consumption information for the corresponding date, divide the electricity consumption information of the day into different time periods according to the preset time period, collect the electricity consumption distribution of the same user for multiple working days at fixed time periods, and combine them in time order to obtain the user's electricity consumption behavior dataset. Acquire historical meteorological data for the same time period as the user's electricity consumption behavior dataset; divide the historical meteorological data into dimensions of different data types, with each dimension containing a meteorological vector, and each meteorological vector consisting of meteorological data feature values ​​of the corresponding data type from multiple time periods; combine the meteorological vectors of all dimensions from multiple consecutive working days in chronological order to obtain the meteorological dataset; A sample set was constructed based on the electricity consumption behavior dataset of all users and the meteorological dataset.

3. The power demand situational awareness method based on a user behavior model according to claim 1, characterized in that, Train multiple base models using different machine learning algorithms, specifically: For any base model, the input sample set contains the historical electricity consumption data of the corresponding user in a certain period and the corresponding historical meteorological data. The base model outputs the predicted value of the user's electricity consumption data for the next period. The mean square error between the predicted value and the true value in the sample set is used as the loss function. The backpropagation algorithm is used to iteratively update and complete the training of the base model.

4. The power demand situational awareness method based on a user behavior model according to claim 1, characterized in that, The weights of each optimized model are adjusted based on the error of the fusion output using the particle swarm optimization algorithm to form a combined model, specifically: Define particle vectors as weight vectors, with each particle vector corresponding to an optimal model; construct a particle swarm based on the particle vectors; iteratively update the position and velocity of each particle vector based on the particle swarm optimization algorithm, and then normalize the particle vectors after the update; Define a second fitness function and calculate the second fitness value for each particle vector. Each particle vector compares its current second fitness value with its historical best second fitness value. If the current second fitness value is higher, the current position of the particle with higher fitness is updated to its individual historical best position. At the same time, if the current second fitness value of each particle vector exceeds the historical best second fitness value of the population, the current position of the particle will be updated to the historical best position of the entire population. Based on the updated individual historical best position and the group historical best position, after iterating a preset number of times, the particle vector corresponding to the group historical best position is output, and the weight values ​​in the particle vector are sequentially assigned to the optimal model to obtain the combined model.

5. The power demand situational awareness method based on a user behavior model according to claim 4, characterized in that, The second fitness function is expressed by the formula: ; in, This represents the second fitness function. This represents the mean square error. Indicates the number of particles in the swarm. particle vectors The combined model of weighted summation of weights in the model , Represents the first particle in the swarm. Particle vectors Indicates the particle vector index.

6. A power demand situational awareness system based on a user behavior model, characterized in that, Includes the following modules: Data acquisition and preprocessing module: acquires historical electricity consumption data and corresponding historical meteorological data from multiple users, and constructs a sample set; Electricity consumption behavior model training module: Uses a sample set to train multiple basic models using different machine learning algorithms. Each basic model is used to predict future user electricity consumption data based on historical electricity consumption data and meteorological data. Combined model construction module: Uses genetic algorithm to select several preferred models from multiple basic models; weights and fuses each preferred model, and adjusts the weights of each preferred model through particle swarm optimization algorithm to form a combined model; Prediction Execution and Output Module: This module predicts future electricity consumption data for each user in the target area using a combined model, integrating it into a power demand profile for the target area. A genetic algorithm is used to select several optimal models from multiple basic models, specifically: Construct chromosome vectors and define each basic model on different bits of the chromosome vectors; initialize the population constructed based on the chromosome vectors as the parent population, and perform crossover and mutation operations on the chromosome vectors in the parent population to obtain the child population corresponding to the parent population. Define a first fitness function to calculate the fitness of chromosome vectors in the parent population and its corresponding child population. Sort the chromosome vectors in ascending order of fitness, and select chromosome vectors with the same number of chromosome vectors as the parent population to form a new parent population. Iterate a preset number of times to obtain multiple new parent populations. Select the first bit from each new parent population as the preferred model. Traverse the first bits of multiple new parent populations to obtain several preferred models, and among them, The first fitness function is expressed by the formula: ; In the formula, Denotes the first fitness function. Indicates weight, Indicates the user's electricity consumption model index. Indicates the first Mean square error of individual user electricity consumption models Indicates the first The computational cost of a user's electricity consumption model Indicates the first The bit, corresponding to the th bit Individual user electricity consumption model This indicates the maximum number of user electricity consumption models.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method as described in any one of claims 1 to 5.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Dynamic combination analysis method of new energy generating capacity influenced by meteorological information

    CN102184337A

  • Classification method based on feature selection and model combination optimization

    CN115795361A

  • Multi-model fusion industry electric power situation awareness method and system

    CN116051161A

  • Multi-model dynamic fusion load prediction method and system, terminal and medium

    CN121332454A

  • A Method and System for Generating Optimal Machine Learning Model Architectures

    US20250086427A1