Joint statistical method and system based on blockchain and privacy computing technology

By using homomorphic encryption and privacy computing technology on the blockchain, the problem that plaintext data statistics and forwarding in the existing technology cannot guarantee data security is solved, and data privacy and secure sharing are realized, and the final statistical results are only provided.

CN119358045BActive Publication Date: 2025-04-08BEIJING NATIONAL FINANCIAL TECHNOLOGY RISK MONITORING CENTER CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411896515.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-23
Publication Date
2025-04-08
Estimated Expiration
2044-12-23

AI Technical Summary

Technical Problem

The statistics and forwarding of plaintext data in the prior art cannot guarantee the security of the data.

Method used

Using a joint statistical method based on blockchain and privacy computing technology, the data is securely encrypted and tampered with the decentralized characteristics of blockchain.

Benefits of technology

Ensure the privacy and security of data, prevent data providers and data queryers from obtaining unnecessary data information, and only final statistical results can be obtained.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119358045B_ABST
    Figure CN119358045B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of data processing technology, and proposes a joint statistical method and system based on blockchain and privacy computing technology. Among them, the joint statistical method based on blockchain and privacy computing technology is used for data query parties, and mainly includes: determining keywords; generating homomorphic encryption public keys and homomorphic encryption private keys; encrypting keywords according to homomorphic encryption public keys to obtain ciphertext data; sending ciphertext data to blockchain; receiving indicator polynomial ciphertext sent by blockchain; determining location information according to indicator polynomial ciphertext; sending location information and random values ​​to blockchain, so that the data provider corresponding to the location information constructs the result ciphertext according to the random value; receiving the joint statistical ciphertext sent in the blockchain, wherein the joint statistical ciphertext is obtained after the blockchain performs homomorphic addition processing on multiple result ciphertexts; and obtaining joint statistical data according to the joint statistical ciphertext. The present invention ensures the security of data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a joint statistical method and system based on blockchain and privacy computing technology. Background Art

[0002] Existing joint statistical solutions are basically based on third-party service agencies or centralized systems to count and forward plaintext data. However, the statistics and forwarding of plaintext data cannot guarantee the security of the data. Summary of the invention

[0003] The present invention aims to at least solve the problem in the related art that statistics and forwarding of plaintext data cannot guarantee the security of the data.

[0004] To this end, the first aspect of the present invention proposes a joint statistical method based on blockchain and privacy computing technology.

[0005] The second aspect of the present invention proposes a joint statistical method based on blockchain and privacy computing technology.

[0006] The third aspect of the present invention proposes a joint statistical system based on blockchain and privacy computing technology.

[0007] The fourth aspect of the present invention proposes a joint statistical system based on blockchain and privacy computing technology.

[0008] A fifth aspect of the present invention provides an electronic device.

[0009] A sixth aspect of the present invention provides a storage medium.

[0010] In view of this, according to the first aspect of the present invention, a joint statistical method based on blockchain and privacy computing technology is proposed, which is used for data query parties, including: determining keywords; generating homomorphic encryption public keys and homomorphic encryption private keys; encrypting keywords according to the homomorphic encryption public keys to obtain ciphertext data; sending the ciphertext data to the blockchain; receiving the indicator polynomial ciphertext sent by the blockchain, wherein the indicator polynomial ciphertext is sent by the data provider to the blockchain; determining the location information according to the indicator polynomial ciphertext, wherein the location information includes the location of the target data provider and the location of the target data in the target data group of the target data provider, and the target data corresponds to the keyword; generating a random value; sending the location information and the random value to the blockchain, so that the data provider corresponding to the location information constructs a result ciphertext based on all data of the target data group combined with the random value; receiving the joint statistical ciphertext sent in the blockchain, wherein the joint statistical ciphertext is obtained after the blockchain performs homomorphic addition processing on multiple result ciphertexts; obtaining joint statistical data according to the joint statistical ciphertext.

[0011] The joint statistical method based on blockchain and privacy computing technology provided by the present invention is mainly used for data query parties, and mainly includes: first determining keywords, wherein the keywords are related to the data that the data query party wants to query. Then the data query party and the data provider generate a Paillier (a homomorphic encryption method) homomorphic encryption public key and a homomorphic encryption private key. After determining the keywords, the data query party uses a homomorphic encryption algorithm and a homomorphic encryption public key to encrypt the keywords to obtain ciphertext data, and then sends the ciphertext data to the blockchain. The blockchain will send the ciphertext data to the data provider, and the data provider will send an indicator polynomial ciphertext to the blockchain based on the ciphertext data. Then the data query party receives the indicator polynomial ciphertext sent by the blockchain. After obtaining the indicator polynomial ciphertext, the location information is determined according to the indicator polynomial ciphertext, wherein it can be understood that the number of data providers can be multiple, and each data provider can provide multiple data, but some of the data providers and some of the data may not be required by the data query party, so the data query party can determine the required data provider, i.e., the location information of the target data provider, and the location of the required data, i.e., the target data, in the target data group of the target data provider according to the indicator polynomial ciphertext. After determining the location information, the data query party will generate a random value, wherein the range of the random value is greater than or equal to 100,000 and less than or equal to 1 billion. Then the location information and the random value are sent to the blockchain at the same time, so that the target data provider corresponding to the location information can use the random value to construct the result ciphertext, that is, the data provider can use the random value to hide all the data in the target data group and then encrypt it, and then construct the result ciphertext according to the encrypted data. After sending the result ciphertext to the blockchain, the data query party receives the joint statistical ciphertext sent by the blockchain, wherein the joint statistical ciphertext is the joint statistical ciphertext obtained after the blockchain performs homomorphic addition processing on multiple result ciphertexts constructed by the data provider. After receiving the joint statistical ciphertext, the data query party decrypts the joint statistical ciphertext to obtain the joint statistical data. The present invention introduces blockchain technology, and uses blockchain to transfer data between the data query party and the data provider, thereby realizing decentralized data sharing. At the same time, the use of blockchain ensures that the data cannot be tampered with, which is conducive to post-audit. At the same time, the present invention also introduces privacy computing technology to encrypt the data and conduct joint statistics of the ciphertext on the blockchain. This ensures the privacy of the shared data, that is, the data provider cannot know the query keyword, and the data query party cannot obtain the specific data of each data provider, and can only obtain the final statistical results.

[0012] The joint statistical method based on blockchain and privacy computing technology according to the present invention may also have the following technical features:

[0013] In some technical solutions, optionally, the step of determining the location information based on the indicator polynomial ciphertext includes: decrypting the indicator polynomial ciphertext; and determining the location information corresponding to the indicator polynomial ciphertext when the decryption result of the indicator polynomial ciphertext is zero.

[0014] In this technical solution, the step of determining the location information according to the indicator polynomial ciphertext includes: first, decrypting all the indicator polynomial ciphertexts. Since the number of data providers can be multiple, the number of indicator polynomial ciphertexts sent by the blockchain is also multiple, so it is necessary to decrypt all the indicator polynomial ciphertexts and obtain the decryption results. When the decryption result of a certain indicator polynomial ciphertext is zero, it means that the data provider who sent the indicator polynomial ciphertext is what the data query party needs, so the location information of the data provider is queried and recorded. By decrypting all the indicator polynomial ciphertexts, the data provider required by the data query party is determined.

[0015] In some technical solutions, optionally, the step of obtaining joint statistical data based on the joint statistical ciphertext includes: decrypting the joint statistical ciphertext according to the homomorphic encryption private key to obtain a decryption result; and determining the joint statistical data based on the decryption result and the random value.

[0016] In the technical solution, the step of obtaining joint statistical data according to the joint statistical ciphertext includes: first, using a homomorphic encryption algorithm, using a homomorphic encryption private key to decrypt the obtained joint statistical data, and obtaining a decryption result. Furthermore, since the joint statistical data is obtained by homomorphic addition processing based on the result ciphertext, and the result ciphertext is constructed by the data provider based on a random value, that is, after decrypting the joint statistical data, the decryption result obtained is the result after hiding the real data. Therefore, in order to obtain the real data, it is also necessary to determine it based on the decryption result and the random value. Specifically, the real joint statistical data can be obtained by subtracting the random value from the decryption result.

[0017] According to a second aspect of the present invention, a joint statistical method based on blockchain and privacy computing technology is proposed, which is used for data providers, wherein the number of data providers is multiple, and the joint statistical method based on blockchain and privacy computing technology mainly includes: constructing an indicator polynomial; generating a homomorphic encryption public key and a homomorphic encryption private key; receiving ciphertext data sent by the blockchain, wherein the ciphertext data corresponds to the data query party; determining the indicator polynomial according to the ciphertext data, and homomorphically encrypting the indicator polynomial to obtain the indicator polynomial ciphertext; sending the indicator polynomial ciphertext to the blockchain; receiving location information and a random value sent by the blockchain, wherein the location information and the random value are sent to the blockchain by the data query party; determining a target data provider and a target data group where the target data is located among multiple data providers according to the location information, wherein the target data group contains data corresponding to the keyword; hiding the data in the target data group according to the random value; obtaining an interpolation polynomial according to the hidden target data group; determining a result ciphertext corresponding to the data provider according to the interpolation polynomial and the ciphertext data; uploading multiple result ciphertexts to the blockchain, so that the blockchain performs homomorphic addition processing on the multiple result ciphertexts to obtain a joint statistical ciphertext.

[0018] The joint statistical method based on blockchain and privacy computing technology provided by the present invention is mainly used for data providers, wherein the number of data providers can be multiple, and the joint statistical method based on blockchain and privacy computing technology mainly includes: first, each data provider constructs an indicator polynomial according to the data contained in itself, and then the data query party and the data provider generate a Paillier homomorphic encryption public key and a homomorphic encryption private key, and then receive the ciphertext data sent by the blockchain, wherein the ciphertext data is the ciphertext data generated after the data query party encrypts the keyword. After receiving the ciphertext data, the data provider determines the indicator polynomial according to the ciphertext data, and homomorphically encrypts the indicator polynomial. Specifically, the coefficient of each term in the indicator polynomial can be used as a multiplication factor, and the ciphertext data can be used as the ciphertext to be multiplied, and then a homomorphic multiplication operation is performed, and the result is homomorphic addition to obtain the indicator polynomial ciphertext corresponding to the indicator polynomial. Then the indicator polynomial ciphertext is sent to the blockchain. The location information and random value sent by the blockchain are received, and the location information and random value are sent to the blockchain by the data query party. Since there are multiple data providers, some data providers may not need to provide data to the data query party. Therefore, the data provider that needs to provide data to the data query party, i.e., the target data provider, and the data that needs to be provided to the data query party, i.e., the target data group in the target data party, are determined according to the location information, wherein the target data group contains data corresponding to the keyword. Then the target data provider hides the stored data stored in the target data group according to the random value. At the same time, the data provider constructs an interpolation polynomial based on the hidden stored data using the Lagrange interpolation method. After obtaining the interpolation polynomial, the result ciphertext is determined according to the interpolation polynomial and the ciphertext data. Specifically, the ciphertext data can be brought into the interpolation polynomial to obtain the result ciphertext. Finally, the result ciphertext is uploaded to the blockchain. Since there are multiple data providers, the result ciphertext is also multiple, so the multiple result ciphertexts will be homomorphically added in the blockchain, thereby obtaining the joint statistical ciphertext after hiding the real data. The present invention introduces blockchain technology, and uses blockchain to transfer data between data query parties and data providers, thereby achieving decentralized data sharing. At the same time, the use of blockchain ensures that the data cannot be tampered with, which is conducive to post-audit. At the same time, the present invention also introduces privacy computing technology to encrypt data and conduct joint statistics of ciphertext on the blockchain. This ensures the privacy of shared data, that is, the data provider cannot know the query keywords, and the data query party cannot obtain the specific data of each data provider, and can only obtain the final statistical results.

[0019] In some technical solutions, optionally, the step of constructing the indicator polynomial includes: grouping the stored data according to a preset number to obtain multiple data groups; and constructing the indicator polynomial according to the multiple data groups.

[0020] In the technical solution, the step of constructing the indicator polynomial includes: firstly, grouping the stored data stored in each data provider with preset data, and then obtaining multiple data groups. Then constructing the indicator polynomial according to the multiple data groups. By grouping the stored data and constructing the indicator polynomial according to the grouped multiple data groups, the stored data in the data provider can be reflected in the indicator polynomial. This provides a basis for the subsequent data query party to determine the required data provider according to the indicator polynomial ciphertext.

[0021] In some technical solutions, optionally, after the step of receiving the location information and the random value sent by the blockchain, it includes: selecting any one data provider from multiple data providers contained in the location information to obtain a random value; the selected data provider divides the random value according to the amount of location information to obtain multiple sub-random values.

[0022] In this technical solution, after the step of receiving the location information and random value sent by the blockchain, it includes: first, selecting any one data provider from multiple data providers included in the location information, then the selected data provider obtains the random value from the blockchain, and finally the selected data provider divides the random value according to the number of location information, thereby obtaining multiple sub-random value ciphertexts. Among them, the sub-random values ​​can be the same or different.

[0023] In some technical schemes, optionally, the step of hiding the data in the target data group according to the random value includes: encrypting the sub-random value according to the homomorphic encryption public key of each data provider to obtain the sub-random value ciphertext, and uploading it to the blockchain; controlling the data provider corresponding to the location information to obtain the sub-random value ciphertext in the blockchain, and decrypting the sub-random value ciphertext according to the homomorphic encryption private key; hiding the data in the target data group according to the decrypted sub-random value, wherein the target data group is the data group where the target data is located.

[0024] In this technical solution, the step of hiding the data in the target data group according to the random value includes: first, encrypting the sub-random value according to the homomorphic encryption public key of each data provider to obtain the sub-random value ciphertext, and uploading it to the blockchain. Then control the data provider corresponding to the location information to obtain the sub-random value ciphertext in the blockchain, and at the same time decrypt the sub-random value ciphertext according to the homomorphic encryption private key to obtain the decrypted sub-random value, so that each data provider included in the location information can obtain a sub-random value. After obtaining the sub-random value, the data in the target data group is hidden according to the sub-random value, wherein the target data group refers to the data group where the target data is located. Specifically, the data value in the data group can be directly added to the sub-random value to obtain the hidden stored data. By using random values ​​to hide the stored data, the data query party cannot obtain the specific data of each data provider, and can only obtain the target of the final statistical result.

[0025] According to the third aspect of the present invention, a joint statistical system based on blockchain and privacy computing technology is proposed for data query parties, wherein the joint statistical system based on blockchain and privacy computing technology includes: a first determination module, the first determination module is used to determine keywords; a first generation module, the first generation module is used to generate a homomorphic encryption public key and a homomorphic encryption private key; a first encryption module, the first encryption module is used to encrypt the keyword according to the homomorphic encryption public key to obtain ciphertext data; a first sending module, the first sending module is used to send the ciphertext data to the blockchain; a first receiving module, the first receiving module is used to receive an indicator polynomial ciphertext sent by the blockchain, and the indicator polynomial ciphertext is sent by the data provider to the blockchain; a second determination module, the second determination module is used to Determine the location information according to the indicator polynomial ciphertext, wherein the location information includes the location of the target data provider and the location of the target data in the target data group of the target data provider, and the target data corresponds to the keyword; a second generation module, the second generation module is used to generate a random value; a second sending module, the second sending module is used to send the location information and the random value to the blockchain, so that the data provider corresponding to the location information constructs a result ciphertext according to all the data of the target data group combined with the random value; a second receiving module, the second receiving module is used to receive the joint statistical ciphertext sent by the blockchain, wherein the joint statistical ciphertext is obtained after the blockchain performs homomorphic addition processing on multiple result ciphertexts; a first processing module, the first processing module is used to obtain joint statistical data according to the joint statistical ciphertext.

[0026] The joint statistical system based on blockchain and privacy computing technology provided by the present invention is mainly used for data query parties, and mainly includes: a first determination module, a first generation module, a first encryption module, a first sending module, a first receiving module, a second determination module, a second generation module, a second sending module, a second receiving module and a first processing module. Among them, the first determination module can determine a keyword, wherein the keyword is related to the data that the data query party wants to query. Then the first generation module generates a Paillier homomorphic encryption public key and a homomorphic encryption private key. After determining the keyword, the first encryption module uses a homomorphic encryption algorithm to encrypt the keyword using a homomorphic encryption public key to obtain ciphertext data, and then the first sending module sends the ciphertext data to the blockchain, and the blockchain will send the ciphertext data to the data provider, and the data provider will send the indicator polynomial ciphertext to the blockchain according to the ciphertext data. Then the first receiving module receives the indicator polynomial ciphertext sent by the blockchain. After obtaining the indicator polynomial ciphertext, the second determination module determines the location information according to the indicator polynomial ciphertext, wherein it can be understood that the number of data providers can be multiple, and each data provider can provide multiple data, but some of the data providers and some of the data may not be required by the data query party, so the data query party can determine the required data provider, i.e., the location information of the target data provider, and the location of the required data, i.e., the target data, in the target data group of the target data provider according to the indicator polynomial ciphertext. After determining the location information, the second generation module generates a random value, wherein the range of the random value is greater than or equal to 100,000 and less than or equal to 1 billion. Then the second sending module sends the location information and the random value to the blockchain at the same time, so that the target data provider corresponding to the location information can use the random value to construct the result ciphertext, i.e., the data provider can use all the data in the random value target data group to hide and encrypt, and then construct the result ciphertext according to the encrypted data. After the result ciphertext is sent to the blockchain, the second receiving module receives the joint statistical ciphertext sent by the blockchain, wherein the joint statistical ciphertext is the joint statistical ciphertext obtained after the blockchain performs homomorphic addition processing on multiple result ciphertexts constructed by the data provider. After receiving the joint statistical ciphertext, the first processing module decrypts the joint statistical ciphertext to obtain joint statistical data. The present invention introduces blockchain technology, and uses blockchain to transfer data between the data query party and the data provider, thereby realizing decentralized data sharing. At the same time, the use of blockchain ensures that the data cannot be tampered with, which is conducive to post-audit. At the same time, the present invention also introduces privacy computing technology to encrypt the data, and performs joint statistics of the ciphertext on the blockchain. This ensures the privacy of the shared data, that is, the data provider cannot know the query keywords, and the data query party cannot obtain the specific data of each data provider, and can only obtain the final statistical results.

[0027] According to a fourth aspect of the present invention, a joint statistical system based on blockchain and privacy computing technology is proposed, which is used for data providers, wherein the number of data providers is multiple, and the joint statistical system based on blockchain and privacy computing technology includes: a first construction module, the first construction module is used to construct an indicator polynomial; a third generation module, the third generation module is used to generate a homomorphic encryption public key and a homomorphic encryption private key; a third receiving module, the third receiving module is used to receive ciphertext data sent by the blockchain, wherein the ciphertext data corresponds to the data query party; a second encryption module, the second encryption module is used to determine the indicator polynomial according to the ciphertext data, and homomorphically encrypt the indicator polynomial to obtain the indicator polynomial ciphertext; a third sending module, the third sending module is used to send the indicator polynomial ciphertext to the blockchain; a fourth receiving module, the fourth receiving module is used to receive the area The block chain comprises a location information and a random value sent by the block chain, wherein the location information and the random value are sent to the block chain by the data query party; a third determination module, the third determination module is used to determine the target data provider and the target data group where the target data is located among multiple data providers according to the location information, wherein the target data group contains data corresponding to the keyword; a first hiding module, the first hiding module is used to hide the data in the target data group according to the random value; a second processing module, the second processing module is used to obtain an interpolation polynomial according to the hidden target data group; a third processing module, the third processing module is used to determine the result ciphertext corresponding to the data provider according to the interpolation polynomial and the ciphertext data; a fourth sending module, the fourth sending module is used to upload multiple result ciphertexts to the block chain, so that the block chain performs homomorphic addition processing on the multiple result ciphertexts to obtain a joint statistical ciphertext.

[0028] The joint statistical system based on blockchain and privacy computing technology provided by the present invention is mainly used for data providers, the joint statistical system based on blockchain and privacy computing technology, and the joint statistical method based on blockchain and privacy computing technology mainly include: a first construction module, a third generation module, a third receiving module, a second encryption module, a third sending module, a fourth receiving module, a third determination module, a first hidden module, a second processing module, a third processing module and a fourth sending module. Among them, first, the first construction module will construct an indicator polynomial according to the data contained in the data provider itself, and then the third generation module will generate a Paillier homomorphic encryption public key and a homomorphic encryption private key, and then the third receiving module will receive the ciphertext data sent by the blockchain, wherein the ciphertext data is the ciphertext data generated after the data query party encrypts the keyword. After receiving the ciphertext data, the second encryption module determines the indicator polynomial according to the ciphertext data, and homomorphically encrypts the indicator polynomial. Specifically, the coefficient of each term in the indicator polynomial can be used as a multiplication factor, and the ciphertext data can be used as the ciphertext to be multiplied, and then a homomorphic multiplication operation is performed, and the result is performed homomorphic addition to obtain the indicator polynomial ciphertext corresponding to the indicator polynomial. Then the third sending module sends the indication polynomial ciphertext to the blockchain. The fourth receiving module receives the location information and random value sent by the blockchain, and the location information and random value are sent to the blockchain by the data query party. Since there are multiple data providers, some data providers may not need to provide data to the data query party. Therefore, the third determination module can determine the data provider that needs to provide data to the data query party, that is, the target data provider, and the data that needs to be provided to the data query party, that is, the target data group in the target data party according to the location information, wherein the target data group contains data corresponding to the keyword. Then the target data provider hides the stored data in the target data group according to the random value through the first hiding module. At the same time, the second processing module constructs an interpolation polynomial based on the hidden stored data using the Lagrange interpolation method. After obtaining the interpolation polynomial, the third processing module determines the result ciphertext according to the interpolation polynomial and the ciphertext data. Specifically, the ciphertext data can be brought into the interpolation polynomial to obtain the result ciphertext. Finally, the fourth sending module uploads the result ciphertext to the blockchain. Since there are multiple data providers, there are also multiple result ciphertexts. Therefore, multiple result ciphertexts will be processed with homomorphic addition in the blockchain, thereby obtaining a joint statistical ciphertext after hiding the real data. The present invention introduces blockchain technology, and uses blockchain to transfer data between the data query party and the data provider, thereby realizing decentralized data sharing. At the same time, the use of blockchain ensures that the data cannot be tampered with, which is conducive to post-audit. At the same time, the present invention also introduces privacy computing technology to encrypt data, and performs joint statistics of ciphertext on the blockchain.Doing so ensures the privacy of shared data, meaning that the data provider cannot know the query keywords, and the data query party cannot obtain the specific data of each data provider, and can only obtain the final statistical results.

[0029] According to a fifth aspect of the present invention, an electronic device is proposed, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the joint statistical method based on blockchain and privacy computing technology as described above are implemented.

[0030] The electronic device provided by the present invention, in which the processor implements the steps of the above-mentioned joint statistical method based on blockchain and privacy computing technology when executing a computer program, can achieve the technical effects of any of the above-mentioned technical solutions, and will not be repeated here.

[0031] According to a sixth aspect of the present invention, a storage medium is proposed, on which a computer program is stored. When the computer program is executed by a processor, the steps of the joint statistical method based on blockchain and privacy computing technology as described above are implemented.

[0032] The storage medium provided by the present invention, when the computer program is executed by the processor, implements the steps of the above-mentioned joint statistical method based on blockchain and privacy computing technology, and can achieve the technical effects of any of the above-mentioned technical solutions, which will not be repeated here.

[0033] Additional aspects and advantages of the present invention will become apparent from the following description or may be learned by practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:

[0035] Figure 1 One of the flowcharts of a joint statistical method based on blockchain and privacy computing technology according to an embodiment of the present invention is shown;

[0036] Figure 2 A flowchart showing the steps of determining location information according to an indicator polynomial ciphertext in a joint statistical method based on blockchain and privacy computing technology according to an embodiment of the present invention is shown;

[0037] Figure 3 A flowchart showing the steps of obtaining joint statistical data according to joint statistical ciphertext in a joint statistical method based on blockchain and privacy computing technology according to an embodiment of the present invention is shown;

[0038] Figure 4The second flowchart of the joint statistical method based on blockchain and privacy computing technology according to an embodiment of the present invention is shown;

[0039] Figure 5 A schematic flow chart showing the steps of constructing an indicator polynomial in a joint statistical method based on blockchain and privacy computing technology according to an embodiment of the present invention;

[0040] Figure 6 A schematic diagram of a process after the step of receiving location information and random values ​​sent by blockchain in a joint statistical method based on blockchain and privacy computing technology according to an embodiment of the present invention is shown;

[0041] Figure 7 A schematic flow chart showing a step of hiding data in a target data group according to a random value in a joint statistical method based on blockchain and privacy computing technology according to an embodiment of the present invention;

[0042] Figure 8 A schematic diagram showing the principle of a joint statistical method based on blockchain and privacy computing technology according to an embodiment of the present invention is shown;

[0043] Fig. 9 One of the schematic block diagrams of a joint statistical system based on blockchain and privacy computing technology according to an embodiment of the present invention is shown;

[0044] Fig.10 A second schematic block diagram of a joint statistical system based on blockchain and privacy computing technology according to an embodiment of the present invention is shown;

[0045] Fig.11 A schematic block diagram of an electronic device according to an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0046] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present invention and the features in the embodiments can be combined with each other without conflict.

[0047] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited to the specific embodiments disclosed below.

[0048] Figure 1 One of the flowcharts of a joint statistical method based on blockchain and privacy computing technology according to an embodiment of the present invention is shown. For data querying, the method includes:

[0049] Step 102: Determine keywords;

[0050] Step 104: Generate a homomorphic encryption public key and a homomorphic encryption private key;

[0051] Step 106: Encrypt the keyword according to the homomorphic encryption public key to obtain ciphertext data;

[0052] Step 108: Send the encrypted data to the blockchain;

[0053] Step 110: receiving the indicator polynomial ciphertext sent by the blockchain, wherein the indicator polynomial ciphertext is sent to the blockchain by the data provider;

[0054] Step 112: determining location information according to the indicator polynomial ciphertext, wherein the location information includes the location of the target data provider and the location of the target data in the target data group of the target data provider, and the target data corresponds to the keyword;

[0055] Step 114: Generate a random value;

[0056] Step 116: Send the location information and the random value to the blockchain, so that the data provider corresponding to the location information constructs the result ciphertext according to all the data of the target data group combined with the random value;

[0057] Step 118: receiving the joint statistical ciphertext sent in the blockchain, wherein the joint statistical ciphertext is obtained by performing homomorphic addition processing on multiple result ciphertexts by the blockchain;

[0058] Step 120: Obtain joint statistical data according to the joint statistical ciphertext.

[0059] The joint statistical method based on blockchain and privacy computing technology provided by the present invention is mainly used for data query parties, and mainly includes: first determining keywords, wherein the keywords are related to the data that the data query party wants to query. Then the data query party and the data provider generate a Paillier (a homomorphic encryption method) homomorphic encryption public key and a homomorphic encryption private key. After determining the keywords, the data query party uses a homomorphic encryption algorithm and a homomorphic encryption public key to encrypt the keywords to obtain ciphertext data, and then sends the ciphertext data to the blockchain. The blockchain will send the ciphertext data to the data provider, and the data provider will send an indicator polynomial ciphertext to the blockchain based on the ciphertext data. Then the data query party receives the indicator polynomial ciphertext sent by the blockchain. After obtaining the indicator polynomial ciphertext, the location information is determined according to the indicator polynomial ciphertext, wherein it can be understood that the number of data providers can be multiple, and each data provider can provide multiple data, but some of the data providers and some of the data may not be required by the data query party, so the data query party can determine the required data provider, i.e., the location information of the target data provider, and the location of the required data, i.e., the target data, in the target data group of the target data provider according to the indicator polynomial ciphertext. After determining the location information, the data query party will generate a random value, wherein the range of the random value is greater than or equal to 100,000 and less than or equal to 1 billion. Then the location information and the random value are sent to the blockchain at the same time, so that the target data provider corresponding to the location information can use the random value to construct the result ciphertext, that is, the data provider can use the random value to hide all the data in the target data group and then encrypt it, and then construct the result ciphertext according to the encrypted data. After sending the result ciphertext to the blockchain, the data query party receives the joint statistical ciphertext sent by the blockchain, wherein the joint statistical ciphertext is the joint statistical ciphertext obtained after the blockchain performs homomorphic addition processing on multiple result ciphertexts constructed by the data provider. After receiving the joint statistical ciphertext, the data query party decrypts the joint statistical ciphertext to obtain the joint statistical data. The present invention introduces blockchain technology, and uses blockchain to transfer data between the data query party and the data provider, thereby realizing decentralized data sharing. At the same time, the use of blockchain ensures that the data cannot be tampered with, which is conducive to post-audit. At the same time, the present invention also introduces privacy computing technology to encrypt the data and conduct joint statistics of the ciphertext on the blockchain. This ensures the privacy of the shared data, that is, the data provider cannot know the query keyword, and the data query party cannot obtain the specific data of each data provider, and can only obtain the final statistical results.

[0060] Figure 2A flowchart of the step of determining location information according to the indicator polynomial ciphertext in a joint statistical method based on blockchain and privacy computing technology according to an embodiment of the present invention is shown; wherein the step of determining location information according to the indicator polynomial ciphertext includes:

[0061] Step 202: decrypt the indicator polynomial ciphertext;

[0062] Step 204: When the decryption result of the indicator polynomial ciphertext is zero, determine the position information corresponding to the indicator polynomial ciphertext.

[0063] In this embodiment, the step of determining the location information according to the indicator polynomial ciphertext includes: first, decrypting all the indicator polynomial ciphertexts. Since the number of data providers can be multiple, the number of indicator polynomial ciphertexts sent by the blockchain is also multiple, so it is necessary to decrypt all the indicator polynomial ciphertexts and obtain the decryption results. When the decryption result of a certain indicator polynomial ciphertext is zero, it means that the data provider who sent the indicator polynomial ciphertext is what the data query party needs, so the location information of the data provider is queried and recorded. By decrypting all the indicator polynomial ciphertexts, the data provider required by the data query party is determined.

[0064] Figure 3 A flowchart of the step of obtaining joint statistical data according to a joint statistical ciphertext in a joint statistical method based on blockchain and privacy computing technology according to an embodiment of the present invention is shown; wherein the step of obtaining joint statistical data according to the joint statistical ciphertext includes:

[0065] Step 302: decrypt the joint statistical ciphertext according to the homomorphic encryption private key to obtain a decryption result;

[0066] Step 304: Determine joint statistical data according to the decryption result and the random value.

[0067] In this embodiment, the step of obtaining joint statistical data according to the joint statistical ciphertext includes: first, using a homomorphic encryption algorithm, using a homomorphic encryption private key to decrypt the obtained joint statistical data, and obtaining a decryption result. Furthermore, since the joint statistical data is obtained by homomorphic addition processing based on the result ciphertext, and the result ciphertext is constructed by the data provider based on the random value, that is, after decrypting the joint statistical data, the decryption result obtained is the result after hiding the real data. Therefore, in order to obtain the real data, it is also necessary to determine it based on the decryption result and the random value. Specifically, the real joint statistical data can be obtained by subtracting the random value from the decryption result.

[0068] Figure 4The second flowchart of the joint statistical method based on blockchain and privacy computing technology according to an embodiment of the present invention is shown; wherein, for a data provider, wherein the number of data providers is multiple, the joint statistical method based on blockchain and privacy computing technology mainly includes:

[0069] Step 402: construct an indicator polynomial;

[0070] Step 404: Generate a homomorphic encryption public key and a homomorphic encryption private key;

[0071] Step 406: receiving the ciphertext data sent by the blockchain, wherein the ciphertext data corresponds to the data querying party;

[0072] Step 408: Determine the indicator polynomial according to the ciphertext data, and perform homomorphic encryption on the indicator polynomial to obtain the indicator polynomial ciphertext;

[0073] Step 410: Send the indicator polynomial ciphertext to the blockchain;

[0074] Step 412: receiving the location information and the random value sent by the blockchain, wherein the location information and the random value are sent to the blockchain by the data query party;

[0075] Step 414: determining a target data provider and a target data group where the target data is located from among multiple data providers according to the location information, wherein the target data group contains data corresponding to the keyword;

[0076] Step 416: hiding the data in the target data group according to the random value;

[0077] Step 418: obtaining an interpolation polynomial according to the hidden target data set;

[0078] Step 420: Determine the result ciphertext corresponding to the data provider according to the interpolation polynomial and the ciphertext data;

[0079] Step 422: Upload the multiple result ciphertexts to the blockchain, so that the blockchain performs homomorphic addition processing on the multiple result ciphertexts to obtain a joint statistical ciphertext.

[0080] The joint statistical method based on blockchain and privacy computing technology provided by the present invention is mainly used for data providers, wherein the number of data providers can be multiple, and the joint statistical method based on blockchain and privacy computing technology mainly includes: first, each data provider constructs an indicator polynomial according to the data contained in itself, and then the data query party and the data provider generate a Paillier homomorphic encryption public key and a homomorphic encryption private key, and then receive the ciphertext data sent by the blockchain, wherein the ciphertext data is the ciphertext data generated after the data query party encrypts the keyword. After receiving the ciphertext data, the data provider determines the indicator polynomial according to the ciphertext data, and homomorphically encrypts the indicator polynomial. Specifically, the coefficient of each term in the indicator polynomial can be used as a multiplication factor, and the ciphertext data can be used as the ciphertext to be multiplied, and then a homomorphic multiplication operation is performed, and the result is homomorphic addition to obtain the indicator polynomial ciphertext corresponding to the indicator polynomial. Then the indicator polynomial ciphertext is sent to the blockchain. The location information and random value sent by the blockchain are received, and the location information and random value are sent to the blockchain by the data query party. Since there are multiple data providers, some data providers may not need to provide data to the data query party. Therefore, the data provider that needs to provide data to the data query party, that is, the target data provider, and the data that needs to be provided to the data query party, that is, the target data group in the target data party, are determined according to the location information, wherein the target data group contains data corresponding to the keyword. Then the target data provider hides the stored data stored in the target data group according to the random value. At the same time, the data provider constructs an interpolation polynomial based on the hidden stored data using the Lagrange interpolation method. After obtaining the interpolation polynomial, the result ciphertext corresponding to the data provider is determined according to the interpolation polynomial and the ciphertext data. Specifically, the ciphertext data can be brought into the interpolation polynomial to obtain the result ciphertext. Finally, the result ciphertext is uploaded to the blockchain. Since there are multiple data providers, the result ciphertext is also multiple, so the multiple result ciphertexts will be homomorphically added in the blockchain, thereby obtaining the joint statistical ciphertext after hiding the real data. The present invention introduces blockchain technology, and uses blockchain to transfer data between data query parties and data providers, thereby achieving decentralized data sharing. At the same time, the use of blockchain ensures that the data cannot be tampered with, which is conducive to post-audit. At the same time, the present invention also introduces privacy computing technology to encrypt data and conduct joint statistics of ciphertext on the blockchain. This ensures the privacy of shared data, that is, the data provider cannot know the query keywords, and the data query party cannot obtain the specific data of each data provider, and can only obtain the final statistical results.

[0081] Figure 5A flow chart showing the steps of constructing an indicator polynomial in a joint statistical method based on blockchain and privacy computing technology according to an embodiment of the present invention is shown; wherein the steps of constructing the indicator polynomial include:

[0082] Step 502: grouping the stored data according to a preset number to obtain multiple data groups;

[0083] Step 504: construct an indicator polynomial according to the multiple data sets.

[0084] In this embodiment, the step of constructing the indicator polynomial includes: firstly, grouping the stored data stored in each data provider with preset data, and then obtaining multiple data groups. Then constructing the indicator polynomial according to the multiple data groups. By grouping the stored data and constructing the indicator polynomial according to the grouped multiple data groups, the stored data in the data provider can be reflected in the indicator polynomial. This provides a basis for the subsequent data query party to determine the required data provider according to the indicator polynomial ciphertext.

[0085] Figure 6 A schematic diagram of a process after the step of receiving the location information and random value sent by the blockchain in a joint statistical method based on blockchain and privacy computing technology according to an embodiment of the present invention is shown; wherein, after the step of receiving the location information and random value sent by the blockchain, the following steps are included:

[0086] Step 602: Select any one data provider from multiple data providers included in the location information to obtain a random value;

[0087] Step 604: The selected data provider divides the random value according to the amount of position information to obtain a plurality of sub-random values.

[0088] In this embodiment, after the step of receiving the location information and the random value sent by the blockchain, it includes: first, selecting any one data provider from the multiple data providers included in the location information, then the selected data provider obtains the random value from the blockchain, and finally the selected data provider divides the random value according to the number of location information, thereby obtaining multiple sub-random value ciphertexts. The sub-random values ​​may be the same or different.

[0089] Figure 7 A flowchart of a step of hiding data in a target data group according to a random value in a joint statistical method based on blockchain and privacy computing technology according to an embodiment of the present invention is shown; wherein the step of hiding data in a target data group according to a random value includes:

[0090] Step 702: Encrypt the sub-random value according to the homomorphic encryption public key of each data provider to obtain the sub-random value ciphertext, and upload it to the blockchain;

[0091] Step 704: Control the data provider corresponding to the location information to obtain the sub-random value ciphertext in the blockchain, and decrypt the sub-random value ciphertext according to the homomorphic encryption private key;

[0092] Step 706: Hide the data in the target data group according to the decrypted sub-random value, wherein the target data group is the data group where the target data is located.

[0093] In this embodiment, the step of hiding the data in the target data group according to the random value includes: first, encrypting the sub-random value according to the homomorphic encryption public key of each data provider to obtain the sub-random value ciphertext, and uploading it to the blockchain. Then, the data provider corresponding to the location information is controlled to obtain the sub-random value ciphertext in the blockchain, and the sub-random value ciphertext is decrypted using the homomorphic encryption private key to obtain the decrypted sub-random value, so that each data provider included in the location information can obtain a sub-random value. After obtaining the sub-random value, the data in the target data group is hidden according to the sub-random value, wherein the target data group refers to the data group where the target data is located. Specifically, the data value in the data group can be directly added to the sub-random value to obtain the hidden stored data. By using random values ​​to hide the stored data, the data query party cannot obtain the specific data of each data provider, and can only obtain the target of the final statistical result.

[0094] Figure 8 The schematic diagram of the principle of a joint statistical method based on blockchain and privacy computing technology according to an embodiment of the present invention is shown; Figure 8 As shown, the technical solution provided by the present invention mainly includes: first, the data provider performs data preprocessing on the data. Specifically, assuming that the data provider is a set B={B1, B2, ..., B n}, data provider B i ∈B is stored in the form of (keyword, data) or (k, d). Assume that B i Own m i data, then its database is .

[0095] To data provider B i Perform data preprocessing, that is, m i Each t data is grouped into a group, divided into u i =[m i / t] groups, respectively:

[0096] B i Put mi The data are divided into u groups, with each t data as a group, which are:

[0097] The first set of data D1: ;

[0098] The second set of data D2: ;

[0099] …

[0100] The uth group of data Du: ;

[0101] The amount of data in the last group may be less than t, and the other groups all contain t pieces of data.

[0102] Then, data provider B i Construct the indicator polynomial F(x) with data provider B i The first set of data For example, the indicator polynomial is constructed as:

[0103] .

[0104] Specifically, it is known that there are e+1 value points: (x0, y0), ..., (x e ,y e ), construct the indicator polynomial:

[0105] ;

[0106] For existing value points, x0, x1, ..., x e Substituting into F(x) respectively, we can get:

[0107] F(x0)=0, F(x1)=0, …, F(x e )=0;

[0108] Then, the data query party and the data provider generate Paillier homomorphic encryption public and private keys. At the same time, the data query party A initiates a query for keyword k, and uses the Paillier homomorphic encryption algorithm to encrypt the t-power ciphertext data of keyword k from the 1st to the tth power using the public and private keys: Enc(k), Enc(k2), ..., Enc(k t ) uploads the t ciphertexts to the blockchain, and the data provider B i The t ciphertexts are obtained from the blockchain, and the data provider homomorphically encrypts the indicator polynomial. Specifically, for data provider B i u i Each polynomial function in the indicated polynomial function is The coefficient of is used as the multiplication factor, the ciphertext data of the tth power of the keyword k from the 1st to the tth power is used as the ciphertext to be multiplied, and the homomorphic multiplication operation is performed. The result is homomorphic addition to obtain the polynomial function The corresponding polynomial ciphertext , that is ; Then the data provider uploads the indicator polynomial ciphertext to the blockchain. Data query party A obtains the indicator polynomial ciphertext from the blockchain, totaling Then the data query party decrypts all the indicator polynomial ciphertexts , if the decryption result is 0, then record the location corresponding to the ciphertext, that is, the data provider B i The jth position of , where j = 1, 2, …, u, and generates a random value R (100000 ≤ R ≤ 1000000000). Data query party A uploads the c position information and random value R to the blockchain, where the c position information corresponds to c data providers. Assume that the set of c data providers C ⊆ B, any data provider B i Obtain a random value R from the blockchain, and randomly divide the random value R into c parts (the sum of which is R), and then use the public and private keys corresponding to the c data providers to encrypt them separately. Then upload the ciphertext of the c data to the blockchain. Then the c data providers obtain the c ciphertexts, and the c data providers use their own private keys to decrypt the random value ciphertexts. For example: Data provider B i Get a random value r i ; Then the data providers in set C hide the real data, for example: data provider B i Hide the real data corresponding to the obtained position, that is, add r to the data value in the group of data i . Among them, if it is not the last set of data, the real data is:

