A Method to Deal With Inter-regional and Inter-provincial Transaction Settlement Deviation Quantity Based on Kernel Density–Entropy Weight

The mismatch between energy distribution and power load in China can be alleviated by inter-regional and inter-provincial power transactions. However, it also brings challenges to transaction settlement. In the new round of electric power reform, the transaction settlement deviation quantity needs to be more standardized. Based on the analysis of the related work, this article used the analytical framework of the analytic hierarchy process to calculate the transaction type weight, the inter-regional, and the inter-provincial weight, respectively, and accordingly, quantifies the amount of deviation quantity allocated by the corresponding trading subjects. According to the size and volatility of the trading quantity, we further propose a comprehensive weighting method based on kernel density and entropy weight to quantify the deviation quantity of inter-regional and inter-provincial trading subjects of different trading types. Specifically, this article first used the kernel function weighting method to calculate the weights of different transaction types that measure the transaction quantity, and then the improved entropy weight method was used to calculate the weights of different transaction types that reflect the volatility of the transaction quantity. Then, the comprehensive weights were constructed by considering the influence of the above two dimensions on the distribution of the deviation electricity simultaneously. The deviation electricity responsibility determination model was used to clarify the transaction subject's deviated electricity responsibility, and the deviated electric quantity calculation model was used for quantification. At last, the validity and practicability of the method were verified through the analysis of examples using the inter-regional and inter-provincial power transaction data from China.


