Reliable energy scheduling method based on BC-PAEKS for intelligent power grid island state micro-grid
By using the BC-PAEKS algorithm and consortium chain technology in the island microgrid, combined with public and private keys and hash functions, the problem of failing to take into account data confidentiality and utility in the existing technology is solved, and the reliability of energy dispatch is achieved. and security, suitable for resource-constrained smart meter environments.
Patent Information
- Application Number
- CN202410632821.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-21
- Publication Date
- 2024-09-03
AI Technical Summary
The existing energy dispatching method in the island microgrid fails to effectively consider the demand level of the energy demander and the supply reliability of the energy supplier. Moreover, encryption strategies based on cryptography have high resource requirements and cannot be deployed on smart meters, resulting in It is difficult to balance data confidentiality and utility.
Using lightweight cryptography algorithms and consortium chain technology based on BC-PAEKS to generate public and private keys, hash functions and trapdoors to ensure the confidentiality and effectiveness of data in the forwarding process, and based on energy demand and supply reliability Schedule.
It achieves both data confidentiality and utility on resource-constrained smart meters, ensures the reliability and security of energy dispatch, and improves the robustness and efficiency of the system.
Smart Images

Figure HDA0004850781860000021 
Figure FDA0004850781840000023 
Figure BDA0004850781850000105
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of smart grid technology, and specifically relates to a reliable energy dispatching method based on BC-PAEKS in an isolated microgrid of a smart grid. Energy dispatching is performed by considering the energy demand of energy demanders and the supply reliability of energy suppliers while ensuring the security of data transmission. Background Art
[0002] Traditional power grids are facing increasingly complex and diverse challenges, and smart grids have emerged. As a subnet of the smart grid, microgrids include users (supply and demand), local controllers (LCs) and microgrid control centers (MGCCs). They are important structures for realizing the core functions of smart grids, such as fault isolation, self-healing, and renewable energy storage. Under normal circumstances, microgrids are connected and operate normally. After encountering natural disasters or attacks, microgrids operate in an isolated state and no longer interact with other microgrids and the main grid. MGCC is the control center of the microgrid. When the microgrid enters the island state, MGCC makes overall decisions to ensure the smooth operation of the microgrid. Users are all equipped with smart meters (SMs). As a key component of the Advanced Metering Infrastructure (AMI) in the microgrid, they are responsible for measurement, perception, and mutual communication. They are used to send information such as user electricity demand and power supply capacity as the basis for MGCC to conduct energy scheduling, energy auctions, and intelligent decision-making. Among them, energy scheduling can effectively manage the production, storage and distribution of various forms of energy to meet the growing energy demand, and plays a key role in ensuring the balance of energy supply and demand and the stable operation of the system.
[0003] The existing energy dispatching methods in some isolated microgrids only consider economic benefits, power generation costs, etc., but do not consider energy reliability, including the energy demand level of energy demanders and the reliability of energy supply by energy suppliers. In fact, different types of energy have different supply stability, and the energy demand level of energy demanders is also different. It should support users to select the type of energy they want to be supplied according to supply stability when initiating energy requests, and supply the corresponding energy to them according to the user's choice and the degree of their energy demand, so as to realize reliable energy dispatching according to energy type classification and give play to the role of energy reliability in energy dispatching. At the same time, considering that MGCC is the only control center in the microgrid, if all power requests are concentrated on one server for processing, once a single point failure occurs, the entire energy dispatching will be paralyzed. In order to improve the robustness of reliable energy dispatching, MGCC should dispatch traditional energy, energy storage and new energy on three different servers: traditional energy server ServerT, energy storage server ServerS and new energy server ServerN according to energy classification. In addition, since smart meters are exposed to an open network environment and interconnected through an open network, they are vulnerable to data integrity attacks, which may cause the scheduling data transmitted by smart meters to be tampered, deleted or forged, thereby affecting the normal scheduling of energy. Therefore, it is not enough to only consider the data utility of energy reliability without considering the security of data. Existing research mainly uses cryptography-based methods to ensure the security of smart meters in advanced measurement systems, thereby ensuring the security of data in smart meters. However, if these methods are combined with reliable energy scheduling, although the confidentiality of data can be guaranteed, the information is encrypted when it is sent and can only be decrypted after reaching the MGCC. The forwarding nodes on the forwarding path (mostly forwarding smart meters and a small number of local controllers) cannot obtain any useful information related to the type of energy, which limits the effectiveness of their data. Therefore, the existing reliable energy scheduling method cannot take into account both data confidentiality and utility at the forwarding node. In addition, the existing cryptography-based encryption strategies to ensure the security of smart meter data are mainly based on advanced cryptographic operations such as bilinear mapping and elliptic curves, which have high requirements for computing resources and storage resources. However, the resources of smart meters are limited, and complex encryption strategies cannot be deployed on smart meters. Therefore, it is necessary to propose a lightweight energy scheduling method that takes into account both data utility and confidentiality, and considers energy reliability (the degree of energy demand from energy demanders and the reliability of energy supply from energy suppliers).
[0004] In summary, the key to solving the above problems is to use a lightweight cryptographic algorithm to achieve both data confidentiality and utility in the forwarding node, and to consider the energy demand of the energy demanders and the reliability of the energy supply of the energy suppliers to perform energy scheduling.
[0005] To achieve the above purpose, the technical solution adopted by the present invention is:
[0006] A reliable energy dispatching method based on BC-PAEKS in an islanded microgrid of a smart grid comprises the following steps:
[0007] (1) System initialization:
[0008] Determine that the energy type is represented as type and type∈{1,2,3}, where 1 represents traditional energy, 2 represents energy storage, and 3 represents new energy; the traditional energy server is represented as ServerT, the energy storage server is represented as ServerS, and the new energy server is represented as ServerN. Traditional energy, energy storage, and new energy are scheduled in these three different servers respectively; determine the number of energy demand parties participating in the energy scheduling of this cycle as A num , the number of energy suppliers is P num , the energy demand side is represented as Sender i ,i=1,2,3...,A num , the energy supplier is represented by Sender j ,j=1,2,3...,P num ; Each scheduling initiator Sender k ,k=1,2,…,A num +P num , both energy demanders and energy suppliers have deployed smart metersSM k , S.M. k Registration is required when joining the grid communication network for the first time. The microgrid central controller MGCC assigns a weight w to each user according to their importance. k ≥0,k=1,2,…,A num +P num , w k The larger it is, the more important the user is;
[0009] (2) Determine the degree of energy demand and supply reliability:
[0010] (2-1) For each energy demander Sender i , for each energy type type,type∈{1,2,3}, determine the required energy quantity U itype ; For each energy supplier Sender j , according to the energy type type,type∈{1,2,3} it can supply, determine the amount of energy it can supply as D jtype ;
[0011] (2-2) For each energy demander Senderi , MGCC according to its weight w i ≥0,i=1,2,…,A num Determine the degree of traditional energy demand N corresponding to the energy type type, type∈{1,2,3} i1 ≥0, energy storage demand level N i2 ≥0 and the degree of new energy demand N i3 ≥0, and N i1 >>N i2 >>N i3 , w i The larger the value, the more important the demand side is. The energy demand level N itype The larger it is, the more priority the demand side has in getting energy;
[0012] (2-3) For each energy supplier Sender j MGCC is based on the amount of energy it can supply D jtype Determine the reliability of traditional energy supply R corresponding to the energy type type, type∈{1,2,3} j1 ≥0, energy storage supply reliability R j2 ≥0 and reliability of new energy supply R j3 ≥0, the amount of energy that can be supplied D jtype The larger the supply reliability R jtype The larger it is, the more priority the supplier has for energy supply;
[0013] (3) MGCC generates public parameters:
[0014] (3-1) MGCC selects the bilinear mapping parameters (G0, G T ,g,p,e), where G0 represents the cyclic group of the bilinear map, g is its generator, G T is also a cyclic group, G0, G T The order of is a prime number p, and e is from G0×G0→G T A bilinear map of ;
[0015] (3-2)MGCC sets the keyword spaceKeyword space ={tranditional,storage,new}, where there are three keywords kw1=tranditional,kw2=storage,kw3=new, representing traditional energy, energy storage and new energy respectively;
[0016] (3-3)MGCC generates identities for different roles and represents them as IDs. Includes the ID of the scheduling initiator Sk ,k=1,2,…,Anum +P num The IDs of the three servers Rtype , type∈{1,2,3}, corresponding to traditional energy, energy storage, and new energy, that is, the identity of the server ServerT is ID R1 , the server ServerS's identity is ID R2 And the identity of server ServerN is ID R3 , all IDs constitute the identity space ID space ;
[0017] (3-4)MGCC selects three hash functions: H1:{0,1} * →G0,H2:ID→G0,H3:G T →{0,1} * , where {0,1} * Represents a string of 0 or 1 bits of any position;
[0018] (3-5) MGCC selects random numbers Return the master key MSK = α, where α is a random number selected from the real number range [1, p-1], and generate the public parameter PP and the global parameter GSP, as shown in formula (1):
[0019]
[0020] (4) MGCC generates public and private keys:
[0021] (4-1) For each energy type type, type∈{1,2,3} corresponding to the server ServerT, ServerS and ServerN, MGCC uses its identity ID Rtype , type∈{1,2,3} calculates H2(ID Rtype ) α And distribute it to ServerT, ServerS and ServerN, and ServerT, ServerS and ServerN will each choose a random number Generate its public key PK Rtype With private key SK Rtype , as shown in formula (2):
[0022]
[0023] (4-2) For each scheduling initiator Sender k MGCC calculates H2(ID Sk ) α And distribute it to it, Sender kChoose another random number Generate its public key PK Sk With private key SK Sk , as shown in formula (3):
[0024]
[0025] (5) Data collection, encryption and transmission:
[0026] (5-1) For each energy demander Sender i , for each energy type type,type∈{1,2,3}, collect the energy demand level N itype And the amount of energy required U itype Generate the required array Need itype =[N itype ,U itype ] and its identity ID Si Composition scheduling data m itype ; For each energy supplier Sender j , for the energy type type,type∈{1,2,3} it can supply, the supply reliability is R jtype And the amount of energy that can be supplied is D jtype Generate supply arraySend jtype =[R jtype ,D jtype ] and its identity ID Sj Composition scheduling data m jtype ;
[0027] (5-2) Each scheduling initiator Sender k For each energy type type,type∈{1,2,3} that it needs or can provide, select a random number k∈(1,2,3,...,P num +A num ),calculate
[0028] K type =e(H2(ID Sk ) α ,H2(ID Rtype )); (4)
[0029] Then, Sender k According to PP,PK Sk ,PK Rtype ,SK Sk ,kw type ,K type Generate ciphertext As shown in formula (5):
[0030]
[0031] Finally, Sender k Using PK according to RSA algorithm Rtype Encrypted scheduling data m ktype Get Encrpted(PK Rtype ,m ktype ), and with Combine to get C ktype ,Right now
[0032] (5-3)Sender k C ktype By forwarding node T node Perform searchable matching operations, T node For Sender k Forwarding nodes, including smart meters and local controllers;
[0033] (6) Server generates a trapdoor:
[0034] (6-1) ServerT, ServerS and ServerN according to PP,PK Sk ,PK Rtype ,SK Rtype ,kw type ',K type 'Generate a trapdoor K type 'Random numbers are selected by ServerT, ServerS and ServerN And calculate, K type The value of ' is shown in formula (6):
[0035] K type '=e(H2(ID Sk ),H2(ID Rtype ) α ); (6)
[0036] Finally, ServerT, ServerS, and ServerN generate trapdoors As shown in formula (7):
[0037]
[0038] (6-2) ServerT, ServerS, and ServerN will generate Send to Sender k The forwarding node T node , including all Senderk and the local controller, T node Will Add to its trapdoor set T c middle, That is, all users’ corresponding trapdoors for different energy sources are generated and handed over to the forwarding node T node ;
[0039] Since the trapdoor that MGCC gives to each local controller or scheduling initiator in each cycle is fixed, MGCC only gives each forwarding node T node Send a trapdoor At the same time, the Keywords included in the GSP in step 3 space 、ID space , the public and private keys of all scheduling initiators and servers in step 4 and the trapdoor in step 6 are initialized only once, while the remaining steps 1, 2, 5 and steps 7 to 9 are performed every cycle; when the number of keywords is adjusted, MGCC can update the Keyword in GSP space ,MGCC synchronously updates the trapdoors generated by each user;
[0040] (7) Match forwarding:
[0041] (7-1) When the forwarding node T node When receiving a ciphertext and a matching request is required, With T node The trapdoor set in Sent to the alliance chain module, for T c In The alliance chain verifies the matching formula (8) in turn:
[0042]
[0043] (7-2) If kw type =kw type 'Then the matching formula (8) is established. The specific derivation process of alliance chain verification based on hyperbolic mapping operation is shown in formula (9):
[0044]
[0045] According to the hyperbolic mapping operation rules, K type With K type The corresponding relationship of ' is shown in formula (10):
[0046]
[0047] (7-3) If and T wk1 The match is successful, and the alliance chain outputs 1 to the forwarding node Tnode , indicating that the match is successful; otherwise, the alliance chain continues to repeat this step to With T c The rest of T wktype ,Right now and Match until the output result is 1, indicating a successful match, or all T wktype If the matching is completed and no 1 is output, it means The keyword specified by the three servers in MGCC is not included. At this time, the alliance chain outputs 0 to the forwarding node T node , indicating that the matching fails; from formula (5) With formula (7)T wktype From the definition of node Unable to decrypt the matching process With T wktype , can only execute the matching formula in formula (8), which takes into account the confidentiality and utility of data;
[0048] (7-4) If the match is successful and T node If it is not the local controller but other meters, the data will be forwarded until it is forwarded to the local controller for matching; if the match is successful and T node It is the local controller, and the local controller sends Encrpted(PK Rtype ,m ktype ) to the server of the corresponding type in MGCC;
[0049] (8) Data decryption and energy scheduling:
[0050] (8-1) Each energy type type, type∈{1,2,3} corresponding to the server ServerT, ServerS and ServerN receives Encrpted(PK Rtype ,m ktype ) data, use SK Rtype Decrypt to get the energy demand side Sender i The need array Need itype =[N itype ,U itype ]、Energy supplier Sender j Supply array Send jtype =[R jtype ,D jtype ];
[0051] (8-2) ServerT, ServerS and ServerN initialize the energy supply matrix X type All elements of X are 0, type As shown in formula (11)
[0052]
[0053] The matrix X type The rows represent energy suppliers, the columns represent energy demanders, and a ji Energy supplier Sender j Sender i How much energy is supplied to a certain energy supplier Sender j For the row, the sum of all elements in the row is the energy supplier Sender j All the energy supplied to a certain energy demander Sender i For the column, the sum of all elements in the column is the energy demand side Sender i All the energy obtained;
[0054] (8-3) Different servers sort the corresponding demand queues according to type needtype Sorted with supply queue sendtype Set it as an empty queue; then set the energy demand of all energy demand parties separately itype =[N itype ,U itype ]Data according to N itype Fill the sorted queue in descending order needtype and energy supply from energy suppliers jtype =[R jtype ,D jtype ]Data according to R jtype Fill the supply queue in descending order Sorted sendtype Chinese; Sorted needtype The demand side at the head of the queue is the one with the highest energy demand. sendtype The supplier at the head of the queue is the supplier with the highest supply reliability;
[0055] (8-4) Energy scheduling based on the greedy algorithm. The specific method is: needtype For a queue, the demand side at the head of the queue is sorted sendtype Get energy from the supplier at the head of the queue. If the current Sorted needtype The demand energy of the demand side at the head of the queue is greater than that of the Sorted sendtype The supply energy of the supplier at the head of the queue, the demander first obtains the current energy of the supplier and sendtype Get energy from the next energy supplier in the queue until the energy demand is met; if the current Sorted needtypeThe demand energy of the demand side at the head of the queue is less than that of the Sorted sendtype The energy supply of the supplier at the head of the queue is met, and the energy demand of the current demander is met. The next energy demander continues to obtain energy from the supplier at the head of the current queue. needtype The demand energy of the demand side at the head of the queue is equal to Sorted sendtype The supply energy of the supplier at the head of the queue, then the energy demand of the current demander is met, and the energy supply demand of the current supplier is met, Sorted needtype The first party becomes the next energy demander of the satisfied demander, that is, the demander with a smaller demand than the first demander. sendtype The first supplier becomes the next energy supplier of the satisfied supplier, that is, the supplier with a lower supply reliability than the first supplier;
[0056] (8-5) After energy scheduling based on the greedy algorithm in (8-4), the energy supply matrix X is finally obtained type Each a ji The specific value of
[0057] (9) MGCC performs energy feedback:
[0058] MGCC is based on the energy dispatch result matrix X type Each energy demand side Sender i The energy obtained from different energy suppliers and the Sender of each energy supplier j The energy supplied to different energy demanders is fed back to each energy demander and energy supplier accordingly, and the energy scheduling of this cycle ends.
[0059] This scheduling method runs in cycles.
[0060] First, determine the energy demand side Sender i ,i=1,2,3...,A num Energy demand for different energy sources N i1 , N i2 , N i3 and energy supplier Sender j ,j=1,2,3...,P num Supply reliability R j1 , R j2 , R j3 ; Then, each energy dispatcher Sender k ,k=1,2,…,A num +P numGenerate a demand array or a supply array, and encrypt the array and energy type information using RSA and BC-PAEKS algorithms respectively, and forward them to different types of scheduling servers ServerT, ServerS, and ServerN in MGCC via forwarding nodes. Finally, MGCC performs energy scheduling and feeds back the results to each energy dispatcher. The BC-PAEKS method adopted in the present invention can ensure that the smart meter or local controller responsible for forwarding cannot obtain any encrypted scheduling data except the matching results from the forwarding process, because the data after successful matching is encrypted using the public keys of different servers of MGCC, and only the corresponding server can use its private key for decryption. This can prevent potential data integrity attacks through forwarding smart meters or local controllers while maintaining data confidentiality and utility. In addition, considering the limited resources of smart meters, the alliance chain module is introduced and deployed in the forwarding node. The forwarding node only needs to send the searchable ciphertext to the alliance chain module and receive the return result.
[0061] Therefore, the present invention has the following advantages:
[0062] In terms of data utility, the method of the present invention takes into account the reliability of energy, proposes the degree of energy demand and the degree of supply reliability, and performs energy scheduling based on the degree of energy demand and the degree of supply reliability;
[0063] In terms of lightweight and balanced data confidentiality and utility, the method of the present invention adopts the BC-PAEKS algorithm and alliance chain technology, so that nodes on the forwarding path can forward information according to the energy type in the ciphertext state to ensure data utility; at the same time, the information will not be decrypted until it reaches the MGCC to ensure data confidentiality. In addition, complex algorithms are deployed on the alliance chain to ensure lightweight.
[0064] Compared with the existing energy scheduling that only considers the degree of energy demand, the method of the present invention can be deployed in resource-constrained smart meters, and for each energy type type, type∈{1,2,3}, the global demand reliability coefficient It is always bigger, ensuring that demanders with greater demand get a larger amount of energy with greater supply reliability, while taking into account data confidentiality and utility, and being more efficient and secure. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] Figure 1 It is a flow chart of a reliable energy dispatching method based on BC-PAEKS in an islanded microgrid in a smart grid;
[0066] Figure 2 It is a supply and demand diagram of each supplier and each demander when supply exceeds demand;
[0067] Figure 3It is a comparison chart of the energy supply of the supplier and the actual energy supply provided when supply exceeds demand;
[0068] Figure 4 It is a comparison chart of the energy demand of the demander and the actual energy supply obtained when supply exceeds demand;
[0069] Figure 5 It is a diagram of the supply and demand situation of each supplier and each demander when supply is less than demand;
[0070] Figure 6 It is a comparison chart of the energy supply of the supplier and the actual energy supply provided when the supply is less than the demand;
[0071] Figure 7 It is a comparison chart of the energy demand of the demander and the actual energy supply obtained when supply is less than demand;
[0072] Figure 8 It is a diagram of the supply and demand situation of each supplier and each demander when supply equals demand;
[0073] Fig. 9 It is a comparison chart of the energy supply of the supplier and the actual energy supply provided when supply equals demand;
[0074] Fig.10 It is a comparison chart of the energy demand of the demander and the actual energy supply obtained when supply equals demand;
[0075] Fig.11 It is a comparison chart of the global demand reliability coefficient of the reliable energy dispatch method based on BC-PAEKS in the isolated microgrid of the smart grid;
[0076] Fig.12 This is a time cost comparison chart of a reliable energy scheduling method based on BC-PAEKS in an isolated microgrid in a smart grid. DETAILED DESCRIPTION
[0077] The present invention is further described in detail below in conjunction with the accompanying drawings:
[0078] like Figure 1 As shown, the reliable energy scheduling method based on BC-PAEKS in the isolated microgrid of the smart grid described in this embodiment has the following specific steps:
[0079] (1) System initialization:
[0080] Determine that the energy type is represented as type and type∈{1,2,3}, where 1 represents traditional energy, 2 represents energy storage, and 3 represents new energy; the traditional energy server is represented as ServerT, the energy storage server is represented as ServerS, and the new energy server is represented as ServerN. Traditional energy, energy storage, and new energy are scheduled in these three different servers respectively; determine the number of energy demand parties participating in the energy scheduling of this cycle as A num , the number of energy suppliers is P num , the energy demand side is represented as Sender i ,i=1,2,3...,A num , the energy supplier is represented by Sender j ,j=1,2,3...,P num ; Each scheduling initiator Sender k ,k=1,2,…,A…,Anum num +P num , both energy demanders and energy suppliers have deployed smart metersSM k , S.M. k Registration is required when joining the grid communication network for the first time. The microgrid central controller MGCC assigns a weight w to each user according to their importance. k ≥0,k=1,2,…,A num +P num , w k The larger it is, the more important the user is;
[0081] (2) Determine the degree of energy demand and supply reliability:
[0082] (2-1) For each energy demander Sender i , for each energy type type,type∈{1,2,3}, determine the required energy quantity U itype ; For each energy supplier Sender j , according to the energy type type,type∈{1,2,3} it can supply, determine the amount of energy it can supply as D jtype ;
[0083] (2-2) For each energy demander Sender i , MGCC according to its weight w i ≥0,i=1,2,…,A num Determine the degree of traditional energy demand N corresponding to the energy type type, type∈{1,2,3} i1 ≥0, energy storage demand level N i2 ≥0 and the degree of new energy demand N i3≥0, and N i1 >>N i2 >>N i3 , w i The larger the value, the more important the demand side is. The energy demand level N itype The larger it is, the more priority the demand side has in getting energy;
[0084] (2-3) For each energy supplier Sender j MGCC is based on the amount of energy it can supply D jtype Determine the reliability of traditional energy supply R corresponding to the energy type type, type∈{1,2,3} j1 ≥0, energy storage supply reliability R j2 ≥0 and reliability of new energy supply R j3 ≥0, the amount of energy that can be supplied D jtype The larger the supply reliability R jtype The larger it is, the more priority the supplier has for energy supply;
[0085] (3) MGCC generates public parameters:
[0086] (3-1) MGCC selects the bilinear mapping parameters (G0, G T ,g,p,e), where G0 represents the cyclic group of the bilinear map, g is its generator, G T is also a cyclic group, G0, G T The order of is a prime number p, and e is from G0×G0→G T A bilinear map of ;
[0087] (3-2)MGCC sets the keyword spaceKeyword space ={tranditional,storage,new}, where there are three keywords kw1=tranditional,kw2=storage,kw3=new, representing traditional energy, energy storage and new energy respectively;
[0088] (3-3)MGCC generates identities for different roles and represents them as IDs. Includes the ID of the scheduling initiator Sk ,k=1,2,…,A num +P num The IDs of the three servers Rtype , type∈{1,2,3}, corresponding to traditional energy, energy storage, and new energy, that is, the identity of the server ServerT is ID R1 , the server ServerS's identity is ID R2And the identity of server ServerN is ID R3 , all IDs constitute the identity space ID space ;
[0089] (3-4)MGCC selects three hash functions: H1:{0,1} * →G0,H2:ID→G0,H3:G T →{0,1} * , where {0,1} * Represents a string of 0 or 1 bits of any position;
[0090] (3-5) MGCC selects random numbers Return the master key MSK = α, where α is a random number selected from the real number range [1, p-1], and generate the public parameter PP and the global parameter GSP, as shown in formula (1):
[0091]
[0092] (4) MGCC generates public and private keys:
[0093] (4-1) For each energy type type, type∈{1,2,3} corresponding to the server ServerT, ServerS and ServerN, MGCC uses its identity ID Rtype , type∈{1,2,3} calculates H2(ID Rtype ) α And distribute it to ServerT, ServerS and ServerN, and ServerT, ServerS and ServerN will each choose a random number Generate its public key PK Rtype With private key SK Rtype , as shown in formula (2):
[0094]
[0095] (4-2) For each scheduling initiator Sender k MGCC calculates H2(ID Sk ) α And distribute it to it, Sender k Choose another random number Generate its public key PK Sk With private key SK Sk , as shown in formula (3):
[0096]
[0097] (5) Data collection, encryption and transmission:
[0098] (5-1) For each energy demander Sender i , for each energy type type,type∈{1,2,3}, collect the energy demand level N itype And the amount of energy required U itype Generate the required array Need itype =[N itype ,U itype ] and its identity ID Si Composition scheduling data m itype ; For each energy supplier Sender j , for the energy type type,type∈{1,2,3} it can supply, the supply reliability is R jtype And the amount of energy that can be supplied is D jtype Generate supply arraySend jtype =[R jtype ,D jtype ] and its identity ID Sj Composition scheduling data m jtype ;
[0099] (5-2) Each scheduling initiator Sender k For each energy type type,type∈{1,2,3} that it needs or can provide, select a random number k∈(1,2,3,...,P num +A num ),calculate
[0100] K type =e(H2(ID Sk ) α ,H2(ID Rtype )); (4)
[0101] Then, Sender k According to PP,PK Sk ,PK Rtype ,SK Sk ,kw type ,K type Generate ciphertext As shown in formula (5):
[0102]
[0103] Finally, Sender k Using PK according to RSA algorithm Rtype Encrypted scheduling data m ktype Get Encrpted(PK Rtype,m ktype ), and with Combine to get C ktype ,Right now
[0104] (5-3)Sender k C ktype By forwarding node T node Perform searchable matching operations, T node For Sender k Forwarding nodes, including smart meters and local controllers;
[0105] (6) Server generates a trapdoor:
[0106] (6-1) ServerT, ServerS and ServerN according to PP,PK Sk ,PK Rtype ,SK Rtype ,kw type ',K type 'Generate a trapdoor K type 'Random numbers are selected by ServerT, ServerS and ServerN And calculate, K type The value of ' is shown in formula (6):
[0107] K type '=e(H2(ID Sk ),H2(ID Rtype ) α ); (6)
[0108] Finally, ServerT, ServerS, and ServerN generate trapdoors As shown in formula (7):
[0109]
[0110] (6-2) ServerT, ServerS, and ServerN will generate Send to Sender k The forwarding node T node , including all Sender k and the local controller, T node Will Add to its trapdoor set T c middle, That is, all users’ corresponding trapdoors for different energy sources are generated and handed over to the forwarding node T node ;
[0111] Since the trapdoor that MGCC gives to each local controller or scheduling initiator in each cycle is fixed, MGCC only gives each forwarding node T node Send a trapdoor At the same time, the Keywords included in the GSP in step 3 space 、ID space , the public and private keys of all scheduling initiators and servers in step 4 and the trapdoor in step 6 are initialized only once, while the remaining steps 1, 2, 5 and steps 7 to 9 are performed every cycle; when the number of keywords is adjusted, MGCC can update the Keyword in GSP space ,MGCC synchronously updates the trapdoors generated by each user;
[0112] (7) Match forwarding:
[0113] (7-1) When the forwarding node T node When receiving a ciphertext and a matching request is required, With T node The trapdoor set in Sent to the alliance chain module, for T c In The alliance chain verifies the matching formula (8) in turn:
[0114]
[0115] (7-2) If kw type =kw type 'Then the matching formula (8) is established. The specific derivation process of alliance chain verification based on hyperbolic mapping operation is shown in formula (9):
[0116]
[0117] According to the hyperbolic mapping operation rules, K type With K type The corresponding relationship of ' is shown in formula (10):
[0118]
[0119] (7-3) If and T wk1 The match is successful, and the alliance chain outputs 1 to the forwarding node T node , indicating that the match is successful; otherwise, the alliance chain continues to repeat this step to With T c The rest of T wktype ,Right now and Match until the output result is 1, indicating a successful match, or all T wktypeIf the matching is completed and no 1 is output, it means The keyword specified by the three servers in MGCC is not included. At this time, the alliance chain outputs 0 to the forwarding node T node , indicating that the matching fails; from formula (5) With formula (7)T wktype From the definition of node Unable to decrypt the matching process With T wktype , can only execute the matching formula in formula (8), which takes into account the confidentiality and utility of data;
[0120] (7-4) If the match is successful and T node If it is not the local controller but other meters, the data will be forwarded until it is forwarded to the local controller for matching; if the match is successful and T node It is the local controller, and the local controller sends Encrpted(PK Rtype ,m ktype ) to the server of the corresponding type in MGCC;
[0121] (8) Data decryption and energy scheduling:
[0122] (8-1) Each energy type type, type∈{1,2,3} corresponding to the server ServerT, ServerS and ServerN receives Encrpted(PK Rtype ,m ktype ) data, use SK Rtype Decrypt to get the energy demand side Sender i The need array Need itype =[N itype ,U itype ]、Energy supplier Sender j Supply array Send jtype =[R jtype ,D jtype ];
[0123] (8-2) ServerT, ServerS and ServerN initialize the energy supply matrix X type All elements of X are 0, type As shown in formula (11)
[0124]
[0125] The matrix X type The rows represent energy suppliers, the columns represent energy demanders, and a ji Energy supplier Sender j Senderi How much energy is supplied to a certain energy supplier Sender j For the row, the sum of all elements in the row is the energy supplier Sender j All the energy supplied to a certain energy demander Sender i For the column, the sum of all elements in the column is the energy demand side Sender i All the energy obtained;
[0126] (8-3) Different servers sort the corresponding demand queues according to type needtype Sorted with supply queue sendtype Set it as an empty queue; then set the energy demand of all energy demand parties separately itype =[N itype ,U itype ]Data according to N itype Fill the sorted queue in descending order needtype and energy supply from energy suppliers jtype =[R jtype ,D jtype ]Data according to R jtype Fill the supply queue in descending order Sorted sendtype Chinese; Sorted needtype The demand side at the head of the queue is the one with the highest energy demand. sendtype The supplier at the head of the queue is the supplier with the highest supply reliability;
[0127] (8-4) Energy scheduling based on the greedy algorithm. The specific method is: needtype For a queue, the demand side at the head of the queue is sorted sendtype Get energy from the supplier at the head of the queue. If the current Sorted needtype The demand energy of the demand side at the head of the queue is greater than that of the Sorted sendtype The supply energy of the supplier at the head of the queue, the demander first obtains the current energy of the supplier and sendtype Get energy from the next energy supplier in the queue until the energy demand is met; if the current Sorted needtype The demand energy of the demand side at the head of the queue is less than that of the Sorted sendtype The energy supply of the supplier at the head of the queue is met, and the energy demand of the current demander is met. The next energy demander continues to obtain energy from the supplier at the head of the current queue. needtype The demand energy of the demand side at the head of the queue is equal to Sortedsendtype The supply energy of the supplier at the head of the queue, then the energy demand of the current demander is met, and the energy supply demand of the current supplier is met, Sorted needtype The first party becomes the next energy demander of the satisfied demander, that is, the demander with a smaller demand than the first demander. sendtype The first supplier becomes the next energy supplier of the satisfied supplier, that is, the supplier with a lower supply reliability than the first supplier;
[0128] (8-5) After energy scheduling based on the greedy algorithm in (8-4), the energy supply matrix X is finally obtained type Each a ji The specific value of
[0129] (9) MGCC performs energy feedback:
[0130] MGCC is based on the energy dispatch result matrix X type Each energy demand side Sender i The energy obtained from different energy suppliers and the Sender of each energy supplier j The energy supplied to different energy demanders is fed back to each energy demander and energy supplier accordingly, and the energy scheduling of this cycle ends.
[0131] The present invention verifies and designs experiments for three aspects: (1) verification of the effectiveness of the invention method; (2) verification of the efficiency of the invention method; and (3) verification of the lightness of the invention method. From steps (1) to (9) of the aforementioned method of the present invention, it can be seen that the scheduling strategies executed on three different servers, the traditional energy server ServerT, the energy storage server ServerS, and the new energy server ServerN, are consistent. Therefore, the present invention uses a server ServerT as an example for experimental verification.
[0132] Regarding “(1) Verification of the effectiveness of the inventive method”, the present invention designs three schemes for different supply and demand situations, namely, Scheme ① (Case 1): supply is greater than demand, Scheme ② (Case 2): supply is less than demand, and Scheme ③ (Case 3): supply is equal to demand. 500 sets of experiments were conducted for each scheme, totaling 1500 sets of experiments to evaluate the effectiveness of the inventive method.
[0133] In each experimental setting, the energy demand side Sender i The number of num is an integer between (0,100], energy demand level N i1 is a decimal number with two decimal places selected from (0.00,1.00), the required quantity U i1It is an integer selected from (0,100] and the unit is kWh. The demand type is 1.
[0134] Energy supplier Sender j The number of num is an integer between (0,100], supply reliability R j1 (0.00,1.00) is a decimal with two decimal places, the supply quantity D j1 is an integer between (0,100] and the unit is kWh, and the supply type is 1. Unlike the energy demand level, the energy demand level depends on the user's importance and other information, and has no direct relationship with the amount of energy required. For the same energy supply, the supply reliability of the energy supplier depends to a large extent on the amount of energy it can supply. Therefore, when setting the supply reliability, the corresponding relationship between the supply reliability and the amount of energy supplied needs to be considered. Based on the above considerations, the supply quantity D of the energy supplier j1 is an integer selected from (0,100] and the unit is kWh, the supply type is 1, and its supply reliability is R j1 From the interval Energy supply type type, supply reliability R j1 , quantity P num The value range and selection method of are consistent with the definition of energy demand side.
[0135] The parameter settings of "2) Verification of the efficiency of the inventive method" are consistent with those of "1) Verification of the effectiveness of the inventive method". Three schemes (Case 1, Case 2, and Case 3) are designed for different energy supply and demand situations. At the same time, a set of comparison schemes Case 4 that does not consider the supply and demand situation is added to compare the inventive method with the energy scheduling strategy SSWCR (Scheduling strategy without considering reliability) that only considers the user's demand level without considering the reliability of the energy supply from the supplier. Among them, the SSWCR strategy only considers the demand level of the energy demander, and gives priority to satisfying the energy demander with a high demand level during energy scheduling, without considering the reliability of the energy supply. Finally, 2000 sets of experimental simulations are used to compare the DRF of the inventive method and the SSWCR strategy in four situations.
[0136] Regarding "3) Lightweight verification of the invented method", the present invention first analyzes the time consumption of the main steps of five searchable encryption schemes including BC-PAEKS, then deploys a complex matching algorithm on the alliance chain, and uploads the searchable ciphertext and trapdoor simulation to the alliance chain. In addition, the lightness of the invented method is evaluated by the time consumption of the main steps of 500 sets of energy scheduling schemes.
[0137] By analyzing the energy demand of the demand side and the actual energy supply obtained, as well as the maximum energy supply of the power supplier and the actual energy supply provided, the results of the first 1500 groups of random experiments all show that the method of the present invention can allocate energy to energy demanders according to the degree of energy demand and the degree of supply reliability, and ensure that the energy demanders with a high degree of energy demand obtain energy with a high degree of supply reliability. The experimental settings in "(1) Verification of the effectiveness of the invention method" are divided into three types according to the actual supply and demand situation: first, supply is greater than demand; second, supply is less than demand; third, supply is equal to demand.
[0138] (1) Option ①: Supply exceeds demand
[0139] The experimental setting of the 234th group of experiments in Scheme ① is as follows: there are 6 energy demand parties, whose energy demand array is [18, 37, 23, 45, 32, 22], and the corresponding demand degree is [0.18, 0.05, 0.72, 0.35, 0.66, 0.38]. There are 6 energy suppliers, whose supply array is [53, 59, 22, 21, 42, 22], and the corresponding reliability is [0.58, 0.53, 0.28, 0.25, 0.45, 0.23]. The specific energy scheduling results are shown in the matrix X 1-1 As shown:
[0140]
[0141] The rows of the matrix represent energy suppliers, the columns of the matrix represent energy demanders, and the values of the matrix elements represent the energy supplied by the energy suppliers to the energy demanders. The amount of energy supplied by the energy supplier is the sum of the element values in its row, and the amount of energy obtained by the energy demander is the sum of all the element values in its column. For example, the total amount of energy supplied by energy supplier 1 is 53kWh, 23kWh is supplied to energy demander 3, and 30kWh is supplied to energy demander 5. The total amount of energy obtained by energy demander 2 is 37kWh, 22kWh is obtained from energy supplier 3, and 1kWh is obtained from energy supplier 4.
[0142] Figure 2 The energy dispatch results of scheme ① are shown. Figure 3 , Figure 4 The energy destination of the energy supplier and the energy composition of the energy demander in solution ① are shown. Figure 2 as well as Figure 3 , 4It can be seen that the present invention can effectively perform energy scheduling according to the supply reliability and energy demand. For example, the total energy supply of scheme ① is 219kWh, the total energy demand is 177kWh, the reliability of the energy supplier is [0.58, 0.53, 0.28, 0.25, 0.45, 0.23], and the demand of the energy demander is [0.18, 0.05, 0.72, 0.35, 0.66, 0.38]. Therefore, the energy of suppliers 1, 2, 5, and 3 is preferentially supplied to energy demanders 3, 5, 6, 4, and 1. After the supply is completed, demander 2 has only 1kWh left to be supplied. According to the energy reliability, supplier 4 supplies 1kWh, and the energy request of the demander is met. However, due to the low supply reliability of supplier 6, the energy cannot be supplied preferentially.
[0143] (2) Option ②: Supply is less than demand
[0144] The experimental setting of the 145th group of experiments in scheme ② is as follows: there are 7 energy demand parties, whose energy demand array is [45, 56, 59, 80, 32, 40, 41], and the corresponding demand degree is [0.65, 0.22, 0.88, 0.47, 0.36, 0.79, 0.31]. There are 5 energy suppliers, whose supply array is [63, 49, 11, 38, 75], and the corresponding reliability is [0.61, 0.43, 0.14, 0.35, 0.75]. The specific energy scheduling results are shown in the matrix X 1-2 As shown:
[0145]
[0146] The rows of the matrix represent energy suppliers, the columns of the matrix represent energy demanders, and the values of the matrix elements represent the energy supplied by the energy suppliers to the energy demanders. The amount of energy supplied by the energy supplier is the sum of the element values in its row, and the amount of energy obtained by the energy demander is the sum of all the element values in its column. For example, the total amount of energy supplied by energy supplier 1 is 63kWh, 39kWh is supplied to energy demander 1, and 24kWh is supplied to energy demander 6. The total amount of energy obtained by energy demander 4 is 80kWh, 43kWh is obtained from energy supplier 2, and 37kWh is obtained from energy supplier 4.
[0147] Figure 5 The energy dispatch results of Scheme ② are shown. Figure 6 , Figure 7 The energy destination of the energy supplier and the energy composition of the energy demander in Scheme ② are shown. Figure 5 as well as Figure 6 , 7It can be seen that the present invention can effectively dispatch energy according to the supply reliability and energy demand. For example, the total energy supply of scheme ② is 236kWh, the total energy demand is 353kWh, the demand level of the energy demander is [0.65, 0.22, 0.88, 0.47, 0.36, 0.79, 0.31], and the reliability of the energy supplier is [0.61, 0.43, 0.14, 0.35, 0.75]. Therefore, the energy of demanders 3, 6, 1, 4, and 5 is preferentially supplied by suppliers 5, 1, 2, 4, and 3. Since energy supplier 3 only has 11kWh left, energy demander 5 can only get 11kWh, and the energy supply of the energy supplier is completed. However, due to the low demand level of demanders 2 and 7, the energy cannot be effectively supplied.
[0148] (3) Option ③: Supply equals demand
[0149] The experimental setting of the 378th experiment in scheme ③ is as follows: there are 8 energy demand parties, whose energy demand array is [40, 60, 35, 50, 2, 25, 4, 41], and the corresponding demand degree is [0.72, 0.45, 0.81, 0.27, 0.63, 0.94, 0.36, 0.52]. There are 4 energy suppliers, whose supply array is [75, 52, 90, 40], and the corresponding reliability is [0.73, 0.58, 0.91, 0.42]. The specific energy scheduling results are shown in the matrix X 1-3 As shown:
[0150]
[0151] The rows of the matrix represent energy suppliers, the columns of the matrix represent energy demanders, and the values of the matrix elements represent the energy supplied by the energy suppliers to the energy demanders. The amount of energy supplied by the energy supplier is the sum of the element values in its row, and the amount of energy obtained by the energy demander is the sum of all the element values in its column. For example, the total amount of energy supplied by energy supplier 4 is 40kWh, and 40kWh is supplied to energy demander 4. The total amount of energy obtained by energy demander 4 is 50kWh, 10kWh from energy supplier 2 and 40kWh from energy supplier 4.
[0152] Figure 8 The energy dispatch results of scheme ③ are shown. Fig. 9 , Fig.10 The energy destination of the energy supplier and the energy composition of the energy demander in solution ③ are shown. Figure 8 as well as Fig. 9 , 10It can be seen that the present invention can effectively perform energy scheduling according to the supply reliability and energy demand. For example, the total energy supply of scheme ③ is 257kWh, the total energy demand is 257kWh, the demand level of the energy demander is [0.72, 0.45, 0.81, 0.27, 0.63, 0.94, 0.36, 0.52], and the reliability of the energy supplier is [0.73, 0.58, 0.91, 0.42]. Therefore, the energy of demanders 6, 3, 1, 5, 8, 2, 7, and 4 is supplied by suppliers 3, 1, 2, and 4 in sequence. The total energy supply is equal to the total energy demand, and the supply and demand requests of the energy supplier and the energy demander are all met.
[0153] Fig.11 The method of the present invention is compared with the strategy SSWCR that does not consider reliability. In addition to scheme ① (Case1), scheme ② (Case2) and scheme ③ (Case3), 500 groups of random experimental schemes ④ (Case4) are added. It can be seen from the figure that the method of the present invention is better than the SSWCR strategy in all schemes. For example, in Case2, the method of the present invention has 494 groups with better results than SSWCR, accounting for 98.8% of the total number of experiments; the total number of the same data is 6 groups, accounting for 1.2% of the total number of experiments. The experimental results show that the DRF of the method of the present invention is always greater than or equal to the DRF of SSWCR.
[0154] Fig.12 The comparison results of the time overhead between the method of the present invention and other keyword searchable encryption algorithms are shown. The difference between the BC-PAEKS of the present invention and the PKAUES and PKAESR schemes is that the BC-PAEKS scheme adds a step of selecting random numbers to participate in the generation of searchable ciphertext and trapdoors, which improves the security of searchable ciphertext and trapdoors within an acceptable additional time overhead. As can be seen from the figure, no matter what algorithm is deployed in the alliance chain module, its average time overhead is less than 25ms, which verifies the lightweight nature of the method of the present invention.
Claims
1. A reliable energy dispatching method based on BC-PAEKS in an islanded microgrid of a smart grid, characterized in that: The following steps are involved: (1) System initialization: Determine that the energy type is represented as type and type∈{1,2,3}, where 1 represents traditional energy, 2 represents energy storage, and 3 represents new energy; the traditional energy server is represented as ServerT, the energy storage server is represented as ServerS, and the new energy server is represented as ServerN. Traditional energy, energy storage, and new energy are scheduled in these three different servers respectively; determine the number of energy demand parties participating in the energy scheduling of this cycle as A num , the number of energy suppliers is P num , the energy demand side is represented as Sender i ,i=1,2,3...,A num , the energy supplier is represented by Sender j ,j=1,2,3...,P num ; Each scheduling initiator Sender k ,k=1,2,,A num +P num , both energy demanders and energy suppliers have deployed smart metersSM k , S.M. k Registration is required when joining the grid communication network for the first time. The microgrid central controller MGCC assigns a weight w to each user according to their importance. k ≥0,k=1,2,,A num +P num , w k The larger it is, the more important the user is; (2) Determine the degree of energy demand and supply reliability: (2-1) For each energy demander Sender i , for each energy type type,type∈{1,2,3}, determine the required energy quantity U itype ; For each energy supplier Sender j , according to the energy type type,type∈{1,2,3} it can supply, determine the amount of energy it can supply as D jtype ; (2-2) For each energy demander Sender i , MGCC according to its weight w i ≥0,i=1,2,,A num Determine the degree of traditional energy demand N corresponding to the energy type type, type∈{1,2,3} i1 ≥0, energy storage demand level N i2 ≥0 and the degree of new energy demand N i3 ≥0, and N i1 >>N i2 >>N i3 , w i The larger the value, the more important the demand side is. The energy demand level N itype The larger it is, the more priority the demand side has in getting energy; (2-3) For each energy supplier Sender j MGCC is based on the amount of energy it can supply D jtype Determine the reliability of traditional energy supply R corresponding to the energy type type, type∈{1,2,3} j1 ≥0, energy storage supply reliability R j2 ≥0 and reliability of new energy supply R j3 ≥0, the amount of energy that can be supplied D jtype The larger the supply reliability R jtype The larger it is, the more priority the supplier has for energy supply; (3) MGCC generates public parameters: (3-1) MGCC selects the bilinear mapping parameters (G0, G T ,g,p,e), where G0 represents the cyclic group of the bilinear map, g is its generator, G T is also a cyclic group, G0, G T The order of is a prime number p, and e is from G0×G0→G T A bilinear map of ; (3-2)MGCC sets the keyword spaceKeyword space ={tranditional,storage,new}, where there are three keywords kw1=tranditional,kw2=storage,kw3=new, representing traditional energy, energy storage and new energy respectively; (3-3)MGCC generates identities for different roles and represents them as IDs. Includes the ID of the scheduling initiator Sk ,k=1,2,,A num +P num The IDs of the three servers Rtype , type∈{1,2,3}, corresponding to traditional energy, energy storage, and new energy, that is, the identity of the server ServerT is ID R1 , the server ServerS's identity is ID R2 And the identity of server ServerN is ID R3 , all IDs constitute the identity space ID space ; (3-4)MGCC selects three hash functions: H1:{0,1} * →G0,H2:ID→G0,H3:G T →{0,1} * , where {0,1} * Represents a string of 0 or 1 bits of any position; (3-5) MGCC selects random numbers Return the master key MSK = α, where α is a random number selected from the real number range [1, p-1], and generate the public parameter PP and the global parameter GSP, as shown in formula (1): (4) MGCC generates public and private keys: (4-1) For each energy type type, type∈{1,2,3} corresponding to the server ServerT, ServerS and ServerN, MGCC uses its identity ID Rtype , type∈{1,2,3} calculates H2(ID Rtype ) α And distribute it to ServerT, ServerS and ServerN, and ServerT, ServerS and ServerN will each choose a random number Generate its public key PK Rtype With private key SK Rtype , as shown in formula (2): (4-2) For each scheduling initiator Sender k MGCC calculates H2(ID Sk ) α And distribute it to it, Sender k Choose another random number Generate its public key PK Sk With private key SK Sk , as shown in formula (3): (5) Data collection, encryption and transmission: (5-1) For each energy demander Sender i , for each energy type type,type∈{1,2,3}, collect the energy demand level N itype And the amount of energy required U itype Generate the required array Need itype =[N itype ,U itype ] and its identity ID Si Composition scheduling data m itype ; For each energy supplier Sender j , for the energy type type,type∈{1,2,3} it can supply, the supply reliability is R jtype And the amount of energy that can be supplied is D jtype Generate supply arraySend jtype =[R jtype ,D jtype ] and its identity ID Sj Composition scheduling data m jtype ; (5-2) Each scheduling initiator Sender k For each energy type type,type∈{1,2,3} that it needs or can provide, select a random number s k , k∈(1,2,3,...,P num +A num ),calculate K type =e(H2(ID Sk ) α ,H2(ID Rtype )); (4) Then, Sender k According to PP,PK Sk ,PK Rtype ,SK Sk ,kw type ,K type Generate ciphertext As shown in formula (5): Finally, Sender k Using PK according to RSA algorithm Rtype Encrypted scheduling data m ktype Get Encrpted(PK Rtype ,m ktype ), and with Combine to get C ktype ,Right now (5-3)Sender k C ktype By forwarding node T node Perform searchable matching operations, T node For Sender k Forwarding nodes, including smart meters and local controllers; (6) Server generates a trapdoor: (6-1) ServerT, ServerS and ServerN according to PP,PK Sk ,PK Rtype ,SK Rtype ,kw type ',K type 'Generate a trapdoor K type 'Random numbers are selected by ServerT, ServerS and ServerN And calculate, K type The value of ' is shown in formula (6): K type '=e(H2(ID Sk ),H2(ID Rtype ) α ); (6) Finally, ServerT, ServerS, and ServerN generate trapdoors As shown in formula (7): (6-2) ServerT, ServerS, and ServerN will generate Send to Sender k The forwarding node T node , including all Sender k and the local controller, T node Will Add to its trapdoor set T c middle, k∈(1,2,3,...,P num +A num ), that is, to generate trapdoors corresponding to different energy sources for all users and hand them over to the forwarding node T node ; Since the trapdoor that MGCC gives to each local controller or scheduling initiator in each cycle is fixed, MGCC only gives each forwarding node T node Send a trapdoor At the same time, the Keywords included in the GSP in step 3 space 、ID space , the public and private keys of all scheduling initiators and servers in step 4 and the trapdoor in step 6 are initialized only once, while the remaining steps 1, 2, 5 and steps 7 to 9 are performed every cycle; when the number of keywords is adjusted, MGCC can update the Keyword in GSP space ,MGCC synchronously updates the trapdoors generated by each user; (7) Match forwarding: (7-1) When the forwarding node T node When receiving a ciphertext and a matching request is required, With T node The trapdoor set in Sent to the alliance chain module, for T c In The alliance chain verifies the matching formula (8) in turn: (7-2) If kw type =kw type 'Then the matching formula (8) is established. The specific derivation process of alliance chain verification based on hyperbolic mapping operation is shown in formula (9): According to the hyperbolic mapping operation rules, K type With K type The corresponding relationship of ' is shown in formula (10): (7-3) If and T wk1 The match is successful, and the alliance chain outputs 1 to the forwarding node T node , indicating that the match is successful; otherwise, the alliance chain continues to repeat this step to With T c The rest of T wktype ,Right now and Match until the output result is 1, indicating a successful match, or all T wktype If the matching is completed and no 1 is output, it means The keyword specified by the three servers in MGCC is not included. At this time, the alliance chain outputs 0 to the forwarding node T node , indicating that the matching fails; from formula (5) With formula (7)T wktype From the definition of node Unable to decrypt the matching process With T wktype , can only execute the matching formula in formula (8), which takes into account the confidentiality and utility of data; (7-4) If the match is successful and T node If it is not the local controller but other meters, the data will be forwarded until it is forwarded to the local controller for matching; if the match is successful and T node It is the local controller, and the local controller sends Encrpted(PK Rtype ,m ktype ) to the server of the corresponding type in MGCC; (8) Data decryption and energy scheduling: (8-1) Each energy type type, type∈{1,2,3} corresponding to the server ServerT, ServerS and ServerN receives Encrpted(PK Rtype ,m ktype ) data, use SK Rtype Decrypt to get the energy demand side Sender i The need array Need itype =[N itype ,U itype ]、Energy supplier Sender j Supply array Send jtype =[R jtype ,D jtype ]; (8-2) ServerT, ServerS and ServerN initialize the energy supply matrix X type All elements of X are 0, type As shown in formula (11) The matrix X type The rows represent energy suppliers, the columns represent energy demanders, and a ji Energy supplier Sender j Sender i How much energy is supplied to a certain energy supplier Sender j For the row, the sum of all elements in the row is the energy supplier Sender j All the energy supplied to a certain energy demander Sender i For the column, the sum of all elements in the column is the energy demand side Sender i All the energy obtained; (8-3) Different servers sort the corresponding demand queues according to type needtype Sorted with supply queue sendtype Set it as an empty queue; then set the energy demand of all energy demand parties separately itype =[N itype ,U itype ]Data according to N itype Fill the sorted queue in descending order needtype and energy supply from energy suppliers jtype =[R jtype ,D jtype ]Data according to R jtype Fill the supply queue in descending order Sorted sendtype Chinese; Sorted needtype The demand side at the head of the queue is the one with the highest energy demand. sendtype The supplier at the head of the queue is the supplier with the highest supply reliability; (8-4) Energy scheduling based on the greedy algorithm. The specific method is: needtype For a queue, the demand side at the head of the queue is sorted sendtype Get energy from the supplier at the head of the queue. If the current Sorted needtype The demand energy of the demand side at the head of the queue is greater than that of the Sorted sendtype The supply energy of the supplier at the head of the queue, the demander first obtains the current energy of the supplier and sendtype Get energy from the next energy supplier in the queue until the energy demand is met; if the current Sorted needtype The demand energy of the demand side at the head of the queue is less than that of the Sorted sendtype If the supplier at the head of the queue supplies energy, the energy demand of the current demander is met, and the next energy demander continues to obtain energy from the supplier at the head of the current queue; If the current Sorted needtype The demand energy of the demand side at the head of the queue is equal to Sorted sendtype The supply energy of the supplier at the head of the queue, then the energy demand of the current demander is met, and the energy supply demand of the current supplier is met, Sorted needtype The first party becomes the next energy demander of the satisfied demander, that is, the demander with a smaller demand than the first demander. sendtype The first supplier becomes the next energy supplier of the satisfied supplier, that is, the supplier with a lower supply reliability than the first supplier; (8-5) After energy scheduling based on the greedy algorithm in (8-4), the energy supply matrix X is finally obtained type Each a ji The specific value of (9) MGCC performs energy feedback: MGCC is based on the energy dispatch result matrix X type Each energy demand side Sender i The energy obtained from different energy suppliers and the Sender of each energy supplier j The energy supplied to different energy demanders is fed back to each energy demander and energy supplier accordingly, and the energy scheduling of this cycle ends.
