CN117407681A - Time sequence data prediction model establishment method based on vector clustering - Google Patents

Time sequence data prediction model establishment method based on vector clustering Download PDF

Info

Publication number
CN117407681A
CN117407681A CN202311728973.2A CN202311728973A CN117407681A CN 117407681 A CN117407681 A CN 117407681A CN 202311728973 A CN202311728973 A CN 202311728973A CN 117407681 A CN117407681 A CN 117407681A
Authority
CN
China
Prior art keywords
data
time
vector
time sequence
sequence
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.)
Granted
Application number
CN202311728973.2A
Other languages
Chinese (zh)
Other versions
CN117407681B (en
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.)
Jiangsu Weiheng Intelligent Technology Co ltd
Original Assignee
Jiangsu Weiheng Intelligent Technology 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 Jiangsu Weiheng Intelligent Technology Co ltd filed Critical Jiangsu Weiheng Intelligent Technology Co ltd
Priority to CN202311728973.2A priority Critical patent/CN117407681B/en
Publication of CN117407681A publication Critical patent/CN117407681A/en
Application granted granted Critical
Publication of CN117407681B publication Critical patent/CN117407681B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/213Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/23Clustering techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/243Classification techniques relating to the number of classes
    • G06F18/2433Single-class perspective, e.g. one-against-all classification; Novelty detection; Outlier detection

