Settlement parameter prediction method and device, storage medium and electronic equipment
By extracting key features in historical energy settlement data, determining the matching candidate settlement period, and performing feature vector fusion calculation, the problem of insufficient accuracy of long-distance dependency capture in the prior art is solved, and the accuracy of power price prediction is improved.
Patent Information
- Application Number
- CN202510058162.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-14
- Publication Date
- 2025-05-06
AI Technical Summary
The prior art has low accuracy when capturing long-distance dependencies in data, resulting in insufficient prediction accuracy of power price.
By extracting the historical key features of the target energy based on multiple historical energy settlement data, a candidate settlement period matching the target settlement period is determined, a set of settlement feature vectors for the candidate settlement period is obtained, and a settlement characterization value is calculated through the feature vector fusion calculation, and the target settlement parameters are finally predicted using the characterization value.
It achieves a more refined capture of long-distance dependencies between data, improving the accuracy of power price prediction.
Smart Images

Figure CN119941309A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of power market transactions, and in particular to a method and device for predicting settlement parameters, a storage medium and an electronic device. Background Art
[0002] In order to count and control the electricity consumption of thousands of households, the power system began to implement an electricity price prediction mechanism. At present, the electricity price prediction methods provided in the prior art are mainly divided into two categories: traditional statistical methods and machine learning-based methods. Traditional statistical methods, such as the Autoregressive Integrated Moving Average model (AIMA) and the Vector Autoregression model (VAR), have limitations in dealing with nonlinear features and long-term dependencies, resulting in insufficient prediction accuracy. Machine learning-based methods, such as Recurrent Neural Network (RNN) and Long Short-Term Memory Network (LSTM), have some improvements in processing time series data, but they are usually difficult to capture long-distance dependencies.
[0003] Although the relevant technology provides some methods to capture long-distance dependencies in input sequences, since the timing information is often disrupted or time-misaligned events occur during the execution process, it is still difficult to ensure the accuracy of the parameters used for statistical settlement of the power system.
[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0005] Embodiments of the present invention provide a method and device for predicting settlement parameters, a storage medium, and an electronic device to at least solve the technical problem of low price prediction accuracy due to low accuracy in capturing long-distance dependencies in data.
[0006] According to one aspect of an embodiment of the present invention, a method for predicting settlement parameters is provided, comprising: extracting historical key features of a target energy based on multiple historical energy settlement data, wherein the historical energy settlement data include attribute data of settlement resources consumed by using the target energy in the multiple historical settlement periods; determining at least one candidate settlement period matching the target settlement period from the multiple historical settlement periods, wherein the feature similarity between the historical key features of the candidate settlement period and the key features of the target settlement period is greater than a target threshold; obtaining a settlement feature vector set corresponding to each of the candidate settlement periods, wherein the settlement feature vector set includes a set of feature vectors obtained by linearly transforming the historical energy settlement data of the candidate settlement period; obtaining a settlement characterization value matching the candidate settlement period based on a fusion calculation of each feature vector in the set of feature vectors; and predicting a target settlement parameter consumed by using the target energy in the target settlement period using the settlement characterization value.
[0007] As an optional implementation, the above-mentioned acquisition of the settlement feature vector set corresponding to each of the above-mentioned candidate settlement periods includes: converting the above-mentioned historical key features of each of the above-mentioned candidate settlement periods through a first multi-layer perceptron to obtain an embedded feature vector; performing a linear transformation on each of the above-mentioned embedded feature vectors according to different weights to generate the above-mentioned set of feature vectors including the query vector, the key vector and the value vector.
[0008] As an optional implementation, the above-mentioned settlement characterization value matching the above-mentioned candidate settlement period is obtained based on the fusion calculation of each feature vector in the above-mentioned set of feature vectors, including: performing dot product calculation on the above-mentioned query vector and all of the above-mentioned key vectors respectively to obtain an intermediate feature vector; performing scaling calculation and nonlinear transformation calculation on the above-mentioned intermediate feature vector to obtain an attention weight coefficient for indicating feature relevance; multiplying the above-mentioned attention weight coefficient and the corresponding above-mentioned value vector, and performing weighted summation on the obtained product results to obtain the above-mentioned settlement characterization value.
[0009] As an optional implementation, the above-mentioned use of the above-mentioned settlement characterization value to predict the target settlement parameters consumed by the use of the above-mentioned target energy during the above-mentioned target settlement period includes: inputting the above-mentioned settlement characterization value into an activation function to obtain a reference settlement result; and performing projection prediction processing on the above-mentioned reference settlement result through a second multi-layer perceptron to obtain the above-mentioned target settlement parameters.
[0010] As an optional implementation, the above-mentioned determination of at least one candidate settlement period that matches the above-mentioned target settlement period from the above-mentioned multiple historical settlement periods includes: performing grey correlation calculation on the above-mentioned historical key features of each of the above-mentioned historical settlement periods and the key features of the above-mentioned target settlement period, respectively, to obtain the corresponding first correlation degrees; calculating the cosine similarity between the above-mentioned historical key features of each of the above-mentioned historical settlement periods and the key features of the above-mentioned target settlement period, respectively, to obtain the corresponding second correlation degrees; performing weighted summation of the above-mentioned first correlation degrees and the above-mentioned second correlation degrees to obtain the overall similarity; and selecting the above-mentioned candidate settlement period from the above-mentioned multiple historical settlement periods according to the above-mentioned overall similarity.
[0011] As an optional implementation, the above-mentioned extraction of historical key features of the target energy based on multiple historical energy settlement data includes: extracting features from the historical energy settlement data within each of the above-mentioned historical settlement periods, and transforming them according to a unified data format to obtain a transformed settlement data sequence; and performing segmentation and labeling processing on the above-mentioned settlement data sequence to obtain the above-mentioned historical key features.
[0012] According to another aspect of an embodiment of the present invention, a settlement parameter prediction device is also provided, comprising: an extraction unit, used to extract historical key features of a target energy based on multiple historical energy settlement data, wherein the historical energy settlement data include attribute data of settlement resources consumed by using the target energy in the multiple historical settlement periods; a determination unit, used to determine at least one candidate settlement period matching the target settlement period from the multiple historical settlement periods, wherein the feature similarity between the historical key features of the candidate settlement period and the key features of the target settlement period is greater than a target threshold; an acquisition unit, used to acquire a settlement feature vector set corresponding to each of the candidate settlement periods, wherein the settlement feature vector set includes a set of feature vectors obtained by linearly transforming the historical energy settlement data of the candidate settlement period; a calculation unit, used to obtain a settlement characterization value matching the candidate settlement period based on a fusion calculation of each feature vector in the set of feature vectors; and a prediction unit, used to predict a target settlement parameter consumed by using the target energy in the target settlement period using the settlement characterization value.
[0013] As an optional implementation, the acquisition unit includes: a conversion module, used to convert the historical key features of each of the candidate settlement periods through a first multi-layer perceptron to obtain an embedded feature vector; a transformation module, used to perform linear transformation on each of the embedded feature vectors according to different weights to generate the set of feature vectors including the query vector, key vector and value vector.
[0014] As an optional implementation, the above-mentioned calculation unit includes: a first calculation module, used to perform dot product calculations on the above-mentioned query vector and all the above-mentioned key vectors respectively to obtain an intermediate feature vector; a second calculation module, used to perform scaling calculations and nonlinear transformation calculations on the above-mentioned intermediate feature vectors to obtain an attention weight coefficient indicating feature relevance; a third calculation module, used to multiply the above-mentioned attention weight coefficient and the corresponding above-mentioned value vector, and perform weighted summation on the obtained product results to obtain the above-mentioned settlement representation value.
[0015] As an optional implementation, the prediction unit includes: a fourth calculation module, used to input the settlement representation value into an activation function to obtain a reference settlement result; and a first processing module, used to perform projection prediction processing on the reference settlement result through a second multi-layer perceptron to obtain the target settlement parameter.
[0016] As an optional implementation, the determination unit includes: a fifth calculation module, used to perform grey correlation calculation on the historical key features of each of the historical settlement cycles and the key features of the target settlement cycle, respectively, to obtain the first correlation degrees corresponding to each of them; a sixth calculation module, used to calculate the cosine similarity between the historical key features of each of the historical settlement cycles and the key features of the target settlement cycle, respectively, to obtain the second correlation degrees corresponding to each of them; a summation module, used to perform weighted summation of the first correlation degree and the second correlation degree, to obtain the overall similarity; a selection module, used to select the candidate settlement cycle from the multiple historical settlement cycles according to the overall similarity.
[0017] As an optional implementation, the extraction unit includes: a second processing module, used to extract features from the historical energy settlement data within each of the above-mentioned historical settlement periods, and transform them according to a unified data format to obtain a transformed settlement data sequence; a third processing module, used to segment and annotate the above-mentioned settlement data sequence to obtain the above-mentioned historical key features.
[0018] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned settlement parameter prediction method when running.
[0019] According to another aspect of the embodiments of the present application, a computer program product or a computer program is provided, the computer program product or the computer program comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the above settlement parameter prediction method.
[0020] According to another aspect of the embodiments of the present application, there is also provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the above-mentioned settlement parameter prediction method through the computer program.
[0021] In an embodiment of the present invention, based on multiple historical energy settlement data, historical key features of the target energy are extracted, where the historical energy settlement data include attribute data of settlement resources consumed by using the target energy in multiple historical settlement periods; at least one candidate settlement period matching the target settlement period is determined from the multiple historical settlement periods, where the feature similarity between the historical key features of the candidate settlement period and the key features of the target settlement period is greater than a target threshold; a settlement feature vector set corresponding to each candidate settlement period is obtained, where the settlement feature vector set includes a set of feature vectors obtained by linearly transforming the historical energy settlement data of the candidate settlement period; based on a fusion calculation of each feature vector in a set of feature vectors, a settlement characterization value matching the candidate settlement period is obtained, and the settlement characterization value is used to predict the target settlement parameters consumed by using the target energy in the target settlement period, so as to achieve a more refined capture of long-distance dependencies between data based on the settlement feature vector set corresponding to the candidate settlement period, thereby achieving the effect of improving prediction accuracy, thereby solving the technical problem of low price prediction accuracy due to low accuracy in capturing long-distance dependencies in data. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0023] Figure 1 is a flow chart of an optional settlement parameter prediction method according to an embodiment of the present application;
[0024] Figure 2 is a schematic diagram of a structure of an optional prediction model of settlement parameters according to an embodiment of the present invention;
[0025] Figure 3 is a flowchart of another optional settlement parameter prediction method according to an embodiment of the present application;
[0026] Figure 4 is a flowchart of another optional settlement parameter prediction method according to an embodiment of the present application;
[0027] Figure 5 is a schematic structural diagram of an optional settlement parameter prediction device according to an embodiment of the present application;
[0028] Figure 6 It is a schematic diagram of the structure of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0029] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0030] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0031] According to one aspect of the embodiments of the present application, a method for predicting a settlement parameter is provided, such as Figure 1 As shown, the method includes:
[0032] S102, extracting historical key features of the target energy based on a plurality of historical energy settlement data, wherein the historical energy settlement data includes attribute data of settlement resources consumed by using the target energy in a plurality of historical settlement periods;
[0033] Optionally, in this embodiment, the historical energy settlement data may be, but is not limited to, factors related to settlement parameters of target energy in a certain historical period, and the target energy may include, but is not limited to, natural resources such as wind energy, electric energy, and water resources. For example, the target energy may be electric energy, and accordingly, the historical energy settlement data may be historical electricity prices, historical weather conditions, historical electricity loads, etc. The historical key features may include, but are not limited to, time series data such as the historical settlement data, seasonal information, and holiday information.
[0034] S104, determining at least one candidate settlement cycle matching the target settlement cycle from the multiple historical settlement cycles, wherein the feature similarity between the historical key features of the candidate settlement cycle and the key features of the target settlement cycle is greater than a target threshold;
[0035] Optionally, in this embodiment, the historical settlement period may be, but is not limited to, at least one historical day within a limited historical time period. The target settlement period may be, but is not limited to, a certain day to be predicted of the settlement parameter. The target threshold may be, but is not limited to, a preset value.
[0036] S106, obtaining a settlement feature vector set corresponding to each candidate settlement period, wherein the settlement feature vector set includes a set of feature vectors obtained by linearly transforming historical energy settlement data of the candidate settlement period;
[0037] Optionally, in this embodiment, a set of feature vectors in the above-mentioned settlement feature vector set may be, but is not limited to, calculated after inputting the above-mentioned historical energy settlement data into a preset prediction model and performing certain linear transformation operations in the prediction model. The above-mentioned set of feature vectors may include, but is not limited to, a query vector, a key vector, and a value vector calculated based on the above-mentioned historical energy settlement data.
[0038] S108, obtaining a settlement characterization value matching the candidate settlement period based on a fusion calculation of each feature vector in a set of feature vectors;
[0039] Optionally, in this embodiment, the above-mentioned settlement representation value can be, but is not limited to, obtained by utilizing a self-attention mechanism, calculating an attention weight based on the above-mentioned set of feature vectors, and performing weighted summation of the value vectors in the above-mentioned set of feature vectors based on the attention weight.
[0040] S110, using the settlement characterization value to predict the target settlement parameter consumed by the target energy within the target settlement period.
[0041] Optionally, in this embodiment, the target settlement parameter may be, but is not limited to, the price of the target energy, such as electricity price, water price, oil price, etc. The target settlement parameter may be, but is not limited to, based on the settlement characterization value, using the prediction model to learn the nonlinear representation between the data, and performing parameter prediction based on the learned nonlinear representation.
[0042] Optionally, in this embodiment, the above-mentioned preset prediction model may be, but is not limited to, a model including an embedding layer, a self-attention layer, a feedforward network layer, and a projection layer. Figure 2As shown, the prediction model includes an embedding layer 202, a self-attention layer 204, a feedforward network layer 208, a projection layer 212, a layer normalization 206 for connecting the self-attention layer 204 and the feedforward network layer 208, and a layer normalization 210 for connecting the feedforward network layer 208 and the projection layer 212. Among them, the embedding layer 202 is used to convert the original multivariate time series data into a high-dimensional space to enrich the data information that the model can process, so that the historical time series data used for prediction can be processed more effectively by the model. The self-attention layer 204 is used to capture the correlation between variables through the high-dimensional multivariate time series data sent by the embedding layer 202, and generate a sequence representation based on the correlation between the variables. The feedforward network layer 208 is used to learn the nonlinear relationship of the sequence based on the sequence representation generated by the self-attention layer, and generate a vector-shaped feature value. The projection layer 212 is used to make predictions based on the feature values and the learned nonlinear relationship, obtain reference values, and project the reference values to the vector space where the original multivariate time series data is located, thereby obtaining predicted values, and using them as the output of the prediction model. In addition, the self-attention layer 204 and the feedforward network layer 208, and the feedforward network layer 208 and the projection layer 212 are respectively connected through layer normalization and residuals to speed up the training speed and improve the stability of the prediction model.
[0043] Through the embodiments provided by the present application, based on multiple historical energy settlement data, historical key features of the target energy are extracted, where the historical energy settlement data include attribute data of settlement resources consumed by using the target energy in multiple historical settlement periods; at least one candidate settlement period matching the target settlement period is determined from multiple historical settlement periods, where the feature similarity between the historical key features of the candidate settlement period and the key features of the target settlement period is greater than the target threshold; a settlement feature vector set corresponding to each candidate settlement period is obtained, where the settlement feature vector set includes a set of feature vectors obtained by linearly transforming the historical energy settlement data of the candidate settlement period; based on the fusion calculation of each feature vector in a set of feature vectors, a settlement characterization value matching the candidate settlement period is obtained, and the settlement characterization value is used to predict the target settlement parameters consumed by using the target energy in the target settlement period, so as to achieve more refined capture of long-distance dependencies between data based on the settlement feature vector set corresponding to the candidate settlement period, thereby achieving the effect of improving prediction accuracy, thereby solving the technical problem of low price prediction accuracy due to low accuracy in capturing long-distance dependencies in data.
[0044] As an optional solution, in step S106, obtaining the settlement feature vector set corresponding to each candidate settlement period includes:
[0045] S1, transform the historical key features of each candidate settlement period through the first multi-layer perceptron to obtain an embedded feature vector;
[0046] S2, linearly transform each embedded feature vector according to different weights to generate a set of feature vectors including query vector, key vector and value vector.
[0047] Optionally, in this embodiment, the above-mentioned embedded feature vector can be, but is not limited to, obtained by performing high-dimensional transformation on the original multivariate time series data. For example, assuming that each variable x in the original multivariate time series data t , input it into the first multi-layer perceptron for two linear transformations to obtain high-dimensional multivariate time series data h t , as shown in Formula 1:
[0048] h t =MLP(x t )=W1σ1(W0x t +b0)+b1 (1)
[0049] Among them, t is used to indicate that the time series data is the data of the t-th historical day in a certain historical period, W0 and b0, W1 and b1 are the weights and biases of the two linear transformation operations respectively, and σ1 is a commonly used activation function, such as ReLU (Rectified Linear Unit, ReLU) function. t Input into the self-attention layer, a set of feature vectors including query vector, key vector and value vector are generated for each feature through linear transformation, as shown in formula 2-4:
[0050] Q t =W Q h t (2)
[0051] K t =W K h t (3)
[0052] V t =W V h t (4)
[0053] Among them, Q t , K t 、V t The vector h t The corresponding query vector, key vector and value vector. Q , W K , W V are preset weight matrices that are randomly initialized.
[0054] Through the embodiment provided by the present application, the historical key features of each candidate settlement period are transformed by the first multi-layer perceptron to obtain an embedded feature vector, and each embedded feature vector is linearly transformed according to different weights to generate a set of feature vectors including a query vector, a key vector and a value vector. The high-dimensional conversion of multivariate time series data is realized by the multi-layer perceptron, so that a higher-level feature representation can be abstracted from the original data, and the ability of the self-attention mechanism to capture the correlation between variables is enhanced, thereby improving the prediction accuracy. In addition, by generating a set of feature vectors including a query vector, a key vector and a value vector for each embedded feature vector, it is possible to independently perform feature analysis on the entire time series of each variable, so that the correlation between variables can be captured more finely, and the prediction accuracy is improved.
[0055] As an optional solution, in the above step S108, based on the fusion calculation of each feature vector in a set of feature vectors, the settlement characterization value matching the candidate settlement period is obtained, including:
[0056] S1, perform dot product calculations on the query vector and all key vectors to obtain the intermediate feature vector;
[0057] S2, scaling and nonlinear transformation calculations are performed on the intermediate feature vector to obtain the attention weight coefficient used to indicate the feature relevance;
[0058] S3, multiply the attention weight coefficient and the corresponding value vector, and perform weighted summation on the obtained product results to obtain the settlement representation value.
[0059] For example, the calculation process of obtaining the settlement characterization value can be shown as Formula 5:
[0060]
[0061] Among them, Q t , K t 、V t are query vector, key vector and value vector respectively. The intermediate feature vector is obtained by performing dot product calculation on the query vector and all key vectors, and then scaled by the feature dimension d. The scaled result is passed into the Softmax function for nonlinear transformation calculation to generate the attention weight coefficient with a value range of (0, 1). t Multiply them and perform weighted summation on the product results to obtain the settlement representation value Z t .
[0062] Through the embodiments provided in the present application, calculation operations such as dot product, scaling, and nonlinear transformation are performed based on the query vector, key vector, and value vector in the feature vector to calculate the settlement representation value, thereby being able to more accurately capture the mutual influence relationship between the features, and then being able to make accurate predictions through the correlation between the captured variables.
[0063] As an optional solution, in the above step S110, using the settlement characterization value to predict the target settlement parameter consumed by the target energy in the target settlement period includes:
[0064] S1, input the settlement representation value into the activation function to obtain the reference settlement result;
[0065] S2, performing projection prediction processing on the reference settlement result through the second multi-layer perceptron to obtain the target settlement parameters.
[0066] For example, the calculation process for obtaining the reference settlement result can be shown as Formula 6:
[0067] output=W4σ2(W3Z t +b3)+b4 (6)
[0068] Among them, W3 and b3, W4 and b4 are the weights and biases of the two linear transformation operations respectively, σ2 is a commonly used activation function, such as ReLU (Rectified Linear Unit, ReLU) function, and output is the reference settlement result. After obtaining the reference settlement result based on the settlement representation value, the reference settlement result is projected to the vector space where the original multivariate time series data is located based on the second multi-layer perceptron, so as to obtain the target settlement parameter As shown in Formula 7:
[0069]
[0070] Among them, W5 and b5, W6 and b6 are the weights and biases of two linear transformation operations respectively, and σ3 is a commonly used activation function, such as ReLU (Rectified Linear Unit, ReLU) function.
[0071] Through the embodiments provided in the present application, a reference settlement result is obtained by calculating the settlement representation value and the activation function, and the reference settlement result is projected and predicted based on the second multi-layer perceptron to obtain the target settlement parameters. The nonlinear relationship of the learning sequence is used, and the settlement parameters are predicted based on the nonlinear relationship, thereby improving the prediction accuracy of the settlement parameters.
[0072] Assume that the above target settlement parameters are constructed using the structure Figure 2 The prediction model shown in the figure is obtained by combining Figure 3The process shown is used to illustrate the process of calculating the target settlement parameters using the above prediction model in the embodiment of the present application:
[0073] Assuming that the first multilayer perceptron is set in the embedding layer 202 and the second multilayer perceptron is set in the projection layer 212, step S302 is executed to input the acquired historical daily data into the embedding layer 202, and the high-dimensional processing is performed on the historical daily data in the high-dimensional state by using the first multilayer perceptron in the embedding layer. Then, the historical daily data in the high-dimensional state is input into the self-attention layer, and S304 is executed. In the self-attention layer 204, the corresponding query vector, key vector, and value vector are calculated based on the historical daily data in the high-dimensional state, and the attention weight coefficient is calculated based on the query vector, key vector, and value vector to capture the correlation between variables and generate a sequence representation based on the correlation between variables. Then step S306 is executed to calculate the corresponding eigenvalue according to the attention weight coefficient in the feedforward network layer 208 of the model to learn the nonlinear relationship of the sequence. The eigenvalue is normalized in the layer normalization 210 to solve the problem of gradient disappearance or explosion, and step S308 is executed to calculate the reference value according to the processed eigenvalue and activation function. The reference value is then input into the projection layer 212, and step S310 is executed, where the reference value is processed into a low-dimensional space using the second multi-layer perceptron in the projection layer 212, that is, the reference value is projected into the same low-dimensional space as the historical daily data, thereby completing the prediction of the settlement parameters.
[0074] As an optional solution, the above step S104, determining at least one candidate settlement period matching the target settlement period from multiple historical settlement periods, includes:
[0075] S1, performing grey correlation calculation on the historical key features of each historical settlement period and the key features of the target settlement period respectively, and obtaining the first correlation degree corresponding to each;
[0076] S2, respectively calculating the cosine similarity between the historical key features of each historical settlement period and the key features of the target settlement period to obtain the corresponding second correlation degrees;
[0077] S3, performing weighted summation of the first correlation degree and the second correlation degree to obtain an overall similarity;
[0078] S4, selecting a candidate settlement period from multiple historical settlement periods based on the overall similarity.
[0079] For example, suppose the jth feature of the i-th historical day in a certain historical period can be expressed as x ij , then firstly perform dimensionless processing on it, as shown in Formula 8:
[0080]
[0081] Among them, max(x ij )、min(x ij ) are the maximum and minimum values of the jth feature in the i-th historical day, respectively. Then, based on the dimensionless data, the correlation coefficient is calculated, as shown in Formula 9:
[0082]
[0083] Among them, ρ is the resolution coefficient, which is generally taken as 0.5. j is the value of the jth feature on the day to be predicted. is the minimum absolute value of the difference between the jth feature of the i-th historical day and the jth feature of the day to be predicted. is the maximum absolute value of the difference between the jth feature on the i-th historical day and the jth feature on the predicted day, |x ij -y j | is the absolute value of the difference between the jth feature of the i-th historical day and the jth feature of the predicted day at the same time. The calculated correlation coefficient is weighted averaged, as shown in Formula 10:
[0084]
[0085] Among them, ω j is the weight of each feature, and n is the total number of features. i That is, the first correlation between the i-th historical day and the day to be predicted.
[0086] Furthermore, the calculation process of the second correlation degree can be shown as formula 11:
[0087]
[0088] Among them, A i , B are the data of the i-th historical day and the day to be predicted respectively. i It is the second correlation between the i-th historical day and the day to be predicted.
[0089] After the first correlation degree and the second correlation degree are calculated, the first correlation degree and the second correlation degree are weighted and summed to obtain the overall similarity S between the i-th historical day and the day to be predicted. i , as shown in Formula 12:
[0090] S i =αξ i +(1-α)D i (12)
[0091] Among them, α is the adaptive weight coefficient, and its value can be adaptively adjusted according to formula 13:
[0092]
[0093] Among them, D i This is the second degree of association mentioned above.
[0094] After the overall similarity is obtained, it is compared with a preset threshold to screen out at least one historical day whose overall similarity is greater than the preset threshold, and determine it as a candidate settlement period.
[0095] Through the embodiments provided in the present application, the comparison of historical key features of each historical settlement period and the key features of the target settlement period is realized through the calculation of grey correlation and cosine similarity, and then the candidate settlement period with higher similarity to the target settlement period is selected, thereby realizing the screening of historical data, thereby reducing the amount of calculation in the prediction process of settlement parameters and improving the prediction efficiency.
[0096] As an optional solution, in step S102, extracting historical key features of the target energy based on multiple historical energy settlement data includes:
[0097] S1, extracting features from the historical energy settlement data in each historical settlement period, and transforming them according to a unified data format to obtain a transformed settlement data sequence;
[0098] S2, segment and label the settlement data sequence to obtain historical key features.
[0099] For example, the frequency of the historical energy settlement data obtained in each historical time period is expanded or deleted, and transformed according to the unified data format, so that the frequency distribution of all data is 96 points in each historical day, that is, one data point every fifteen minutes. At each time point of data distribution, the data is segmented and labeled according to the peak, flat and valley distribution of the data, that is, the peak, flat and valley distribution of the data at that time point is additionally labeled on the basis of the original data.
[0100] Through the embodiments provided by the present application, feature extraction is performed from the historical energy settlement data in each historical settlement period, and the data is transformed according to a unified data format. The transformed settlement data sequence is segmented and labeled to obtain historical key features, thereby unifying the frequency distribution of the data, improving the prediction speed of the settlement parameters, and realizing further extraction of key features, so as to more comprehensively capture the influencing factors of the settlement parameters, making the prediction process of the settlement parameters more universal and applicable to more complex practical scenarios.
[0101] Specific combination Figure 4 The process shown is used to illustrate the process of applying the embodiment of the present application to the actual electricity price prediction scenario:
[0102] S402, data acquisition: acquiring time series data for prediction, including the target area's day-ahead electricity price, real-time electricity price, unit quotations, electricity load in different regions, weather, holidays, renewable energy power generation, thermal power unit operation modes (including operating capacity, reduced output, must-start and must-stop, etc.), disclosed data (including direct load regulation, inter-provincial interconnection line power supply), and other data.
[0103] S404, data preprocessing: expand or reduce the frequency of each data in the acquired time series data, and convert all data into 96 points a day, that is, one data point every 15 minutes. For each data distribution time point of each day, segment the data according to the peak, flat and valley distribution of the data, and mark the holiday information to construct new features, and finally add the seasonal information (spring, summer, autumn and winter, flood season, dry season, heating season).
[0104] S406, feature extraction; after data preprocessing, the grey correlation between the jth feature of the ith historical day and the jth feature of the day to be predicted is calculated, and the cosine similarity between the ith historical day and the day to be predicted is calculated, and the grey correlation and the cosine similarity are weighted to obtain the overall similarity between the ith historical day and the day to be predicted.
[0105] S408, similar days are determined; the similar days are compared with a preset similarity threshold, and the historical days corresponding to the overall similarity greater than the preset similarity threshold are determined as similar days.
[0106] S410, feature vector group calculation; input the multivariate time series data of similar days into the preset iTransformer model, which includes an embedding layer, a self-attention layer, a feedforward network layer and a projection layer. The embedding layer maps the original multivariate time series data to a higher-dimensional space to capture more complex features. The Transformer layer is used to capture the correlation between different variables and the long-term dependencies within the time series, and learn the nonlinear representation of the sequence. The projection layer projects the learned variable relationship back to the space of the prediction target, that is, predicting the future electricity market price. In the embedding layer, the multivariate time series data of similar days is processed in high dimension to obtain similar day data in a high-dimensional state. Subsequently, the similar day data in a high-dimensional state is input into the self-attention layer. In the self-attention layer, based on the historical daily data in a high-dimensional state, the corresponding query vector, key vector, and value vector are calculated, and the attention weight coefficient is calculated based on the query vector, key vector, and value vector.
[0107] S412, prediction value calculation: in the feedforward network layer of the model, the corresponding eigenvalues are calculated according to the attention weight coefficients, and the eigenvalues are normalized. In the projection layer, the eigenvalues are transformed into low dimensions to project the learned variable relationship back to the space of the prediction target to complete the prediction and obtain the prediction value.
[0108] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0109] According to another aspect of the embodiments of the present application, a settlement parameter prediction device for implementing the settlement parameter prediction method is also provided. Figure 5 As shown, the device comprises:
[0110] An extraction unit 502 is used to extract historical key features of a target energy based on a plurality of historical energy settlement data, wherein the historical energy settlement data includes attribute data of settlement resources consumed by using the target energy in a plurality of historical settlement periods;
[0111] A determination unit 504 is configured to determine at least one candidate settlement cycle matching the target settlement cycle from the plurality of historical settlement cycles, wherein a feature similarity between the historical key features of the candidate settlement cycle and the key features of the target settlement cycle is greater than a target threshold;
[0112] An acquisition unit 506 is used to acquire a settlement feature vector set corresponding to each candidate settlement period, wherein the settlement feature vector set includes a set of feature vectors obtained by linearly transforming the historical energy settlement data of the candidate settlement period;
[0113] A calculation unit 508, configured to obtain a settlement characterization value matching the candidate settlement period based on a fusion calculation of each feature vector in a set of feature vectors;
[0114] The prediction unit 510 is used to predict the target settlement parameters consumed by the target energy in the target settlement period by using the settlement characterization value.
[0115] Optionally, the embodiments in this solution may be but are not limited to the reference method embodiments, which will not be described in detail here.
[0116] As an optional solution, the acquisition unit includes:
[0117] A conversion module, used for converting the historical key features of each candidate settlement period through a first multi-layer perceptron to obtain an embedded feature vector;
[0118] The transformation module is used to perform linear transformation on each embedded feature vector according to different weights to generate a set of feature vectors including a query vector, a key vector and a value vector.
[0119] Optionally, the embodiments in this solution may be but are not limited to the reference method embodiments, which will not be described in detail here.
[0120] As an optional solution, the computing unit includes:
[0121] A first calculation module is used to perform dot product calculations on the query vector and all key vectors to obtain an intermediate feature vector;
[0122] A second calculation module is used to perform scaling calculation and nonlinear transformation calculation on the intermediate feature vector to obtain an attention weight coefficient for indicating feature relevance;
[0123] The third calculation module is used to multiply the attention weight coefficient and the corresponding value vector, and perform weighted summation on the obtained product results to obtain a settlement representation value.
[0124] Optionally, the embodiments in this solution may be but are not limited to the reference method embodiments, which will not be described in detail here.
[0125] As an optional solution, the prediction unit includes:
[0126] A fourth calculation module, used for inputting the settlement representation value into the activation function to obtain a reference settlement result;
[0127] The first processing module is used to perform projection prediction processing on the reference settlement result through a second multi-layer perceptron to obtain a target settlement parameter.
[0128] Optionally, the embodiments in this solution may be but are not limited to the reference method embodiments, which will not be described in detail here.
[0129] As an optional solution, the determining unit includes:
[0130] A fifth calculation module is used to perform grey correlation calculation on the historical key features of each historical settlement period and the key features of the target settlement period respectively to obtain the first correlation degrees corresponding to each of them;
[0131] A sixth calculation module, used to respectively calculate the cosine similarity between the historical key features of each historical settlement period and the key features of the target settlement period, to obtain the respective corresponding second correlation degrees;
[0132] A summing module, used for performing weighted summation on the first correlation degree and the second correlation degree to obtain an overall similarity;
[0133] The selection module is used to select a candidate settlement period from multiple historical settlement periods based on overall similarity.
[0134] Optionally, the embodiments in this solution may be but are not limited to the reference method embodiments, which will not be described in detail here.
[0135] As an optional solution, the extraction unit includes:
[0136] The second processing module is used to extract features from the historical energy settlement data in each historical settlement period and transform them according to a unified data format to obtain a transformed settlement data sequence;
[0137] The third processing module is used to perform segmentation and labeling processing on the settlement data sequence to obtain historical key features.
[0138] Optionally, the embodiments in this solution may refer to but not be limited to the above method embodiments, which will not be described in detail here.
[0139] According to one aspect of the present application, a computer-readable storage medium is provided, and a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method provided in various optional implementations of the above-mentioned settlement parameter prediction method.
[0140] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:
[0141] S1, extracting historical key features of a target energy based on a plurality of historical energy settlement data, wherein the historical energy settlement data includes attribute data of settlement resources consumed by using the target energy in a plurality of historical settlement periods;
[0142] S2, determining at least one candidate settlement cycle matching the target settlement cycle from multiple historical settlement cycles, wherein the feature similarity between the historical key features of the candidate settlement cycle and the key features of the target settlement cycle is greater than a target threshold;
[0143] S3, obtaining a settlement feature vector set corresponding to each candidate settlement period, wherein the settlement feature vector set includes a set of feature vectors obtained by linearly transforming the historical energy settlement data of the candidate settlement period;
[0144] S4, obtaining a settlement representation value matching the candidate settlement period based on a fusion calculation of each feature vector in a set of feature vectors;
[0145] S5, using the settlement characterization value to predict the target settlement parameter consumed by the target energy within the target settlement period.
[0146] According to one aspect of the present application, a computer program product is provided. The computer program product includes a computer program / instruction. The computer program / instruction includes a program code for executing the method shown in the above flowchart.
[0147] According to another aspect of the embodiments of the present application, an electronic device for implementing the above settlement parameter prediction method is also provided. Figure 6 As shown, the electronic device includes a memory 602 and a processor 604. The memory 602 stores a computer program, and the processor 604 is configured to execute the steps in any of the above method embodiments through the computer program.
[0148] Optionally, in this embodiment, the electronic device may be located in at least one network device among a plurality of network devices of a computer network.
[0149] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0150] S1, extracting historical key features of a target energy based on a plurality of historical energy settlement data, wherein the historical energy settlement data includes attribute data of settlement resources consumed by using the target energy in a plurality of historical settlement periods;
[0151] S2, determining at least one candidate settlement cycle matching the target settlement cycle from multiple historical settlement cycles, wherein the feature similarity between the historical key features of the candidate settlement cycle and the key features of the target settlement cycle is greater than a target threshold;
[0152] S3, obtaining a settlement feature vector set corresponding to each candidate settlement period, wherein the settlement feature vector set includes a set of feature vectors obtained by linearly transforming the historical energy settlement data of the candidate settlement period;
[0153] S4, obtaining a settlement representation value matching the candidate settlement period based on a fusion calculation of each feature vector in a set of feature vectors;
[0154] S5, using the settlement characterization value to predict the target settlement parameter consumed by the target energy within the target settlement period.
[0155] Alternatively, a person skilled in the art may understand that: Figure 6The structure shown is for illustration only, and the electronic device may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (Mobile Internet Devices, MID), a PAD, or other terminal devices. Figure 6 The structure of the electronic device is not limited. For example, the electronic device may also include Figure 6 More or fewer components (such as network interfaces, etc.) as shown in, or with Figure 6 Different configurations shown.
[0156] Among them, the memory 602 can be used to store software programs and modules, such as the program instructions / modules corresponding to the settlement parameter prediction method and device in the embodiment of the present application. The processor 604 executes various functional applications and data processing by running the software programs and modules stored in the memory 602, that is, realizing the above-mentioned settlement parameter prediction method. The memory 602 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 602 may further include a memory remotely located relative to the processor 604, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. Among them, the memory 602 can be specifically, but not limited to, used to store information such as historical energy settlement data. As an example, such as Figure 6 As shown, the memory 602 may include, but is not limited to, the extraction unit 502, the determination unit 504, the acquisition unit 506, the calculation unit 508, and the prediction unit 510 in the prediction device for the settlement parameters. In addition, other module units in the prediction device for the settlement parameters may also be included but are not limited to, which will not be repeated in this example.
[0157] Optionally, the transmission device 606 is used to receive or send data via a network. Specific examples of the network may include a wired network and a wireless network. In one example, the transmission device 606 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers via a network cable so as to communicate with the Internet or a local area network. In one example, the transmission device 606 is a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0158] In addition, the electronic device further includes: a display 608 for displaying the target settlement parameters; and a connection bus 610 for connecting the various module components in the electronic device.
[0159] In other embodiments, the terminal device or server may be a node in a distributed system, wherein the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting the multiple nodes through network communication. The nodes may form a point-to-point network, and any form of computing device, such as a server, terminal or other electronic device, may become a node in the blockchain system by joining the point-to-point network.
[0160] Optionally, in the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories), or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0161] Optionally, in this embodiment, a person of ordinary skill in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing hardware related to the terminal device through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.
[0162] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.
[0163] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0164] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0165] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0166] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0167] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0168] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for predicting settlement parameters, characterized in that: include: Extracting historical key features of a target energy based on a plurality of historical energy settlement data, wherein the historical energy settlement data includes attribute data of settlement resources consumed by using the target energy in the plurality of historical settlement periods; Determine at least one candidate settlement cycle matching the target settlement cycle from the multiple historical settlement cycles, wherein the feature similarity between the historical key features of the candidate settlement cycle and the key features of the target settlement cycle is greater than a target threshold; Acquire a settlement feature vector set corresponding to each of the candidate settlement periods, wherein the settlement feature vector set includes a set of feature vectors obtained by linearly transforming the historical energy settlement data of the candidate settlement period; Based on the fusion calculation of each feature vector in the set of feature vectors, a settlement characterization value matching the candidate settlement period is obtained; The settlement characterization value is used to predict a target settlement parameter consumed by using the target energy within the target settlement period.
2. The method according to claim 1, characterized in that The acquiring of the settlement feature vector set corresponding to each of the candidate settlement periods comprises: Transforming the historical key features of each of the candidate settlement periods through a first multi-layer perceptron to obtain an embedded feature vector; Each of the embedded feature vectors is linearly transformed according to different weights to generate the set of feature vectors including a query vector, a key vector and a value vector.
3. The method according to claim 2, characterized in that The obtaining of the settlement characterization value matching the candidate settlement period based on the fusion calculation of each feature vector in the set of feature vectors includes: Performing dot product calculations on the query vector and all the key vectors to obtain intermediate feature vectors; Performing scaling calculation and nonlinear transformation calculation on the intermediate feature vector to obtain an attention weight coefficient for indicating feature relevance; The attention weight coefficient is multiplied by the corresponding value vector, and the obtained product is weighted summed to obtain the settlement representation value.
4. The method according to claim 3, characterized in that The method of using the settlement characterization value to predict the target settlement parameter consumed by using the target energy in the target settlement period includes: Inputting the settlement representation value into an activation function to obtain a reference settlement result; The reference settlement result is projected and predicted by a second multi-layer perceptron to obtain the target settlement parameter.
5. The method according to claim 1, characterized in that The determining at least one candidate settlement period that matches the target settlement period from the multiple historical settlement periods includes: Performing grey correlation calculation on the historical key features of each of the historical settlement periods and the key features of the target settlement period respectively to obtain respective corresponding first correlation degrees; Respectively calculating the cosine similarity between the historical key features of each of the historical settlement periods and the key features of the target settlement period to obtain respective corresponding second correlation degrees; Performing a weighted summation on the first degree of association and the second degree of association to obtain an overall similarity; The candidate settlement period is selected from the multiple historical settlement periods according to the overall similarity.
6. The method according to any one of claims 1 to 5, characterized in that The extraction of historical key features of target energy based on multiple historical energy settlement data includes: Extracting features from the historical energy settlement data in each of the historical settlement periods, and transforming them according to a unified data format to obtain a transformed settlement data sequence; The settlement data sequence is segmented and labeled to obtain the historical key features.
7. A settlement parameter prediction device, characterized in that: include: An extraction unit, configured to extract historical key features of a target energy based on a plurality of historical energy settlement data, wherein the historical energy settlement data includes attribute data of settlement resources consumed by using the target energy in the plurality of historical settlement periods; a determining unit, configured to determine at least one candidate settlement cycle matching the target settlement cycle from the multiple historical settlement cycles, wherein a feature similarity between the historical key features of the candidate settlement cycle and the key features of the target settlement cycle is greater than a target threshold; An acquisition unit, configured to acquire a settlement feature vector set corresponding to each of the candidate settlement periods, wherein the settlement feature vector set includes a set of feature vectors obtained by linearly transforming the historical energy settlement data of the candidate settlement period; A calculation unit, configured to obtain a settlement characterization value matching the candidate settlement period based on a fusion calculation of each feature vector in the set of feature vectors; The prediction unit is used to predict the target settlement parameter consumed by using the target energy in the target settlement period by using the settlement characterization value.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program is executed by a processor to perform the method described in any one of claims 1 to 6.
9. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 6 through the computer program.