Peer-to-peer electricity trading method and system based on supply and demand forecasting in blockchain environment

By building a photovoltaic power prediction model and a blockchain credit management mechanism, the problem of low supply and demand matching in the blockchain power trading system is solved, accurate prediction and stable transactions on both the supply and demand sides are achieved, and the economic and reliability of the system is improved.

CN115907984BActive Publication Date: 2025-09-02HEFEI UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211418863.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-14
Publication Date
2025-09-02
Estimated Expiration
2042-11-14

AI Technical Summary

Technical Problem

In the existing blockchain-based power trading system, supply and demand matching is low, system reliability is low, and uncertainty on both supply and demand leads to unstable transaction processes.

Method used

By building a photovoltaic power prediction model, combining meteorological data and historical data, supply and demand prediction is performed using the Attention-MPA-LSTM model and the improved RBF neural network model, supply and demand matching principles are formulated to form a transaction contract that maximizes both supply and demand returns.

Benefits of technology

It realizes accurate predictions on both sides of supply and demand, reduces uncertainty, improves the effectiveness of supply and demand matching, enhances the economy, stability and reliability of the energy system, and ensures the stability and credibility of transactions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115907984B_ABST
    Figure CN115907984B_ABST
Patent Text Reader

Abstract

This invention provides a peer-to-peer electricity trading method and system based on supply and demand forecasting in a blockchain environment, relating to the technical field of blockchain-based electricity trading. By combining the selection of similar historical days with supply and demand forecasting, the embodiments of the invention reduce the impact of meteorological factors, day type factors, and other factors on forecast accuracy. Using more accurate forecasting methods, they achieve precise forecasts of both supply and demand, reduce uncertainty in supply and demand forecasts, promote dynamic balance between supply and demand, improve the effectiveness of supply and demand matching, and enhance the economic efficiency, stability, and reliability of energy systems.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of blockchain-based power trading technology, and specifically to a peer-to-peer power trading method and system based on supply and demand forecasting in a blockchain environment. Background Art

[0002] With the increasing demand for renewable energy power driven by socioeconomic development, a variety of electricity trading models have emerged, promoting the optimization of the power energy structure. Among them, peer-to-peer (P2P) electricity trading is a trading model that allows supply and demand parties to directly meet and transact on an interconnected platform, without the intervention of a middleman. Through P2P trading, both parties can actively participate in the local energy market by purchasing needed electricity and selling surplus electricity, while also increasing revenue and bringing greater market flexibility. However, in P2P trading, due to the lack of a transparent, tamper-proof method for storing and verifying transaction information, mutual trust between the two parties is difficult without relying on a trusted third party. Furthermore, the surge in the number of trading entities in the power market has significantly increased the complexity of its management and operation, raising significant issues of information trust and security, as well as transparency, during transactions. To further improve power trading mechanisms, blockchain technology has been widely applied in this area.

[0003] During blockchain-based peer-to-peer electricity trading, uncertainty and imbalances between supply and demand can impact the security and stability of the entire transaction process. Therefore, a dynamic balance between power output and power consumption is essential. On the supply side, photovoltaics, as a new clean energy source, are characterized by randomness, volatility, and intermittency, resulting in significant uncertainty. This uncertainty inevitably impacts the stable operation of the trading system. Accurate photovoltaic power generation forecasts provide the best possible understanding of supply-side output, enabling better matching of supply and demand and peer-to-peer transactions. Similarly, on the demand side, electricity load fluctuates constantly with seasonal and climatic factors, creating uncertainty. Obviously, the photovoltaic power generation on the supply side and the electricity load on the demand side often have certain inconsistencies and mismatches in time and space. The uncertainty on both the supply and demand sides will bring certain difficulties to point-to-point electricity transactions. Therefore, solving the uncertainty problem on both the supply and demand sides, making accurate predictions on the supply and demand sides and matching the supply and demand sides based on this is an important foundation for subsequent point-to-point transactions. It can reduce the uncertainty of supply and demand predictions, promote the dynamic balance of supply and demand, improve the effectiveness of supply and demand matching, and enhance the economy, stability and reliability of the energy system.

[0004] However, in the existing blockchain-based electricity trading process, the uncertainty on both the supply and demand sides leads to low effectiveness of supply and demand matching and low stability and reliability of the energy system. That is, the existing blockchain-based electricity trading system has low effectiveness of supply and demand matching and low system reliability. Summary of the Invention

[0005] (1) Technical problems solved

[0006] In response to the shortcomings of the existing technology, the present invention provides a peer-to-peer electricity trading method and system based on supply and demand forecasting in a blockchain environment, which solves the technical problems of low effectiveness of existing supply and demand matching and low reliability of blockchain-based electricity trading systems.

[0007] (2) Technical solution

[0008] To achieve the above objectives, the present invention is implemented through the following technical solutions:

