CN115186887A - Multithreading parallel computing power load prediction method based on LSTM - Google Patents

Multithreading parallel computing power load prediction method based on LSTM Download PDF

Info

Publication number
CN115186887A
CN115186887A CN202210768886.9A CN202210768886A CN115186887A CN 115186887 A CN115186887 A CN 115186887A CN 202210768886 A CN202210768886 A CN 202210768886A CN 115186887 A CN115186887 A CN 115186887A
Authority
CN
China
Prior art keywords
data
thread
prediction
power load
threads
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210768886.9A
Other languages
Chinese (zh)
Inventor
秦虹
宗明
代杰杰
赵熠旖
朱洪成
谢婧
黄嵩
陆黎
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
State Grid Shanghai Electric Power Co Ltd
Original Assignee
State Grid Shanghai Electric Power Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by State Grid Shanghai Electric Power Co Ltd filed Critical State Grid Shanghai Electric Power Co Ltd
Priority to CN202210768886.9A priority Critical patent/CN115186887A/en
Publication of CN115186887A publication Critical patent/CN115186887A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/04Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/063Operations research, analysis or management
    • G06Q10/0639Performance analysis of employees; Performance analysis of enterprise or organisation operations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q50/00Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
    • G06Q50/06Energy or water supply
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y04INFORMATION OR COMMUNICATION TECHNOLOGIES HAVING AN IMPACT ON OTHER TECHNOLOGY AREAS
    • Y04SSYSTEMS INTEGRATING TECHNOLOGIES RELATED TO POWER NETWORK OPERATION, COMMUNICATION OR INFORMATION TECHNOLOGIES FOR IMPROVING THE ELECTRICAL POWER GENERATION, TRANSMISSION, DISTRIBUTION, MANAGEMENT OR USAGE, i.e. SMART GRIDS
    • Y04S10/00Systems supporting electrical power generation, transmission or distribution
    • Y04S10/50Systems or methods supporting the power network operation or management, involving a certain degree of interaction with the load-side end user applications

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Human Resources & Organizations (AREA)
  • Economics (AREA)
  • Physics & Mathematics (AREA)
  • Strategic Management (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • Marketing (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Development Economics (AREA)
  • Health & Medical Sciences (AREA)
  • Tourism & Hospitality (AREA)
  • General Health & Medical Sciences (AREA)
  • Educational Administration (AREA)
  • Quality & Reliability (AREA)
  • Operations Research (AREA)
  • Game Theory and Decision Science (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Water Supply & Treatment (AREA)
  • Artificial Intelligence (AREA)
  • Biomedical Technology (AREA)
  • Primary Health Care (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Public Health (AREA)
  • Evolutionary Computation (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Computing Systems (AREA)
  • Molecular Biology (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Supply And Distribution Of Alternating Current (AREA)

Abstract

The invention discloses a multithreading parallel computing power load prediction method based on LSTM, which comprises the following steps of 1, data processing; step 2, a prediction step; and 3, training. According to the invention, a neural network is constructed at the beginning of each thread, and all distribution transformers in the thread use the same network, so that the time for constructing the neural network is reduced; after a thread calculates a certain distribution transformation quantity, the thread is closed and a round of threads are started again, and the efficiency reduction caused by the increase of the calculation distribution transformation is eliminated; an array is newly established in the thread, the predicted data of the thread is stored in the array, and when the distribution task of the thread is completely finished, the predicted data of the thread is uniformly stored in the global array, so that the problem of thread locking is reduced to the greatest extent; in order to meet the requirements of accuracy and efficiency at the same time, a prediction program and a training program are separated, so that the LSTM neural network power load prediction with high calculation efficiency is realized.

Description

Multithreading parallel computing power load prediction method based on LSTM
Technical Field
The invention relates to an LSTM-based multithreading parallel computing power load prediction method which is used in the field of power load prediction and operation.
Background
The power demand has the characteristic of real-time change, and the power system cannot store electric energy in a large quantity, so that the generated energy of the system and the change of the load are required to reach a dynamic balance state. The timeliness of economic dispatch and the utilization rate of the power generation device can be improved by improving the power load prediction accuracy. In order to meet the actual production requirements, the prediction result needs to be output in time on the premise of meeting the accuracy. The LSTM model (Long Short-Term Memory artificial neural network) has high accuracy, but needs a large amount of training for new data every day, and has low calculation efficiency. If all the distribution transformers are predicted by adopting the LSTM model, the distribution transformer prediction result in a large area range cannot be output in one day.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provide a multithreading parallel computing power load forecasting method based on an LSTM (least Square TM), which can improve the computing efficiency of an LSTM model for power load forecasting.
One technical scheme for achieving the above purpose is as follows: a multithread parallel computing power load prediction method based on LSTM comprises the following steps:
step 1, data processing, specifically comprising:
step 1.1, a database reads specified time data;
step 1.2, classifying the data of the appointed time into m data sets according to ID;
step 1.3, sorting the data in each data set according to time;
step 1.4, preprocessing the sorted data;
and 2, predicting, wherein the specific steps comprise:
step 2.1, starting a thread n;
step 2.2, building a neural network;
step 2.3, reading the ith data set;
step 2.4, reading corresponding hyper-parameters;
step 2.5, predicting the power load;
step 2.6, storing the prediction data into a global array;
step 2.7, judging whether i is less than or equal to the calculation configuration number of each thread, if so, returning to the step 2.3 to read the (i + 1) th data set, if not, continuously judging whether i is less than the total configuration variable number, if so, counting i is increased by 1 and n threads are closed, otherwise, closing 33 threads, storing all the prediction data into a database and entering the step 3;
step 3, training, specifically comprising:
step 3.1, starting a thread n;
step 3.2, building a neural network;
step 3.3, reading the ith data set;
step 3.4, reading corresponding hyper-parameters;
step 3.5, training the power load prediction model;
step 3.6, updating the hyper-parameters;
and 3.7, judging whether i is less than or equal to the calculation configuration number of each thread, if so, returning to the step 3.3 to read the (i + 1) th data set, otherwise, continuously judging whether i is less than the total configuration variable number, if so, adding 1 to the count of i and closing n threads, otherwise, closing 33 threads, and ending the program.
Further, step 1.4, preprocessing the sorted data specifically includes supplementing missing data, deleting deviating data, and normalizing the data.
The multithreading parallel computing power load prediction method based on the LSTM improves the computing efficiency by adopting the following method:
1. at the beginning of each thread, a neural network is constructed, and all the distribution transformers in the thread use the same network, so that the time for constructing the neural network is reduced;
2. after a thread calculates a certain distribution transformation quantity, the thread is closed and a round of threads are started again, and the efficiency reduction caused by the increase of the calculation distribution transformation is eliminated;
3. when the local data is stored in the global array, the system automatically generates a thread lock to stop other threads from rewriting the global array. Therefore, an array is newly built in the thread, the prediction data of the thread is stored in the array, and when the distribution task of the thread is completely finished, the prediction data of the thread is uniformly stored in the global array. Because a plurality of prediction and training parts of the distribution transformer are operated, the process of each thread generates certain deviation, when one thread rewrites the global array, other threads still perform prediction or finish operation, and the problem of thread lock is reduced to the maximum extent;
4. to meet both accuracy and efficiency, the prediction program and the training program are separated. When yesterday data is input, the distribution transformer load is predicted by using the existing hyper-parameters, and after all distribution transformer predictions are finished, the input new data is used for training and updating the hyper-parameters.
Drawings
Fig. 1 is a schematic flow chart of a method for predicting an electrical load of an LSTM-based multithreaded parallel computing according to the present invention.
Detailed Description
In order to better understand the technical solution of the present invention, the following detailed description is given by specific examples:
the common LSTM load prediction method needs to be subjected to complete data set construction, network construction, fixed-time training and output during each operation. Through practical tests, data of a distribution transformer in one month are trained on a computer with a processor of i5 9400, the training times are 70, the number of three-layer networks is 8, and the time is about 15 minutes. When running on a large server (20-core processor), the time required is not less than 12 minutes, since the tenserflow platform is not multi-threaded. Such operating efficiency cannot meet daily forecasted demand as the number of loads increases.
The invention discloses an LSTM-based multithreading parallel computing power load forecasting method, which provides a solution for improving the efficiency of an LSTM long-term and short-term memory neural network in a large-scale power load forecasting scene, and the solution comprehensively comprises the following points:
1) The neural network hyper-parameters are reserved and recovered, and the training times are reduced
In practical short-term prediction applications, the algorithm needs to give a prediction value every day for a certain period of time. Between every two days, the dataset gap includes only one newly added day, and the percentage of this newly added data in the entire dataset is typically small. Thus, there is no need to start training again from 0 every day. The first day of program deployment is removed, and training based on a new data set is started on the basis of the original training result from the second day, so that the subsequent calculation speed can be greatly improved on the premise of not influencing the accuracy of the algorithm.
The adjustment made by the neural network training is to update the hyper-parameters of the network, so that the hyper-parameters are reserved and stored after each training is finished, the influence of early training data on the hyper-parameters of the network is saved, and the hyper-parameters are read when a subsequent program runs, so that repeated training can be avoided; meanwhile, the subsequent training set is adjusted, the proportion of the recent data is increased, and the influence weight of the recent data on the network hyperparameters is also increased. Through the two modes, the training times in the subsequent training can be reduced, so that the occupation of computing resources is reduced, and the efficiency is improved.
2) Multithread calculation for solving corresponding problems
When the LSTM is used for load prediction, the prediction and training time of program operation is longer. If the method is applied to a large-scale load prediction scene, the total time consumption of prediction and training exceeds the number of days which can be predicted, so that the actual load data is obtained when the prediction result is obtained. The prediction program loses meaning.
In actual environment, the CPU occupancy rate of the system is low and is about 3% when the load prediction program is operated. The utilization rate of system resources is low, and there are two main reasons as follows:
1. the system has a small number of cpu cores allocated to the program.
2. The neural network has a part with insufficient CPU utilization rate in the process of building, training and predicting.
Therefore, the utilization rate of system resources is improved by utilizing multiple threads, and the load forecasting efficiency is improved. The load prediction program is used as one thread, and a plurality of threads are started simultaneously. Gradual increase in the utilization of the system cpu is observed. The prediction time of each distribution transformer load is not effectively improved after the measurement and the calculation. The following problems mainly exist:
1. the database does not support simultaneous access of a plurality of threads, and when a certain thread operates the database, other threads need to stop running through the thread lock. And the database needs to be read and written in each thread, so that the database reading and writing time of other threads needs to be increased when the running time of one thread is increased.
2. Because the time required for screening in the database is long, when a plurality of threads run, the database reading time is far longer than the training and prediction time of the neural network
3. As the number of threads increases, the efficiency of a single thread decreases.
In order to solve the problems, firstly, indexes are added to the time and the distribution transform name of the database to improve the data reading efficiency of the database. Under the condition that the memory is enough, before the load prediction program, the data of all the distribution variables in the set time is read into the memory at one time, so that the database is prevented from being read for many times. Meanwhile, the data of each prediction is stored into a global array, and the data is stored into the database once after the prediction is finished. Therefore, the problem that other threads stop running due to the fact that the database is read and written in the threads is solved, and efficiency is improved. And simultaneously, uniformly preprocessing the read data.
The basic multithreading structure is built, the problems are solved, but the operation efficiency still cannot meet the requirements, and the following new problems mainly exist:
1. the neural network needs to be reconstructed every time a new distribution change is calculated in each thread, and the proportion of the neural network in the total time is large.
2. When the method is applied to large-scale loads, the efficiency of the threads is gradually reduced along with the increase of the calculation distribution change.
3. When the predicted data is stored in the global array, the time occupation ratio is too long.
To solve the above problems, the following solutions may be adopted:
1. at the beginning of each thread, a neural network is constructed, and all the distribution transformers in the thread use the same network, so that the time for constructing the neural network is reduced.
2. After a certain distribution change number is calculated by one thread, the thread is closed and a round of threads are opened again, and the efficiency reduction caused by the increase of the calculation distribution change is eliminated.
3. When the local data is stored in the global array, the system automatically generates a thread lock to stop other threads from rewriting the global array. Therefore, an array is newly built in the thread, the prediction data of the thread is stored in the array, and when the distribution task of the thread is completely finished, the prediction data of the thread is uniformly stored in the global array. Because a plurality of prediction and training parts of the distribution transformer are operated, the process of each thread generates certain deviation, when one thread rewrites the global array, other threads still perform prediction or finish operation, and the problem of thread lock is reduced to the maximum extent.
4. To meet both accuracy and efficiency, the prediction program and the training program are separated. When yesterday data is input, the distribution transformer load is predicted by using the existing hyper-parameters, and after all distribution transformer predictions are finished, the input new data is used for training and updating the hyper-parameters.
Referring to fig. 1, the method for predicting the electrical load of the multithreaded parallel computing based on the LSTM of the present invention includes the following steps:
step 1, data processing, specifically comprising:
step 1.1, a database reads specified time data;
step 1.2, classifying the data of the appointed time into m data sets according to ID;
step 1.3, sorting the data in each data set according to time;
step 1.4, preprocessing the sorted data; preprocessing the sorted data specifically comprises supplementing missing data, deleting deviating data and standardizing the data;
and 2, predicting, wherein the specific steps comprise:
step 2.1, starting a thread n;
step 2.2, building a neural network;
step 2.3, reading the ith data set;
step 2.4, reading corresponding hyper-parameters;
step 2.5, predicting the power load;
step 2.6, storing the prediction data into a global array;
step 2.7, judging whether i is less than or equal to the calculation configuration number of each thread, if so, returning to the step 2.3 to read the (i + 1) th data set, if not, continuously judging whether i is less than the total configuration variable number, if so, counting i is increased by 1 and n threads are closed, otherwise, closing 33 threads, storing all the prediction data into a database and entering the step 3;
step 3, training, specifically comprising:
step 3.1, starting a thread n;
step 3.2, building a neural network;
step 3.3, reading the ith data set;
step 3.4, reading corresponding hyper-parameters;
step 3.5, training the power load prediction model;
step 3.6, updating the hyper-parameters;
and 3.7, judging whether i is less than or equal to the calculation configuration number of each thread, if so, returning to the step 3.3 to read the (i + 1) th data set, otherwise, continuously judging whether i is less than the total configuration variable number, if so, adding 1 to the count of i and closing n threads, otherwise, closing 33 threads, and ending the program.
It should be understood by those skilled in the art that the above embodiments are only for illustrating the present invention and are not to be used as a limitation of the present invention, and that changes and modifications to the above described embodiments are within the scope of the claims of the present invention as long as they are within the spirit and scope of the present invention.

Claims (2)

1. A multithreading parallel computing power load prediction method based on LSTM is characterized by comprising the following steps:
step 1, data processing, specifically comprising:
step 1.1, a database reads specified time data;
step 1.2, classifying the data of the appointed time into m data sets according to ID;
step 1.3, sorting the data in each data set according to time;
step 1.4, preprocessing the sorted data;
and 2, predicting, wherein the specific steps comprise:
step 2.1, starting a thread n;
step 2.2, building a neural network;
step 2.3, reading the ith data set;
step 2.4, reading corresponding hyper-parameters;
step 2.5, predicting the power load;
step 2.6, storing the prediction data into a global array;
step 2.7, judging whether i is less than or equal to the calculation configuration number of each thread, if so, returning to the step 2.3 to read the (i + 1) th data set, if not, continuously judging whether i is less than the total configuration variable number, if so, counting i is increased by 1 and n threads are closed, otherwise, closing 33 threads, storing all the prediction data into a database and entering the step 3;
step 3, training, specifically comprising:
step 3.1, starting a thread n;
step 3.2, building a neural network;
step 3.3, reading the ith data set;
step 3.4, reading corresponding hyper-parameters;
step 3.5, training the power load prediction model;
step 3.6, updating the hyper-parameters;
and 3.7, judging whether i is less than or equal to the calculation configuration number of each thread, if so, returning to the step 3.3 to read the (i + 1) th data set, otherwise, continuously judging whether i is less than the total configuration variable number, if so, adding 1 to the count of i and closing n threads, otherwise, closing 33 threads, and ending the program.
2. The LSTM-based multi-threaded parallel computing power load forecasting method of claim 1, wherein in step 1.4, the preprocessing of the sorted data specifically comprises supplementing missing data, deleting deviating data, and normalizing the data.
CN202210768886.9A 2022-06-30 2022-06-30 Multithreading parallel computing power load prediction method based on LSTM Pending CN115186887A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210768886.9A CN115186887A (en) 2022-06-30 2022-06-30 Multithreading parallel computing power load prediction method based on LSTM

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210768886.9A CN115186887A (en) 2022-06-30 2022-06-30 Multithreading parallel computing power load prediction method based on LSTM

Publications (1)

Publication Number Publication Date
CN115186887A true CN115186887A (en) 2022-10-14

Family

ID=83516265

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210768886.9A Pending CN115186887A (en) 2022-06-30 2022-06-30 Multithreading parallel computing power load prediction method based on LSTM

Country Status (1)

Country Link
CN (1) CN115186887A (en)

Similar Documents

Publication Publication Date Title
Tang et al. Short‐term power load forecasting based on multi‐layer bidirectional recurrent neural network
Du et al. Power load forecasting using BiLSTM-attention
CN110674999A (en) Cell load prediction method based on improved clustering and long-short term memory deep learning
CN112990556A (en) User power consumption prediction method based on Prophet-LSTM model
CN112215442B (en) Method, system, device and medium for predicting short-term load of power system
CN110909941B (en) Power load prediction method, device and system based on LSTM neural network
CN111489036A (en) Resident load prediction method and device based on electrical appliance load characteristics and deep learning
CN106980906B (en) Spark-based Ftrl voltage prediction method
CN116186548B (en) Power load prediction model training method and power load prediction method
Xie et al. Short-term power load forecasting model based on fuzzy neural network using improved decision tree
CN112418496A (en) Power distribution station energy storage configuration method based on deep learning
CN112288140A (en) Keras-based short-term power load prediction method, storage medium and equipment
Li et al. Short-term Power Load Forecasting Based on Gate Recurrent Unit Network and Cloud Computing Platform
CN112598188A (en) Neural network generation method, power prediction method, device and storage medium
CN115186887A (en) Multithreading parallel computing power load prediction method based on LSTM
Sun et al. Ultra-short-term wind power interval prediction based on fluctuating process partitioning and quantile regression forest
CN115860270A (en) Network supply load prediction system and method based on LSTM neural network
Prashanthi et al. A comparative study of the performance of machine learning based load forecasting methods
CN115619449A (en) Deep learning model-based fertilizer price prediction method, device and storage medium
Pang et al. A photovoltaic power predicting model using the differential evolution algorithm and multi-task learning
CN114759579A (en) Power grid active power optimization control system, method and medium based on data driving
CN113283638A (en) Load extreme curve prediction method and system based on fusion model
Xu et al. An LSTM approach for predicting the short-time passenger flow of urban bus
Wang et al. Dynamic neural network based genetic algorithm optimizing for short term load forecasting
Wang et al. Research on Prediction of Dynamic Load Complementarity Based on Big Data

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination