Summary of the invention
In order to overcome the blindness of empirical method in the prior art, subjectivity, system complexity, the effect of intelligent prediction algorithms
Forthright problem, the present invention provides a kind of load forecasting methods, to solve the above problems.
The purpose of the present invention is implemented with the following technical solutions:
A kind of load forecasting method, it is characterised in that the following steps are included:
S1: acquiring the historical data of historical date, the historical data include historical load data and with the history
The corresponding history meteorological data of load data, the history meteorological data include temperature, humidity, wind speed;
S2: the historical data for belonging to the workaday historical date is classified as the first classification, inoperative will be belonged to
The historical data of the historical date of day is classified as the second classification;
S3: the p cluster set of the historical data of first classification, the q of the historical data of second classification are obtained
A cluster set;
S4: the fitting cluster set obtains function relevant to first classificationIt obtains and described the
The relevant function of two classification
S5: being integrated into the number occurred in period and the first classification or the second control by kinds data bulk ratio according to cluster,
Calculate the contribution probability of the cluster setAndObtain the first output functionObtain the second output function
S6: the forecast date is mapped to the historical date T by the input prediction date;
S7: the historical date T is inputted into first output function or second output function, it is negative to obtain prediction
Lotus.
Further, in step sl, first the historical data is cleaned when acquisition.
Further, in step s3, the cluster is obtained using Euclidean distance calculating method to gather.
Further, the Euclidean distance calculating method comprises the steps of:
In S31: Yu Suoshu first classification or second classification, p or q initial point Z are takeni(xi,yi,zi), wherein i
≤ n or m, i are positive integer, xiFor temperature, yiFor humidity, ziFor wind speed;By the point Zi(xi,yi,zi) be set as in initial clustering
The heart;
S32: any of the first classification or the second classification point P are successively calculatedf(xf,yf,zf) arrive the cluster centre most
Short distance obtains p or q cluster according to shortest distance principle;
S33: calculating the cluster centre of each cluster, and new cluster centre is exactly the average value of data object distance in class,
New cluster centre is denoted as Zi(xi,yi,zi);
S34: if reaching termination condition, stopping calculating, and otherwise returns to S32 step.
Further, the termination condition of step S34 is to have reached the maximum number of iterations or step S33 meter of setting
The new cluster centre calculated, is no longer changed relative to the cluster centre in step S32.
Further, the relevant function is polynomial function.
Further, the coefficient of the polynomial function is solved using intelligent algorithm.
Further, the coefficient of the polynomial function is solved using the method for seeking partial derivative.
Further, further include that historical data is inputted to first output function and second output function, calculate
Square mean error amount, relative error maximum value, relative error minimum value;Fitting result is evaluated.
The invention also includes a kind of load prediction system, scheme is as follows:
A kind of load prediction system, including data preprocessing module, fitting of a polynomial module, forecast date input module,
Load prediction output module;
Data preprocessing module, for acquiring the historical data of historical date, the historical data includes historical load number
Accordingly and history meteorological data corresponding with the historical load data, the history meteorological data include temperature, humidity, wind
Speed;
Cluster module will belong to workaday described for handling the historical data of the data preprocessing module output
The historical data of historical date is classified as the first classification, will belong to the historical data of the historical date of nonworkdays
It is classified as the second classification;The p cluster set of the historical data of first classification is obtained, the historical data of second classification
Q cluster set;
Fitting of a polynomial module obtains function relevant to first classification for being fitted the cluster setObtain function relevant to second classificationAccording to cluster be integrated into the number that occurs in period with
First classification or the second control by kinds data bulk ratio calculate the contribution probability of the cluster setAndObtain first
Output functionObtain the second output function
Forecast date input module is used for the input prediction date, the forecast date is mapped to the historical date T;
Load prediction output module, for storing the first output functionAnd second output functionThe historical date T is inputted into first output function or second output function, it is negative to obtain prediction
Lotus.
The invention also includes a kind of memory, load forecasting method is stored in memory.
Compared with prior art, the beneficial effects of the present invention are:
(1) present invention according to influence electric load multiple factors, i.e., whether festivals or holidays, temperature, humidity, wind speed, logarithm
According to being clustered, cluster is relatively easy intuitive, can rule of thumb select initial cluster center and cluster number, the effect of cluster can
Direct Test.
(2) the final anticipation function of the present invention, it is contemplated that the probability that each anticipation function occurs considers each cluster
It is as a result more accurate, reliable to the contribution rate of predicted time electric load amount.
Specific embodiment
The present invention provides a kind of load forecasting method.Several big factors that will affect electric load extract, and are made with this
For the foundation of cluster, then fitting of a polynomial is carried out for each cluster result and obtains multiple functions, finally according to the contribution of cluster
Rate is integrated into final anticipation function.The present invention is effectively improved polynomial fitting, is guaranteeing prediction algorithm
Simple can improve the accuracy of algorithm under operational circumstances.In the following, in conjunction with attached drawing and specific embodiment, to the present invention
It is described further:
The present invention analyzes data by Principal Component Analysis, and having obtained temperature, humidity, wind speed is to influence power load
An important factor for lotus, and in same weather, the electric load of working day and nonworkdays has significant difference.Cause
This acquires basis of the historical data on phase of history date as anticipation function training, and historical data includes historical load number
Accordingly and history meteorological data corresponding with historical load data, history meteorological data include temperature, humidity, wind speed.History number
According to acquisition time will be close to forecast date, and the historical data of long period need to be obtained as far as possible.And anticipation function needs to determine
Shi Gengxin can according to circumstances choose whether to be modified model before prediction, such as predict the electricity consumption on 1 day May the year two thousand thirty, selection
2010-2019 4, the data in May as historical data, this is clearly inappropriate, once 2019-2029 year-climate has
The prediction effect of significant change, model will be very inaccurate.
Referring to attached drawing 2, after historical data acquisition, data incompleteness is likely to occur in historical data, such as lack temperature, humidity,
It is one or more in wind speed, it is also possible to appear in the electric power for occurring that an exception is high or exception is low in continuous historical date
Load needs to reject the above abnormal data, i.e., cleans, had to historical data when obtaining historical data
There is the historical data of reference value.The cleaning method of historical data includes but is not limited to following methods: value lacks detection method, mistake
It is worth detection method, repeats record detection method, inconsistency detection method.Due to the main electricity consumption main body of working day and nonworkdays, set
It is standby inconsistent, it is therefore desirable to which that the load prediction of working day and nonworkdays is distinguished.Workaday described go through will be belonged to
The historical data on history date is classified as the first classification, and the historical data for belonging to the historical date of nonworkdays is returned
For the second classification.
Referring to attached drawing 3, the p cluster set of the historical data of first classification is obtained using clustering algorithm, described the
The q cluster set of the historical data of two classification.The clustering algorithm includes but is not limited to K-Means clustering procedure, mean value drift
It moves cluster, density clustering method, examined with the greatest hope cluster of gauss hybrid models, Agglomerative Hierarchical Clustering, figure group
Survey clustering procedure.
The present invention takes full advantage of Conventional wisdom, selects the totally different point of weather that can effectively improve as the initial point of cluster
Computational efficiency, and calculated result is made to meet objective law.The empirical method can be the Chinese twenty-four solar terms can also be with
It is that the weather counted according to historical time, region characteristic changes key node.And cluster is calculated using Euclidean distance calculating method.
I.e. in first classification or second classification, p or q initial point Z are takeni(xi,yi,zi), wherein i≤n
Or m, i are positive integer, xiFor temperature, yiFor humidity, ziFor wind speed;By the point Zi(xi,yi,zi) it is set as initial cluster center.
Start clustering algorithm, any of the first classification or the second classification point Pf(xf,yf,zf) arrive the cluster centre
The shortest distance:
According to the calculating of the shortest distance, it is most short to can be obtained distance of the arbitrary point apart from which cluster centre, from
And the cluster centre of the arbitrary point and its shortest distance is classified as one kind.By all historical data points according to above method meter
It calculates, p cluster can be obtained in the first classification;Q cluster is obtained in the second classification.
The cluster centre of each cluster is recalculated, new cluster centre is exactly the average value of data object distance in class,
New cluster centre is denoted as Zi(xi,yi,zi):
Wherein n indicates the number of the historical data in the cluster.
The new cluster centre of acquisition is substituted into clustering algorithm, the clustering algorithm is restarted and is calculated, when
The maximum number of iterations or cluster centre for reaching setting are no longer changed, and stop calculating, and export cluster result.
Referring to attached drawing 4, start fitting algorithm and obtain curve matching to above-mentioned cluster, fitting algorithm include but is not limited to
Lower method: Lagrange's interpolation, Newton interpolating method, Newton iteration method, section dichotomy, Secant Method, Jacobi iterative method and
Newton Ke Tesi numerical integrating.
The present invention predicts the electric load of each cluster using fitting of a polynomial, before fitting, due to right
Data have carried out clustering processing, and prediction process can not consider further that the influence of temperature, humidity, wind speed, are guaranteeing prediction accuracy
While, simplify the complexity of prediction model:
(the first classification correlation function)
(the second classification correlation function)
Wherein max is a precision index, and value can be customized, but is not that the higher the better, it is, in general, that choosing
The result for selecting the higher sample data of number is more preferable, but the result of test data can decline instead.The value of max in the present invention
Range is 10 to 100, preferably 25.
The coefficient solution of the first classification correlation function and the second classification correlation function can use genetic algorithm, particle
Group method or simulated annealing etc..
In the present invention since data sample sufficiently uses high-efficient partial differentiation, i.e. construction range formula is minimized:
It enables
WhenIt is equally that distance is minimum, due to minimum value, that is, partial derivative when minimum
It is at zero, it may be assumed that
It can get max local derviation equation, the coefficient of correlation function can be obtained by needing to obtain at least max historical data,
To obtain the relevant function of the first classificationObtain function relevant to second classification
However each influence clustered in the period of certain to load prediction is inconsistent, therefore to be calculated every
The contribution probability of one cluster.The contribution probability of each cluster can be using within one period, which goes out in this time
Existing number and total time is than obtaining.Specifically contribution probability be any cluster in historical data number with first classification or
The ratio of the historical data number in second classification:
O=n when for the first classification, o=m when for the second classification.To obtain the contribution probability of the cluster setAndObtain the first output functionObtain the second output function
Since in same year, influence of a certain cluster to load is also not the same, therefore is also needed in calculating ratio
Impact factor a is added in valuei, it may be assumed that
Obtain the first output functionObtain the second output function
During prediction, the forecast date is mapped to the historical date T by user's input prediction date;It is described
It maps including but not limited to following methods: belonging to a certain date in year or belong to a certain date of the lunar calendar.
The historical date T is inputted into first output function or second output function, obtains prediction load.
Further include that historical data is inputted to first output function and second output function referring to attached drawing 5, calculates
Square mean error amount, relative error maximum value, minimum value;Fitting result is evaluated.By evaluation method, first can be obtained
The accuracy of output function and the second output function.To be adjusted in due course.
Further, first output function and the second output function should periodically update, that is, execute the several years
When afterwards or weather produces variation, resurveys historical data and adjust the first output function and the second output function, so as to its energy
It is long-term to meet prediction requirement.
The present invention contains a kind of memory, and memory can store load forecasting method wherein.
The solution of the present invention further includes a kind of load prediction system, referring to attached drawing 1, including data preprocessing module, cluster
Module, fitting of a polynomial module, forecast date input module, load prediction output module.
Referring to attached drawing 2, data preprocessing module, for acquiring the historical data of historical date, the historical data includes
Historical load data and history meteorological data corresponding with the historical load data, the history meteorological data include temperature
Degree, humidity, wind speed.
Referring to attached drawing 3, cluster module will belong to work for handling the historical data of the data preprocessing module output
The historical data for making the historical date of day is classified as the first classification, will belong to the institute of the historical date of nonworkdays
It states historical data and is classified as the second classification;The p cluster set of the historical data of first classification is obtained, second classification
Q cluster of historical data is gathered;
Referring to attached drawing 4, fitting of a polynomial module obtains related to first classification for being fitted the cluster set
FunctionObtain function relevant to second classificationIt is integrated into according to cluster and is occurred in period
Number and the first classification or the second control by kinds data bulk ratio calculate the contribution probability of the cluster setAndIt obtains
First output functionObtain the second output function
Forecast date input module is used for the input prediction date, the forecast date is mapped to the historical date T.
Load prediction output module, for storing the first output functionAnd second output functionThe historical date T is inputted into first output function or second output function, it is negative to obtain prediction
Lotus.
In data preprocessing module, the historical data of acquisition is needed through over cleaning, and it is negative that cleaning method can be found in the present invention
Lotus prediction technique.
In cluster module, the cluster is obtained using Euclidean distance calculating method and is gathered, the Euclidean distance calculating method packet
Containing following steps: in the classification of Yu Suoshu first or second classification, taking p or q initial point Zi(xi,yi,zi), wherein i≤
N or m, i are positive integer, xiFor temperature, yiFor humidity, ziFor wind speed;By the point Zi(xi,yi,zI) it is set as initial cluster center;
Successively calculate any of the first classification or the second classification point Pf(xf,yf,zf) arrive the cluster centre the shortest distance, according to
Shortest distance principle obtains p or q cluster;The cluster centre of each cluster is calculated, new cluster centre is exactly data in class
The average value of object distance, new cluster centre are denoted as zi(xi,yi,zi);If reaching termination condition, stop calculating, otherwise will
Cluster centre zi(xi,yi,zi) return, recalculate cluster.The termination condition is to have reached the maximum number of iterations of setting
Or the new cluster centre that step S33 is calculated, it is no longer changed relative to the cluster centre in step S32.It is European
Apart from calculating method reference can be made to load forecasting method of the present invention.
In fitting of a polynomial module, the relevant function is polynomial function, is solved using intelligent algorithm described multinomial
The coefficient of formula function or the coefficient that the polynomial function is solved using the method for seeking partial derivative.The polynomial function solution side
The visible load forecasting method of the invention of method.
Referring to attached drawing 5, load prediction system further includes correction verification module, for historical data to be inputted the first output letter
Several and second output function calculates square mean error amount, relative error maximum value, minimum value;Fitting result is evaluated.
By evaluation method, the accuracy of the first output function and the second output function can be obtained.To be adjusted in due course.
It will be apparent to those skilled in the art that can make various other according to the above description of the technical scheme and ideas
Corresponding change and deformation, and all these changes and deformation all should belong to the protection scope of the claims in the present invention
Within.