A method for completing low-rank matrix of electricity consumption of power users in electricity spot trading

By combining STL time series decomposition and learning vector quantization method, the problem of missing user electricity consumption data in electricity spot trading was solved, high-precision data completion and supply and demand balance were achieved, and the efficiency of electricity market transactions was improved.

CN118395053BActive Publication Date: 2025-09-19STATE GRID SHANXI MARKETING SERVICE CENT +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410293481.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-14
Publication Date
2025-09-19
Estimated Expiration
2044-03-14

AI Technical Summary

Technical Problem

Existing matrix completion methods cannot effectively update data information when dealing with missing user electricity consumption data in electricity spot transactions, resulting in supply and demand imbalance and low completion accuracy.

Method used

STL time series decomposition is used to decompose user electricity consumption data into smooth trend terms, periodic terms and residual terms, and then converted into Toeplitz matrix form. Combining learning vector quantization method and stochastic gradient descent method, the objective function is optimized through low-rank decomposition and regularization term to update missing data.

Benefits of technology

It improves the accuracy of data completion, ensures the supply and demand balance in spot transactions and the integrity and reliability of load aggregator data, and improves the settlement efficiency of power market transactions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118395053B_ABST
    Figure CN118395053B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of data processing technology, and specifically refers to a method, device, equipment, and computer-readable storage medium for completing a low-rank matrix of electricity consumption of electricity users in electricity spot transactions, comprising: obtaining required time series data and decomposing it; obtaining meteorological data, converting it into a label set, and defining a label sequence; defining a disturbance term and a regularization term based on the fact that a subsequence of residual terms under similar labels is close to a representative vector after quantization of the subsequence; defining a smoothing trend regularization term based on the fact that the fluctuation between adjacent moments of the smoothing trend term is small; establishing an objective function, updating the objective function using a stochastic gradient descent method, iterating to a preset number of iterations, obtaining a completed data matrix, comparing it with the original matrix, and solving the missing value of electricity using a mean method. When data is missing, the present invention updates the data, reduces data sparsity, improves the accuracy of data completion, improves the settlement efficiency of spot transactions in the electricity market, and ensures the data integrity and reliability of load aggregators participating in spot transactions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing in electricity spot trading, and in particular to a method and device for completing a low-rank matrix of electricity consumption of electricity users in electricity spot trading. Background Art

[0002] At present, my country is actively promoting power system reform, requiring all provinces to carry out power reform according to actual conditions, and promoting the continuous development of the power market by combining power receiving side reform, transmission and distribution price determination and direct power energy trading. However, due to the initial stage of my country's power market, market-oriented transactions are lagging behind, planned management still dominates power system dispatching, and changes in supply and demand are not fully reflected in market prices. Therefore, it is necessary to further promote the construction of the power market system, strengthen the power spot market, better select market models and design market plans, and lay the foundation for power system reform.

[0003] Spot trading involves various power generation companies, power users, and power retail companies. Electricity consumption plays a crucial role as a trading commodity in the electricity market. However, during the electricity collection process, factors such as communication interference, equipment aging, sensor failures, communication obstructions, and human influence can result in poor data collection quality and missing electricity data. Most user electricity consumption is traded through load aggregators. When a user's load is missing, an imbalance between supply and demand can occur. Therefore, data completion is urgently needed to ensure the integrity and reliability of the data from load aggregators participating in spot trading.

[0004] Existing matrix completion methods include the KNN algorithm, linear interpolation, and traditional low-rank matrix completion methods. However, the KNN algorithm and linear interpolation methods are not effective in handling missing data, resulting in missing electricity during day-ahead transactions, inaccurate electricity consumption data, and imbalance between supply and demand. Traditional low-rank matrix completion methods are unable to update data information when dealing with continuous missing values ​​and entire segments of missing values, resulting in the inability to perform gradient descent in matrix completion, increased data sparsity, and low completion accuracy. Summary of the Invention

[0005] To this end, the technical problem to be solved by the present invention is to overcome the problem that the existing technology is not effective in handling missing data, resulting in an imbalance between supply and demand; when processing continuous missing values ​​and entire segments of missing values, the data information cannot be updated, resulting in the inability to perform gradient descent in matrix completion, resulting in increased data sparsity, and thus causing the problem of low completion accuracy.

[0006] To solve the above technical problems, the present invention provides a method for completing a low-rank matrix of power consumption of power users in power spot trading, comprising:

[0007] The Promethus time series database was used to extract the electricity consumption time series data of coal plant users participating in spot trading. The STL time series addition method was used to decompose the extracted electricity consumption time series data of coal plant users participating in spot trading into a smooth trend term, a period term, and a residual term.

[0008] The electricity consumption time series data of coal plant users participating in spot trading is converted into a symmetric Toeplitz matrix to obtain the original data matrix; the smooth trend term, period term, and residual term are Toeplitz-ized to obtain the smooth trend term matrix, period term matrix, and residual term matrix; based on the low rank property of the original data matrix, the smooth trend term matrix is ​​low-rank decomposed to obtain the low-rank decomposition matrix of the smooth trend term matrix, thereby obtaining an approximation matrix of the difference between the original data matrix and the period term matrix;

[0009] In the Oracle relational database, obtain external interference information and transform it into a label set Based on the label set, according to the time series data of electricity consumption of coal plant users participating in spot trading X(t) = <x1,x2,...,x T >Sequence, define label sequence Y= <y1,y2,...,y T >;wherein, the label sequence corresponds to the time series data one by one; set the power consumption data loss indication matrix W={w t}∈{0,1} T , define the labeled time series data of electricity consumption of coal plant users participating in spot trading LCD=<X,W,Y> ;

[0010] Extract the corresponding labels in the residual items as Q m The data is extracted to form a residual term subsequence corresponding to each label; the learning vector quantization method is used to process each residual term subsequence to obtain the representative vector corresponding to each residual term subsequence, and the first distance formula is used to express the constraint relationship between each data in all residual term subsequences and their corresponding representative vectors; the corresponding labels in the residual term matrix are extracted as Q m The data is obtained to form a residual matrix submatrix corresponding to each label; the learning vector quantization method is used to process each residual matrix submatrix to obtain the representative vector matrix corresponding to each residual matrix submatrix; based on the first distance formula, the perturbation term regularization term is designed to represent the constraint relationship between all residual matrix submatrices and their corresponding representative vector matrices;

[0011] For the smooth trend term, the second distance formula is used to express the constraint relationship between the smooth trend term data at adjacent moments. Based on the second distance formula, the low-rank decomposition matrix of the smooth trend term matrix is ​​used to design the smooth trend regularization term to express the constraint relationship between the data at adjacent moments in the matrix.

[0012] Based on the traditional matrix decomposition framework, the objective function is established by combining the smooth trend regularization term and the disturbance regularization term. The stochastic gradient descent method is used to update the objective function and solve the low-rank decomposition matrix and the residual term matrix. The iterative update is performed until the preset number of iterations is reached to obtain the target low-rank decomposition matrix and the target residual term matrix, thereby obtaining the target approximation matrix.

[0013] The completed data matrix is ​​obtained through the periodic term matrix and the target approximation matrix; the corresponding position of the missing data in the completed data matrix is ​​obtained according to the position of the missing data in the original data matrix; the missing value of electricity is solved by the mean method according to the data value at the corresponding position, and the completed time series data of electricity consumption of coal plant users participating in spot trading is obtained; the completed time series data of electricity consumption of coal plant users participating in spot trading is put back into the Promethus time series database.

[0014] Preferably, in the Promethus time series database, the time series data of electricity consumption of coal plant users participating in spot transactions are extracted; the extracted time series data of electricity consumption of coal plant users participating in spot transactions are decomposed into a smooth trend term, a period term, and a residual term using STL time series addition; each term in the decomposition expression is Toeplitz-ized to obtain an original data matrix, a smooth trend term matrix, a period term matrix, and a residual term matrix; based on the low rank property of the original data matrix, the smooth trend term matrix is ​​low-rank decomposition is performed to obtain a low-rank decomposition matrix of the smooth trend term matrix, thereby obtaining an approximation matrix of the difference between the original data matrix and the period term matrix, including:

