Disclosure of Invention
The invention provides a carbon emission data processing method, which aims to avoid the leakage of carbon emission data of a control and emission enterprise.
In order to achieve the above object, the present invention provides a carbon emission data processing method comprising:
The carbon emission monitoring system acquires a carbon emission amount comparison request of a first enterprise aiming at a second enterprise, and sends the carbon emission amount comparison request to a first server;
The first server receives the carbon emission comparison request and downloads first ciphertext carbon emission monitoring data of the first enterprise and second ciphertext carbon emission monitoring data of the second enterprise from a blockchain;
The first server calculates a random encryption value based on a first random number, a second random number and a third random number, calculates according to the random encryption value, the first ciphertext carbon emission monitoring data and the second ciphertext carbon emission monitoring data to obtain ciphertext carbon data, decrypts the ciphertext carbon data partially based on a first private key to obtain first decrypted carbon data, and sends the ciphertext carbon data and the first decrypted carbon data to a second server;
After the second server receives the ciphertext carbon data and the first decrypted carbon data, partial decryption is performed on the ciphertext carbon data based on a second private key to obtain second decrypted carbon data, joint decryption is performed on the first decrypted carbon data and the second decrypted carbon data to obtain third decrypted carbon data, calculation is performed on the third decrypted carbon data based on a common public key of the first server and the second server to obtain transitional comparison data, and the transitional comparison data is sent to the first server;
The first server receives the transition comparison data, corrects the transition comparison data according to the third random number to obtain corrected comparison data, decrypts the corrected comparison data partially based on the first private key to obtain first decryption comparison data, and sends the first decryption comparison data to the carbon emission monitoring system;
the carbon emission monitoring system receives the corrected comparison data and the first decryption comparison data sent by the first server, performs partial decryption on the comparison data based on the second private key to obtain second decryption comparison data, performs joint decryption according to the first decryption comparison data and the second decryption comparison data to obtain a decryption comparison result, and sends the decryption comparison result to the first enterprise;
And the private key formed by the first private key and the second private key and the common public key form a key pair.
Further, the first server calculates a random encryption value based on the first random number, the second random number, and the third random number, and includes:
the first server selects a first calculation method of the random encryption value according to the value of the third random number;
and substituting the first random number and the second random number into the first calculation method by the first server to calculate so as to obtain the random encryption value.
Still further, the third random number includes 0 or 1;
When the third random number is 0, the first calculation method of the random encryption value specifically includes: Wherein, the method comprises the steps of, wherein, In order to randomly encrypt the value of the code,As a result of the first random number,As a result of the second random number,,AndIs two arbitraryA strong prime number of bits; Representation generator for generating common public key ,;Representation ofWherein the random number of (c) is, among other things,Is in combination withAll positive integer sets of mutual prime;
when the third random number is 1, the first calculation method of the random encryption value specifically includes: Wherein, the method comprises the steps of, wherein, In order to randomly encrypt the value of the code,As a result of the second random number,,AndIs two arbitraryA strong prime number of bits; Representation generator for generating common public key ,,Representation ofWhereinIs in combination withAll positive integer sets of mutual prime.
Further, the calculating according to the random encryption value, the first ciphertext carbon emission monitoring data and the second ciphertext carbon emission monitoring data to obtain ciphertext carbon data includes:
When the third random number is 0, the calculation method of the ciphertext carbon data is as follows Wherein, the method comprises the steps of, wherein,As the ciphertext carbon data, the method comprises the steps of,First ciphertext carbon emission monitoring data representative of a first enterprise,Second ciphertext carbon emission monitoring data representative of a second enterprise,,AndIs two arbitraryThe strong prime number of bits is chosen,A random encryption value when the value of the third random number is 0;
When the third random number is 1, the calculation method of the ciphertext carbon data is as follows Wherein, among them,As the ciphertext carbon data, the method comprises the steps of,First ciphertext carbon emission monitoring data representative of a first enterprise,Second ciphertext carbon emission monitoring data representative of a second enterprise,,AndIs two arbitraryThe strong prime number of bits is chosen,The random encryption value when the value of the third random number is 1 is taken.
Further, the calculating the third decrypted carbon data may obtain transitional comparison data, specifically:
the second server selects a second calculation method of the transition comparison data according to the third decrypted carbon data;
And the second server calculates according to the second calculation method to obtain the transition comparison data.
Further, after the first server receives the transient comparison data, calculating and correcting the transient comparison data according to the third random number to obtain corrected comparison data, including:
the first server selects a calculation method of the comparison data after correction according to the value of the third random number;
And substituting the transition comparison data into the calculation method of the comparison data after the correction by the first server to calculate so as to obtain the comparison data after the correction.
Still further, the decryption comparison result includes:
If the decryption comparison result is 0, the carbon emission of the first enterprise is larger than or equal to the carbon emission of the second enterprise;
and if the decryption comparison result is 1, the carbon emission of the first enterprise is smaller than that of the second enterprise.
Still further, the carbon emission data processing method further includes:
Receiving carbon emission data of an emission control enterprise uploaded by a plurality of data holders, encrypting the carbon emission data to generate ciphertext carbon emission data, and generating a carbon emission data signature value by using an SM2 signature algorithm for the carbon emission data; the data holders comprise an electric company, a thermodynamic company, a coal company, an oil company, a gas company and a control and discharge enterprise, and the first enterprise and the second enterprise are both the control and discharge enterprise;
Downloading and signature verification are carried out on the carbon emission data signature value of any control and emission enterprise, after signature verification is passed, all the ciphertext carbon emission data of any control and emission enterprise are downloaded and decrypted, all the carbon emission data of any control and emission enterprise are calculated and encrypted, ciphertext carbon emission monitoring data are obtained, and the ciphertext carbon emission monitoring data are uploaded to a block chain, wherein the ciphertext carbon emission monitoring data comprise first ciphertext carbon emission monitoring data of a first enterprise and second ciphertext carbon emission monitoring data of a second enterprise.
Still further, the carbon emission data processing method further includes:
receiving ciphertext carbon emission obtained by a plurality of data holders through calculation and encryption based on homomorphic encryption algorithm according to the carbon emission data, and generating a ciphertext carbon emission signature value by the ciphertext carbon emission through SM2 signature algorithm;
providing all the ciphertext carbon emission amounts for any one of the control and emission enterprises based on multiparty safety calculation contracts, and calculating to obtain ciphertext carbon emission total amounts which are automatically calculated by any one of the control and emission enterprises;
And comparing the total carbon emission amount of the ciphertext with the carbon emission monitoring data of the ciphertext, verifying the correctness of the calculation result of the control and emission enterprise, and storing the verification result in a uplink manner.
Still further, the carbon emission data processing method further includes:
receiving ciphertext carbon emission obtained by a plurality of data holders through calculation and encryption based on homomorphic encryption algorithm according to the carbon emission data, and generating a ciphertext carbon emission signature value by the ciphertext carbon emission through SM2 signature algorithm;
providing all the ciphertext carbon emission amounts for any one of the control and emission enterprises based on multiparty safety calculation contracts, and calculating to obtain ciphertext carbon emission total amounts which are automatically calculated by any one of the control and emission enterprises;
Analyzing according to the historical carbon emission data uploaded by the data holders, establishing a carbon emission prediction model of an emission control enterprise, and predicting the carbon emission prediction data of the year according to the carbon emission prediction model;
Comparing the carbon emission prediction data with the ciphertext carbon emission total amount, and when the deviation of the ciphertext carbon emission total amount and the carbon emission prediction data is in an error range, passing the comparison; when the deviation of the total carbon emission amount of the ciphertext and the carbon emission prediction data is out of an error range, marking the total carbon emission amount of the ciphertext as abnormal data;
downloading and decrypting all the ciphertext carbon emission data of the emission control enterprises marked as abnormal data, calculating and encrypting all the carbon emission data of any emission control enterprise, and obtaining ciphertext carbon emission monitoring data;
and comparing the total carbon emission amount of the ciphertext with the carbon emission monitoring data of the ciphertext, verifying the correctness of the calculation result of the control and emission enterprise, and storing the verification result in a uplink manner.
Compared with the prior art, the carbon emission data processing method provided by the embodiment of the invention has the beneficial effects that: the carbon emission monitoring system sends a carbon emission comparison request to a first server, the first server downloads encrypted data from a blockchain, uses a first private key to perform partial decryption, sends the encrypted data to a second server to perform partial decryption, and sends a decryption comparison result to the carbon emission monitoring system after the decryption is finished. By setting two servers to perform decryption together, collusion on one server can be prevented, and unsafe phenomenon can be caused. According to the invention, through the interaction of the carbon emission monitoring system, the first server and the second server, under the condition that data is not leaked, the carbon emission comparison between enterprises is completed, and the carbon emission data leakage of the emission control enterprises is avoided, so that the privacy of the emission control enterprises can be effectively protected, the purposes of encouraging each emission control enterprise to reduce the carbon emission and promoting the realization of low-carbon production are realized.
Detailed Description
The following describes in further detail the embodiments of the present invention with reference to the drawings and examples. The following examples are illustrative of the invention and are not intended to limit the scope of the invention.
Referring to fig. 1 and 2, the invention provides a carbon emission data processing method, which completes the comparison of carbon emission from enterprise to enterprise under the condition of ensuring that data is not leaked by the interaction of a carbon emission monitoring system, a first server and a second server, and avoids the leakage of carbon emission data of an emission control enterprise, thereby effectively protecting the privacy of the emission control enterprise, realizing the aim of encouraging each emission control enterprise to reduce the carbon emission and promoting the realization of low-carbon production.
The carbon emission data processing method comprises the following steps:
s1, a carbon emission monitoring system obtains a carbon emission comparison request of a first enterprise for a second enterprise, and sends the carbon emission comparison request to a first server, wherein the first enterprise and the second enterprise are both the emission control enterprises;
S2, the first server receives the carbon emission amount comparison request, and downloads first ciphertext carbon emission monitoring data of the first enterprise and second ciphertext carbon emission monitoring data of the second enterprise from a blockchain;
S3, the first server calculates a random encryption value based on a first random number, a second random number and a third random number, calculates according to the random encryption value, the first ciphertext carbon emission monitoring data and the second ciphertext carbon emission monitoring data to obtain ciphertext carbon data, decrypts the ciphertext carbon data partially based on a first private key to obtain first decrypted carbon data, and sends the ciphertext carbon data and the first decrypted carbon data to a second server;
s4, after receiving the ciphertext carbon data and the first decrypted carbon data, the second server performs partial decryption on the ciphertext carbon data based on a second private key to obtain second decrypted carbon data, performs joint decryption on the first decrypted carbon data and the second decrypted carbon data to obtain third decrypted carbon data, performs calculation on the third decrypted carbon data based on a common public key of the first server and the second server to obtain transitional comparison data, and sends the transitional comparison data to the first server;
S5, the first server receives the transition comparison data, corrects the transition comparison data according to the third random number to obtain corrected comparison data, decrypts the corrected comparison data partially based on the first private key to obtain first decryption comparison data, and sends the first decryption comparison data to the carbon emission monitoring system;
S6, the carbon emission monitoring system receives the corrected comparison data and the first decryption comparison data sent by the first server, performs partial decryption on the comparison data based on the second private key to obtain second decryption comparison data, performs joint decryption according to the first decryption comparison data and the second decryption comparison data to obtain a decryption comparison result, and sends the decryption comparison result to the first enterprise;
And the private key formed by the first private key and the second private key and the common public key form a key pair.
Specifically, the steps are performed on a blockchain-based carbon emission monitoring system, and relate to an initialization process, which is as follows:
(1) The regulatory body initializes the carbon emission monitoring system. Generation PAILLIERTD of a common public key for a threshold cryptosystem by a Paillier homomorphic cryptomodule And a first private keyAnd the first private keySplit into two parts, i.eAnd. The public key is then sharedDisclosing, first private keyStored by government regulatory authorities. Each entity can obtain common public key of PAILLIERTD threshold cryptosystem。
Specifically, two are first selectedStrong prime number of bitsAndSubsequent calculation of,Is thatAndIs a numerical value, is a constant-type parameter in the algorithm, and is used later, so it is named separately;,,Is thatAnd (3) withIs an intermediate calculation, noted as this symbol, and will be used hereinafter. Selecting a generator,For generating a common public keyCommon public keyPrivate key. Then the first private keySplit into two parts, denoted asAndAnd meet the followingAnd. Then, the Chinese remainder theorem is used for calculation. Can makeIs a 128-bit random number and can be further calculatedWhereinAnd is an integer. For efficient computation, the following will beSet to 0, is a non-negative integer. For generatingValues.
(2) The regulatory body sets two non-colluded servers, namely a first server and a second server. Then the partial private key is usedAndAnd respectively transmitting the first server and the second server through the secret channels which are constructed in advance. By arranging two servers, collusion on one server can be prevented, and unsafe phenomena can be caused.
(3) The control and drainage enterprises and the electric power companies/heating power companies/coal companies/petroleum companies/gas companies respectively initialize, respectively generate a common public key and a first private key of the SM2 common public key signature algorithm, the first private keys are respectively stored, and the common public key is disclosed to all entities. The control and drainage enterprise obtains PAILLIERTD part of private keys of the threshold password system from the supervision organization through the carbon emission monitoring system。
Specifically, the carbon emission amount comparison request in S1 is sent by the first enterprise under the condition that the carbon emission privacy comparison is required, the first enterprise and the second enterprise both belong to emission control enterprises, the first enterprise and the second enterprise are not fixed enterprises, and can be any enterprise, and the first enterprise sends the carbon emission amount comparison request to the first server through the carbon emission monitoring system.
Specifically, after receiving the carbon emission comparison request, the first server in S2 downloads ciphertext carbon emission monitoring data of two emission control enterprises designed from the blockchain.
In the embodiment of the invention, the homomorphic encryption technology is adopted to ensure the privacy of the carbon emission data. In addition, the ciphertext comparison and ciphertext operation are cooperatively executed by the first server and the second server, and the secret key is split and sent to the first server and the second server respectively, so that the privacy that both servers cannot acquire carbon emission data is ensured. The nonlinear operation under the ciphertext state can be realized under the condition of protecting the data privacy, and the method has the advantages of supporting the safe calculation to protect the data privacy of the control enterprise and the like.
The embodiment of the invention provides comparison of carbon emission among emission control enterprises, which aims to encourage each emission control enterprise to reduce carbon emission, promote low-carbon production, allow the carbon emission monitoring system to allow the comparison of the carbon emission among different emission control enterprises, and can not leak the carbon emission of the emission control enterprises, and only inform the relationship of the carbon emission among two emission control enterprises.
In an optional embodiment of the present invention, the first server calculates a random encryption value based on the first random number, the second random number, and the third random number, and the method includes:
the first server selects a first calculation method according to the value of the third random number;
and substituting the first random number and the second random number into the first calculation method by the first server to calculate so as to obtain the random encryption value.
In an alternative embodiment of the invention, the third random number comprises 0 or 1.
When the third random number is 0, the first calculation method of the random encryption value specifically includes: Wherein, the method comprises the steps of, wherein, In order to randomly encrypt the value of the code,As a result of the first random number,As a result of the second random number,,AndIs two arbitraryA strong prime number of bits; Representation generator for generating common public key ,;Representation ofWherein the random number of (c) is, among other things,Is in combination withAll positive integer sets of mutual prime;
when the third random number is 1, the first calculation method of the random encryption value specifically includes: Wherein, the method comprises the steps of, wherein, In order to randomly encrypt the value of the code,As a result of the second random number,,AndIs two arbitraryA strong prime number of bits; Representation generator for generating common public key ,,Representation ofWherein the random number of (c) is, among other things,Is in combination withAll positive integer sets of mutual prime.
Optionally, the first server selects a first random numberAnd a second random numberSatisfy the first random numberSecond random numberAndWhereinIs a safety parameter, which is a function of the safety,,AndIs two arbitraryThe strong prime number of bits.
In an optional embodiment of the present invention, the calculating the random encryption value, the first ciphertext carbon emission monitoring data, and the second ciphertext carbon emission monitoring data to obtain ciphertext carbon data includes:
When the third random number is 0, the calculation method of the ciphertext carbon data is as follows Wherein, the method comprises the steps of, wherein,As the ciphertext carbon data, the method comprises the steps of,First ciphertext carbon emission monitoring data representative of a first enterprise,Second ciphertext carbon emission monitoring data representative of a second enterprise,,AndIs two arbitraryThe strong prime number of bits is chosen,A random encryption value when the value of the third random number is 0;
When the third random number is 1, the calculation method of the ciphertext carbon data is as follows Wherein, among them,As the ciphertext carbon data, the method comprises the steps of,First ciphertext carbon emission monitoring data representative of a first enterprise,Second ciphertext carbon emission monitoring data representative of a second enterprise,,AndIs two arbitraryThe strong prime number of bits is chosen,The random encryption value when the value of the third random number is 1 is taken.
In an optional embodiment of the present invention, the calculating the third decrypted carbon data may obtain transitional comparison data, specifically:
the second server selects a second calculation method of the transition comparison data according to the third decrypted carbon data;
And the second server calculates according to the second calculation method to obtain the transition comparison data.
Optionally, if the third decrypted carbon dataThe transition comparison dataThe second calculation method of (2) is as follows:;
If the third decrypted carbon data The second calculation method of the transition comparison data comprises the following steps:;
wherein, In order to transition the comparison data,,AndIs two arbitraryThe strong prime number of bits is chosen,Representation generator for generating common public key,。
In an optional embodiment of the present invention, the first server receives the transient comparison data, corrects the transient comparison data according to the third random number, and obtains corrected comparison data, including:
the first server selects a calculation method of the comparison data after correction according to the value of the third random number;
And substituting the transition comparison data into the calculation method of the comparison data to calculate by the first server, so as to obtain the comparison data after the comparison.
Third random numberMay be 0 or 1.
When the third random numberWhen the value is 0, comparing the data after correctionThe calculation method of (1) is thatThat is, the comparison data after the correction is equal to the transition comparison data in value;
When the third random number When the value is 0, comparing the data after correctionThe calculation method of (1) is thatWherein, the method comprises the steps of, wherein,,AndIs two arbitraryThe strong prime number of bits.
In an alternative embodiment of the present invention, the decryption comparison result has two cases:
If the decryption comparison result is 0, the carbon emission of the first enterprise is larger than or equal to the carbon emission of the second enterprise;
and if the decryption comparison result is 1, the carbon emission of the first enterprise is smaller than that of the second enterprise.
In an optional embodiment of the invention, carbon emission data of an emission control enterprise uploaded by a plurality of data holders is received, the carbon emission data is encrypted to generate ciphertext carbon emission data, and the carbon emission data is used for generating a carbon emission data signature value by using an SM2 signature algorithm; the data holders comprise an electric company, a thermodynamic company, a coal company, an oil company, a gas company and a control and discharge enterprise, and the first enterprise and the second enterprise are both the control and discharge enterprise;
Downloading and signature verification are carried out on the carbon emission data signature value of any control and emission enterprise, after signature verification is passed, all the ciphertext carbon emission data of any control and emission enterprise are downloaded and decrypted, all the carbon emission data of any control and emission enterprise are calculated and encrypted, ciphertext carbon emission monitoring data are obtained, and the ciphertext carbon emission monitoring data are uploaded to a block chain, wherein the ciphertext carbon emission monitoring data comprise first ciphertext carbon emission monitoring data of a first enterprise and second ciphertext carbon emission monitoring data of a second enterprise.
Specifically, the uploaded ciphertext carbon emission amounts of the plurality of data holders are carbon emission amounts calculated by the plurality of data holders according to the carbon emission data of the data holders, and then are encrypted to ciphertext carbon emission amounts. For example, the electric power company uploads carbon emission data of the purchased electric power, the thermal company uploads carbon emission data of the purchased thermal power, the coal company uploads carbon emission data of the purchased coal, the petroleum company uploads carbon emission data of the purchased petroleum, the gas company uploads carbon emission data of the purchased gas, and the control and exhaust enterprise uploads carbon emission data and carbon emission data of the control and exhaust enterprise in the production process. By acquiring carbon emission data from a plurality of data holders, the authenticity of the data can be ensured. In the prior art, carbon emission data is generally uploaded and calculated unilaterally by a control and discharge enterprise, and the obtained data has the condition of fake making of the control and discharge enterprise, so that the data is unreal.
Specifically, all the carbon emission data of any one control and emission enterprise are calculated and encrypted to obtain ciphertext carbon emission monitoring data, that is, all the carbon emission data of a first enterprise are calculated and encrypted to obtain first ciphertext carbon emission monitoring data, all the carbon emission data of a second enterprise are calculated and encrypted to obtain second ciphertext carbon emission monitoring data, specifically:
Obtaining carbon emission factors of a plurality of carbon emission data according to the carbon emission data uploaded by a plurality of data holders;
calculating according to the carbon emission data and the carbon emission factor to obtain carbon emission;
and calculating and encrypting the carbon emission of the plurality of data holders to obtain ciphertext carbon emission monitoring data.
Specifically, the carbon emission data uploaded by the electric company is specifically the carbon emission data of the purchase electric quantity of the emission control enterpriseThe generated ciphertext carbon emission is specifically the ciphertext carbon emission of the purchased electric quantityThe specific calculation mode is as follows:
wherein, A carbon emission factor representing purchase electricity carbon emission data; Representing a common public key; , And Is two arbitraryA strong prime number of bits; Represented as generator, generates a common public key ,;Representation ofIs used for the random number in the random number code,Is in combination withAll positive integer sets of mutual prime;
Firstly, the electric company encrypts and signs the electric quantity carbon emission data purchased by the enterprise and then links the encrypted and signed data, and the specific steps are as follows:
a) The electric company encrypts the carbon emission data Q of the electric quantity purchased by the enterprise by using PAILLIERTD threshold password system to obtain ciphertext . The specific encryption process is as follows:
。
b) Signing by using SM2 signature algorithm to obtain corresponding signature value Then the ciphertext value and the signature value of the carbon emission data of the electric power purchased by the electric power companyUploading to the blockchain. Specifically, the signing process is:
。
secondly, calculating the carbon emission of the ciphertext of the purchased electric quantity by using PAILLIERTD threshold password system and SM2 signature algorithm Signature valueAnd (5) back winding.
。
Wherein: and represents the carbon emission factor of the purchased electricity carbon emission data.
The carbon emission data uploaded by the thermal company is specifically the purchase thermal carbon emission data of the emission control enterpriseThe generated ciphertext carbon emission is specifically the carbon emission of the purchased thermal ciphertextThe specific calculation mode is as follows:
wherein, Representing the carbon emission factor of the purchased thermal carbon emission data.
Firstly, the thermal company encrypts and signs the purchased electricity carbon emission data of the enterprise and then links the encrypted and signed data, and the method is concretely as follows: a) The thermodynamic company encrypts the thermodynamic carbon emission data H purchased by the enterprise by using PAILLIERTD threshold password system to obtain ciphertext. The specific encryption process is as follows:
。
b) Signing by using SM2 signature algorithm to obtain corresponding signature value Subsequently, the thermal company purchases the ciphertext value and the signature value of the thermal carbon emission dataUploading to the blockchain. Specifically, the signing process is:
。
Secondly, calculating the carbon emission of the purchased thermal ciphertext by using PAILLIERTD threshold cryptosystem and SM2 signature algorithm Signature valueAnd (5) back winding.
,
,
Wherein H represents the purchase of thermal carbon emission data by a control and exhaust enterprise,Represents the carbon emission of the purchased thermal ciphertext,Representing the carbon emission factor of the purchased thermal carbon emission data.
The carbon emission data uploaded by the coal company are specifically the carbon emission data of the purchased coal of the emission control enterpriseThe generated ciphertext carbon emission is specifically the ciphertext carbon emission of purchased coalThe specific calculation mode is as follows:
,
wherein, Representing the carbon emission factor of the purchased coal carbon emission data.
First, a coal company purchases coal carbon emission data from the enterpriseEncryption and signature are followed by chaining. The method comprises the following steps: a) The coal company encrypts the coal carbon emission data C purchased by the enterprise by using PAILLIERTD threshold password system to obtain ciphertext. The specific encryption process is as follows:
。
b) Signing by using SM2 signature algorithm to obtain corresponding signature value Then, the coal company purchases ciphertext value and signature value of the coal carbon emission dataUploading to the blockchain. Specifically, the signing process is:
。
Secondly, calculating the carbon emission of purchased coal ciphertext by using PAILLIERTD threshold password system and SM2 signature algorithm Signature valueAnd (5) back winding.
,
,
Wherein C represents the data of purchasing coal carbon emission by a control and emission enterprise,Represents the carbon emission amount of ciphertext purchased from coal,Representing the carbon emission factor of the purchased coal carbon emission data.
The carbon emission data uploaded by the petroleum company is specifically purchased petroleum carbon emission data of a control and emission enterpriseThe generated ciphertext carbon emission is specifically the carbon emission of the purchased petroleum ciphertextThe specific calculation mode is as follows:
wherein, Representing the carbon emission factor of the purchased petroleum carbon emission data.
First, the petroleum company encrypts and signs the petroleum carbon emission data purchased by the enterprise and then links the encrypted and signed data. The method comprises the following steps: a) Petroleum company uses PAILLIERTD threshold password system to purchase petroleum carbon emission data from enterprisesEncryption to obtain ciphertext. The specific encryption process is as follows:
。
b) Signing by using SM2 signature algorithm to obtain corresponding signature value Ciphertext value and signature value of petroleum company purchased petroleum carbon emission dataUploading to the blockchain. Specifically, the signing process is:
。
secondly, calculating the carbon emission of the purchased petroleum ciphertext by using PAILLIERTD threshold password system and SM2 signature algorithm Signature valueAnd (5) back winding.
,
,
Wherein, Indicating that the emission control enterprises purchase petroleum carbon emission data,Represents the carbon emission of the purchased petroleum ciphertext,Representing the carbon emission factor of the purchased petroleum carbon emission data.
The carbon emission data uploaded by the gas company are specifically the carbon emission data of the purchased gas of the emission control enterpriseThe generated ciphertext carbon emission is specifically the carbon emission of the purchased gas ciphertextThe specific calculation mode is as follows:
wherein, Representing the carbon emission factor of the purchased fuel gas carbon emission data.
First, the gas company encrypts and signs the gas carbon emission data purchased by the enterprise and then links the encrypted and signed gas carbon emission data. The method comprises the following steps: a) The gas company encrypts the carbon emission data G of the gas purchased by the enterprise by using PAILLIERTD threshold password system to obtain ciphertext. The specific encryption process is as follows:
。
b) Signing by using SM2 signature algorithm to obtain corresponding signature value Ciphertext value and signature value of the gas carbon emission data purchased by gas companyUploading to the blockchain. Specifically, the signing process is:
。
secondly, calculating the carbon emission of the purchased gas ciphertext by using PAILLIERTD threshold password system and SM2 signature algorithm Signature valueAnd (5) back winding.
,
。
Wherein G represents the carbon emission data of the fuel gas purchased by the emission control enterprises,Represents the carbon emission of the purchased fuel gas ciphertext,Representing the carbon emission factor of the purchased fuel gas carbon emission data.
The carbon emission data uploaded by the emission control enterprises are specifically carbon emission data in the production process of the emission control enterprisesCarbon emission data for end treatmentThe generated ciphertext carbon emission is specifically the ciphertext carbon emission of the process of the control and discharge enterpriseThe specific calculation mode is as follows:
wherein, A carbon emission factor representing carbon emission data during production; representing the carbon emission factor of the end treatment carbon emission data.
Firstly, the control and emission enterprises control and emit the carbon emission data of the production processCarbon emission data for end treatmentEncryption and signature are followed by chaining. The method comprises the following steps: a) The control and emission enterprise encrypts the carbon emission data P in the production process and the carbon emission data T treated at the tail end by using PAILLIERTD threshold password system to obtain ciphertextAnd. The specific encryption process is as follows:
,
,
Wherein the method comprises the steps of Is thatIs used for the random number in the random number code,Is in combination withAll positive integer sets of mutual prime.
B) Signing by using SM2 signature algorithm to obtain corresponding signature valueAndThen the ciphertext value and the signature value of the enterprise process carbon emission dataAndUploading to the blockchain. Specifically, the signing process is:
,
。
Secondly, calculating the ciphertext carbon emission in the production process by using PAILLIERTD threshold cryptosystem and SM2 signature algorithm Signature valueAnd (5) back winding.
,
,
Wherein: A carbon emission factor representing production process carbon emission data; representing the carbon emission factor of the end treatment carbon emission data.
Based on the data, calculating the total ciphertext carbon emission amount of the control and emission enterpriseThe calculation result is uplink and stored, and the specific calculation process is as follows:
。
Specifically, the supervisory mechanism acquires a signature value of carbon emission data of any control row enterprise and ciphertext carbon emission data of the control row enterprise, downloads and decrypts the ciphertext carbon emission data after the signature value passes verification, decrypts the ciphertext carbon emission data to obtain carbon emission data, calculates and encrypts all the carbon emission data of any control row enterprise, and obtains ciphertext carbon emission monitoring data.
The supervisory authorities download encrypted form of ciphertext carbon emission data uploaded by the controlling and discharging enterprises, and electric/thermal/coal/petroleum/gas companies, from the blockchainAnd carbon emission data signature valueAfter decryption and signature verification, calculating the carbon emission monitoring result of the emission control enterprise. Wherein, ciphertext carbon emission dataComprising the following steps:、、、、、、 Signature value of carbon emission data Comprising the following steps:、、、、、、。
the processes of decrypting, verifying the signature and calculating the carbon emission monitoring result R are as follows:
,
,
,
wherein, And (3) a calculation formula for controlling the total carbon emission of the enterprises.
Specifically, adding the decrypted carbon emission data uploaded by any control and emission enterprise, such as an electric company, a thermal company, a coal company, a petroleum company, a gas company and the control and emission enterprise, to obtain a carbon emission monitoring result by a supervision organization。
The monitoring result of carbon emission is carried out by the supervision and management institutionEncryption is carried out by using PAILLIERTD threshold password system to obtain ciphertext carbon emission monitoring dataThe specific encryption process is as follows:
。
in an alternative embodiment of the present invention, the carbon emission data processing method further includes:
receiving ciphertext carbon emission obtained by a plurality of data holders through calculation and encryption based on homomorphic encryption algorithm according to the carbon emission data, and generating a ciphertext carbon emission signature value by the ciphertext carbon emission through SM2 signature algorithm;
providing all the ciphertext carbon emission amounts for any one of the control and emission enterprises based on multiparty safety calculation contracts, and calculating to obtain ciphertext carbon emission total amounts which are automatically calculated by any one of the control and emission enterprises;
And comparing the total carbon emission amount of the ciphertext with the carbon emission monitoring data of the ciphertext, verifying the correctness of the calculation result of the control and emission enterprise, and storing the verification result in a uplink manner.
Specifically, since the ciphertext carbon emission is calculated by a plurality of data holders according to the carbon emission data uploaded by the data holders, the data holders may reduce the data of the carbon emission factor to a certain extent during calculation. By comparing the ciphertext carbon emission total amount calculated by the emission control enterprise with the carbon emission monitoring data calculated by the supervision agency according to the carbon emission data and the carbon emission factors published by the country, whether the data holder has the function of making the data or not can be obtained.
The supervisory mechanism obtains the total ciphertext carbon emission amount of the emission control enterprise from the blockchainAnd with ciphertext carbon emission monitoring dataA comparison is made. If the two are equal, the multi-party safety calculation result is proved to be correct, otherwise, the calculation result is wrong.
When the calculation result is wrong, the supervision organization further verifies which party of calculation result is wrong through the carbon emission data, the carbon emission amount, the signature thereof and the like on the chain, penalizes the wrong party of calculation (the data holder with the wrong calculation result), links the penalized result to verify, and requests the calculation of the related result again.
After the calculation result is verified to be correct, the supervision mechanism monitors the ciphertext carbon emission dataDecryption into carbon emission monitoring dataAnd then the carbon emission monitoring dataAnd sending the data to a corresponding control enterprise.
In the embodiment, the control and discharge enterprises and the supervision authorities can calculate the carbon emission of the control and discharge enterprises, so that the authenticity of data can be ensured, and the supervision function of the supervision authorities can be played by punishing and warning education on the data holder for data counterfeiting, so that the occurrence of the data counterfeiting condition is reduced.
In an alternative embodiment of the present invention, the carbon emission data processing method further includes:
receiving ciphertext carbon emission obtained by a plurality of data holders through calculation and encryption based on homomorphic encryption algorithm according to the carbon emission data, and generating a ciphertext carbon emission signature value by the ciphertext carbon emission through SM2 signature algorithm;
providing all the ciphertext carbon emission amounts for any one of the control and emission enterprises based on multiparty safety calculation contracts, and calculating to obtain ciphertext carbon emission total amounts which are automatically calculated by any one of the control and emission enterprises;
Analyzing according to the historical carbon emission data uploaded by the data holders, establishing a carbon emission prediction model of an emission control enterprise, and predicting the carbon emission prediction data of the year according to the carbon emission prediction model;
Comparing the carbon emission prediction data with the ciphertext carbon emission total amount, and when the deviation of the ciphertext carbon emission total amount and the carbon emission prediction data is in an error range, passing the comparison; when the deviation of the total carbon emission amount of the ciphertext and the carbon emission prediction data is out of an error range, marking the total carbon emission amount of the ciphertext as abnormal data;
downloading and decrypting all the ciphertext carbon emission data of the emission control enterprises marked as abnormal data, calculating and encrypting all the carbon emission data of any emission control enterprise, and obtaining ciphertext carbon emission monitoring data;
and comparing the total carbon emission amount of the ciphertext with the carbon emission monitoring data of the ciphertext, verifying the correctness of the calculation result of the control and emission enterprise, and storing the verification result in a uplink manner.
Specifically, the carbon emission prediction model is analyzed and summarized according to the condition of the historical carbon emission data, so that the prediction model of the carbon emission data in the past year is obtained. The prediction model compares the prediction data with the self-calculated ciphertext carbon emission total amount of the control and emission enterprises, performs a pre-test on the carbon emission amount, marks out data outside an error range, calculates ciphertext carbon emission monitoring data subsequently to marked abnormal data, and compares the self-calculated ciphertext carbon emission total amount of the control and emission enterprises with the ciphertext carbon emission monitoring data.
If the total carbon emission amount of the ciphertext is inconsistent with the carbon emission monitoring data of the ciphertext, punishing a data holder with a wrong calculation result, and uploading punished records to a chain for verification; and if the total carbon emission amount of the ciphertext is consistent with the carbon emission monitoring data of the ciphertext, decrypting the carbon emission monitoring data of the ciphertext and transmitting the decrypted carbon emission monitoring data to the emission control enterprise.
The working process of the invention is as follows: the control and discharge enterprises can provide a comparison request of carbon emission data, know the carbon emission data conditions of the control and discharge enterprises and other enterprises, in the comparison process, the carbon emission data are in an encrypted state, the control and discharge enterprises cannot know the carbon emission data conditions of other control and discharge enterprises, and the privacy of the carbon emission data is guaranteed by decrypting the carbon emission data of the control and discharge enterprises respectively through two servers.
In summary, the embodiment of the invention provides a carbon emission data processing method, which can stimulate the emission control enterprises to take more positive measures to reduce carbon emission by comparing carbon emission data among the emission control enterprises, thereby promoting the green low-carbon transformation of the whole industry and even the country. Ensuring that all businesses can compare under the same criteria in terms of carbon emission control, avoiding that some businesses gain an undue competitive advantage because the information disclosure is opaque. Avoiding the direct disclosure of the carbon emission data of the enterprise may reveal the business confidentiality of the enterprise, such as the production scale, the technical route and other sensitive information, and can display the relative performance of the carbon emission management of the enterprise without revealing specific data.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be executed in parallel, sequentially, or in a different order, and the present invention is not limited herein as long as the desired results of the technical solution disclosed in the present invention can be achieved.
The foregoing is merely a preferred embodiment of the present invention, and it should be noted that modifications and substitutions can be made by those skilled in the art without departing from the technical principles of the present invention, and these modifications and substitutions should also be considered as being within the scope of the present invention.