[0009] In a first aspect, the present invention provides a peer-to-peer electricity trading method based on supply and demand forecasting in a blockchain environment. The method is executed by a blockchain-based electricity trading system in which a photovoltaic power prediction model is pre-established. The peer-to-peer electricity trading method includes:

[0010] S1. Predicting the photovoltaic power generation on the supply side during the preset time period based on the meteorological data of the preset time period and a pre-built photovoltaic power prediction model; obtaining similar historical daily data for the preset time period, and predicting the electricity load on the demand side during the preset time period based on the similar historical daily data;

[0011] S2. Match supply and demand based on the photovoltaic power generation on the supply side and the electricity load on the demand side during the preset time period to form a transaction contract that maximizes the benefits on both sides.

[0012] Preferably, the process of pre-building a photovoltaic power prediction model includes:

[0013] a. Obtain historical meteorological data and photovoltaic power data and perform preprocessing;

[0014] b. Standardize the pre-processed historical daily meteorological data and PV power data to obtain a normalized data set, and use correlation analysis to obtain the main characteristic parameters of PV forecasting and the degree of correlation between each historical day and the preset time period;

[0015] c. Select the top n data with the greatest similarity based on the degree of association as a training set, and train the Attention-MPA-LSTM model to obtain a photovoltaic power prediction model to predict photovoltaic power for a preset time period. The Attention-MPA-LSTM model refers to adding a marine predator algorithm to an attention mechanism long short-term memory neural network.

[0016] Preferably, the obtaining of similar historical daily data for a preset time period of demand-side load forecasting includes:

[0017] Using the comprehensive factor as a measurement indicator, the historical daily data with the largest comprehensive factor between the preset time period is selected as the similar historical daily data, wherein the calculation formula of the comprehensive factor is as follows:

[0018] δ i =M1α1+M2α2+M3α3+M4α4

[0019] Among them, δ i represents the comprehensive factor, α1 represents the day type factor, α2 represents the precursor factor, α3 represents the meteorological factor, α4 represents the time similarity factor, and M1, M2, M3, and M4 represent the weight coefficients of each factor.

[0020] Preferably, the forecasting of the demand-side electricity load in a preset time period based on similar historical daily data includes:

[0021] a. Use the improved RBF neural network model to predict similar historical daily data to obtain y i ;

[0022] b. Use the XGBoost model to predict similar historical daily data to get y j ;

[0023] c. Initialize the adaptive weights α and β, initialize the parameters μ and epochs, where μ is the iteration step size and epochs is the model training cycle;

[0024] d. Through the formula y = αy i +βy j and batch gradient descent method to iteratively train the model weights α and β;

[0025] e. Use the weights obtained in step d to assign weights to the models in steps a and b, and add the weighted sum to obtain the demand side power load forecast value

[0026] Preferably, the S2 includes:

[0027] Supply and demand are matched according to the following principles:

[0028] ① Based on the predicted photovoltaic power generation value on the supply side and the predicted power load value on the demand side, point-to-point transactions are prioritized between the supply side and the demand side with the closest predicted power generation and demand values, so that electricity can be traded among as few users as possible;

[0029] ② When conducting electricity transactions, full consideration should be given to the peak period of point-to-point electricity transactions, and transactions should be avoided during peak periods;

[0030] ③ After the acceptable electricity price range is established on both the supply and demand sides, point-to-point transactions are conducted based on the principle of giving priority to low prices on the demand side and high prices on the supply side;

[0031] ④The priority of the above principles is: ③①②.

[0032] Both the supply side and the demand side will be matched according to this principle to form a transaction contract that maximizes the benefits on both sides.

[0033] Preferably, the point-to-point electricity trading method further includes:

[0034] S3. The credit management mechanism in the blockchain ensures that both the supply and demand sides can reliably complete the transaction contract.

[0035] In a second aspect, the present invention provides a peer-to-peer power trading system based on supply and demand forecasting in a blockchain environment, in which a photovoltaic power forecasting model is pre-established; the peer-to-peer power trading system includes:

[0036] The prediction module is used to predict the photovoltaic power generation on the supply side of the preset time period based on the meteorological data of the preset time period and the pre-built photovoltaic power prediction model; obtain similar historical daily data for the preset time period, and predict the power load on the demand side of the preset time period based on the similar historical daily data;

[0037] The matching module is used to match the supply and demand sides according to the photovoltaic power generation on the supply side and the electricity load on the demand side in a preset time period, forming a trading contract that maximizes the benefits of both sides.

[0038] Preferably, the point-to-point electricity trading system further includes:

[0039] The supervision module is used to ensure that both the supply and demand sides can reliably complete the transaction contract through the credit management mechanism in the blockchain.