[0015] In the Promethus time series database, we use the Promethus web UI or API to query the stored timestamps and corresponding time series data, using the PromQL query language combined with the Grafana visualization tool to obtain the time series data of electricity consumption of coal plant users participating in spot trading. We then perform STL time series additive decomposition on this data, decomposing it into a smooth trend term, a periodic term, and a residual term. The decomposition expression is as follows:

[0016] X(t)=S(t)+T(t)+E(t)

[0017] Where X(t) represents the time series data of electricity consumption of coal plant users participating in spot transactions; S(t) represents the smooth trend term; T(t) represents the period term; E(t) represents the residual term;

[0018] The time series data of electricity consumption of coal plant users participating in spot transactions are converted into a symmetric Toeplitz matrix form, then the matrix is

[0019]

[0020] Among them, each row and column reflects the temporal correlation of adjacent elements; t Represents the data at time t;

[0021] The smooth trend term, period term and residual term are Toeplitzized to obtain the data decomposition matrix expression after Toeplitzization.

[0022] T p (X) = T p (S)+T p (T)+T p (E)

[0023] Among them, T p (X) represents the original data matrix; T p (S) represents the smooth trend matrix, T p (T) represents the periodic term matrix, T p (E) represents the residual matrix;

[0024] Based on the singular value decomposition of the matrix, it is proved that the original data matrix has low rank property; based on the low rank property of the original data matrix, the smooth trend term matrix is ​​decomposed into low rank T p (S), and the corresponding low-rank decomposition matrices U and V are obtained; then the approximation matrix of the difference between the original data matrix and the periodic term matrix is ​​expressed as

[0025] A=UV+T p (E)

[0026] Where A represents the approximation matrix of the difference between the original data matrix and the periodic term matrix; U and V represent low-rank decomposition matrices.

[0027] Preferably, the external interference information is obtained in the oracle relational database and converted into a label set Based on the label set, according to the time series data of electricity consumption of coal plant users participating in spot trading X(t) = <x1,x2,...,x T >Sequence, define label sequence Y= <y1,y2,...,y T >;wherein, the label sequence corresponds to the time series data one by one; set the power consumption data loss indication matrix W={w t}∈{0,1} T , define the labeled time series data of electricity consumption of coal plant users participating in spot trading LCD=<X,W,Y> include:

[0028] In the Oracle relational database, obtain meteorological data and transform it into a label set Among them, Q mIndicates a tag with tag type m, where M represents the tag type;

[0029] Define the label sequence to represent the impact of meteorological data on the time series data of electricity consumption of coal plant users participating in spot trading, then the label sequence is expressed as

[0030] Y= <y1,y2,...,y T >

[0031] Among them, y t ∈Y, t∈[1,T], represents the label at time t; the label sequence corresponds one-to-one to the time series data of electricity consumption of users participating in spot trading;

[0032] The time series data of electricity consumption of coal plant users participating in spot trading with labels is defined as: LCD =<X,W,Y> ;

[0033] Where, X(t)= <x1,x2,...,x T > represents a time series of length T, x t ∈R represents the data at time t; indicator matrix W={w t}∈{0,1} T , when w t =0 means the power data is lost. t =1 indicates that the power data is complete; Y indicates the tag sequence.

[0034] Preferably, the corresponding labels in the extracted residual items are Q m The data is extracted to form a residual term subsequence corresponding to each label; the learning vector quantization method is used to process each residual term subsequence to obtain the representative vector corresponding to each residual term subsequence, and the first distance formula is used to express the constraint relationship between each data in all residual term subsequences and their corresponding representative vectors; the corresponding labels in the residual term matrix are extracted as Q m The data is obtained to form a residual matrix submatrix corresponding to each label; the learning vector quantization method is used to process each residual matrix submatrix to obtain the representative vector matrix corresponding to each residual matrix submatrix; based on the first distance formula, the perturbation term regularization term is designed to represent the constraint relationship between all residual matrix submatrices and their corresponding representative vector matrices, including:

[0035] Based on the one-to-one correspondence between the label sequence and the time series data of electricity consumption of coal plant users participating in spot transactions, the label sequence and the residual data also maintain a one-to-one correspondence;

[0036] Based on the above conclusions, the corresponding labels in the residual items are extracted as Q m The data is taken out to form a residual term subsequence corresponding to each label, and the corresponding label is Q mThe residual term subsequence of

[0037] The learning vector quantization method is used to map the corresponding label to Q m The residual term subsequence is processed to obtain the representative vector corresponding to the residual term subsequence Given that the data differences of the same user under the same label are small, the sum of the distances between all elements in the residual term subsequence and the corresponding representative vector can be expressed as

[0038]

[0039] The first distance formula is used to express the constraint relationship between each data in all residual item subsequences and their corresponding representative vectors, which can be expressed as

[0040]

[0041] in, Represents the label Q m The sum of the distances between the corresponding residual term subsequence and its corresponding representative vector; e represents the residual term data; e u Represents the label Q m The corresponding subsequence The u-th data in; Q represents the label set; m represents the label type; Q m Indicates the label type m is a label; I∈R T×T is the identity matrix; H∈{0,1} T×M Indicates the position of different labels in the label sequence Y if and only if y t =Q m When H t,m =1;H T represents the transposed matrix of H; C∈R M×M Indicates that only the diagonal elements are non-zero and have a value of C m,m =1 / c m The matrix, c m Represents the label Q m The number of times it appears in the tag sequence; B = I-HCH T ; Since the labels corresponding to the meteorological data will not be lost, the values ​​of the elements in B, H, and C are all fixed values;

[0042] Extract the corresponding labels Q in the residual matrix respectively m The data is taken out to form the residual term matrix submatrix corresponding to each label, then the residual term matrix submatrix corresponding to the label is expressed as;

[0043] The machine learning method is used to process each residual matrix sub-matrix to obtain the representative vector matrix corresponding to each residual matrix sub-moment

[0044] Based on the first distance formula, considering that under the same label, the missing data in each residual matrix submatrix is ​​close to the corresponding vector in its corresponding representative vector matrix, the perturbation term regularization term is designed to represent the constraint relationship between the submatrix and its corresponding representative vector matrix, then the perturbation term regularization term is expressed as

[0045]

[0046] in, represents the square of the matrix F-norm, Indicates that the corresponding label in the residual matrix E is Q m The residual matrix submatrix composed of all the data; express The representative vector matrix obtained by learning vector quantization.

[0047] Preferably, for the smooth trend item, the second distance formula is used to represent the constraint relationship between the smooth trend item data at adjacent moments; based on the second distance formula, the low-rank decomposition matrix of the smooth trend item matrix is ​​used to design the constraint relationship between the data at adjacent moments in the smooth trend regularization item representation matrix, including:

[0048] Based on the constraint relationship of small fluctuation between adjacent data of smooth trend items, the second distance formula is used to express It can be expressed as

[0049]

[0050] Among them, s t Represents the smooth trend item data at time t, s t-1 Represents the smooth trend item data at time t-1, s represents the smooth trend item data, t represents the time moment, and T represents the time length; represents the square of the l2 norm, L1 represents the smooth constraint matrix, which is defined as

[0051]

[0052] Among them, all the unmarked ones in the above matrix are 0; R represents the set of real numbers;

[0053] For the smooth trend matrix T p (S), considering that the data values ​​with a time difference of 1 are close, combined with the low-rank decomposition matrices U and V, based on the second distance formula, the smooth trend regularization term is defined, and the smooth trend regularization term is expressed as

[0054]

[0055] Where i, t represent the number of rows and columns of the matrix; T represents the time length; and D represents the total number of rows.

[0056] Preferably, the objective function is established based on the traditional matrix decomposition framework, combined with the smooth trend regularization term and the disturbance term regularization term; the objective function is updated using the stochastic gradient descent method to solve the low-rank decomposition matrix and the residual term matrix; the iterative update is performed until a preset number of iterations is reached to obtain the target low-rank decomposition matrix and the target residual term matrix, thereby obtaining the target approximation matrix, which includes:

[0057] Based on the traditional matrix decomposition framework, combined with the smooth trend regularization term and the disturbance regularization term, the objective function is established:

[0058]

[0059] Among them, λ S ,λ E ,λ O represents the regularization coefficient; i, t represents the number of rows and columns of the matrix; [T p (X) i,t -T p (T) i,t ] represents the original sequence matrix, A i,t Represents the reconstruction sequence matrix, A i,t =U i,: V :,t +E i,t ;([T p (X) i,t -T p (T) i,t ]-A i,t ) 2 is the root mean square error between the original sequence and the reconstructed sequence, indicating the reconstruction error; R S (U, V) represents the smooth trend regularization term; R E (E) represents the disturbance term and regularization term; R O (U, V, E) represents the standard regularization term; W represents the indicator matrix; X represents the time series data of electricity consumption of coal plant users participating in spot trading; Y represents the label sequence;

[0060] Among them, in order to prevent the data from overfitting, the standard regularization term is defined as

[0061]

[0062] in, represents the square of the matrix F-norm;

[0063] The stochastic gradient descent method is used to update the objective function and solve the low-rank matrix and the residual matrix. Each updated objective function is expressed as

[0064]

[0065] Among them, U and V represent the low-rank decomposition matrix of the smooth trend term; E represents the residual term matrix; X represents the time series data of electricity consumption of coal plant users participating in spot trading; Y represents the label sequence; W represents the indicator matrix;

[0066] Since the decomposed data are all periodic, the periodic items do not need to be updated;

[0067] By continuously iterating and updating until the preset number of iterations is reached, the target low-rank decomposition matrix and the target residual matrix are obtained, which can be expressed as

[0068]

[0069]

[0070]

[0071] Among them, error i,t =[T p (X) i,t -T p (T) i,t ]-A i,t ; Indicates that the corresponding label in E is Q m The residual matrix submatrix composed of all the data; express The representative vector matrix obtained by learning vector quantization;

[0072] According to the target low-rank decomposition matrix and the target residual matrix, the target approximation matrix is ​​obtained for

[0073]

[0074] Where i and t represent the number of rows and columns of the matrix.

[0075] Preferably, the method of obtaining a completed data matrix through the periodic term matrix and the target approximation matrix; obtaining corresponding positions of the missing data in the completed data matrix according to the positions of the missing data in the original data matrix; solving the missing values ​​of electricity using the mean method according to the data values ​​at the corresponding positions to obtain completed time series data of electricity consumption of coal plant users participating in spot transactions; and placing the completed time series data of electricity consumption of coal plant users participating in spot transactions back into the Promethus time series database includes:

[0076] Through the periodic term matrix and the target approximation matrix, the completed data matrix is ​​obtained, and the completed data matrix is ​​expressed as

[0077]

[0078] Among them, T p (T) i,t represents the periodic term matrix;

[0079] According to the position of the missing data in the original data matrix, corresponding to the completed data matrix, the position of the corresponding missing data is found in the completed data matrix; according to the data value at the corresponding missing data position found, the mean method is used to solve the missing value of electricity, and its expression is

[0080]

[0081] Where j represents the position of the missing value in the completed symmetric Toeplitz data matrix; N represents the number of positions corresponding to the missing value in the completed symmetric Toeplitz data matrix;

[0082] Import the modified data into the Promethus time series database through the HTTP API or add remote write configuration to the Promethus configuration file. After completion, use the Promethus Web UI or API query to verify whether the completed electricity consumption data of coal plant users participating in spot trading has been successfully written.

[0083] The present invention also provides a device for completing a low-rank matrix of power consumption of power users in power spot trading, comprising:

[0084] Data acquisition and decomposition module: Extracts time series data on electricity consumption of coal plants participating in spot trading from the Promethus time series database. Uses STL time series addition to decompose the extracted time series data into smoothed trend terms, periodic terms, and residual terms.

[0085] Data Toeplitzization module: This module converts the electricity consumption time series data of coal plant users participating in spot trading into a symmetric Toeplitz matrix to obtain the original data matrix. The smooth trend term, period term, and residual term are Toeplitzized to obtain the smooth trend term matrix, period term matrix, and residual term matrix. Based on the low rank property of the original data matrix, the smooth trend term matrix is ​​low-rank decomposed to obtain the low-rank decomposition matrix of the smooth trend term matrix, thereby obtaining an approximation matrix of the difference between the original data matrix and the period term matrix.

[0086] Define the label module: In the Oracle relational database, obtain external interference information and transform it into a label set Based on the label set, according to the time series data of electricity consumption of coal plant users participating in spot trading X(t) = <x1,x2,...,x T >Sequence, define label sequence Y= <y1,y2,...,yT >;wherein, the label sequence corresponds to the time series data one by one; set the power consumption data loss indication matrix W={w t}∈{0,1} T , define the labeled time series data of electricity consumption of coal plant users participating in spot trading LCD=<X,W,Y> ;

[0087] Design disturbance term regularization module: extract the corresponding label Q in the residual term respectively m The data is extracted to form a residual term subsequence corresponding to each label; the learning vector quantization method is used to process each residual term subsequence to obtain the representative vector corresponding to each residual term subsequence, and the first distance formula is used to express the constraint relationship between each data in all residual term subsequences and their corresponding representative vectors; the corresponding labels in the residual term matrix are extracted as Q m The data is obtained to form a residual matrix submatrix corresponding to each label; the learning vector quantization method is used to process each residual matrix submatrix to obtain the representative vector matrix corresponding to each residual matrix submatrix; based on the first distance formula, the perturbation term regularization term is designed to represent the constraint relationship between all residual matrix submatrices and their corresponding representative vector matrices;

[0088] Design a smooth trend term module: For the smooth trend term, the second distance formula is used to express the constraint relationship between the smooth trend term data at adjacent moments. Based on the second distance formula, the low-rank decomposition matrix of the smooth trend term matrix is ​​used to design a smooth trend regularization term to express the constraint relationship between the data at adjacent moments in the matrix.

[0089] Constructing the objective function module: Based on the traditional matrix decomposition framework, combined with the smooth trend regularization term and the disturbance regularization term, the objective function is established;

[0090] Objective function solution module: Use stochastic gradient descent to update the objective function and solve the low-rank decomposition matrix and residual matrix; iteratively update until the preset number of iterations is reached to obtain the target low-rank decomposition matrix and target residual matrix, thereby obtaining the target approximation matrix;

[0091] Data completion module: The completed data matrix is ​​obtained by combining the periodic term matrix and the target approximation matrix. The corresponding position of the missing data in the completed data matrix is ​​obtained based on the position of the missing data in the original data matrix. The missing electricity value is solved using the mean method based on the data value at the corresponding position to obtain the completed time series data of electricity consumption of coal plant users participating in spot trading.

[0092] Data import module: puts the completed time series data of electricity consumption of coal plant users participating in spot transactions back into the Promethus time series database.

[0093] The present invention also provides a device for completing a low-rank matrix of power consumption of power users in power spot trading, comprising:

[0094] Memory for storing computer programs;

[0095] A processor is used to implement the steps of any one of the methods for completing the low-rank matrix of electricity consumption of electricity users in electricity spot trading when executing the computer program.

[0096] The present invention also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the method for completing the low-rank matrix of electricity consumption of electricity users in any one of the electricity spot transactions are implemented.

[0097] The above technical solution of the present invention has the following beneficial effects compared with the prior art:

[0098] (1) The method for completing the low-rank matrix of electricity consumption of power users in electricity spot transactions described in the present invention extracts the time series data of electricity consumption of power users in electricity spot transactions from the Promethus time series database, which can better meet the requirement of large data storage demand in spot transactions;

[0099] (2) The method for completing the low-rank matrix of electricity consumption of power users in electricity spot trading described in the present invention adopts STL (Standard Template Library) additive decomposition of the time series data of electricity consumption of coal plant users participating in spot trading to obtain the internal smooth trend term, period term and residual term of the time series data; after STL decomposition, the data fluctuation of the time series data of user electricity consumption with a difference of 1 in the smooth trend is small, thereby ensuring the stability of the data; at the same time, since the decomposed time series data of user electricity consumption has strict periodicity, there is no need to further update the period term, thereby reducing the amount of calculation;

