Electricity market user load prediction method, system, equipment and medium
By building an optimization model based on LSTM and dual Q networks in the power market user load prediction, the problems of imperfect data processing and insufficient generalization capabilities are solved, and higher prediction accuracy and model stability are achieved.
Patent Information
- Application Number
- CN202510436544.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-09
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2045-04-09
AI Technical Summary
The existing power load prediction methods lack systematic processing in dealing with missing values, outliers and multimodal features, resulting in unstable data quality and affecting the accuracy of model training. Traditional LSTM models are difficult to capture the influence of short-term fluctuations and environmental factors, resulting in large prediction errors, strong dependence on training data and insufficient generalization ability.
A user load prediction method for power market is proposed. By collecting and preprocessing power market user load data, a user load prediction model based on LSTM and dual Q network optimization is constructed. This model captures long-term dependencies in power load data through the LSTM network and uses the dual Q network to optimize the prediction results to improve the adaptability and stability of the model.
By systematically processing missing values, outliers and multimodal features, data quality and model training accuracy are improved. Innovative approaches combining LSTM and dual Q networks can more effectively capture the impact of short-term fluctuations and environmental factors, reduce prediction errors, and improve the generalization ability and adaptability of the model.
Smart Images

Figure CN119940665A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power market user load forecasting, and in particular to a power market user load forecasting method, system, equipment and medium. Background Art
[0002] In the intelligent management of the power market, user load forecasting technology occupies a core position, and its research and practice are of great importance. From the perspective of scientific research, the power consumption pattern provides a solid theoretical basis for the iterative optimization of the forecasting model. From the perspective of engineering practice, user load forecasting has a decisive influence on improving the economy and energy efficiency of the power grid. Accurate forecasting not only guides the rational allocation of power resources and reduces the construction and operation costs of the power system, but also effectively prevents power shortages or surpluses and ensures the balance between power supply and demand. Therefore, power market user load forecasting is not only a quantitative estimate of power demand in the future, but also one of the key technologies to ensure the safe, economical and efficient operation of the power system.
[0003] At present, the application of deep learning technology has significantly promoted the development of power load forecasting technology. In particular, the user load forecasting method based on the long short-term memory network (LSTM), as an advanced time series forecasting technology, has been proven to effectively capture the long-term dependencies in power load data. This method uses the unique memory capacity of the LSTM network to deeply learn the historical patterns of power consumption, thereby providing more accurate load forecasts.
[0004] Although LSTM-based power load forecasting methods have significant advantages in capturing long-term dependencies, they may face challenges in generalization capabilities on unseen data. In addition, the accuracy of LSTM models is largely limited by the quality and quantity of training data, which is particularly evident when data is scarce or of low quality. Summary of the invention
[0005] In view of the above-mentioned problems, the present invention is proposed.
[0006] Therefore, the technical problem solved by the present invention is that the existing methods usually rely on the historical load data of users for prediction, but the data processing stage lacks systematic processing of missing values, outliers and multimodal features, resulting in unstable input data quality, thereby affecting the accuracy of model training. Although the traditional LSTM model can learn the long-term dependence of time series, it is difficult to effectively capture the influence of short-term fluctuations and environmental factors, resulting in large prediction errors. In addition, the existing LSTM prediction method has a strong dependence on training data, and the generalization ability is insufficient when encountering unseen data, which is prone to overfitting, affecting the adaptability and stability of the model.
[0007] To solve the above technical problems, the present invention provides the following technical solutions: A method for predicting user load in an electricity market, comprising: collecting and preprocessing user load data in an electricity market, and dividing the preprocessed data into a training set and an evaluation set. A user load prediction model based on LSTM and dual Q network optimization is constructed, and the training set is input for single-step prediction. The user load prediction model in the electricity market is evaluated based on the evaluation set. After the evaluation is passed, the future prediction data is input into the user load prediction model to obtain the predicted user load in the electricity market. Constructing a user load prediction model based on LSTM and dual Q network optimization includes constructing an LSTM network, including an input layer, a hidden layer, and an output layer. The input layer receives a data sequence of continuous time steps, and slices the data according to a set time window to form an input sample. The hidden layer uses a memory unit to respectively calculate the influence of user power consumption, weather data, and time characteristics on the current load state, and extract the time series features that characterize the user load change pattern. The output layer generates a short-term load forecast value as a preliminary prediction result, and further inputs it into the dual Q network as a state. A dual Q network is constructed to optimize the prediction results of LSTM output. The state space of the dual Q network is composed of the time series features of LSTM output, and the action space includes the adjustment range of the predicted load value. The dual Q network includes two independent Q value networks. The first Q value network estimates the Q value of all possible actions in the current state, and the second Q value network calculates the target Q value. The parameters of the current Q value network are updated by minimizing the mean square error between the predicted value and the target Q value, and the parameters are periodically copied from the current Q value network to the target Q value network.
[0008] As a preferred solution of a method for predicting user load in a power market of the present invention, the collection of user load data in the power market and preprocessing includes obtaining user power consumption, weather data, time characteristics and socio-economic indicators, performing missing value filling, outlier detection and normalization. Interpolation is used to fill missing values. The Z-score method is used to identify outliers for outlier detection, and outliers are deleted based on statistical distribution. The min-max method is used for normalization, scaling all data to a range of -1 to 1.
[0009] As a preferred solution of a method for predicting user load in a power market of the present invention, wherein: dividing the preprocessed data into a training set and an evaluation set includes dividing according to a first division ratio.
[0010] As a preferred embodiment of a method for predicting user load in a power market of the present invention, the user load prediction model based on LSTM and dual Q network optimization is constructed, including constructing an LSTM network, including an input layer, a hidden layer and an output layer. The input layer of the LSTM network receives a data sequence of continuous time steps, and slices the data according to a set time window to form an input sample. The hidden layer of the LSTM network uses memory units to calculate the influence of user power consumption, weather data and time characteristics on the current load state, and extracts time series features that characterize the user load change pattern. The output layer of the LSTM network generates a short-term load forecast value as a preliminary forecast result, and further inputs it into the dual Q network as a state. The dual Q network is constructed to optimize the forecast result output by the LSTM, and the state space of the dual Q network is composed of the time series features output by the LSTM, and the action space includes the adjustment range of the predicted load value. Two independent Q value networks are constructed to calculate the Q values of different actions, the first Q value network estimates the Q values of all possible actions in the current state, and the second Q value network calculates the target Q value.
[0011] As a preferred embodiment of a method for predicting user load in an electricity market according to the present invention, the input of a training set for single-step prediction includes sequentially inputting the training set data into the LSTM neural network according to a set time step. During the training process, the mean square error is used as the loss function, and the Adam optimizer is used for gradient update to optimize the objective function and minimize the prediction error. After the LSTM network training is completed, the hidden state vector of the final time step is extracted as the time series feature of the load prediction, and the time series feature of the load prediction is input into the dual Q network to calculate the adjustment amount of the predicted load value. During the training process, the dual Q network adopts a target Q value update strategy to calculate the error between the current Q value and the target Q value and optimize the model parameters. The experience replay mechanism is adopted to store historical training samples, and past samples are randomly selected for training when the strategy is updated.
[0012] As a preferred embodiment of a method for predicting user load in a power market of the present invention, the evaluation of the user load prediction model in the power market based on the evaluation set includes calculating the error between the predicted value and the actual value, using the mean square error, the mean absolute error and the determination coefficient as evaluation indicators to judge the prediction ability of the model. If the mean square error and the mean absolute error are lower than the preset threshold value, and the determination coefficient is in the range of 0.95-1, the model meets the actual prediction requirements, otherwise the model is optimized.
[0013] As a preferred solution of a method for predicting user load in a power market of the present invention, the predicted user load in the power market includes inputting prediction data for a future time period, using the trained LSTM and dual Q network models for load prediction, and storing and outputting the prediction results. A rolling prediction strategy is adopted in the prediction process, and the latest prediction value is used as the input for the next step based on each step of prediction. The prediction results are stored in a database, and a real-time query function is provided through an API interface.
[0014] Another object of the present invention is to provide an electricity market user load forecasting system based on LSTM and dual Q network, which can obtain the predicted electricity market user load by constructing a user load forecasting model based on LSTM and dual Q network optimization, thereby solving the problems of imperfect data processing, large prediction error, low model generalization ability and insufficient optimization adjustment in the current LSTM-based electricity market user load forecasting method.
[0015] As a preferred solution of the system of the method for predicting user load in the power market of the present invention, it includes: a pre-processing and data set division module, a training model module, and an evaluation and prediction module.
[0016] The preprocessing and data set division module is used to collect and preprocess user load data in the power market, and divide the preprocessed data into a training set and an evaluation set.
[0017] The training model module is used to build a user load forecasting model based on LSTM and dual Q network optimization, and input the training set for single-step forecasting.
[0018] The evaluation and prediction module is used to evaluate the power market user load prediction model based on the evaluation set to obtain the predicted power market user load.
[0019] A computer device comprises a memory and a processor. The memory stores a computer program. The processor executes the computer program to implement a method for predicting user load in an electricity market.
[0020] A computer-readable storage medium stores a computer program, which implements the steps of a method for predicting user load in an electricity market when executed by a processor.
[0021] Beneficial effects of the present invention: In the process of constructing a power market user load forecasting model, a power market user load forecasting method provided by the present invention not only considers the traditional indicator of user power consumption, but also introduces multiple influencing factors such as temperature, holidays, and residents' average monthly income. This comprehensive consideration method can more comprehensively capture the external variables that affect the power load, thereby improving the accuracy and reliability of the forecasting model. The present invention adopts an LSTM network to capture the long-term dependencies in the power load data, and combines the autonomous learning ability of the dual Q network. This innovative fusion method not only enhances the model's ability to identify long-term trends, but also improves the model's adaptability to environmental changes through a reinforcement learning mechanism, and improves the accuracy of the forecasting results and the generalization ability of the model. The present invention provides a more accurate and efficient technical solution in the field of power market user load forecasting, which has important practical value and broad application prospects. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0023] Figure 1 An overall flow chart of a method for predicting user load in a power market provided by the first embodiment of the present invention.
[0024] Figure 2 This is a model comparison curve diagram of a method for predicting user load in a power market provided in the second embodiment of the present invention. DETAILED DESCRIPTION
[0025] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in the art without creative work should fall within the scope of protection of the present invention.
[0026] Example 1, reference Figure 1 , is an embodiment of the present invention, and provides a method for predicting user load in a power market, comprising:
[0027] S1: Collect user load data in the power market, preprocess it, and divide it into training set and evaluation set.
[0028] Obtain user power consumption, weather data, time characteristics and socio-economic indicators, perform missing value filling, outlier detection and normalization, and divide according to the first division ratio.
[0029] It should be noted that the data obtained needs to ensure comprehensive coverage of factors affecting power load, as shown in Table 1.
[0030] Table 1 Index table of power market user load forecasting dataset index Indicator Type Indicator Unit Example User power consumption Numeric Spend 54,999,… date Time Type Year-Month-Day 2020-01-01,… month Character moon 1,2,3,…,12 Week Character Week One, two, three, ..., seven Is it a holiday? Character none whether Festival Category Character none New Year's Day, Spring Festival, Qingming Festival,... Average temperature Numeric Celsius 20,-2,… humidity Numeric percentage 20,70,… Wind speed Numeric class 1,2,… Rainfall Numeric Millimeters 10,23,… Average monthly income of residents Numeric Yuan 3454,5677,…
[0031] It should be noted that a preferred solution for filling missing values, detecting outliers and normalizing includes using interpolation to fill missing values. The Z-score method is used to identify outliers for outlier detection, and outliers are deleted based on statistical distribution. The min-max method is used for normalization, and all data are scaled to a range of -1 to 1. For missing values in the data, interpolation is used to fill them. According to the trend of adjacent time points, continuous data is linearly interpolated. For periodic features, such as holiday effects, the data of the nearest similar period is used to complete. For outliers in the data set, an anomaly detection method based on standard distribution is used to calculate the statistical distribution of the data, identify outliers that deviate from the mean by more than a set multiple, and decide whether to correct or delete them according to the degree of the outlier. The degree of outliers includes calculating the mean and standard deviation of the data, judging whether the data point exceeds the preset range, and if it exceeds the range, it is adjusted based on the distribution of historical data, or the outliers are removed in extreme cases. For user power consumption data, the average value over the past period is calculated, and the abnormal value range based on the standard deviation is set so that the data points fall within the standard deviation range of the mean plus or minus a fixed multiple. Data points outside this range are considered abnormal. For user power consumption data with large short-term fluctuations, the abnormal value detection threshold is set to the mean plus or minus three times the standard deviation to ensure that data fluctuations during peak or trough load periods will not be misjudged as abnormalities, and data points outside this range are removed. For weather data, including temperature, humidity, wind speed, and precipitation, the abnormal value range is set according to the change law of historical meteorological data. The temperature abnormal range is set to plus or minus two times the standard deviation of the historical mean, the humidity is set to plus or minus three times the standard deviation, the wind speed is set to plus or minus two and a half times the standard deviation, and the precipitation is set to plus or minus four times the standard deviation to adapt to changes in different seasons and sudden weather conditions. For time characteristics, including weekdays, weekends, and holidays, determine whether there is a sudden abnormal power consumption. The abnormal value range is set to the mean of the load data in the same time period in history plus or minus two times the standard deviation, and the abnormal judgment standard is adjusted in combination with holiday consumption behavior. For socioeconomic indicators such as residents' income levels, stricter outlier criteria are set due to the relatively slow changes in data. The outlier range is the historical mean plus or minus 1.5 times the standard deviation to avoid short-term fluctuations affecting the overall stability of the data. After determining that the data is abnormal, if the data point deviates from the normal range but is still within the correctable range, the weighted mean of the adjacent time points is used for adjustment to maintain data continuity. If the data point deviates significantly from the historical trend or exceeds the extreme threshold, it is marked as an anomaly and removed to ensure the rationality and consistency of the data. In the data normalization process, the normalization transformation method is used to scale all feature data to a unified interval to eliminate the impact of data dimensions so that different types of data can be modeled and trained at the same scale.The normalization process uses the minimum and maximum scaling method to convert the data into standardized data within a specific range by calculating the minimum and maximum values of the data, ensuring that the numerical weights of different features remain consistent.
[0032] Furthermore, a preferred solution for dividing according to the first division ratio specifically includes: the first division ratio is set to 8:2, and the ratio can be dynamically adjusted in actual applications.
[0033] S2: Build a user load forecasting model based on LSTM and dual Q network optimization, and input the training set for single-step forecasting.
[0034] Construct an LSTM network, including an input layer, a hidden layer, and an output layer. The input layer of the LSTM network receives a data sequence of continuous time steps, and slices the data according to the set time window to form an input sample. The hidden layer of the LSTM network uses memory units to calculate the impact of user power consumption, weather data, and time characteristics on the current load state, and extracts time series features that characterize the user load change pattern. The output layer of the LSTM network generates a short-term load forecast value as a preliminary forecast result, and further inputs it into the dual Q network as a state. Construct a dual Q network to optimize the forecast results of the LSTM output. The state space of the dual Q network is composed of the time series features of the LSTM output, and the action space includes the adjustment range of the predicted load value. Construct two independent Q value networks to calculate the Q values of different actions. The first Q value network estimates the Q values of all possible actions in the current state, and the second Q value network calculates the target Q value.
[0035] Furthermore, a preferred solution for constructing an LSTM network specifically includes, based on the training data set, first determining the input variables, including the user's historical power consumption, time characteristics, weather data, and socioeconomic indicators, and dividing the time window so that the data is input into the LSTM network in a sliding window manner. The input layer of the LSTM network receives multidimensional data within the set time window, and organizes the data structure according to the time step, so that the model can learn the time correlation of the load data, and the input data is arranged in the order of the time series, and each time step corresponds to a data point of a time segment. The hidden layer of the LSTM network is composed of multiple recurrent units, each of which controls the flow of information through a gating mechanism, and calculates the influence of the user's power consumption, weather characteristics, and time factors on the current load state respectively. The forget gate determines whether to retain past information, the input gate adjusts the state update in combination with the current input data, and the output gate generates the output of the current state based on the information of the previous time step. In the hidden layer, the calculation of each time step depends on the state information of the previous time step, so that the LSTM can extract the historical load pattern and learn long-term dependencies to adapt to the periodicity and mutation of the power load. The output layer of the LSTM network receives the final state of the hidden layer and maps it to the load forecast value through the fully connected layer to generate a short-term load forecast result, which can be used as an independent forecast value or as the input state of the subsequent double Q network.
[0036] Furthermore, a preferred solution for constructing a dual Q network specifically includes constructing a dual Q network based on the prediction results output by LSTM to optimize the load prediction accuracy and improve the generalization ability of the model, wherein the input state of the dual Q network is composed of the final hidden state vector of LSTM, reflecting the time series characteristics of the load data. The structure of the dual Q network includes a state space, an action space and a reward function, the state space is composed of the time series characteristics output by LSTM, and the action space represents the adjustment amount of the predicted load value, which is defined in the range of [-δ,δ], allowing the model to be adjusted based on the prediction to reduce the error. The dual Q network is composed of two independent Q value networks, one of which is used to estimate the Q value of each possible action in the current state, and the other Q value network is used to calculate the target Q value to reduce the problem of overestimation of the Q value. The target Q value calculation adopts a time difference update method, so that the model can gradually adjust the prediction strategy during the training process. Each Q value network has an input layer, a hidden layer and an output layer. The input layer receives the state vector, the hidden layer includes at least two layers of neurons, and the number of neurons in each layer is not less than 64, and the output layer outputs the Q value of the action. The state space is composed of the time series features of the LSTM output, and the action space is defined as the adjustment range of the predicted load value, specifically [-δ,δ], where δ is the preset adjustment step size. The action selection adopts the ε-greedy strategy. In the early stage of training, random actions are selected with a large random probability ε. As the training progresses, ε is gradually reduced to increase the probability of selecting the action with the maximum Q value in the current state. The update strategy includes parameter updates of the current Q value network and the target Q value network. The parameters of the current Q value network are updated by minimizing the mean square error between the predicted value and the target Q value, and the parameters of the target Q value network are regularly copied from the current Q value network. During the training process of the dual Q network, the current Q value is first calculated, and the current optimal action is selected according to the reinforcement learning strategy. The corresponding target Q value is calculated by the second Q value network, and the parameters of the policy network are updated to make the predicted value gradually approach the real load data.
[0037] It should be noted that the combined design of LSTM and dual Q network enables the model to extract long-term dependency information by utilizing the time series modeling capability of LSTM, and to optimize the prediction error through the dual Q network to improve the generalization ability of unseen data. This solves the problem of insufficient generalization ability of the traditional LSTM model in load forecasting, making the model more stable in the short-term forecasting task of power load, and optimizes the prediction error through reinforcement learning strategy, improving the adaptability to dynamic changes in load, thereby avoiding the problem of reduced accuracy of fixed parameter models in changing environments.
[0038] Single-step prediction includes inputting the training set data into the LSTM neural network in sequence according to the set time step. During the training process, the mean square error is used as the loss function, and the Adam optimizer is used for gradient update to optimize the objective function and minimize the prediction error. After the LSTM network training is completed, the hidden state vector of the final time step is extracted as the time series feature of the load forecast, and the time series feature of the load forecast is input into the dual Q network as the state space to calculate the adjustment amount of the predicted load value. During the training process, the dual Q network adopts the target Q value update strategy to calculate the error between the current Q value and the target Q value and optimize the model parameters. The experience replay mechanism is adopted to store historical training samples, and randomly extract past samples for training when updating the strategy.
[0039] Furthermore, a preferred solution for single-step prediction specifically includes converting the hidden state vector of LSTM into the state space of the dual Q network. After the LSTM training is completed, the hidden state vector of the final time step is extracted, which contains the encoding information of the time series features of the LSTM network, and is directly used as the input state vector of the dual Q network. The training process of coordinating the two networks includes first training the LSTM network with the training set data until the loss function converges. Then the output of LSTM is used as the input of the dual Q network, and the dual Q network is trained using a reinforcement learning method, in which the experience replay mechanism is used to store historical training samples, and past samples are randomly selected for training when updating the strategy to improve the stability and generalization ability of the model.
[0040] S3: Evaluate the power market user load forecasting model based on the evaluation set. After the evaluation is passed, input the future forecast data into the user load forecasting model to obtain the predicted power market user load.
[0041] The error between the predicted value and the actual value was calculated, and the mean square error, mean absolute error, and determination coefficient were used as evaluation indicators to determine the prediction ability of the model.
[0042] It should be noted that a preferred solution for using mean square error, mean absolute error and coefficient of determination as evaluation indicators includes: the average error between the true value and the predicted value It is expressed as: , in, Indicates the actual load value. represents the model predicted load value, Represents the total number of samples input into the model. Represents the index of the input model sample.
[0043] The mean absolute error between the true value and the predicted value It is expressed as: , Coefficient of determination It is expressed as: , in, Represents the mean of all actual load values.
[0044] If the mean square error and mean absolute error are lower than the preset thresholds and the determination coefficient is close to 1, the model meets the actual prediction requirements, otherwise the model is optimized.
[0045] Furthermore, based on the distribution characteristics of the historical load data of the electricity market users, the preset threshold of the mean square error is set to 0.02. The threshold of the mean absolute error is set based on the fluctuation of the user load. By counting the load fluctuation range in different time periods, it is ensured that the error value does not exceed the normal load fluctuation range. The threshold of the mean absolute error is set to 0.15 in the present invention. The threshold of the determination coefficient is set according to the model fit requirements to ensure that the prediction results of the model can highly fit the actual load data. The experimental results on different evaluation sets show that when the determination coefficient is close to one, the prediction effect of the model is optimal, so the threshold of the determination coefficient is finally set to 0.95.
[0046] Furthermore, if the evaluation results meet the requirements of mean square error less than 0.02, mean absolute error less than 0.15, and determination coefficient greater than 0.95 and less than 1, the prediction ability of the model is considered to meet the actual application requirements. If the evaluation results fail to meet the preset threshold, the model is optimized by adjusting the hyperparameters of LSTM and double Q network, including learning rate, number of hidden layer neurons and training rounds, or expanding the training data set to improve the generalization ability of the model until the evaluation indicators meet the set standards.
[0047] Input future forecast data into the user load forecasting model to obtain the predicted power market user load, including inputting forecast data for future time periods, including user power consumption, weather data, time characteristics, and socioeconomic indicators for the next month. Use the trained LSTM and dual Q network models for load forecasting, and store and output the forecast results. A rolling forecasting strategy is used in the forecasting process. Based on each step of the forecast, the latest forecast value is used as the input for the next step. The forecast results are stored in the database, and real-time query functions are provided through the API interface.
[0048] Example 2, reference Figure 2 , which is an embodiment of the present invention, provides a method for predicting user load in an electricity market. In order to verify the beneficial effects of the present invention, a scientific demonstration is carried out through simulation experiments.
[0049] In this embodiment, the historical load data of users in a certain area of the power grid are selected, and the data is sampled with a time step of 15 minutes to construct a time series input. The simulation experiment builds a prediction model based on LSTM and double Q network, and compares and analyzes it with the traditional LSTM model to evaluate the performance of this method in unified load forecasting.
[0050] like Figure 2 As shown in the figure, the comparison curves of Q-LearningLSTM model, traditional LSTM model and real data are plotted. The horizontal axis represents time (in days), and the vertical axis represents user load (time-sharing value of unified load regulation). The experimental results show that the Q-LearningLSTM model can more accurately capture the changing trend of load and provide better prediction results in time periods with large load peak and valley changes (such as noon and night). In contrast, the traditional LSTM model has large errors in periods with drastic load fluctuations, while the method of the present invention optimizes the weight update strategy of LSTM through the reinforcement learning mechanism, thereby improving the generalization ability and prediction accuracy of the model.
[0051] Embodiment 3 is an embodiment of the present invention, which provides a power market user load forecasting system based on LSTM and dual Q network, including a preprocessing and data set partitioning module, a training model module, and an evaluation and prediction module.
[0052] The module for preprocessing and dividing data sets is used to collect user load data in the power market, perform preprocessing, and divide the preprocessed data into training sets and evaluation sets.
[0053] The training model module is used to build a user load forecasting model based on LSTM and dual Q network optimization, and input the training set for single-step prediction.
[0054] The evaluation and prediction module is used to evaluate the power market user load prediction model based on the evaluation set to obtain the predicted power market user load.
[0055] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0056] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.
[0057] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic devices), a portable computer disk case (magnetic devices), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.
[0058] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logical function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc. It should be noted that the above embodiments are only used to illustrate the technical solution of the present invention and are not limited. Although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention, which should be included in the scope of the claims of the present invention.
Claims
1. A method for predicting user load in a power market, characterized in that: include: Collect and preprocess the user load data of the power market, and divide the preprocessed data into a training set and an evaluation set; Build a user load forecasting model based on LSTM and dual Q network optimization, and input the training set for single-step forecasting; The power market user load forecasting model is evaluated based on the evaluation set. After the evaluation is passed, the future forecast data is input into the user load forecasting model to obtain the predicted power market user load; Building a user load forecasting model based on LSTM and dual Q network optimization includes building an LSTM network, including an input layer, a hidden layer, and an output layer; The input layer receives a data sequence of continuous time steps and slices the data according to the set time window to form input samples; The hidden layer uses memory units to calculate the impact of user power consumption, weather data and time characteristics on the current load state, and extract the time series features that characterize the user load change pattern; The output layer generates short-term load forecast values as preliminary forecast results, which are further input into the dual Q network as states; A double Q network is constructed to optimize the prediction results of LSTM output. The state space of the double Q network is composed of the time series features of LSTM output, and the action space includes the adjustment range of the predicted load value. The dual Q-value network consists of two independent Q-value networks. The first Q-value network estimates the Q-values of all possible actions in the current state, and the second Q-value network calculates the target Q-value. The parameters of the current Q-value network are updated by minimizing the mean square error between the predicted value and the target Q-value, and the parameters are periodically copied from the current Q-value network to the target Q-value network.
2. A method for predicting user load in a power market according to claim 1, characterized in that: The collecting and preprocessing of power market user load data includes: Obtain user power consumption, weather data, time characteristics, and socioeconomic indicators, and perform missing value filling, outlier detection, and normalization processing; Interpolation method is used to fill missing values; The Z-score method is used to identify outliers for outlier detection, and outliers are deleted based on statistical distribution; The min-max method was used for normalization, scaling all data to the range of -1 to 1.
3. A method for predicting user load in a power market according to claim 1 or 2, characterized in that: The dividing of the preprocessed data into a training set and an evaluation set includes: Divide according to the first division ratio.
4. A method for predicting user load in a power market according to claim 3, characterized in that: The construction of the user load forecasting model based on LSTM and dual Q network optimization includes: Construct an LSTM network, including input layer, hidden layer and output layer; The LSTM network input layer receives the data sequence of continuous time steps and slices the data according to the set time window to form input samples; The hidden layer of the LSTM network uses memory units to calculate the impact of user power consumption, weather data, and time characteristics on the current load state, and extract time series features that characterize the user load change pattern; The output layer of the LSTM network generates short-term load forecast values as preliminary forecast results, which are further input into the dual Q network as states; A double Q network is constructed to optimize the prediction results of LSTM output. The state space of the double Q network is composed of the time series features of LSTM output, and the action space includes the adjustment range of the predicted load value. Construct two independent Q-value networks to calculate the Q-values of different actions. The first Q-value network estimates the Q-values of all possible actions in the current state, and the second Q-value network calculates the target Q-value.
5. A method for predicting user load in a power market according to any one of claims 1, 2 or 4, characterized in that: The input training set for single-step prediction includes: Input the training set data into the LSTM neural network in sequence according to the set time step; During the training process, the mean square error is used as the loss function, and the Adam optimizer is used to update the gradient, optimize the objective function, and minimize the prediction error; After the LSTM network training is completed, the hidden state vector of the final time step is extracted as the time series feature of the load forecast, and the time series feature of the load forecast is input into the double Q network to calculate the adjustment amount of the predicted load value; During the training process, the dual Q network adopts the target Q value update strategy to calculate the error between the current Q value and the target Q value and optimize the model parameters; An experience replay mechanism is used to store historical training samples, and past samples are randomly selected for training when updating the strategy.
6. A method for predicting user load in a power market according to claim 5, characterized in that: The evaluation of the power market user load forecasting model based on the evaluation set includes: Calculate the error between the predicted value and the actual value, and use the mean square error, mean absolute error, and determination coefficient as evaluation indicators to determine the prediction ability of the model; If the mean square error and mean absolute error are lower than the preset thresholds and the coefficient of determination is in the range of 0.95-1, the model meets the actual prediction requirements, otherwise the model is optimized.
7. A method for predicting user load in a power market according to any one of claims 1, 2, 4 or 6, characterized in that: The predicted power market user load includes: Input forecast data for future time periods, use the trained LSTM and dual Q network models to perform load forecasting, and store and output the forecast results; The rolling forecast strategy is adopted in the forecast process. Based on each step of forecast, the latest forecast value is used as the input for the next step. The prediction results are stored in the database, and real-time query functions are provided through the API interface.
8. A system for predicting user load in the power market, characterized by: It includes modules for preprocessing and partitioning data sets, training models, and evaluation and prediction; The preprocessing and data set division module is used to collect and preprocess the user load data of the power market, and divide the preprocessed data into a training set and an evaluation set; The training model module is used to build a user load forecasting model based on LSTM and dual Q network optimization, and input the training set for single-step forecasting; The evaluation and prediction module is used to evaluate the power market user load prediction model based on the evaluation set to obtain the predicted power market user load.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of a method for predicting user load in a power market as described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of a method for predicting user load in a power market according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Power short-term load prediction method based on deep reinforcement learning and transfer learning
CN116306229A
Electric power load prediction method and prediction device based on LSTM network model
CN117521724A
User trajectory prediction and unmanned aerial vehicle path planning method in real geographical environment
CN118915814A
Short-term load prediction method and system based on LSTM-DNN hybrid neural network
CN118970924A
Power dispatching method and system based on power load prediction
CN119029836A
Cited By
Model training method, electric load prediction method, equipment and storage medium
CN120354380A
Power load prediction method and device
CN120933946A
A power load forecasting method and apparatus
CN120933946B
Semi-real-time prediction model updating method based on double-model parallel verification
CN122114687A
Semi-real-time predictive model updating method based on parallel verification of double models
CN122114687B