[0040] In a third aspect, the present invention provides a computer-readable storage medium, characterized in that it stores a computer program for a peer-to-peer electricity trading system based on supply and demand forecasting in a blockchain environment, wherein the computer program enables a computer to execute the peer-to-peer electricity trading method based on supply and demand forecasting in a blockchain environment as described above.

[0041] In a fourth aspect, the present invention provides an electronic device, comprising:

[0042] one or more processors;

[0043] Memory; and

[0044] One or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, the programs including a method for executing the peer-to-peer electricity trading method based on supply and demand forecasting in the blockchain environment as described above.

[0045] (3) Beneficial effects

[0046] This invention provides a peer-to-peer electricity trading method and system based on supply and demand forecasting in a blockchain environment. Compared with existing technologies, it has the following advantages:

[0047] The present invention predicts the photovoltaic power generation on the supply side during a preset time period based on meteorological data for the preset time period and a pre-established photovoltaic power prediction model. It also obtains similar historical day data for the preset time period and predicts the electricity load on the demand side during the preset time period based on the similar historical day data. Based on the photovoltaic power generation on the supply side and the electricity load on the demand side during the preset time period, supply and demand are matched to form a transaction contract that maximizes the benefits of both supply and demand. By combining the selection of similar historical days with supply and demand prediction, the present invention reduces the impact of meteorological factors, day type factors, and the like on prediction accuracy, uses a more accurate prediction method to achieve precise prediction of both supply and demand, reduces the uncertainty of supply and demand predictions, promotes a dynamic balance between supply and demand, improves the effectiveness of supply and demand matching, and enhances the economy, stability, and reliability of the energy system. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0049] Figure 1 This is a block diagram of a peer-to-peer electricity trading method based on supply and demand forecasting in a blockchain environment in an embodiment of the present invention;

[0050] Figure 2 is a comprehensive factor design diagram for similar historical days in an embodiment of the present invention;

[0051] Figure 3This is a flow chart of determining the weights of various factors using the Ant Lion optimization algorithm according to an embodiment of the present invention;

[0052] Figure 4 This is a flow chart of the credit management mechanism in an embodiment of the present invention. DETAILED DESCRIPTION

[0053] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention are clearly and completely described. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. All other embodiments derived by persons of ordinary skill in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.

[0054] The embodiments of the present application provide a peer-to-peer electricity trading method and system based on supply and demand forecasting in a blockchain environment, thereby solving the technical problems of low effectiveness of existing supply and demand matching and low reliability of blockchain-based electricity trading systems, reducing the uncertainty of supply and demand forecasting, promoting dynamic balance of supply and demand, improving the effectiveness of supply and demand matching, and enhancing the economy, stability, and reliability of the energy system.

[0055] The technical solution in the embodiments of the present application is to solve the above technical problems, and the overall idea is as follows:

[0056] During point-to-point electricity trading, the imbalance between supply and demand will threaten the safe and stable operation of the power system. Therefore, supply and demand interaction can ensure that the power generation method and market demand are in a balanced state, adjust the coordination of supply and demand in all aspects, so as to achieve dynamic balance of supply and demand and improve the effectiveness of supply and demand matching.

[0057] On the supply side, photovoltaics, as a new clean energy source, are more susceptible to sunlight than traditional power generation. Consequently, photovoltaic power generation exhibits certain intermittent and volatile characteristics, making the supply and demand relationship for this energy source complex and volatile. On the demand side, there is also a degree of uncertainty in user load requirements. Conducting electricity trading under the influence of both supply and demand uncertainties can lead to a series of adverse effects, making it difficult to maintain a stable trading process. Therefore, to maximize power utilization, it is necessary to fully consider both supply and demand uncertainties, addressing the randomness, volatility, and intermittency of distributed green renewable energy generation, as well as the inherent non-storability of electricity resources. Therefore, accurate forecasting of both supply and demand is a key means of mitigating the impact of uncertainty. By clearly defining the power generation capacity of individual power generation units on the supply side and the power load requirements of users on the demand side, and developing accurate forecasts for both sides, we can better lay the foundation for supply and demand matching, reduce uncertainty in supply and demand forecasts, promote dynamic supply and demand balance, and improve the effectiveness of supply and demand matching.

[0058] After completing the forecasts for both supply and demand, peer-to-peer electricity trading is necessary to achieve supply and demand matching. This is an effective measure to maintain the stability of supply and demand transactions, improve transaction efficiency, reduce transaction costs, and integrate the normal and stable operation of the transaction mechanism. On the basis of achieving supply and demand matching in peer-to-peer electricity transactions, it is also very important to formulate the necessary principles for supply and demand transactions. Under unified trading rules, both supply and demand sides can be regulated to conduct transactions according to established rules, which is more conducive to improving transaction stability and ensuring the economical, sustainable, and stable operation of the entire peer-to-peer trading system.