[0100] (3) The present invention discloses a method for completing a low-rank matrix of electricity consumption of electricity users in electricity spot trading. The method adopts a clustering method to analyze the electricity consumption data and residual data of users participating in spot trading, and finds the similarity of electricity consumption behaviors of similar users. The Toeplitz matrix is ​​used to further enhance the temporal correlation between data, and a low-rank matrix decomposition model is constructed based on the STL time series addition model. The method can update the data when a whole segment of data is missing, reduce the sparsity of the data, improve the accuracy of data completion, enhance the settlement efficiency of spot transactions in the electricity market, ensure the integrity and reliability of the data of load aggregators participating in spot transactions, and ensure the balance of supply and demand in spot transactions. BRIEF DESCRIPTION OF THE DRAWINGS

[0101] In order to make the content of the present invention more clearly understood, the present invention is further described in detail below based on specific embodiments of the present invention in conjunction with the accompanying drawings, wherein:

[0102] Figure 1 This is the Promethus monitoring system architecture diagram provided by the present invention;

[0103] Figure 2 This is a flow chart of a method for completing a low-rank matrix of power consumption of power users in power spot trading provided by the present invention;

[0104] Figure 3 It is the STL data decomposition diagram provided by the present invention;

[0105] Figure 4 It is a flowchart of establishing a low-rank matrix completion model based on a symmetric Toeplitz matrix provided by the present invention;

[0106] Figure 5 This is a diagram showing the effect of completing a single missing data provided by the present invention;

[0107] Figure 6 This is a diagram showing the effect of completing the continuous missing data provided by the present invention;

[0108] Figure 7 This is the evaluation diagram of single random missing and continuous missing data provided by the present invention;

[0109] Figure 8 This is a schematic diagram of a low-rank matrix completion device for power users' power consumption in power spot trading provided by the present invention;

[0110] Description of the accompanying drawings: Figure 7 (a) shows the experimental data of the number of single missing ratios; Figure 7 (b) in the figure shows the experimental data of the ratio of consecutive missing numbers. DETAILED DESCRIPTION

[0111] The present invention will be further described below with reference to the accompanying drawings and specific embodiments so that those skilled in the art can better understand the present invention and implement it. However, the embodiments are not intended to limit the present invention.

[0112] Reference Figure 1 As shown, Figure 1This is the architecture diagram of the Promethus monitoring system provided by the present invention. In electricity spot trading, the Promethus monitoring system plays an important role in storing and extracting electricity user consumption data. Its time series database collects data through two methods: active pull and passive push. It also has a very efficient time series data storage method. Each sampled data only takes up about 3.5 bytes of space, meeting the large data storage needs of spot trading.

[0113] Reference Figure 2 As shown, Figure 2 The following is a flow chart of a method for completing the low-rank matrix of electricity consumption of power users in electricity spot trading. The specific steps are as follows:

[0114] Step 1: In the Promethus time series database, use the Promethus web UI or API to query the stored timestamps and corresponding time series data. Use the PromQL query language combined with the Grafana visualization tool to obtain the time series data of electricity consumption of coal plant users participating in spot trading. Perform STL time series additive decomposition on the time series data of electricity consumption of coal plant users participating in spot trading, decomposing it into smooth trend terms, periodic terms, and residual terms. The decomposition expression is as follows:

[0115] X(t)=S(t)+T(t)+E(t)

[0116] Among them, X(t) represents the time series data of electricity consumption of coal plant users participating in spot trading; S(t) represents the smooth trend term; T(t) represents the period term; R(t) represents the residual term; the decomposed data are as follows Figure 3 shown.

[0117] Step 2: Convert the time series data of electricity consumption of coal plant users participating in spot transactions into a symmetric Toeplitz matrix. The matrix is:

[0118]

[0119] Among them, each row and column reflects the temporal correlation of adjacent elements; t Represents the data at time t;

[0120] The smooth trend term, period term and residual term are Toeplitzized to obtain the data decomposition matrix expression after Toeplitzization.

[0121] T p (X) = T p (S)+T p (T)+T p (E)

[0122] Among them, Tp (X) represents the original data matrix; t p (S) represents the smooth trend matrix, T p (T) represents the periodic term matrix, T p (E) represents the residual matrix;

[0123] Based on the singular value decomposition of the matrix, it is proved that the original data matrix has low rank property; based on the low rank property of the original data matrix, the smooth trend term matrix is ​​decomposed into low rank T p (S), and the corresponding low-rank decomposition matrices U and V are obtained; then the approximation matrix of the difference between the original data matrix and the periodic term matrix is ​​expressed as

[0124] A=UV+T p (E)

[0125] Where A represents the approximation matrix of the difference between the original data matrix and the periodic term matrix; U and V represent low-rank decomposition matrices;

[0126] In step 2, since the user power consumption data in the electricity spot market has time series characteristics, the structural matrix can effectively reflect the correlation between time series data, so that the input data can be converted into a symmetric Toeplitz matrix form to obtain the original data matrix T p (X); where T p Each row and column in (X) reflects the temporal correlation of adjacent elements;

[0127] By clustering the time series data of electricity consumption of coal plant users participating in spot transactions, it can be found that the clustered data has low rank. Then, using the singular value decomposition of the matrix, it can be proved that T p (X)=U∑V T , we can conclude that the original data matrix has low rank. Based on this conclusion, we can perform low rank decomposition on the smooth trend term matrix and then obtain the approximate matrix of the difference between the original data matrix and the period term matrix.

[0128] Step 3: Obtain meteorological data in the Oracle relational database and transform it into a label set Among them, Q m Indicates a tag with tag type m, where M represents the tag type;

[0129] Define the label sequence to represent the impact of meteorological data on the time series data of electricity consumption of coal plant users participating in spot trading, then the label sequence is expressed as

[0130] Y= <y1,y2,...,y T >

[0131] Among them, y t∈Y, t∈[1,T], represents the label at time t; the label sequence corresponds one-to-one to the time series data of electricity consumption of coal plant users participating in spot trading;

[0132] The time series data of electricity consumption of coal plant users participating in spot trading with labels is defined as: LCD =<X,W,Y> ;

[0133] Where, X(t)= <x1,x2,...,x T > represents a time series of length T, x t ∈R represents the data at time t; indicator matrix W={w t}∈{0,1} T , when w t =0 means the power data is lost. t =1 indicates that the power data is complete; Y indicates the tag sequence;

[0134] In step 3, by clustering the electricity consumption data and residual data of coal plant users participating in spot transactions, it is found that the residual data and user electricity consumption data are closely correlated with meteorological data. Therefore, weather labels are added to the data, and label sequences and labeled time series data of electricity consumption of coal plant users participating in spot transactions are defined.

[0135] Step 4: Based on the one-to-one correspondence between the label sequence and the time series data of electricity consumption of coal plant users participating in spot transactions, the label sequence and the residual data also maintain a one-to-one correspondence;

[0136] Based on the above conclusions, the corresponding labels in the residual items are extracted as Q m The data is taken out to form a residual term subsequence corresponding to each label, and the corresponding label is Q m The residual term subsequence of

[0137] The learning vector quantization method is used to map the corresponding label to Q m The residual term subsequence is processed to obtain the representative vector corresponding to the residual term subsequence Given that the data differences of the same user under the same label are small, the sum of the distances between all elements in the residual term subsequence and the corresponding representative vector can be expressed as

[0138]

[0139] The first distance formula is used to express the constraint relationship between each data in all residual item subsequences and their corresponding representative vectors, which can be expressed as

[0140]

[0141] in, Represents the label Q m The sum of the distances between the corresponding residual term subsequence and its corresponding representative vector; e represents the residual term data; e u Represents the label Q m The corresponding subsequence The u-th data in; Q represents the label set; m represents the label type; Q m Indicates the label type m is a label; I∈R T×T is the identity matrix; H∈{0,1} T×M Indicates the position of different labels in the label sequence Y if and only if y t =Q m When H t,m =1;H T represents the transposed matrix of H; C∈R M×M Indicates that only the diagonal elements are non-zero and have a value of C m,m =1 / c m The matrix, c m Represents the label Q m The number of times it appears in the tag sequence; B = I-HCH T ; Since the labels corresponding to the meteorological data will not be lost, the values ​​of the elements in B, H, and C are all fixed values;

