Building carbon emission data evidence storage method based on block chain
Through blockchain-based homomorphic encryption and multi-party computing protocols, safe calculation and evidence storage of building carbon emission data are realized, data privacy and security issues are solved, and data security sharing and the reliability of the data in an encrypted state are ensured.
Patent Information
- Application Number
- CN202510476550.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-16
- Publication Date
- 2025-07-29
AI Technical Summary
When building carbon emission data is shared among multiple stakeholders, there is a risk of data breaches, abuses and competitors’ acquisition of data. Existing centralized storage and centralized computing methods cannot guarantee data privacy and security and the security of the computing process.
The blockchain-based construction carbon emission data proof-keeping method is used to encrypt the carbon emission data using a homomorphic encryption algorithm, and it is divided into multiple secret shares and allocated to multiple computing units. The total carbon emissions are calculated jointly through multi-party computing protocols. The results are verified by the verification node and stored on the blockchain.
Computing in an encrypted state avoids exposure of original data, improves privacy and security, ensures that a single computing party cannot recover complete data, and all participants calculate together to ensure the security and privacy of the computing process without relying on trusted third parties.
Smart Images

Figure CN120387178A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data deposit and evidence, and specifically relates to a method for depositing and evidencing building carbon emission data based on blockchain. Background Art
[0002] With the increasing global attention to climate change issues, carbon emissions in the construction industry are regarded as one of the important areas for reducing greenhouse gas emissions. The carbon emissions of buildings not only come from the material and energy consumption during the construction process, but also include the energy use during the operation stage and the final demolition and waste stage.
[0003] The existing technology has the following defects:
[0004] Since building carbon emission data usually involves multiple stakeholders such as construction parties and supply chain management parties and belongs to business secrets, direct sharing may lead to data abuse. Currently, the calculation of carbon emission data usually adopts centralized storage + centralized calculation, and all data is transmitted to regulatory agencies or third-party platforms, resulting in the possibility of data leakage, abuse or tampering. Moreover, the data of supply chain management parties (such as building material suppliers) and construction parties has commercial competitive value, and direct sharing may cause competitors to obtain the enterprise's emission data, thus affecting market competition.
[0005] Based on this, the present invention proposes a method for depositing and evidencing building carbon emission data based on blockchain, enabling data to be directly calculated in an encrypted state, avoiding the exposure of original data, ensuring that a single computing party cannot restore complete data, enhancing privacy and security, and allowing all participating parties to jointly calculate without relying on a trusted third party to ensure the security of the calculation process. Summary of the Invention
[0006] The purpose of the present invention is to provide a method for depositing and evidencing building carbon emission data based on blockchain to solve the deficiencies in the background art.
[0007] To achieve the above purpose, the present invention provides the following technical solution: A method for depositing and evidencing building carbon emission data based on blockchain, the depositing and evidencing method comprising the following steps:
[0008] The acquisition end obtains the carbon emission data of all participating parties in a building project and encrypts the carbon emission data of each participating party using a homomorphic encryption algorithm;
[0009] Split the carbon emission data of each participating party into multiple secret shares, and distribute all the secret shares belonging to one participating party to multiple computing units;
[0010] Each computing unit jointly calculates the total carbon emissions of the building project through the MPC protocol, and the calculated result is verified for accuracy by a verification node. After the accuracy verification is completed, the final total carbon emissions are stored in the blockchain.
[0011] In a preferred embodiment, the accuracy of the calculated result is verified by a verification node, including the following steps:
[0012] After obtaining the running data of the computing unit, the verification node obtains the total confidence score of multiple computing units, analyzes the calculation results of multiple computing units, and obtains the anomaly index of the calculation results;
[0013] The result coefficient is obtained by combining the calculation result's anomaly index with the total confidence score of multiple calculation units. The expression is: Where jgh is the result coefficient, is the total confidence score, θ is the mutation index, B is the number of computing units, is the confidence score of the i-th computing unit;
[0014] The obtained result coefficient is compared with the preset coefficient threshold. The coefficient threshold is used to analyze whether the accuracy of the calculation result is qualified. If the result coefficient is less than or equal to the coefficient threshold, the accuracy of the calculation result analyzed by the verification node is qualified. If the result coefficient is greater than the coefficient threshold, the accuracy of the calculation result analyzed by the verification node is unqualified.
[0015] In a preferred embodiment, the logic for obtaining the calculation result variation index is as follows: after obtaining the carbon emission values calculated multiple times by the calculation unit, the calculation fluctuation amplitude is calculated based on the carbon emission values calculated multiple times. The expression is: Where DF is the calculated fluctuation amplitude, G is the total number of calculations of the calculation unit, and P i is the carbon emission value obtained by the i-th calculation, P avg The carbon emission mean is obtained. After obtaining the maximum carbon emission value and the minimum carbon emission value, the calculation difference is obtained by subtracting the minimum carbon emission value from the maximum carbon emission value. The calculation difference and the calculation fluctuation amplitude are normalized to obtain the normalized calculation difference value and the normalized calculation fluctuation amplitude value. The normalized calculation difference value and the normalized calculation fluctuation amplitude value are summed to obtain the variation factor. The variation factors of multiple calculation units are summed to obtain the variation index.
[0016] In a preferred embodiment, after obtaining the operation data of the computing units, the verification node obtains the total confidence scores of the multiple computing units, including the following steps:
[0017] Get the anomaly score of the computation unit, expressed as: In the formula, A i is the abnormality score of the i-th computing unit, E i is the calculation error of the i-th calculation unit, S i is the computation timeout frequency of the i-th computation unit, is the average calculation error of all calculation units, is the average value of the calculation timeout frequencies of all computing units. The logic for obtaining the calculation error is as follows: Obtain the value calculated when a computing unit fails and issues a warning, and obtain the value calculated under normal conditions of the computing unit. Subtract the value calculated under normal conditions from the value calculated when a failure warning is issued to obtain a numerical difference, and divide the absolute value of the numerical difference by the value calculated under normal conditions to obtain the calculation error;
[0018] Obtain the normality score of the computing unit. The expression is: In the formula, N i is the normality score of the i-th computing unit, and R i is the number of abnormal error reports of the i-th computing unit during the monitoring period, is the average number of errors of all computing units during the same period;
[0019] Subtract the abnormality score from the normality score to obtain the confidence score of the computing unit. The expression is:
[0020] In the formula, is the confidence score of the i-th computing unit.
[0021] In a preferred embodiment, each computing unit jointly calculates the total carbon emissions of a construction project through the MPC protocol, including the following steps:
[0022] Computing units C1 and C2 calculate Enc(D A 1 + D B 2) through the MPC protocol. After all computing units cooperate, the encrypted total carbon emissions Enc(D total ) are obtained;
[0023] Computing units C1 and C2 respectively hold the encrypted results Enc(D A 1) and Enc(D B 2), and merge the results to obtain the encrypted total carbon emissions: Enc(D total ) = Enc(D A 1) + Enc(D B 2).
[0024] In a preferred embodiment, splitting the carbon emission data of each participant into multiple secret shares and distributing all the secret shares belonging to one participant to multiple computing units includes the following steps:
[0025] Split the carbon emission data D of each participant into multiple secret shares through the Shamir secret sharing method;
[0026] Shamir secret sharing splits data D into multiple shares such that b shares can reconstruct the original data, while b - 1 shares cannot recover the data. For carbon emission data D_A, assume that the carbon emission data of each participant is split into h shares, where at least b shares are required to recover the data;
[0027] Use the method of polynomial interpolation to generate shares. For the carbon emission data D_A of the participant, generate a polynomial: f(x) = a0 + a1x + a2x 2 +...+a b-1 x b-1 , where f(x) represents the polynomial function generated by interpolation and is used to calculate the corresponding results for different x values. a0 is the carbon emission data D_A. Generate h shares according to the polynomial: (x1, f(x1)), (x2, f(x2)),...,(xh, f(xh)), and distribute the h shares to different computing units.
[0028] In a preferred embodiment, the acquisition end obtains the carbon emission data of all participants in the construction project and encrypts the carbon emission data of each participant using the homomorphic encryption algorithm, including the following steps:
[0029] Collect the carbon emission data of each participant in the construction project respectively, including the carbon emissions during the construction process and the carbon emissions of building materials, and encrypt the carbon emission data of each participant using the Paillier homomorphic encryption algorithm.
[0030] In a preferred embodiment, encrypting the carbon emission data of each participant using the Paillier homomorphic encryption algorithm includes the following steps:
[0031] Generate a public-private key pair required for the Paillier encryption algorithm for each participant. The public key pk is used to encrypt the carbon emission data and is publicly available to all participants, and the private key sk is used to decrypt the data and is held only by the data owner;
[0032] The generation of public and private keys includes the following steps:
[0033] Select prime numbers p and q, calculate n = p * q, and n is used as the modulus in the encryption process;
[0034] Calculate λ(n) = lcm(p - 1, q - 1), where λ(n) is the Lagrange function of n. Select a random number g, and g is n 2 , calculate μ = (L(g λ(n) mod n 2 )) (-1) mod n, and μ is part of the private key. Here, L(x) = (x - 1) / n, and L(x) is an auxiliary function used to process L(g λ(n) mod n2 ) result;
[0035] Generate the public key pk = (n, g) and the private key sk = (λ(n), μ). The public key is distributed to all participating parties for encrypting data, and the private key is kept secret and held only by the data provider for decrypting data;
[0036] Use the Paillier public key (pk = (n, g)) to encrypt the carbon emission data of each participating party, including the following steps:
[0037] The participating party selects a random number r, where r satisfies r < n and r is relatively prime to n, and uses the public key (n, g) and the data m for encryption, and calculates: c = g m ·r n mod n 2 , where c is the encrypted ciphertext, m is the original data, and r is the random number.
[0038] In the above technical solution, the technical effects and advantages provided by the present invention:
[0039] The present invention obtains the carbon emission data of all participating parties in a construction project, encrypts the carbon emission data of each participating party using a homomorphic encryption algorithm, splits the carbon emission data of each participating party into multiple secret shares, and distributes all the secret shares belonging to a participating party to multiple computing units. Each computing unit jointly calculates the total carbon emissions of the construction project through the MPC protocol. The calculated result is verified for accuracy by a verification node, and after the accuracy verification is completed, the final total carbon emissions are stored in the blockchain. The regulatory agency queries the deposit information through the blockchain. This deposit method enables direct calculation of data in an encrypted state, avoids exposure of the original data, ensures that a single computing party cannot recover the complete data, improves privacy security, and all participating parties jointly calculate without relying on a trusted third party, ensuring the security of the calculation process. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required in the embodiments. Obviously, the drawings described below are only some embodiments recorded in the present invention. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings.
[0041] Figure 1 It is the method flow chart of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0042] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0043] Embodiment 1: Please refer to Figure 1 As shown, the method for storing building carbon emission data based on blockchain in this embodiment includes the following steps:
[0044] The acquisition end obtains the carbon emission data of all participants in the construction project, encrypts the carbon emission data of each participant using a homomorphic encryption algorithm (such as Paillier encryption) so that the encrypted data can be directly calculated without decryption to ensure privacy protection, splits the carbon emission data of each participant into multiple secret shares, and distributes all the secret shares belonging to one participant to multiple computing units so that a single computing unit cannot restore the original data. Only when all computing units calculate together can the final total carbon emissions be reconstructed. Each computing unit jointly calculates the total carbon emissions of the construction project through the MPC protocol without disclosing the original data. The calculated result is verified for accuracy by the verification node, and after the accuracy verification is completed, the final total carbon emissions are stored in the blockchain, rather than storing the original data of each party. The regulatory agency can query the stored information through the blockchain and conduct audits.
[0045] This application obtains the carbon emission data of all participants in the construction project, encrypts the carbon emission data of each participant using a homomorphic encryption algorithm, splits the carbon emission data of each participant into multiple secret shares, and distributes all the secret shares belonging to one participant to multiple computing units. Each computing unit jointly calculates the total carbon emissions of the construction project through the MPC protocol. The calculated result is verified for accuracy by the verification node, and after the accuracy verification is completed, the final total carbon emissions are stored in the blockchain. The regulatory agency queries the stored information through the blockchain. This method of storing evidence enables data to be directly calculated in an encrypted state, avoids the exposure of original data, ensures that a single computing party cannot restore the complete data, improves privacy security, and all participants calculate together without relying on a trusted third party, ensuring the security of the calculation process.
[0046] Embodiment 2: The acquisition end obtains the carbon emission data of all participants in the construction project, encrypts the carbon emission data of each participant using a homomorphic encryption algorithm (such as Paillier encryption) so that the encrypted data can be directly calculated without decryption to ensure privacy protection, including the following steps:
[0047] Each participant in the construction project (such as the construction party, the supply chain management party, the government supervision party, etc.) separately collects carbon emission-related data (such as carbon emissions during construction, carbon emissions of building materials, etc.). The carbon emission data of each participant is private and not intended to be disclosed to other participants.
[0048] Use the Paillier homomorphic encryption algorithm to encrypt the carbon emission data of each participant. This encryption method can ensure that certain mathematical operations (such as addition) can be performed on the encrypted data without decrypting it.
[0049] Suppose the carbon emission data of construction party A is 100 tons of CO2, which becomes Enc(100) after encryption. Suppose the carbon emission data of supply chain management party B is 150 tons of CO2, which becomes Enc(150) after encryption. The encrypted data Enc(100) and Enc(150) can be directly added without decryption. The encrypted data can only be decrypted by the participant holding the private key. Therefore, construction party A and supply chain management party B each hold their own private keys for decrypting their own data.
[0050] Each participant encrypts its own carbon emission data using the Paillier homomorphic encryption algorithm, including the following steps:
[0051] Generate the public and private key pairs required for the Paillier encryption algorithm for each participant: Public key pk: used to encrypt carbon emission data and is publicly available to all participants. Private key sk: used to decrypt data and is only held by the data owner.
[0052] The public and private key generation process includes: Select two large prime numbers p and q. Calculate n = p * q, and n is used as the modulus in the encryption process. Calculate λ(n) = lcm(p - 1, q - 1), where λ(n) is the Lagrange function of n, and the Lagrange function is used to determine the "effective" encryption space of a number n, which is the least common multiple (lcm, i.e., least - common - multiple) of p - 1 and q - 1. Select a random number g to ensure that the order of g satisfies certain conditions, usually g = n 2 。Calculate μ = (L(g λ(n) mod n 2 )) (-1) mod n, where L(x) = (x - 1) / n. Finally, generate: Public key pk = (n, g). Private key sk = (λ(n), μ). The public key will be distributed to all participants for encrypting data. The private key remains secret and is only held by the data provider (participant) for decrypting data.
[0053] p and q are two large prime numbers. Usually, they should be large enough to ensure the security of the encryption process. They are the core of Paillier encryption. Any attacker trying to crack the encrypted data must rely on the problem of factoring large numbers (which is considered a difficult problem).
[0054] Selection of p and q: They need to be random and distinct, and in practical applications, it is usually necessary to ensure that they do not have any special mathematical structure (for example, ensure that they are not twin primes close to each other) to enhance the security of the encryption algorithm.
[0055] n is the "modulus" of Paillier encryption. It is obtained by multiplying two prime numbers p and q. The size of n determines the security of the encryption algorithm. In practical applications, n is usually chosen as a very large value (such as 2048 bits or longer) to ensure its security. n also serves as the modulus in encryption and decryption operations and appears in many calculations, including addition operations in the encryption process and decryption operations.
[0056] λ(n), that is, the Euler's totient function of n, is used to ensure the correctness of the encryption operation. λ(n) is a very important parameter, which is used to control the exponentiation operation in the encryption process. It is also crucial when calculating the key and directly affects the security of encryption.
[0057] g is the base used in the encryption process. The order of g refers to the smallest integer k such that g^k ≡ 1 (mod n 2 ). Selecting a suitable g is to ensure the homomorphic property of the addition operation in the encryption process. In Paillier encryption, the order of g needs to be related to the value of n to ensure the mathematical properties of encryption and decryption. By selecting a suitable g, it can be ensured that the encryption operation satisfies the expected homomorphism (additive homomorphism).
[0058] μ is a key parameter in Paillier encryption and is part of the private key. L(x) is an auxiliary function, and the role of this function is to enable the encryption process to use mathematical properties for effective decryption. In practical applications, L(g λ(n) mod n 2 will produce a result, and then perform the inverse operation modulo n to obtain μ. μ is part of the private key and is used to decrypt the encrypted message. The security of the Paillier algorithm depends on the fact that after obtaining the ciphertext from the public keys g and n, the private key μ can be used to correctly decrypt the data. When decrypting, calculate g λ(n) and obtain the result through the L function, and then perform the inverse operation to obtain μ for restoring the original message (i.e., carbon emission data).
[0059] In this application, "mod" is a symbol in modular-arithmetic, representing the remainder operation. Specifically, a mod b means dividing a by b and then returning the remainder. In other words, a mod b calculates the remainder after dividing a by b. In encryption algorithms (such as Paillier encryption), mod is widely used to ensure that numerical values cycle within a certain range. For example, in the encryption calculation of large numbers, all operations are usually carried out under n 2 (the modulus), so as to ensure that the result does not exceed the predetermined range.
[0060] Each participating party (e.g., the construction party, the supply chain management party, the government supervision party) collects its own carbon emission data (such as construction carbon emissions, transportation carbon emissions, etc.). For example, assume that the carbon emissions of construction party A are 100 tons of CO2, and the carbon emissions of supply chain management party B are 150 tons of CO2.
[0061] Use the Paillier public key (pk = (n, g)) to encrypt the carbon emission data of each participating party. The encryption process follows the Paillier encryption algorithm, and the basic steps are as follows:
[0062] The participating party selects a random number r, where r must satisfy r < n and r is relatively prime to n. Use the public key (n, g) and the data m (such as carbon emissions) for encryption, and calculate: c = g m ·r n mod n 2 , where c is the encrypted ciphertext, m is the original data (such as carbon emissions), and r is the random number. For example, the carbon emission data of 100 tons of CO2 of construction party A is encrypted using the public key to obtain the ciphertext Enc(100). The carbon emission data of 150 tons of CO2 of supply chain management party B is encrypted using the public key to obtain the ciphertext Enc(150). The encrypted data can be safely transmitted and processed because only the participating party with the private key can decrypt it.
[0063] Split the carbon emission data of each participating party into multiple secret shares, and distribute all the secret shares belonging to a participating party to multiple computing units, so that a single computing unit cannot recover the original data. Only when all computing units calculate together can the final total carbon emissions be reconstructed, including the following steps:
[0064] Split the carbon emission data D of each participating party into multiple secret shares through the Shamir secret sharing method, so that each share cannot individually restore the original data. The Shamir secret sharing splits the data D into multiple shares, so that b shares can reconstruct the original data, while b - 1 shares cannot recover the data. For the carbon emission data D_A, assume that the carbon emission data of each participating party is split into h shares, and at least b shares are required to recover the data.
[0065] Use the method of polynomial interpolation to generate shares. For example, for the carbon emission data \(D_A\) of Party A, generate a polynomial: \(f(x)=a_0 + a_1x + a_2x\) 2 +... + a b-1 x b-1 , where \(a_0\) is the carbon emission data \(D_A\). Generate \(h\) shares according to this polynomial: \((x_1, f(x_1)), (x_2, f(x_2)),..., (x_h, f(x_h))\). These shares can be distributed to different computing units.
[0066] Distribute the secret shares split from each party to multiple computing units. These computing units do not have the ability to reconstruct the original data. Only when all computing units cooperate can these shares be combined to reconstruct the final total carbon emissions. The \(h\) shares of Party A (for example: \(S_{A1}, S_{A2},..., S_{Ah}\)) will be respectively distributed to \(h\) computing units (such as \(C1, C2,..., Ch\)). Similarly, the carbon emission data of other parties (for example, the supply chain management party B) will also be split into shares and distributed to computing units.
[0067] a_0, a_1, a_2, …, a b-1 : These are the coefficients of the polynomial, representing the weights of different power terms. Each coefficient \(a\) i corresponds to an \(x\) term of a power, determining the contribution size of the polynomial in this term, and the values of \(a_0, a_1, a_2, …, a\) b-1 are all greater than 0.
[0068] x_1, x_2, …, x h are different \(x\) values. Usually, these values are randomly selected points. They are used as independent variables in the polynomial, and \(f(x_1), f(x_2), …, f(x h ) are the function values calculated corresponding to \(x_1, x_2, …, x\) h (i.e., the output of the polynomial). These values are the second part of each share.
[0069] Suppose the carbon emission data of Party A is \(D_A = 100\), and it is necessary to generate a polynomial and split it into three secret shares. Generate a polynomial: Suppose we use a quadratic polynomial, that is, \(b = 3\), then the form of the polynomial is: \(f(x)=a_0 + a_1x + a_2x\) 2 , where \(a_0 = D_A = 100\), and \(a_1 = 10\) and \(a_2 = 5\). So, the generated polynomial is: \(f(x)=100 + 10x + 5x\) 2 , now, select different \(x\) values to generate multiple shares:
[0070] x1 = 1, f(1) = 100 + 10(1) + 5(1) 2 = 115; so the first share is (1, 115).
[0071] x2 = 2, f(2) = 100 + 10(2) + 5(2) 2 = 130; so the second share is (2, 130).
[0072] x3 = 3, f(3) = 100 + 10(3) + 5(3) 2 = 145; so the third share is (3, 145).
[0073] These shares are respectively allocated to different computing units,
[0074] The computing unit C1 gets the share (1, 115), the computing unit C2 gets the share (2, 130), and the computing unit C3 gets the share (3, 145).
[0075] Each computing unit can only receive partial shares and cannot know the original data. For example, the computing unit C1 may only receive the share S_A1 of the participant A and cannot receive the shares of other participants or the complete original data. In this way, even if the share of a single computing unit is intercepted by an attacker, the original carbon emission data cannot be recovered.
[0076] All computing units jointly calculate the total carbon emissions through a multi-party secure computation (MPC) protocol, but each computing unit maintains the privacy of its own share. All computing units cooperate through the multi-party computation protocol to calculate the sum of the carbon emission data of each participant. Since the data shares held by each computing unit are partial, only when all computing units cooperate can the final total carbon emissions be obtained.
[0077] Each computing unit jointly calculates the total carbon emissions of the construction project through the MPC protocol without revealing the original data, including the following steps:
[0078] The computing units perform collaborative calculations through the multi-party secure computation (MPC) protocol, and can calculate the total carbon emissions without decrypting the data. The MPC protocol is a distributed protocol that allows multiple computing units to cooperate in calculating the total carbon emissions without any single computing unit accessing the complete original data. Each computing unit can only perform local calculations on the data shares it holds and finally merge the calculation results.
[0079] The computing units C1 and C2 calculate Enc(D A 1 + D B 2) through the MPC protocol. After all computing units cooperate, the encrypted total carbon emissions Enc(D total), each computing unit will hold part of the calculation results (encrypted total carbon emissions), and merge them through the MPC protocol to obtain the final encrypted total carbon emissions. For example, if computing units C1 and C2 hold the encrypted results Enc(D A 1) and Enc(D B 2) respectively, they can merge the results to obtain the encrypted total carbon emissions: Enc(D total ) = Enc(D A 1) + Enc(D B 2).
[0080] The results obtained by the calculation are verified for accuracy by the verification node. After the accuracy verification is completed, the final total carbon emissions are stored in the blockchain, rather than storing the original data of each party. The regulatory agency can query the deposit information through the blockchain and conduct audits, including the following steps:
[0081] After the verification node obtains the operation data of the computing unit, it obtains the total confidence score of multiple computing units and analyzes the calculation results of multiple computing units to obtain the mutation index of the calculation results;
[0082] The mutation index of the calculation results and the total confidence score of multiple computing units are comprehensively calculated to obtain the result coefficient. The expression is: In the formula, jgh is the result coefficient, is the total confidence score, θ is the mutation index, B is the number of computing units, is the confidence score of the i-th computing unit;
[0083] The larger the result coefficient, the worse the accuracy of the calculation results. The obtained result coefficient is compared with the preset coefficient threshold. The coefficient threshold is used to analyze whether the accuracy of the calculation results is qualified. If the result coefficient is less than or equal to the coefficient threshold, the verification node analyzes that the accuracy of the calculation results is qualified. If the result coefficient is greater than the coefficient threshold, the verification node analyzes that the accuracy of the calculation results is unqualified.
[0084] The acquisition logic of the mutation index of the calculation results is: after obtaining the carbon emission values calculated by the computing unit multiple times, calculate the calculation fluctuation amplitude based on the carbon emission values obtained by multiple calculations. The expression is: In the formula, DF is the calculation fluctuation amplitude, G is the total number of calculations of the computing unit, P i is the carbon emission value obtained by the i-th calculation, P avgLet \(C\) be the average carbon emission value. After obtaining the maximum carbon emission value and the minimum carbon emission value, calculate the difference by subtracting the minimum carbon emission value from the maximum carbon emission value. Normalize the calculated difference and the calculated fluctuation amplitude to obtain the normalized value of the calculated difference and the normalized value of the calculated fluctuation amplitude. Sum the normalized value of the calculated difference and the normalized value of the calculated fluctuation amplitude to obtain the mutation factor. Sum the mutation factors of multiple calculation units to obtain the mutation index. The larger the mutation index, the greater the fluctuation of the calculation results of multiple calculation units, that is, the worse the accuracy of the calculation results.
[0085] After the verification node obtains the operation data of the calculation unit, obtain the total confidence score of multiple calculation units, including the following steps:
[0086] Obtain the anomaly score of the calculation unit, expressed as: In the formula, \(A\) i is the anomaly score of the \(i\)-th calculation unit, \(E\) i is the calculation error of the \(i\)-th calculation unit, \(S\) i is the calculation timeout frequency of the \(i\)-th calculation unit, is the average calculation error of all calculation units, is the average value of the calculation timeout frequencies of all calculation units. The acquisition logic of the calculation error is: obtain the value calculated when the calculation unit issues a fault warning, and obtain the value calculated under the normal condition of the calculation unit. Subtract the value calculated under the normal condition from the value calculated when the fault warning is issued to obtain the numerical difference. Divide the absolute value of the numerical difference by the value calculated under the normal condition to obtain the calculation error. If there are problems with the hardware (such as memory damage or the calculation unit fails), it will affect the accuracy of the calculation results;
[0087] Obtain the normality score of the calculation unit, and the expression is: In the formula, \(N\) i is the normality score of the \(i\)-th calculation unit, \(R\) i is the number of abnormal error reports of the \(i\)-th calculation unit during the monitoring period, is the average number of errors of all calculation units in the same period;
[0088] Subtract the anomaly score from the normality score to obtain the confidence score of the calculation unit, and the expression is:
[0089] In the formula, is the confidence score of the \(i\)-th calculation unit.
[0090] The above formulas are all dimensionless and take their numerical values for calculation. The formulas are obtained by collecting a large amount of data and performing software simulation to obtain a formula that is closest to the actual situation. The preset parameters in the formulas are set by those skilled in the art according to the actual situation.
[0091] In the description of this specification, the descriptions referring to the terms "one embodiment", "example", "specific example", etc. mean that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0092] The preferred embodiments of the present invention disclosed above are only used to help explain the present invention. The preferred embodiments do not describe all the details in detail, nor do they limit the present invention to only the specific implementation manners. Obviously, many modifications and variations can be made according to the content of this specification. These embodiments are selected and specifically described in this specification in order to better explain the principles and practical applications of the present invention, so that those skilled in the art can well understand and utilize the present invention. The present invention is only limited by the claims and their full scope and equivalents.
Claims
1. A method for storing building carbon emission data based on blockchain, characterized in that: The described evidence storage method includes the following steps: The acquisition end obtains the carbon emission data of all parties involved in the construction project and encrypts the carbon emission data of each party using a homomorphic encryption algorithm; Split the carbon emission data of each party into multiple secret shares and distribute all the secret shares belonging to one party to multiple computing units; Each computing unit jointly calculates the total carbon emissions of the construction project through the MPC protocol. The calculated result is verified for accuracy by the verification node, and after the accuracy verification is completed, the final total carbon emissions are stored in the blockchain.
2. The method for storing building carbon emission data based on blockchain according to claim 1, wherein: The calculated result is verified for accuracy by the verification node, including the following steps: After the verification node obtains the operation data of the computing unit, it obtains the total confidence score of multiple computing units and analyzes the calculation results of multiple computing units to obtain the mutation index of the calculation results; The result coefficient is obtained by comprehensively calculating the mutation index of the calculation result and the total confidence score of multiple calculation units. The expression is as follows: In the formula, jgh is the result coefficient, is the total confidence score, is the mutation index, B is the number of calculation units, is the confidence score of the i-th calculation unit; Compare the obtained result coefficient with the preset coefficient threshold. The coefficient threshold is used to analyze whether the accuracy of the calculation result is qualified. If the result coefficient is less than or equal to the coefficient threshold, the verification node analyzes that the accuracy of the calculation result is qualified. If the result coefficient is greater than the coefficient threshold, the verification node analyzes that the accuracy of the calculation result is unqualified.
3. The method for storing building carbon emission data based on blockchain according to claim 2, wherein: The acquisition logic of the calculation result mutation index is as follows: After obtaining the carbon emission values calculated by the calculation unit multiple times, calculate and obtain the calculation fluctuation amplitude based on the carbon emission values obtained from multiple calculations. The expression is: In the formula, DF is the calculation fluctuation amplitude, G is the total number of calculations of the calculation unit, P i is the carbon emission value obtained from the i-th calculation, P avg is the average carbon emission value. After obtaining the maximum carbon emission value and the minimum carbon emission value, obtain the calculation difference by subtracting the minimum carbon emission value from the maximum carbon emission value. Normalize the calculation difference and the calculation fluctuation amplitude to obtain the normalized calculation difference value and the normalized calculation fluctuation amplitude value. Sum the normalized calculation difference value and the normalized calculation fluctuation amplitude value to obtain the mutation factor, and sum the mutation factors of multiple calculation units to obtain the mutation index.
4. The method for storing building carbon emission data based on blockchain according to claim 3, characterized in that: After the verification node obtains the operation data of the computing unit, it obtains the total confidence score of multiple computing units, including the following steps: Obtain the anomaly score of the computing unit, expressed as: where A i is the anomaly score of the i-th computing unit, E i is the calculation error of the i-th computing unit, S i is the calculation timeout frequency of the i-th computing unit, is the average calculation error of all computing units, is the average value of the calculation timeout frequencies of all computing units. The logic for obtaining the calculation error is: obtain the value calculated when the computing unit has a fault warning, and obtain the value calculated when the computing unit is in a normal condition. Subtract the value calculated in the normal condition from the value calculated during the fault warning to obtain the numerical difference, and divide the absolute value of the numerical difference by the value calculated in the normal condition to obtain the calculation error; Obtain the normality score of the computing unit, with the expression: In the formula, N i is the normality score of the i-th computing unit, and R i is the number of abnormal error reports of the i-th computing unit during the monitoring period, is the average number of errors of all computing units during the same period; Subtract the abnormal score from the normality score to obtain the confidence score of the computing unit. The expression is: Wherein, is the confidence score of the i-th computing unit.
5. The method for storing building carbon emission data based on blockchain according to claim 4, characterized in that: Each computing unit jointly calculates the total carbon emissions of the construction project through the MPC protocol, including the following steps: The computing units C1 and C2 calculate Enc(D A 1 + D B 2) through the MPC protocol. After all computing units collaborate, the encrypted total carbon emissions Enc(D total ) are obtained; The computing units C1 and C2 respectively hold the encryption results Enc(D A 1) and Enc(D B 2). The combined result gives the encrypted total carbon emissions: Enc(D total ) = Enc(D A 1) + Enc(D B 2).
6. The method for storing and proving building carbon emission data based on blockchain according to claim 5, wherein: Split the carbon emission data of each party into multiple secret shares and distribute all the secret shares belonging to one party to multiple computing units, including the following steps: Split the carbon emission data D of each party into multiple secret shares through the Shamir secret sharing method; The Shamir secret sharing splits the data D into multiple shares so that b shares can reconstruct the original data, while b - 1 shares cannot recover the data. For the carbon emission data D_A, assume that the carbon emission data of each party is split into h shares, where at least b shares are required to recover the data; Use the method of polynomial interpolation to generate shares. For the carbon emission data \(D_A\) of the participating parties, generate the polynomial: \(f(x)=a_0 + a_1x + a_2x\) 2 +\(\cdots\)+a b-1 x b-1 , where \(f(x)\) represents the polynomial function generated by interpolation and is used to calculate the corresponding results for different \(x\) values. \(a_0\) is the carbon emission data \(D_A\). Generate \(h\) shares according to the polynomial: \((x_1,f(x_1)),(x_2,f(x_2)),\cdots,(x_h,f(x_h))\). The \(h\) shares are distributed to different computing units.
7. The method for storing building carbon emission data based on blockchain according to claim 6, characterized in that: The acquisition end obtains the carbon emission data of all parties involved in the construction project and encrypts the carbon emission data of each party using a homomorphic encryption algorithm, including the following steps: Collect the carbon emission data of each party involved in the construction project respectively, including the carbon emissions during the construction process and the carbon emissions of building materials, and encrypt the carbon emission data of each party using the Paillier homomorphic encryption algorithm.
8. The method for storing building carbon emission data based on blockchain according to claim 7, characterized in that: Encrypt the carbon emission data of each party using the Paillier homomorphic encryption algorithm, including the following steps: Generate a public-private key pair required for the Paillier encryption algorithm for each party. The public key pk is used to encrypt the carbon emission data and is publicly available to all parties. The private key sk is used to decrypt the data and is only held by the data owner; The generation of the public-private key includes the following steps: Select prime numbers p and q, calculate n = p * q, and n is used as the modulus in the encryption process; Calculate λ(n) = lcm(p - 1, q - 1), where λ(n) is the Lagrange function of n. Select a random number g, where g is n 2 , and calculate μ = (L(g λ(n) mod n 2 )) (-1) mod n, where μ is part of the private key, and L(x) = (x - 1) / n, and L(x) is an auxiliary function used to process the result of L(g λ(n) mod n 2 ); Generate the public key pk = (n, g) and the private key sk = (λ(n), μ). The public key is distributed to all participants for encrypting data, while the private key is kept secret and only held by the data provider for decrypting data; Use the Paillier public key (pk = (n, g)) to encrypt the carbon emission data of each participant, including the following steps: The participant selects a random number r, where r satisfies r < n and r is relatively prime to n, and uses the public key (n, g) and the data m for encryption, and calculates: c = g m ·r n mod n 2 , where c is the encrypted ciphertext, m is the original data, and r is the random number.