[0109] ;

[0110] Hide as:

[0111] ;

[0112] If it is the last set of data, the real data is:

[0113] ;

[0114] Hide as:

[0115] ;

[0116] Among them, j=1, 2,…,u.

[0117] Then, the interpolation polynomial G(x) is constructed. Specifically, the data provider Based on the hidden data, if , use Lagrange interpolation method to construct polynomial G i (x).

[0118] Specifically, for a certain polynomial function, it is known that there are e+1 value points: (x0, y0), ..., (x e ,y e ), where x q corresponds to the position of the independent variable, and y q Corresponding to the value of the function at this position.

[0119] Assume that any two different x q are all different, then the Lagrange difference polynomial obtained by applying the Lagrange interpolation formula is:

[0120] ;

[0121] Where each l(x) is a Lagrange polynomial (or interpolation odd function), and its expression is:

[0122] ;

[0123] The characteristic of the Lagrange basic polynomial l(x) is that at x q The value is 1 at other points x q (p≠q) takes the value 0.

[0124] Then, the polynomial ciphertext of G(x) is homomorphically calculated for the data providers in set C, for example: data provider B i Homomorphic Computation G i (x) is a polynomial ciphertext, and the polynomial function G i The coefficient of (x) is used as the multiplication factor, and the ciphertext data of the tth power of the keyword k from the 1st to the tth power is used as the ciphertext to be multiplied. The homomorphic multiplication operation is performed, and the result is homomorphic addition to obtain the polynomial function G. i (k) The corresponding polynomial ciphertext Enc(G i (k)); then the data provider converts the c polynomial ciphertexts Enc(G i (k)) uploads the blockchain, and the blockchain processes the c polynomial ciphertext Enc(G i (k)) performs homomorphic addition to obtain the joint statistical ciphertext with the real data hidden. The data query party obtains the joint statistical ciphertext with the real data hidden from the blockchain, decrypts the ciphertext, and subtracts R from the decryption result to obtain the joint statistical data.

[0125] Fig. 9One of the schematic block diagrams of a joint statistical system based on blockchain and privacy computing technology according to an embodiment of the present invention is shown; wherein the joint statistical system 80 based on blockchain and privacy computing technology is mainly used by data query parties, and mainly includes:

[0126] A first determination module 802, used to determine a keyword;

[0127] A first generating module 804, used to generate a homomorphic encryption public key and a homomorphic encryption private key;

[0128] A first encryption module 806, used to encrypt the keyword according to the homomorphic encryption public key to obtain ciphertext data;

[0129] A first sending module 808, used to send the ciphertext data to the blockchain;

[0130] A first receiving module 810 is used to receive the indicator polynomial ciphertext sent by the blockchain, wherein the indicator polynomial ciphertext is sent to the blockchain by the data provider;

[0131] A second determination module 812, configured to determine location information according to the indicator polynomial ciphertext, wherein the location information includes the location of the target data provider and the location of the target data in the target data group of the target data provider, and the target data corresponds to the keyword;

[0132] A second generating module 814, used to generate a random value;

[0133] The second sending module 816 is used to send the location information and the random value to the blockchain, so that the data provider corresponding to the location information can construct the result ciphertext according to all the data of the target data group combined with the random value;

[0134] The second receiving module 818 is used to receive the joint statistical ciphertext sent by the blockchain, wherein the joint statistical ciphertext is obtained by the blockchain performing homomorphic addition processing on multiple result ciphertexts;

[0135] The first processing module 820 is used to obtain joint statistical data according to the joint statistical ciphertext.

[0136] The joint statistical system 80 based on blockchain and privacy computing technology provided by the present invention is mainly used for data query parties, and mainly includes: a first determination module 802, a first generation module 804, a first encryption module 806, a first sending module 808, a first receiving module 810, a second determination module 812, a second generation module 814, a second sending module 816, a second receiving module 818 and a first processing module 820. Among them, the first determination module 802 can determine a keyword, wherein the keyword is related to the data that the data query party wants to query. Then the first generation module 804 generates a Paillier to generate a homomorphic encryption public key and a homomorphic encryption private key. After determining the keyword, the first encryption module 806 uses a homomorphic encryption algorithm to encrypt the keyword using a homomorphic encryption public key to obtain ciphertext data, and then the first sending module 808 sends the ciphertext data to the blockchain, and the blockchain will send the ciphertext data to the data provider, and the data provider will send the indicator polynomial ciphertext to the blockchain according to the ciphertext data. Then the first receiving module 810 receives the indicator polynomial ciphertext sent by the blockchain. After obtaining the indicator polynomial ciphertext, the second determination module 812 determines the location information according to the indicator polynomial ciphertext, wherein it can be understood that the number of data providers can be multiple, and each data provider can provide multiple data, but some of the data providers and some of the data may not be required by the data query party, so the data query party can determine the required data provider, i.e., the location information of the target data provider, and the location of the required data, i.e., the target data, in the target data group in the target data provider according to the indicator polynomial ciphertext. After determining the location information, the second generation module 814 generates a random value, wherein the range of the random value is greater than or equal to 100,000 and less than or equal to 1 billion. Then the second sending module 816 sends the location information and the random value to the blockchain at the same time, so that the target data provider corresponding to the location information can use the random value to construct the result ciphertext, i.e., the data provider can use the random value to hide all the data in the target data group and then encrypt it, and then construct the result ciphertext according to the encrypted data. After the result ciphertext is sent to the blockchain, the second receiving module 818 receives the joint statistical ciphertext sent by the blockchain, wherein the joint statistical ciphertext is the joint statistical ciphertext obtained after the blockchain performs homomorphic addition processing on multiple result ciphertexts constructed by the data provider. After receiving the joint statistical ciphertext, the first processing module 820 decrypts the joint statistical ciphertext to obtain joint statistical data. The present invention introduces blockchain technology, and uses blockchain to transfer data between the data query party and the data provider, thereby realizing decentralized data sharing. At the same time, the use of blockchain ensures that the data cannot be tampered with, which is conducive to post-audit. At the same time, the present invention also introduces privacy computing technology to encrypt data, and performs joint statistics of ciphertext on the blockchain.Doing so ensures the privacy of shared data, meaning that the data provider cannot know the query keywords, and the data query party cannot obtain the specific data of each data provider, and can only obtain the final statistical results.

[0137] In some embodiments, optionally, the second determination module 812 is specifically configured to decrypt the indicator polynomial ciphertext; and determine the position information corresponding to the indicator polynomial ciphertext when the decryption result of the indicator polynomial ciphertext is zero.

[0138] In this embodiment, the second determination module 812 is specifically used to decrypt all indicator polynomial ciphertexts. Since the number of data providers can be multiple, the number of indicator polynomial ciphertexts sent by the blockchain is also multiple, so all indicator polynomial ciphertexts need to be decrypted and the decryption results are obtained. When the decryption result of a certain indicator polynomial ciphertext is zero, it means that the data provider who sent the indicator polynomial ciphertext is what the data query party needs, so the location information of the data provider is queried and recorded. By decrypting all indicator polynomial ciphertexts, the data provider required by the data query party is determined.

[0139] In some embodiments, optionally, the first processing module 820 is specifically used to decrypt the joint statistical ciphertext according to the homomorphic encryption private key to obtain a decryption result; and determine the joint statistical data according to the decryption result and the random value.

