CN113407981A - Energy consumption data processing method based on zero knowledge proof - Google Patents
Energy consumption data processing method based on zero knowledge proof Download PDFInfo
- Publication number
- CN113407981A CN113407981A CN202110954361.XA CN202110954361A CN113407981A CN 113407981 A CN113407981 A CN 113407981A CN 202110954361 A CN202110954361 A CN 202110954361A CN 113407981 A CN113407981 A CN 113407981A
- Authority
- CN
- China
- Prior art keywords
- energy consumption
- proof
- consumption data
- energy
- vector
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000005265 energy consumption Methods 0.000 title claims abstract description 107
- 238000003672 processing method Methods 0.000 title claims description 4
- 230000002427 irreversible effect Effects 0.000 claims abstract description 49
- 238000000034 method Methods 0.000 claims abstract description 31
- 238000012795 verification Methods 0.000 claims abstract description 22
- 238000012545 processing Methods 0.000 claims abstract description 17
- 239000013598 vector Substances 0.000 claims description 46
- 230000008569 process Effects 0.000 claims description 16
- 238000004364 calculation method Methods 0.000 claims description 12
- 238000005070 sampling Methods 0.000 claims description 10
- 230000005611 electricity Effects 0.000 claims description 7
- XLYOFNOQVPJJNP-UHFFFAOYSA-N water Substances O XLYOFNOQVPJJNP-UHFFFAOYSA-N 0.000 claims description 7
- 238000013507 mapping Methods 0.000 claims description 5
- 238000006243 chemical reaction Methods 0.000 claims description 3
- 230000009466 transformation Effects 0.000 claims 1
- 238000004458 analytical method Methods 0.000 abstract description 9
- -1 electricity Substances 0.000 description 5
- 230000014509 gene expression Effects 0.000 description 3
- 238000005259 measurement Methods 0.000 description 3
- 238000013480 data collection Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000007812 deficiency Effects 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000007781 pre-processing Methods 0.000 description 1
- 238000012549 training Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/602—Providing cryptographic facilities or services
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/62—Protecting access to data via a platform, e.g. using keys or access control rules
- G06F21/6218—Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
- G06F21/6245—Protecting personal data, e.g. for financial or medical purposes
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/64—Protecting data integrity, e.g. using checksums, certificates or signatures
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Health & Medical Sciences (AREA)
- Bioethics (AREA)
- General Health & Medical Sciences (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Hardware Design (AREA)
- Medical Informatics (AREA)
- Databases & Information Systems (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
本发明提出了一种基于零知识证明的能源消费数据处理方法,包括:基于预设频率获取耗能企业的原始能源消费数据;基于哈希算法计算原始能源消费数据的散列值,将所述散列值作为第一证明问题;根据能源大数据中心的业务需求确定不可逆函数,基于不可逆加密算法得到原始能源消费数据的第二证明问题;验证原始能源消费数据是否完整,若验证通过,分别计算第一证明问题和第二证明问题的零知识证明,若零知识证明均满足能源大数据中心规定的验证条件,则将第二证明问题存储到能源大数据中心。本发明在不泄露耗能企业的原始能源消费数据的同时,采集到真实的能源消费数据的相关信息,并能够直接被能源大数据中心用于后续的分析业务。
The present invention provides a method for processing energy consumption data based on zero-knowledge proof, comprising: obtaining original energy consumption data of an energy-consuming enterprise based on a preset frequency; calculating a hash value of the original energy consumption data based on a hash algorithm, The hash value is used as the first proof problem; the irreversible function is determined according to the business requirements of the energy big data center, and the second proof problem is to obtain the original energy consumption data based on the irreversible encryption algorithm; to verify whether the original energy consumption data is complete, if the verification passes, calculate separately For the zero-knowledge proofs of the first proof problem and the second proof problem, if the zero-knowledge proofs both meet the verification conditions specified by the Energy Big Data Center, the second proof problem will be stored in the Energy Big Data Center. The invention collects the relevant information of the real energy consumption data without leaking the original energy consumption data of the energy-consuming enterprise, and can be directly used by the energy big data center for the subsequent analysis business.
Description
技术领域technical field
本发明属于数据隐私保护技术领域,尤其涉及一种基于零知识证明的能源消费数据处理方法。The invention belongs to the technical field of data privacy protection, and in particular relates to a method for processing energy consumption data based on zero-knowledge proof.
背景技术Background technique
现阶段,耗能企业能源消费数据的采集与分析过程中缺少了必要的验证流程,并且以明文的方式收集各耗能企业的能源消费数据,上述过程不仅存在耗能企业数据隐私泄露的风险,还存在从耗能企业传输至能源大数据中心的数据真实性有待商榷的问题,影响了能源大数据中心对耗能企业能源消费的宏观分析结果。因此,零知识证明逐渐被运用到验证能源消费数据的应用场景下。零知识证明是一种能够保护隐私的密码学算法,能够在不向验证者提供任何隐私信息的情况下,使验证者相信某个论断是正确的。At this stage, the collection and analysis of energy consumption data of energy-consuming enterprises lacks the necessary verification process, and the energy consumption data of each energy-consuming enterprise is collected in plain text. The above process not only has the risk of data privacy leakage of energy-consuming enterprises, There is also the question of the authenticity of the data transmitted from the energy-consuming enterprises to the energy big data center, which affects the macro-analysis results of the energy consumption enterprises' energy consumption by the energy big data center. Therefore, zero-knowledge proofs are gradually being applied to the application scenarios of verifying energy consumption data. Zero-knowledge proof is a cryptographic algorithm that can protect privacy, which can make the verifier believe that a certain assertion is correct without providing any private information to the verifier.
在能源消费领域,现有的零知识证明通常是用于验证能源交易的真实性,证明者通过向验证者发送的证明信息通常是由哈希算法计算的哈希值,零知识证明通过便确认交易成立。由于能源大数据中心需要根据耗能企业的能源消费数据进行一系列能源消费情况的分析,而哈希值是无法直接用于上述分析业务的,即使通过了现有的零知识证明机制,能源大数据中心仍然需要获取耗能企业的原始能源消费数据来进行后续的分析业务,也就无法真正实现不透露耗能企业隐私的要求,因此现有的零知识证明无法直接应用到能源消费数据真实性的验证。In the field of energy consumption, existing zero-knowledge proofs are usually used to verify the authenticity of energy transactions. The proof information sent by the prover to the verifier is usually the hash value calculated by the hash algorithm, and the zero-knowledge proof is confirmed when passed. Transaction established. Because the energy big data center needs to analyze a series of energy consumption situations based on the energy consumption data of energy-consuming enterprises, the hash value cannot be directly used for the above analysis business, even if the existing zero-knowledge proof mechanism is passed, the energy consumption The data center still needs to obtain the original energy consumption data of energy-consuming enterprises for subsequent analysis business, so it cannot truly realize the requirement of not revealing the privacy of energy-consuming enterprises. Therefore, the existing zero-knowledge proof cannot be directly applied to the authenticity of energy consumption data. 's verification.
发明内容SUMMARY OF THE INVENTION
为了解决现有技术中存在的缺点和不足,本发明提出了一种基于零知识证明的能源消费数据处理方法,包括:In order to solve the shortcomings and deficiencies existing in the prior art, the present invention proposes a method for processing energy consumption data based on zero-knowledge proof, including:
S100:基于预设频率获取耗能企业的原始能源消费数据;S100: Obtain the raw energy consumption data of the energy-consuming enterprise based on the preset frequency;
S200:基于哈希算法计算原始能源消费数据的散列值,将所述散列值作为第一证明问题;S200: Calculate a hash value of the original energy consumption data based on a hash algorithm, and use the hash value as the first proof problem;
S300:根据能源大数据中心的业务需求确定不可逆函数,不可逆函数的输出结果为根据原始能源消费数据计算的能够满足业务需求的数据,由不可逆函数、S200中的哈希算法以及随机定义的拼接规则构成不可逆加密算法,基于所述不可逆加密算法得到原始能源消费数据的第二证明问题;S300: Determine the irreversible function according to the business requirements of the energy big data center. The output result of the irreversible function is the data calculated according to the original energy consumption data that can meet the business requirements. The irreversible function, the hash algorithm in S200 and the randomly defined splicing rule Constitute an irreversible encryption algorithm, and obtain the second proof problem of the original energy consumption data based on the irreversible encryption algorithm;
S400:根据第一证明问题和第二证明问题的重复部分验证原始能源消费数据是否完整,若验证通过则执行S500,否则拒绝进行零知识证明;S400: Verify whether the original energy consumption data is complete according to the repeated part of the first proof problem and the second proof problem, and if the verification passes, execute S500, otherwise, refuse to perform zero-knowledge proof;
S500:基于傅里叶逆变换将第一证明问题和第二证明问题转换为多项式向量,结合能源大数据中心生成的随机数,分别计算第一证明问题和第二证明问题的零知识证明,将零知识证明和第二证明问题发送给能源大数据中心;S500: Convert the first proof problem and the second proof problem into a polynomial vector based on the inverse Fourier transform, and combine the random numbers generated by the Energy Big Data Center to calculate the zero-knowledge proofs of the first proof problem and the second proof problem, respectively. The zero-knowledge proof and the second proof problem are sent to the energy big data center;
S600:若零知识证明均满足能源大数据中心规定的验证条件,则将第二证明问题存储到能源大数据中心,否则判定原始能源消费数据未通过真实性验证,拒绝将第二证明问题存储到能源大数据中心。S600: If the zero-knowledge proofs all meet the verification conditions specified by the energy big data center, store the second proof questions in the energy big data center, otherwise determine that the original energy consumption data fails the authenticity verification, and refuse to store the second proof questions in the energy big data center. Energy Big Data Center.
可选的,所述S100包括:Optionally, the S100 includes:
确定耗能企业中水、电、气计量仪表的数据端口,获取数据端口的量纲参数;Determine the data ports of water, electricity, and gas metering instruments in energy-consuming enterprises, and obtain the dimensional parameters of the data ports;
基于预设频率向所述数据端口发送数据采集请求,获取水、电、气计量仪表的计量数据,根据量纲参数对计量数据进行量纲统一处理,将处理后的计量数据作为原始能源消费数据。Send a data collection request to the data port based on the preset frequency to obtain the metering data of the water, electricity, and gas metering instruments, perform dimensional unified processing on the metering data according to the dimensional parameters, and use the processed metering data as the original energy consumption data .
可选的,所述S200中的哈希算法为SHA-256算法。Optionally, the hash algorithm in the S200 is the SHA-256 algorithm.
可选的,所述S300包括:Optionally, the S300 includes:
获取预先存储在能源大数据中心的函数库,所述函数库中包含若干个自定义的不可逆函数,根据能源大数据中心的业务需求在函数库中选取一个不可逆函数;Obtain the function library pre-stored in the energy big data center, the function library contains several self-defined irreversible functions, and select an irreversible function in the function library according to the business requirements of the energy big data center;
随机确定第一证明问题与原始能源消费数据的拼接顺序规则,结合选取的不可逆函数、S200中的哈希算法共同组成不可逆加密算法;Randomly determine the splicing sequence rules of the first proof problem and the original energy consumption data, and combine the selected irreversible function and the hash algorithm in S200 to form an irreversible encryption algorithm;
将原始能源消费数据输入S200中的哈希算法,得到第一字符串,将原始能源消费数据输入不可逆函数,得到第二字符串;Input the raw energy consumption data into the hash algorithm in S200 to obtain the first character string, and input the raw energy consumption data into the irreversible function to obtain the second character string;
按照不可逆加密算法中的拼接顺序规则将第一字符串与第二字符串进行拼接,得到第二证明问题。The first string and the second string are spliced according to the splicing sequence rule in the irreversible encryption algorithm to obtain the second proof problem.
可选的,所述S400包括:Optionally, the S400 includes:
将第一证明问题和第二证明问题进行比对,若经过比对得到的重复部分与第一证明问题一致,则原始能源消费数据的完整性通过校验。The first proof problem and the second proof problem are compared, and if the repeated part obtained by the comparison is consistent with the first proof problem, the integrity of the original energy consumption data passes the verification.
可选的,所述S500包括:Optionally, the S500 includes:
基于zkSNARKs零知识协议,将第一证明问题和第二证明问题分别转化为若干个二元赋值式;Based on the zkSNARKs zero-knowledge protocol, the first proof problem and the second proof problem are respectively transformed into several binary assignment expressions;
将二元赋值式中的变量组合为向量u,根据二元赋值式和向量u分别将第一证明问 题和第二证明问题转化为R1CS实例,其中N为第一证明问题或第二证明问 题的变量个数,M为二元赋值式的个数,a、b、c分别为R1CS实例中的向量序列,使 ; Combine the variables in the binary assignment expression into a vector u, and convert the first proof problem and the second proof problem into R1CS instances according to the binary assignment expression and the vector u, respectively , where N is the number of variables in the first proof problem or the second proof problem, M is the number of binary assignments, and a, b, and c are the vector sequences in the R1CS instance, so that ;
将R1CS实例转化为QAP实例 ,其中A、B、C依次为R1CS实例中的 向量序列的傅里叶逆变换; Convert R1CS instance to QAP instance , where A, B, and C are in turn the inverse Fourier transform of the vector sequence in the R1CS instance;
获取能源大数据中心生成的随机数t、、、、、、、、,其中t为随机 选取的采样点,计算中间向量、与,计算过程如下: Obtain the random number t generated by the energy big data center, , , , , , , , , where t is a randomly selected sampling point, and the intermediate vector is calculated , and , the calculation process is as follows:
; ;
其中,,、…、为预设可信域D中的元素,j为 的元素标号,j的取值范围为0至M-2之间的正整数,表示t采样点下向量A的第一个元 素,表示t采样点下向量B的第一个元素,表示t采样点下向量C的第一个元素,表示t采样点下向量A的第个元素,表示t采样点下向量B的第个元素,表示t采样点下向量C的第个元素,i的取值范围为1至N-1之间的正整数; in, , , …, is the element in the preset trusted domain D, and j is The element label of , the value of j is a positive integer between 0 and M-2, represents the first element of the vector A at the t sampling point, represents the first element of the vector B at the t sampling point, represents the first element of the vector C at the t sampling point, Represents the th elements, represents the th elements, represents the th elements, the value range of i is a positive integer between 1 and N-1;
计算、、以及,计算过程如下: calculate , , as well as , the calculation process is as follows:
; ;
其中,为的第j项系数,,表示向量u的第i个元 素,表示中间向量的第i个元素,表示中间向量的第j个元素,r、s 为耗能企业作为证明方选取的随机数; in, for The jth coefficient of , , represents the ith element of the vector u, represents the intermediate vector the ith element of , represents the intermediate vector The jth element of , r and s are random numbers selected by the energy-consuming enterprise as the prover;
根据计算结果组成向量作为零知识证明。 Form a vector according to the calculation result as a zero-knowledge proof.
可选的,所述向量u的第一个元素恒为1。Optionally, the first element of the vector u is always 1.
可选的,所述S600包括:Optionally, the S600 includes:
确定双线性配对映射,、为映射e的输入变量,为映射e 的输出变量; Determining Bilinear Pairwise Mapping , , is the input variable of mapping e, is the output variable of mapping e;
根据能源大数据中心接收到的零知识证明验证是否正确,若正确则判定第一证明问 题和第二证明问题通过真实性验证。 According to the zero-knowledge proof received by the energy big data center verify Whether it is correct, if it is correct, it is determined that the first proof problem and the second proof problem pass the authenticity verification.
本发明提供的技术方案带来的有益效果是:The beneficial effects brought by the technical scheme provided by the invention are:
(1)在zkSNARKs零知识协议的基础上,作为验证者的能源大数据中心能够根据自身业务需要生成不可逆加密算法并发送给耗能企业,在不泄露耗能企业的原始能源消费数据的同时,使能源大数据中心采集到真实的能源消费数据的相关信息,同时耗能企业通过不可逆加密算法生成的证明问题能够直接被能源大数据中心用于后续的分析业务,解决了通过传统的零知识证明无法满足能源分析需求的问题。(1) Based on the zkSNARKs zero-knowledge protocol, the energy big data center as a verifier can generate irreversible encryption algorithms according to their own business needs and send them to energy-consuming enterprises. The energy big data center can collect the relevant information of real energy consumption data, and the proof problem generated by the energy-consuming enterprise through the irreversible encryption algorithm can be directly used by the energy big data center for the subsequent analysis business. The problem of inability to meet energy analysis needs.
(2)作为证明者的耗能企业分别根据两种不同的加密方法生成两个证明问题,其中利用哈希算法得到的证明问题能够验证原始能源消费数据的完整性,利用自定义的不可逆加密算法得到的证明问题能够验证原始能源消费数据的真实性,结合了零知识证明的特点,能够在不泄露耗能企业隐私数据的情况下,检验传输至能源大数据中心的数据是否被篡改,提高了数据的真实性。(2) The energy-consuming enterprise as the prover generates two proof problems according to two different encryption methods. The proof problem obtained by using the hash algorithm can verify the integrity of the original energy consumption data, and the self-defined irreversible encryption algorithm is used. The obtained proof problem can verify the authenticity of the original energy consumption data. Combined with the characteristics of zero-knowledge proof, it can verify whether the data transmitted to the energy big data center has been tampered without revealing the private data of energy-consuming enterprises, which improves the authenticity of the data.
附图说明Description of drawings
为了更清楚地说明本发明的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions of the present invention more clearly, the following briefly introduces the accompanying drawings used in the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention, which are of great significance to the art For those of ordinary skill, other drawings can also be obtained from these drawings without any creative effort.
图1为本发明一实施例提出的一种基于零知识证明的能源消费数据处理方法的流程示意图;FIG. 1 is a schematic flowchart of a method for processing energy consumption data based on zero-knowledge proof provided by an embodiment of the present invention;
图2为耗能企业向能源大数据中心发送零知识证明的流程示意图。Figure 2 is a schematic diagram of the process of sending a zero-knowledge proof to an energy big data center by an energy-consuming enterprise.
具体实施方式Detailed ways
为使本发明的结构和优点更加清楚,下面将结合附图对本发明的结构作进一步地描述。In order to make the structure and advantages of the present invention clearer, the structure of the present invention will be further described below with reference to the accompanying drawings.
实施例一Example 1
如图1所示,本实施例提出了一种基于零知识证明的能源消费数据处理方法,包括:As shown in FIG. 1 , this embodiment proposes a method for processing energy consumption data based on zero-knowledge proof, including:
S100:基于预设频率获取耗能企业的原始能源消费数据;S100: Obtain the raw energy consumption data of the energy-consuming enterprise based on the preset frequency;
S200:基于哈希算法计算原始能源消费数据的散列值,将所述散列值作为第一证明问题;S200: Calculate a hash value of the original energy consumption data based on a hash algorithm, and use the hash value as the first proof problem;
S300:根据能源大数据中心的业务需求确定不可逆函数,不可逆函数的输出结果为根据原始能源消费数据计算的能够满足业务需求的数据,由不可逆函数、S200中的哈希算法以及随机定义的拼接规则构成不可逆加密算法,基于所述不可逆加密算法得到原始能源消费数据的第二证明问题;S300: Determine the irreversible function according to the business requirements of the energy big data center. The output result of the irreversible function is the data calculated according to the original energy consumption data that can meet the business requirements. The irreversible function, the hash algorithm in S200 and the randomly defined splicing rule Constitute an irreversible encryption algorithm, and obtain the second proof problem of the original energy consumption data based on the irreversible encryption algorithm;
S400:根据第一证明问题和第二证明问题的重复部分验证原始能源消费数据是否完整,若验证通过则执行S500,否则拒绝进行零知识证明;S400: Verify whether the original energy consumption data is complete according to the repeated part of the first proof problem and the second proof problem, and if the verification passes, execute S500, otherwise, refuse to perform zero-knowledge proof;
S500:基于傅里叶逆变换将第一证明问题和第二证明问题转换为多项式向量,结合能源大数据中心生成的随机数,分别计算第一证明问题和第二证明问题的零知识证明,将零知识证明和第二证明问题发送给能源大数据中心;S500: Convert the first proof problem and the second proof problem into a polynomial vector based on the inverse Fourier transform, and combine the random numbers generated by the Energy Big Data Center to calculate the zero-knowledge proofs of the first proof problem and the second proof problem, respectively. The zero-knowledge proof and the second proof problem are sent to the energy big data center;
S600:若零知识证明均满足能源大数据中心规定的验证条件,则将第二证明问题存储到能源大数据中心,否则判定原始能源消费数据未通过真实性验证,拒绝将第二证明问题存储到能源大数据中心。S600: If the zero-knowledge proofs all meet the verification conditions specified by the energy big data center, store the second proof questions in the energy big data center, otherwise determine that the original energy consumption data fails the authenticity verification, and refuse to store the second proof questions in the energy big data center. Energy Big Data Center.
现阶段,能源公司常常需要获取各耗能企业的能源消费数据以分析能源消耗情况,并针对能耗情况及时调整能源营销计划以及能源定价策略,本实施例中能源消费数据主要包括各个耗能企业的水、电、气以及其他新能源的实时消耗数据以及购买上述能源的实时费用。本实施例为了实现上述目的,建立能源大数据中心并在各家耗能企业内部安装仪表进行能源消费监控,首先确定耗能企业中水、电、气计量仪表的数据端口,获取数据端口的量纲参数,再基于预设频率向所述数据端口发送数据采集请求,本实施例中按照十五分钟每次的频率进行水、电、气计量仪表的计量数据的采集,根据量纲参数对计量数据进行量纲统一处理,具体为获取预先建立的对应不同量纲的量纲转换模型,将计量数据输入量纲转换模型,使同类能源消费数据具有相同的量纲,便于能源大数据中心后续对能源消费情况进行统一分析,将处理后的计量数据作为原始能源消费数据。At this stage, energy companies often need to obtain the energy consumption data of each energy-consuming enterprise to analyze the energy consumption, and adjust the energy marketing plan and energy pricing strategy in time according to the energy consumption. In this embodiment, the energy consumption data mainly includes each energy-consuming enterprise The real-time consumption data of water, electricity, gas and other new energy and the real-time cost of purchasing the above energy. In order to achieve the above purpose, in this embodiment, an energy big data center is established and meters are installed in each energy-consuming enterprise to monitor energy consumption. First, the data ports of the water, electricity, and gas metering instruments in the energy-consuming enterprises are determined, and the quantity of the data port is obtained. dimensional parameters, and then send a data collection request to the data port based on the preset frequency. In this embodiment, the measurement data of water, electricity, and gas metering instruments are collected at a frequency of fifteen minutes each time. The data is subjected to unified dimension processing. Specifically, the pre-established dimension conversion models corresponding to different dimensions are obtained, and the measurement data is input into the dimension conversion model, so that the energy consumption data of the same type have the same dimension, which is convenient for the energy big data center to follow-up. The energy consumption is analyzed uniformly, and the processed metering data is used as the original energy consumption data.
常规的处理方法是直接将原始能源消费数据传输至能源大数据中心进行分析和处理。然而该过程存在两个主要的问题,首先通过明文的方式传输耗能企业的能源消费数据的过程存在隐私泄露的风险,其次从耗能企业传输至能源大数据中心的数据真实性有待进一步商榷。以上问题的存在,一定程度上阻碍了能源大数据中心的服务质量,进而影响了政企之间的数据共享与深度融合。因此,本实施例采用零知识证明解决上述问题。零知识证明是一种能够保护隐私的密码学算法,能够在不向验证者提供任何隐私信息的情况下,使验证者相信某个论断是正确的。The conventional processing method is to directly transmit the raw energy consumption data to the energy big data center for analysis and processing. However, there are two main problems in this process. First, there is a risk of privacy leakage in the process of transmitting energy consumption data of energy-consuming enterprises in plaintext. Secondly, the authenticity of the data transmitted from energy-consuming enterprises to the energy big data center needs to be further discussed. The existence of the above problems hinders the service quality of the energy big data center to a certain extent, and then affects the data sharing and deep integration between the government and enterprises. Therefore, this embodiment adopts zero-knowledge proof to solve the above problem. Zero-knowledge proof is a cryptographic algorithm that can protect privacy, which can make the verifier believe that a certain assertion is correct without providing any private information to the verifier.
本实施例在常规零知识证明算法的基础上,分别生成两个证明问题进行零知识证明,其证明流程如图2所示,能耗生成模块和能耗加密模块均部署在耗能企业内部的服务器中,能耗验证模块部署在能源大数据中心上,能耗生成模块能够汇集耗能企业中各个仪表采集到的计量数据,能耗加密模块将原始能源消费数据X加密处理为第一证明问题和第二证明问题,并生成一个证明方法"π" 发送给能耗验证模块,其中,采用哈希算法对X进行数据加密得到第一证明问题Y=Hash(X),本实施例中哈希算法为SHA-256算法,位于能源大数据中心的能耗验证模块将自定义的不可逆加密函数F发送给能耗加密模块,能耗加密模块对X进行数据加密得到第二证明问题Z=F(X),其中Z能够用于能源大数据中心进行后续处理。In this embodiment, based on the conventional zero-knowledge proof algorithm, two proof problems are respectively generated for zero-knowledge proof. The proof process is shown in Figure 2. Both the energy consumption generation module and the energy consumption encryption module are deployed in the energy consumption enterprise In the server, the energy consumption verification module is deployed on the energy big data center, the energy consumption generation module can collect the measurement data collected by various meters in the energy-consuming enterprise, and the energy consumption encryption module encrypts the original energy consumption data X as the first proof problem and the second proof problem, and generate a proof method "π" and send it to the energy consumption verification module, wherein the first proof problem Y=Hash(X) is obtained by using the hash algorithm to encrypt the data of X. In this embodiment, the hash algorithm The algorithm is the SHA-256 algorithm. The energy consumption verification module located in the energy big data center sends the custom irreversible encryption function F to the energy consumption encryption module, and the energy consumption encryption module encrypts the data of X to obtain the second proof problem Z=F( X), where Z can be used in the energy big data center for subsequent processing.
本实施例中下面针对不可逆加密函数F的生成过程进行具体阐述:In this embodiment, the generation process of the irreversible encryption function F is specifically described below:
获取预先存储在能源大数据中心的函数库,所述函数库中包含若干个自定义的不可逆函数,根据能源大数据中心的业务需求在函数库中选取一个不可逆函数。例如,能源大数据中心具有预测能源费用的应用业务,其包括一个用于预测未来某一段时间耗能企业能源消费情况的预测模型,需要获取耗能企业在某一时段内各类能源的消费总费用作为预测模型的训练数据,基于此业务需求,选取一个不可逆函数,能源大数据中心将该不可逆函数发送给耗能企业,耗能企业即可将原始能源消费数据输入不可逆函数,输出结果为各类能源对应的原始能源消费数据的消费总费用。由此可见,不可逆函数的主要作用为将能源大数据对数据的需求发送给耗能企业,相当于将能源大数据中心对原始能源消费数据的部分处理操作转移到耗能企业内部进行,由耗能企业对原始能源消费数据进行一定的预处理后直接将满足业务需求的数据处理结果发送给能源大数据中心,这样能源大数据中心即可在不获取耗能企业的原始能源消费数据X的前提下获得其在后续应用中需要的数据,进而使能源大数据中心能够根据这些数据进行能源营销策略的规划。Obtain the function library pre-stored in the energy big data center, the function library contains several self-defined irreversible functions, and select an irreversible function in the function library according to the business requirements of the energy big data center. For example, the energy big data center has the application business of predicting energy costs, which includes a prediction model for predicting the energy consumption of energy-consuming enterprises in a certain period of time in the future. The cost is used as the training data for the prediction model. Based on this business requirement, an irreversible function is selected, and the energy big data center sends the irreversible function to the energy-consuming enterprise. The energy-consuming enterprise can input the original energy consumption data into the irreversible function, and the output result is each The total consumption cost of the original energy consumption data corresponding to the class energy. It can be seen that the main function of the irreversible function is to send the data requirements of energy big data to energy-consuming enterprises, which is equivalent to transferring part of the processing operations of the original energy consumption data by the energy big data center to the energy-consuming enterprises. After preprocessing the original energy consumption data, the energy enterprise directly sends the data processing results that meet the business needs to the energy big data center, so that the energy big data center can obtain the original energy consumption data X of the energy-consuming enterprise on the premise It can obtain the data it needs in subsequent applications, so that the energy big data center can plan energy marketing strategies based on these data.
为了提高第一证明问题的不可逆性,本实施例还会随机确定第一证明问题与原始能源消费数据的拼接顺序规则,结合选取的不可逆函数、S200中的哈希算法共同组成不可逆加密算法。能源大数据中心将不可逆加密算法发送给耗能企业,耗能企业将原始能源消费数据输入不可逆加密算法进行计算的过程如下:In order to improve the irreversibility of the first proof problem, this embodiment also randomly determines the splicing sequence rule of the first proof problem and the original energy consumption data, and combines the selected irreversible function and the hash algorithm in S200 to form an irreversible encryption algorithm. The energy big data center sends the irreversible encryption algorithm to the energy-consuming enterprise, and the energy-consuming enterprise inputs the original energy consumption data into the irreversible encryption algorithm for calculation as follows:
将原始能源消费数据输入S200中的哈希算法,得到第一字符串,将原始能源消费数据输入不可逆函数,得到第二字符串;Input the raw energy consumption data into the hash algorithm in S200 to obtain the first character string, and input the raw energy consumption data into the irreversible function to obtain the second character string;
按照不可逆加密算法中的拼接顺序规则将第一字符串与第二字符串进行拼接,得到第二证明问题。本实施例中所述拼接顺序规则包括第一字符串和第二字符串整体进行拼接的前后顺序,以及将第一字符串在预设字符位置进行分割后与第二字符串拼接的前后顺序。例如,第一字符串为“3a6fed5fc11392b3ee9f81caf017b48640d7458766a8eb0382899a605b41f2b9”,第二字符串为“50000”,第一字符串为一个长度为64的十六进制字符串,拼接顺序规则规定在第8个字符串的位置分割,得到第一字符串的两个子字符串“3a6fed5f”和“c11392b3ee9f81caf017b48640d7458766a8eb0382899a605b41f2b9”,并规定分割后的两个子字符串分别拼接在第二字符串的首尾,拼接后的字符串即为最终生成的第二证明问题,即Z=F(X)=3a6fed5f5000011392b3ee9f81caf017b48640d7458766a8eb0382899a605b41f2b9。The first string and the second string are spliced according to the splicing sequence rule in the irreversible encryption algorithm, and the second proof problem is obtained. The splicing sequence rules in this embodiment include the sequence of splicing the first character string and the second character string as a whole, and the sequence of splicing the second character string after the first character string is divided at the preset character position. For example, the first string is "3a6fed5fc11392b3ee9f81caf017b48640d7458766a8eb0382899a605b41f2b9", the second string is "50000", the first string is a hexadecimal string with a length of 64, and the splicing order rule stipulates that the split is at the position of the 8th string , get the two substrings "3a6fed5f" and "c11392b3ee9f81caf017b48640d7458766a8eb0382899a605b41f2b9" of the first string, and specify that the two substrings after splitting are spliced at the beginning and end of the second string respectively, and the spliced string is the final generated second string. The proof problem is that Z=F(X)=3a6fed5f5000011392b3ee9f81caf017b48640d7458766a8eb0382899a605b41f2b9.
在本实施例中,不可逆加密函数中之所以还包括了S200中使用的哈希算法,是为了确保用于分别生成第一证明问题和第二证明问题的原始能源消费数据一致,实现对原始能源消费数据的完整性校验,避免因输入的原始能源消费数据不完整导致后续能源大数据中心获取的数据不准确的问题。能源大数据中心将第一证明问题和第二证明问题进行比对,若经过比对得到的重复部分与第一证明问题不一致,则未通过完整性校验,能源大数据中心拒绝接收第一证明问题和第二证明问题,不再进行后续的零知识证明步骤。若经过比对得到的重复部分与第一证明问题一致,即两次哈希值相同,说明第一证明问题Y=Hash(X)和第二证明问题Z=F(X)中的X是一致的,原始能源消费数据的完整性通过校验。In this embodiment, the reason why the irreversible encryption function also includes the hash algorithm used in S200 is to ensure that the original energy consumption data used to generate the first proof problem and the second proof problem respectively are consistent, so as to ensure that the original energy consumption data are consistent with each other. The integrity verification of consumption data avoids the problem of inaccurate data obtained by the subsequent energy big data center due to incomplete input of original energy consumption data. The energy big data center compares the first proof problem with the second proof problem. If the repeated part obtained by the comparison is inconsistent with the first proof problem, the integrity check is not passed, and the energy big data center refuses to receive the first proof. problem and the second proof problem, no subsequent zero-knowledge proof steps are performed. If the repeated part obtained by comparison is consistent with the first proof problem, that is, the two hash values are the same, it means that X in the first proof problem Y=Hash(X) and the second proof problem Z=F(X) are consistent Yes, the integrity of the original energy consumption data passed the verification.
在本实施例中,不可逆加密函数中之所以还规定了拼接顺序规则,是为了提高第二证明问题在由耗能企业发送至能源大数据中心过程中的数据安全性,避免第三方恶意窃取相关信息。In this embodiment, the splicing sequence rule is also specified in the irreversible encryption function, in order to improve the data security of the second proof problem in the process of sending it from the energy-consuming enterprise to the energy big data center, and to avoid malicious theft by a third party. information.
通过完整性校验后,图2所示能耗验证模块中的基于Groth版本的 zkSNARKs零知识证明协议对第一证明问题和第二证明问题分别进行零知识证明。zkSNARKs是“Zero-Knowledge Succinct Non-Interactive Argument of Knowledge”的简称,指一种非交互式的、可以证明某人拥有某些信息的证明结构。本实施例中具体零知识证明过程包括:After passing the integrity check, the zkSNARKs zero-knowledge proof protocol based on the Groth version in the energy consumption verification module shown in Figure 2 respectively performs zero-knowledge proof for the first proof problem and the second proof problem. zkSNARKs is short for "Zero-Knowledge Succinct Non-Interactive Argument of Knowledge", which refers to a non-interactive proof structure that can prove that someone has certain information. The specific zero-knowledge proof process in this embodiment includes:
基于zkSNARKs零知识协议,将第一证明问题和第二证明问题分别转化为若干个二元赋值式,所述二元赋值式即将Y=Hash(X)和Z=F(X)分别转化为仅有二元变量且仅具有加、减、乘、除等基本运算组成的单步骤;Based on the zkSNARKs zero-knowledge protocol, the first proof problem and the second proof problem are transformed into several binary assignments, which transform Y=Hash(X) and Z=F(X) into only A single step consisting of binary variables and only basic operations such as addition, subtraction, multiplication, and division;
将二元赋值式中的变量组合为向量u,为了能够表达二元赋值式中的常数,所述向 量u的第一个元素恒为1,根据二元赋值式和向量u分别将第一证明问题和第二证明问题转 化为R1CS实例,其中N为第一证明问题或第二证明问题的变量个数,M为二 元赋值式的个数,a、b、c分别为R1CS实例中的向量序列,使; The variables in the binary assignment are combined into a vector u. In order to express the constants in the binary assignment, the first element of the vector u is always 1. According to the binary assignment and the vector u, the first proof is The problem and the second proof problem are transformed into R1CS instances , where N is the number of variables in the first proof problem or the second proof problem, M is the number of binary assignments, and a, b, and c are the vector sequences in the R1CS instance, so that ;
将R1CS实例转化为QAP实例,其中A、B、C依次为R1CS实例中的向 量序列的傅里叶逆变换,本领域技术人员应当连接如何将R1CS实例转化为QAP实例,此处不 再赘述; Convert R1CS instance to QAP instance , wherein A, B, and C are the inverse Fourier transform of the vector sequence in the R1CS instance in turn, and those skilled in the art should connect the R1CS instance into a QAP instance, which will not be repeated here;
获取能源大数据中心生成的随机数t、、、、、、、、,其中t为随机 选取的采样点,计算中间向量、与,计算过程如下: Obtain the random number t generated by the energy big data center, , , , , , , , , where t is a randomly selected sampling point, and the intermediate vector is calculated , and , the calculation process is as follows:
; ;
其中,,、…、 为预设可信域D中的元素,j为 的元素标号,j的取值范围为0至M-2之间的正整数,表示t采样点下向量A的第一个元 素,表示t采样点下向量B的第一个元素,表示t采样点下向量C的第一个元素,表示t采样点下向量A的第个元素,表示t采样点下向量B的第个元素,表示t采样点下向量C的第个元素,i的取值范围为1至N-1之间的正整数; in, , , …, is the element in the preset trusted domain D, and j is The element label of , the value of j is a positive integer between 0 and M-2, represents the first element of the vector A at the t sampling point, represents the first element of the vector B at the t sampling point, represents the first element of the vector C at the t sampling point, Represents the th elements, Represents the th elements, represents the th elements, the value range of i is a positive integer between 1 and N-1;
计算、、以及,计算过程如下: calculate , , as well as , the calculation process is as follows:
; ;
其中,为的第j项系数,,表示向量u的第i个元 素,表示中间向量的第i个元素,表示中间向量的第j个元素,r、s 为耗能企业作为证明方选取的随机数; in, for The jth coefficient of , , represents the ith element of the vector u, represents the intermediate vector the ith element of , represents the intermediate vector The jth element of , r and s are random numbers selected by the energy-consuming enterprise as the prover;
根据计算结果组成向量作为零知识证明。 Form a vector according to the calculation result as a zero-knowledge proof.
最后,由能源大数据中心根据根据接收到的零知识证明验 证是否正确,其中,e为双线性配对映射, 可表示为,、为映射e的输入变量,为映射e的输出变量,本实施 例中映射e由能源大数据中心自行确定。若正确则判定第一证明问题和第二证明问题通过 真实性验证。由此可见,若第一证明问题和第二证明问题均证明成功,则能源大数据中心作 为验证者认证耗能企业具有真实的原始能源消费数据,同时存储Z=f(X)进行后续的能耗综 合运算;若第一证明问题和第二证明问题中任一项证明失败,则能源大数据中心作为验证 者认为耗能企业的原始能源消费数据不具有真实性,拒绝存储Z=f(X),并发出警报。 Finally, according to the zero-knowledge proof received by the energy big data center verify Is it correct, where e is a bilinear pairing map, which can be expressed as , , is the input variable of mapping e, In order to map the output variable of e, in this embodiment, the map e is determined by the energy big data center itself. If it is correct, it is determined that the first proof problem and the second proof problem pass the authenticity verification. It can be seen that if both the first proof problem and the second proof problem are proved successful, the energy big data center, as a verifier, certifies that the energy-consuming enterprise has real original energy consumption data, and stores Z=f(X) for subsequent energy consumption. Consumption comprehensive calculation; if any one of the first proof problem and the second proof problem fails, the energy big data center, as a verifier, believes that the original energy consumption data of the energy-consuming enterprise is not authentic, and refuses to store Z=f(X ), and an alarm is issued.
因此通过上述过程生成的不可逆加密函数能够实现对原始能源消费数据的特殊加密,在保证零知识证明有效性的基础上,使其加密过的原始能源消费数据能够用于进一步的能耗计算,能源大数据中心在后续能够直接利用Z进行能源消费分析等应用业务。Therefore, the irreversible encryption function generated by the above process can realize the special encryption of the original energy consumption data. On the basis of ensuring the validity of the zero-knowledge proof, the encrypted original energy consumption data can be used for further energy consumption calculation. In the future, the big data center can directly use Z for energy consumption analysis and other application services.
上述实施例中的各个序号仅仅为了描述,不代表各部件的组装或使用过程中的先后顺序。The serial numbers in the above-mentioned embodiments are only for description, and do not represent the order in which the components are assembled or used.
以上所述仅为本发明的实施例,并不用以限制本发明,凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above descriptions are only the embodiments of the present invention and are not intended to limit the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention. Inside.
Claims (8)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110954361.XA CN113407981B (en) | 2021-08-19 | 2021-08-19 | Energy consumption data processing method based on zero knowledge proof |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110954361.XA CN113407981B (en) | 2021-08-19 | 2021-08-19 | Energy consumption data processing method based on zero knowledge proof |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113407981A true CN113407981A (en) | 2021-09-17 |
CN113407981B CN113407981B (en) | 2021-11-09 |
Family
ID=77688909
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110954361.XA Active CN113407981B (en) | 2021-08-19 | 2021-08-19 | Energy consumption data processing method based on zero knowledge proof |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113407981B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114064993A (en) * | 2021-11-16 | 2022-02-18 | 瀚云科技有限公司 | Energy data acquisition method and energy balance diagram construction method and device |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102446329A (en) * | 2010-10-08 | 2012-05-09 | 微软公司 | Privacy-preserving metering |
CN110795767A (en) * | 2019-11-12 | 2020-02-14 | 阳光电源股份有限公司 | Electric power transaction method, device and system and trusted cloud platform |
CN113037479A (en) * | 2021-03-25 | 2021-06-25 | 支付宝(杭州)信息技术有限公司 | Data verification method and device |
-
2021
- 2021-08-19 CN CN202110954361.XA patent/CN113407981B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102446329A (en) * | 2010-10-08 | 2012-05-09 | 微软公司 | Privacy-preserving metering |
CN110795767A (en) * | 2019-11-12 | 2020-02-14 | 阳光电源股份有限公司 | Electric power transaction method, device and system and trusted cloud platform |
CN113037479A (en) * | 2021-03-25 | 2021-06-25 | 支付宝(杭州)信息技术有限公司 | Data verification method and device |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114064993A (en) * | 2021-11-16 | 2022-02-18 | 瀚云科技有限公司 | Energy data acquisition method and energy balance diagram construction method and device |
Also Published As
Publication number | Publication date |
---|---|
CN113407981B (en) | 2021-11-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108683669B (en) | Data verification method and secure multi-party computing system | |
TWI452533B (en) | Privacy-preserving metering | |
CN111886829A (en) | Computer-implemented system and method for distrusting zero knowledge or paid | |
Weng et al. | pvcnn: Privacy-preserving and verifiable convolutional neural network testing | |
Xu et al. | Catch you if you deceive me: Verifiable and privacy-aware truth discovery in crowdsensing systems | |
Zhao et al. | Blockchain-based auditable privacy-preserving data classification for Internet of Things | |
CN115760399A (en) | Data privacy transaction method based on zero knowledge proof | |
CN112291062A (en) | Voting method and device based on block chain | |
CN112104609A (en) | Method for verifiable privacy-aware true phase discovery in a mobile crowd-sourcing awareness system | |
CN115174091A (en) | Homomorphic encryption privacy protection method for distributed digital identity | |
CN112434026A (en) | Secure intellectual property pledge financing method based on Hash chain | |
CN113407981B (en) | Energy consumption data processing method based on zero knowledge proof | |
CN115150057A (en) | Integrity verification method for block chain cross-chain interactive data calculation result | |
CN117454431A (en) | Verifiable data privacy protection system and method for computing service outsourcing | |
Wang et al. | zkfl: Zero-knowledge proof-based gradient aggregation for federated learning | |
CN113078993A (en) | Smart grid third-party privacy protection method based on improved homomorphic encryption algorithm | |
Yang et al. | Accountable and verifiable secure aggregation for federated learning in IoT networks | |
Liang et al. | Decentralized crowdsourcing for human intelligence tasks with efficient on-chain cost | |
Zhang et al. | A blockchain-based privacy-preserving scheme for sealed-bid auction | |
CN116414875A (en) | Data processing apparatus and data processing method | |
Zhou et al. | Overview of zero-knowledge proof and its applications in Blockchain | |
Zhang et al. | Understanding privacy-preserving techniques in digital cryptocurrencies | |
Guo et al. | A Novel Biometric Identification Scheme Based on Zero‐Knowledge Succinct Noninteractive Argument of Knowledge | |
Xu et al. | Efficient privacy-preserving electronic voting scheme based on blockchain | |
Zhu | Operation mechanism for G2B system based on blockchain |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |