A Power Consumption Prediction Method Based on Intelligent Algorithms
By optimizing the power consumption prediction model using the MSLSO-CNN-LSTM intelligent algorithm, the problem of easily getting trapped in local optima during training is solved, achieving high-precision power consumption prediction and improving the efficiency of power grid dispatch and energy management.
Patent Information
- Application Number
- CN202511148854.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-18
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2045-08-18
AI Technical Summary
Existing technologies are prone to getting stuck in local optima when training deep learning models and are sensitive to initial values, resulting in inaccurate power consumption predictions.
The MSLSO-CNN-LSTM intelligent algorithm is used to learn from multi-source heterogeneous data. The hyperparameters are optimized by a hybrid strategy herd optimization algorithm. A power consumption prediction model is constructed by combining convolutional neural networks and long short-term memory networks and deployed on a cloud server for real-time data identification.
It improves the accuracy and precision of electricity consumption prediction, enhances the model's global search capability and convergence speed, lowers the barrier to entry, and facilitates large-scale deployment.
Smart Images

Figure CN120657765B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of power consumption prediction technology, and more specifically, to a power consumption prediction method based on intelligent algorithms. Background Technology
[0002] With the development of the social economy and the continuous growth of electricity demand, electricity consumption forecasting plays a vital role in power grid dispatching, energy management, energy conservation, and emission reduction. Traditional electricity consumption forecasting methods, mainly based on statistical models or simple time series analysis, are ill-suited to handle the complex changing patterns in multi-source heterogeneous data environments, resulting in limited forecasting accuracy. In recent years, with the development of artificial intelligence technology, deep learning models (such as CNN (Convolutional Neural Network) and LSTM (Long Short-Term Memory)) have been applied to the field of electricity forecasting. Existing technologies often employ intelligent algorithms to train deep learning models, but problems such as low model training efficiency, difficulty in optimizing hyperparameters, and insufficient generalization ability still exist. For example, existing technologies often use the LSO algorithm to train deep learning models, but it is prone to getting trapped in local optima during training and is sensitive to initial values, leading to the trained deep learning model failing to accurately predict electricity consumption. Summary of the Invention
[0003] This application aims to provide a power consumption prediction method based on intelligent algorithms, which addresses the problem that existing technologies are prone to getting trapped in local optima during training and are sensitive to initial values, resulting in the deep learning models trained being unable to accurately predict power consumption.
[0004] This application provides a power consumption prediction method based on intelligent algorithms, including:
[0005] Collect multi-source heterogeneous data related to power consumption, and preprocess the multi-source heterogeneous data to obtain a standardized dataset;
[0006] Based on the standardized dataset, training data for electricity consumption prediction is constructed; wherein, the training data includes training samples and training labels;
[0007] The training data is learned using the MSLSO-CNN-LSTM intelligent algorithm to obtain a power consumption prediction model, and the power consumption prediction model is deployed on a cloud server.
[0008] Real-time data corresponding to the predicted power consumption area is collected, uploaded to the server, and the power consumption prediction model deployed on the server is scheduled to identify the real-time data to obtain the power consumption prediction result.
[0009] In some possible implementations, the collection of multi-source heterogeneous data related to power consumption includes:
[0010] Based on the preset data sampling frequency, historical power load characteristic data, meteorological characteristic data and time characteristic data corresponding to the power consumption prediction area are collected according to the preset data sampling period to obtain multiple multi-source heterogeneous data related to power consumption.
[0011] Among them, historical power load characteristic data includes historical power load values corresponding to the power consumption prediction area; meteorological characteristic data includes temperature, humidity, wind speed, rainfall, and sunshine duration; and time characteristic data includes month, date, weekday identifier, and holiday identifier.
[0012] In some possible implementations, the multi-source heterogeneous data is preprocessed to obtain a standardized dataset, including:
[0013] The multi-source heterogeneous data is deduplicated and outliers are removed to obtain preprocessed multi-source heterogeneous data.
[0014] All preprocessed multi-source heterogeneous data are constructed into a standardized dataset.
[0015] In some possible implementations, training data for electricity consumption prediction is constructed based on the standardized dataset; wherein the training data includes training samples and training labels, including:
[0016] Use any one of the multi-source heterogeneous data in the standardized dataset as a training sample, and use the historical power load characteristic data at future time points corresponding to the multi-source heterogeneous data as training labels.
[0017] In some possible implementations, the MSLSO-CNN-LSTM intelligent algorithm is used to learn the training data to obtain an electricity consumption prediction model, including:
[0018] The initial prediction model is constructed using the CNN-LSTM algorithm;
[0019] The training data is used to initialize the lion king, lioness, and cubs corresponding to the MSLSO algorithm; wherein the lion king, lioness, and cubs all contain all the hyperparameters of the initial prediction model;
[0020] For any given Lion King, an adaptive dual strategy with added mutation search is used to search for the Lion King in the solution space to obtain the searched Lion King.
[0021] For any lioness, a variable spiral search strategy is used to perform a cooperative search for the lionesses in the solution space to obtain the lionesses after the cooperative search.
[0022] For any cub, an adaptive balance search strategy is used to guide the search of the cub within the solution space, so as to obtain the cub after the guided search.
[0023] Based on the lion king after the search, the lioness after the cooperative search, and the cub after the guided search, obtain the updated population during the current training process; wherein any individual in the updated population is the lion king after the search, the lioness after the cooperative search, or the cub after the guided search.
[0024] In the updated population, determine the best and worst individuals;
[0025] A mutual influence search is performed on the optimal and worst individuals to obtain the optimal and worst individuals after the search.
[0026] The two individuals with the largest loss function values in the updated population are replaced by the best and worst individuals after the search, and the replaced population is obtained.
[0027] Determine whether the total number of training iterations has reached the preset maximum number of training iterations. If so, then based on the replaced population, redetermine the optimal individual and use the hyperparameters of the optimal individual as the final hyperparameters of the initial prediction model to obtain the power consumption prediction model. Otherwise, re-divide the replaced population into lion king, lionesses, and cubs, and return to the step of searching for lion king.
[0028] In some possible implementations, initializing the lion king, lioneses, and cubs corresponding to the MSLSO algorithm based on the training data includes:
[0029] For the hyperparameters of the initial prediction model, they are randomly initialized between the upper and lower bounds, and the randomly initialized hyperparameters are combined into a vector to obtain the individual.
[0030] Repeatedly obtain multiple different individuals and obtain the loss function value for each individual;
[0031] Based on the loss function values from smallest to largest, all individuals are divided into lion kings, lionesses, and cubs in a ratio of 1:7:2.
[0032] In some possible implementations, for any given Lion King, an adaptive dual strategy with added mutation search is used to search for the Lion King in the solution space, resulting in the following Lion King:
[0033]
[0034]
[0035]
[0036] in, Indicates the first k The Lion King's first d dimensional hyperparameters, k =1,2,…,K, where K represents the total number of Lion Kings. d =1,2,…,D, where D represents the total number of hyperparameters in LionKing. t This indicates the current total number of training iterations. The lion king with the smallest loss function value is represented by its th... d dimensional hyperparameters, Indicates the first k The Lion King's first search d dimensional hyperparameters; This represents the first Lion King search coefficient, and is a random number between (0,1); Represents the decision coefficient. Represents the cosine function. Indicates the maximum number of training iterations. Represents pi (π). This represents the search coefficient for the second Lion King. Indicates the mutation control coefficient. Represents the random number of the Lion King's first... d dimensional hyperparameters, Indicates the mutation order. Indicates the total mutation order. This represents the maximum value of the decision coefficient. This represents the minimum decision coefficient. This represents the sine function.
[0037] In some possible implementations, for any given lioness, a variable spiral search strategy is used to perform a cooperative search for the lionesses in the solution space, resulting in the following lionesses after the cooperative search:
[0038]
[0039]
[0040] in, Indicates the first m A lioness, m =1,2,…,M, where M represents the total number of female lions. Indicates the first m The lioness after a collaborative search. Represents a random lioness. Represents the natural constant. b This represents the variable spiral search shape control parameter. This represents the control parameters for the spiral search path between (-1, 1). This represents an exponential function with the natural constant e as its base.
[0041] In some possible implementations, for any cub, an adaptive balancing search strategy is used to guide the search within the solution space, resulting in cubs after the guided search, including:
[0042] The adaptive equilibrium search factor is obtained as follows:
[0043]
[0044] in, This represents the adaptive balance search factor. This represents the average of the upper limits of all hyperparameters. This represents the average of the lower bounds of all hyperparameters;
[0045] For any cub, a guided search is performed within the solution space based on the adaptive balance search factor, resulting in the following cubs after the guided search:
[0046]
[0047] in, Indicates the first n A lion cub, n =1,2,…,N, where N represents the total number of lion cubs. Indicates the first n A lion cub after being guided through a search, The lion cub with the smallest loss function value is represented. The Lion King represents the Lion King with the smallest loss function value; This represents the search coefficient for the lion cub, and is a random number between (0,1); Represents the first random number between (0,1); This represents an individual with the upper limit mean, and its dimensions are the same as those of a lion cub. Each dimension element is set to... ; This represents an individual with the lower bound mean, and its dimensions are the same as those of the lion cubs. Each dimension element is set to... .
[0048] In some possible implementations, a mutual influence search is performed on the optimal and worst individuals to obtain the optimal and worst individuals after the search, including:
[0049] Based on the current total number of training iterations, the non-linear time correlation factor is obtained as follows:
[0050]
[0051] in, Indicates a nonlinear time-related factor;
[0052] Based on the worst-case individual and the nonlinear time correlation factor, the basic influence parameters are determined as follows:
[0053]
[0054] in, Indicates the first d The fundamental influence parameters corresponding to the hyperparameters are The worst individual is represented by the first... d dimensional hyperparameters, Represents the first of the random individuals d The hyperparameters are defined, and the random individuals are neither the worst nor the best individuals;
[0055] Based on the optimal and worst individuals, the influence control parameters are obtained as follows:
[0056]
[0057] in, Indicates the first d The influence control parameters corresponding to the hyperparameters. The positional evaluation parameter represents the worst-performing individual. The location evaluation parameter represents the optimal individual, and the location evaluation parameter = 1 / (loss function value + 0.001). The first element representing the optimal individual d dimensional hyperparameters, This represents the Euclidean distance between the worst and best individuals.
[0058] Based on the aforementioned basic influence parameters and influence control parameters, the optimal and worst individuals are searched to obtain the optimal and worst individuals after the search:
[0059]
[0060]
[0061] in, This represents the first optimal individual after the search. d dimensional hyperparameters, This represents the worst individual after the search. d dimensional hyperparameters, This represents the second random number between (0,1).
[0062] Beneficial effects:
[0063] This application provides a power consumption prediction method based on intelligent algorithms. It collects multi-source heterogeneous data related to power consumption and preprocesses this data to obtain a standardized dataset, thus improving data richness and prediction accuracy. Then, based on the standardized dataset, training data for power consumption prediction is constructed, and the MSLSO-CNN-LSTM intelligent algorithm is used to learn from the training data to obtain a power consumption prediction model. This improves the algorithm's global search capability and convergence speed, further enhancing prediction accuracy. Finally, the power consumption prediction model is deployed on a cloud server, collecting real-time data corresponding to the power consumption prediction area and uploading it to the server. The power consumption prediction model deployed on the server is then scheduled to identify the real-time data and obtain power consumption prediction results, effectively improving the accuracy of power consumption prediction. Attached Figure Description
[0064] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0065] Figure 1 This is a flowchart of a power consumption prediction method based on intelligent algorithms proposed in an embodiment of this application.
[0066] Figure 2 This is a flowchart of a power consumption prediction model proposed in one embodiment of this application. Detailed Implementation
[0067] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0068] like Figure 1 As shown in the figure, this application provides a power consumption prediction method based on intelligent algorithms, including:
[0069] S101. Collect multi-source heterogeneous data related to power consumption, and preprocess the multi-source heterogeneous data to obtain a standardized dataset.
[0070] For example, the collection of multi-source heterogeneous data related to power consumption includes:
[0071] Based on a preset data sampling frequency, historical power load characteristic data, meteorological characteristic data, and time characteristic data corresponding to the power consumption prediction area are collected according to a preset data sampling period to obtain multiple multi-source heterogeneous data related to power consumption. Among them, the historical power load characteristic data includes the historical power load value corresponding to the power consumption prediction area, the meteorological characteristic data includes temperature, humidity, wind speed, rainfall, and sunshine duration, and the time characteristic data includes month, date, weekday identifier of the current month, and holiday identifier.
[0072] Short-term power consumption forecasts are typically based on daily data. Therefore, the data sampling frequency can be set to daily. Temperature, humidity, and wind speed can each include their maximum, minimum, and average values. Rainfall is the cumulative rainfall over a day, and sunshine duration is the cumulative sunshine duration over a day. To ensure consistent data length, both months and dates are represented by linked numbers (e.g., months can be 01, 11, etc., and times can be 01, 24, etc.). The weekday identifier for each month is represented by a single number. The week number for which multi-source heterogeneous data was collected is indicated by that number. Holiday identifiers can use either a first or second code, with the first code corresponding to holidays and the second code corresponding to non-holidays.
[0073] Compared with traditional single time series forecasting methods, using multi-source heterogeneous data significantly improves the richness of the model's input information, thereby improving forecast accuracy.
[0074] For example, preprocessing the multi-source heterogeneous data to obtain a standardized dataset includes:
[0075] The multi-source heterogeneous data is subjected to deduplication and outlier processing to obtain preprocessed multi-source heterogeneous data. Outlier processing can be performed by identifying outliers using the 3σ principle for historical load data and replacing them with the average of the data one day before and after the outlier. This embodiment assumes no missing values; however, missing value processing can be performed if missing values exist.
[0076] All preprocessed multi-source heterogeneous data are constructed into a standardized dataset.
[0077] Optionally, during preprocessing, multi-source heterogeneous data can be normalized to reduce data complexity and improve processing efficiency. However, it's worth noting that normalization should also be performed simultaneously during the subsequent identification of real-time data.
[0078] S102. Based on the standardized dataset, construct training data for electricity consumption prediction; wherein the training data includes training samples and training labels.
[0079] For example, training data for electricity consumption prediction is constructed based on the standardized dataset; wherein the training data includes training samples and training labels, including: using any one of the multi-source heterogeneous data in the standardized dataset as a training sample, and using the historical electricity load characteristic data at future time points corresponding to the multi-source heterogeneous data as training labels.
[0080] S103. The training data is learned using the MSLSO (Mixed Strategy Loin Swarm Optimization)-CNN-LSTM intelligent algorithm to obtain the power consumption prediction model, and the power consumption prediction model is deployed on a cloud server.
[0081] The MSLSO-CNN-LSTM intelligent algorithm provided in this application combines the advantages of convolutional neural networks (CNN) in feature extraction with the strengths of long short-term memory networks (LSTM) in time series modeling. It also uses MSLSO for hyperparameter optimization, which solves the defects in the LSO algorithm and enables the power consumption prediction model to have stronger adaptability and higher prediction accuracy.
[0082] Deploying the trained power consumption prediction model on a cloud server enables the system to have high availability and elastic scalability. There is no need to deploy complex models locally; prediction results can be obtained simply by uploading real-time data, which lowers the barrier to entry and facilitates large-scale deployment.
[0083] S104. Collect real-time data corresponding to the power consumption prediction area, upload the real-time data to the server, and schedule the power consumption prediction model deployed on the server to identify the real-time data and obtain the power consumption prediction result.
[0084] This application provides a power consumption prediction method based on intelligent algorithms. Through high-precision power consumption prediction, it can help power grid companies rationally plan power generation, avoid energy waste or power shortages, and effectively achieve peak shaving and valley filling, especially during peak electricity consumption periods, thereby reducing system operating costs. The prediction results can be used in intelligent dispatch systems to optimize power resource allocation, reduce unnecessary energy reserves, and improve overall energy utilization efficiency.
[0085] like Figure 2 As shown, the MSLSO-CNN-LSTM intelligent algorithm is used to learn the training data to obtain a power consumption prediction model, including:
[0086] S201. The initial prediction model is constructed using the CNN-LSTM algorithm.
[0087] S202. Initialize the lion king, lioness, and cubs corresponding to the MSLSO algorithm based on the training data. The lion king, lioness, and cubs all include all hyperparameters of the initial prediction model.
[0088] Alternatively, a chaotic mapping initialization method can be used to generate multiple individuals. Then, based on the training data, the loss function value (such as cross-entropy loss function value or root mean square loss function value) corresponding to each individual can be obtained, and the individuals can be divided into lion kings, lionesses, and cubs according to the loss function value.
[0089] All hyperparameters of the initial prediction model can include weights and thresholds, each with corresponding upper and lower limits, or can be randomly initialized between the upper and lower limits of the hyperparameters.
[0090] For example, initializing the lion king, lioness, and cubs corresponding to the MSLSO algorithm based on the training data includes:
[0091] For the hyperparameters of the initial prediction model, they are randomly initialized between the upper and lower bounds, and the randomly initialized hyperparameters are combined into a vector to obtain the individual.
[0092] Repeatedly obtain multiple different individuals and obtain the loss function value corresponding to each individual.
[0093] Based on the loss function values from smallest to largest, all individuals are divided into lion kings, lionesses, and cubs in a ratio of 1:7:2.
[0094] To ensure that the division is an integer, the number of different individuals generated can be an integer multiple of 10.
[0095] S203. For any Lion King, an adaptive dual strategy with added mutation search is used to search for the Lion King in the solution space to obtain the searched Lion King.
[0096] S204. For any lioness, a variable spiral search strategy is used to perform a cooperative search for the lionesses in the solution space to obtain the lionesses after the cooperative search.
[0097] S205. For any cub, an adaptive balance search strategy is used to guide the search of the cub within the solution space to obtain the cub after the guided search.
[0098] S206. Based on the lion king after the search, the lioness after the cooperative search, and the cub after the guided search, obtain the updated population during the current training process. Any individual in the updated population can be the lion king after the search, the lioness after the cooperative search, or the cub after the guided search.
[0099] S207. In the updated population, determine the best and worst individuals.
[0100] S208. Perform a mutual influence search on the optimal individual and the worst individual to obtain the optimal individual and the worst individual after the search.
[0101] S209. Replace the two individuals with the largest loss function values in the updated population with the best and worst individuals after the search, and obtain the replaced population.
[0102] S210. Determine whether the total number of training iterations has reached the preset maximum number of training iterations. If so, then based on the replaced population, redetermine the optimal individual and use the hyperparameters of the optimal individual as the final hyperparameters of the initial prediction model to obtain the power consumption prediction model. Otherwise, re-divide the replaced population into lion king, lionesses, and cubs, and return to the step of searching for the lion king.
[0103] Optionally, after each search of any individual, out-of-bounds handling can be performed on that individual. For example, the out-of-bounds hyperparameter can be randomly generated between its corresponding upper and lower limits, or the out-of-bounds hyperparameter can be set to the nearest limit value.
[0104] Existing technologies often employ the LSO algorithm to train deep learning models. However, this algorithm is prone to getting trapped in local optima during training and is sensitive to initial values, resulting in the trained deep learning model failing to accurately predict power consumption. Therefore, this application provides an improved algorithm that solves the problems of getting trapped in local optima and sensitivity to individual initial values, thereby improving the prediction accuracy of the power consumption prediction model.
[0105] In some possible implementations, for any given Lion King, an adaptive dual strategy with added mutation search is used to search for the Lion King in the solution space, resulting in the following Lion King:
[0106]
[0107]
[0108]
[0109] in, Indicates the first k The Lion King's first d dimensional hyperparameters, k =1,2,…,K, where K represents the total number of Lion Kings. d =1,2,…,D, where D represents the total number of hyperparameters in LionKing. t This indicates the current total number of training iterations. The lion king with the smallest loss function value is represented by its th... d dimensional hyperparameters, Indicates the first k The Lion King's first search d dimensional hyperparameters; This represents the first Lion King search coefficient, and is a random number between (0,1); Represents the decision coefficient. Represents the cosine function. Indicates the maximum number of training iterations. Represents pi (π). This represents the search coefficient for the second Lion King. This represents the mutation control coefficient, which can be set to 0.4; Represents the random number of the Lion King's first... d dimensional hyperparameters, Indicates the mutation order. This indicates the total mutation order, which can be set to 4. This represents the maximum value of the decision coefficient, which can be set to 1. This represents the minimum decision coefficient, which can be set to 0.001. This represents the sine function.
[0110] The adaptive dual-strategy with added mutation search provided in this application adds adaptive mutation to the original Lion King search strategy, providing the algorithm with powerful global search capabilities and improving its ability to escape local optima. Furthermore, the algorithm tends to use the original Lion King search strategy in the later stages of the search, ensuring the algorithm's convergence.
[0111] Optionally, when Lion King undergoes mutation, a greedy strategy or simulated annealing algorithm can be used to control the mutation process to ensure the training speed of the algorithm.
[0112] In some possible implementations, for any given lioness, a variable spiral search strategy is used to perform a cooperative search for the lionesses in the solution space, resulting in the following lionesses after the cooperative search:
[0113]
[0114]
[0115] in, Indicates the first m A lioness, m =1,2,…,M, where M represents the total number of female lions. Indicates the first m The lioness after a collaborative search. Represents a random lioness. Represents the natural constant. bThis represents the variable spiral search shape control parameter. This represents the control parameters for the spiral search path between (-1, 1). This represents an exponential function with the natural constant e as its base.
[0116] The variable spiral search strategy provided in this application embodiment can enable the lioness to perform variable spiral searches in different directions, thereby balancing the lioness's global and local search capabilities while increasing her ability to explore unknown areas.
[0117] In some possible implementations, for any cub, an adaptive balancing search strategy is used to guide the search within the solution space, resulting in cubs after the guided search, including:
[0118] The adaptive equilibrium search factor is obtained as follows:
[0119]
[0120] in, This represents the adaptive balance search factor. This represents the average of the upper limits of all hyperparameters. This represents the average of the lower bounds of all hyperparameters;
[0121] For any cub, a guided search is performed within the solution space based on the adaptive balance search factor, resulting in the following cubs after the guided search:
[0122]
[0123] in, Indicates the first n A lion cub, n =1,2,…,N, where N represents the total number of lion cubs. Indicates the first n A lion cub after being guided through a search, The lion cub with the smallest loss function value is represented. The Lion King represents the Lion King with the smallest loss function value; This represents the search coefficient for the lion cub, and is a random number between (0,1); Represents the first random number between (0,1); This represents an individual with the upper limit mean, and its dimensions are the same as those of a lion cub. Each dimension element is set to... ; This represents an individual with the lower bound mean, and its dimensions are the same as those of the lion cubs. Each dimension element is set to... .
[0124] The adaptive balanced search strategy provided in this application embodiment allows the young lion to have a large perturbation force in the early stage of the algorithm, and then it can be non-linearly reduced to zero as the algorithm progresses, thereby balancing the young lion's global search and local search.
[0125] In some possible implementations, a mutual influence search is performed on the optimal and worst individuals to obtain the optimal and worst individuals after the search, including:
[0126] Based on the current total number of training iterations, the non-linear time correlation factor is obtained as follows:
[0127]
[0128] in, Indicates a nonlinear time-related factor;
[0129] Based on the worst-case individual and the nonlinear time correlation factor, the basic influence parameters are determined as follows:
[0130]
[0131] in, Indicates the first d The fundamental influence parameters corresponding to the hyperparameters are The worst individual is represented by the first... d dimensional hyperparameters, Represents the first of the random individuals d The hyperparameters are defined, and the random individuals are neither the worst nor the best individuals;
[0132] Based on the optimal and worst individuals, the influence control parameters are obtained as follows:
[0133]
[0134] in, Indicates the first d The influence control parameters corresponding to the hyperparameters. The positional evaluation parameter represents the worst-performing individual. The location evaluation parameter represents the optimal individual, and the location evaluation parameter = 1 / (loss function value + 0.001). The first element representing the optimal individual d dimensional hyperparameters, This represents the Euclidean distance between the worst and best individuals.
[0135] Based on the aforementioned basic influence parameters and influence control parameters, the optimal and worst individuals are searched to obtain the optimal and worst individuals after the search:
[0136]
[0137]
[0138] in, This represents the first optimal individual after the search. d dimensional hyperparameters, This represents the worst individual after the search. d dimensional hyperparameters, This represents the second random number between (0,1).
[0139] In this embodiment, the optimal and worst individuals are searched for mutual influence, increasing the probability of collisions and thus increasing the probability of the algorithm escaping local optima. The gradually increasing speed also helps the algorithm reduce the probability of getting trapped in local optima in the later stages. Furthermore, replacing the two individuals with the largest loss function values in the updated population with the optimal and worst individuals found after the search ensures the algorithm's training speed, thereby comprehensively improving the algorithm's ability to escape local optima.
[0140] This application provides a power consumption prediction method based on intelligent algorithms. It collects multi-source heterogeneous data related to power consumption and preprocesses this data to obtain a standardized dataset, thus improving data richness and prediction accuracy. Then, based on the standardized dataset, training data for power consumption prediction is constructed, and the MSLSO-CNN-LSTM intelligent algorithm is used to learn from the training data to obtain a power consumption prediction model. This improves the algorithm's global search capability and convergence speed, further enhancing prediction accuracy. Finally, the power consumption prediction model is deployed on a cloud server, collecting real-time data corresponding to the power consumption prediction area and uploading it to the server. The power consumption prediction model deployed on the server is then scheduled to identify the real-time data and obtain power consumption prediction results, effectively improving the accuracy of power consumption prediction.
[0141] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0142] This application describes embodiments with reference to flowchart illustrations and / or block diagrams of methods, apparatuses, electronic devices, and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0143] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0144] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0145] Although preferred embodiments of the present application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present application.
[0146] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.
[0147] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A power consumption prediction method based on intelligent algorithms, characterized in that, include: Collect multi-source heterogeneous data related to power consumption, and preprocess the multi-source heterogeneous data to obtain a standardized dataset; Based on the standardized dataset, training data for electricity consumption prediction is constructed; wherein, the training data includes training samples and training labels; The training data is learned using the MSLSO-CNN-LSTM intelligent algorithm to obtain a power consumption prediction model, and the power consumption prediction model is deployed on a cloud server. Real-time data corresponding to the predicted power consumption area is collected, the real-time data is uploaded to the server, and the power consumption prediction model deployed on the server is scheduled to identify the real-time data and obtain the power consumption prediction result. The training data is learned using the MSLSO-CNN-LSTM intelligent algorithm to obtain a power consumption prediction model, including: The initial prediction model is constructed using the CNN-LSTM algorithm; The training data is used to initialize the lion king, lioness, and cubs corresponding to the MSLSO algorithm; wherein the lion king, lioness, and cubs all contain all the hyperparameters of the initial prediction model; For any given Lion King, an adaptive dual strategy with added mutation search is used to search for the Lion King in the solution space to obtain the searched Lion King. For any lioness, a variable spiral search strategy is used to perform a cooperative search for the lionesses in the solution space to obtain the lionesses after the cooperative search. For any cub, an adaptive balance search strategy is used to guide the search of the cub within the solution space, so as to obtain the cub after the guided search. Based on the lion king after the search, the lioness after the cooperative search, and the cub after the guided search, obtain the updated population during the current training process; wherein any individual in the updated population is the lion king after the search, the lioness after the cooperative search, or the cub after the guided search. In the updated population, determine the best and worst individuals; A mutual influence search is performed on the optimal and worst individuals to obtain the optimal and worst individuals after the search. The two individuals with the largest loss function values in the updated population are replaced by the best and worst individuals after the search, and the replaced population is obtained. Determine whether the total number of training iterations has reached the preset maximum number of training iterations. If so, then based on the replaced population, redetermine the optimal individual and use the hyperparameters of the optimal individual as the final hyperparameters of the initial prediction model to obtain the power consumption prediction model. Otherwise, re-divide the replaced population into lion king, lionesses, and cubs, and return to the step of searching for lion king. For any given Lion King, an adaptive dual strategy with added mutation search is used to search for the Lion King in the solution space, resulting in the following Lion King: in, Indicates the first k The Lion King's first d dimensional hyperparameters, k =1,2,…,K, where K represents the total number of Lion Kings. d =1,2,…,D, where D represents the total number of hyperparameters in LionKing. t This indicates the current total number of training iterations. The lion king with the smallest loss function value is represented by its th... d dimensional hyperparameters, Indicates the first k The Lion King's first search d dimensional hyperparameters; This represents the first Lion King search coefficient, and is a random number between (0,1); Represents the decision coefficient. Represents the cosine function. Indicates the maximum number of training iterations. Represents pi (π). This represents the search coefficient for the second Lion King. Indicates the mutation control coefficient. Represents the random number of the Lion King's first... d dimensional hyperparameters, Indicates the mutation order. Indicates the total mutation order. This represents the maximum value of the decision coefficient. This represents the minimum decision coefficient. This represents the sine function.
2. The power consumption prediction method based on intelligent algorithms according to claim 1, characterized in that, The collection of multi-source heterogeneous data related to power consumption includes: Based on the preset data sampling frequency, historical power load characteristic data, meteorological characteristic data and time characteristic data corresponding to the power consumption prediction area are collected according to the preset data sampling period to obtain multiple multi-source heterogeneous data related to power consumption. Among them, historical power load characteristic data includes historical power load values corresponding to the power consumption prediction area; meteorological characteristic data includes temperature, humidity, wind speed, rainfall, and sunshine duration; and time characteristic data includes month, date, weekday identifier, and holiday identifier.
3. The power consumption prediction method based on intelligent algorithms according to claim 1, characterized in that, The multi-source heterogeneous data is preprocessed to obtain a standardized dataset, including: The multi-source heterogeneous data is deduplicated and outliers are removed to obtain preprocessed multi-source heterogeneous data. All preprocessed multi-source heterogeneous data are constructed into a standardized dataset.
4. The power consumption prediction method based on intelligent algorithms according to claim 1, characterized in that, Based on the standardized dataset, training data for electricity consumption prediction is constructed; wherein, the training data includes training samples and training labels, including: Use any one of the multi-source heterogeneous data in the standardized dataset as a training sample, and use the historical power load characteristic data at future time points corresponding to the multi-source heterogeneous data as training labels.
5. The power consumption prediction method based on intelligent algorithms according to claim 1, characterized in that, Initialize the lion king, lioness, and cubs corresponding to the MSLSO algorithm based on the training data, including: For the hyperparameters of the initial prediction model, they are randomly initialized between the upper and lower bounds, and the randomly initialized hyperparameters are combined into a vector to obtain the individual; Repeatedly obtain multiple different individuals and obtain the loss function value for each individual; Based on the loss function values from smallest to largest, all individuals are divided into lion kings, lionesses, and cubs in a ratio of 1:7:
2.
6. The power consumption prediction method based on intelligent algorithms according to claim 1, characterized in that, For any given lioness, a variable spiral search strategy is used to perform a cooperative search for the lionesses within the solution space. The lionesses obtained after the cooperative search are: in, Indicates the first m A lioness, m =1,2,…,M, where M represents the total number of female lions. Indicates the first m The lioness after a collaborative search. Represents a random lioness. Represents the natural constant. b This represents the variable spiral search shape control parameter. This represents the control parameters for the spiral search path between (-1, 1). This represents an exponential function with the natural constant e as its base.
7. The power consumption prediction method based on intelligent algorithms according to claim 6, characterized in that, For any cub, an adaptive balancing search strategy is used to guide the search within the solution space, resulting in the following cubs after the guided search: The adaptive equilibrium search factor is obtained as follows: in, This represents the adaptive balance search factor. This represents the average of the upper limits of all hyperparameters. This represents the average of the lower bounds of all hyperparameters; For any cub, a guided search is performed within the solution space based on the adaptive balance search factor, resulting in the following cubs after the guided search: in, Indicates the first n A lion cub, n =1,2,…,N, where N represents the total number of lion cubs. Indicates the first n A lion cub after being guided through a search, The lion cub with the smallest loss function value is represented. The Lion King represents the Lion King with the smallest loss function value; This represents the search coefficient for the lion cub, and is a random number between (0,1); Represents the first random number between (0,1); This represents an individual with the upper limit mean, and its dimensions are the same as those of a lion cub. Each dimension element is set to... ; This represents an individual with the lower bound mean, and its dimensions are the same as those of the lion cubs. Each dimension element is set to... .
8. The power consumption prediction method based on intelligent algorithms according to claim 7, characterized in that, A mutual influence search is performed on the optimal and worst individuals to obtain the optimal and worst individuals after the search, including: Based on the current total number of training iterations, the non-linear time correlation factor is obtained as follows: in, Indicates a nonlinear time-related factor; Based on the worst-case individual and the nonlinear time correlation factor, the basic influence parameters are determined as follows: in, Indicates the first d The fundamental influence parameters corresponding to the hyperparameters are The worst individual is represented by the first... d dimensional hyperparameters, Represents the first of the random individuals d The hyperparameters are defined, and the random individuals are neither the worst nor the best individuals; Based on the optimal and worst individuals, the influence control parameters are obtained as follows: in, Indicates the first d The influence control parameters corresponding to the hyperparameters. The positional evaluation parameter represents the worst-performing individual. The location evaluation parameter represents the optimal individual, and the location evaluation parameter = 1 / (loss function value + 0.001). The first element representing the optimal individual d dimensional hyperparameters, This represents the Euclidean distance between the worst and best individuals. Based on the aforementioned basic influence parameters and influence control parameters, the optimal and worst individuals are searched to obtain the optimal and worst individuals after the search: in, This represents the first optimal individual after the search. d dimensional hyperparameters, This represents the worst individual after the search. d dimensional hyperparameters, This represents the second random number between (0,1).
Citation Information
Patent Citations
Power load prediction method based on SLSO-BP
CN115587637A
MSTGCN-A thermal error modeling prediction method and system based on deep learning
CN116882289A