A blockchain-based data statistics method and device, and a medium
By generating and encrypting random data on the management end, and combining it with public key decryption and data operation rules on the user end, the problem of data disclosure in the blockchain is solved, data security and confidentiality are achieved under multi-party cooperation, and the authenticity and immutability of the final statistical results are ensured.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-05-27
- Publication Date
- 2026-03-20
AI Technical Summary
In blockchain or consortium blockchains, when members are unwilling to disclose the data they possess and multi-party cooperation is required, how can we ensure the security of data and the data statistical calculation process so that the data of each party can achieve the effect of "usable but not visible"?
Random data is generated and encrypted by the management terminal. Each user terminal encrypts the data using the other party's public key and decrypts it using its own private key. Data statistics are performed in combination with data operation rules to ensure data security and confidentiality. Finally, the management terminal subtracts the random data to obtain the final statistical result.
It achieves the goal of ensuring the security and confidentiality of statistical data while separating user terminals and management terminals, making the data "usable but not visible", and ensuring the authenticity and immutability of the final statistical results.
Smart Images

Figure CN111737648B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to the technical field of blockchain application, in particular to a data statistical method and device based on a blockchain and a medium. BACKGROUND
[0002] In the digital economy era, data is the core asset of an enterprise, and encrypting and protecting the data is one of the effective means to protect the assets of the enterprise. However, in the data life cycle link, the problem of privacy in the statistical processing process of the data has not been well solved due to technical reasons and the like.
[0003] In the past, in order to keep the statistical processing process of the data secret, the enterprise often controls the data and the statistical calculation process of the data within its own control range, that is, the data and the statistical calculation process of the data are in a unified security domain within the enterprise, so as to protect the confidential data of the enterprise and ensure that there is no leakage of secrets and the like.
[0004] However, with the development of the data economy, the data sharing and data calculation mode has developed to a new height. In the blockchain or alliance chain, the various demanders of the data are highly dispersed, and it is already impossible to control them in a unified security domain. In this case, how to ensure the security of the data and the statistical calculation process of the data in the multi-party cooperation mode and enable the data of each party to achieve the effect of "available but invisible" has become a technical problem to be solved urgently.
[0005] Therefore, with the development of the data economy and the multi-party cooperation mode, it is urgently needed to develop a new data statistical method and device based on a blockchain and a medium to fill the above security gap and help the development of the digital economy to a new height.
[0006] It should be noted that the above content belongs to the technical cognition range of the inventor and does not necessarily constitute the prior art. SUMMARY
[0007] The embodiments of the present specification provide a data statistical method and device based on a blockchain and a medium, which are used to solve the following technical problems in the prior art: in the case that the members of the blockchain or alliance chain do not want to disclose the data owned by them to each other or even to the manager, multi-party cooperation is needed and some data needs to be counted.
[0008] The embodiments of the present specification adopt the following technical solutions:
[0009] A data statistical method based on a blockchain, comprising:
[0010] Obtaining random data generated by the management end, encrypting the random data using the public key of the first user end to obtain random data ciphertext, and sending the random data ciphertext to the first user end;
[0011] Obtaining the first statistical result, encrypting the first statistical result using the public key of the second user end to obtain first statistical result ciphertext, and sending the first statistical result ciphertext to the second user end, wherein the first statistical result is obtained by the first user end decrypting the random data ciphertext using the private key thereof and then summing the first statistical data stored therein;
[0012] Obtaining the second statistical result, encrypting the second statistical result using the public key of the management end to obtain second statistical result ciphertext, and sending the second statistical result ciphertext back to the management end, wherein the second statistical result is obtained by the second user end decrypting the first statistical result ciphertext using the private key thereof and then summing the second statistical data stored therein;
[0013] Obtaining the final statistical result sent by the management end, and uploading the final statistical result to the data statistical blockchain, wherein the final statistical result is obtained by the management end decrypting the second statistical result ciphertext using the private key thereof and then subtracting the random data.
[0014] Further, the data statistical method based on the blockchain further comprises:
[0015] Obtaining the third statistical result, encrypting the third statistical result using the public key of the fourth user end to obtain third statistical result ciphertext, and sending the third statistical result ciphertext to the fourth user end, wherein the third statistical result is obtained by the third user end decrypting the second statistical result ciphertext using the private key thereof and then summing the third statistical data stored therein.
[0016] Preferably, the data statistical method based on the blockchain further comprises:
[0017] Obtaining at least two random data generated by the management end, encrypting one of the random data using the public key of the first user end to obtain first random data ciphertext, and sending the first random data ciphertext to the first user end, and encrypting another of the random data using the public key of the second user end to obtain second random data ciphertext, and sending the second random data ciphertext to the second user end;
[0018] Calculating the first statistical result using the first random data ciphertext;
[0019] Calculating the second statistical result using the second random data ciphertext;
[0020] Subtracting one of the random data and the other of the random data from the second statistical result to obtain the final statistical result.
[0021] Preferably, the blockchain-based data statistical method further comprises:
[0022] obtaining a data operation rule randomly generated by the management end, and calculating the first to-be-counted data and the second to-be-counted data by using the data operation rule to obtain first to-be-counted converted data and second to-be-counted converted data;
[0023] calculating the first statistical result by using the first to-be-counted converted data;
[0024] calculating the second statistical result by using the second to-be-counted converted data;
[0025] calculating the second statistical result by using the inverse operation rule of the data operation rule, and subtracting the random data to obtain the final statistical result.
[0026] Further, the sign of the to-be-counted converted data converted by using the data operation rule is the same as the sign of the corresponding to-be-counted data.
[0027] Further, the data operation rule cannot be obtained by inversely deducing any group of to-be-counted converted data and the corresponding to-be-counted data.
[0028] Further, the data operation rule comprises at least one of addition, subtraction, multiplication, division, and a combination of addition, subtraction, multiplication, and division.
[0029] Preferably, the blockchain-based data statistical method of any one of the above further comprises:
[0030] verifying whether the first user end participates in data statistics, and if not, the first to-be-counted data is zero; and / or verifying whether the second user end participates in data statistics, and if not, the second to-be-counted data is zero.
[0031] A device for data statistics based on a blockchain, comprising:
[0032] at least one processor; and
[0033] a memory in communication connection with the at least one processor; wherein
[0034] the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to:
[0035] obtaining random data generated by the management end, encrypting the random data by using the public key of the first user end to obtain random data ciphertext, and sending the random data ciphertext to the first user end;
[0036] Obtaining the first statistical result, encrypting the first statistical result by using the public key of the second user end to obtain the first statistical result ciphertext, and sending the first statistical result ciphertext to the second user end, the first statistical result being obtained by the first user end by decrypting the random data ciphertext by using the private key thereof and then summing the first statistical data stored thereby;
[0037] Obtaining the second statistical result, encrypting the second statistical result by using the public key of the management end to obtain the second statistical result ciphertext, and sending the second statistical result ciphertext back to the management end, the second statistical result being obtained by the second user end by decrypting the first statistical result ciphertext by using the private key thereof and then summing the second statistical data stored thereby;
[0038] Obtaining the final statistical result sent by the management end, and uploading the final statistical result to the data statistical blockchain, the final statistical result being obtained by the management end by decrypting the second statistical result ciphertext by using the private key thereof and then subtracting the random data.
[0039] A non-volatile computer storage medium based on data statistics of a blockchain, storing computer executable instructions, wherein the computer executable instructions are configured to:
[0040] Obtaining the random data generated by the management end, encrypting the random data by using the public key of the first user end to obtain the random data ciphertext, and sending the random data ciphertext to the first user end;
[0041] Obtaining the first statistical result, encrypting the first statistical result by using the public key of the second user end to obtain the first statistical result ciphertext, and sending the first statistical result ciphertext to the second user end, the first statistical result being obtained by the first user end by decrypting the random data ciphertext by using the private key thereof and then summing the first statistical data stored thereby;
[0042] Obtaining the second statistical result, encrypting the second statistical result by using the public key of the management end to obtain the second statistical result ciphertext, and sending the second statistical result ciphertext back to the management end, the second statistical result being obtained by the second user end by decrypting the first statistical result ciphertext by using the private key thereof and then summing the second statistical data stored thereby;
[0043] Obtaining the final statistical result sent by the management end, and uploading the final statistical result to the data statistical blockchain, the final statistical result being obtained by the management end by decrypting the second statistical result ciphertext by using the private key thereof and then subtracting the random data.
[0044] The above at least one technical solution adopted by the embodiments of the present specification can achieve the following beneficial effects:
[0045] (1) The data statistical method based on the blockchain provided by the embodiment of the present specification ensures the security and confidentiality of the data to be counted of each user terminal on the blockchain, so that no party can obtain the data of other parties, and enables multiple parties to cooperate to obtain the statistical result of a certain parameter or data, so that the data of each user terminal achieves the effect of "available but invisible".
[0046] (2) The data statistical method based on the blockchain provided by the embodiment of the present specification realizes the identity verification of the next user terminal by encrypting the statistical result of the previous user terminal with the public key of the next user terminal and then sending it to the next user terminal, and then decrypting the statistical result of the previous user terminal with the private key of the next user terminal and summing it with the data to be counted stored by the next user terminal. Through this way, other user terminals cannot decrypt the statistical result even if they obtain it, and cannot participate in the data statistical process. In this way, the security and confidentiality of the data of each user terminal can be effectively protected, and other user terminals are prevented from participating in the data statistical process at will.
[0047] (3) The data statistical method based on the blockchain provided by the embodiment of the present specification further converts each data to be counted by using a data operation rule, and performs data statistical process on the converted data to be counted, thereby further protecting the data security of each user terminal.
[0048] (4) Through the above method, the security and confidentiality of the data to be counted can be ensured in the case that each user terminal and the management terminal are separated, so that the data to be counted can achieve the effect of "available but invisible". At the same time, the final statistical result is uploaded to the data comparison blockchain, so that the authenticity, traceability and non-tamperability of the final statistical result can be ensured. BRIEF DESCRIPTION OF DRAWINGS
[0049] The drawings described herein are used to provide further understanding of the present application, and form a part of the present application. The schematic embodiments of the present application and the description thereof are used to explain the present application, and do not constitute an improper limitation on the present application. In the drawings:
[0050] Figure 1 A flowchart of the data statistical method based on the blockchain provided by the embodiment of the present specification. DETAILED DESCRIPTION
[0051] For the purposes of the present description, the technical solutions and advantages, the technical solutions of the present application will be described below in conjunction with the specific embodiments of the present description and the corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, not all embodiments. Based on the embodiments in the description, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of the present application.
[0052] First, the technical concept of the technical solutions disclosed by the present application is described. At present, with the rapid development of digital economy, the data sharing mode has developed to a new height. In the blockchain or alliance chain, the users with demand for data are highly dispersed, and it is not possible to control the data and its statistical calculation process in a unified security domain. In this case, how to realize the data security of each user end, ensure the security of the data and the data statistical calculation process of each user end in the multi-party cooperation mode, and make the data of each party achieve the effect of "available but invisible", has become a technical problem to be solved. Therefore, a new data statistical method based on blockchain needs to be developed to fill the above security gap and help the better development of digital economy.
[0053] The technical solutions provided by the embodiments of the present application will be described in detail below in conjunction with the drawings. Figure 1 A flowchart of a data statistical method based on a blockchain provided by an embodiment of the present description.
[0054] As shown in Figure 1 A data statistical method based on a blockchain, which comprises: obtaining random data generated by a management end, encrypting the random data using a public key of a first user end to obtain random data ciphertext, and sending the random data ciphertext to the first user end; obtaining a first statistical result, encrypting the first statistical result using a public key of a second user end to obtain first statistical result ciphertext, and sending the first statistical result ciphertext to the second user end, wherein the first statistical result is obtained by the first user end by decrypting the random data ciphertext using its private key and then summing the first statistical data stored therein; obtaining a second statistical result, encrypting the second statistical result using a public key of the management end to obtain second statistical result ciphertext, and sending the second statistical result ciphertext back to the management end, wherein the second statistical result is obtained by the second user end by decrypting the first statistical result ciphertext using its private key and then summing the second statistical data stored therein; obtaining a final statistical result sent by the management end, and uploading the final statistical result to a data statistical blockchain, wherein the final statistical result is obtained by the management end by decrypting the second statistical result ciphertext using its private key and then subtracting the random data.
[0055] In the data statistics, the management end first generates a random data, encrypts the random data with the public key of the first user end, and then sends the encrypted random data to the first user end. The first user end can only decrypt the received random data through the private key, then adds its own number (i.e. the first data to be counted) to the random data to obtain the first statistical result, and then sends the encrypted first statistical result to the next user end. Through this method, the random data is involved in the data statistics, and each user end participating in the data statistics in the blockchain does not know the random data generated by the management end, so it cannot deduce the data of other user ends according to the statistical result. The management end can obtain the final statistical result by subtracting the random data from the statistical result, and the management end cannot deduce the data of each user end. In this way, the security and confidentiality of the data to be counted by each user end on the blockchain are ensured, and no one can obtain the data of others; and the statistical result of a certain parameter or data can be obtained by cooperation of multiple parties, so that the data of each user end achieves the effect of "available but invisible".
[0056] Meanwhile, in the above method, the last user end encrypts the statistical result with the public key of the next user end, and the next user end can only decrypt the statistical result with its own private key and then sum it. Through this way, the identity verification of the next user end is realized, and other user ends cannot decrypt the statistical result and participate in the data statistics. In this way, the security and confidentiality of the data of each user end can be effectively protected, and other user ends are prevented from participating in the data statistics at will.
[0057] The data statistics method based on the blockchain further includes obtaining a third statistical result, encrypting the third statistical result with the public key of the fourth user end to obtain third statistical result ciphertext, and sending the third statistical result ciphertext to the fourth user end, the third statistical result being obtained by the third user end by decrypting the second statistical result ciphertext with its private key and then summing the third data to be counted stored by it.
[0058] It can be understood that in the data statistics blockchain, there are multiple user ends, and each user end can repeat the above steps to decrypt the statistical result ciphertext received from the last user end with its own private key, then sum its own statistical data, encrypt the sum result with the public key of the next user end, and send it to the next user end. In this way, the last statistical result is transmitted for data statistics. The last statistical result is sent to the management end by the last user end, and the management end subtracts the first random number from the last statistical result to obtain the final statistical result of this statistics.
[0059] The data statistics blockchain has N user terminals (including the initiator), and the final result is obtained through the method. Each user terminal only needs to send and receive once, and the final ring is formed. The total number of transactions initiated is N, which greatly reduces the number of transactions.
[0060] In an embodiment, the blockchain-based data statistics method further comprises obtaining at least two random data generated by the management terminal, encrypting one of the random data using the public key of the first user terminal to obtain a first random data ciphertext, and sending the first random data ciphertext to the first user terminal; encrypting another of the random data using the public key of the second user terminal to obtain a second random data ciphertext, and sending the second random data ciphertext to the second user terminal; calculating a first statistical result using the first random data ciphertext; calculating a second statistical result using the second random data ciphertext; and obtaining a final statistical result by subtracting one of the random data and the other of the random data from the second statistical result.
[0061] In a preferred embodiment, the management terminal can also randomly generate multiple random data, and then select multiple user terminals from the N user terminals participating in the data statistics, and send the random data to the selected user terminals after encrypting them using the public keys of the selected user terminals. In this way, multiple random data can be involved in the calculation process of the data statistics, and the data to be counted of each user terminal can be further hidden, making it difficult for other user terminals to obtain it.
[0062] In an embodiment, the blockchain-based data statistics method further comprises obtaining a data operation rule randomly generated by the management terminal, calculating first and second statistical conversion data using the data operation rule on the first and second data to be counted; calculating a first statistical result using the first statistical conversion data; calculating a second statistical result using the second statistical conversion data; calculating the second statistical result using the inverse operation rule of the data operation rule, and subtracting the random data to obtain a final statistical result.
[0063] In a preferred embodiment, the management terminal can randomly generate a data operation rule, and then convert the data to be counted of each user terminal using the data operation rule, and sum the multiple statistical conversion data after conversion. Then, the inverse operation rule is used to inverse operate the sum result to obtain a statistical result, and the final statistical result is obtained by subtracting the random data from the statistical result. Because the data operation rule generated by the management terminal cannot be obtained by each user terminal, it is equivalent to encrypting the data to be counted of each user terminal, further protecting the data to be counted of each user terminal, and achieving the effect of "available but invisible" data.
[0064] In the embodiment, the sign of the to-be-counted converted data obtained by converting the data operation rule is the same as the sign of the corresponding to-be-counted data. Moreover, the data operation rule cannot be obtained by inversely deducing any set of to-be-counted converted data and the corresponding to-be-counted data.
[0065] The data operation rule can be implemented by one of the following embodiments:
[0066] Embodiment 1: The data operation rule can adopt at least one of the following: addition, subtraction, multiplication, division, or a combination of addition, subtraction, multiplication, and division. Preferably, the more complex the data operation rule is, the better.
[0067] Embodiment 2: The data operation rule can adopt a set of encryption and decryption algorithms, which can encrypt and decrypt the to-be-counted data.
[0068] The blockchain-based data counting method according to any one of the above further includes verifying each user terminal, and determining whether the user terminal participates in data counting. If the user terminal participates in data counting, the data counting is performed according to the above steps. If the user terminal does not participate in data counting, the to-be-counted data of the user terminal is considered to be zero. In this way, the number of user terminals participating in data counting can be adjusted at any time, and the user terminals not participating in data counting can be skipped, and the next user terminal can continue to be counted without the need to start over, thereby greatly reducing the number of transactions.
[0069] The embodiment also provides a device for blockchain-based data counting, which includes:
[0070] at least one processor; and
[0071] a memory connected in communication with the at least one processor; wherein
[0072] the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to:
[0073] obtain random data generated by a management terminal, encrypt the random data using a public key of a first user terminal to obtain random data ciphertext, and send the random data ciphertext to the first user terminal;
[0074] obtain a first counting result, encrypt the first counting result using a public key of a second user terminal to obtain first counting result ciphertext, and send the first counting result ciphertext to the second user terminal, the first counting result being obtained by the first user terminal by decrypting the random data ciphertext using a private key thereof and then performing summation calculation on first to-be-counted data stored by the first user terminal;
[0075] obtaining the second statistical result, encrypting the second statistical result by using the public key of the management terminal to obtain second statistical result ciphertext, and sending the second statistical result ciphertext back to the management terminal, the second statistical result being obtained by the second user terminal by decrypting the first statistical result ciphertext by using the private key thereof and then summing the second statistical data stored by the second user terminal;
[0076] obtaining the final statistical result sent by the management terminal, and uploading the final statistical result to the data statistical block chain, the final statistical result being obtained by the management terminal by decrypting the second statistical result ciphertext by using the private key thereof and then subtracting the random data.
[0077] The embodiment also provides a nonvolatile computer storage medium based on data statistics of a block chain, which stores computer executable instructions, wherein the computer executable instructions are configured to:
[0078] obtaining the random data generated by the management terminal, encrypting the random data by using the public key of the first user terminal to obtain random data ciphertext, and sending the random data ciphertext to the first user terminal;
[0079] obtaining the first statistical result, encrypting the first statistical result by using the public key of the second user terminal to obtain first statistical result ciphertext, and sending the first statistical result ciphertext to the second user terminal, the first statistical result being obtained by the first user terminal by decrypting the random data ciphertext by using the private key thereof and then summing the first statistical data stored by the first user terminal;
[0080] obtaining the second statistical result, encrypting the second statistical result by using the public key of the management terminal to obtain second statistical result ciphertext, and sending the second statistical result ciphertext back to the management terminal, the second statistical result being obtained by the second user terminal by decrypting the first statistical result ciphertext by using the private key thereof and then summing the second statistical data stored by the second user terminal;
[0081] obtaining the final statistical result sent by the management terminal, and uploading the final statistical result to the data statistical block chain, the final statistical result being obtained by the management terminal by decrypting the second statistical result ciphertext by using the private key thereof and then subtracting the random data.
[0082] Each of the embodiments in the application is described in a progressive manner, and the same or similar parts of each of the embodiments can be referred to each other, and each of the embodiments mainly describes the difference from other embodiments. In particular, for the device and medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the part of the description of the method embodiments.
[0083] The devices and media provided in this application are one-to-one with the methods. Therefore, the devices and media also have similar beneficial technical effects as their corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the devices and media will not be repeated here.
[0084] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0085] This invention relates to methods, apparatus (systems), and computer programs produced according to embodiments of the invention.
[0086] The flowcharts and / or block diagrams are used to describe the product. It should be understood that each block in the flowcharts and / or block diagrams, and combinations of blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing device, generate instructions for implementing the product in the flowcharts and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0087] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0088] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0089] In one typical arrangement, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0090] The memory can include non-persistent memory and / or volatile memory, such as random access memory (RAM) having a common memory space employing many flash memory devices. The memory is an example of computer readable media.
[0091] Computer readable media includes permanent and non-permanent, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile discs (DVDs) or other optical storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible to a computing device. According to the definition herein, computer readable media does not include transitory media, such as modulated data signals and carrier waves.
[0092] It should also be noted that the terms "comprising", "containing", or any other variant thereof, are intended to encompass a non-exclusive inclusion, such that a process, method, article or apparatus that comprises a list of elements does not include only those elements in the list, but can also include other elements not expressly listed or inherent to such process, method, article or apparatus. Without further limitation, an element defined by the statement "comprising a" does not exclude the presence of additional identical elements in the process, method, article or apparatus that includes the element.
[0093] The above description is merely illustrative of the application, and not restrictive. Various modifications and changes can become apparent to those skilled in the art. Incorporating any modification, equivalent substitution, improvement, etc. within the spirit and principle of the application shall be included in the scope of claims of the application.
Claims
1. A data statistics method based on blockchain, characterized in that, include: Obtain random data generated by the management terminal, encrypt the random data using the public key of the first user terminal to obtain random data ciphertext, and send the random data ciphertext to the first user terminal; Obtain the first statistical result, encrypt the first statistical result using the public key of the second user terminal to obtain the first statistical result ciphertext, and send the first statistical result ciphertext to the second user terminal. The first statistical result is obtained by the first user terminal decrypting the random data ciphertext using its private key and summing it with the first statistical data to be collected stored therein. The second statistical result is obtained, and the second statistical result is encrypted using the public key of the management terminal to obtain the ciphertext of the second statistical result. The ciphertext of the second statistical result is then sent back to the management terminal. The second statistical result is obtained by the second user terminal using its private key to decrypt the ciphertext of the first statistical result and summing it with the second statistical data to be collected stored therein. Obtain the final statistical results and upload them to the data statistics blockchain. The final statistical results are obtained by the management terminal decrypting the encrypted second statistical results using its private key and then subtracting the random data. The method further includes: The system acquires at least two random data generated by the management terminal, encrypts one of the random data using the public key of the first user terminal to obtain a first random data ciphertext, and sends the first random data ciphertext to the first user terminal. The system also encrypts the other random data using the public key of the second user terminal to obtain a second random data ciphertext, and sends the second random data ciphertext to the second user terminal. The first statistical result is calculated using the first random data ciphertext; The second statistical result is calculated using the second random data ciphertext; The final statistical result is obtained by subtracting one of the random data and the other of the random data from the second statistical result; The method further includes: Obtain the data operation rules randomly generated by the management terminal, and use the data operation rules to calculate the first statistical data to be converted and the second statistical data to be converted to obtain the first statistical data to be converted and the second statistical data to be converted. The first statistical result is calculated using the first data to be statistically transformed; The second statistical result is calculated using the second data to be statistically transformed; The second statistical result is calculated using the inverse operation rule of the data operation rule, and the random data is subtracted to obtain the final statistical result; The sign of the data to be statistically transformed obtained by the aforementioned data operation rules is the same as the sign of the corresponding data to be statistically analyzed. The data operation rules cannot be derived by reverse calculation from any set of data to be statistically transformed and the corresponding data to be statistically analyzed. The data operation rules include at least one of the following: addition, subtraction, multiplication, division, and combinations of addition, subtraction, multiplication, and division.
2. The data statistics method based on blockchain according to claim 1, characterized in that, The method further includes: The third statistical result is obtained, and the third statistical result is encrypted using the public key of the fourth user terminal to obtain the ciphertext of the third statistical result. The ciphertext of the third statistical result is then sent to the fourth user terminal. The third statistical result is obtained by the third user terminal using its private key to decrypt the ciphertext of the second statistical result and summing it with the third statistical data to be collected stored therein.
3. The data statistics method based on blockchain according to claim 1 or 2, characterized in that, The method further includes: Verify whether the first user terminal participates in data statistics. If not, then the first statistical data to be collected is zero; and / or Verify whether the second user terminal participates in data statistics. If not, then the second statistical data to be collected will be zero.
4. A data statistics device based on blockchain, characterized in that, include: At least one processor; as well as, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to: Obtain random data generated by the management terminal, encrypt the random data using the public key of the first user terminal to obtain random data ciphertext, and send the random data ciphertext to the first user terminal; Obtain the first statistical result, encrypt the first statistical result using the public key of the second user terminal to obtain the first statistical result ciphertext, and send the first statistical result ciphertext to the second user terminal. The first statistical result is obtained by the first user terminal decrypting the random data ciphertext using its private key and summing it with the first statistical data to be collected stored therein. The second statistical result is obtained, and the second statistical result is encrypted using the public key of the management terminal to obtain the ciphertext of the second statistical result. The ciphertext of the second statistical result is then sent back to the management terminal. The second statistical result is obtained by the second user terminal using its private key to decrypt the ciphertext of the first statistical result and summing it with the second statistical data to be collected stored therein. Obtain the final statistical results and upload them to the data statistics blockchain. The final statistical results are obtained by the management terminal decrypting the encrypted second statistical results using its private key and then subtracting the random data. Also includes: The system acquires at least two random data generated by the management terminal, encrypts one of the random data using the public key of the first user terminal to obtain a first random data ciphertext, and sends the first random data ciphertext to the first user terminal. The system also encrypts the other random data using the public key of the second user terminal to obtain a second random data ciphertext, and sends the second random data ciphertext to the second user terminal. The first statistical result is calculated using the first random data ciphertext; The second statistical result is calculated using the second random data ciphertext; The final statistical result is obtained by subtracting one of the random data and the other of the random data from the second statistical result; Also includes: Obtain the data operation rules randomly generated by the management terminal, and use the data operation rules to calculate the first statistical data to be converted and the second statistical data to be converted to obtain the first statistical data to be converted and the second statistical data to be converted. The first statistical result is calculated using the first data to be statistically transformed; The second statistical result is calculated using the second data to be statistically transformed; The second statistical result is calculated using the inverse operation rule of the data operation rule, and the random data is subtracted to obtain the final statistical result; The sign of the data to be statistically transformed obtained by the aforementioned data operation rules is the same as the sign of the corresponding data to be statistically analyzed. The data operation rules cannot be derived by reverse calculation from any set of data to be statistically transformed and the corresponding data to be statistically analyzed. The data operation rules include at least one of the following: addition, subtraction, multiplication, division, and combinations of addition, subtraction, multiplication, and division.
5. A non-volatile computer storage medium for data statistics based on blockchain, storing computer-executable instructions, characterized in that, The computer-executable instructions are set as follows: Obtain random data generated by the management terminal, encrypt the random data using the public key of the first user terminal to obtain random data ciphertext, and send the random data ciphertext to the first user terminal; Obtain the first statistical result, encrypt the first statistical result using the public key of the second user terminal to obtain the first statistical result ciphertext, and send the first statistical result ciphertext to the second user terminal. The first statistical result is obtained by the first user terminal decrypting the random data ciphertext using its private key and summing it with the first statistical data to be collected stored therein. The second statistical result is obtained, and the second statistical result is encrypted using the public key of the management terminal to obtain the ciphertext of the second statistical result. The ciphertext of the second statistical result is then sent back to the management terminal. The second statistical result is obtained by the second user terminal using its private key to decrypt the ciphertext of the first statistical result and summing it with the second statistical data to be collected stored therein. Obtain the final statistical results and upload them to the data statistics blockchain. The final statistical results are obtained by the management terminal decrypting the encrypted second statistical results using its private key and then subtracting the random data. Also includes: The system acquires at least two random data generated by the management terminal, encrypts one of the random data using the public key of the first user terminal to obtain a first random data ciphertext, and sends the first random data ciphertext to the first user terminal. The system also encrypts the other random data using the public key of the second user terminal to obtain a second random data ciphertext, and sends the second random data ciphertext to the second user terminal. The first statistical result is calculated using the first random data ciphertext; The second statistical result is calculated using the second random data ciphertext; The final statistical result is obtained by subtracting one of the random data and the other of the random data from the second statistical result; Also includes: Obtain the data operation rules randomly generated by the management terminal, and use the data operation rules to calculate the first statistical data to be converted and the second statistical data to be converted to obtain the first statistical data to be converted and the second statistical data to be converted. The first statistical result is calculated using the first data to be statistically transformed; The second statistical result is calculated using the second data to be statistically transformed; The second statistical result is calculated using the inverse operation rule of the data operation rule, and the random data is subtracted to obtain the final statistical result; The sign of the data to be statistically transformed obtained by the aforementioned data operation rules is the same as the sign of the corresponding data to be statistically analyzed. The data operation rules cannot be derived by reverse calculation from any set of data to be statistically transformed and the corresponding data to be statistically analyzed. The data operation rules include at least one of the following: addition, subtraction, multiplication, division, and combinations of addition, subtraction, multiplication, and division.
Citation Information
Patent Citations
Data processing method, apparatus, storage medium and device for electronic bills
CN109087078A
Data processing method, device, server and system
CN110400162A