INTRODUCTION
In 2015, China issued a document titled "Furthering Reform of the Electricity Market" to start a new round of electric power reform. In this new reform, great importance was attached to the price mechanism reform and competition will be gradually introduced into price determination. A scientific and reasonable inter-regional electricity trading price mechanism is conducive to the optimization of energy allocation and sustainable resource management (Song et al., 2019). As an important part, electricity transaction settlement directly affects the market operation. Further, the gradual development of the electric power market has put forward higher requirements for the transaction settlement.
The focus of electricity marketization is to improve efficiency and reduce energy prices for other industries. Energy distribution in China does not match with the power load, which needs to be alleviated through inter-regional and inter-provincial power trading. Inter-regional and inter-provincial power trading in China is usually driven by the provincial government. Due to the homogeneity of electricity, it is impossible to derive the actual electricity of each seller from the total actual on-grid electricity. Besides, due to the loss in the transmission process and the difference between the actual loss and the power loss calculated according to the approved line loss rate, the crossregional and cross-provincial power trading settlement has a deviation. Moreover, for new energy power plants, the fluctuation of clean energy generation tends to bring more deviated quantity than traditional thermal power generation. Therefore, how to deal with the deviated electricity in a standardized way has become an urgent problem to be solved. Different treatment methods will directly affect the settlement quantity. Additionally, the establishment of the assessment rules of the deviation electric quantity will directly affect the economic interests of both parties in the electric power transaction.
The settlement of electricity transactions includes electric quantity settlement and electric fee settlement. The current interregional and inter-provincial electricity transaction settlement in China is completed by the power transaction department. And the settlement amount is the sum of the planned amount and the distributed amount of deviated electricity. The electricity fee settlement is completed by the financial department. The electricity bill to be paid is determined based on the settled electricity quantity and the contract price. Because a realtime market for inter-regional and inter-provincial electricity transactions cannot be established in the short term, real-time balancing transaction cannot be realized. Figuring out how to deal with the deviated electric quantity is the key problem in the design of power trading mechanism in China.
The electric quantity deviation generally refers to the difference between the actual quantity and the contract quantity. In the medium-and long-term power market, many factors can lead to the electric quantity deviation, e.g., the sudden failure of the generator set. However, as for the spot market, the settlement period is shortened to less than an hour, and the electric quantity deviation, also known as the unbalanced quantity, refers to the difference between the planned transaction quantity and the actual generation quantity. The disputes on market construction target, assessment responsibility, and economic benefit caused by settlement deviation have brought great trouble to the trading subject. First, in the power market, the different market participants need to strictly follow the contract. The deviation quantity not only reflects the deviation between the generator and the dispatcher but also makes it difficult to confirm the deviation responsibility of different transaction parties in practice. Second, it is difficult to confirm each subcontract due to the grid structure and dispatching operations. Different off-grid power division schemes will lead to the difference in the current deviation quantity of each contract. And then, the contract settlement amount will change accordingly, which raises the problem of unfairness. Thus, the proper processing of deviation quantity has become one of the most important standards to measure the fairness and justice of the power market. If not handled properly, it will directly affect the economic interests of the participants in the power transaction, and may even have a negative impact on the power market order. In inter-regional power transactions, it is of great significance to reduce the influence of the deviation electric quantity on the participants starting from the settlement scheme, so as to establish a more perfect inter-regional power transaction mechanism.
The processing method of the deviated quantity can be divided into separate settlement and apportionment settlement. The separate settlement is to settle the deviated electricity quantity according to the formulated unified price. While the apportionment settlement is made according to the corresponding electricity price of the transaction type. The deviated electric quantity is allocated to each transaction according to the scheduling plan, contract electric quantity, and verified line loss rate. The difference between them is evident. In general, the operation of separate settlements is relatively simple, but the specific settlement electric quantity of each transaction cannot be measured. In addition, how to set a reasonable and fair uniform price for the deviation electric quantity is also a relatively difficult problem. The apportionment settlement can obtain the electric quantity of the on-grid end and the landing end of each transaction. It has more detailed processing of the deviation electricity, and the differentiated pricing and settlement of the deviation electricity according to the specific situation is more in line with the actual situation. At present, most of the electricity transaction settlements in China adopt the processing method that uses the annual base rather than other components to bear the deviation of electricity. With the advance of the reform of the power market, the annual base quantity of electricity will gradually decrease. At the same time, the market entities of power trading, such as power sales companies, will constantly increase. This promotes the gradual transition of the power market from the single buyer mode to the wholesale competition mode and enables power generation enterprises to conduct bilateral transactions with large power users, power sales companies, and other market members. The existing settlement method of deviation quantity transaction cannot meet the needs of power market reform and a new and more reasonable deviation electricity processing method needs to be proposed. Therefore, this article proposes a settlement method based on kernel density and entropy weight for inter-regional and interprovincial transaction electricity quantity, which is quantified in three steps. First, taking the transaction quantity as the target, we use the kernel density to assign the weight to the transaction type with a large transaction quantity. At the same time, entropy weight is used to describe the volatility of transaction quantity, and the transaction type is given weight from the two dimensions of transaction: volume and volatility. Second, we clarify the responsibility judgment of deviation electric quantity. The responsibility of deviation electric quantity exists between the sending end and the receiving end. The contract electric quantity, actual electric quantity, and power deviation are used to determine to which side the responsibility of deviated electric quantity belongs. Third, we use the line loss rate and network loss rate to quantify the total amount of deviation in the transaction process. Then, the corresponding punishment strategy is set for the responsible party. The above three-step method comprehensively and objectively quantifies the responsibilities of power market participants for the deviated electric quantity. It breaks through the limitations of the existing methods of processing deviations in cross-regional and crossprovincial power transactions. And it provides a standard solution for the determination of deviated electric quantity among different departments.

LITERATURE REVIEW
Electricity deviation refers to the difference between the actual measured electric quantity and the contract quantity. The factors influencing electricity deviation are complex. The reasonable handling of the electricity deviation is important to ensure the fairness and justice of the power trade. The cross-provincial and cross-regional development of the electric power trading market is an important breakthrough of the marketization reform in China. It not only conforms to the national energy development plan but also can realize the surplus and shortage adjustment and supply and demand complementarity, which is of great significance to the optimal allocation of electric power resources.

The Treatment Method of Deviating Electric Quantity
Many scholars have carried out relevant research on the settlement mechanism and the treatment method of deviation electric quantity in the inter-regional and inter-provincial electric power transaction of China. With cross-regional trading mechanism and historical trading data, Li et al. (2016) proposed a deviation electric quantity processing method based on virtual time-of-use price. Zhao et al. (2016) proposed the reference electricity price based on the approved deviation electricity price of regional power generation cost, determined the deviation electricity price through the proposed logic, and finally settled the contract electricity quantity and deviation electricity quantity separately. Ding et al. (2017) proposed a responsibility determination model and pricing method for the deviation of cross-region alternating current (AC) power grid based on the average frequency deviation and constructed the "meter" region diagram for determining the liability for the deviation of the tie line. He et al. (2018) summarized the experience and characteristics of the efficient operation of the typical balanced market by analyzing the operation and transaction settlement mode of the PJM balanced market in northern Europe, the United Kingdom, and the United States. They proposed that the bivalent method should be adopted in the deviation settlement, and the capacity cost should be shared by the market members with deviations. Yan et al. (2019) proposed a deviation quantity treatment method based on fuzzy comprehensive evaluation theory. It uses the analytic hierarchy process (AHP) to set the weight of each index, the type of transaction, and the membership function of the transaction cycle, and finally determines the comprehensive evaluation score of each transaction and allocates the power deviation based on the score. By referring to the deviation assessment mechanism under the British balance mechanism, Ma et al. (2019) proposed the deviation quantity assessment mechanism in the domestic day-ahead market and constructed the profit model of the electricity selling companies. Xu et al. (2019) proposed three settlement methods of cardinal deviation electric quantity, namely, the expected revenue compensation method, the deviation electric quantity replacement matching method, and the average price difference compensation method.

Deviation Electric Quantity Settlement of International Power Market
The research on deviation electric quantity settlement of international power market is more abundant. Zhang and Lo (2009) believed that deviation settlement is highly dependent on the real-time balance of electricity prices and market structure. Van Der Veen and Hakvoort (2009) showed that the power market balance responsibility and deviation settlement rules were different in the Nordic countries. Combined with the deviation settlement mechanism of the Belgian electricity market, De Vos et al. (2010) analyzed the effect of the deviation tolerance system of offshore wind power generation on the promotion of new energy grid connection. Haring et al. (2012) evaluated the impact of different prices on the energy market and deviation settlement under the two conditions of considering and ignoring transmission capacity limits. Haring et al. (2015) pointed out that the cost transparency of deviated electricity settlement in the European power market is insufficient, which may bring arbitrage opportunities and hinder the market integration of renewable energy. Mendes et al. (2016) compared the trading patterns of the UK and Brazilian electricity wholesale markets and pointed out that the deviation settlement design of the UK electricity market can provide a reference for the redesign of deviation settlement in Brazil. Zani and Rossi (2018) applied the node electricity price to the electricity deviation settlement and showed that the node electricity price was an effective method. Kermer (2019) studied the deviation settlement design considering demandside management and thermoelectric combination and found that the deviation settlement design depended on the structure of the market's main body. Bottieau et al. (2020) pointed out that the single deviation pricing mechanism of positive and negative deviation electricity with a single price settlement has become a new mechanism in the European power market, but this mechanism will stimulate market participants to deviate from the plan to restore the balance of the power system, which brings risks.

The Formation Characteristics of the Deviated Electric Quantity
The formation characteristics and corresponding solutions of deviated power from the subdivision of the power industry have also attracted much attention. Generally, the power industry is composed of four sub-industries, including thermal power generation, hydropower generation, photovoltaic power generation, and wind power generation. Chen et al. (2016) believed that the main problems in thermal power systems are power loss and voltage deviation, so a multi-objective enhanced particle swarm optimization (MOEPSO) algorithm is proposed to solve the above problems simultaneously. Compared with traditional thermal power, the proportion of renewable energy to participate in market transactions is increasing in recent years. However, the characteristics of renewable energy, such as high volatility and poor prediction accuracy, lead to the uneven distribution of base electricity among renewable energy power plants and low renewable energy consumption ratio. Therefore, the design of a deviation power model for renewable energy to participate in power market transactions is particularly critical. Moreover, Bo et al. (2019) also demonstrated that the accounting of deviation electricity has a significant impact on the economic benefit evaluation of wind power plants. The design of the deviation power model in the new energy industry generally has two ideas. One design method is to reduce the scale of the formation of deviation electricity in the new energy industry from the source and achieve it through technical and other means. For example, Limsakul et al. (2015) believed that the generator speed deviation caused by the fluctuation of photovoltaic power in the time domain and frequency domain can be indirectly reversed by changing the photovoltaic power, which is found through unit step function analysis. Similarly, Li et al. (2015) believed that with the increase of grid connection of large-scale wind farms, the fluctuation of wind power generation output would not only affect the power flow distribution of the power grid but would also affect the frequency of the power grid. Therefore, a quasisteady state model of synchronous generator, a quasi-steady-state load model of asynchronous wind generator, and a simplified RX 1 model are proposed. Another design method is to make appropriate compensation to the new energy industry the electric power market transaction mechanism. For example, Liu et al. (2017) proposed a renewable energy alternative compensation method. First, the actual power generation of renewable energy power plants is subtracted from the prior contract power generation, and the basic power generation is determined based on the installed capacity of the machine. Then, according to the electricity quantity and electricity price in the market transaction, the comprehensive unit price of the renewable energy power generation settlement is determined, and fewer power plants are economically compensated.
Overall, the existing methods for dealing with deviation electricity have certain limitations, lacking a more mature deviation electricity liability determination mechanism and pricing mechanism. Especially in cross-regional and crossprovince power transactions, there are problems such as the difficulty in determining the quantity of the deviated power and the inconsistency in the processing methods of different departments Therefore, this study will quantify the amount of electric deviation from the perspective of the power market transaction volume and transaction fluctuations, and propose the main accounting method for cross-regional and cross-provincial power transactions based on the idea that all parties involved in the transaction share the deviation electric quantity.

PROPOSED METHOD
At present, electric quantity settlement plays a main part in the inter-regional and inter-provincial electric power transaction settlement in China, which is completed by the electric power transaction department. The accounting of transaction electricity consists of planned electricity quantity and apportioned deviation electricity quantity. Two issues need to be addressed to calculate the deviation electric quantity between transaction entities based on the transaction electric quantity. The first issue is about the transaction volume. If the transaction electric quantity is larger, the loss rate of the power line in the transaction process will be higher, thus the deviation power quantity (Wang et al., 2003;Gao and Song, 2012). The second issue is about the volatility of transaction volume. The greater the fluctuation of transaction electric quantity with time, the greater the inter-provincial and inter-regional power dispatching coordination cost, and thus the more the deviated power that should be borne (Shang et al., 2014). Therefore, based on the transaction electric quantity, this article considers the influence of the trading volume and the volatility of trading volume on the calculation of deviation electric quantity allocation.
The electricity market in China is divided into three regions: State Grid, Southern Power Grid, and West Mongolia Grid. And the power trade in each region can be divided into intra-provincial and inter-provincial transactions. Since the current electricity market transactions in China are mainly mid-and long-term transactions and spot transactions, intra-provincial electricity transactions can be subdivided into four categories: direct electricity transactions, power generation rights transactions, pumped storage transactions, and other transactions. Similarly, the inter-provincial electricity transactions can be subdivided into three types: inter-provincial direct electricity transactions, inter-provincial outbound transactions (network-to-point, network-to-network), and interprovincial power generation rights transactions. To study the characteristics of inter-regional and inter-provincial transactions of different transaction types, this article adopted the AHP framework to calculate the weights of different transaction types and different regions, respectively, and then quantify the amount of deviated electricity allocated by corresponding transaction entities.

Calculation of Transaction Type Weight
The weight analysis can adopt the methods of objective weighting, subjective weighting, or mixed weighting. From the mathematical perspective, kernel function weighting method, and entropy weighting method belong to the category of objective weighting method. How to assign different weights to different transaction types in the power market is the focus of this section.
If the transaction quantity of a certain transaction type i within time T is X iT , we use linear kernel function f (X iT ) to weight transaction type i, that is, X it , and f (X iT ) represents the total transaction volume of the transaction type i within the time T. This method is intuitive, but it ignores the influence of other transaction types on the weight W i . Therefore, we have made the following corrections f (X iT ).
It can be seen that the redefined w i reflects the transaction volume proportion of different transaction types i in time T. The proportion of transaction volume reflects the degree of negative line loss of this transaction type. The greater the degree of loss, the greater the amount of deviation generated. In addition, due to the limitations of electric dispatching cost and the default conditions of the electricity contract, the deviation electric quantity will be larger if the volatility of transaction electric quantity is greater. The following will focus on how to assign weights to different transaction types according to the volatility of transaction electric quantity. We adopted the improved entropy weight method. The calculation steps were as follows: Step 1: Establish panel data for different transaction types of intra-provincial and inter-provincial transactions: In the above equation, i denotes the transaction type (i = 1, ..., n). t denotes the trading time point (t = 1, ..., T). And superscriptkindicates whether x it is an intra-provincial transaction or an inter-provincial transaction.
Step 2: Normalization. Due to differences in regions, transaction types, and transaction time, the transaction volume of electricity at each transaction time point fluctuates greatly. So non-dimensional processing is required. The specific expression is as follows: In the above formula, x k max and x k min denote the maximum and minimum trading volumes in period T, respectively.
Step 3: Calculate information entropy. Based on the standardized processing of transaction electric quantity, we calculate the information entropy according to the following formula: Information entropy is a description of the degree of uncertainty. f it denotes the proportion of the normalized electric quantityx k it of transaction type i in the form of intra-province transaction or inter-province transaction. It measures the possibility of transaction type i, which is essentially a representation of probability. And f it ln f it indirectly reflects the volatility of the probability of transaction type i, which is essentially a description of variance. Therefore, with a minus sign, H i describes the degree of inverse fluctuation of transaction type i based on trading quantityx k it in period T. There may be some statistical problems in the actual calculation of H i . Therefore, this article made the following assumptions: ifx k it = 0, then f it = 0, and f it ln f it = 0.
Step 4: Calculate the entropy weight. Generally, when the traditional entropy weight method is used to calculate the entropy weight ω i , the standardized processing method is adopted, as is shown in the following formula: Olendski (2016) and Kasolis and Clemens (2020) have shown that, when the entropy value is in a certain range, the slight difference in the entropy value may cause the entropy weight to change exponentially, which is inconsistent with the information conveyed by the entropy value. To avoid this problem, the improved entropy weight method is used to calculate the objective weight value of the ith transaction type: H i reflects the degree of reverse uncertainty of all transaction types.
n i=1 H i + 1 − 2H i measures the reverse volatility level of the remaining transaction types after removing the uncertainty degree of the transaction type i. The greater the inverse volatility of the transaction type i, the larger the value of −2H i will be, and thus the proportion of the transaction type i.
To sum up, this section, first, use the kernel function weighting method to calculate the weight of different transaction types based on the transaction volume. And then, use the improved entropy weight method to calculate the weight of different transaction types that reflect the volatility of transaction volume. If the above two dimensions are considered at the same time, the comprehensive weight is constructed as follows: Where α reflects the importance of the power transaction volume to the allocation of deviated electric quantity. Correspondingly, 1−α reflects the degree of influence of the volatility of transaction volume on the deviated electric quantity, which also reflects the composition of the comprehensive weight.

Calculation of Inter-provincial and Inter-regional Weights
Since the electricity market in China is divided into three regions: State Grid, Southern Power Grid and West Mongolia. Each region involves intra-provincial and inter-provincial transactions. After quantifying the transaction type weight, the next step is to calculate the weight of each region according to the transaction quantity.
Similarly, according to the transaction quantity, the linear kernel function is used to assign weights to the transaction time point of a certain area in a period of time, so as to reflect the transaction quantity of the area at that time point. And the improved entropy weight method is used to measure the characteristics of the volatility of transaction quantity in different regions.

Deviation Electricity Responsibility Judgment Model
Another core issue of establishing a reasonable settlement mechanism for inter-regional electricity trading is the allocation of deviation electricity. There are usually two ways to clarify the electric deviation responsibility of the two parties in an electricity transaction. One is based on rigorous theoretical calculations, such as the power flow tracking algorithm, which can intuitively describe the physical direction of the actual power grid flow and calculate the actual deviation electricity quantity of transaction parties at each time period (Huang et al., 2018;Zhang H. et al., 2019). This method can also ensure the accuracy and fairness of the calculation results. However, the calculation process is complicated and the amount of calculation is too large. Thus, it is not practical to use this method to settle the electricity quantity of grid transactions, and the responsible party of the deviated electricity quantity cannot be determined in this way either. The other method is based on the actual electricity trading market data. The deviation electricity price in the inter-regional electricity transaction is settled according to the original contract price without distinction, or allocated according to a certain proportion, or through a certain weighted average pricing (Wen et al., 2008;Zhang, 2008;Zhao et al., 2009). Although this method is simple and easy to use, it is unfair and lacks a rigorous scientific basis. In addition, the planned value of the next month is adjusted in a rolling way according to the current deviated electric quantity with more refunds and less compensations, which is not necessarily beneficial to the damaged party of the deviated electric quantity.
To sum up, the above two methods of determining the liability of deviated electric quantity adopt different ways and different perspectives to allocate the deviated electric quantity. But neither of them puts forward a clear criterion and method for determining the responsibility of deviated electric quantity. The trans-regional transmission in China is generally characterized by long-distance and large capacity. According to the power transaction settlement data of the state grid, the daily deviation of trans-regional ultrahigh voltage (UHV) power transmission can reach 4% of the planned electricity, which is a large amount. Therefore, it is urgent to establish a settlement mechanism based on the responsibility identification of the cross-region power grid deviation quantity. Therefore, this section will put forward the responsibility determination model of the cross-region power grid deviation quantity.
The responsibility determination of deviation power mainly revolves around the differentiation between the power grids at the receiving end. Two sub-regions A and B in the cross-region power system are set. The power sent from region A to B via the cross-region link line is P AB , and P AB = −P BA . Each trading day is divided into N periods of responsibility, and the duration of each period is T n . From the power grid dispatch center dispatch management system (OMS), the contract electric quantity W ABn and the actual electric quantity G ABn at the gateway of A and B, and in time period n in the trading day are obtained, as well as the record data of frequency change curve, which can be calculated as follows: where W ABn , P ABn , f t , and f n are cross-region transmission deviation of the period of time period n, the quantity, the average deviation of power, the instantaneous value of frequency and the average deviation of frequency, respectively. Especially, for f n , 50 is the average value of instantaneous frequency between time 0 and T n (Ding et al., 2017).
The area control deviation λ n of area A and B in the calculation period n is, Where K is the system power/frequency equivalent factor, which is called power frequency equivalent in short. According to the principle of controlling power frequency deviation of grid frequency tie line, under ideal operation state, when the power network load changes, automatic generation control of units in the region should be carried out through the dispatching center of the sending and receiving regions, respectively, so as to maintain the power balance in the region, that is, λ n = 0. If the dispatching at the sending end or the receiving end and the output regulation of the generator set are delayed or deviated, which implies that f n = 0and P ABn = 0, the corresponding end be responsible for the deviation. And the criteria for identifying the self-recognizing party of deviation electricity are proposed: (a) When f n > 0, P ABn > 0 or f n < 0, P ABn < 0, the sending end shall be responsible for the electric deviation. When f n > 0, P ABn < 0or f n < 0, P ABn > 0, the receiving end shall be responsible for the electric deviation. (b) When | P ABn | < K f n , the degree of responsibility is for a lighter level, when | P ABn | > K f n , the degree of responsibility is for the heavier grades. (c) When f n = 0, no judgment on the responsibility for the electric deviation will be made, or the sending and receiving ends are equally responsible.

Deviation Electricity Accounting Model
After clarifying the responsibility of deviation quantity of both parties in power transactions, it is necessary to quantify the total deviation quantity in the transaction process. The calculation of deviation quantity can be further divided into information deviation calculation and energy deviation calculation. Information deviation accounting refers to the process in which the trading center takes punitive measures against the market subject according to the degree of deviation, for there is a difference between the output/load curve approved by the dispatching agency and the output/load value actually measured by the market subject and the difference has exceeded the permissible range. The measure can be economic measures, such as the deviation degree according to the hierarchical fines, etc. And it can also be assessment measures, such as classifying the credit rating of the subject according to the degree of deviation and reducing the proportion of the transaction of the credit subject in the next cycle. The deviation rate β i is the core to determine the trading main body i. Based on the deviation rate of trading subject i, the penalty f (β i ) under different deviation levels is set. f (β i ) is a dispersion function related to β i . Energy deviation accounting refers to the calculation of the actual measurement quantity of the trading subject and the deviation quantity of the agreed electricity quantity and the dispatching plan. It is the total deviation quantity shared by the trading subject i in each power market. The specific form of deviation electric quantity Q d i is, In the above formula, f (β i ) is the information deviation accounting, and W i Q 2,i is the energy deviation accounting. To further discuss the composition of the total deviated electric quantity, it is assumed that Q 1,i is the agreement quantity of market subject i, Q 2,i is the total deviated electric quantity of market subject i in each market, and Q 3,i is the actual measurement quantity of gateway data for the market subject i. Since the deviation of the measurement of electricity can be calculated by line loss rate and grid loss rate, the total deviation Q 2,i of the subject i in each market power calculation is as follows: where the η i is the line loss rate of trade type i, Q r i is the displayed electric measured quantity, and the η s i is the integrated network loss rate. The deviation rate β can be calculated by the total deviation quantity Q 2,i of the market agent i and the agreement quantity Q 1,i of the market agent i: The degree of deviation and the penalty for the responsible party are expressed by the function f (β). The greater the number of grades of deviation rate, the easier it is to accurately determine the liability for deviation. This section takes the classification of five grades of deviation e.g., to analyze. f (β) is a dispersion function related to and is divided into five deviation levels according to different deviation rates β, which are related to the performance of trading subjects in the previous three transaction periods. Each deviation level corresponds to a penalty gold function. The mathematical expression is, where the coefficients a, b, c, and d are the basic fines for different deviation grades, respectively. In particular, a < b < c < d, which indicate that the higher the deviation rate is, the higher the level of base penalty is correspondingly. The penalty for subject i is determined by the deviation rate β i and the adjustment factor µ. The grade of deviation is divided into five ranges from β 1 to β 4 . µ is the adjustment coefficient, which is used to adjust the punishment according to the supply and demand. When the supply is tight, the value of µ will be increased, and when the market is surplus, the value of µ will be reduced.

Example Data
To calculate the transaction type weight and the inter-provincial and inter-regional weight, this section selects the transaction type and inter-regional and inter-provincial transaction power data from the Electric Power Industry Statistics of China Electricity Council from July 2019 to December 2019 as the source of the calculation example data. The relevant data are summarized in Tables 1, 2.

Calculation of Weights
Using the calculation method and based on the transaction quantity data in Table 1, the kernel density weight and improved entropy weight of different transaction types within and outside the province were obtained, respectively. From the data distribution, the kernel density weight focused on the volume of transacted electric quantity, while the improved entropy weight focused on the fluctuation of transacted electric quantity, which is in line with the theoretical expectation. Where the kernel density weight and improved entropy weight of the four transaction types in the province are (0.8557, 0.1319, 0.0081, 0.0042) and  0.1981, 0.2011, 0.3024, 0.2984), and the kernel density weight and improved entropy weight of the three transaction types in the province are (0.3313, 0.6019, 0.0668) and (0.2075, 0.1950, 0.5975), respectively. Based on the transaction quantity data in Table 2, the kernel density weight and improved entropy weight of the three regions can be obtained as: (0.7549, 0.1847, 0.0604) and (0.1998, 0.2004, 0.5998). On this basis, if the importance level α of the amount of electric transaction to the allocation of the deviation power is determined, then the allocation ratio of the four types of transactions in the province, the three types of transactions between the provinces, and the deviation of the three regions are determined accordingly. The specific calculation process is shown in Table 3.