[0140] In this embodiment, the first processing module 820 is specifically used to use a homomorphic encryption algorithm to decrypt the obtained joint statistical data using a homomorphic encryption private key, and obtain a decryption result. Furthermore, since the joint statistical data is obtained by homomorphic addition processing based on the result ciphertext, and the result ciphertext is constructed by the data provider based on the random value, that is, after decrypting the joint statistical data, the decryption result obtained is the result after hiding the real data. Therefore, in order to obtain the real data, it is also necessary to determine it based on the decryption result and the random value. Specifically, the decryption result minus the random value can be used to obtain the real joint statistical data.

[0141] Fig.10 The second schematic block diagram of a joint statistical system based on blockchain and privacy computing technology according to an embodiment of the present invention is shown; wherein the joint statistical system 90 based on blockchain and privacy computing technology is mainly used by data providers, and mainly includes:

[0142] A first construction module 902, used to construct an indicator polynomial;

[0143] The third generation module 904 is used to generate a homomorphic encryption public key and a homomorphic encryption private key;

[0144] The third receiving module 906 is used to receive the ciphertext data sent by the blockchain, wherein the ciphertext data corresponds to the data query party;

[0145] A second encryption module 908, configured to determine an indicator polynomial according to the ciphertext data, and perform homomorphic encryption on the indicator polynomial to obtain an indicator polynomial ciphertext;

[0146] The third sending module 910 is used to send the indicator polynomial ciphertext to the blockchain;

[0147] A fourth receiving module 912 is used to receive the location information and the random value sent by the blockchain, wherein the location information and the random value are sent to the blockchain by the data query party;

[0148] A third determination module 914 is used to determine a target data provider and a target data group where the target data is located among multiple data providers according to the location information, wherein the target data group contains data corresponding to the keyword;

[0149] A first hiding module 916, used to hide data in the target data group according to a random value;

[0150] A second processing module 918, configured to obtain an interpolation polynomial according to the hidden target data set;

[0151] The third processing module 920 is used to determine the result ciphertext corresponding to the data provider according to the interpolation polynomial and the ciphertext data;

[0152] The fourth sending module 922 is used to upload multiple result ciphertexts to the blockchain, so that the blockchain performs homomorphic addition processing on the multiple result ciphertexts to obtain a joint statistical ciphertext.

[0153] The joint statistical system 90 based on blockchain and privacy computing technology provided by the present invention is mainly used for data providers, and mainly includes: a first construction module 902, a third generation module 904, a third receiving module 906, a second encryption module 908, a third sending module 910, a fourth receiving module 912, a third determination module 914, a first hiding module 916, a second processing module 918, a third processing module 920 and a fourth sending module 922. Among them, firstly, the first construction module 902 constructs an indicator polynomial according to the data contained in the data provider itself, and then the third generation module 904 generates a Paillier homomorphic encryption public key and a homomorphic encryption private key, and then the third receiving module 906 receives the ciphertext data sent by the blockchain, wherein the ciphertext data is the ciphertext data generated by the data query party after encrypting the keyword. After receiving the ciphertext data, the second encryption module 908 determines the indicator polynomial according to the ciphertext data, and performs homomorphic encryption on the indicator polynomial. Specifically, the coefficient of each item in the indicator polynomial can be used as a multiplication factor, and the ciphertext data can be used as the ciphertext to be multiplied. Then, a homomorphic multiplication operation is performed, and the result is homomorphic addition to obtain the indicator polynomial ciphertext corresponding to the indicator polynomial. Then the third sending module 910 sends the indicator polynomial ciphertext to the blockchain. The fourth receiving module 912 receives the location information and random value sent by the blockchain, and the location information and random value are sent to the blockchain by the data query party. Since there are multiple data providers, some data providers do not need to provide data to the data query party. Therefore, the third determination module 914 can determine the data provider that needs to provide data to the data query party, that is, the target data provider, and the data that needs to be provided to the data query party, that is, the target data group in the target data party according to the location information, wherein the target data group contains data corresponding to the keyword. Then the target data provider hides the stored data in the target data group according to the random value through the first hiding module 916. At the same time, the second processing module 918 constructs an interpolation polynomial based on the hidden stored data using the Lagrange interpolation method. After obtaining the interpolation polynomial, the third processing module 920 determines the result ciphertext corresponding to the data provider according to the interpolation polynomial and the ciphertext data. Specifically, the ciphertext data can be brought into the interpolation polynomial to obtain the result ciphertext. Finally, the fourth sending module 922 uploads the result ciphertext to the blockchain. Since the number of data providers is multiple, the number of result ciphertexts is also multiple, so the multiple result ciphertexts will be homomorphically added in the blockchain, thereby obtaining the joint statistical ciphertext after hiding the real data. In the present invention, blockchain technology is introduced, and data is transmitted by using blockchain between the data query party and the data provider, thereby realizing decentralized data sharing. At the same time, the use of blockchain ensures that the data cannot be tampered with, which is conducive to post-audit.At the same time, the present invention also introduces privacy computing technology to encrypt data and conduct joint statistics of ciphertext on the blockchain. This ensures the privacy of shared data, that is, the data provider cannot know the query keywords, and the data query party cannot obtain the specific data of each data provider, and can only obtain the final statistical results.

[0154] In some embodiments, optionally, the first construction module 902 is specifically configured to group the stored data according to a preset number to obtain a plurality of data groups; and construct an indicator polynomial according to the plurality of data groups.

[0155] In this embodiment, the first construction module 902 is specifically used to first group the stored data stored in each data provider with preset data, and then obtain multiple data groups. Then, an indicator polynomial is constructed based on the multiple data groups. By grouping the stored data and constructing the indicator polynomial based on the grouped multiple data groups, the stored data in the data provider can be reflected in the indicator polynomial. This provides a basis for the subsequent data query party to determine the required data provider based on the indicator polynomial ciphertext.

[0156] In some embodiments, optionally, the joint statistical system 90 based on blockchain and privacy computing technology is also used to select any one data provider from multiple data providers contained in the location information to obtain a random value; the selected data provider divides the random value according to the amount of location information to obtain multiple sub-random values.

[0157] In this embodiment, the joint statistical system 90 based on blockchain and privacy computing technology is also used to select any data provider from the data providers included in the location information, and then the selected data provider obtains a random value from the blockchain, and finally the selected data provider divides the random value according to the number of location information, thereby obtaining multiple sub-random value ciphertexts. The sub-random values ​​may be the same or different.

[0158] In some embodiments, optionally, the first hiding module 916 is specifically used to encrypt the sub-random value according to the homomorphic encryption public key of each data provider to obtain the sub-random value ciphertext, and upload it to the blockchain; control the data provider corresponding to the location information to obtain the sub-random value ciphertext in the blockchain, and decrypt the sub-random value ciphertext according to the homomorphic encryption private key; hide the data in the target data group according to the decrypted sub-random value, wherein the target data group is the data group where the target data is located.

[0159] In this embodiment, the first hiding module 916 is specifically used to encrypt the sub-random value according to the homomorphic encryption public key of each data provider to obtain the sub-random value ciphertext, and upload it to the blockchain. Then the data provider corresponding to the location information is controlled to obtain the sub-random value ciphertext in the blockchain, and the sub-random value ciphertext is decrypted according to the homomorphic encryption private key to obtain the decrypted sub-random value, so that each data provider included in the location information can obtain a sub-random value. After obtaining the sub-random value, the data in the target data group is hidden according to the sub-random value, wherein the target data group refers to the data group where the target data is located. Specifically, the data value in the data group can be directly added to the sub-random value to obtain the hidden stored data. By using random values ​​to hide the stored data, the data query party cannot obtain the specific data of each data provider, and can only obtain the target of the final statistical result.

[0160] Fig.11 A schematic block diagram of an electronic device of an embodiment of the present invention is shown; wherein, the electronic device 100 includes a memory 1002, a processor 1004, and a computer program stored in the memory 1002 and executable on the processor 1004, and when the processor 1004 executes the computer program, the steps of the joint statistical method based on blockchain and privacy computing technology as described above are implemented.

[0161] The electronic device 100 provided by the present invention, in which the processor 1004 implements the steps of the above-mentioned joint statistical method based on blockchain and privacy computing technology when executing a computer program, can achieve the technical effect of any of the above-mentioned embodiments and will not be repeated here.

