Research on Decentralized Trading Strategy of Electricity Market
Based on Blockchain Technology

With the gradual opening of the bilateral electricity market and the increase in distributed new energy generation, under the new market structure, various types of members should be encouraged to develop flexible cooperation and competition models in the new situation in order to improve the operating efficiency in the electricity market, encouraging the reduction of operating costs to improve the economic benefits of the market. Based on the relevant theories of blockchain technology, this paper proposes a decentralized small-scale distribution network intra-network transaction model and market mechanism, which can eventually be truly decentralized and achieve a lower cost and high efficiency market.


Introduction
In the early days of the power industry, each user established a system within a small area. Later, the scale of infrastructure construction continued to increase, forming a monopoly pattern. With the maturity of the industrial system and market, the deficiencies of monopoly are becoming increasingly prominent and the amount of power generation is redundant. Surplus investment, meaningless investment and excess labor cost investment have become the urgent problem to be solved in a huge system, that is how to make the market get the maximum return under the premise of higher efficiency, and ensure that all links of transmission, transmission and use maximize benefits and be friendly to the environment and the long-term development of human society.
The benefits brought by the scale of power generation have gradually worn out. The power industry in many countries and regions has begun to carry out system reforms, with the goal of breaking monopolies and deregulation, and establishing an orderly power market with the goal of introducing orderly competition. This new form can undoubtedly optimize the allocation of resources and increase the utilization of various biological and human resources, and it has a tremendous role to be expected for the development of the power industry and even the entire society.
In recent years, the rise of blockchain technology and its highly anticipated future market have injected new technical vitality into the reform of various industries. As an emerging distributed bookkeeping method, it changes the previous mode of centralized over-reliance on intermediary links, which is very worthy of expectation in terms of saving manpower and material resources, fair and just security that cannot be tampered with, and so on. As more and more retailers and small companies participate in market operations, the use of blockchain-related technologies to decentralize the distribution network market has become a necessary way for the future development of the power market.
Based on the relevant theories of blockchain technology, this paper proposes a decentralized smallscale distribution network transaction model and market mechanism. First, the feasibility of this method in the current general environment is analyzed, combined with the Ethereum smart contract in the blockchain technology, a model that combines the economic benefits of each member and the energy optimization in the system is proposed, and the trend of the system is combined Analysis, combined with the proposed modifiable quotation function, users can continuously adjust their own quotations by weighing the benefits, and then use the improved alternating direction multiplier iterative algorithm to verify its feasibility through the example data, and obtain a complete clearing model of the system, and based on the above for the analysis summarizes and prospects the future development status and blueprint of the retail market.

