Transaction electricity price and electricity demand prediction method and system for virtual power plant transaction model
By cleaning and pre-processing the power grid data in the virtual power plant trading model, combining Apriori association rules and frequent item set calculations, accurate prediction of transaction electricity prices and electricity demand is achieved, solving the problem of lack of accuracy in the traditional model, and meeting the efficient operation needs of virtual power plants under diversified trading mode.
Patent Information
- Application Number
- CN202510240187.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-03
- Publication Date
- 2025-03-28
AI Technical Summary
The current traditional trading model of virtual power plants based on manual determination of electricity prices and electricity demands lacks accuracy and cannot meet the application needs of virtual power plants in decentralized markets and diversified trading models.
A trading electricity price and electricity demand prediction method is adopted, and data cleaning and preprocessing is carried out by obtaining power grid data, using Apriori association rules and frequent item set calculations, and transition item sets with interest greater than 1 layer by layer, and finally the prediction results of transaction electricity price and electricity demand are obtained.
It improves the accuracy of forecasting transaction electricity prices and electricity demand, and meets the efficient operation needs of virtual power plants under diversified trading mode.
Smart Images

Figure CN119722138A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of virtual power plants, and in particular to a method and system for predicting transaction electricity prices and electricity demand for a virtual power plant transaction model. Background Art
[0002] Since the power operation model of virtual power plants was only proposed in recent years, the power trading models and tools are relatively simple and scarce. Currently, virtual power plants sell electricity through contract trading and spot trading. Currently, both contract trading and spot trading use traditional trading models and tools. For example, buyers and sellers manually confirm the current electricity price and electricity demand in real time, and then complete the power purchase and sales process through a business contract.
[0003] The current traditional electricity trading model of virtual power plants, which is based on manually determining current electricity prices and electricity demand, is simple and fast, but lacks accuracy and efficiency. For example, in contract transactions, the accuracy of future electricity price forecasts and electricity demand forecasts will affect the performance of trading contracts. In spot transactions, real-time electricity price fluctuations will affect the consensus of the two parties on the trading contract. Therefore, the traditional electricity trading model cannot meet the application requirements in the virtual power plant business, which has the characteristics of decentralized market participants and diversified trading objects and business models. Summary of the invention
[0004] In view of the shortcomings of the prior art, the present invention provides a method and system for predicting trading electricity prices and electricity demand for a virtual power plant trading model, which solves the problem that the traditional electricity trading model of the current virtual power plant based on manual determination of the current electricity price and electricity demand is simple and fast, but lacks accuracy.
[0005] To achieve the above object, the present invention provides the following technical solutions: A method for predicting transaction electricity price and electricity demand for a virtual power plant transaction model, the prediction method comprising the following steps: S1. Obtaining power grid data including at least one of transaction electricity price and electricity demand data; S2. Classify the power grid data by day, and divide it into peak, sharp, flat and valley attributes to eliminate the power grid data of the day with incomplete attributes, and perform linear test on the power grid data at any time to complete data cleaning and generate preprocessed data; S3, associate the daily preprocessed data according to the Apriori association rule and obtain several item sets; S4, calculate the support and confidence of each item set, and select several item sets as frequent item sets according to the support and confidence; S5, mark the frequent itemsets as transition itemsets, calculate the interest of any transition itemset relative to other transition itemsets, and obtain several transition itemsets with interest greater than 1 by layer-by-layer calculation, until the number of transition itemsets obtained is 1, and mark it as the final itemset; S6. Output the final item set as the prediction result of the transaction electricity price and electricity demand data corresponding to the power grid data.
[0006] Preferably, in step S2, the following steps are specifically included: S21, classifying the power grid data by day; S22, set the four attribute values of peak, sharp, flat and valley; S23, classifying the power grid data at any time of the day into four attribute values: peak, sharp, flat and valley; S24, determining whether the four attribute values of peak, sharp, flat and valley all contain power grid data in any day; If yes, save the grid data; If not, all power grid data for that day will be eliminated; S25. Perform a linear test on the power grid data at any time to complete data cleaning and generate preprocessed data.
[0007] Preferably, in step S25, the following steps are specifically included: S251, filtering out the data missing moments when the power grid data is missing; S252, respectively obtaining the power grid data at the closest time before and after the time when the data is missing; S253, establishing a first straight line equation according to the power grid data at the closest time before and after the data missing time; the expression of the first straight line equation is: ; In the above formula, represents the dependent variable, representing the power grid data, represents the independent variable, which is the time corresponding to the power grid data, and They represent the power grid data closest to the time before and after the data missing time, and They represent the two moments before and after the missing data moment when the power grid data exists and are closest to it. is the basic coefficient; S254, substituting the data missing time between the two time points used to establish the linear equation into the first linear equation to obtain the power grid data at the corresponding time point; S255, sequentially establishing a second straight line equation with the power grid data at adjacent moments before and after the power grid data at any moment, and correcting the power grid data at that moment according to the second straight line equation to obtain preprocessed data.
[0008] Preferably, in step S255, the following steps are specifically included: S2551, sequentially establishing a second straight line equation using the power grid data at adjacent moments before and after the power grid data at any moment; S2552, calculating the virtual power grid data at this moment according to the second straight line equation; S2553, calculating the deviation ratio of the difference between the virtual power grid data and the power grid data at this moment relative to the virtual power grid data; the calculation formula of the deviation ratio is: ; In the above formula, represents the deviation ratio, represents the power grid data at the i-th moment, represents the virtual power grid data at the i-th moment; S2554, setting a deviation ratio threshold, and determining in sequence whether the deviation ratio at any moment is greater than the deviation ratio threshold; If yes, the virtual power grid data at the moment when the deviation ratio is greater than the deviation ratio threshold is used as the power grid data; If not, proceed to the next step; S2555. Mark the power grid data as pre-processed data.
[0009] Preferably, in step S5, the following steps are specifically included: S51, mark the frequent itemsets as transition itemsets; S52, calculating the interest of any transition item set relative to other transition item sets; the calculation formula of the interest is: ; In the above formula, Indicates the interest of item set A in item set B, represents the probability of item set A and item set B appearing at the same time, and Respectively represent the probability of item set A and item set B appearing; S53, determining whether the number of the obtained transition item sets is 1; If yes, mark the current transition item set as the final item set; If not, the current transition item set is marked as a frequent item set, and then the process returns to step S51.
[0010] Preferably, in step S4, the support degree is calculated as follows: ; In the above formula, represents the support of the Xth item set to the Yth item set, Indicates the number of changes from the Xth item set to the Yth item set, Represents the total number of changes in all item sets; The confidence calculation formula is: ; In the above formula, Represents confidence, that is, the probability of item set X appearing after item set Y appears. represents the probability of item set Y appearing, It represents the probability that item set X and item set Y appear at the same time.
[0011] The technical solution also provides a system for implementing a method for predicting trading electricity prices and electricity demand for a virtual power plant trading model. The system includes: a processor and a memory, wherein the memory is used to store a computer program, and when the computer program is executed by the processor, the method for predicting trading electricity prices and electricity demand for a virtual power plant trading model is implemented.
[0012] Compared with the prior art, the present invention provides a method and system for predicting transaction electricity price and electricity demand for a virtual power plant transaction model, which has the following beneficial effects: 1. In order to ensure the accuracy of the acquired power grid data, the present invention first eliminates the power grid data of abnormal days through peak, sharp, flat and valley attributes, then interpolates and supplements the missing power grid data through linear test, corrects the abnormal power grid data, and then associates them through the Apriori algorithm on a daily basis, then calculates frequent item sets, and screens them layer by layer through interest to select the final item sets, thereby obtaining the prediction results of the transaction electricity price and electricity demand data corresponding to the power grid data.
[0013] 2. The present invention establishes a first straight line equation and a second straight line equation based on different data, so as to interpolate and supplement the missing power grid data, and calculates the virtual power grid data at any time through the second straight line equation, and compares the virtual power grid data with the power grid data, so as to determine whether the power grid data is abnormal, and replace the abnormal power grid data.
[0014] 3. The present invention uses the Apriori algorithm to associate daily power grid data and perform data mining on a daily basis, mining the changing patterns of power grid data, and through frequent item sets and transition item sets, it is possible to predict the power grid data at any time in the future. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings: Figure 1 The present invention is a flow chart of the method for predicting transaction electricity price and electricity demand in a virtual power plant transaction model. DETAILED DESCRIPTION
[0016] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific implementation methods, so that the implementation process of how the present application uses technical means to solve technical problems and achieve technical effects can be fully understood and implemented accordingly.
[0017] Those skilled in the art can understand that all or part of the steps in the following embodiments can be completed by instructing the relevant hardware through a program, so the present application can be in the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application can be in the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0018] With the increase in social electricity demand and the emergence of problems such as unbalanced electricity demand, virtual power plants, as a new form of energy management, are not physical power plants. Through advanced software and information and communication technology, they integrate and optimize the management of dispersed power generation resources, such as wind power, solar power generation, and energy storage systems. They form a system platform, use modern communication technology to connect various distributed energy resources, form a unified energy management network, realize efficient scheduling and optimal allocation of energy, achieve efficient use of energy and balance supply and demand, and meet the growing energy and environmental protection needs.
[0019] Diversified electricity trading models are the core foundation of virtual power plants. Their core trading models mainly include electricity market transactions, ancillary service transactions, and balancing market transactions. Compared with traditional power plant trading models, virtual power plant trading models have the characteristics of decentralized market participants, flexible trading strategies and response mechanisms, refined and intelligent operation requirements, and diversified trading objects and business models.
[0020] In order to solve the problem that the traditional power trading model of the current virtual power plant based on manual determination of the current electricity price and electricity demand is simple and fast, but lacks accuracy, the present invention provides a method for predicting the transaction electricity price and electricity demand for the virtual power plant trading model. Through this patent, the goal of predicting and analyzing the transaction electricity price and electricity demand can be achieved. Through accurate analysis of electricity demand and electricity price, the virtual power plant can effectively occupy an industry advantage in market transactions and commercial operations. The prediction method includes the following steps: S1. Obtain power grid data including at least one of transaction electricity price and electricity demand data; obtain historical and real-time data of electricity price and electricity consumption from the cloud database of China Southern Power Grid and State Grid through the data channel of Kafka data subscription mode. These are all original power grid data; S2. Classify the power grid data by day, and divide it according to the peak, sharp, flat and valley attributes to eliminate the power grid data of the day with incomplete attributes, and perform linear tests on the power grid data at any time to complete data cleaning and generate pre-processed data; the peak, sharp, flat and sharp electricity prices are closely related to the time period in a day. In the electricity billing system, the electricity price levels in different time periods reflect the changing law of electricity demand. The peak period usually refers to the period of the day when the electricity demand is the highest, and the electricity price is relatively high. The peak period is the second peak of electricity demand. The electricity price is slightly lower than the peak period but higher than the normal period and valley period. The electricity demand in the normal period is relatively stable and the electricity price is moderate. The valley period is the period when the electricity demand is the lowest and the electricity price is the lowest. This electricity price time-sharing system aims to guide users to reasonably adjust their electricity consumption behavior through price levers, balance the power grid load, and improve the utilization efficiency of power resources. Therefore, the changes in power grid data in a day should include four attribute intervals of peak, sharp, flat and valley. Therefore, the screening of power grid data can be achieved based on this. In step S2, the following steps are specifically included: S21, classifying the power grid data by day; S22, set the four attribute values of peak, sharp, flat and valley; S23, classifying the power grid data at any time of the day into four attribute values: peak, sharp, flat and valley; that is, the power grid data at any time of the day corresponds to one of the four time periods: peak, sharp, flat and valley; S24, determining whether the four attribute values of peak, sharp, flat and valley all contain power grid data in any day; If yes, save the grid data; If not, all power grid data for that day will be eliminated; S25, perform linearity check on the power grid data at any time to complete data cleaning and generate preprocessed data; when performing linearity check on the power grid data, it is necessary to interpolate the missing data and check the correctness of the existing data. Therefore, in step S25, the following steps are specifically included: S251, filtering out the data missing moments when the power grid data is missing; S252, respectively obtaining the power grid data at the closest time before and after the time when the data is missing; S253, establishing a first straight line equation according to the power grid data at the closest time before and after the data missing time; the expression of the first straight line equation is: ; In the above formula, represents the dependent variable, representing the power grid data, represents the independent variable, which is the time corresponding to the power grid data, and They represent the power grid data closest to the time before and after the data missing time, and They represent the two moments before and after the missing data moment when the power grid data exists and are closest to it. is the basic coefficient; S254, substituting the data missing time between the two time points used to establish the linear equation into the first linear equation to obtain the power grid data at the corresponding time point; S255, sequentially establish a second straight line equation with the power grid data at adjacent moments before and after the power grid data at any moment, and correct the power grid data at the moment according to the second straight line equation to obtain preprocessed data; the second straight line equation is established in the same manner as the first straight line equation. In order to further clarify the method for correcting the power grid data according to the second straight line equation, step S255 specifically includes the following steps: S2551, sequentially establishing a second straight line equation using the power grid data at adjacent moments before and after the power grid data at any moment; S2552, calculating the virtual power grid data at this moment according to the second straight line equation; S2553, calculating the deviation ratio of the difference between the virtual power grid data and the power grid data at this moment relative to the virtual power grid data; the calculation formula of the deviation ratio is: ; In the above formula, represents the deviation ratio, represents the power grid data at the i-th moment, represents the virtual power grid data at the i-th moment; S2554, setting a deviation ratio threshold, and determining in turn whether the deviation ratio at any time is greater than the deviation ratio threshold; the deviation ratio threshold is generally in the range of 10% to 15%; If yes, the virtual power grid data at the moment when the deviation ratio is greater than the deviation ratio threshold is used as the power grid data; If not, proceed to the next step; S2555. Mark the power grid data as pre-processed data.
[0021] S3, associate the daily pre-processed data according to the Apriori association rule and obtain several item sets; each item set is the power grid data of one day; S4. Calculate the support and confidence of each item set, and select several item sets as frequent item sets according to the support and confidence. The calculation formula of support is: ; In the above formula, represents the support of the Xth item set to the Yth item set, Indicates the number of changes from the Xth item set to the Yth item set, Represents the total number of changes in all item sets; The confidence calculation formula is: ; In the above formula, Represents confidence, that is, the probability of item set X appearing after item set Y appears. represents the probability of item set Y appearing, Indicates the probability of item set X and item set Y appearing at the same time; one method to obtain frequent item sets is to set the minimum support and confidence, so that the item sets with support and confidence greater than the minimum support and confidence are set as frequent item sets, and the other is to directly select several item sets with the largest support and confidence as frequent item sets through direct screening.
[0022] S5, marking the frequent itemsets as transition itemsets, and calculating the interest of any transition itemset relative to other transition itemsets, and obtaining several transition itemsets with interest greater than 1 by layer-by-layer calculation, until the number of obtained transition itemsets is 1, and marking it as the final itemset; in order to further describe in detail the method of obtaining the final itemset by layer-by-layer calculation, in step S5, the following steps are specifically included: S51, mark the frequent itemsets as transition itemsets; S52, calculating the interest of any transition item set relative to other transition item sets; the calculation formula of the interest is: ; In the above formula, Indicates the interest of item set A in item set B, represents the probability of item set A and item set B appearing at the same time, and Respectively represent the probability of item set A and item set B appearing; S53, determining whether the number of the obtained transition item sets is 1; If yes, mark the current transition item set as the final item set; If not, the current transition item set is marked as a frequent item set, and then the process returns to step S51.
[0023] S6. Output the final item set as the prediction result of the transaction electricity price and electricity demand data corresponding to the power grid data.
[0024] When the present invention is implemented, power grid data including historical data and real-time data of electricity price and electricity consumption are first obtained from the cloud database of Southern Power Grid and State Grid through the data channel of Kafka data subscription mode. Then, in order to ensure the accuracy of power grid data, the power grid data of abnormal days are first eliminated through peak, sharp, flat and valley attributes, and then the missing power grid data are interpolated and supplemented through linear test, and the abnormal power grid data are corrected. Then, the Apriori algorithm is used to associate them on a daily basis, and then the frequent item sets are calculated and screened layer by layer through the interest level to select the final item set, thereby obtaining the prediction results of the transaction electricity price and electricity demand data corresponding to the power grid data.
[0025] Corresponding to the trading electricity price and electricity demand forecasting method for the virtual power plant trading model provided in the above-mentioned embodiment, the present embodiment also provides a system for implementing the trading electricity price and electricity demand forecasting method for the virtual power plant trading model. Since the trading electricity price and electricity demand forecasting system for the virtual power plant trading model provided in the present embodiment corresponds to the trading electricity price and electricity demand forecasting method for the virtual power plant trading model provided in the above-mentioned embodiment, the implementation method of the aforementioned trading electricity price and electricity demand forecasting method for the virtual power plant trading model is also applicable to the trading electricity price and electricity demand forecasting system for the virtual power plant trading model provided in the present embodiment, and will not be described in detail in the present embodiment.
[0026] The system includes a processor and a memory, wherein the memory is used to store a computer program, and when the computer program is executed by the processor, a transaction electricity price and electricity demand forecasting method for a virtual power plant transaction model is implemented.
[0027] The above implementation methods have been described in detail. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A method for predicting transaction electricity price and electricity demand for a virtual power plant transaction model, characterized in that: The prediction method includes the following steps: S1. Obtaining power grid data including at least one of transaction electricity price and electricity demand data; S2. Classify the power grid data by day, and divide it into peak, sharp, flat and valley attributes to eliminate the power grid data of the day with incomplete attributes, and perform linear test on the power grid data at any time to complete data cleaning and generate preprocessed data; S3, associate the daily preprocessed data according to the Apriori association rule and obtain several item sets; S4, calculate the support and confidence of each item set, and select several item sets as frequent item sets according to the support and confidence; S5, mark the frequent itemsets as transition itemsets, calculate the interest of any transition itemset relative to other transition itemsets, and obtain several transition itemsets with interest greater than 1 by layer-by-layer calculation, until the number of transition itemsets obtained is 1, and mark it as the final itemset; S6. Output the final item set as the prediction result of the transaction electricity price and electricity demand data corresponding to the power grid data.
2. The prediction method according to claim 1, characterized in that: In step S2, the following steps are specifically included: S21, classifying the power grid data by day; S22, set the four attribute values of peak, sharp, flat and valley; S23, classifying the power grid data at any time of the day into four attribute values: peak, sharp, flat and valley; S24, determining whether the four attribute values of peak, sharp, flat and valley all contain power grid data in any day; If yes, save the grid data; If not, all power grid data for that day will be eliminated; S25. Perform a linear test on the power grid data at any time to complete data cleaning and generate preprocessed data.
3. The prediction method according to claim 2, characterized in that: In step S25, the following steps are specifically included: S251, filtering out the data missing moments when the power grid data is missing; S252, respectively obtaining the power grid data at the closest time before and after the time when the data is missing; S253, establishing a first straight line equation according to the power grid data at the closest time before and after the data missing time; the expression of the first straight line equation is: ; In the above formula, represents the dependent variable, representing the power grid data, represents the independent variable, which is the time corresponding to the power grid data, and They represent the power grid data closest to the time before and after the data missing time, and They represent the two moments before and after the missing data moment when the power grid data exists and are closest to it. is the basic coefficient; S254, substituting the data missing time between the two time points used to establish the linear equation into the first linear equation to obtain the power grid data at the corresponding time point; S255, sequentially establishing a second straight line equation with the power grid data at adjacent moments before and after the power grid data at any moment, and correcting the power grid data at that moment according to the second straight line equation to obtain preprocessed data.
4. The prediction method according to claim 3, characterized in that: In step S255, the following steps are specifically included: S2551, sequentially establishing a second straight line equation using the power grid data at adjacent moments before and after the power grid data at any moment; S2552, calculating the virtual power grid data at this moment according to the second straight line equation; S2553, calculating the deviation ratio of the difference between the virtual power grid data and the power grid data at this moment relative to the virtual power grid data; the calculation formula of the deviation ratio is: ; In the above formula, represents the deviation ratio, represents the power grid data at the i-th moment, represents the virtual power grid data at the i-th moment; S2554, setting a deviation ratio threshold, and determining in sequence whether the deviation ratio at any moment is greater than the deviation ratio threshold; If yes, the virtual power grid data at the moment when the deviation ratio is greater than the deviation ratio threshold is used as the power grid data; If not, proceed to the next step; S2555. Mark the power grid data as pre-processed data.
5. The prediction method according to claim 1, characterized in that: In step S5, the following steps are specifically included: S51, mark the frequent itemsets as transition itemsets; S52, calculating the interest of any transition item set relative to other transition item sets; the calculation formula of the interest is: ; In the above formula, Indicates the interest of item set A in item set B, represents the probability of item set A and item set B appearing at the same time, and Respectively represent the probability of item set A and item set B appearing; S53, determining whether the number of the obtained transition item sets is 1; If yes, mark the current transition item set as the final item set; If not, the current transition item set is marked as a frequent item set, and then the process returns to step S51.
6. The prediction method according to claim 1, characterized in that: In step S4, the support degree is calculated as: ; In the above formula, represents the support of the Xth item set to the Yth item set, Indicates the number of changes from the Xth item set to the Yth item set, Represents the total number of changes in all item sets; The confidence calculation formula is: ; In the above formula, Represents confidence, that is, the probability of item set X appearing after item set Y appears. represents the probability of item set Y appearing, It represents the probability that item set X and item set Y appear at the same time.
7. A prediction system for implementing the prediction method according to any one of claims 1 to 6, characterized in that: It includes a processor and a memory, the memory is used to store a computer program, and when the computer program is executed by the processor, it implements the transaction electricity price and electricity demand forecasting method for a virtual power plant transaction model as described in any one of claims 1-6.
Citation Information
Patent Citations
Power grid data mining method based on improved Apriori algorithm
CN114547138A
Resource allocation method and system based on virtual power plant
CN119298041A
Device for generating optimal scheduling model about virtual power plant, and method of generating optimal management model using the same
KR1020150029120A