[0142] Extract the corresponding labels Q in the residual matrix respectively m The data is taken out to form the residual term matrix submatrix corresponding to each label, then the residual term matrix submatrix corresponding to the label is expressed as;

[0143] The machine learning method is used to process each residual matrix sub-matrix to obtain the representative vector matrix corresponding to each residual matrix sub-moment

[0144] Based on the first distance formula, considering that under the same label, the missing data in each residual matrix submatrix is ​​close to the corresponding vector in its corresponding representative vector matrix, the perturbation term regularization term is designed to represent the constraint relationship between the submatrix and its corresponding representative vector matrix, then the perturbation term regularization term is expressed as

[0145]

[0146] in, represents the square of the matrix F-norm, Indicates that the corresponding label in the residual matrix E is Q m The residual matrix submatrix composed of all the data; express The representative vector matrix obtained by learning vector quantization;

[0147] In step 4, cluster analysis shows that weather conditions and electricity consumption behavior are closely related. That is, at different times, the electricity consumption data of users participating in spot trading indicated by the same tag are similar. In other words, the same external interference influence is similar, that is, the external interference data indicated by the same tag at different times in the tag sequence are similar.

[0148] Since the types of users participating in spot trading are diverse and their electricity consumption behaviors are also different, the data differences of the same user under the same label are small. Therefore, each data in each residual item subsequence will be as close as possible to the representative vector of each residual item subsequence after learning vector quantization. The first distance formula can be used to express the constraint that each data in all residual item subsequences will be as close as possible to its corresponding representative vector.

[0149] According to the above analysis, consider the residual matrix T p (E) The data in the residual matrix is ​​used as the indicator information; the indicator information of the same label at different times in the label sequence is similar, that is, under the same label, the indicator information of the missing value is close to the representative vector data of such indicator information obtained by learning vector quantization, thereby designing the perturbation term regularization term.

[0150] Step 5: Based on the constraint relationship of small fluctuation between adjacent data of the smooth trend item, the second distance formula is used to express It can be expressed as

[0151]

[0152] Among them, s t Represents the smooth trend item data at time t, s t-1 Represents the smooth trend item data at time t-1, s represents the smooth trend item data, t represents the time moment, and T represents the time length; represents the square of the l2 norm, L1 represents the smooth constraint matrix, which is defined as

[0153]

[0154] Among them, all the unmarked ones in the above matrix are 0; R represents the set of real numbers;

[0155] For the smooth trend matrix T p (S), considering that the data values ​​with a time difference of 1 are close, combined with the low-rank decomposition matrices U and V, based on the second distance formula, the smooth trend regularization term is defined, and the smooth trend regularization term is expressed as

[0156]

[0157] Where i, t represent the number of rows and columns of the matrix; T represents the time length; D represents the total number of rows;

[0158] In step 5, based on the time series correlation of the symmetric Toeplitz matrix and the STL decomposition results, it can be found that the data with a time difference of 1 in the smooth trend term of the power data after STL decomposition has small fluctuations. Therefore, a time series smoothness constraint is proposed, and the second distance formula is used to express the constraint conditions between adjacent time data in the smooth trend term.

[0159] According to the above analysis, based on the observation of electricity data in spot trading and the STL time series decomposition results, a time series smoothness constraint is added to the smooth trend term, that is, the data values ​​with a time difference of 1 are close. Combined with the characteristics of the adjacency of row and column data of the Toeplitz matrix, a smooth trend regularization term is designed.

[0160] Step 6: Based on the traditional matrix decomposition framework, combined with the smooth trend regularization term and the disturbance regularization term, establish the objective function:

[0161]

[0162] Among them, λ S ,λ E ,λ O represents the regularization coefficient; i, t represents the number of rows and columns of the matrix; [T p (X) i,t -T p (T) i,t ] represents the original sequence matrix, A i,t Represents the reconstruction sequence matrix, A i,t =U i,: V :,t +E i,t ;([T p (X) i,t -T p (T) i,t ]-A i,t ) 2 is the root mean square error between the original sequence and the reconstructed sequence, indicating the reconstruction error; R S (U, V) represents the smooth trend regularization term; R E (E) represents the disturbance term and regularization term; R O (U, V, E) represents the standard regularization term; W represents the indicator matrix; X represents the time series data of electricity consumption of coal plant users participating in spot trading; Y represents the label sequence;

[0163] Among them, in order to prevent the data from overfitting, the standard regularization term is defined as

[0164]

[0165] in, represents the square of the matrix F-norm.

[0166] Step 7: Use the stochastic gradient descent method to update the objective function and solve the low-rank matrix and the residual matrix. Each updated objective function is expressed as

[0167]

[0168] Among them, U and V represent the low-rank decomposition matrix of the smooth trend term; E represents the residual term matrix; X represents the time series data of electricity consumption of coal plant users participating in spot trading; Y represents the label sequence; W represents the indicator matrix;

[0169] Since the decomposed data are all periodic, the periodic items do not need to be updated;

[0170] By continuously iterating and updating until the preset number of iterations is reached, the target low-rank decomposition matrix is ​​obtained and the target residual matrix Right now

[0171]

[0172]

[0173]

[0174] Among them, error i,t =[T p (X) i,t -T p (T) i,t ]-A i,t ; Indicates that the corresponding label in E is Q m The residual matrix submatrix composed of all the data; express The representative vector matrix obtained by learning vector quantization;

[0175] According to the target low-rank decomposition matrix and the target residual matrix, the target approximation matrix is ​​obtained for

[0176]

[0177] Where i and t represent the number of rows and columns of the matrix.

[0178] Step 8: Obtain the completed data matrix through the periodic term matrix and the target approximation matrix. The completed data matrix is ​​expressed as

[0179]

[0180] Among them, Tp (T) i,t represents the periodic term matrix;

[0181] According to the position of the missing data in the original data matrix, corresponding to the completed data matrix, the position of the corresponding missing data is found in the completed data matrix; according to the data value at the corresponding missing data position found, the mean method is used to solve the missing value of electricity, and its expression is

[0182]

[0183] Where j represents the position of the missing value in the completed symmetric Toeplitz data matrix; N represents the number of positions of the missing value in the completed symmetric Toeplitz data matrix.

[0184] Step 9: Import the modified data into the Promethus time series database through the HTTP API or add remote write configuration in the Promethus configuration file. After completion, use the Promethus Web UI or API query to verify whether the completed electricity consumption data of coal plant users participating in spot trading has been successfully written.

[0185] Refer to Figure 4. Figure 4 The flowchart of establishing a low-rank matrix completion model based on a symmetric Toeplitz matrix provided by the present invention includes the matrix processing part in steps 2 to 8 of the above steps.

[0186] The designed data completion model is verified based on the evaluation model, where the evaluation model expression is:

[0187]

[0188] Reference Figure 5 As shown, Figure 5 This is a diagram showing the effect of completing a single missing data set provided by the present invention, including simulation results of the KNN algorithm, linear interpolation method, and the data completion method provided by the present invention. For specific RRE indicators, please refer to Table 1.

[0189] Table 1 RRE index of missing single sampling point

[0190]

[0191] Reference Figure 6 As shown, Figure 6 This is a diagram showing the effect of completing the continuous missing data provided by the present invention, including the simulation results of the KNN algorithm, the linear interpolation method, and the data completion method provided by the present invention. For specific RRE indicators, please refer to Table 2.

[0192] Table 2 Continuous missing RRE indicators

[0193]

[0194] Reference Figure 7 As shown, Figure 7 This is the evaluation diagram of single random missing and continuous missing data provided by the present invention. Through analysis, for single missing data, when there is only one missing data, the errors of the three algorithms are small, but the method of the present invention has obvious advantages in comparison. As the missing ratio increases, the method of the present invention becomes more significant. Figure 7 As shown in (a) in the figure, for random missing, when there are 5 consecutive missing sampling points, the error of KNN and linear interpolation exceeds 5%, while that of this method is 3.08%, ensuring that the data accuracy is above 95%. Figure 7 As shown in (b);

