Block chain-based data statistics system, method, apparatus and device, and medium
Through blockchain smart contracts and secret sharing agreements, various institutional participants build polynomials and share secret fragments, solving the security problems of data statistics in the data board project, realizing safe and accurate data aggregation and fusion, and ensuring data privacy and fairness.
Patent Information
- Application Number
- CN202411171180.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-23
- Publication Date
- 2024-12-17
AI Technical Summary
In the data board project, the joint summation of data between institutions is difficult to achieve secure data statistics schemes due to data security issues, especially when it is necessary to summarize and integrate macro data, institutions are unwilling to disclose transaction data. .
Adopting a blockchain-based data statistics system, through blockchain smart contracts and secret sharing protocols, various institutional participants build polynomials and share secret fragments, and blockchain nodes reconstruct data statistics results to ensure the security and accuracy of data statistics. sex.
It realizes the security and accuracy of data statistics among various institutions, avoids plain text data leakage, provides a secure data statistics solution, and ensures the privacy and fairness of the data.
Smart Images

Figure CN119149555A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a blockchain-based data statistics system, method, device, equipment and medium. Background Art
[0002] According to the Shanghai Municipal Party Committee's work instructions on "Shanghai Blockchain Cooperation", in the data dashboard project, it is necessary to design an implementation plan for the integration of internal and external consumption data. The specific requirement is to aggregate and integrate the macro data of clearing institutions, payment institutions, operators and key merchants, etc., to support the data dashboard to achieve a panoramic view of consumption data.
[0003] The data statistics requirements of the consumption data dashboard include, for example: 1. Statistics on transaction amounts, number of transactions, and average customer spending by industry and region on a certain day or within a period of time, and provide year-on-year and month-on-month data. 2. Statistics and rankings of transaction amounts and number of transactions in each region. 3. Distribution of average transaction spending. These data statistics only involve the problem of joint summation of data between institutions. For example, the consumption data dashboard needs to calculate the total number and total amount of offline catering transactions in October 2023 (NetsUnion, UnionPay, AT). However, considering data security issues, the relevant participating institutions are often reluctant to disclose their transaction data to other institutions. Therefore, there is an urgent need for a secure data statistics solution. Summary of the invention
[0004] The present application provides a blockchain-based data statistics system, method, apparatus, device and medium to provide a secure data statistics solution.
[0005] In a first aspect, the present application provides a data statistics system based on blockchain, the system comprising: a task scheduler and a blockchain node; wherein the blockchain node is deployed with a blockchain smart contract, and the blockchain node performs data statistics based on the blockchain smart contract;
[0006] The task scheduler is used to configure the data statistics task, specify each institutional participant, and send the data statistics task to the blockchain node, which then sends the data statistics task to each institutional participant;
[0007] The institutional participants are used to count the total amount of local secrets according to the data statistics task, construct a corresponding polynomial based on the total amount of secrets and the secret sharing protocol; determine the secret fragments corresponding to each of the institutional participants based on the polynomial; and share the secret fragments with the corresponding institutional participants;
[0008] The institutional participant is further configured to determine the secret fragment and value according to the secret fragment corresponding to the institutional participant and the secret fragment obtained through sharing; and send the secret fragment and value to the blockchain node;
[0009] The blockchain node is used to reconstruct the sum of the polynomials corresponding to each of the institutional participants based on the secret fragments and values sent by each of the institutional participants; and determine the data statistical results based on the sum of the polynomials corresponding to each of the institutional participants.
[0010] In a second aspect, the present application provides a data statistics method based on blockchain, the method comprising:
[0011] The institutional participant receives the data statistics task sent by the task scheduler through the blockchain node, counts the total amount of local secrets according to the data statistics task, and constructs a corresponding polynomial based on the total amount of secrets and the secret sharing protocol; determines the corresponding secret fragments of each institutional participant participating in the data statistics based on the polynomial; and shares the secret fragments with the corresponding institutional participants;
[0012] Determine the secret fragment and value according to the secret fragment corresponding to itself and the secret fragment obtained through sharing; and send the secret fragment and value to the blockchain node; the blockchain node reconstructs the sum of the polynomials corresponding to each institutional participant based on the secret fragments and values sent by each institutional participant; determine the data statistical result according to the sum of the polynomials corresponding to each institutional participant.
[0013] In a third aspect, the present application provides a data statistics method based on blockchain, the method comprising:
[0014] The blockchain node receives the data statistics task configured by the task scheduler, and notifies each institutional participant of the data statistics task;
[0015] Based on the secret fragments and values sent by each of the institutional participants, the sum of the polynomials corresponding to each of the institutional participants is reconstructed; based on the sum of the polynomials corresponding to each of the institutional participants, the data statistics result is determined; wherein, the institutional participants count the total amount of local secrets according to the data statistics task, and construct the corresponding polynomial based on the total amount of secrets and the secret sharing protocol; based on the polynomial, the corresponding secret fragments of each of the institutional participants participating in the data statistics are determined; the secret fragments are shared with the corresponding institutional participants; the secret fragments and values are determined based on the corresponding secret fragments of themselves and the secret fragments obtained through sharing; and the secret fragments and values are sent to the blockchain node
[0016] In a fourth aspect, the present application provides a data statistics device based on blockchain, the device comprising:
[0017] The secret fragment sharing module is used to receive the data statistics task sent by the task scheduler through the blockchain node, count the local total amount of secrets according to the data statistics task, and construct a corresponding polynomial based on the total amount of secrets and the secret sharing protocol; determine the secret fragments corresponding to each institutional participant participating in the data statistics based on the polynomial; and share the secret fragments with the corresponding institutional participants;
[0018] The blockchain reporting module is used to determine the secret fragments and values according to the secret fragments corresponding to itself and the secret fragments obtained through sharing; and send the secret fragments and values to the blockchain node; the blockchain node reconstructs the sum of the polynomials corresponding to each institutional participant based on the secret fragments and values sent by each institutional participant; and determines the data statistical results according to the sum of the polynomials corresponding to each institutional participant.
[0019] In a fifth aspect, the present application provides a data statistics device based on blockchain, the device comprising:
[0020] The data statistics module is used to receive the data statistics tasks configured by the task scheduler, and notify the data statistics tasks to each institutional participant; based on the secret fragments and values sent by each institutional participant, reconstruct the sum of the polynomials corresponding to each institutional participant; according to the sum of the polynomials corresponding to each institutional participant, determine the data statistics results; wherein, the institutional participant counts the total amount of local secrets according to the data statistics task, and constructs the corresponding polynomial based on the total amount of secrets and the secret sharing protocol; based on the polynomial, determine the corresponding secret fragments of each institutional participant participating in the data statistics; share the secret fragments with the corresponding institutional participants; determine the secret fragments and values according to the corresponding secret fragments and the secret fragments obtained through sharing; and send the secret fragments and values to the data statistics module in the blockchain node.
[0021] In a sixth aspect, the present application provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;
[0022] Memory, used to store computer programs;
[0023] The processor is used to implement the method steps when executing the program stored in the memory.
[0024] In a seventh aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program implements the method steps when executed by a processor.
[0025] The present application provides a data statistics system, method, apparatus, device and medium based on blockchain, the system comprising: a task scheduler and a blockchain node; wherein the blockchain node is deployed with a blockchain smart contract, and the blockchain node performs data statistics based on the blockchain smart contract; the task scheduler is used to configure the data statistics task, and specify each institutional participant, and send the data statistics task to the blockchain node, and the blockchain node sends the data statistics task to each institutional participant; the institutional participant is used to count the local total amount of secrets according to the data statistics task, and construct a corresponding polynomial based on the total amount of secrets and a secret sharing protocol; determine the secret fragments corresponding to each institutional participant based on the polynomial; share the secret fragments with the corresponding institutional participants; the institutional participants are also used to determine the secret fragments and values according to their own corresponding secret fragments and the secret fragments obtained through sharing; and send the secret fragments and values to the blockchain node; the blockchain node is used to reconstruct the sum of the polynomials corresponding to each institutional participant based on the secret fragments and values sent by each institutional participant; and determine the data statistics results according to the sum of the polynomials corresponding to each institutional participant.
[0026] The above technical solution has the following advantages or beneficial effects:
[0027] In this application, the task scheduler specifies each institutional participant through the blockchain smart contract deployed by the blockchain node, and configures the data statistics task for each institutional participant. For each institutional participant, a corresponding polynomial is constructed according to the data statistics task; the secret fragments corresponding to each institutional participant are determined based on the polynomial, and then the secret fragments are shared with the corresponding institutional participants. In this way, each institutional participant shares secret fragments with other institutional participants, and each institutional participant also receives the secret fragments shared by other institutional participants. Each institutional participant determines the secret fragments and values based on its corresponding secret fragments and the secret fragments obtained through sharing; and sends the secret fragments and values to the blockchain node. The blockchain node determines the final data statistics results based on the secret fragments and values sent by each institutional participant. In this application, the total amount of plaintext secrets of the institutional participants is saved locally, and the total amount of plaintext secrets of the institutional participants is not saved in the blockchain node, and the institutional participants do not need to leak the total amount of plaintext secrets to other institutional participants. The secret fragments and values determined based on the secret sharing protocol are sent to the blockchain node, and then the final data statistics results are determined based on the secret fragments and values sent by each institutional participant in the blockchain node. Therefore, a safe data statistics solution is provided. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0029] Figure 1 Schematic diagram of the blockchain-based data statistics system provided for this application;
[0030] Figure 2 A schematic diagram of the first blockchain-based data statistics process provided for this application;
[0031] Figure 3 A schematic diagram of the second blockchain-based data statistics process provided for this application;
[0032] Figure 4 A schematic diagram of the third blockchain-based data statistics process provided for this application;
[0033] Figure 5 A schematic diagram of the fourth blockchain-based data statistics process provided for this application;
[0034] Figure 6 A fifth process diagram of blockchain-based data statistics provided for this application;
[0035] Figure 7 A schematic diagram of the sixth blockchain-based data statistics process provided for this application;
[0036] Figure 8 A seventh process diagram of blockchain-based data statistics provided for this application;
[0037] Fig. 9 The overall architecture diagram of the blockchain-based data statistics system provided for this application;
[0038] Fig.10 The blockchain-based data statistics flow chart provided for this application;
[0039] Fig.11 A schematic diagram of the structure of the first blockchain-based data statistics device provided in this application;
[0040] Fig.12 A schematic diagram of the structure of the second blockchain-based data statistics device provided in this application;
[0041] Fig.13 This is a schematic diagram of the electronic device structure provided in this application. DETAILED DESCRIPTION
[0042] In order to make the purpose and implementation method of the present application clearer, the exemplary implementation method of the present application will be clearly and completely described below in conjunction with the drawings in the exemplary embodiments of the present application. Obviously, the described exemplary embodiments are only part of the embodiments of the present application, rather than all the embodiments.
[0043] It should be noted that the brief description of terms in this application is only for the convenience of understanding the embodiments described below, and is not intended to limit the embodiments of this application. Unless otherwise specified, these terms should be understood according to their common and usual meanings.
[0044] The terms "first", "second", "third", etc. in the specification and claims of this application and the above drawings are used to distinguish similar or similar objects or entities, and do not necessarily mean to limit a specific order or sequence, unless otherwise noted. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances.
[0045] The terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover but not exclude inclusion, for example, a product or device comprising a list of components is not necessarily limited to all the components expressly listed but may include other components not expressly listed or inherent to such product or device.
[0046] The term "module" refers to any known or later developed hardware, software, firmware, artificial intelligence, fuzzy logic or combination of hardware and / or software code that is capable of performing the functions associated with that element.
[0047] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
[0048] For the convenience of explanation, the above description has been made in conjunction with specific embodiments. However, the above exemplary discussion is not intended to be exhaustive or limit the embodiments to the specific forms disclosed above. Based on the above teachings, various modifications and variations can be obtained. The selection and description of the above embodiments are to better explain the principles and practical applications, so that those skilled in the art can better use the embodiments and various different variations of the embodiments suitable for specific use considerations.
[0049] Figure 1 The schematic diagram of the blockchain-based data statistics system provided for this application is as follows: Figure 1 As shown, the system includes: a task scheduler 11 and a blockchain node 12; wherein the blockchain node 12 is deployed with a blockchain smart contract, and the blockchain node 12 performs data statistics based on the blockchain smart contract;
[0050] The task scheduler 11 is used to configure the data statistics task, specify each institutional participant 13, and send the data statistics task to the blockchain node 12, and the blockchain node 12 sends the data statistics task to each institutional participant 13;
[0051] The institutional participant 13 is used to count the total amount of local secrets according to the data statistics task, construct a corresponding polynomial based on the total amount of secrets and the secret sharing protocol; determine the secret fragments corresponding to each of the institutional participants based on the polynomial; and share the secret fragments with the corresponding institutional participants;
[0052] The institutional participant 13 is further used to determine the secret fragment and value according to the secret fragment corresponding to itself and the secret fragment obtained through sharing; and send the secret fragment and value to the blockchain node 12;
[0053] The blockchain node 12 is used to reconstruct the sum of the polynomials corresponding to each of the institutional participants based on the secret fragments and values sent by each of the institutional participants; and determine the data statistical results based on the sum of the polynomials corresponding to each of the institutional participants.
[0054] Figure 1 The example in which the task scheduler specifies three institutional participants is used for schematic illustration. The three institutional participants are institutional participant A, institutional participant B, and institutional participant C. The task scheduler is used to configure the data statistics task, specify each institutional participant, and send the data statistics task and the identification information of each institutional participant to the blockchain node. The blockchain node sends the data statistics task to the institutional participant indicated by the identification information of each institutional participant based on the deployed blockchain smart contract. The institutional participants count the total amount of local secrets according to the data statistics task. For example, the data statistics task is to count the total number of offline catering transactions in October 2023. Then the institutional participants count the total number of local offline catering transactions in October 2023. The total number of local offline catering transactions of the institutional participants in October 2023 is also the total amount of local secrets.
[0055] The institutional participants construct corresponding polynomials based on the total amount of secrets and the secret sharing protocol. Let's take the example that the task scheduler specifies three institutional participants, namely institutional participant A, institutional participant B, and institutional participant C. Institutional participant A constructs the corresponding polynomial a based on the local total amount of secrets and the secret sharing protocol, institutional participant B constructs the corresponding polynomial b based on the local total amount of secrets and the secret sharing protocol, and institutional participant C constructs the corresponding polynomial c based on the local total amount of secrets and the secret sharing protocol. Optionally, the secret sharing protocol can be the Shamir secret sharing protocol.
[0056] The process by which institutional participants construct corresponding polynomials based on the total amount of secrets and the secret sharing protocol is described as follows:
[0057] A secret sharing protocol is a protocol that divides a secret into multiple parts so that only a certain minimum number of parts can reconstruct the original secret. For example, in the (k, n) threshold scheme, n represents the total number of parts and k represents the minimum number of parts required to reconstruct the secret.
[0058] The secret sharing protocol is based on the mathematical principle of polynomial interpolation. Specifically, using the Lagrange interpolation method, a k-1 order polynomial can be uniquely determined through k points.
[0059] Assume that the secret to be shared (total amount) is S, which needs to be divided into n parts, and at least k parts are required to reconstruct the secret.
[0060] Select polynomial: Select a random k-1 order polynomial f(x) = a0+a1x+a2x 2 +...+a k-1 x k-1 , where a0=S is the total amount of secrets, a1,a2,...,a k-1 is a random coefficient.
[0061] Generate shares: Calculate the value of the polynomial at n different points (f(1), f(2), ..., f(n)), each value corresponds to a share.
[0062] Distribute shares: distribute each share to the corresponding institutional participants.
[0063] Reconstructing the secret: Any k or more participants can use their shares to reconstruct the polynomial f(x) through Lagrange interpolation and obtain the secret S=f(0).
[0064] For example, the task scheduler specifies three institutional participants, namely, institutional participant A, institutional participant B, and institutional participant C. Institutional participant A constructs the corresponding polynomial based on the total amount of secrets and the secret sharing protocol: a (x) = a0 + a1x + a2x 2 Institutional participant B constructs the corresponding polynomial based on the total amount of secrets and the secret sharing protocol: f b (x) = b0 + b1x + b2x 2 Institutional participant C constructs the corresponding polynomial based on the total amount of secrets and the secret sharing protocol: f c (x) = c0 + c1x + c2x 2 .
[0065] The institutional participants determine the secret fragments corresponding to each institutional participant based on the polynomial. Optionally, for the polynomial f determined by institutional participant A a (x), f a (1) is the secret fragment corresponding to the institutional participant A, f a (2) is the secret fragment corresponding to the institutional participant B, f a (3) is the secret fragment corresponding to the institutional participant C. For the polynomial f determined by the institutional participant B b (x), f b (1) is the secret fragment corresponding to the institutional participant A, f b (2) is the secret fragment corresponding to the institutional participant B, f b (3) is the secret fragment corresponding to the institutional participant C. For the polynomial f determined by the institutional participant C c (x), f c (1) is the secret fragment corresponding to the institutional participant A, fc (2) is the secret fragment corresponding to the institutional participant B, f c (3) is the secret fragment corresponding to the institutional participant C.
[0066] Institutional participant A sends the secret fragment f a (1) Keep the secret fragment f a (2) Share it with the corresponding institutional participant B, and send the secret fragment f a (3) Share it with the corresponding institutional participant C; institutional participant B sends the secret fragment f b (2) Keep the secret fragment f b (1) Share it with the corresponding institutional participant A, and send the secret fragment f b (3) Share it with the corresponding institutional participant C; institutional participant C sends the secret fragment f c (3) Keep the secret fragment f c (1) Share it with the corresponding institutional participant A, and send the secret fragment f c (2) Share with the corresponding institutional participant B.
[0067] The institutional participants also use it to determine the secret fragments and values based on their corresponding secret fragments and the secret fragments obtained through sharing. Institutional participant A determines the secret fragments and values based on its corresponding secret fragments f a (1) and the secret fragment f obtained by sharing b (1) and f c (1), determine the secret fragment and value f a (1)+f b (1)+f c (1), the secret fragment and the value f a (1)+f b (1)+f c (1) Sent to the blockchain node; Institutional participant B uses its corresponding secret fragment f b (2) and the secret fragment f obtained through sharing a (2) and f c (2) Determine the secret fragment and value f a (2)+f b (2)+f c (2) The secret fragment and the value f a (2)+f b (2)+f c (2) Sent to the blockchain node; Institutional participant C uses its corresponding secret fragment f c (3) and the secret fragment f obtained through sharing a (3) and f b (3), determine the secret fragment and value f a (3)+fb (3)+f c (3), the secret fragment and the value f a (3)+f b (3)+f c (3)Send to the blockchain node.
[0068] After receiving the secret fragments and values sent by each institutional participant, the blockchain smart contract deployed by the blockchain node reconstructs the sum of the polynomials corresponding to each institutional participant based on the secret fragments and values sent by each institutional participant. In other words, the blockchain node reconstructs the sum of the polynomials corresponding to each institutional participant based on the secret fragments and values f a (1)+f b (1)+f c (1) Secret fragment and value f a (2)+f b (2)+f c (2) and the secret fragment and value f a (3)+f b (3)+f c (3), reconstruct the sum of the polynomials corresponding to each institutional participant: f a (x)+f b (x)+f c (x)=(a0+b0+c0)+(a1+b1+c1)x+(a2+b2+c2)x 2 Finally, according to the sum of the above polynomials, the final statistical result is determined to be a0+b0+c0.
[0069] In this application, the task scheduler specifies each institutional participant and configures data statistics tasks for each institutional participant through the blockchain smart contract deployed in the blockchain node. For each institutional participant, a corresponding polynomial is constructed according to the data statistics task; the corresponding secret fragments of each institutional participant are determined based on the polynomial, and then the secret fragments are shared with the corresponding institutional participants. In this way, each institutional participant shares secret fragments with other institutional participants, and each institutional participant also receives secret fragments shared by other institutional participants. Each institutional participant determines the secret fragments and values based on its corresponding secret fragments and the secret fragments obtained through sharing; and sends the secret fragments and values to the blockchain node. The blockchain node determines the final data statistics results based on the secret fragments and values sent by each institutional participant. In this application, the total amount of plaintext secrets of the institutional participants is saved locally, and the total amount of plaintext secrets of the institutional participants is not saved in the blockchain node, and the institutional participants do not need to leak the total amount of plaintext secrets to other institutional participants. The secret fragments and values determined based on the secret sharing protocol are sent to the blockchain, and then the final data statistics results are determined based on the secret fragments and values sent by each institutional participant in the blockchain node. Therefore, a safe data statistics solution is provided.
[0070] In the present application, in order to improve the security of secret fragment sharing, thereby further improving the security of data statistics, the institutional participants are specifically used to share the secret fragments to the corresponding institutional participants through the channel technology of the blockchain; or to share the secret fragments to the corresponding institutional participants through the public key encryption technology of the institutional participants corresponding to the secret fragments.
[0071] This application provides two ways to share secret fragments. Method 1 is to share secret fragments through the channel technology of the blockchain, and method 2 is to share secret fragments through the public key encryption technology of the institutional participants corresponding to the secret fragments. For the channel technology of the blockchain, it is generally necessary to define the participants of the blockchain channel. Only the participants of the defined blockchain channel can see the content of the shared secret fragments. For the public key encryption technology, the institutional participant uses the public key of the corresponding institutional participant to encrypt the secret fragment. After the corresponding institutional participant receives the encrypted secret fragment, it uses its own private key to decrypt the encrypted secret fragment.
[0072] Institutional participant A takes the secret fragment f a (2) Sharing to the corresponding institutional participant B is used as an example. Method 1: The participants of the blockchain channel are defined as institutional participant A and institutional participant B through the blockchain channel technology. Then institutional participant A uses the blockchain channel technology to share the secret fragment f a (2) Share it with the corresponding institutional participant B. Method 2: Share the secret fragment f a(2) Use the public key of institutional participant B to encrypt, and then use the encrypted secret fragment f a (2) Shared with the corresponding institutional participant B, who receives the encrypted secret fragment f a (2) Then, the encrypted secret fragment f is encrypted using the private key a (2) Decryption. Institutional participant A sends the secret fragment f a (3) Share it with the corresponding institutional participant C; institutional participant B sends the secret fragment f b (1) Share it with the corresponding institutional participant A, and send the secret fragment f b (3) Share it with the corresponding institutional participant C; institutional participant C sends the secret fragment f c (1) Share it with the corresponding institutional participant A, and send the secret fragment f c (2) The process of sharing to the corresponding institutional participant B is similar to the process of institutional participant A sharing the secret fragment f a (2) The process of sharing with the corresponding institutional participant B is similar and will not be elaborated here.
[0073] In order to ensure the correctness of the shared secret fragments and thus the correctness of data statistics, in this application, the institutional participants are also used to determine the corresponding secret commitments based on the local total amount of secrets and the corresponding polynomials; and send the secret commitments to the blockchain nodes;
[0074] The institutional participant is also used to verify the correctness of the secret fragments obtained through sharing based on the secret commitments corresponding to the institutional participants who shared the secret fragments in the blockchain node. If the verification is successful, the secret fragments and values are determined based on the secret fragments corresponding to the institutional participants and the secret fragments obtained through sharing.
[0075] In this application, the institutional participants are also used to determine the corresponding secret commitment based on the local total amount of secrets and the corresponding polynomial; and send the secret commitment to the blockchain node. Optionally, the institutional participants can determine the corresponding secret commitment through the Pederden commitment algorithm. In the Pederden commitment algorithm, the committer randomly selects a blinding factor r and generates a commitment value c containing the original information v according to the formula. This application sends the commitment value to the blockchain node, and the verifier obtains the commitment value from the blockchain node for verification.
[0076] For the secret fragments obtained through sharing, the institutional participants obtain the secret commitment corresponding to the institutional participants who shared the secret fragments in the blockchain node, and then verify the correctness of the secret fragments obtained through sharing based on the secret commitment. If the verification is successful, the secret fragments and values are determined based on their corresponding secret fragments and the secret fragments obtained through sharing.
[0077] Institutional participant A takes the secret fragment f a (2) Sharing to the corresponding institutional participant B is used as an example. Institutional participant A sends the secret fragment f a (2) Share it with the corresponding institutional participant B, and institutional participant A determines the corresponding secret commitment based on the local total secret amount and the corresponding polynomial; and sends the secret commitment to the blockchain node. Institutional participant B obtains the secret fragment f through sharing a (2) After that, the secret commitment corresponding to institutional participant A is obtained from the blockchain node, and then institutional participant B verifies the secret fragment f based on the secret commitment corresponding to institutional participant A. a (2) is correct. Similarly, institutional participant B verifies the secret fragment f based on the corresponding secret commitment of institutional participant C. c (2) is correct. If institutional participant B verifies the secret fragment f based on the corresponding secret commitment of institutional participant A, a The correctness of (2) is verified, and the institution participant B verifies the secret fragment f based on the secret commitment corresponding to the institution participant C. c The correctness of (2) is verified, and the secret fragment and value f are determined. a (2)+f b (2)+f c (2).
[0078] The institutional participant is also used to record the secret fragment as an erroneous secret fragment and send it to the blockchain node if the verification of the correctness of the secret fragment fails, and record the institutional participant who shared the secret fragment as an abnormal institutional participant in the blockchain node.
[0079] For example, if institutional participant B verifies secret fragment f based on the corresponding secret commitment of institutional participant A a If the correctness verification of (2) fails, the secret fragment f a (2) Record it as an incorrect secret fragment and send it to the blockchain node, and record the shared secret fragment f in the blockchain node a (2) Institutional participant A is an abnormal institutional participant. For later audit and corresponding punishment. For another example, if institutional participant B verifies the secret fragment f based on the secret commitment corresponding to institutional participant C c If the correctness verification of (2) fails, the secret fragment f c (2) Record it as an incorrect secret fragment and send it to the blockchain node, and record the shared secret fragment f in the blockchain node c (2) The institutional participant C is an abnormal institutional participant. For later audit and corresponding punishment. It should be noted that the secret fragment f a (2) and secret fragment f cIf any correctness verification in (2) fails, the subsequent process of determining the secret fragment and value will not be performed.
[0080] In order to ensure the correctness of the secret fragments and values, and thus ensure the correctness of data statistics, in the present application, the blockchain node is also used to verify the correctness of the secret fragments and values sent by each of the institutional participants based on the secret commitments corresponding to the institutional participants who sent the secret fragments and values. If the verification is successful, based on the secret fragments and values sent by each of the institutional participants, the sum of the polynomials corresponding to each of the institutional participants is reconstructed.
[0081] In this application, the institutional participants determine the corresponding secret commitments based on the local total secret amount and the corresponding polynomials, and send the secret commitments to the blockchain node. The blockchain node obtains the secret fragments and values sent by each institutional participant based on the blockchain smart contract. For each secret fragment and value, the corresponding secret commitment of the institutional participant who sent the secret fragment and value is first obtained, and then the correctness of the secret fragment and value is verified based on the secret commitment. If the verification is successful, the sum of the polynomials corresponding to each institutional participant is reconstructed based on the secret fragments and values sent by each institutional participant, and then the data statistics result is determined based on the sum of the polynomials corresponding to each institutional participant.
[0082] Institutional participant A takes the secret fragment and value f a (1)+f b (1)+f c (1) Sending to a blockchain node is used as an example. The blockchain node obtains the sent secret fragment and value f a (1)+f b (1)+f c (1) The corresponding secret commitment of the institutional participant A verifies the secret fragment and value f based on the secret commitment a (1)+f b (1)+f c (1) is correct. Similarly, blockchain nodes verify the secret fragment and the value fa(2)+f b (2)+f c (2) The correctness and verification of the secret fragment and value f a (3)+f b (3)+f c (3) is correct. If the blockchain node verifies the secret fragment and value f a (1)+f b (1)+f c The correctness of (1) is verified by verifying the secret fragment and the value fa(2)+f b (2)+f c(2) is correct by verifying the secret fragment and value f a (3)+f b (3)+f c If the correctness of (3) is passed, the subsequent process is to reconstruct the sum of the polynomials corresponding to each institutional participant based on the secret fragments and values sent by each institutional participant, and then determine the data statistical results based on the sum of the polynomials corresponding to each institutional participant. Verify the secret fragment and value f a (1)+f b (1)+f c The correctness of (1) fails, or the secret fragment and value fa(2)+f are verified. b (2)+f c (2) fails to verify the correctness, or verifies the secret fragment and value f a (3)+f b (3)+f c If the correctness of (3) is not passed, the subsequent process of reconstructing the sum of the polynomials corresponding to each institutional participant based on the secret fragments and values sent by each institutional participant will not be carried out, and then determining the data statistical results based on the sum of the polynomials corresponding to each institutional participant will not be carried out.
[0083] In order to facilitate later audits and corresponding penalties, in the present application, the blockchain node is also used to record the secret fragments and values as erroneous secret fragments and values if the verification of the correctness of the secret fragments and values fails, and to record the institutional participant that sent the secret fragments and values as an abnormal institutional participant.
[0084] For example, blockchain nodes verify secret fragments and value f based on blockchain smart contracts a (1)+f b (1)+f c If the correctness of (1) fails, the secret fragment and value f a (1)+f b (1)+f c (1) Record the secret fragment and value as an error, and record the institutional participant A that sent the secret fragment and value as an abnormal institutional participant. For another example, the blockchain node verifies the secret fragment and value fa(2)+f based on the blockchain smart contract. b (2)+f c If the correctness of (2) fails, the secret fragment and value fa(2)+f b (2)+f c (2) Record the secret fragment and value as an error, and record the institutional participant B that sent the secret fragment and value as an abnormal institutional participant. For another example, the blockchain node verifies the secret fragment and value f based on the blockchain smart contract. a (3)+f b(3)+f c If the correctness of (3) fails, the secret fragment and value f a (3)+f b (3)+f c (3) Record the secret fragment and value as an erroneous one, and record the institutional participant C that sent the secret fragment and value as an abnormal institutional participant.
[0085] Figure 2 The first blockchain-based data statistics process provided in this application includes the following steps:
[0086] S101: The institutional participant receives the data statistics task sent by the task scheduler through the blockchain node, counts the local total amount of secrets according to the data statistics task, and constructs a corresponding polynomial based on the total amount of secrets and the secret sharing protocol; determines the corresponding secret fragments of each institutional participant participating in the data statistics based on the polynomial; and shares the secret fragments with the corresponding institutional participants;
[0087] S102: Determine the secret fragment and value based on the secret fragment corresponding to itself and the secret fragment obtained through sharing; and send the secret fragment and value to the blockchain node; the blockchain node reconstructs the sum of the polynomials corresponding to each institutional participant based on the secret fragments and values sent by each institutional participant; determine the data statistical result based on the sum of the polynomials corresponding to each institutional participant.
[0088] Figure 3 A schematic diagram of the second blockchain-based data statistics process provided for this application, the process includes the following steps:
[0089] S201: The institutional participant receives the data statistics task sent by the task scheduler through the blockchain node, counts the total amount of local secrets according to the data statistics task, and constructs a corresponding polynomial based on the total amount of secrets and the secret sharing protocol; determines the corresponding secret fragments of each institutional participant participating in the data statistics based on the polynomial; shares the secret fragments with the corresponding institutional participant through the channel technology of the blockchain; or shares the secret fragments with the corresponding institutional participant through the public key encryption technology of the institutional participant corresponding to the secret fragment;
[0090] S202: Determine the secret fragment and value based on the secret fragment corresponding to itself and the secret fragment obtained through sharing; and send the secret fragment and value to the blockchain node; the blockchain node reconstructs the sum of the polynomials corresponding to each institutional participant based on the secret fragments and values sent by each institutional participant; determine the data statistical result based on the sum of the polynomials corresponding to each institutional participant.
[0091] Figure 4 A schematic diagram of the third blockchain-based data statistics process provided for this application, the process includes the following steps:
[0092] S301: The institutional participant receives the data statistics task sent by the task scheduler through the blockchain node, counts the total amount of local secrets according to the data statistics task, and constructs a corresponding polynomial based on the total amount of secrets and the secret sharing protocol; determines the corresponding secret fragments of each institutional participant participating in the data statistics based on the polynomial; shares the secret fragments with the corresponding institutional participant through the channel technology of the blockchain; or shares the secret fragments with the corresponding institutional participant through the public key encryption technology of the institutional participant corresponding to the secret fragment;
[0093] S302: Determine the corresponding secret commitment based on the local total amount of secrets and the corresponding polynomial; and send the secret commitment to the blockchain node; for the secret fragments obtained through sharing, verify the correctness of the secret fragments based on the secret commitments corresponding to the institutional participants who share the secret fragments in the blockchain node, and if the verification is successful, determine the secret fragments and values based on their own corresponding secret fragments and the secret fragments obtained through sharing; and send the secret fragments and values to the blockchain; the blockchain node reconstructs the sum of the polynomials corresponding to each institutional participant based on the secret fragments and values sent by each institutional participant; and determines the data statistical results based on the sum of the polynomials corresponding to each institutional participant.
[0094] Figure 5 A fourth process diagram of blockchain-based data statistics provided in this application, the process includes the following steps:
[0095] S401: The institutional participant receives the data statistics task sent by the task scheduler through the blockchain node, counts the total amount of local secrets according to the data statistics task, and constructs a corresponding polynomial based on the total amount of secrets and the secret sharing protocol; determines the corresponding secret fragments of each institutional participant participating in the data statistics based on the polynomial; shares the secret fragments with the corresponding institutional participant through the channel technology of the blockchain; or shares the secret fragments with the corresponding institutional participant through the public key encryption technology of the institutional participant corresponding to the secret fragment;
[0096] S402: Determine the corresponding secret commitment based on the local total amount of secrets and the corresponding polynomial; and send the secret commitment to the blockchain node; for the secret fragments obtained through sharing, verify the correctness of the secret fragments based on the secret commitments corresponding to the institutional participants who share the secret fragments in the blockchain node. If the verification fails, record the secret fragments as erroneous secret fragments and send them to the blockchain node, and record the institutional participants who share the secret fragments as abnormal institutional participants in the blockchain node.
[0097] in, Figures 2 to 5 The process diagram of blockchain-based data statistics shown is a process diagram of blockchain-based data statistics on the side of institutional participants.
[0098] Figure 6 A fifth blockchain-based data statistics process diagram provided in this application includes the following steps:
[0099] S501: The blockchain node receives the data statistics task configured by the task scheduler, and notifies each institutional participant of the data statistics task;
[0100] S502: Based on the secret fragments and values sent by each of the institutional participants, reconstruct the sum of the polynomials corresponding to each of the institutional participants; determine the data statistics results based on the sum of the polynomials corresponding to each of the institutional participants; wherein, the institutional participants count the total amount of local secrets according to the data statistics task, and construct the corresponding polynomial based on the total amount of secrets and the secret sharing protocol; determine the secret fragments corresponding to each of the institutional participants participating in the data statistics based on the polynomial; share the secret fragments with the corresponding institutional participants; determine the secret fragments and values based on their own corresponding secret fragments and the secret fragments obtained through sharing; and send the secret fragments and values to the blockchain node.
[0101] Figure 7 A sixth process diagram of blockchain-based data statistics provided in this application, the process includes the following steps:
[0102] S601: The blockchain node verifies the correctness of the secret fragments and values sent by each of the institutional participants based on the secret commitments of the institutional participants who sent the secret fragments and values. If the verification is successful, the sum of the polynomials corresponding to each of the institutional participants is reconstructed based on the secret fragments and values sent by each of the institutional participants.
[0103] S602: Determine the data statistical result according to the sum of the polynomials corresponding to each of the institutional participants.
[0104] Figure 8 A seventh process diagram of blockchain-based data statistics provided in this application, the process includes the following steps:
[0105] S701: The blockchain node verifies the correctness of the secret fragments and values sent by each of the institutional participants based on the secret commitments of the institutional participants that sent the secret fragments and values;
[0106] S702: If the verification of the correctness of the secret fragment and value fails, the secret fragment and value are recorded as erroneous secret fragments and values, and the institutional participant that sent the secret fragment and value is recorded as an abnormal institutional participant.
[0107] in, Figures 6 to 8 The process diagram of blockchain-based data statistics shown is a process diagram of blockchain-based data statistics on the blockchain node side.
[0108] The data statistics scheme based on blockchain provided by the present application, on the one hand, extends the verifiable Shamir secret sharing protocol, and obtains the secret fragments and values of each institutional participant by allowing each institutional participant to share the secret fragments. On the other hand, each institutional participant sends the secret commitment to the blockchain node, and all institutional participants can obtain the secret commitment from the blockchain node and verify the secret fragments. If the secret fragment verification fails, the institutional participant can publish the wrong secret fragment plaintext information to the blockchain node, and the blockchain smart contract deployed in the blockchain node verifies and records the abnormal behavior as the basis for subsequent punishment, and the protocol terminates. The correctness of the protocol is ensured and the auditability of the protocol is achieved. On the third hand, all institutional participants calculate the secret fragments and values locally after receiving the secret fragments. The protocol requires the institutional participants to submit the secret fragments and values to the blockchain smart contract deployed by the blockchain node, and the blockchain smart contract determines whether the secret fragments and values submitted by each institutional participant are correct according to a specific algorithm and secret commitment. If an institutional participant submits incorrect secret fragments and values, the verification will fail, and the abnormal behavior can be recorded on the blockchain node as the basis for subsequent punishment, and the protocol terminates. The correctness of the protocol is ensured and the auditability of the protocol is achieved. Fourthly, the blockchain smart contract deployed on the blockchain node determines the data statistics results, and all institutional participants can see the final data statistics results, which is fair.
[0109] The technical effects achieved by the blockchain-based data statistics solution provided by this application are as follows:
[0110] The first is security and privacy. The verifiable multi-party secure summation algorithm ensures that the transaction data and statistical values of each institutional participant are not leaked.
[0111] The second is correctness. The protocol issues secret commitments on blockchain nodes and verifies the correctness of secret fragments and the correctness of secret fragments and values based on secret commitments on and off the blockchain to ensure the correct execution of the protocol and prevent institutional participants from sharing incorrect secret fragments or calculating incorrect secret fragments and values, which may lead to errors in the final statistical results.
[0112] The third is fairness. This application relies on blockchain smart contracts to aggregate the various secret fragments and values to obtain the final data statistics, ensuring that each institutional participant can obtain the calculation results at the same time to ensure fairness.
[0113] Fourth, auditability. This application is based on the blockchain node to initiate tasks, execute calculations, and complete calculations. The entire process is recorded on the blockchain node to ensure its auditability. By uploading secret commitments to the chain and verifying the calculation process, abnormal institutional participants in the protocol execution process can be discovered.
[0114] The fifth is programmability. The programmability of blockchain smart contracts can enable flexible customization and release of tasks.
[0115] Fig. 9 The overall architecture diagram of the blockchain-based data statistics system provided for this application is as follows: Fig. 9 As shown, the data statistics system based on blockchain includes a blockchain platform (including blockchain nodes), institutional participants and task schedulers. The blockchain platform includes a directional sharing protocol and multiple blockchain smart contracts for secure summation. Institutional participants include local computing SDK and blockchain platform SDK. Task schedulers include task generation modules and blockchain platform SDK. Fig. 9 A blockchain-based data statistics system including institutional participants A and B is used as an example for illustration.
[0116] Institutional participants and task schedulers jointly build a blockchain network and complete verifiable multi-party secure summation on blockchain nodes.
[0117] Blockchain platform: Task schedulers can configure and deploy secure summation smart contracts (blockchain smart contracts) according to specific computing tasks to achieve programmability and flexible release of tasks. The directional sharing protocol based on the blockchain network is an important component of the secure summation algorithm.
[0118] Institutional participants: Institutional participants can integrate the blockchain platform SDK and local computing SDK to minimize code development. In the case that local privacy data does not leave the domain, the computing task is completed by relying on the multi-party secure summation algorithm on the blockchain.
[0119] Task scheduler: The task generation module supports the configuration, generation and scheduling of tasks through a visual interface, and publishes them to the blockchain node through the blockchain platform SDK.
[0120] Blockchain nodes implement data security statistics based on the secure summation smart contract deployed on the blockchain platform.
[0121] Fig.10 The data statistics flow chart based on blockchain provided for this application, for example, the data statistics task is to calculate the total number of offline catering transactions in October 2023. The specific process of the multi-party secure summation protocol based on blockchain verifiable is as follows:
[0122] 1. Task configuration: The task scheduler configures the computing task (for example, counting the total number of offline catering transactions of the designated institutional participants in October), specifies the institutional participants (such as institutional participants A, institutional participants B, and institutional participants C), generates a secure summation smart contract and deploys it to the blockchain network. Each institutional participant will receive a task notification.
[0123] 2. Task start: The task scheduler starts the computing task at a fixed time (for example, on the 1st of each month) and calls the start interface of the above-mentioned secure summation smart contract. Each institutional participant will receive a task start notification.
[0124] 3. Calculation phase: In this phase, each institutional participant calculates its total secret amount locally (for example, the total number of offline catering transactions of the institutional participants in October), divides the total secret amount into N secret fragments (N is the total number of institutional participants) according to the algorithm described below, and calculates the secret fragments and secret commitments.
[0125] 4. Commitment on the chain: Each institutional participant calls the commitment interface of the above-mentioned security summation smart contract to submit the above-mentioned secret commitment to the blockchain node, and the blockchain smart contract records the secret commitment.
[0126] 5. Secret Sharing: Each institutional participant shares the secret fragments one by one with the corresponding institutional participants among the other N-1 institutional participants through a directional sharing protocol. The directional sharing protocol can rely on the channel technology of the blockchain, or encrypt the secret fragments through the public key of the recipient and submit them to the blockchain node, and then share the secret fragments with the corresponding institutional participants. Institutional participant A shares the secret fragments with the corresponding institutional participants B and C, institutional participant B shares the secret fragments with the corresponding institutional participants A and C, and institutional participant C shares the secret fragments with the corresponding institutional participants A and B.
[0127] 6. Calculation of data statistics: After receiving the secret fragments shared by other institutional participants, each institutional participant verifies whether the received secret fragments are correct based on the secret commitment stored in the blockchain node. If the verification is correct, the secret fragments and values are calculated locally, and the interface of the above-mentioned secure summation smart contract is called to submit to the blockchain node. The secure summation smart contract will verify the correctness of the secret fragments and values based on the secret commitment. If the verification is correct, the data statistics results are finally calculated. All institutional participants receive the final calculated data statistics results.
[0128] The verifiable multi-party secure summation algorithm is constructed based on the Shamir secret sharing protocol and the Pedersen commitment algorithm. The specific algorithm is as follows:
[0129] Institutional Participants: N Institutions P j ,j=1,…N;
[0130] Total secret input of institutional participants: s j ,j=1,…N;
[0131] Institutional Participants j Compute secret commitments and secret fragments:
[0132] Calculate the secret s j The Pedersen commitment:
[0133] Randomly select a polynomial with a maximum number of terms of N-1 And calculate
[0134] The Pedersen commitment of the above polynomial coefficients is calculated: 1,…N-1;
[0135] Generate the polynomial corresponding to the random term And calculate
[0136] Get the final secret promise and secret fragments
[0137] Institutional Participants j Call the secure summation smart contract to publish the secret commitment to the blockchain node:
[0138]
[0139] Institutional Participants j Separate the secret fragments Send to the corresponding institutional participants among the other N institutional participants;
[0140] Institutional Participants j Reading the commitment value from the secure sum smart contract Use the following algorithm to verify the fragments you received Correctness:
[0141]
[0142] After verification, the participant P j Compute the secret shard and value locally:
[0143]
[0144] Participant P j Call the secure sum smart contract to publish the secret fragments and values to the blockchain node:
[0145]
[0146] The secure sum smart contract calls the following method to verify the secret fragment and value Correctness:
[0147]
[0148] The secure summation smart contract calculates the final data statistics:
[0149]
[0150] This application ensures the security, correctness and fairness of joint computing, while providing an auditable and programmable blockchain-based data statistics solution.
[0151] The following are the explanations for situations where verification fails:
[0152] 1. Secret fragment verification failed.
[0153] Assume P i Receive P j The secret fragments and values sent to him via the directed transfer protocol The following verification failed:
[0154]
[0155] P i The secure sum smart contract is called to submit the wrong secret fragment and value to the blockchain node.
[0156]
[0157] If the smart contract executes the above formula to verify the following results:
[0158]
[0159] The smart contract accepts this error transaction and records P j Abnormal behavior is detected for later audit and punishment, and the multi-party security summation protocol is terminated.
[0160] 2. Secret fragment and value verification failed.
[0161] The smart contract receives P j Submitted secret fragments and values The following verification was performed and it was found that the verification failed:
[0162]
[0163] Then the smart contract records P j Abnormal behavior is detected for later audit and punishment, and the multi-party security summation protocol is terminated.
[0164] Fig.11 A schematic diagram of the structure of the first blockchain-based data statistics device provided in this application, the device includes:
[0165] The secret fragment sharing module 111 is used to receive the data statistics task sent by the task scheduler through the blockchain node, count the total amount of local secrets according to the data statistics task, and construct a corresponding polynomial based on the total amount of secrets and the secret sharing protocol; determine the secret fragments corresponding to each institutional participant participating in the data statistics based on the polynomial; and share the secret fragments with the corresponding institutional participants;
[0166] The blockchain reporting module 112 is used to determine the secret fragments and values according to the secret fragments corresponding to itself and the secret fragments obtained through sharing; and send the secret fragments and values to the blockchain node; the blockchain node reconstructs the sum of the polynomials corresponding to each institutional participant based on the secret fragments and values sent by each institutional participant; and determines the data statistical results according to the sum of the polynomials corresponding to each institutional participant.
[0167] The secret fragment sharing module 111 is specifically used to share the secret fragments with corresponding institutional participants through the channel technology of the blockchain; or to share the secret fragments with corresponding institutional participants through the public key encryption technology of the institutional participants corresponding to the secret fragments.
[0168] The device also includes:
[0169] The secret fragment verification module 113 is used to determine the corresponding secret commitment based on the local total amount of secrets and the corresponding polynomial; and send the secret commitment to the blockchain node; for the secret fragments obtained through sharing, based on the secret commitment corresponding to the institutional participant who shared the secret fragment in the blockchain node, verify the correctness of the secret fragment, if the verification is successful, trigger the blockchain reporting module to determine the secret fragment and value based on its own corresponding secret fragment and the secret fragment obtained through sharing.
[0170] The secret fragment verification module 113 is also used to record the secret fragment as an erroneous secret fragment and send it to the blockchain node if the verification of the correctness of the secret fragment fails, and record the institutional participant who shares the secret fragment as an abnormal institutional participant in the blockchain node.
[0171] Fig.12 A schematic diagram of the structure of a second blockchain-based data statistics device provided in this application, the device comprising:
[0172] The data statistics module 121 is used to receive the data statistics tasks configured by the task scheduler, and notify the data statistics tasks to each institutional participant; based on the secret fragments and values sent by each institutional participant, reconstruct the sum of the polynomials corresponding to each institutional participant; according to the sum of the polynomials corresponding to each institutional participant, determine the data statistics results; wherein, the institutional participants count the total amount of local secrets according to the data statistics tasks, and construct the corresponding polynomial based on the total amount of secrets and the secret sharing protocol; determine the secret fragments corresponding to each institutional participant participating in the data statistics based on the polynomial; share the secret fragments to the corresponding institutional participants; determine the secret fragments and values according to their own corresponding secret fragments and the secret fragments obtained through sharing; and send the secret fragments and values to the data statistics module in the blockchain node.
[0173] The device also includes:
[0174] The secret fragment and value verification module 122 is used to verify the correctness of the secret fragments and values sent by each of the institutional participants based on the secret commitments corresponding to the institutional participants who sent the secret fragments and values. If the verification is successful, the data statistics module is triggered to reconstruct the sum of the polynomials corresponding to each of the institutional participants based on the secret fragments and values sent by each of the institutional participants; wherein the institutional participants determine the corresponding secret commitments based on the local total amount of secrets and the corresponding polynomials.
[0175] The secret fragment and value verification module 122 is also used to record the secret fragment and value as an erroneous secret fragment and value if the verification of the correctness of the secret fragment and value fails, and record the institutional participant who sent the secret fragment and value as an abnormal institutional participant.
[0176] The present application also provides an electronic device, such as Fig.13 As shown, it includes: a processor 131, a communication interface 132, a memory 133 and a communication bus 134, wherein the processor 131, the communication interface 132, and the memory 133 communicate with each other through the communication bus 134;
[0177] The memory 133 stores a computer program, and when the program is executed by the processor 131, the processor 131 executes any of the above method steps.
[0178] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0179] The communication interface 132 is used for communication between the above electronic device and other devices.
[0180] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0181] The above-mentioned processor can be a general-purpose processor, including a central processing unit, a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, etc.
[0182] The present application also provides a computer storage readable storage medium, wherein the computer readable storage medium stores a computer program executable by an electronic device, and when the program runs on the electronic device, the electronic device implements any of the above method steps when executing.
[0183] Although the preferred embodiments of the present application have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.
[0184] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A data statistics system based on blockchain, characterized in that: The system includes: a task scheduler and a blockchain node; wherein the blockchain node is deployed with a blockchain smart contract, and the blockchain node performs data statistics based on the blockchain smart contract; The task scheduler is used to configure the data statistics task, specify each institutional participant, and send the data statistics task to the blockchain node, which then sends the data statistics task to each institutional participant; The institutional participants are used to count the total amount of local secrets according to the data statistics task, construct a corresponding polynomial based on the total amount of secrets and the secret sharing protocol; determine the secret fragments corresponding to each of the institutional participants based on the polynomial; and share the secret fragments with the corresponding institutional participants; The institutional participant is further configured to determine the secret fragment and value according to the secret fragment corresponding to the institutional participant and the secret fragment obtained through sharing; and send the secret fragment and value to the blockchain node; The blockchain node is used to reconstruct the sum of the polynomials corresponding to each of the institutional participants based on the secret fragments and values sent by each of the institutional participants; and determine the data statistical results based on the sum of the polynomials corresponding to each of the institutional participants.
2. The system according to claim 1, characterized in that The institutional participant is specifically used to share the secret fragment with the corresponding institutional participant through the channel technology of the blockchain; or to share the secret fragment with the corresponding institutional participant through the public key encryption technology of the institutional participant corresponding to the secret fragment.
3. The system according to claim 1, characterized in that The institutional participant is further used to determine a corresponding secret commitment based on the local total amount of secrets and the corresponding polynomial; and send the secret commitment to the blockchain node; The institutional participant is also used to verify the correctness of the secret fragments obtained through sharing based on the secret commitments corresponding to the institutional participants who shared the secret fragments in the blockchain node. If the verification is successful, the secret fragments and values are determined based on the secret fragments corresponding to the institutional participants and the secret fragments obtained through sharing.
4. The system according to claim 3, characterized in that The institutional participant is also used to record the secret fragment as an erroneous secret fragment and send it to the blockchain node if the verification of the correctness of the secret fragment fails, and record the institutional participant who shared the secret fragment as an abnormal institutional participant in the blockchain node.
5. The system according to claim 3, characterized in that The blockchain node is further used to verify the correctness of the secret fragments and values sent by each of the institutional participants based on the secret commitments corresponding to the institutional participants who sent the secret fragments and values. If the verification is successful, the sum of the polynomials corresponding to each of the institutional participants is reconstructed based on the secret fragments and values sent by each of the institutional participants.
6. The system according to claim 5, characterized in that The blockchain node is also used to record the secret fragments and values as erroneous secret fragments and values if the verification of the correctness of the secret fragments and values fails, and to record the institutional participant that sent the secret fragments and values as an abnormal institutional participant.
7. A data statistics method based on blockchain, characterized in that: The method comprises: The institutional participant receives the data statistics task sent by the task scheduler through the blockchain node, counts the total amount of local secrets according to the data statistics task, and constructs a corresponding polynomial based on the total amount of secrets and the secret sharing protocol; determines the corresponding secret fragments of each institutional participant participating in the data statistics based on the polynomial; and shares the secret fragments with the corresponding institutional participants; Determine the secret fragment and value according to the secret fragment corresponding to itself and the secret fragment obtained through sharing; and send the secret fragment and value to the blockchain node; the blockchain node reconstructs the sum of the polynomials corresponding to each institutional participant based on the secret fragments and values sent by each institutional participant; determine the data statistical result according to the sum of the polynomials corresponding to each institutional participant.
8. The method according to claim 7, characterized in that The secret fragments are shared with the corresponding institutional participants including: The secret fragments are shared with the corresponding institutional participants through the channel technology of the blockchain; or the secret fragments are shared with the corresponding institutional participants through the public key encryption technology of the institutional participants corresponding to the secret fragments.
9. The method according to claim 7, characterized in that Before determining the secret fragment and the value according to the secret fragment corresponding to the self and the secret fragment obtained through sharing, the method further includes: Determine a corresponding secret commitment according to the local total amount of secrets and the corresponding polynomial; and send the secret commitment to the blockchain node; For the secret fragments obtained through sharing, the correctness of the secret fragments is verified based on the secret commitments corresponding to the institutional participants in the blockchain node that share the secret fragments. If the verification passes, the secret fragments and values are determined based on the secret fragments corresponding to themselves and the secret fragments obtained through sharing.
10. The method according to claim 9, characterized in that The method further comprises: If the verification of the correctness of the secret fragment fails, the secret fragment is recorded as an erroneous secret fragment and sent to the blockchain node, and the institutional participant who shares the secret fragment is recorded in the blockchain node as an abnormal institutional participant.
11. A data statistics method based on blockchain, characterized in that: The method comprises: The blockchain node receives the data statistics task configured by the task scheduler, and notifies each institutional participant of the data statistics task; Based on the secret fragments and values sent by each of the institutional participants, the sum of the polynomials corresponding to each of the institutional participants is reconstructed; based on the sum of the polynomials corresponding to each of the institutional participants, the data statistics result is determined; wherein, the institutional participants count the total amount of local secrets according to the data statistics task, and construct the corresponding polynomial based on the total amount of secrets and the secret sharing protocol; based on the polynomial, the secret fragments corresponding to each of the institutional participants participating in the data statistics are determined; the secret fragments are shared with the corresponding institutional participants; the secret fragments and values are determined according to the corresponding secret fragments of themselves and the secret fragments obtained through sharing; and the secret fragments and values are sent to the blockchain node.
12. The method according to claim 11, characterized in that Before reconstructing the sum of the polynomials corresponding to the respective institutional participants based on the secret fragments and values respectively sent by the respective institutional participants, the method further comprises: For the secret fragments and values sent by each of the institutional participants, the correctness of the secret fragments and values is verified based on the secret commitments corresponding to the institutional participants sending the secret fragments and values. If the verification is successful, the sum of the polynomials corresponding to each of the institutional participants is reconstructed based on the secret fragments and values sent by each of the institutional participants; wherein the institutional participants determine the corresponding secret commitments based on the local total amount of secrets and the corresponding polynomials.
13. The method according to claim 12, characterized in that The method further comprises: If the verification of the correctness of the secret fragment and value fails, the secret fragment and value are recorded as erroneous secret fragment and value, and the institutional participant who sent the secret fragment and value is recorded as an abnormal institutional participant.
14. A data statistics device based on blockchain, characterized in that: The device comprises: The secret fragment sharing module is used to receive the data statistics task sent by the task scheduler through the blockchain node, count the local total amount of secrets according to the data statistics task, and construct a corresponding polynomial based on the total amount of secrets and the secret sharing protocol; determine the secret fragments corresponding to each institutional participant participating in the data statistics based on the polynomial; and share the secret fragments with the corresponding institutional participants; The blockchain reporting module is used to determine the secret fragments and values according to the secret fragments corresponding to itself and the secret fragments obtained through sharing; and send the secret fragments and values to the blockchain node; the blockchain node reconstructs the sum of the polynomials corresponding to each institutional participant based on the secret fragments and values sent by each institutional participant; and determines the data statistical results according to the sum of the polynomials corresponding to each institutional participant.
15. The device according to claim 14, characterized in that The secret fragment sharing module is specifically used to share the secret fragments with corresponding institutional participants through the channel technology of the blockchain; or to share the secret fragments with corresponding institutional participants through the public key encryption technology of the institutional participants corresponding to the secret fragments.
16. The device according to claim 14, characterized in that The device also includes: The secret fragment verification module is used to determine the corresponding secret commitment based on the local total amount of secrets and the corresponding polynomial; and send the secret commitment to the blockchain node; for the secret fragments obtained through sharing, based on the secret commitment corresponding to the institutional participant sharing the secret fragment in the blockchain node, verify the correctness of the secret fragment, if the verification is successful, trigger the blockchain reporting module to determine the secret fragment and value based on its own corresponding secret fragment and the secret fragment obtained through sharing.
17. The device according to claim 16, characterized in that The secret fragment verification module is also used to record the secret fragment as an erroneous secret fragment and send it to the blockchain node if the verification of the correctness of the secret fragment fails, and record the institutional participant who shares the secret fragment as an abnormal institutional participant in the blockchain node.
18. A data statistics device based on blockchain, characterized in that: The device comprises: The data statistics module is used to receive the data statistics tasks configured by the task scheduler, and notify the data statistics tasks to each institutional participant; based on the secret fragments and values sent by each institutional participant, reconstruct the sum of the polynomials corresponding to each institutional participant; according to the sum of the polynomials corresponding to each institutional participant, determine the data statistics results; wherein, the institutional participant counts the total amount of local secrets according to the data statistics task, and constructs the corresponding polynomial based on the total amount of secrets and the secret sharing protocol; based on the polynomial, determine the corresponding secret fragments of each institutional participant participating in the data statistics; share the secret fragments with the corresponding institutional participants; determine the secret fragments and values according to the corresponding secret fragments and the secret fragments obtained through sharing; and send the secret fragments and values to the data statistics module in the blockchain node.
19. The device according to claim 18, characterized in that The device also includes: The secret fragment and value verification module is used to verify the correctness of the secret fragments and values sent by each of the institutional participants based on the secret commitments corresponding to the institutional participants who sent the secret fragments and values. If the verification is successful, the data statistics module is triggered to reconstruct the sum of the polynomials corresponding to each of the institutional participants based on the secret fragments and values sent by each of the institutional participants; wherein the institutional participants determine the corresponding secret commitments based on the local total amount of secrets and the corresponding polynomials.
20. The device according to claim 19, characterized in that The secret fragment and value verification module is also used to record the secret fragment and value as an erroneous secret fragment and value if the verification of the correctness of the secret fragment and value fails, and record the institutional participant who sent the secret fragment and value as an abnormal institutional participant.
21. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 7 to 10, or implementing the method steps described in any one of claims 11 to 13, when executing a program stored in a memory.
22. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 7 to 10 are implemented, or the method steps described in any one of claims 11 to 13 are implemented.
Citation Information
Patent Citations
Input data credibility verification method and device based on block chain technology
CN113486368A
Method, system and node for realizing distributed key generation on block chain
CN115941164A
Data hiding statistical query method and system based on privacy calculation
CN117494177A
Cited By
Blockchain-based data statistics system, methods and apparatuses, device, and medium
WO2026040278A1