[0059] During the transaction process, with the help of the characteristics of blockchain, the blockchain system is jointly operated and maintained by all nodes in the network. Every electricity transaction record will be correctly recorded to avoid tampering; the intelligent punishment mechanism strengthens the self-discipline and credit rating of the trading entities, prevents false transactions and record tampering, enhances the credibility of the trading mechanism, and encourages point-to-point electricity trading entities to participate correctly in accordance with the rules and maintain the correct and stable conduct of transactions.

[0060] The embodiment of the present invention provides a peer-to-peer power trading method based on supply and demand forecasting in a blockchain environment. The peer-to-peer power trading method is executed by a blockchain-based power trading system in which a photovoltaic power prediction model is pre-built. Figure 1 As shown, the peer-to-peer electricity trading method includes:

[0061] S1. Predicting the photovoltaic power generation on the supply side during the preset time period based on the meteorological data of the preset time period and a pre-built photovoltaic power prediction model; obtaining similar historical daily data for the preset time period, and predicting the electricity load on the demand side during the preset time period based on the similar historical daily data;

[0062] S2. Match supply and demand based on the photovoltaic power generation on the supply side and the electricity load on the demand side during the preset time period to form a transaction contract that maximizes the benefits on both sides.

[0063] The embodiments of the present invention combine the selection of similar historical days with supply and demand forecasts to reduce the impact of meteorological factors, day type factors, etc. on forecast accuracy, use precise forecasting methods to achieve accurate forecasts of both supply and demand, reduce the uncertainty of supply and demand forecasts, promote the dynamic balance of supply and demand, improve the effectiveness of supply and demand matching, and enhance the economy, stability, and reliability of the energy system.

[0064] The following is a detailed description of each step:

[0065] In step S1, the photovoltaic power generation on the supply side of the preset time period is predicted based on the meteorological data of the preset time period and the pre-built photovoltaic power prediction model; similar historical daily data of the preset time period is obtained, and the electricity load on the demand side of the preset time period is predicted based on the similar historical daily data. The specific implementation process is as follows:

[0066] In peer-to-peer electricity trading, photovoltaic power generation is the primary means of increasing power supply on the demand side. The process of converting solar energy into electricity through the photovoltaic effect is influenced by numerous external factors, resulting in volatility, indirectness, and uncontrollability. Photovoltaic power is not only affected by solar irradiance and operating temperature, but also strongly correlated with meteorological conditions such as seasons, daytime and nighttime, and weather conditions. Therefore, the impact of meteorological factors is primarily considered when forecasting photovoltaic power generation.

[0067] In an embodiment of the present invention, the construction process of the pre-built photovoltaic power prediction model is as follows:

[0068] a. Obtain historical meteorological data and photovoltaic power data and perform preprocessing, including:

[0069] Obtain historical daily meteorological data and photovoltaic power data uploaded in the past from the blockchain and remove outliers such as erroneous and missing data.

[0070] b. Standardize the pre-processed historical meteorological data and photovoltaic power data, and obtain the main characteristic parameters through correlation analysis, including:

[0071] Through Pearson coefficient and maximum information coefficient analysis, meteorological factors related to photovoltaic power are selected, and data of these meteorological factors are quantified. The quantified data are analyzed using the Pearson coefficient method to obtain the main characteristic parameters affecting photovoltaic power generation and standardize them.

[0072] The correlation degree between each historical day and the preset time period is obtained through correlation analysis, and the data of each historical day is sorted according to the degree of correlation with the preset time period;

[0073] c. Select the top n pieces of data with the highest similarity based on the degree of correlation as the training set, train the Attention-MPA-LSTM model, and obtain the photovoltaic power prediction model to predict the photovoltaic power in the preset time period. Specifically:

[0074] In practical applications, traditional LSTM neural network prediction models often struggle to process large, multi-dimensional, and multi-variable datasets. During training, the model may overlook important temporal information, resulting in poor performance and impacting prediction accuracy. Therefore, the Attention mechanism was introduced to overcome the limitations of traditional encoder-decoders, which use fixed-length vectors during encoding. This mechanism preserves the intermediate states of the LSTM encoder and selectively learns these states through model training. The Attention mechanism highlights key influencing factors, helping the LSTM make accurate judgments without increasing the model's computational and storage overhead.

[0075] At the same time, in order to further improve the prediction accuracy of the photovoltaic power model based on the LSTM network and reduce the adverse effects of unreasonable LSTM hyperparameter setting by traditional manual trial and error on model accuracy, a novel swarm intelligence optimization method, the marine predator algorithm (MPA), is also used to optimize the hyperparameters of the LSTM network, thereby improving the accuracy and robustness of the photovoltaic power prediction model.

[0076] S101. Obtain the photovoltaic power of the preset time period by using a trained photovoltaic power prediction model and meteorological data of the preset time period, thereby obtaining the photovoltaic power generation of the preset time period and obtaining a final photovoltaic power generation prediction result.