Contribution of Deviation Quantity
To allocate the deviated electricity quantity properly, we should first clarify the responsibility of the two sides of the electricity transaction, and then quantify the total deviated electricity quantity in the transaction process. Taking a 1,000 kV AC UHV test demonstration project to send power to Central China as an example for analysis, the existing UHV cross-regional power transaction method is organized by the State Grid Corporation of China, and the transaction centers at all levels cooperate. The power grid companies and local government departments of the purchase and sale of electricity determine the electricity and electricity prices through bilateral negotiations, and sign a medium and long-term framework agreement. Therefore, it can be determined that the transaction belongs to the direct electricity transaction type in the intra-provincial transaction of the State Grid area. Based on the framework agreement, both the sending and receiving parties sign the annual contract for the next year through negotiation at the end of each year according to the agreement and the real-time power supply and demand situation. The annual contract plan electricity is broken down to the month, and the monthly deviation electricity is apportioned to the receiving end provinces. The electricity price is the same as the contract electricity and settled on a monthly basis. Because there is no responsibility assessment mechanism for the deviation quantity in the inter-regional transaction settlement, and there is no binding force for the fairness maintenance and execution of the transaction contract between the sending and receiving parties, it is not reasonable to allocate the deviation quantity to the receiving provinces in proportion.
According to the power transaction settlement management method of the State Grid Corporation, the current domestic cross-regional and cross-provincial connection line gateway electricity is measured once every 15 min in the United States, and the transmission plan is also formulated in units of 15 min. Therefore, the time period T n = 15min for deviation electricity metering is appropriate. In November of a year, the measured data at the gateway of receiving end power network are: contract (receiving end) 4,287.88 GW·h, and actual receiving end 4,256.55 GW·h. The difference between the contract electric quantity and the actual electric quantity can be calculated, so W ABn is −31.33 GW·h. Then we can figure out that the average deviation power P ABn equals to −125.32 GW according to the formula P ABn = W ABn /T n . In this example, we assume that the system power-frequency equivalent coefficient K is 1,650 MW/Hz. The frequency instantaneous value f t is a fixed value in the unit T n , which is set as 2,199.75 Hz in this example. By integrating the instantaneous frequency value f t and averaging it, we can obtain that f n is 96.65 Hz. So K f n is 159.47 GW. By the deviation of power liability judgment model of decision rule, when f n > 0, P ABn < 0 or f n < 0, P ABn > 0, the deviation power responsibility should be taken by the receiving side. Therefore, in this case, the receiving side should be responsible for the deviation of electricity, and because | P ABn | < |K f n |, the degree of responsibility is of a lighter level. In this example, the comprehensive line loss rate of the crossregion UHV tie line is 1.52%, and the comprehensive network loss rate is 1.38%. From this, the deviation power Q 2 is calculated to be 24.89 GW·h, and the corresponding deviation rate β is 0.058%. Since the β here is relatively low, which lies in the first range of deviation rate, we have f (β) = 0. Therefore, the receiving side of the deviation power is not affected by the penalty factor. The transaction belongs to the direct electricity transaction type in the intra-provincial transaction of the State Grid region. If the importance level of the amount of electricity transaction to the distribution of the deviation power is set to 0.5, then the corresponding weight is 0.5269 accordingly. Therefore, it can be determined that the deviation electric quantity assumed by both parties in the direct transaction within the province of the State Grid region is 13.11 GW·h.

CONCLUSIONS
China is gradually deepening the reform of electricity marketization. With the deepening of the degree of marketization, the demand for large-scale cross-regional electric power transmission and energy consumption becomes more urgent (Zhang D. et al., 2019). And thus, the processing requirements of deviation electric quantity in transaction settlement are also increasing. At present, the way to deal with the deviation electric quantity in the electricity settlement business is still under exploration. According to the idea that all participants in the transaction share the deviation electric quantity, this article quantifies the deviation electric quantity from the perspective of the transaction volume and transaction fluctuation degree of the electricity market and proposes the calculation method of the deviation electric quantity in the interregional and inter-provincial electricity transaction. And this article also establishes the responsibility judgment mechanism and pricing mechanism of electric quantity deviation to deal with the problem of electric quantity deviation sharing among different departments, which a new idea for quantifying the deviation electric quantity.
To be more specific, this article proposes a method for calculating the apportionment ratio of the deviation electric quantity of the four types of transactions within the province, the three types of transactions between the provinces and the three regions, and then constructs a comprehensive weight calculation method. On this basis, this article then adopts the deviation electricity responsibility judgment model and the deviation electricity accounting model, respectively, to clarify the deviation electricity responsibility and the specific deviation electricity that should be undertaken by the transaction subjects. From this perspective, this article expands and enriches the measurement methods of deviation electric quantity to a certain extent, which has strong practical value in actual work. In addition, this article makes an example analysis using the transaction data of the China Electric Power Industry, inter-regional and inter-provincial transaction electric quantity data, and the specific contract electric quantity transaction data, which proves the effectiveness and practicability of the proposed method. However, this method is mainly aimed at the initial stage of the power market in China. With the continuous promotion of the power market, the treatment method of deviation electric quantity will be improved and optimized in combination with the construction progress of the power market.

DATA AVAILABILITY STATEMENT
The raw data supporting the conclusions of this article will be made available by the authors, without undue reservation.

AUTHOR CONTRIBUTIONS
Conceptualization, methodology, and writing-original draft were contributed by DW and WD. Software, data curation, and writing-review and editing were contributed by FG. Conceptualization, methodology, writing-original draft, writing-review and editing, and supervision were contributed by YX and QM. All authors have read and agreed to the published version of the manuscript.