Landscapes

  • Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Artificial Intelligence (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a time sequence data prediction model establishment method based on vector clustering, which relates to the technical field of energy storage prediction and comprises the following steps: s1, data preprocessing: extracting time sequence data from an energy management system and preprocessing the time sequence data; s2, data vector representation: converting the preprocessed time sequence data into data vectors; s3, clustering data vectors: clustering the data vectors into a plurality of categories; s4, constructing a time sequence data prediction model, training the time sequence data prediction model by using historical time sequence data and other related data, and circularly executing S1-S4 until the time sequence data prediction model is adapted. The invention provides a high-efficiency accurate time sequence data prediction model establishment method, which is used for meeting the time sequence data prediction requirements of an energy management system in various scenes and enabling intelligent energy service and energy system operation and maintenance.

Description

Time sequence data prediction model establishment method based on vector clustering
Technical Field
The invention relates to the technical field of energy storage prediction, in particular to a time sequence data prediction model establishment method based on vector clustering.
Background
Virtual Power Plants (VPPs) are an energy management system that integrates distributed energy resources that can be traded and managed as a single virtual power generation asset. The implementation of VPP relies on flexible control and optimal management of distributed energy resources, where load prediction is one of the key technologies to achieve such flexible control. Through accurate prediction of future loads, reasonable scheduling and management of distributed energy resources can be achieved, so that the VPP can quickly respond to price signals and adjustment requirements of the electric power spot market, and extra electric power spot transaction and electric power auxiliary service benefits are obtained.
To achieve accurate load prediction, a large amount of time series data needs to be obtained. Such data includes historical load data, weather data, power market transaction data, and the like. By analyzing and processing the data, future load change trend can be predicted, thereby providing important decision support for the optimized operation of the VPP.
Time series data refers to data that changes over time, such as stock prices, weather data, and the like. Accurate prediction of time series data is critical to many fields. The conventional time series data prediction method is mainly based on statistical analysis, periodic time series modeling and the like, such as ARIMA model (autoregressive moving average model), exponential smoothing method, seasonal decomposition method and the like, and is widely applied to time series data prediction. These methods perform model fitting and prediction based on statistical features and trends of the historical data. The traditional method requires the estimation of a large number of intermediate indexes, which are usually average values, standard deviations, variances and the like of certain moments of time sequence data, and the accurate extraction and calculation of the indexes can greatly improve the prediction accuracy and have great influence on the result. The field expert is often required to combine empirical extraction, so that the statistical-based approach is inefficient.
In the field of customer-side energy management, energy Management Systems (EMS) collect a large amount of time series data, such as statistical indicators of changes over time of loads, photovoltaics, motors, energy storage batteries, etc. However, the time sequence data are often affected by various factors such as temperature and humidity, seasons, electricity habits, scenes, electricity prices, holidays and the like in a real scene, and the research on the characteristics and the research on the load fluctuation caused by the characteristics by the traditional load prediction method are deficient, the periodicity is also ambiguous, and a segmented mode is presented. If the time sequence data is given larger-scale data, the traditional statistical time sequence analysis method is difficult to give accurate prediction, and manual calibration features are needed to distinguish different sequence modes, for example, the power requirements of the factory on weekdays and non-weekdays, the holidays and the non-holidays of the market and the like have larger differences.
Therefore, a new method is needed to analyze and process historical load data and other related data, so that future load change trend can be rapidly and accurately predicted, and accuracy and efficiency of time sequence data prediction in a complex scene mode are improved.
Disclosure of Invention
The invention aims to solve the technical problem of overcoming the defects of the prior art and providing a time sequence data prediction model establishment method based on vector clustering.
In order to solve the technical problems, the technical scheme of the invention is as follows:
a time sequence data prediction model establishment method based on vector clustering comprises the following steps:
s1, data preprocessing: extracting time sequence data from an energy management system and preprocessing the time sequence data;
s2, data vector representation: converting the preprocessed time sequence data into data vectors;
s3, clustering data vectors: clustering the data vectors into a plurality of categories;
s4, constructing a time sequence data prediction model, training the time sequence data prediction model by using historical time sequence data and other related data, and circularly executing S1-S4 until the time sequence data prediction model is adapted.
As a preferable scheme of the time sequence data prediction model establishing method based on vector clustering, the invention comprises the following steps: the time sequence data extraction from the energy management system comprises the following steps:
setting a query input time period, wherein the starting point is s time, the end point is e time, and the s time and the e time are the time from the detail to the minute; extracting historical time sequence data, dividing a time interval into one data point at t time, and calculating each data pointWherein, data point->Is the average value of time sequence data in the time t, +.>,d S ,d S+1 ,...,d e Are data points in minutes from s to e.
As a preferable scheme of the time sequence data prediction model establishing method based on vector clustering, the invention comprises the following steps: the preprocessing of the time series data comprises the following steps:
replacing points which do not accord with the physical rule with reasonable values;
grouping the recorded values according to fixed time intervals;
selecting linear interpolation padding in the absence of recorded values at a certain time, using adjacent front and back data points thereofAnd->Weighted calculation average fills in the data points at this place +.>Wherein the weighted calculation average formula:the method comprises the steps of carrying out a first treatment on the surface of the Wherein (1)>The determination mode of (a) also comprises the steps of fitting the polynomial fitting method to the photovoltaic beta distribution curve to fill the missing value or filling the fitting curve y completed by a fitting function and a curve fitter>
Each category of the categorized time series data uses the tag value to determine the category of the time series data and records the category into the final data set D, expressed as:wherein Load is the Load, pv is the photovoltaic data, DG is the energy storage system.
As a preferable scheme of the time sequence data prediction model establishing method based on vector clustering, the invention comprises the following steps: the vectorizing of the data in the S2 comprises the following steps:
s2.1, respectively acquiring a data set D according to different time intervals r such as day, week, month and the like to form a data set; wherein,,/>,/>day, week, month is the unit of time length, and the data set length is ordered: />
S2.2, converting the preprocessed time sequence data with different lengths into vectors with equal lengths, taking the cleaned data sequence as a sequence set X,
s2.3, cutting each data sequence leftwards and rightwards at the time t to obtain two sections of subsequences, wherein t is any time from the start time to the end time of each sequence in the X sequence set, and the pairs of subsequence pairs at different times t are sample pairs;
s2.4, converting the paired subsequences into paired vectors.
As a preferable scheme of the time sequence data prediction model establishing method based on vector clustering, the invention comprises the following steps: the step S2.4 of converting the paired subsequences into paired vectors comprises the steps of:
s2.4.1 inputting the pair subsequences into a first layer neural network to obtain hidden layer output Y;
s2.4.2 masking operation is carried out on the hidden layer output Y, certain values in the Y are randomly modified to be 0, and sequence information on a part of X time stamps is masked, so that a model can better process a variable-length time sequence;
s2.4.3 inputting the processed time sequence into a cavity convolution layer, wherein the layer is composed of 10 residual error networks, each residual error network comprises 2 1-dimensional convolution layers, the space between the cavity convolution kernel of each convolution layer and input data is reached, and each convolution layer outputs a data vector;
s2.4.4 the obtained pair vectors are recorded as,/>I=1, 2 … N; the output Z and Y of the last layer of convolution layer are spliced to obtain sequential characteristic paired vectors of the sequence, and the sequential characteristic vectors are one-dimensional characteristic large vectors, so that the sequential data context is extracted;
s2.4.5 selecting positive and negative samples, wherein the positive sample pair is marked as +R, and the negative sample pair is marked as-R;
s2.4.6, training each round to obtain a vector representation, inputting +R, -R into a hierarchical contrast learning frame to calculate a hierarchical contrast Loss function Loss, feeding the obtained Loss back to parameter updating, and circularly executing steps S2.4.5 and S2.4.6 until model parameters are converged;
s2.4.7, inputting the coded vector Vi obtained for each sequence in X via the converged model, the dimension of Vi being noted as u; all sets of time series sequences are uniformly vector-ized to a u-dimensional vector X,the vector is uniformly quantized to a u-dimensional vector.
As a preferable scheme of the time sequence data prediction model establishing method based on vector clustering, the invention comprises the following steps: the +R in S2.4.5 is selected by the following wayI=1, 2 … N, t=1, 2,3, … N, t being the instant of the ith time sequence; r is selected in the form of->G is the time point, i.e. the sub-sequences of all identical sequences i which are not cut to the left at the same time point can form a negative sample sum, i.e. the left cut sub-sequence and the right cut sub-sequence of all identical sequences which are not cut at any time point can form a negative sample sum->
At this time, the negative sample pair-R is modified into a left sequence vector and a right sequence vector sum obtained by cutting the same time t in the sequenceNamely, left sequence vectors obtained by cutting the same time t in all different sequences are negative sample pairs.
As a preferable scheme of the time sequence data prediction model establishing method based on vector clustering, the invention comprises the following steps: the S2.4.6 includes the steps of:
the hierarchical contrast loss functionWherein, the loss function in the subsequence is calculated and recorded as,/>The method comprises the steps of carrying out a first treatment on the surface of the Calculating a sampleThe loss function between pairs, noted +.>,/>
When the difference between the adjacent values before and after the loss function is larger than 0, the model parameters are converged.
As a preferable scheme of the time sequence data prediction model establishing method based on vector clustering, the invention comprises the following steps: the step S3 comprises the following steps:
clustering the time sequence data represented by the vector by using a vector clustering algorithm, classifying the similar sequence data segments into the same category, setting a number super parameter K of the clustering category, and repeatedly executing the following steps:
s3.1, obtaining an ith u-dimensional vector representation
S3.2, generating initial points of K vector spaces to form a cluster data setTaking the i-th vector encoded by the time sequence segment +.>The j-th initial point vector +.>Calculate->And->Distance per point +.>If (if)Then->,/>The dimension of the parameter; selecting the minimum,/>Corresponding->And->Add i to the corresponding +.>In (a) and (b);
s3.3, obtaining a center point of a new data point set after clusteringAccording to the formulaCalculating a vector average value and updating a center data set;
s3.4, repeating the steps S3.2 and S3.3 until the category corresponding to the center dataset and the center point is stable.
As a preferable scheme of the time sequence data prediction model establishing method based on vector clustering, the invention comprises the following steps: and S3, clustering the time sequence data represented by the vector by using a vector clustering algorithm, wherein the convergence judgment condition is as follows:
if any of the following conditions is satisfied, the center dataset and the category corresponding to the center point are stable:
current center point vectorCenter point vector recorded with previous round +.>Is less than a threshold value (1 e -3 ~1e -6 );
Exceeding the set maximum wheel stack value M.
As a preferable scheme of the time sequence data prediction model establishing method based on vector clustering, the invention comprises the following steps: the time sequence data prediction model construction in the S4 comprises the following steps:
s4.1, constructing a special discrete model f1, and constructing a sequence to obtain a class label for predicting a sequence mode in the next period; the final class label obtained for example for sequences constructed in a number of days period is c 1 ,…,c n, I.e.
S4.2, constructing a numerical model f2, and forming a set C2 by all data points marked by histories to obtain points in a prediction period; such as assuming thatThe point in the prediction period may be marked by all of the historic c 2 Composition data set C 2 Obtained (I)>Wherein the prediction period is 24h.
The beneficial effects of the invention are as follows:
(1) According to the prediction model building method, the time sequence data of a load, a photovoltaic motor, a diesel motor and the like are converted into vector representations, and similarity retrieval is carried out by utilizing a vector clustering technology to obtain a most similar historical time sequence data set, so that a sequence mode label matched with the historical time sequence data set is determined.
(2) According to the method, time sequence analysis and modeling are carried out by analyzing the characteristics of historical data and combining the matched sequence pattern labels. On the basis, the prediction model can be combined with a deep learning prediction algorithm to realize accurate prediction of future time sequence data.
(3) According to the invention, by combining vector clustering, the existing sequence features and the added time sequence clustering analysis are utilized, and sequence label features do not need to be manually marked, so that the model capacity is optimized, and the prediction model is adapted to the existing deep learning algorithm. The method can improve the prediction accuracy of the complex time sequence data in the energy storage scene and reduce the workload of manual labeling. The model is adapted to the existing deep learning algorithm so as to optimize the model capacity and increase the prediction accuracy of complex time sequence data in an energy storage scene.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the description of the embodiments will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic flow chart of a method for establishing a time sequence data prediction model based on vector clustering;
FIG. 2 is a schematic diagram of sequence clipping in the present invention;
FIG. 3 is a left cut schematic view of the present invention;
FIG. 4 is a right cut schematic view of the present invention;
FIG. 5 is a schematic diagram of the transformation of a pairwise subsequence into a pairwise vector in accordance with the present invention;
FIG. 6 is a schematic diagram of a timing prediction process according to the present invention;
fig. 7 is a flowchart illustrating an example of the present invention.
Detailed Description
In order that the invention may be more readily understood, a more particular description thereof will be rendered by reference to specific embodiments that are illustrated in the appended drawings.
The invention provides a time sequence data prediction model establishment method based on vector clustering, which aims to meet the time sequence data prediction requirements of an energy storage energy management system in various scenes so as to realize efficient and accurate prediction. The method gives the model intelligent operation and maintenance capability, and is suitable for time sequence data prediction of the power system.
Specific implementations of the invention are described in detail below in connection with specific embodiments. In one embodiment of the present invention, referring to fig. 1, the method for establishing a time series data prediction model based on vector clustering includes data extraction and data preprocessing, and includes the following steps:
s1, extracting and preprocessing data:
s1.1, a method of extracting data from an Energy Management System (EMS), the method comprising the steps of:
setting a query input time period, wherein the starting point is s time, and the end point is e time; extracting historical dataWherein the time length is->The time interval is divided into a data point at time t, wherein t is E (1, 60), and each data point is calculated>,/>As a value in the set. Wherein, data point->Is the average value of time series data in the time t,,d S ,d S+1 ,...,d e are data points in minutes from s to e.
S1.2, a method for preprocessing original time sequence data comprises the following steps: 1.2.1. points that do not fit the physical laws are replaced with reasonable values. The data point of the data, e.g., photovoltaic or load, with a value <0 is replaced with 0.
S1.2.2, the recorded values are grouped according to fixed time intervals.
S1.2.3 when there is no recorded value at a certain time, selecting linear interpolation method for filling, specifically using the front and rear data pointsAnd->Weighted calculation average fills in the data points at this place +.>
Weighted calculation average formula:
in addition, the polynomial fitting method can be selected to fit the beta-like distribution curve of the photovoltaic and the like to fill the missing value, or the fitting function and the fitting curve y completed by the curve fitter can be used for filling
S1.2.4, removing abnormal data by using an abnormal detection algorithm, for example, when photovoltaic data at a certain moment surge or load breaks through the maximum value of the readings of the recorded ammeter, and the readings are normal before the moment, so as to prevent ammeter or communication errors.
S1.2.5, classifying time-series data categoriesEtc., each type of data uses the tag value to determine the category of the time series data to record into the final data set D: />Wherein Load is the Load, pv is the photovoltaic data, DG is the energy storage system.
S2, obtaining time sequence data vector representation:
s2.1, obtaining D according to different time intervals r such as day, week, month and the like, and forming a data set.,/>. Data length ordering of the three-period time sequence:
s2.2, converting the preprocessed unequal time sequence data into equal-length vectors, and cleaning the data sequence such as sequence setOne sequence in the set of sequences is shown as a curve in figure one. Each sequence is subjected to a third crop.
S2.3, cutting each data sequence leftwards and rightwards at the moment t to obtain two sections of subsequences. t is any time from the start time to the end time of each sequence in the X sequence set.
Specifically, as shown in fig. 2, a fixed window size may be set to indicate the length obtained during clipping, and assuming that the window size is w, the width of the smaller offset from the window right distance t is denoted as pad, and the width of the larger offset from the window left distance t is denoted as w minus pad, denoted as w-pad. Also, the left smaller offset pad is cut right, and the right larger offset is w-pad. Different times t are selected, and a plurality of subsequences with the length of w are obtained according to the same cutting rule. These sub-sequence pairs at different times t are pairs of samples.
S2.4, taking the photovoltaic sequence data in the management system as an example, as shown in fig. 3-4, t=2023, 7, 1, 12 points, the left clipping window w=8h, pad=2h corresponding to the moment, and taking the data from 2023, 7, 1, 6, to 2023, 7, 1, 14 points, forming the subsequence {10,30,80,260,300,70,402,200} at the ith t moment, with unit kW.
The data with the right clipping window of 2023, 7, 1, 10 to 2023, 7, 1 and 18 points at this time form the ithSub-sequences at time t{10,30,80,260,300,70,402,200}, unit kW.
The data with the right clipping window of 2023, 7, 1, 10 to 2023, 7, 1 and 18 points at this time constitutes the subsequence at the ith time t{300,70,402,200,140,100,70,50,2}, unit kW.
S2.4.1, inputting the pair sub-sequences into the first layer neural network to obtain hidden layer output Y.
S2.4.2 masking the hidden layer output Y, randomly modifying some values in Y to 0. Masking the sequence information on a portion of the X time stamps allows the model to better handle variable length time sequences.
In processing characterization learning of variable-length time sequences, a higher level of understanding of the overall sequence is required. The masking operation deliberately removes a portion of the input sequence content by generating a masking vector M that is the same length as the number of time steps of the input sequence X, wherein an element takes a value of 0 or 1, indicating whether the value of the timestamp is valid in the time sequence. The sequence information on the invalid timestamp is masked and the lost data can be recovered by means of a trained model. Past experience shows that the method can remarkably improve the accuracy of variable-length time sequence characterization learning. In the time sequence, the fixed mask position is easily inferred by the correlation of the time values of the adjacent mask points, and deviates from the target of the abstract representation of the sequence. To solve this problem, a random strategy is used to mask time series of different lengths. We have a random position of 0 on the mask vector M and then have a more rational representation of the learned vector.
S2.4.3 the processed time series inputs the hole convolution layer, the layer is composed of 10 residual error networks, each network contains 2 1-dimensional convolution layers, the space between the hole convolution core of each convolution layer and the input data is reached, and each convolution layer outputs the data vector.
S2.4.4 the output Z of the last convolution layer is spliced with the output Y of the last convolution layer to obtain sequential characteristic pair vectors of the sequence, and the sequential characteristic vectors are one-dimensional characteristic large vectors, so that the sequential data context is extracted.
We will record the pair vectors obtained as,/>
The flow of converting the pairwise subsequence into pairwise vectors is shown in fig. 5.
S2.4.5, positive and negative samples are selected, the positive sample pair is denoted as +R, and the negative sample pair is denoted as-R. The +R is selected in the following wayI=1, 2 … N, t=1, 2,3, … N, t is a pair vector output by a pair sequence obtained by clipping the same time t in the same sequence at a certain time in the ith time sequence (assuming that the length of the ith time sequence is N). R is selected in the form of->G is the time point, i.e. all sub-sequences of the same sequence i which are not clipped to the left at the same time can form a negative sample and +.>I.e. the left and right clip subsequences in all the same sequences that are not at any instant in time may constitute a negative sample.
Calculating a loss function in the subsequence:
the loss between the sample pair was also calculated and noted as loss2. The negative sample pair-R structure mode at this time is modified asI.e. left sequence vector obtained by clipping the same time t in the sequenceAnd right sequence vector sum->Namely, left sequence vectors obtained by cutting the same time t in different sequences are negative sample pairs. Wherein (1)>
S2.4.6 each round of training obtains the vector representation, the vector representation comprises the time sequence data context of positive and negative samples, +R, -R is input into a hierarchical contrast learning framework, and a hierarchical contrast loss function is calculatedAnd feeding the obtained loss back to parameter updating. Steps 5, 6 are restarted until the model parameters converge, i.e. the difference between adjacent values of the loss function is greater than 0.
S2.4.7 via a converged model we can input the encoded vector obtained for each sequence in X,/>The dimension of (2) is denoted as u. All unequal length sequence fragments +.>The unified vector can be converted into a u-dimensional vector.
S3, vector clustering: clustering the time sequence data represented by the vector by using a vector clustering algorithm, classifying the similar sequence data fragments into the same class, and setting the super parameter K as the number of clustering classes.
The following steps are repeatedly performed until convergence:
s3.1, obtaining an ith u-dimensional vector representation
S3.2, generating initial points of K vector spaces to form a cluster data setLet U-dimensional vector->Calculate->And->Distance per point +.>,/>,/>Is the dimension in which the parameter is located. Select minimum +.>,/>Corresponding->And->Adding i to the correspondingIs a kind of medium.
S3.4, repeating the steps S3.2 and S3.3 until the category corresponding to the center dataset and the center point is stable.
S3.3, obtaining a center point of a new data point set after clusteringVector average is calculated and center dataset is updated according to the following formula: />
S3.4, repeating the steps 3.2 and 3.3 until the category corresponding to the center dataset and the center point is stable.
And S3.5, stabilizing the class corresponding to the center data set and the center point when the following conditions are met.
Condition 1, if
Condition 2, if the current center point vectorCenter point vector recorded with previous round +.>Is less than a threshold value (1 e -3 ~1e -6 );
And 3, if the set maximum wheel stacking value M is exceeded.
S4, building a time sequence prediction model:
s4.1, constructing a special discrete prediction model f1: for sequence pattern prediction in the next period, it is assumed that the final class label obtained for the sequence constructed in the day-level period is c1, … cn, i.e. As shown in FIG. 6, c2, c1 and c2 on the axis correspond to the cluster labels corresponding to the time series data of 2023-08-01 to 2023-08-03, the time series data change curve is at the lowest, the prediction period is the time series data of 2023-08-04 expected to be predicted, and then the f1 model predicts the label result of 2023-08-04 in the period->
S4.2, constructing a numerical prediction model f2: assume thatThe points within the prediction period 24h may be marked by all historiesc2 is obtained by composing the data set C2. />As shown in FIG. 6, the dark color part represents a numerical prediction model, and the predicted numerical value +.about.time series data of 2023-08-04 is obtained on the basis of the c2 tag>There are 24 points in total.
For example: for a certain manufacturing energy storage system to manage SaaS service, the energy management system collects photovoltaic and load data of each day, and K=2 is set after vectorization clustering of the data in a factory, namely a simple high-low load mode. The time sequence data prediction task of the plant can be divided into two parts, wherein the first step is to predict the rule of a sequence mode in a week (for example, the time of day from Monday to Friday is high load, the time of day from Saturday is low load), and the second part is to model a prediction model by extracting data in all high load time periods if the current time is the time of day from Monday to Friday on the basis of the first part, so as to obtain a high load time sequence data prediction model. And then predicting the data of the current prediction window by using the model, and if the current time is Saturday, extracting the data of all low-load time periods to construct a prediction model, and similarly, obtaining the low-load time sequence data prediction model.
In addition, the method can further comprise step S5, optimizing a prediction big model, namely: the specific predictive properties in the respective fields, f1 and f2, may be generic models, for example, f1 may be the discrete event sequence model LSTM, and f2 may be the ARIMA model or the deepa model. And the model is connected with a load prediction large model to optimize the whole model.
The whole process is refined as shown in fig. 7.
In addition to the above embodiments, the present invention may have other embodiments; all technical schemes formed by equivalent substitution or equivalent transformation fall within the protection scope of the invention.

Claims (9)

1. A time sequence data prediction model establishing method based on vector clustering is characterized by comprising the following steps of: the method comprises the following steps:
s1, data preprocessing: extracting time sequence data from an energy management system and preprocessing the time sequence data; the time sequence data extraction from the energy management system comprises the following steps:
setting a query input time period, wherein the starting point is s time, the end point is e time, and the s time and the e time are the time from the detail to the minute; historical time sequence data are extracted, the time interval r is divided into one data point at the moment t, and each data point is calculatedWherein, data point->Is the average value of time sequence data in the time t, +.>,d S ,d S+1 ,...,d e Data points in minutes from s to e;
s2, data vector representation: converting the preprocessed time sequence data into data vectors;
s3, clustering data vectors: clustering the data vectors into a plurality of categories;
s4, constructing a time sequence data prediction model, training the time sequence data prediction model by using historical time sequence data and other related data, and circularly executing S1-S4 until the time sequence data prediction model is adapted.
2. The method for building the time series data prediction model based on vector clustering according to claim 1, wherein the method comprises the following steps: the preprocessing of the time series data comprises the following steps:
replacing points which do not accord with the physical rule with reasonable values;
grouping the recorded values according to fixed time intervals;
selecting linear interpolation padding in the absence of recorded values at a certain time, using adjacent front and back data points thereofAndweighted calculation average fills in the data points at this place +.>Wherein the weighted calculation average formula:
removing abnormal data by adopting an abnormal detection algorithm;
each category of the categorized time series data uses the tag value to determine the category of the time series data and records the category into the final data set D, expressed as:wherein Load is the Load, pv is the photovoltaic data, DG is the energy storage system.
3. The method for building the time series data prediction model based on vector clustering according to claim 1, wherein the method comprises the following steps: the vectorizing of the data in the S2 comprises the following steps:
s2.1, acquiring a data set D according to a time interval r of day, week and month to form a data set;
s2.2, converting the preprocessed time sequence data with different lengths into vectors with equal lengths, taking the cleaned data sequence as a sequence set X,
s2.3, cutting each data sequence leftwards and rightwards at the time t to obtain two sections of subsequences, wherein t is any time from the start time to the end time of each sequence in the X sequence set, and the pairs of subsequence pairs at different times t are sample pairs;
s2.4, converting the paired subsequences into paired vectors.
4. The method for building a time series data prediction model based on vector clustering according to claim 3, wherein: the step S2.4 of converting the paired subsequences into paired vectors comprises the steps of:
s2.4.1 inputting the pair subsequences into a first layer neural network to obtain hidden layer output Y;
s2.4.2 masking the hidden layer output Y;
s2.4.3, inputting the processed time sequence into the cavity convolution layer;
s2.4.4 the obtained pair vectors are recorded as,/>I=1, 2 … N; the output Z and Y of the last layer of convolution layer are spliced to obtain sequential characteristic paired vectors of the sequence, and the sequential characteristic vectors are one-dimensional characteristic large vectors, so that the sequential data context is extracted;
s2.4.5 selecting positive and negative samples, wherein the positive sample pair is marked as +R, and the negative sample pair is marked as-R;
s2.4.6, training each round to obtain a vector representation, inputting +R, -R into a hierarchical contrast learning frame to calculate a hierarchical contrast Loss function Loss, feeding the obtained Loss back to parameter updating, and circularly executing steps S2.4.5 and S2.4.6 until model parameters are converged;
s2.4.7, inputting the coded vector Vi obtained for each sequence in X via the converged model, the dimension of Vi being noted as u; all sets of time series sequences are uniformly vector-ized to a u-dimensional vector X,the vector is uniformly quantized to a u-dimensional vector.
5. The method for building the time series data prediction model based on vector clustering according to claim 4, wherein the method comprises the following steps: by a means ofThe +R in S2.4.5 is selected by the following wayI=1, 2 … N, t=1, 2,3, … N, t being the instant of the ith time sequence; r is selected in the form of->G is the time point.
6. The method for building the time series data prediction model based on vector clustering according to claim 4, wherein the method comprises the following steps: the S2.4.6 includes the steps of:
the hierarchical contrast loss functionWherein, the loss function in the subsequence is calculated and denoted as +.>The method comprises the steps of carrying out a first treatment on the surface of the Calculating a loss function between the pairs of samples, denoted +.>,/>,j=1,2…N;
When the difference between the adjacent values before and after the loss function is larger than 0, the model parameters are converged.
7. The method for constructing a time series data prediction model based on vector clustering according to claim 1, wherein the step S3 comprises the steps of:
clustering the time sequence data represented by the vector by using a vector clustering algorithm, classifying the similar sequence data segments into the same category, setting a number super parameter K of the clustering category, and repeatedly executing the following steps:
s3.1, obtaining an ith u-dimensional vector representation
S3.2, generating initial points of K vector spaces to form a cluster data setTaking the i-th vector encoded by the time sequence segment +.>The j-th initial point vector +.>Calculate->And->Distance per point +.>If (if)Then->,/>The dimension of the parameter; select minimum +.>,/>Corresponding->And->Add i to the corresponding +.>In (a) and (b);
s3.3, obtaining a center point of a new data point set after clusteringAccording to the formulaCalculating a vector average value and updating a center data set;
s3.4, repeating the steps S3.2 and S3.3 until the category corresponding to the center dataset and the center point is stable.
8. The method for building the time series data prediction model based on vector clustering according to claim 7, wherein the method comprises the following steps: and S3, clustering the time sequence data represented by the vector by using a vector clustering algorithm, wherein the convergence judgment condition is as follows:
if any of the following conditions is satisfied, the center dataset and the category corresponding to the center point are stable:
current center point vectorCenter point vector recorded with previous round +.>Is less than a threshold value (1 e -3 ~1e -6 );
Exceeding the set maximum wheel stack value M.
9. The method for constructing a time series data prediction model based on vector clustering according to claim 1, wherein the constructing of the time series data prediction model in S4 comprises the steps of:
s4.1, constructing a special discrete model f1, and constructing a sequence to obtain a class label for predicting a sequence mode in the next period;
s4.2, constructing a numerical model f2, and forming a set C2 by all data points marked by histories to obtain points in a prediction period; wherein the prediction period is 24h.
CN202311728973.2A 2023-12-15 2023-12-15 Time sequence data prediction model establishment method based on vector clustering Active CN117407681B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311728973.2A CN117407681B (en) 2023-12-15 2023-12-15 Time sequence data prediction model establishment method based on vector clustering

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311728973.2A CN117407681B (en) 2023-12-15 2023-12-15 Time sequence data prediction model establishment method based on vector clustering

Publications (2)

Publication Number Publication Date
CN117407681A true CN117407681A (en) 2024-01-16
CN117407681B CN117407681B (en) 2024-03-22

Family

ID=89487574

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311728973.2A Active CN117407681B (en) 2023-12-15 2023-12-15 Time sequence data prediction model establishment method based on vector clustering

Country Status (1)

Country Link
CN (1) CN117407681B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117996863A (en) * 2024-04-07 2024-05-07 国网浙江省电力有限公司宁波供电公司 Sagging control method and device for photovoltaic power supply, computer equipment and medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113033776A (en) * 2021-03-10 2021-06-25 浙大城市学院 Time sequence prediction method combining global cavity convolution and local identification characterization
CN114091752A (en) * 2021-11-22 2022-02-25 复旦大学 Method for improving time sequence prediction effect of time sequence prediction system
US20230108916A1 (en) * 2021-10-05 2023-04-06 Indian Institute Of Technology Bombay Method and system for forecasting non-stationary time-series

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113033776A (en) * 2021-03-10 2021-06-25 浙大城市学院 Time sequence prediction method combining global cavity convolution and local identification characterization
US20230108916A1 (en) * 2021-10-05 2023-04-06 Indian Institute Of Technology Bombay Method and system for forecasting non-stationary time-series
CN114091752A (en) * 2021-11-22 2022-02-25 复旦大学 Method for improving time sequence prediction effect of time sequence prediction system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
王华秋;廖晓峰;曹长修;李梁;: "基于鲁棒LS-SVM的ARMA时序模型研究", 系统仿真学报, no. 08, 20 April 2007 (2007-04-20) *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117996863A (en) * 2024-04-07 2024-05-07 国网浙江省电力有限公司宁波供电公司 Sagging control method and device for photovoltaic power supply, computer equipment and medium

Also Published As

Publication number Publication date
CN117407681B (en) 2024-03-22

Similar Documents

Publication Publication Date Title
CN112016734A (en) Stack type self-coding multi-model load prediction method and system based on LSTM
CN112529282A (en) Wind power plant cluster short-term power prediction method based on space-time graph convolutional neural network
CN111079989B (en) DWT-PCA-LSTM-based water supply amount prediction device for water supply company
CN117407681B (en) Time sequence data prediction model establishment method based on vector clustering
CN114792156A (en) Photovoltaic output power prediction method and system based on curve characteristic index clustering
CN118114955B (en) Power scheduling method of virtual power plant and related equipment
CN115222106A (en) User day-ahead load prediction method of self-adaptive model
CN111680818B (en) Short-term reactive load prediction method and system
CN118333338B (en) Data processing method and system of charging management platform
CN114330934A (en) Model parameter self-adaptive GRU new energy short-term power generation power prediction method
CN115375014A (en) Source-load combination probability prediction method, device and storage medium
CN112348236B (en) Abnormal daily load demand prediction system and method for intelligent electricity consumption monitoring terminal
CN118132948A (en) Electric power and electric quantity prediction method
CN118095704A (en) Rural typical energy supply and demand balance method and system based on big data
CN117134315A (en) Distribution transformer load prediction method and device based on BERT algorithm
CN117374920A (en) Ultra-short-term prediction method, device and medium considering environmental factors
CN116883057A (en) XGBoost-based high-precision power customer marketing channel preference prediction system
CN114004408B (en) User power load prediction method based on data analysis
CN116415714A (en) Wind power prediction method and device, electronic equipment and readable storage medium
CN115081551A (en) RVM line loss model building method and system based on K-Means clustering and optimization
Liu et al. SFCL: electricity consumption forecasting of CNN-LSTM based on similar filter
Kaushik et al. Performance Analysis of Regression Models in Solar PV Forecasting
Hong et al. Advancing Long-Term Multi-Energy Load Forecasting with Patchformer: A Patch and Transformer-Based Approach
CN118365139B (en) Risk situation awareness method, system, equipment and medium
Huang et al. Short-term load forecasting method based on heterogeneous big data of power

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
GR01 Patent grant
GR01 Patent grant