[0077] S102: Obtain similar historical daily data for a preset time period, and predict the demand-side electricity load for the preset time period based on the similar historical daily data. This includes:

[0078] When conducting short-term power load forecasting, selecting appropriate similar historical days as training samples can simplify the training process and improve the forecast accuracy.

[0079] Get similar historical daily data for a preset time period:

[0080] Similar historical days refer to historical days with similar influencing factors. In the embodiment of the present invention, the comprehensive factor is used as a similarity comparison index to select similar historical days. The comprehensive factor is defined as the sum of the similarities of various influencing factors between the predicted day and the historical day. The comprehensive factor design diagram is shown as follows: Figure 2 shown.

[0081] in,

[0082] Day type factors: the impact of time factors such as seasons, holidays, and weekly cycles on load changes. In the embodiment of the present invention, the similarity of day type factors in the influencing factors between the preset time period and historical days is analyzed by grey correlation analysis.

[0083] Precursor potential factor: By comparing and analyzing the shapes of the average load change curves of two specific days or the average load change curves of recent days, if the shapes are similar, it indicates that the average load change patterns of these two days or recent days are also similar. The similarity of the shapes of the average load change curves also indicates the trend similarity of these two days or recent days. In this embodiment of the present invention, the similarity of the precursor potential factor among the influencing factors between the preset time period and the historical day is obtained using the DTW distance algorithm.

[0084] Meteorological factors: Short-term changes in power load values ​​are related to meteorological factors such as temperature, humidity, wind speed, and rainfall. In this embodiment of the present invention, the Manhattan distance algorithm is used to calculate the similarity of meteorological factors among the influencing factors between the preset time period and historical days.

[0085] Temporal Similarity Factor: In short-term load forecasting, the impact of historical days on the target day has a significant "time distance" effect. That is, as the time interval from the target day increases, the impact on the target day's load value gradually decreases. Furthermore, daily load values ​​exhibit cyclical variations, meaning that the load values ​​for days of the same type as this week's Sunday are similar. In this embodiment of the present invention, the temporal similarity factor of the influencing factors between the preset time period and historical days is calculated using adjacent days.

[0086] In order to form a comprehensive factor, the weight coefficients M1, M2, M3, and M4 of each factor are introduced, and the comprehensive similarity is calculated using the weighted summation method. It can be specifically expressed as:

[0087] δ i =M1α1+M2α2+M3α3+M4α4

[0088] The Ant Lion algorithm is introduced to dynamically optimize the weight coefficient, so that the weight coefficient can dynamically adapt to different situations, thereby achieving parameter adaptability, and thus selecting similar historical days with a high degree of similarity to the predicted day. The Ant Lion optimization algorithm determines the weight flow chart as follows Figure 3 shown.

[0089] Forecast the electricity load on the demand side based on similar historical daily data:

[0090] In an embodiment of the present invention, the electricity load on the demand side is predicted by combining the improved RBF neural network model and the XGBoost model.

[0091] Improved RBF (Radial Basis Function) Neural Network Model: Samples are first clustered using a subtractive clustering algorithm. Fuzzy C-means clustering is then clustered again based on the output. This significantly reduces the impact of random initial values ​​in C-means clustering on clustering performance. RBF hidden layer parameters are then set based on the clustering results to improve model performance.

[0092] XGBoost model: Extreme Gradient Boosting Tree is an ensemble learning framework based on the Boosting tree model. It performs a second-order Taylor expansion on the loss function. Compared to the GBDT model, it reduces training time and improves solution efficiency. Regularization is also added to reduce model complexity and prevent overfitting. The core idea of ​​this algorithm is to continuously split features to construct new trees to fit the residual between the previous prediction and the actual value, and then accumulate the results of all trees as the final prediction result.

[0093] To combine the advantages of different models, the improved RBF neural network model and the XGBoost model were mixed. Since the results produced by the tree model and the neural network model are less correlated, the adaptive weight method is used to select the optimal weight parameters to help improve prediction accuracy.

[0094] First, the above influencing factors are used as model input, that is, X t , each prediction model has a certain effect on the data X t The prediction results are y i 、y j The adaptive weight module first assigns different weights α and β to the outputs of the two modules through the Dense layer; then the weighted values ​​of the two modules are added together through the Add layer to obtain the demand-side electricity load forecast value. While the hybrid model is learning and training, the optimal parameters are obtained using batch gradient descent iteration. During the iteration process, α and β are the weights of the two models, ranging from 0 to 1, with random initial values; μ is the iteration step size, and epochs is the model training cycle. The steps are as follows:

[0095] a. Use the improved RBF neural network model to predict the data and obtain y i ;

[0096] b. Use the XGBoost model to predict the data and get y j ;

[0097] c. Adaptive weight part α and β, initialization parameters μ, epochs;

[0098] d. Through the formula y = αy i +βy j and batch gradient descent method to iteratively train the model weights α and β;