Feasibility analysis
The application of blockchain technology to the retail model of the electricity market can be analyzed in terms of structural decentralization and transaction information security.
First, the decentralized electricity trading market is similar in structure to blockchain technology. The penetration rate of distributed new energy power generation has gradually increased, and a large amount of energy and data management has brought no small challenges to the management of the distribution network E3S Web of Conferences 185, 01022 (2020) ICEEB 2020 http://doi.org/10.1051/e3sconf/202018501022 and retail transactions. After applying blockchain technology to decentralize the distribution network retail market in the community or area, there is no central organization management, and the information flow is point-to-point transmission. All users jointly supervise and maintain, due to the cancellation of the central organization's investment and maintenance costs , Saves human and material resources, removes the transaction procedures through the intermediary institutions, simplifies the steps of the transaction, saves the time and cost of the transaction. This reduces the economic cost of the system to a certain extent, and also promotes direct communication between buyers and sellers. At the same time, the blockchain records information, and the source of the information can be traced back when there is a dispute between the two parties. Therefore, in summary, the decentralized transaction model has great advantages compared with the traditional transaction model.
In addition, the application of blockchain technology to the distribution network trading market also has significant advantages in terms of information security. The special asymmetric encryption method of the blockchain and the private key are not disclosed, so that the information can be traced to the source. After the tampering, the asymmetric decrypted hash digest and the Mockler root can't pass the information consistency check, and the time stamp can't correspond. It can prevent intruders who falsify their identity to participate in the transaction, and also can well prevent false transactions and frauds, malicious tampering and other negative behaviors that occur in the transaction. Once discovered, it will lose credit and seriously affect the subsequent transactions of the node. Therefore, it is possible to include a review procedure in the transaction system, and it is recommended that the participants pay a certain amount of credit guarantee as a node's credit certificate after joining the system. In the decentralized storage method of the general ledger, all individual keys are used to encrypt the system, which greatly improves the security performance of the entire system.
In the entire trading system, each producer and consumer becomes the main body of the transaction and participates in the purchase and sale of electrical energy. Participants first prepare their own identity information, including the external public key and registration information in the industrial and commercial system as identity credentials, and publish it externally through the system, and other participants can verify the authenticity through open and authoritative channels. When an individual raises a transaction request, sends out the corresponding information, several nodes interested in the transaction accept the information for verification, and then returns their own information and quotation.After the system clears the auction price, the transaction is concluded and recorded.
In summary, it has been proven that the decentralized distribution network trading market is feasible, and has obvious advantages in economic benefits, investment costs, operation and maintenance costs, and information security.
According to the above analysis on technology and feasibility, based on the specific characteristics of blockchain technology and the characteristics of a large number of distributed new energy power generation distribution networks, design the decentralized distribution network transaction specific transaction process, the core steps are as follows: ① Information release stage: All nodes in the system always pay attention to the blockchain dynamics of the communication network. When a node makes a transaction request, it will package and encrypt its own identity information and transaction demand information to generate a summary and digital signature and write it into the blockchain, and broadcast it through the communication network to notify all nodes in the system. ②Information receiving stage: The remaining nodes receive the latest block information, obtain the corresponding digest after asymmetric decryption, and combine the transaction issuer's external public key and its own key to conduct a consistent information check to determine whether the block information is forged or has been tampered with. When the information is consistently verified, it proves that the block information is the current real transaction request.
③ Reply to the intention stage: Each participating entity judges whether it has a trading intention according to its actual situation, and if there is no intention, it will not respond; if there is no node response, the transaction proposer needs to modify its own conditions to re-submit the transaction request, and the program returns to the first step. Nodes with transaction intent package their own quotations and identity information into the blockchain in the same way, the process is similar to step ①.
④Bidding negotiation stage: The publishing node of the transaction intention accepts the blockchain information at this moment, and after decrypting and verifying the consistency, it selects the nodes that meet its own conditions, and conducts price negotiations or auction bidding on two or more parties. In this process, the nodes can use their own conditions and The other parties involved in the transaction request to amend their own quotations until the negotiation is over to reach a consensus. If the publisher does not receive a quotation that satisfies itself, it can choose to modify the conditions to resend the transaction request, or abandon the transaction, the process is terminated.
⑤ Transaction completion stage: The two or more parties to a consensus transaction exchange identity information, send digital signatures to each other, transfer money through a blockchain token account or transact through cash, bank and other traditional methods, and transfer the entire transaction without violating the relevant confidentiality agreement. The process is written into the blockchain. If necessary, you can also sign contracts, pay deposits and other procedures to further improve the transaction process to prevent delinquency or tampering with information. All of this information will be used as evidence of the transaction after the dispute between the two parties. legal validity.