[0162] One embodiment of the present invention proposes a storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the joint statistical method based on blockchain and privacy computing technology as described above are implemented.

[0163] The storage medium provided by the present invention, when the computer program is executed by the processor, implements the steps of the above-mentioned joint statistical method based on blockchain and privacy computing technology, and can achieve the technical effects of any of the above-mentioned embodiments, which will not be repeated here.

[0164] In the description of this specification, the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance unless otherwise clearly specified and limited; the terms "connection", "installation", "fixation" and the like should be understood in a broad sense, for example, "connection" can be a fixed connection, a detachable connection, or an integral connection; it can be directly connected or indirectly connected through an intermediate medium. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0165] In the description of this specification, the description of the terms "one embodiment", "some embodiments", "specific embodiments", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.

[0166] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. 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.

Claims

1. A joint statistical method based on blockchain and privacy computing technology, used for data query, characterized in that: include: Identify keywords; Generate homomorphic encryption public key and homomorphic encryption private key; Encrypt the keyword according to the homomorphic encryption public key to obtain ciphertext data; Sending the ciphertext data to the blockchain; Receiving the indicator polynomial ciphertext sent by the blockchain, wherein the indicator polynomial ciphertext is sent to the blockchain by a data provider; Determine location information according to the indicator polynomial ciphertext, wherein the location information includes a location of a target data provider and a location of target data in a target data group of the target data provider, and the target data corresponds to the keyword; Generate random values; Sending the location information and the random value to the blockchain, so that the data provider corresponding to the location information constructs a result ciphertext according to all the data of the target data group combined with the random value; Receiving a joint statistical ciphertext sent by the blockchain, wherein the joint statistical ciphertext is obtained by the blockchain performing homomorphic addition processing on a plurality of the result ciphertexts; Obtaining joint statistical data according to the joint statistical ciphertext; The step of obtaining joint statistical data according to the joint statistical ciphertext includes: Decrypting the joint statistical ciphertext according to the homomorphic encryption private key to obtain a decryption result; The joint statistical data is determined according to the decryption result and the random value.

2. The joint statistical method based on blockchain and privacy computing technology according to claim 1 is characterized in that: The step of determining the location information according to the indicator polynomial ciphertext comprises: Decrypting the indicator polynomial ciphertext; When the decryption result of the indicator polynomial ciphertext is zero, the position information corresponding to the indicator polynomial ciphertext is determined.

3. A joint statistical method based on blockchain and privacy computing technology for data providers, where: The number of the data providers is multiple, and the data providers include: Construct indicator polynomials; Generate homomorphic encryption public key and homomorphic encryption private key; Receiving ciphertext data sent by the blockchain, wherein the ciphertext data corresponds to the data querying party; Determine an indicator polynomial according to the ciphertext data, and perform homomorphic encryption on the indicator polynomial to obtain an indicator polynomial ciphertext; Sending the indicator polynomial ciphertext to the blockchain; Receiving the location information and the random value sent by the blockchain, wherein the location information and the random value are sent to the blockchain by the data query party; Determining a target data provider and a target data group where the target data is located among the plurality of data providers according to the location information, wherein the target data group includes data corresponding to the keyword; hiding the data in the target data group according to the random value; Obtaining an interpolation polynomial according to the hidden target data set; Determine a result ciphertext corresponding to the data provider according to the interpolation polynomial and the ciphertext data; Uploading the multiple result ciphertexts to the blockchain, so that the blockchain performs homomorphic addition processing on the multiple result ciphertexts to obtain a joint statistical ciphertext; The step of constructing the indicator polynomial comprises: The stored data is grouped according to a preset number to obtain a plurality of data groups; The indicating polynomial is constructed according to a plurality of the data groups.

4. The joint statistical method based on blockchain and privacy computing technology according to claim 3 is characterized in that: After the step of receiving the location information and the random value sent by the blockchain, the method further comprises: Selecting any one of the data providers from the plurality of data providers included in the location information to obtain the random value; The selected data provider divides the random value according to the amount of the position information to obtain a plurality of sub-random values.

5. The joint statistical method based on blockchain and privacy computing technology according to claim 4 is characterized in that: The step of hiding the data in the target data group according to the random value comprises: Encrypting the sub-random value according to the homomorphic encryption public key of each of the data providers to obtain a sub-random value ciphertext, and uploading it to the blockchain; Control the data provider corresponding to the location information to obtain the sub-random value ciphertext in the blockchain, and decrypt the sub-random value ciphertext according to the homomorphic encryption private key; The data in the target data group is hidden according to the decrypted sub-random value, wherein the target data group is the data group where the target data is located.

6. A joint statistical system based on blockchain and privacy computing technology, used for data query, characterized in that: include: A first determining module, the first determining module is used to determine a keyword; A first generation module, the first generation module is used to generate a homomorphic encryption public key and a homomorphic encryption private key; A first encryption module, the first encryption module is used to encrypt the keyword according to the homomorphic encryption public key to obtain ciphertext data; A first sending module, the first sending module is used to send the ciphertext data to the blockchain; A first receiving module, the first receiving module is used to receive the indicator polynomial ciphertext sent by the blockchain, wherein the indicator polynomial ciphertext is sent to the blockchain by a data provider; a second determination module, the second determination module being configured to determine location information according to the indicator polynomial ciphertext, wherein the location information includes a location of a target data provider and a location of target data in a target data group of the target data provider, the target data corresponding to the keyword; A second generating module, the second generating module is used to generate a random value; A second sending module, the second sending module is used to send the location information and the random value to the blockchain, so that the data provider corresponding to the location information constructs a result ciphertext according to all the data of the target data group combined with the random value; A second receiving module, the second receiving module is used to receive the joint statistical ciphertext sent by the blockchain, wherein the joint statistical ciphertext is obtained by the blockchain performing homomorphic addition processing on multiple result ciphertexts; A first processing module, the first processing module is used to obtain joint statistical data according to the joint statistical ciphertext; Among them, the first processing module is specifically used to decrypt the joint statistical ciphertext according to the homomorphic encryption private key to obtain a decryption result; and determine the joint statistical data according to the decryption result and the random value.

7. A joint statistical system based on blockchain and privacy computing technology for data providers, where: The number of the data providers is multiple, and the characteristics include: a first construction module, the first construction module being used to construct an indicator polynomial; A third generation module, the third generation module is used to generate a homomorphic encryption public key and a homomorphic encryption private key; A third receiving module, the third receiving module is used to receive ciphertext data sent by the blockchain, wherein the ciphertext data corresponds to the data query party; A second encryption module, the second encryption module is used to determine an indicator polynomial according to the ciphertext data, and perform homomorphic encryption on the indicator polynomial to obtain an indicator polynomial ciphertext; A third sending module, the third sending module is used to send the indicator polynomial ciphertext to the blockchain; A fourth receiving module, the fourth receiving module is used to receive the location information and the random value sent by the blockchain, wherein the location information and the random value are sent to the blockchain by the data query party; A third determination module, the third determination module is used to determine a target data provider and a target data group where the target data is located among the plurality of data providers according to the location information, wherein the target data group contains data corresponding to the keyword; A first hiding module, the first hiding module is used to hide the data in the target data group according to the random value; A second processing module, the second processing module is used to obtain an interpolation polynomial according to the hidden target data group; A third processing module, the third processing module is used to determine the result ciphertext corresponding to the data provider according to the interpolation polynomial and the ciphertext data; A fourth sending module, the fourth sending module is used to upload the multiple result ciphertexts to the blockchain, so that the blockchain performs homomorphic addition processing on the multiple result ciphertexts to obtain a joint statistical ciphertext; The first construction module is specifically used to group the stored data according to a preset number to obtain a plurality of data groups; and construct an indicator polynomial according to the plurality of data groups.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, it implements the steps of the joint statistical method based on blockchain and privacy computing technology as described in claim 1 or 2, and / or the steps of the joint statistical method based on blockchain and privacy computing technology as described in any one of claims 3 to 5.

9. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements the steps of the joint statistical method based on blockchain and privacy computing technology as described in claim 1 or 2, and / or the steps of the joint statistical method based on blockchain and privacy computing technology as described in any one of claims 3 to 5.

Citation Information

Patent Citations

  • Block chain-based information query method and device and storage medium

    CN117150561A

  • Data query method and device based on multi-party combination and storage medium

    CN117668899A