[0099] e. Use the weights obtained in step d to assign weights to the models in steps a and b, and add the weighted sum to obtain the demand side power load forecast value

[0100] It should be noted that in the specific implementation process, there is no order requirement between the supply-side photovoltaic forecast and the demand-side user demand forecast.

[0101] In step S2, the supply and demand are matched based on the photovoltaic power generation on the supply side and the electricity load on the demand side during the preset time period, forming a transaction contract that maximizes the benefits on both sides. The specific implementation process is as follows:

[0102] Normal demand users often consider the following aspects when purchasing electricity:

[0103] a. Electricity prices;

[0104] b. Power supply stability;

[0105] c. Wire capacity;

[0106] d. Transaction user credit value;

[0107] Normal supply users often consider the following aspects when selling electricity:

[0108] a. Electricity prices;

[0109] b. Wire capacity;

[0110] c. Transaction user credit value;

[0111] To maximize the efficiency of supply and demand matching and maintain grid stability, we will now implement supply and demand matching according to the following principles:

[0112] ① Based on the predicted photovoltaic power generation value on the supply side and the predicted power load value on the demand side, point-to-point transactions are prioritized between the supply side and the demand side with the closest predicted power generation and demand values, so that electricity can be traded among as few users as possible;

[0113] ② When conducting electricity transactions, full consideration should be given to the peak period of point-to-point electricity transactions, and transactions should be avoided during peak periods;

[0114] ③ After the acceptable electricity price range is established on both the supply and demand sides, point-to-point transactions are conducted based on the principle of giving priority to low prices on the demand side and high prices on the supply side.

[0115] ④The order of priority of the above principles is: ③①②

[0116] The supply side and the demand side will be matched accordingly based on this principle and form a trading contract that maximizes the benefits on both sides. The contract will take effect after confirmation by both sides, and electricity transactions will then be carried out in accordance with the terms of this contract.

[0117] In an embodiment of the present invention, the prediction module in "predict first, then trade" is completed by performing three steps: supply-side photovoltaic prediction, demand-side user demand prediction, and two-way matching of supply and demand. This fully considers the uncertainty of both the supply and demand sides and improves the stability of point-to-point electricity trading.

[0118] In the specific implementation process, when conducting electricity transactions, the transaction contract often occurs before the actual execution of the transaction. The uncertainty of renewable energy production and electricity demand may lead to differences between the actual and contracted transaction amounts. The fluctuation of electricity prices may cause the supply side and the demand side (users) to breach the contract and pursue more benefits. Therefore, it is very necessary to establish an effective reward and punishment mechanism to regulate user breach of contract behavior. The embodiment of the present invention also includes step S3, using a credit management mechanism to ensure that both the supply and demand sides complete a stable and reliable transaction contract. The implementation process is as follows:

[0119] First, a penalty model is established. When a user makes a transaction, the closer the default time is to the transaction execution time, the higher the credibility value will be reduced; the greater the amount of electricity traded, the higher the credibility value will be reduced when the default occurs.

[0120] When a user's credibility falls below the low-trust mark, a low-trust mark will appear on their homepage, along with the number of defaults. The credit management model also implements a waiting period, trust guarantees, and penalty costs to penalize defaulting users. Defaulting users are assumed to incur one of these penalties. The introduction of a waiting period assigns different attributes to users with different credit levels, restricting electricity trading for low-credit users. To avoid the waiting period, users can adjust prices—increasing the buy price or lowering the sell price—to prioritize their orders and circumvent the waiting period. Those who prefer neither waiting nor losing profits can enlist high-credit users to guarantee their contracts, allowing them to trade normally. However, if a user defaults during the guaranteed period, the high-credit user who guaranteed them will also be penalized.

[0121] In addition to the penalty mechanism, the model introduces priority time and incentive costs to manage the credit of high-trust users who adhere to peer-to-peer electricity trading principles and strictly complete electricity transactions in accordance with established contracts. Priority time means that this user will be prioritized among other trading users under the same trading conditions, gaining priority selection. Incentive costs supplement this priority time by allowing users with low trust scores to appear on their homepages with higher selling prices and lower buying prices, allowing them to obtain more valuable benefits.

[0122] The credit management mechanism flow chart is as follows: Figure 4 shown.

[0123] An embodiment of the present invention further provides a peer-to-peer power trading system based on supply and demand forecasting in a blockchain environment, in which a photovoltaic power forecasting model is pre-established. The peer-to-peer power trading system includes:

[0124] The prediction module is used to predict the photovoltaic power generation on the supply side of the preset time period based on the meteorological data of the preset time period and the pre-built photovoltaic power prediction model; obtain similar historical daily data for the preset time period, and predict the power load on the demand side of the preset time period based on the similar historical daily data;