[0195] In summary, the present invention provides a time series data completion method based on STL and low-rank Toeplitz matrix decomposition. The completion effect is good for both single and continuous missing data, and can improve the data reliability in spot trading.

[0196] Reference Figure 8 As shown, Figure 8 This is a schematic diagram of a low-rank matrix completion device for power users' power consumption in power spot trading provided by the present invention, which specifically includes:

[0197] Data acquisition and decomposition module: Extracts time series data on electricity consumption of coal plants participating in spot trading from the Promethus time series database. Uses STL time series addition to decompose the extracted time series data into smoothed trend terms, periodic terms, and residual terms.

[0198] Data Toeplitzization module: This module converts the electricity consumption time series data of coal plant users participating in spot trading into a symmetric Toeplitz matrix to obtain the original data matrix. The smooth trend term, period term, and residual term are Toeplitzized to obtain the smooth trend term matrix, period term matrix, and residual term matrix. Based on the low rank property of the original data matrix, the smooth trend term matrix is ​​low-rank decomposed to obtain the low-rank decomposition matrix of the smooth trend term matrix, thereby obtaining an approximation matrix of the difference between the original data matrix and the period term matrix.

[0199] Define the label module: In the Oracle relational database, obtain external interference information and transform it into a label set Based on the label set, according to the time series data of electricity consumption of coal plant users participating in spot trading X(t) = <x1,x2,...,x T >Sequence, define label sequence Y= <y1,y2,...,yT >;wherein, the label sequence corresponds to the time series data one by one; set the power consumption data loss indication matrix W={w t}∈{0,1} T , define the labeled time series data of electricity consumption of coal plant users participating in spot trading LCD=<X,W,Y> ;

[0200] Design disturbance term regularization module: extract the corresponding label Q in the residual term respectively m The data is extracted to form a residual term subsequence corresponding to each label; the learning vector quantization method is used to process each residual term subsequence to obtain the representative vector corresponding to each residual term subsequence, and the first distance formula is used to express the constraint relationship between each data in all residual term subsequences and their corresponding representative vectors; the corresponding labels in the residual term matrix are extracted as Q m The data is obtained to form a residual matrix submatrix corresponding to each label; the learning vector quantization method is used to process each residual matrix submatrix to obtain the representative vector matrix corresponding to each residual matrix submatrix; based on the first distance formula, the perturbation term regularization term is designed to represent the constraint relationship between all residual matrix submatrices and their corresponding representative vector matrices;

[0201] Design a smooth trend term module: For the smooth trend term, the second distance formula is used to express the constraint relationship between the smooth trend term data at adjacent moments. Based on the second distance formula, the low-rank decomposition matrix of the smooth trend term matrix is ​​used to design a smooth trend regularization term to express the constraint relationship between the data at adjacent moments in the matrix.

[0202] Constructing the objective function module: Based on the traditional matrix decomposition framework, combined with the smooth trend regularization term and the disturbance regularization term, the objective function is established;

[0203] Objective function solution module: Use stochastic gradient descent to update the objective function and solve the low-rank decomposition matrix and residual matrix; iteratively update until the preset number of iterations is reached to obtain the target low-rank decomposition matrix and target residual matrix, thereby obtaining the target approximation matrix;

[0204] Data completion module: The completed data matrix is ​​obtained by combining the periodic term matrix and the target approximation matrix. The corresponding position of the missing data in the completed data matrix is ​​obtained based on the position of the missing data in the original data matrix. The missing electricity value is solved using the mean method based on the data value at the corresponding position to obtain the completed time series data of electricity consumption of coal plant users participating in spot trading.

[0205] Data import module: puts the completed time series data of electricity consumption of coal plant users participating in spot transactions back into the Promethus time series database;

[0206] The device of this embodiment is used to implement the aforementioned method for completing the low-rank matrix of electricity consumption of electricity users in electricity spot trading. Therefore, the specific implementation method of the device for completing the low-rank matrix of electricity consumption of electricity users in electricity spot trading can be seen in the embodiment part of the method for completing the low-rank matrix of electricity consumption of electricity users in electricity spot trading in the previous text. For example, the data acquisition and decomposition module 100, the data Toeplitzization module 200, the label definition module 300, the disturbance term regularization term design module 400, the smooth trend term design module 500, the objective function construction module 600, the objective function solution module 700, the data completion module 800, and the data import module 900 are respectively used to implement steps 1 to 9 in the above-mentioned method for completing the low-rank matrix of electricity consumption of electricity users in electricity spot trading. Therefore, its specific implementation method can refer to the description of the corresponding embodiments of each part, and will not be repeated here.

[0207] A specific embodiment of the present invention also provides a device for completing a low-rank matrix of electricity consumption of electricity users in electricity spot trading, comprising: a memory for storing a computer program; and a processor for implementing the steps of any one of the methods for completing a low-rank matrix of electricity consumption of electricity users in electricity spot trading when executing the computer program.

[0208] A specific embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for completing the low-rank matrix of electricity consumption of electricity users in any of the above-mentioned electricity spot transactions are implemented.

[0209] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0210] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the steps in the process. Figure 1 a process or multiple processes and / or boxes Figure 1A device that provides the functions specified in a block or multiple blocks.

[0211] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0212] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0213] Obviously, the above embodiments are merely examples for clarity of explanation and are not intended to limit the implementation methods. Those skilled in the art will appreciate that other variations or modifications can be made based on the above description. It is not necessary and impossible to enumerate all implementation methods here. Obvious variations or modifications arising therefrom remain within the scope of protection of the present invention.

Claims

1. A method for completing the low-rank matrix of power consumption of power users in power spot trading, characterized by: include: Extract the electricity consumption time series data of coal plant users participating in spot transactions from the Promethus time series database; The STL time series addition method is used to decompose the extracted electricity consumption time series data of coal plant users participating in spot trading into smooth trend terms, periodic terms and residual terms. The time series data of electricity consumption of coal plant users participating in spot trading is converted into a symmetric Toeplitz matrix to obtain the original data matrix; the smooth trend term, period term and residual term are Toeplitz-ized to obtain the smooth trend term matrix, period term matrix and residual term matrix; Based on the low rank property of the original data matrix, the smooth trend term matrix is ​​decomposed into a low rank to obtain a low rank decomposition matrix of the smooth trend term matrix, thereby obtaining an approximate matrix of the difference between the original data matrix and the period term matrix; In the Oracle relational database, obtain external interference information and transform it into a label set Based on the label set, according to the time series data of electricity consumption of coal plant users participating in spot trading X(t) = <x1,x2,...,x T >Sequence, define label sequence Y= <y1,y2,...,y T >;wherein, the label sequence corresponds to the time series data one by one; set the power consumption data loss indication matrix W={w t }∈{0,1} T , define the labeled time series data of electricity consumption of coal plant users participating in spot trading LCD=<X,W,Y> ; Extract the corresponding labels in the residual items as Q m The data is extracted to form a residual term subsequence corresponding to each label; the learning vector quantization method is used to process each residual term subsequence to obtain the representative vector corresponding to each residual term subsequence, and the first distance formula is used to express the constraint relationship between each data in all residual term subsequences and their corresponding representative vectors; the corresponding labels in the residual term matrix are extracted as Q m The data is obtained to form a residual matrix submatrix corresponding to each label; the learning vector quantization method is used to process each residual matrix submatrix to obtain the representative vector matrix corresponding to each residual matrix submatrix; based on the first distance formula, the perturbation term regularization term is designed to represent the constraint relationship between all residual matrix submatrices and their corresponding representative vector matrices; For the smooth trend term, the second distance formula is used to express the constraint relationship between the smooth trend term data at adjacent moments. Based on the second distance formula, the low-rank decomposition matrix of the smooth trend term matrix is ​​used to design the smooth trend regularization term to express the constraint relationship between the data at adjacent moments in the matrix. Based on the traditional matrix decomposition framework, the objective function is established by combining the smooth trend regularization term and the disturbance regularization term. The stochastic gradient descent method is used to update the objective function and solve the low-rank decomposition matrix and the residual term matrix. The iterative update is performed until the preset number of iterations is reached to obtain the target low-rank decomposition matrix and the target residual term matrix, thereby obtaining the target approximation matrix. The completed data matrix is ​​obtained through the periodic term matrix and the target approximation matrix; the corresponding position of the missing data in the completed data matrix is ​​obtained according to the position of the missing data in the original data matrix; the missing value of electricity is solved by the mean method according to the data value at the corresponding position, and the completed time series data of electricity consumption of coal plant users participating in spot trading is obtained; the completed time series data of electricity consumption of coal plant users participating in spot trading is put back into the Promethus time series database.

