A blockchain trusted authentication method for distributed adjustable load interaction
By improving the PBFT consensus algorithm and cryptographic hash function, the security and overhead issues of blockchain authentication methods in distributed adjustable loads are solved, realizing efficient and secure electricity market transaction authentication and improving credibility and transaction efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- STATE GRID ZHEJIANG ELECTRIC POWER CO LTD
- Filing Date
- 2022-10-31
- Publication Date
- 2026-04-28
AI Technical Summary
Existing blockchain authentication methods suffer from poor security, high computational overhead, and high storage requirements when dealing with large-scale distributed adjustable loads, thus failing to effectively improve the reliability and efficiency of electricity market transactions.
It adopts an improved PBFT consensus algorithm and a hybrid software-defined network architecture, combined with a cryptographic hash function, to generate public-private key pairs through a secure channel, filter nodes and authenticate transaction information, thereby ensuring communication quality and reducing overhead.
It improves the reliability of distributed adjustable load interaction, reduces communication overhead and storage requirements, and enhances the security and efficiency of electricity market transactions.
Smart Images

Figure CN115801341B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of mutual trust authentication in the power market, and specifically relates to a blockchain-based trusted authentication method for distributed adjustable load interaction. Background Technology
[0002] The emergence of new loads and distributed power sources has further expanded the scale of electricity market transactions, thereby increasing the number of participants and leading to a crisis of trust in the electricity market. To enhance mutual trust in the electricity market and improve transaction security and efficiency, reliable authentication methods are essential.
[0003] Blockchain-based trusted authentication methods can improve the reliability of electricity market transactions in new power system environments. Due to the continuous development of various emerging loads, coupled with the unpredictable security vulnerabilities and reliability issues arising from the autonomy of adjustable load entities, the application of trusted authentication has become increasingly important in today's adjustable load interactions. A secure and trusted trading environment can better leverage the advantages of distributed loads and energy sources in demand response interactions, while also facilitating the participation of more entities in electricity market transactions. Blockchain research in the field of transaction trust has a certain foundation; its immutability and transparency provide guarantees for fair transactions. However, previous blockchain authentication methods incur significant communication overhead and reduced security when dealing with large-scale distributed adjustable loads. Therefore, it is necessary to improve existing methods to enhance the security of the electricity market interaction transaction architecture while reducing computational overhead and storage requirements. Summary of the Invention
[0004] To address the issues of poor security, high computational overhead, and high storage requirements in existing blockchain authentication methods, this invention provides a blockchain trusted authentication method for distributed adjustable load interactions. It employs an improved PBFT consensus algorithm to ensure fairness, reduces overhead based on a hybrid software-defined network architecture, and achieves secure communication through cryptographic hash functions. This method can effectively improve the trustworthiness of adjustable load interactions while resulting in lower communication overhead and storage requirements.
[0005] The technical solution adopted in this invention is as follows: A blockchain trusted authentication method for distributed adjustable load interaction, comprising:
[0006] S1, through a secure channel, enables the adjustable load node to communicate and exchange credentials with the aggregator node, generates a public-private key pair for the adjustable load node, and stores it in the tamper-proof computing unit to complete the initialization;
[0007] S2 filters nodes that meet the conditions, creates blocks based on the improved PBFT consensus algorithm, and enables sharing among aggregators at the same layer to form an adjustable load interaction network to transmit authentication, transaction information, and mutual trust authentication. The ultimate goal is to ensure the confidentiality, integrity, and identity authentication of adjustable load interaction transactions. Among them, the improved PBFT consensus algorithm introduces a leader node selection method to minimize consensus latency.
[0008] S3, key exchange and communication, verifies transaction information, and reduces the impact of malicious node behavior or bit errors on normal communication and transactions.
[0009] Secure communication is achieved through a secure channel, and fairness is ensured by adopting an improved PBFT consensus algorithm. Based on the leader node selection method of this application, communication quality and verification effectiveness can be guaranteed, while the broadcast objects and scope are narrowed, thereby reducing communication overhead.
[0010] Furthermore, the initialization process specifically includes:
[0011] S1.1, the adjustable load node includes user ID and device ID. The adjustable load node selects a pseudo-random number and calculates:
[0012]
[0013]
[0014] Where H() is the hash function, ⊕ is the XOR operator, and || is the AND operator; ID ui For user ID, ID dxi For the first device ID, P r Let A1 be the first hash value and A2 be the second hash value; there are n user nodes, and the range of i is from 1 to n; let the i-th user have X i One device, x i Let x represent a device at the i-th user. i The value range is from 1 to X i ;
[0015] S1.2, the adjustable load node sends its ID to the aggregator node via a secure channel. ui A2 and P r Composed data packets <ID ui A2, P r >, to obtain credentials for communication;
[0016] Based on ID at the aggregator node ui A2 and P r Data packets <ID ui A2, Pr Calculation:
[0017]
[0018] And calculate B1, B2 and B A :
[0019]
[0020]
[0021]
[0022] Among them, EK pub AK pub These are the public keys of the edge intelligent agent and the aggregator, respectively; B1 and B2 are the encrypted data of the edge intelligent agent's public key and the aggregator's public key, respectively. A Registration code for adjustable load nodes;
[0023] B is stored in the local repository by the aggregator node based on the device ID. A The values of B1, B2, and B are stored. A and ID EA The value is transmitted to the tamper-proof computing unit to the adjustable load node; where ID EA For the ID of the edge intelligence agent;
[0024] S1.3, at the adjustable load node, decrypt the edge intelligent agent public key and the aggregator public key, the process is as follows:
[0025]
[0026]
[0027] S1.4, Generate a public-private key pair for secure communication at the adjustable load node; enable the aggregator node to share the public key AK with all intelligent edge agents connected to the aggregator node and with other aggregator nodes in the same layer via a secure channel. pub And the ID of the aggregator node.
[0028] In S1.1, the pseudo-random number P r The selection process is as follows: a pseudo-random number generation algorithm is used to obtain a random number sequence uniformly distributed in the range [0,1], which is then multiplied by a coefficient to set the random range. This random number sequence has statistical characteristics similar to random numbers, such as uniformity and independence. This method is existing technology and is easy to implement.
[0029] Furthermore, the specific process of step S2 is as follows:
[0030] S2.1, Calculate the hash value and ciphertext via the adjustable load node device Dx i Send ID to aggregator node ui ID dxi H R1 H R2 P r T R1 Data packets <ID ui ID dxi H R1 H R2 ,P r ,T R1 >, satisfying the following formula:
[0031]
[0032]
[0033] H R1 =H(R) h ||T R1 ||P r (11);
[0034] H R2 =E(AK) pub (DK_x ipub ,R s )) (12);
[0035] Where E() is the computational asymmetric encryption, and DK_x ipub For device x i The public key; E(AK) pub (DK_x ipub ,R s )) Using the aggregator's public key to connect the device's public key and R s Encrypt; T R1 The first registration timestamp allows adjustment of the data packet sending time for load node devices; ID A R is the aggregator node ID. s To verify the hash value for the ID, R h H is the encrypted value for the registration ID. R1 H is a timestamp hash value. R2 Public key ciphertext;
[0036] This step is a preprocessing step before encryption, converting text of variable length into fixed-length numbers. Encrypting with the original data would result in a large workload. The hash value is equivalent to a digest of the original data, which can simplify the encryption process.
[0037] S2.2, check the first time threshold ΔT at the aggregator node. R1 Does ΔT satisfy?R1 ≥T R2 -T R1 If true, then it is calculated using the following formula:
[0038]
[0039]
[0040]
[0041]
[0042] Where D() is for calculating asymmetric decryption, B A ` is the verification code for adjustable load nodes; T` R2 This is the second registration timestamp, i.e., the time when the aggregator node received the data; ΔT R1 Rs′ represents the first registration time threshold; Rs′ represents the calculated ID verification hash value; Rh′ represents the calculated encrypted registration ID value; Get() retrieves the value within the parentheses. This indicates the use of the aggregator's private key pair. Perform asymmetric decryption; These are the transmitted user ID, the transmitted first device ID, the transmitted pseudo-random number, and the transmitted public key ciphertext, respectively.
[0043] This step involves decryption and comparison with local information to confirm the information's legitimacy; the transmitted data may differ from the data packet. <ID ui ID dxi H R1 H R2 ,P r ,T R1 The data is inconsistent; therefore, verification is required.
[0044] S2.3, at the aggregator node, check if (Rs' = Rs & H) R1 '=H R1 &B A '=B A If ) is true, then at the aggregator node, the median hash value and the hash value of the current block are calculated using the following formula:
[0045]
[0046] T H =H(M) info (18);
[0047] H R1 '=H(R h '||T R1 ||P r(52);
[0048] Where: M info T is the median value of the hash value. H H contains the hash value of the current block; R1 Verify the hash value for the timestamp;
[0049] S2.4, according to M info and T H A block is created at the aggregator node using an improved PBFT consensus algorithm. This block is then verified at other aggregator nodes to confirm the accuracy of the information and rule out errors caused by non-malicious actions or erroneous data. When an aggregator node receives 2N / 3 commitment messages, it adds the block to the blockchain and sends a registration confirmation message. <confr,T R3 Send from aggregator node to adjustable load node device Adjustable load node equipment Response and check ΔT R2 ≥T R3 -T R1 If the value is true, update the authentication or transaction information of the anti-tampering computing unit to ensure that the information is not tampered with; otherwise, discard the response and trigger step S2.1; where T R3 The third registration timestamp allows adjustment of the time it takes for the load node to receive the registration confirmation message; ΔT R2 The second registration time threshold is denoted by N; N is the total number of aggregator nodes.
[0050] Furthermore, the improvement of the PBFT consensus algorithm in step S2.1 specifically includes:
[0051] S2.2.1, Start: Select a block proposal block from the aggregator nodes according to formula (19);
[0052] miner = R(mod)n (19);
[0053] Here, miner refers to the selected node; R is the current round number; mod is the modulo operator; n is the number of user nodes, specifically the total number of nodes including faulty nodes; this method ensures that the block proposer has a uniformly distributed chance of being selected, avoids repeated selection of the same node, is easy to attract attackers, and produces a low consensus latency.
[0054] S2.2.2, Verification: Create a transaction block and verify the transaction block information outside the leader node; when the total number of verifications is greater than 2N / 3, broadcast the commitment message to the network and proceed to the next step;
[0055] S2.2.3, Commitment: Confirm the additional block on the blockchain. If the total number of commitments is greater than 2N / 3, proceed to the next step.
[0056] S2.2.4, Attach: Attach the proposed block to the blockchain until all nodes have attached it; otherwise, return to step S2.2.1.
[0057] Furthermore, the specific verification messages in S2.2.2 include the block number, the previous block hash, the random number, and the Merkle root.
[0058] Furthermore, the specific process of step S3 is as follows:
[0059] S3.1, at the adjustable load node device D xi Generate ciphertext and a random number, and calculate:
[0060]
[0061]
[0062] H2=E(DK_x ipri (MS1,Ps,ID ui )) (twenty two);
[0063] MS1 is the ciphertext of the request. It is a random number; ID dxi H1 is the first device ID; H2 and H1 are the hash value of the request communication ID and the encrypted request communication data, respectively; P s To request the encrypted value of the communication ID, ID dxj For the second device ID, x j The first information device has a value range of 1 to X. i E(DK_x) ipri (MS1,Ps,ID ui )) indicates the use of device D xi Private key pair MS1, Ps, ID ui Perform asymmetric encryption;
[0064] data packet From adjustable load node equipment Send to adjustable load node equipment Adjustable load node equipment Verification is performed at the location; where T1 is the time it takes for the node to send the response request data packet.
[0065] S3.2, at the adjustable load node device D xj The system checks whether ΔT1≥T1'-T1 is true. If it is true, it proceeds to the next step; otherwise, it discards the response. Here, ΔT1 is the first verification time threshold, and T1' is the time it takes for the node to receive the response request data packet. This step is used to verify the validity of the time and detect message replay attacks.
[0066] S3.3, Locate adjustable load node devices in the local repository. If the public key is found, then in the adjustable load node device... The following calculations are performed:
[0067]
[0068]
[0069]
[0070] Where: Ps` represents the request communication ID encryption verification; H1` represents the request communication ID hash verification value; The first device ID after transmission; This is the second device ID after transmission; This indicates the encrypted request communication data after transmission; Indicates the use of equipment public key pair Perform asymmetric encryption;
[0071] Then check if (Ps'=Ps&H1'=H1) is true. If it is true, then calculate:
[0072]
[0073] H = E(DK_x) ipub (MS2,Bs)) (27);
[0074] Where: Bs represents the encrypted value of the response communication ID; H represents the encrypted response ciphertext information; E(DK_x) ipub (MS2,Bs) indicates the use of the device. The public key performs asymmetric decryption on MS2,Bs, where MS2 represents the ciphertext of the response. Generate random numbers for the system;
[0075] Then, through the response adjustable load node device data packet From adjustable load node equipment Send to adjustable load node equipment T6 indicates the time it took for the node to send the response data packet;
[0076] S3.4, at adjustable load node equipment Check if ΔT6≥T6'-T6 is true, and then perform the following calculation:
[0077]
[0078] Get(MS2,Bs)=D(DK_x ipri (H * )) (29);
[0079] Where: Bs' represents the encrypted verification value of the response communication ID; T6` represents the time when the node receives the response data packet; ΔT6 is the sixth verification time threshold; Indicates the second device ID after transmission; H * This represents the encrypted response ciphertext information after transmission; D(DK_x) ipri (H * )) indicates the use of equipment Private key pair H * Decrypt;
[0080] S3.5, at adjustable load node equipment Check if (Bs'=Bs&H1'=H1) is true. If true, then enable the adjustable load node equipment. Respond and take action, otherwise discard the response.
[0081] Furthermore, in S3.3, if no adjustable load node device is found... The public key can then be used to regulate the load node devices. The edge intelligence agent sends a request to the aggregator node to obtain adjustable load node devices. The public key is obtained through the following steps:
[0082] S3.3.1, in adjustable load node equipment Calculate Qs, H3 and H4 are generated, and... Send to the edge intelligence agent:
[0083]
[0084]
[0085]
[0086] Where: Qs is the encrypted value of the first public key request communication ID; H3 and H4 are the hash value of the first public key request communication ID and the encrypted communication data of the first public key request, respectively; T2 is the time when the public key request data packet was sent. To use the edge proxy public key to access Req, Qs, and ID uj , Encryption; Req indicates a public key retrieval request; ID uj This represents the ID of user j;
[0087] S3.3.2, at the edge intelligent agent, check whether ΔT2≥T2'-T2 is true. If it is true, calculate Qs' and H3' and proceed to the next step; otherwise, discard the request.
[0088]
[0089]
[0090]
[0091] Where: Qs' is the encrypted verification value of the first public key request communication ID, and H3' is the hash verification value of the first public key request communication ID. This indicates the use of edge proxy private key pairs. Perform asymmetric decryption; ΔT2` is the second time threshold; and T2` is the time when the edge intelligent agent node receives the response data packet. Request encrypted communication data using the first public key after transmission; This indicates that the system generates random numbers after transmission;
[0092] Subsequently, the edge intelligence agent checks whether (Qs'=Qs&H3'=H3) is true. If it is true, further action is taken; otherwise, malicious activity is reported.
[0093] S3.3.3, computed at the edge intelligent agent:
[0094]
[0095] H5 = H(Os||ID) A ||ID EA (37);
[0096]
[0097] Where: Os is the encrypted value of the second public key request communication ID, H5 and H6 are the hash value of the second public key request communication ID and the encrypted communication data of the second public key request, respectively; P E This represents a random number generated by the edge agent;
[0098] data packet <H5,H6,T3,P E ID EA >Send from the edge intelligent agent to the aggregator node; at the aggregator node, check if ΔT3≥T3'-T3 is true. If true, calculate Os':
[0099]
[0100]
[0101] Where: H5` is the hash verification value of the second public key request communication ID; Os' is the encrypted verification value of the second public key request communication ID; T3 is the time when the edge agent node sends the public key request data packet; T3` is the time when the aggregator node receives the public key request data packet; The ID of the edge intelligent agent after transmission; This represents a random number generated by the edge proxy after transmission;
[0102] Execute formula (41):
[0103]
[0104] in: To use the aggregator's private key Decrypt; Request encrypted communication data using the transmitted second public key;
[0105] Check if (Os'=Os&H5'=H5) is true. If true, search for and retrieve Get(DK_x) from the blockchain record. ipub Simultaneously calculate:
[0106]
[0107] H7=H(Xs||ID A ||ID EA (43);
[0108] H8=E(EK pub (DK_i pub ,Xs)) (44);
[0109] Where: Xs is the encrypted value of the first public key response communication ID; H7 and H8 are the hash value of the first public key response communication ID and the encrypted communication data of the first public key response, respectively; P A E(EK) represents the random value generated by the aggregator node. pub (DK_x ipub ,Xs)) indicates using the edge proxy public key to device D xi Decrypt;
[0110] And <H7,H8,T4,P A ID A >The request is sent from the aggregator node to the edge intelligent agent. If not, the response is discarded and malicious activity is reported; where: T4 represents the time when the aggregator node sends the public key information data packet;
[0111] S3.3.4, at the edge intelligent agent, check whether ΔT4≥T4'-T4 is true, and then calculate:
[0112]
[0113]
[0114]
[0115] Where: Xs` is the encrypted value of the first public key response communication ID; T4` represents the time when the edge agent receives the public key information data packet; ΔT4 represents the fourth time threshold; and H7` represents the hash value verification value of the first public key response communication ID. The aggregator node ID after transmission; This represents the random value generated by the aggregator node after transmission. This indicates the use of the aggregator's private key pair. Decrypt; This indicates the first public key response to the encrypted communication data after transmission;
[0116] S3.3.5, check if (Xs'=Xs&H7'=H7) exists at the adjustable load node, and calculate:
[0117]
[0118] H9 = E(DK_x) jpub (DK_x ipub ,Ps)) (49);
[0119] Where Ys is the encrypted value of the second public key response communication ID; H9 is the encrypted communication data of the second public key response; E(DK_x) jpub (DK_x ipub Ps)) indicates the use of adjustable load node equipment D xj Public key pair DK_x ipub ,Ps is encrypted;
[0120] data packet <H3',H9,T5,P E ID EA >Sent from the edge intelligent agent to the adjustable load node device D xj T5 represents the time when the edge agent sends the public key information data packet;
[0121] S3.3.6, in adjustable load node equipment Check if ΔT5≥T5'-T5 is true, then calculate for the adjustable load node equipment:
[0122]
[0123]
[0124] Where: T5` represents the time when the device receives the public key information data packet, and ΔT5 represents the fifth time threshold. Indicates the use of equipment Private key pair Decrypt; Y represents the encrypted communication data received after transmission via a second public key reply; S `is the encrypted verification value for the second public key response communication ID; Indicates the aggregator node ID after transmission; This represents a random number generated by the edge proxy after transmission;
[0125] Subsequently, at the adjustable load node equipment Check if (Ys'=Ys&H3'=H3) is true. If it is true, execute formulas (26) and (27):
[0126] Will From adjustable load node equipment Send to adjustable load node equipment
[0127] The beneficial effects of this invention are as follows: This invention is a blockchain trusted authentication method for distributed adjustable load interaction. It adopts an improved PBFT consensus algorithm to ensure fairness, reduces overhead based on a hybrid software-defined network architecture, and achieves secure communication through cryptographic hash functions. It can effectively improve the trustworthiness of adjustable load interaction and generate lower communication overhead and storage requirements. Attached Figure Description
[0128] Figure 1 This is a flowchart of a blockchain trusted authentication method for distributed, adjustable load interaction. Detailed Implementation
[0129] The technical solutions of the embodiments of the present invention will be explained and described below with reference to the accompanying drawings. However, the following embodiments are only preferred embodiments of the present invention and not all of them. Other embodiments obtained by those skilled in the art based on the embodiments in the implementation methods without creative effort are all within the protection scope of the present invention.
[0130] A blockchain trusted authentication method for distributed, adjustable load interaction, such as Figure 1 As shown, it includes:
[0131] S1, through a secure channel, enables the adjustable load node to communicate and exchange credentials with the aggregator node, generates a public-private key pair for the adjustable load node, and stores it in the tamper-proof computing unit to complete the initialization;
[0132] The initialization process is as follows:
[0133] S1.1, the adjustable load node includes user ID and device ID. The adjustable load node selects a pseudo-random number and calculates:
[0134]
[0135]
[0136] Where H() is the hash function, ⊕ is the XOR operator, and || is the AND operator; ID ui For user ID, ID dxi For the first device ID, P r Let A1 be the first hash value and A2 be the second hash value; there are n user nodes, and the range of i is from 1 to n; let the i-th user have X i One device, x i Let x represent a device at the i-th user. i The value range is from 1 to X i ;
[0137] S1.2, the adjustable load node sends its ID to the aggregator node via a secure channel. ui A2 and P r Data packets <ID ui A2, P r >, to obtain credentials for communication;
[0138] Based on ID at the aggregator node ui A2 and P r Data packets <ID ui A2, P r Calculation:
[0139]
[0140] And calculate B1, B2 and B A :
[0141]
[0142]
[0143]
[0144] Among them, EK pub AK pub These are the public keys of the edge intelligent agent and the aggregator, respectively; B1 and B2 are the encrypted data of the edge intelligent agent's public key and the aggregator's public key, respectively. A Registration code for adjustable load nodes;
[0145] B is stored in the local repository by the aggregator node based on the device ID. A The values of B1, B2, and B are stored. A and ID EA The value is transmitted to the tamper-proof computing unit to the adjustable load node; where ID EA For the ID of the edge intelligence agent;
[0146] S1.3, at the adjustable load node, decrypt the edge intelligent agent public key and the aggregator public key, the process is as follows:
[0147]
[0148]
[0149] S1.4, Generate a public-private key pair for secure communication at the adjustable load node; enable the aggregator node to share the public key AK with all intelligent edge agents connected to the aggregator node and with other aggregator nodes in the same layer via a secure channel. pub And the ID of the aggregator node.
[0150] S2 filters nodes that meet the conditions, creates blocks based on the improved PBFT consensus algorithm, and enables sharing among aggregators at the same layer to form an adjustable load interaction network to transmit authentication, transaction information, and mutual trust authentication. The ultimate goal is to ensure the confidentiality, integrity, and identity authentication of adjustable load interaction transactions. Among them, the improved PBFT consensus algorithm introduces a leader node selection method to minimize consensus latency.
[0151] The specific process is as follows:
[0152] S2.1, Calculate the hash value and ciphertext via the adjustable load node device Dx i Send ID to aggregator node ui ID dxi H R1 H R2 P r T R1 Data packets <ID ui ID dxi H R1 H R2 ,P r ,T R1 >, satisfying the following formula:
[0153]
[0154]
[0155] H R1 =H(R)h ||T R1 ||P r (11);
[0156] H R2 =E(AK) pub (DK_x ipub ,R s )) (12);
[0157] Where E() is the computational asymmetric encryption, and DK_x ipub For device x i The public key; E(AK) pub (DK_x ipub ,R s )) Using the aggregator's public key to connect the device's public key and R s Encrypt; T R1 The first registration timestamp allows adjustment of the data packet sending time for load node devices; ID A R is the aggregator node ID. s To verify the hash value for the ID, R h H is the encrypted value for the registration ID. R1 H is a timestamp hash value. R2 Public key ciphertext;
[0158] This step is a preprocessing step before encryption, converting variable-length text into fixed-length numbers. Encrypting with the original data would be very labor-intensive. The hash value is equivalent to a digest of the original data, which simplifies the encryption process. The improvements to the PBFT consensus algorithm specifically include:
[0159] S2.2.1, Start: Select a block proposal block from the aggregator nodes according to formula (19);
[0160] min er=R(mod)n (19);
[0161] Here, miner refers to the selected node; R is the current round number; mod is the modulo operator; n is the number of user nodes, specifically the total number of nodes including faulty nodes; this method ensures that the block proposer has a uniformly distributed chance of being selected, avoids repeated selection of the same node, is easy to attract attackers, and produces a low consensus latency.
[0162] S2.2.2, Verification: Create a transaction block and verify the transaction block information outside the leader node; when the total number of verifications is greater than 2N / 3, broadcast the commitment message to the network and proceed to the next step;
[0163] S2.2.3, Commitment: Confirm the additional block on the blockchain. If the total number of commitments is greater than 2N / 3, proceed to the next step.
[0164] S2.2.4, Attach: Attach the proposed block to the blockchain until all nodes have attached it; otherwise, return to step S2.2.1.
[0165] S2.2, check the first time threshold ΔT at the aggregator node. R1 Does ΔT satisfy? R1 ≥T R2 -T R1 If true, then it is calculated using the following formula:
[0166]
[0167]
[0168]
[0169]
[0170] Where D() is for calculating asymmetric decryption, B A ` is the verification code for adjustable load nodes; T` R2 This is the second registration timestamp, i.e., the time when the aggregator node received the data; ΔT R1 Rs′ represents the first registration time threshold; Rs′ represents the calculated ID verification hash value; Rh′ represents the calculated encrypted registration ID value; Get() retrieves the value within the parentheses. This indicates the use of the aggregator's private key pair. Perform asymmetric decryption; These are the transmitted user ID, the transmitted first device ID, the transmitted pseudo-random number, and the transmitted public key ciphertext, respectively.
[0171] This step involves decryption and comparison with local information to confirm the information's legitimacy.
[0172] S2.3, at the aggregator node, check if (Rs' = Rs & H) R1 '=H R1 &B A '=B A If ) is true, then at the aggregator node, the median hash value and the hash value of the current block are calculated using the following formula:
[0173]
[0174] T H =H(M) info (18);
[0175] H R1 '=H(R h '||T R1 ||P r(52);
[0176] Where: M info T is the median value of the hash value. H H contains the hash value of the current block; R1 Verify the hash value for the timestamp;
[0177] S2.4, according to M info and T H A block is created at the aggregator node using an improved PBFT consensus algorithm. This block is then verified at other aggregator nodes to confirm the accuracy of the information and rule out errors caused by non-malicious actions or erroneous data. When an aggregator node receives 2N / 3 commitment messages, it adds the block to the blockchain and sends a registration confirmation message. <confr,T R3 Send from aggregator node to adjustable load node device Adjustable load node equipment Response and check ΔT R2 ≥T R3 -T R1 If the value is true, update the authentication or transaction information of the anti-tampering computing unit to ensure that the information is not tampered with; otherwise, discard the response and trigger step S2.1; where T R3 The third registration timestamp allows adjustment of the time it takes for the load node to receive the registration confirmation message; ΔT R2 The second registration time threshold; N is the total number of aggregator nodes;
[0178] S3, key exchange and communication, verifies transaction information, and reduces the impact of malicious node behavior or bit errors on normal communication and transactions. The specific process is as follows:
[0179] S3.1, at the adjustable load node device D xi Generate ciphertext and a random number, and calculate:
[0180]
[0181]
[0182] H2=E(DK_x ipri (MS1,Ps,ID ui )) (twenty two);
[0183] MS1 is the ciphertext of the request. It is a random number; ID dxi The first information device ID; H1 and H2 are the hash value of the request communication ID and the encrypted request communication data, respectively; P s To request the encrypted value of the communication ID, ID dxj For the second device ID, xj The second information device has a value range of 1 to X. i E(DK_x) ipri (MS1,Ps,ID ui )) indicates the use of equipment Private key pair MS1, Ps, ID ui Perform asymmetric encryption;
[0184] data packet From adjustable load node equipment Send to adjustable load node equipment Adjustable load node equipment Verification is performed at the location; where T1 is the time it takes for the node to send the response request data packet.
[0185] S3.2, at the adjustable load node device D xj The system checks whether ΔT1≥T1'-T1 is true. If it is true, it proceeds to the next step; otherwise, it discards the response. Here, ΔT1 is the first verification time threshold, and T1' is the time it takes for the node to receive the response request data packet. This step is used to verify the validity of the time and detect message replay attacks.
[0186] S3.3, Locate adjustable load node devices in the local repository. If the public key is found, then in the adjustable load node device... The following calculations are performed:
[0187]
[0188]
[0189]
[0190] Where: Ps` represents the request communication ID encryption verification; H1` represents the request communication ID hash verification value; The first device ID after transmission; This is the second device ID after transmission; This indicates the encrypted request communication data after transmission; Indicates the use of equipment public key pair Perform asymmetric encryption;
[0191] Then check if (Ps'=Ps&H1'=H1) is true. If it is true, then calculate:
[0192]
[0193] H = E(DK_x) ipub(MS2,Bs)) (27);
[0194] Where: Bs represents the encrypted value of the response communication ID; H represents the encrypted response ciphertext information; E(DK_x) ipub (MS2,Bs) indicates the use of the device. The public key performs asymmetric decryption on MS2,Bs, where MS2 represents the ciphertext of the response. Generate random numbers for the system;
[0195] Then, through the response adjustable load node device data packet From adjustable load node equipment Send to adjustable load node equipment T6 indicates the time it took for the node to send the response data packet;
[0196] If no adjustable load node device is found The public key can then be used to regulate the load node devices. The edge intelligence agent sends a request to the aggregator node to obtain adjustable load node devices. The public key is obtained through the following steps:
[0197] S3.3.1, in adjustable load node equipment Calculate Qs, H3 and H4 are generated, and... Send to the edge intelligence agent:
[0198]
[0199]
[0200]
[0201] Where: Qs is the encrypted value of the first public key request communication ID; H3 and H4 are the hash value of the first public key request communication ID and the encrypted communication data of the first public key request, respectively; T2 is the time when the public key request data packet was sent. To use the edge proxy public key to access Req, Qs, and ID uj , Encryption; Req indicates a public key retrieval request; ID uj This represents the ID of user j;
[0202] S3.3.2, at the edge intelligent agent, check whether ΔT2≥T2'-T2 is true. If it is true, calculate Qs' and H3' and proceed to the next step; otherwise, discard the request.
[0203]
[0204]
[0205]
[0206] Where: Qs' is the encrypted verification value of the first public key request communication ID, and H3' is the hash verification value of the first public key request communication ID. This indicates the use of edge proxy private key pairs. Perform asymmetric decryption; ΔT`2 is the second time threshold; and T2` is the time when the edge intelligent agent node receives the response data packet. Request encrypted communication data using the first public key after transmission; This indicates that the system generates random numbers after transmission;
[0207] Subsequently, the edge intelligence agent checks whether (Qs'=Qs&H3'=H3) is true. If it is true, further action is taken; otherwise, malicious activity is reported.
[0208] S3.3.3, computed at the edge intelligent agent:
[0209]
[0210] H5 = H(Os||ID) A ||ID EA (37);
[0211]
[0212] Where: Os is the encrypted value of the second public key request communication ID, H5 and H6 are the hash value of the second public key request communication ID and the encrypted communication data of the second public key request, respectively; P E This represents a random number generated by the edge agent;
[0213] data packet <H5,H6,T3,P E ID EA >Send from the edge intelligent agent to the aggregator node; at the aggregator node, check if ΔT3≥T3'-T3 is true. If true, calculate Os':
[0214]
[0215]
[0216] Where: H5` is the hash verification value of the second public key request communication ID; Os' is the encrypted verification value of the second public key request communication ID; T3 is the time when the edge agent node sends the public key request data packet; T3` is the time when the aggregator node receives the public key request data packet; The ID of the edge intelligent agent after transmission; This represents a random number generated by the edge proxy after transmission;
[0217] Execute formula (41):
[0218]
[0219] in: To use the aggregator's private key Decrypt; Request encrypted communication data using the transmitted second public key;
[0220] Check if (Os'=Os&H5'=H5) is true. If true, search for and retrieve Get(DK_x) from the blockchain record. ipub Simultaneously calculate:
[0221]
[0222] H7=H(Xs||ID A ||ID EA (43);
[0223] H8=E(EK pub (DK_i pub ,Xs)) (44);
[0224] Where: Xs is the encrypted value of the first public key response communication ID; H7 and H8 are the hash value of the first public key response communication ID and the encrypted communication data of the first public key response, respectively; P A E(EK) represents the random value generated by the aggregator node. pub (DK_x ipub ,Xs)) indicates using the edge proxy public key to the device Decrypt;
[0225] And <H7,H8,T4,P A ID A >The request is sent from the aggregator node to the edge intelligent agent. If not, the response is discarded and malicious activity is reported; where: T4 represents the time when the aggregator node sends the public key information data packet;
[0226] S3.3.4, at the edge intelligent agent, check whether ΔT4≥T4'-T4 is true, and then calculate:
[0227]
[0228]
[0229]
[0230] Where: Xs` is the encrypted value of the first public key response communication ID; T4` represents the time when the edge agent receives the public key information data packet; ΔT4 represents the fourth time threshold; and H7` represents the hash value verification value of the first public key response communication ID. The aggregator node ID after transmission; This represents the random value generated by the aggregator node after transmission. This indicates the use of the aggregator's private key pair. Decrypt; This indicates the first public key response to the encrypted communication data after transmission;
[0231] S3.3.5, check if (Xs'=Xs&H7'=H7) exists at the adjustable load node, and calculate:
[0232]
[0233] H9 = E(DK_x) jpub (DK_x ipub ,Ps)) (49);
[0234] Where Ys is the encrypted value of the second public key response communication ID; H9 is the encrypted communication data of the second public key response; E(DK_x) jpub (DK_x ipub Ps) indicates the use of adjustable load node equipment. Public key pair DK_x ipub ,Ps is encrypted;
[0235] data packet <H3',H9,T5,P E ID EA Send from the edge intelligent agent to the adjustable load node device T5 represents the time when the edge agent sends the public key information data packet;
[0236] S3.3.6, in adjustable load node equipment Check if ΔT5≥T5'-T5 is true, then calculate for the adjustable load node equipment:
[0237]
[0238]
[0239] Where: T5` represents the time when the device receives the public key information data packet, and ΔT5 represents the fifth time threshold. Indicates the use of equipment Private key pair Decrypt; Y represents the encrypted communication data received after transmission via a second public key reply; S`is the encrypted verification value for the second public key response communication ID; Indicates the aggregator node ID after transmission; This represents a random number generated by the edge proxy after transmission;
[0240] Subsequently, at the adjustable load node equipment Check if (Ys'=Ys&H3'=H3) is true. If it is true, execute formulas (26) and (27):
[0241] Will From adjustable load node equipment Send to adjustable load node equipment
[0242] S3.4, at adjustable load node equipment Check if ΔT6≥T6'-T6 is true, and then perform the following calculation:
[0243]
[0244] Get(MS2,Bs)=D(DK_x ipri (H * )) (29);
[0245] Where: Bs' represents the encrypted verification value of the response communication ID; T6` represents the time when the node receives the response data packet; ΔT6 is the sixth verification time threshold; Indicates the second device ID after transmission; H * This represents the encrypted response ciphertext information after transmission; D(DK_x) ipri (H * )) indicates the use of equipment Private key pair H * Decrypt;
[0246] S3.5, at the adjustable load node device D xi Check if (Bs'=Bs&H1'=H1) is true. If true, then enable the adjustable load node equipment. Respond and take action, otherwise discard the response.
[0247] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Those skilled in the art should understand that the present invention includes, but is not limited to, the contents described in the accompanying drawings and the specific embodiments above. Any modifications that do not depart from the functional and structural principles of the present invention will be included within the scope of the claims.
Claims
1. A blockchain trusted authentication method for distributed, adjustable load interaction, characterized in that, include: S1, the adjustable load node communicates and exchanges credentials with the aggregator node through a secure channel, generates a public-private key pair for the adjustable load node, and stores it in the tamper-proof computing unit, completing the initialization; the initialization process specifically includes: S1.1, the adjustable load node includes user ID and device ID. The adjustable load node selects a pseudo-random number and calculates: (1); (2); Where H() is the hash function, ⊕ is the XOR operator, and || is the AND operator; For user ID, The first device ID, P r Pseudo-random numbers ,A 1 is the first hash value. A 2 is the second hash value; there are n user nodes. i The range is 1 to n Let the first i One user has X i One device x i Indicates the first i One device at each user's location, then x i The value range is 1 to X i ; S1.2, the adjustable load node sends data to the aggregator node via a secure channel. ID ui 、A 2 and P r Data packets To obtain credentials for communication; At the aggregator node, according to ID ui 、A 2 and P r Data packets calculate: (3); and calculation B 1 、B 2 and B A : (4); (5); (6); in, EK pub , AK pub These are the edge intelligence agent's public key and the aggregator's public key, respectively. B 1 、B 2 represents the data encrypted with the public key of the edge intelligent agent and the data encrypted with the public key of the aggregator, respectively. B A Registration code for adjustable load nodes; Stored in the local repository by aggregator nodes based on device ID. B A The value, and store B 1 、B 2 、B A and ID EA The value is transmitted to the tamper-proof computing unit to the adjustable load node; where, ID EA For the ID of the edge intelligence agent; S1.3, at the adjustable load node, decrypt the edge intelligent agent public key and the aggregator public key, the process is as follows: (7); (8); S1.4, Generate a public-private key pair for secure communication at the adjustable load node; enable the aggregator node to share the public key with all intelligent edge agents connected to the aggregator node and with other aggregator nodes in the same layer via a secure channel. AK pub S1. The aggregator node ID; S2. Filter aggregator nodes that meet the conditions, create blocks based on the improved PBFT consensus algorithm, and realize sharing among aggregators in the same layer to form an adjustable load interaction network to transmit authentication, transaction information and mutual trust authentication. The ultimate goal is to ensure the confidentiality, integrity and identity authentication of adjustable load interaction transactions. Among them, the improved PBFT consensus algorithm introduces a leader node selection method to minimize consensus latency. S3, key exchange and communication, verifies transaction information.
2. The blockchain trusted authentication method for distributed adjustable load interaction according to claim 1, characterized in that, The specific process of step S2 is as follows: S2.1, Calculate the hash value and ciphertext via an adjustable load node device. Send to aggregator node ID ui , , H R1 , H R2 , P r , T R1 Data packets It satisfies the following formula: (9); (10); (11); (12); in, E ( ) represents the computation of asymmetric encryption. For equipment x i The public key; Using the aggregator's public key to the device's public key and R s Encrypt; T R1 The first registration timestamp allows adjustment of the data packet sending time of the load node device; ID A For aggregator node ID, R s Verify the hash value for the ID. R h for Registration ID encryption value H R1 For timestamp hash value, H R2 Public key ciphertext; S2.2, Check the first time threshold at the aggregator node. Does it meet the requirements? If true, then it is calculated using the following formula: (13); (14); (15); (16); in, To compute asymmetric decryption, B A ` Verification coding for adjustable load nodes; T R2 This is the second registration timestamp, i.e., the time when the aggregator node received the data; The first registration time threshold; This represents the calculated ID verification hash value; This represents the calculated encrypted value of the registration ID. `Get()` retrieves the value within the parentheses. This indicates the use of the aggregator's private key pair. Perform asymmetric decryption; , , , These are the transmitted user ID, the transmitted first device ID, the transmitted pseudo-random number, and the transmitted public key ciphertext, respectively. S2.3, check at the aggregator node if If true, then at the aggregator node, calculate the median hash value and the hash value of the current block using the following formula: (17); (18); (52); in: M info The median value of the hash value. T H Contains the hash value of the current block; H R1 Verify the hash value for the timestamp; S2.4, according to M info and T H A block is created at the aggregator node using an improved PBFT consensus algorithm, and the block is verified at other aggregator nodes to confirm the accuracy of the information. When an aggregator node receives 2N / 3 commitment messages, it adds the block to the blockchain and registers a confirmation message. Send from aggregator node to adjustable load node device In adjustable load node equipment Response and inspection If the value is true, update the authentication or transaction information of the anti-tampering computing unit to ensure that the information is not tampered with; otherwise, discard the response and trigger step S2.1; where, T R3 The third registration timestamp can be used to adjust the time when the load node receives the registration confirmation message; The second registration time threshold is denoted by N; N is the total number of aggregator nodes.
3. The blockchain trusted authentication method for distributed adjustable load interaction according to claim 2, characterized in that, The improvement of the PBFT consensus algorithm in step S2.4 specifically includes: S2.4.1, Start: Select a proposal block from the aggregator nodes according to formula (19); (19); in, miner This refers to the selected node; R is the current round number, and mod is the modulo operator. n It is a user node; S2.4.2, Verification: Create a transaction block and verify the transaction block information outside the leader node; when the total number of verifications is greater than 2N / 3, broadcast the commitment message to the network and proceed to the next step; S2.4.3, Commitment: Confirm the blockchain additional block. If the total number of commitments is greater than 2N / 3, proceed to the next step; S2.4.4, Attach: Attach the proposed block to the blockchain until all nodes have attached it; otherwise, return to step S2.2.
1.
4. The blockchain trusted authentication method for distributed adjustable load interaction according to claim 3, characterized in that, The specific verification messages in S2.2.2 include the block number, the previous block hash, the random number, and the Merkle root.
5. The blockchain trusted authentication method for distributed adjustable load interaction according to claim 2, characterized in that, Step 3 is as follows: S3.1, in adjustable load node equipment Generate ciphertext and a random number, and calculate: (20); (21); (22); in, To request the ciphertext, It is a random number; The first device ID; H 1. H 2 represents the hash value of the request communication ID and the encrypted request communication data, respectively; Ps To request the encrypted value of the communication ID, For the second device ID, x j For the second device, its value ranges from 1 to... X i ; Indicates the use of equipment Private key pair Perform asymmetric encryption; data packet From adjustable load node equipment Send to adjustable load node equipment In adjustable load node equipment Verification is performed at the following locations; among them T 1 represents the time it takes for a node to send a response request data packet; S3.2, at adjustable load node equipment Inspection If the value is true, proceed to the next step; otherwise, discard the response. The first verification time threshold, T 1 ’ This refers to the time when the node receives the response request data packet; this step is used to verify the validity of the time and detect message replay attacks. S3.3, Locate adjustable load node devices in the local repository. If the public key is found, then in the adjustable load node device... The following calculations are performed: (23); (24); (25); in: Ps` This indicates a request for encrypted verification of the communication ID; H 1 ` This indicates the request communication ID hash value verification value; The first device ID after transmission; This is the second device ID after transmission; This indicates the encrypted request communication data after transmission; Indicates the use of equipment public key pair Perform asymmetric encryption; Subsequent inspection Is it true? If true, then calculate: (26); (27); in: Bs This indicates the encrypted value of the response communication ID; H This represents the encrypted ciphertext information of the response; Indicates the use of equipment public key pair Perform asymmetric decryption. MS 2 indicates the ciphertext response; Generate random numbers for the system; Then, through the response adjustable load node device , will data packet From adjustable load node equipment Send to adjustable load node equipment ; T 6 indicates the time it took for the node to send the response data packet; This represents the ID of user j; S3.4, at adjustable load node equipment Inspection Check if it is true, and then perform the following calculation: (28); (29); in: This indicates the encrypted verification value of the response communication ID; T 6` indicates the time it took for the node to receive the response data packet; The sixth verification time threshold; Indicates the second device ID after transmission; H * This represents the encrypted response ciphertext information after transmission; Indicates the use of equipment Private key pair H * Decrypt; S3.5, at adjustable load node equipment Inspection If true, then enable the adjustable load node equipment. Respond and take action, otherwise discard the response.
6. The blockchain trusted authentication method for distributed adjustable load interaction according to claim 5, characterized in that, In S3.3, if no adjustable load node device is found... The public key can then be used to regulate the load node devices. The edge intelligence agent sends a request to the aggregator node to obtain adjustable load node devices. The public key is obtained through the following steps: S3.3.1, in adjustable load node equipment calculate Qs , , H 3. H 4, and will Send to the edge intelligence agent: (30); (31); (32); in: Qs Request the encrypted value of the communication ID for the first public key. H 3. H 4 represents the hash value of the communication ID requested by the first public key and the encrypted communication data requested by the first public key, respectively; T 2 represents the time when the public key request data packet was sent. To use the public key pair of the edge proxy Information encryption; Req This indicates a public key retrieval request. ID uj Indicates user j ID; The ID representing the edge intelligence agent; S3.3.2, Check at the edge intelligent agent Is it true? If true, then calculate. and The request will be discarded if the next step is not initiated. (33); (34); (35); in: Request a communication ID encryption verification value for the first public key. H 3` represents the hash value verification value of the communication ID requested by the first public key. This indicates the use of edge proxy private key pairs. Perform asymmetric decryption; The second time threshold; and T 2 ` The time it takes for the edge intelligent agent node to receive response data packets; Request encrypted communication data using the first public key after transmission; This indicates that the system generates random numbers after transmission; Subsequently, an inspection was conducted at the edge intelligence agent. If true, proceed further; otherwise, report malicious activity. S3.3.3, computed at the edge intelligent agent: (36); (37); (38); in: Os Request the encrypted value of the communication ID for the second public key. H 5. H 6 represents the hash value of the communication ID requested by the second public key and the encrypted communication data requested by the second public key, respectively. P E This represents a random number generated by the edge agent; data packet Send from the edge intelligence agent to the aggregator node; check at the aggregator node. Is it true? If true, calculate... : (39); (40); in: H 5` represents the hash value verification value of the communication ID requested by the second public key; Request a communication ID encryption verification value for the second public key; T 3 represents the time it takes for the edge proxy node to send the public key request data packet; T 3` represents the time it takes for the aggregator node to receive the public key request data packet; The ID of the edge intelligent agent after transmission; This represents a random number generated by the edge proxy after transmission; Execute formula (41): (41); in: To use the aggregator's private key Decrypt; Request encrypted communication data using the transmitted second public key; examine If true, then search for and obtain it in the blockchain record. Simultaneously calculate: (42); (43); (44); in: Xs The first public key is used to encrypt the communication ID value. H 7. H 8 represents the hash value of the first public key response communication ID and the encrypted communication data of the first public key response, respectively; P A This represents the random value generated by the aggregator node. This indicates the use of the edge proxy public key pair. Encrypt; And The request is sent from the aggregator node to the edge intelligence agent; if not, the response is discarded and malicious activity is reported. Wherein: T 4 indicates the time when the aggregator node sent the public key information data packet; S3.3.4, Check at the edge intelligent agent Check if it is true, then calculate: (45); (46); (47); in: Xs` The first public key is used to encrypt the communication ID value. T 4` indicates the time when the edge agent receives the public key information data packet. This represents the fourth time threshold. H 7` represents the hash value verification value of the first public key response communication ID; This is the aggregator node ID after transmission; This represents the random value generated by the aggregator node after transmission. This indicates the use of the aggregator's private key pair. Decrypt; This indicates the first public key response to the encrypted communication data after transmission; S3.3.5, Check for the presence of [something] at the adjustable load node. ,calculate: (48); (49); in, The second public key is used to encrypt the communication ID value. H 9 represents the second public key used to encrypt communication data; Indicates the use of adjustable load node equipment public key pair Encrypt; data packet Send from the edge intelligent agent to the adjustable load node device ;in T 5 indicates the time when the edge agent sent the public key information data packet; S3.3.6, in adjustable load node equipment Inspection If true, then calculate at the adjustable load node equipment: (50); (51); in: T 5` indicates the time when the device received the public key information data packet. This indicates the fifth time threshold. Indicates the use of equipment Private key pair Decrypt; This indicates that the second public key has been used to respond to the encrypted communication data after transmission. The second public key is used to encrypt the communication ID verification value. Indicates the aggregator node ID after transmission; This represents a random number generated by the edge proxy after transmission; Subsequently, at the adjustable load node equipment Inspection If true, execute formulas (26) and (27): Will From adjustable load node equipment Send to adjustable load node equipment .