[0125] The matching module is used to match the supply and demand sides according to the photovoltaic power generation on the supply side and the electricity load on the demand side in a preset time period, forming a trading contract that maximizes the benefits of both sides.

[0126] It is understandable that the peer-to-peer electricity trading system based on supply and demand forecasting in a blockchain environment provided by an embodiment of the present invention corresponds to the peer-to-peer electricity trading method based on supply and demand forecasting in the above-mentioned blockchain environment. The explanation, examples, beneficial effects, etc. of the relevant contents can refer to the corresponding contents in the peer-to-peer electricity trading method based on supply and demand forecasting in a blockchain environment, and will not be repeated here.

[0127] An embodiment of the present invention also provides a computer-readable storage medium, which stores a computer program for peer-to-peer electricity trading based on supply and demand forecasting in a blockchain environment, wherein the computer program enables a computer to execute the peer-to-peer electricity trading method based on supply and demand forecasting in a blockchain environment as described above.

[0128] An embodiment of the present invention further provides an electronic device, including:

[0129] one or more processors;

[0130] Memory; and

[0131] One or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, the programs including a method for executing the peer-to-peer electricity trading method based on supply and demand forecasting in the blockchain environment as described above.

[0132] In summary, compared with the existing technology, the present invention has the following beneficial effects:

[0133] 1. The embodiment of the present invention combines the selection of similar historical days with supply and demand forecasts to reduce the impact of meteorological factors, day type factors, etc. on forecast accuracy, use more accurate forecasting methods to achieve accurate forecasts of both supply and demand, reduce the uncertainty of supply and demand forecasts, promote the dynamic balance of supply and demand, improve the effectiveness of supply and demand matching, and enhance the economy, stability, and reliability of the energy system.

[0134] 2. The embodiment of the present invention improves the peer-to-peer electricity trading process mechanism based on blockchain, takes "predict first, then trade" as the research focus, forms the supply and demand matching principle, and ensures the normal and stable operation of the electricity trading system.

[0135] 3. The embodiment of the present invention introduces a user credit management model, which manages user trust based on a reward and punishment mechanism, reduces the number of user defaults due to personal gain, and maintains the credibility, continuity, and stability of point-to-point electricity transactions.

[0136] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply the existence of any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.

[0137] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A peer-to-peer electricity trading method based on supply and demand forecasting in a blockchain environment, characterized in that: The method is performed by a blockchain-based power trading system in which a photovoltaic power prediction model is pre-built; the peer-to-peer power trading method includes: S1. Predicting the photovoltaic power generation on the supply side during the preset time period based on the meteorological data of the preset time period and a pre-built photovoltaic power prediction model; obtaining similar historical daily data for the preset time period, and predicting the electricity load on the demand side during the preset time period based on the similar historical daily data; S2. Matching supply and demand based on the photovoltaic power generation on the supply side and the electricity load on the demand side during a preset time period to form a transaction contract that maximizes the benefits on both sides. The process of pre-building a photovoltaic power prediction model includes: a. Obtain historical daily meteorological data and photovoltaic power data and perform preprocessing; b. Standardize the pre-processed historical daily meteorological data and PV power data to obtain a normalized data set, and use correlation analysis to obtain the main characteristic parameters of PV forecasting and the degree of correlation between each historical day and the preset time period; c. Selecting the top n pieces of data with the greatest similarity based on the degree of association as a training set, training the Attention-MPA-LSTM model to obtain a photovoltaic power prediction model to predict photovoltaic power for a preset time period, wherein the Attention-MPA-LSTM model refers to adding a marine predator algorithm to an attention mechanism long short-term memory neural network; obtaining similar historical daily data for the preset time period includes: Using the comprehensive factor as a measurement indicator, the historical daily data with the largest comprehensive factor between the preset time period is selected as the similar historical daily data, wherein the calculation formula of the comprehensive factor is as follows: d i =M1α1+M2α2+M3α3+M4α4 Among them, δ i represents the comprehensive factor, α1 represents the day type factor, α2 represents the precursor factor, α3 represents the meteorological factor, α4 represents the time similarity factor, and M1, M2, M3, and M4 represent the weight coefficients of each factor; among which, the precursor factor refers to: by comparing and analyzing the shapes of the average load change curves of two days or the shapes of the average load change curves of recent days, if the shapes are similar, it means that the average load change patterns of these two days or recent days are also similar, and the similarity of the shapes of the average load change curves also represents the similarity of the precursor factors of these two days or recent days.