2. The method for completing the low-rank matrix of power consumption of power users in power spot trading according to claim 1 is characterized in that: The Promethus time series database was used to extract the time series data of electricity consumption of coal plant users participating in spot trading. The extracted time series data of electricity consumption of coal plant users participating in spot trading was decomposed into a smooth trend term, a period term, and a residual term using STL time series addition. Each term in the decomposition expression was Toeplitz-ized to obtain the original data matrix, the smooth trend term matrix, the period term matrix, and the residual term matrix. Based on the low rank property of the original data matrix, the smooth trend term matrix is ​​decomposed into a low rank, and the low rank decomposition matrix of the smooth trend term matrix is ​​obtained, thereby obtaining the approximate matrix of the difference between the original data matrix and the periodic term matrix, including: In the Promethus time series database, we use the Promethus web UI or API to query the stored timestamps and corresponding time series data, using the PromQL query language combined with the Grafana visualization tool to obtain the time series data of electricity consumption of coal plant users participating in spot trading. We then perform STL time series additive decomposition on this data, decomposing it into a smooth trend term, a periodic term, and a residual term. The decomposition expression is as follows: X(t)=S(t)+T(t)+E(t) Where X(t) represents the time series data of electricity consumption of coal plant users participating in spot transactions; S(t) represents the smooth trend term; T(t) represents the period term; E(t) represents the residual term; The time series data of electricity consumption of coal plant users participating in spot transactions are converted into a symmetric Toeplitz matrix form, then the matrix is Among them, each row and column reflects the temporal correlation of adjacent elements; t Represents the data at time t; The smooth trend term, period term and residual term are Toeplitzized to obtain the data decomposition matrix expression after Toeplitzization. T p (X)=T p (S)+T p (T)+T p (E) Among them, T p (X) represents the original data matrix; T p (S) represents the smooth trend matrix, T p (T) represents the periodic term matrix, T p (E) represents the residual matrix; Based on the singular value decomposition of the matrix, it is proved that the original data matrix has low rank property; based on the low rank property of the original data matrix, the smooth trend term matrix is ​​decomposed into low rank T p (S), and the corresponding low-rank decomposition matrices U and V are obtained; then the approximation matrix of the difference between the original data matrix and the periodic term matrix is ​​expressed as A=UV+T p (E) Where A represents the approximation matrix of the difference between the original data matrix and the periodic term matrix; U and V represent low-rank decomposition matrices.

3. The method for completing the low-rank matrix of power consumption of power users in power spot trading according to claim 1 is characterized in that: In the oracle relational database, external interference information is obtained and transformed into a label set. Based on the label set, according to the time series data of electricity consumption of coal plant users participating in spot trading X(t) = <x1,x2,...,x T >Sequence, define label sequence Y= <y1,y2,...,y T >;wherein, the label sequence corresponds to the time series data one by one; set the power consumption data loss indication matrix W={w t }∈{0,1} T , define the labeled time series data of electricity consumption of coal plant users participating in spot trading LCD=<X,W,Y> include: In the Oracle relational database, obtain meteorological data and transform it into a label set Among them, Q m Indicates a tag with tag type m, where M represents the tag type; Define the label sequence to represent the impact of meteorological data on the time series data of electricity consumption of coal plant users participating in spot trading, then the label sequence is expressed as And= <y1,y2,...,y T > Among them, y t ∈Y, t∈[1,T], represents the label at time t; the label sequence corresponds one-to-one to the time series data of electricity consumption of coal plant users participating in spot trading; The time series data of electricity consumption of coal plant users participating in spot trading with labels is defined as: LCD =<X,W,Y> ; Where, X(t)= <x1,x2,...,x T > represents a time series of length T, x t ∈R represents the data at time t; indicator matrix W={w t }∈{0,1} T , when w t =0 means the power data is lost. t =1 indicates that the power data is complete; Y indicates the tag sequence.

4. The method for completing the low-rank matrix of power consumption of power users in power spot trading according to claim 3 is characterized in that: The corresponding labels in the extracted residual items are Q m The data is taken out to form a residual term subsequence corresponding to each label; The learning vector quantization method is used to process each residual item subsequence to obtain the representative vector corresponding to each residual item subsequence. The first distance formula is used to express the constraint relationship between each data in all residual item subsequences and their corresponding representative vectors; the corresponding labels in the residual item matrix are extracted as Q m The data is taken out to form a residual matrix sub-matrix corresponding to each label; The learning vector quantization method is used to process each residual matrix sub-matrix to obtain the representative vector matrix corresponding to each residual matrix sub-matrix; Based on the first distance formula, the perturbation term regularization term is designed to represent the constraint relationship between all residual term sub-matrices and their corresponding representative vector matrices, including: Based on the one-to-one correspondence between the label sequence and the time series data of electricity consumption of coal plant users participating in spot transactions, the label sequence and the residual item data also maintain a one-to-one correspondence; the corresponding labels in the residual items are extracted as Q m The data is taken out to form a residual term subsequence corresponding to each label, and the corresponding label is Q m The residual term subsequence of The learning vector quantization method is used to map the corresponding label to Q m The residual term subsequence is processed to obtain the representative vector corresponding to the residual term subsequence Given that the data differences of the same user under the same label are small, the sum of the distances between all elements in the residual term subsequence and the corresponding representative vector can be expressed as The first distance formula is used to express the constraint relationship between each data in all residual item subsequences and their corresponding representative vectors, which can be expressed as in, Represents the label Q m The sum of the distances between the corresponding residual term subsequence and its corresponding representative vector; e represents the residual term data; e u Represents the label Q m The corresponding subsequence The u-th data in; Q represents the label set; m represents the label type; Q m Indicates the label type m is a label; I∈R T×T is the identity matrix; H∈{0,1} T×M Indicates the position of different labels in the label sequence Y if and only if y t =Q m When H t,m =1;H T represents the transposed matrix of H; C∈R M×M Indicates that only the diagonal elements are non-zero and have a value of C m,m =1 / c m The matrix, c m Represents the label Q m The number of times it appears in the tag sequence; B = I-HCH T ; Since the labels corresponding to the meteorological data will not be lost, the values ​​of the elements in B, H, and C are all fixed values; Extract the corresponding labels Q in the residual matrix respectively m The data is taken out to form the residual term matrix submatrix corresponding to each label, then the residual term matrix submatrix corresponding to the label is expressed as The machine learning method is used to process each residual matrix sub-matrix to obtain the representative vector matrix corresponding to each residual matrix sub-moment Based on the first distance formula, considering that under the same label, the missing data in each residual matrix submatrix is ​​close to the corresponding vector in its corresponding representative vector matrix, the perturbation term regularization term is designed to represent the constraint relationship between the submatrix and its corresponding representative vector matrix, then the perturbation term regularization term is expressed as in, represents the square of the matrix F-norm, Indicates that the corresponding label in the residual matrix E is Q m The residual matrix submatrix composed of all the data; express The representative vector matrix obtained by learning vector quantization.

5. The method for completing the low-rank matrix of power consumption of power users in power spot trading according to claim 1, characterized in that: For the smooth trend item, the second distance formula is used to express the constraint relationship between the smooth trend item data at adjacent moments; Based on the second distance formula, the low-rank decomposition matrix of the smooth trend term matrix is ​​used to design the smooth trend regularization term to express the constraint relationship between the data at adjacent moments in the matrix, including: Based on the constraint relationship of small fluctuation between adjacent data of smooth trend items, the second distance formula is used to express It can be expressed as Among them, s t Represents the smooth trend item data at time t, s t-1 Represents the smooth trend item data at time t-1, s represents the smooth trend item data, t represents the time moment, and T represents the time length; represents the square of the l2 norm, L1 represents the smooth constraint matrix, which is defined as Among them, all the unmarked ones in the above matrix are 0; R represents the set of real numbers; For the smooth trend matrix T p (S), considering that the data values ​​with a time difference of 1 are close, combined with the low-rank decomposition matrices U and V, based on the second distance formula, the smooth trend regularization term is defined, and the smooth trend regularization term is expressed as Where i, t represent the number of rows and columns of the matrix; T represents the time length; and D represents the total number of rows.