Energy optimization model
The model in this chapter divides the ordinary users involved in the transaction into micro-grid (MG), load user (LA) and producer-consumer (RES). A super user distribution network operator DSO is also set up for energy supervision.
Among ordinary users, MG users as typical ordinary users are the analysis objects for model establishment. It can be used as a consumer to buy electrical energy from other members, or it can sell its own generated energy. It is a typical producer and consumer. System energy optimization model, auction clearance model and electric energy distribution model, and dynamically modify the parameters of the auction.
In the traditional centralized market, the operator DSO is responsible for the management of centralized clearing, while in the decentralized market, all members with communication functions negotiate and make independent decisions.
According to the solution of economic optimization, users judge whether they have trading needs and make corresponding response actions in the system. Assume that the bidding function of each user node is: In the formula: ， is expected energy trading volume. The value greater than zero indicates that there is a demand to buy electricity, negative indicates that there is a surplus of power generation can be sold, 0 ， is expected price. 、 are auction correlation coefficients, both of which are greater than zero. After the user submits a transaction request, the market enters the stage of clearing the auction price. The model is: In the formula: δ is the network loss coefficient. Equation (3) is the power balance equation after the transaction volume request is made.
After the transaction is concluded, the active power will be proportionally distributed to the demand side: In the formula: ∆ ， is the tie line power; ∆ ， is the amount of controllable power change; ∆ ， is the controllable load power variation.
Under the decentralized market structure, for ordinary users who participate in the quotation, after the buyer and seller have repeatedly cleared the bid price, under the premise that the strategy has been formulated, if the transaction is for multiple parties to participate, the first to reach the same quotation conditions will constitute a transaction, The auction clearance period ends. According to this, the auction price of the entire transaction is divided into two stages: power correction and power price dynamic adjustment. User n represents the bidding round, +1 after each adjustment, set the penalty coefficient in the iteration to β, and u_k is the corresponding Lagrangian iterative multiplier at the kth iteration.
In the iterative process of ordinary users, the alternating direction multiplier algorithm is used to iteratively update in the power correction process of the first stage. For the ordinary user model, the iteration form at this stage is shown in Equation (5): Step 1: Initialize bidding round n, bidding coefficients α and β.
Step 2: Initialize the ADMM iteration number k, penalty coefficient ρ and Lagrange penalty coefficient initial value .
Step 3: Solve the regional bidding model and initialize the expected exchange power ， ， to transfer the expected exchange power between users.
Step 4: The user performs ADMM iteration, updates the expected exchange power ， ， , and transmits the desired exchange power between users.
Step 5: The user determines whether the iteration has converged. If it has converged, stop iterating, go to step 6; otherwise, the number of iterations is k+1, and update the Lagrange multiplier and return to step 4 for the next iteration.
Step 6: DSO invokes the power flow check model to check the ADMM iteration results, determine whether the node power and voltage meet the constraints, and if so, proceed to step 7; otherwise, the number of iterations k+1, and update , return to step 4.
Step 7: Determine whether the buyer's expected electricity price is consistent with the seller's expected electricity price. If they are not consistent, the bidding round n+1, return to step 2; if they are consistent, exit the calculation, and the clearing is completed.

Example analysis
This article takes the improved IEEE 9 standard node as an example for analysis.
In the task release phase, LA acts as the buyer of electricity, and MG and RES act as the seller of electricity, and publishes market demand through the Ethereum smart contract quotation function to obtain the initial quotation of ordinary users.
Then the smart contract integrates the market entry user bidding curve according to the market opening criteria to determine whether to open the market. Then the smart contract integrates the market entry user bidding curve according to the market opening criteria to determine whether to open the market.
Using MATLAB for programming and simulation, the bidding curves of ordinary users LA is as follows: The bidding curves of ordinary users MG is as follows: The bidding curves of ordinary users RES is as follows:

Conclusion
Based on the core features of blockchain technology, this paper has carried out theoretical explanations, actual algorithms and practical examples of distribution network transactions. Although this article is based on the operating rules of the electricity market, the method can also be promoted in other industries. It is better to say that the natural gas trading and heating industries have even great prospects in the future energy interconnection. Finally, this article only discusses and analysis the theoretical and mathematical levels. Whether this type of project can be implemented depends on the support of national and generous policies, which will contribute to the improvement of relevant laws and regulations, as well as the better development of technology, industry and society.