2. The peer-to-peer electricity trading method based on supply and demand forecasting in a blockchain environment according to claim 1, characterized in that: The forecasting of the electricity load on the demand side in a preset time period based on similar historical daily data includes: a. Use the improved RBF neural network model to predict similar historical daily data to obtain y i ; b. Use the XGBoost model to predict similar historical daily data to get y j ; c. Initialize the adaptive weights α and β, initialize the parameters μ and epochs, where μ is the iteration step size and epochs is the model training cycle; d. Through the formula y = αy i +βy j and batch gradient descent method to iteratively train the model weights α and β; e. Use the weights obtained in step d to assign weights to the models in steps a and b, and add the weighted sum to obtain the demand side power load forecast value The improved RBF neural network model includes: clustering the samples using a subtractive clustering algorithm, setting the initial value of fuzzy c-means clustering according to the output results, and clustering again, and then setting the RBF hidden layer parameters according to the clustering results.

3. The peer-to-peer electricity trading method based on supply and demand forecasting in a blockchain environment according to claim 1, characterized in that: The S2 includes: Supply and demand are matched according to the following principles: ① Based on the supply-side photovoltaic power generation forecast and the demand-side electricity load forecast, point-to-point transactions are prioritized between the supply side and the demand side with the closest power generation and demand forecasts, allowing electricity to be traded between as few supply and demand users as possible. ② When conducting electricity transactions, full consideration should be given to the peak period of point-to-point electricity transactions, and transactions should be avoided during peak periods; ③ After the acceptable electricity price range is established on both the supply and demand sides, point-to-point transactions are conducted based on the principle of giving priority to low prices on the demand side and high prices on the supply side; ④The order of priority of the above principles is: ③①②; Both the supply side and the demand side will be matched according to this principle to form a transaction contract that maximizes the benefits of both the supply and demand sides.

4. The peer-to-peer electricity trading method based on supply and demand forecasting in a blockchain environment according to any one of claims 1 to 3, characterized in that: The peer-to-peer electricity trading method further includes: S3. The credit management mechanism in the blockchain ensures that both the supply and demand sides can reliably complete the transaction contract.

5. A peer-to-peer electricity trading system based on supply and demand forecasting in a blockchain environment, characterized by: A photovoltaic power prediction model is pre-built in the system; the peer-to-peer power trading system includes: The prediction module is used to predict the photovoltaic power generation on the supply side of the preset time period based on the meteorological data of the preset time period and the pre-built photovoltaic power prediction model; obtain similar historical daily data for the preset time period, and predict the power load on the demand side of the preset time period based on the similar historical daily data; The matching module is used to match the supply and demand sides based on the photovoltaic power generation on the supply side and the electricity load on the demand side in a preset time period, forming a transaction contract that maximizes the benefits of both sides; The process of pre-building a photovoltaic power prediction model includes: a. Obtain historical daily meteorological data and photovoltaic power data and perform preprocessing; b. Standardize the pre-processed historical daily meteorological data and PV power data to obtain a normalized data set, and use correlation analysis to obtain the main characteristic parameters of PV forecasting and the degree of correlation between each historical day and the preset time period; c. Selecting the top n pieces of data with the greatest similarity based on the degree of association as a training set, training the Attention-MPA-LSTM model to obtain a photovoltaic power prediction model to predict photovoltaic power for a preset time period, wherein the Attention-MPA-LSTM model refers to adding a marine predator algorithm to an attention mechanism long short-term memory neural network; obtaining similar historical daily data for the preset time period includes: Using the comprehensive factor as a measurement indicator, the historical daily data with the largest comprehensive factor between the preset time period is selected as the similar historical daily data, wherein the calculation formula of the comprehensive factor is as follows: d i =M1α1+M2α2+M3α3+M4α4 Among them, δ i represents the comprehensive factor, α1 represents the day type factor, α2 represents the precursor factor, α3 represents the meteorological factor, α4 represents the time similarity factor, and M1, M2, M3, and M4 represent the weight coefficients of each factor; among which, the precursor factor refers to: by comparing and analyzing the shapes of the average load change curves of two days or the shapes of the average load change curves of recent days, if the shapes are similar, it means that the average load change patterns of these two days or recent days are also similar, and the similarity of the shapes of the average load change curves also represents the similarity of the precursor factors of these two days or recent days.

6. The peer-to-peer power trading system based on supply and demand forecasting in a blockchain environment according to claim 5, characterized in that: The peer-to-peer power trading system further includes: The supervision module is used to ensure that both the supply and demand sides can reliably complete the transaction contract through the credit management mechanism in the blockchain.

7. A computer-readable storage medium, characterized in that It stores a computer program for a peer-to-peer electricity trading system based on supply and demand forecasting in a blockchain environment, wherein the computer program enables a computer to execute a peer-to-peer electricity trading method based on supply and demand forecasting in a blockchain environment as described in any one of claims 1 to 4.

8. An electronic device, characterized in that: include: one or more processors; Memory; as well as One or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, the programs including a method for executing a peer-to-peer electricity trading method based on supply and demand forecasting in a blockchain environment as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Electric power spot market marginal electricity price prediction method, system and device and storage medium

    CN112686693A

  • Short-term photovoltaic power probability interval prediction method

    CN114330100A