6. The method for completing the low-rank matrix of power consumption of power users in power spot trading according to claim 1, characterized in that: Based on the traditional matrix decomposition framework, the objective function is established by combining the smooth trend regularization term and the disturbance term regularization term; the stochastic gradient descent method is used to update the objective function and solve the low-rank decomposition matrix and the residual term matrix; Iterate and update until the preset number of iterations is reached to obtain the target low-rank decomposition matrix and the target residual matrix, thereby obtaining the target approximation matrix including: Based on the traditional matrix decomposition framework, combined with the smooth trend regularization term and the disturbance regularization term, the objective function is established: Among them, λ S ,λ E ,λ O represents the regularization coefficient; i, t represents the number of rows and columns of the matrix; [T p (X) i,t -T p (T) i,t ] represents the original sequence matrix, A i,t Represents the reconstruction sequence matrix, A i,t =U i,: V :,t +E i,t ;([T p (X) i,t -T p (T) i,t ]-A i,t ) 2 is the root mean square error between the original sequence and the reconstructed sequence, indicating the reconstruction error; R S (U, V) represents the smooth trend regularization term; R E (E) represents the disturbance term and regularization term; R O (U, V, E) represents the standard regularization term; W represents the indicator matrix; X represents the time series data of electricity consumption of coal plant users participating in spot trading; Y represents the label sequence; Among them, in order to prevent the data from overfitting, the standard regularization term is defined as in, represents the square of the matrix F-norm; The stochastic gradient descent method is used to update the objective function and solve the low-rank matrix and the residual matrix. Each updated objective function is expressed as Among them, U and V represent the low-rank decomposition matrix of the smooth trend term; E represents the residual term matrix; X represents the time series data of electricity consumption of coal plant users participating in spot trading; Y represents the label sequence; W represents the indicator matrix; Since the decomposed data are all periodic, the periodic items do not need to be updated; By continuously iterating and updating until the preset number of iterations is reached, the target low-rank decomposition matrix and the target residual matrix are obtained, which can be expressed as Among them, error i,t =[T p (X) i,t -T p (T) i,t ]-A i,t ; Indicates that the corresponding label in E is Q m The residual matrix submatrix composed of all the data; express The representative vector matrix obtained by learning vector quantization; According to the target low-rank decomposition matrix and the target residual matrix, the target approximation matrix is ​​obtained for Where i and t represent the number of rows and columns of the matrix.

7. The method for completing the low-rank matrix of power consumption of power users in power spot trading according to claim 6, characterized in that: The method comprises the following steps: obtaining a completed data matrix through the periodic term matrix and the target approximation matrix; obtaining corresponding positions of the missing data in the completed data matrix according to the positions of the missing data in the original data matrix; and solving the missing values ​​of electricity using the mean method according to the data values ​​at the corresponding positions to obtain the completed time series data of electricity consumption of coal plant users participating in spot trading; Putting the completed electricity consumption time series data of coal plant users participating in spot transactions back into the Promethus time series database includes: Through the periodic term matrix and the target approximation matrix, the completed data matrix is ​​obtained, and the completed data matrix is ​​expressed as Among them, T p (T) i,t represents the periodic term matrix; According to the position of the missing data in the original data matrix, corresponding to the completed data matrix, the position of the corresponding missing data is found in the completed data matrix, and the mean method is used to solve the missing value of electricity. Its expression is: Where j represents the position of the missing value in the completed symmetric Toeplitz data matrix; N represents the number of positions corresponding to the missing value in the completed symmetric Toeplitz data matrix; Import the modified data into the Promethus time series database through the HTTP API or add remote write configuration to the Promethus configuration file. After completion, use the Promethus Web UI or API query to verify whether the completed electricity consumption data of coal plant users participating in spot trading has been successfully written.

8. A device for completing the low-rank matrix of electricity consumption of power users in electricity spot trading, characterized in that: include: Data acquisition and decomposition module: Extracts time series data on electricity consumption of coal plant users participating in spot transactions from the Promethus time series database; The STL time series addition method is used to decompose the extracted electricity consumption time series data of coal plant users participating in spot trading into smooth trend terms, periodic terms and residual terms. Data Toeplitzization module: This module converts the electricity consumption time series data of coal plant users participating in spot trading into a symmetric Toeplitz matrix to obtain the original data matrix; it Toeplitz-izes the smooth trend term, period term, and residual term to obtain the smooth trend term matrix, period term matrix, and residual term matrix; Based on the low rank property of the original data matrix, the smooth trend term matrix is ​​decomposed into a low rank to obtain a low rank decomposition matrix of the smooth trend term matrix, thereby obtaining an approximate matrix of the difference between the original data matrix and the period term matrix; Define the label module: In the Oracle relational database, obtain external interference information and transform it into a label set Based on the label set, according to the time series data of electricity consumption of users participating in spot trading X(t) <x1,x2,...,x T >Sequence, define label sequence Y= <y1,y2,...,y T >;wherein, the label sequence corresponds to the time series data one by one; set the power consumption data loss indication matrix W={w t }∈{0,1} T , define the labeled time series data LCD of electricity consumption of users participating in spot trading<X,W,Y> ; Design disturbance term regularization module: extract the corresponding label Q in the residual term respectively m The data is extracted to form a residual term subsequence corresponding to each label; the learning vector quantization method is used to process each residual term subsequence to obtain the representative vector corresponding to each residual term subsequence, and the first distance formula is used to express the constraint relationship between each data in all residual term subsequences and their corresponding representative vectors; the corresponding labels in the residual term matrix are extracted as Q m The data is obtained to form a residual matrix submatrix corresponding to each label; the learning vector quantization method is used to process each residual matrix submatrix to obtain the representative vector matrix corresponding to each residual matrix submatrix; based on the first distance formula, the perturbation term regularization term is designed to represent the constraint relationship between all residual matrix submatrices and their corresponding representative vector matrices; Design a smooth trend term module: For the smooth trend term, the second distance formula is used to express the constraint relationship between the smooth trend term data at adjacent moments. Based on the second distance formula, the low-rank decomposition matrix of the smooth trend term matrix is ​​used to design a smooth trend regularization term to express the constraint relationship between the data at adjacent moments in the matrix. Constructing the objective function module: Based on the traditional matrix decomposition framework, combined with the smooth trend regularization term and the disturbance regularization term, the objective function is established; Objective function solution module: Use stochastic gradient descent to update the objective function and solve the low-rank decomposition matrix and residual matrix; iteratively update until the preset number of iterations is reached to obtain the target low-rank decomposition matrix and target residual matrix, thereby obtaining the target approximation matrix; Data completion module: The completed data matrix is ​​obtained by combining the periodic term matrix and the target approximation matrix. The corresponding position of the missing data in the completed data matrix is ​​obtained based on the position of the missing data in the original data matrix. The missing electricity value is solved using the mean method based on the data value at the corresponding position to obtain the completed time series data of electricity consumption of coal plant users participating in spot trading. Data import module: puts the completed time series data of electricity consumption of coal plant users participating in spot transactions back into the Promethus time series database.

9. A device for completing the low-rank matrix of electricity consumption of electricity users in electricity spot trading, characterized in that: include: memory for storing computer programs; A processor, configured to implement the steps of a method for completing a low-rank matrix of electricity consumption of electricity users in electricity spot trading as described in any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of a method for completing a low-rank matrix of electricity consumption of electricity users in electricity spot trading as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Completion method of road network traffic data based on adaptive space-time constraint low-order algorithm

    CN108010320A

  • Meteorological radar wind power plant clutter suppression method based on low-rank matrix completion

    CN112882034A