Blockchain-based data sharing method, device, and computer program product
By deploying smart contracts and virtual reward mechanisms on the blockchain, the problem of low efficiency in sharing private data on the blockchain is solved, and users' sharing enthusiasm and data sharing efficiency are improved.
Patent Information
- Application Number
- CN202210259158.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-16
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2042-03-16
AI Technical Summary
The sharing of private data between users on the blockchain is inefficient, and the lack of an effective incentive mechanism leads to low user enthusiasm for sharing.
By deploying the first and second smart contracts on the blockchain and utilizing a virtual reward mechanism, users can initiate private data requests through the first smart contract. The second smart contract calculates the privacy budget based on the virtual reward and generates target private data, and sends it to the first smart contract, ensuring that the provider receives the corresponding virtual reward.
It improves the enthusiasm and efficiency of blockchain users in sharing private data, ensures that providers receive corresponding virtual rewards, and establishes an effective incentive mechanism for sharing private data.
Smart Images

Figure CN114580027B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of blockchain, and more specifically, to a blockchain-based data sharing method, device, and computer program product. Background Art
[0002] Currently, some valuable information on the blockchain, as private data of users, cannot be directly disclosed to the public, and therefore cannot be fully utilized. However, in practical applications, if certain technical means can be used to encourage the owners of private data to provide statistical results of private data, other users on the blockchain can use these statistical results to conduct data analysis, thereby further exploring commercial value.
[0003] However, since there is no incentive mechanism in the existing technology to encourage blockchain users to share their private data, blockchain users are not very enthusiastic about sharing private data, which leads to low efficiency in sharing private data between different users in the blockchain.
[0004] To address the above-mentioned problems, no effective solutions have been proposed so far. Summary of the Invention
[0005] Embodiments of the present invention provide a blockchain-based data sharing method, device, and computer program product to at least solve the technical problem of low data sharing efficiency in existing private data sharing processes.
[0006] According to one aspect of an embodiment of the present invention, a blockchain-based data sharing method is provided, comprising: obtaining a private data request initiated by a first object based on a first smart contract, wherein the private data request includes at least an identifier of a second smart contract and a virtual reward provided by the first object for obtaining the private data, the second smart contract is used to provide private data to the first smart contract, and the first and second smart contracts are deployed in a blockchain; sending the private data request to the second smart contract based on the identifier of the second smart contract; receiving target private data provided by the second smart contract based on the virtual reward in the private data request; and sending the target private data to the first smart contract.
[0007] Furthermore, the blockchain-based data sharing method also includes: a second smart contract is used to calculate a privacy budget based on the virtual reward, and generate target privacy data based on the privacy budget, wherein the privacy budget represents the degree of publicity of the target privacy data, and the privacy budget is positively correlated with the degree of publicity of the target privacy data.
[0008] Furthermore, the blockchain-based data sharing method also includes: before sending the target private data to the first smart contract, transferring the virtual reward from the first virtual account to the second virtual account, wherein the first virtual account is the virtual account of the first object, the second virtual account is the virtual account of the second object, and the second object is the object providing the target private data.
[0009] Furthermore, the blockchain-based data sharing method also includes: the privacy data request also includes the identity of the first object; before transferring the virtual reward from the first virtual account to the second virtual account, the first virtual account is determined based on the identity of the first object; and the virtual reward in the first virtual account is frozen.
[0010] Furthermore, the blockchain-based data sharing method also includes: unfreezing the frozen virtual rewards in the first virtual account; and transferring the unfrozen virtual rewards from the first virtual account to the second virtual account.
[0011] Furthermore, the blockchain-based data sharing method also includes: before transferring the unfrozen virtual reward from the first virtual account to the second virtual account, obtaining a first virtual reward from the unfrozen virtual reward, wherein the first virtual reward is smaller than the unfrozen virtual reward; and storing the first virtual reward in a preset virtual account.
[0012] Furthermore, the blockchain-based data sharing method also includes: after sending the target private data to the first smart contract, obtaining the evaluation score made by the first object for the target private data through the first smart contract; when the evaluation score is greater than the preset score, transferring the first virtual reward from the preset virtual account to the second virtual account.
[0013] According to another aspect of an embodiment of the present invention, a blockchain-based data sharing device is also provided, including: an acquisition module, which obtains a privacy data request initiated by a first object based on a first smart contract, wherein the privacy data request includes at least an identifier of a second smart contract and a virtual reward provided by the first object for obtaining the privacy data, and the second smart contract is used to provide privacy data to the first smart contract, and the first smart contract and the second smart contract are deployed in a blockchain; a first sending module, which sends the privacy data request to the second smart contract according to the identifier of the second smart contract; a receiving module, which receives target privacy data provided by the second smart contract based on the virtual reward in the privacy data request; and a second sending module, which sends the target privacy data to the first smart contract.
[0014] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is further provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned blockchain-based data sharing method when running.
[0015] According to another aspect of an embodiment of the present invention, an electronic device is further provided, comprising one or more processors; a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors are enabled to run the programs, wherein the programs are configured to execute the above-mentioned blockchain-based data sharing method when running.
[0016] According to another aspect of an embodiment of the present invention, a computer program product is also provided, including a computer program / instruction, which implements the above-mentioned blockchain-based data sharing method when the computer program / instruction is executed by a processor.
[0017] In an embodiment of the present invention, a virtual reward is provided to entities providing private data. After obtaining a private data request from a first entity based on a first smart contract, the private data request is sent to a second smart contract based on the identifier of the second smart contract. The second smart contract then receives the target private data provided by the second smart contract based on the virtual reward in the private data request, and finally sends the target private data to the first smart contract. The private data request includes at least the identifier of the second smart contract and the virtual reward provided by the first entity for obtaining the private data. The second smart contract is used to provide the private data to the first smart contract. Both the first and second smart contracts are deployed on a blockchain.
[0018] As can be seen from the above, since both the first and second smart contracts are deployed on the blockchain, the security of private data during transmission is guaranteed based on the blockchain's protection mechanism. Furthermore, the private data request also includes the virtual reward offered by the first party for obtaining the private data. Therefore, providers of private data can receive the virtual reward after providing the private data, thereby increasing blockchain users' enthusiasm for sharing private data and making private data sharing more efficient. Furthermore, after receiving the private data request, the second smart contract provides the first smart contract with the target private data based on the virtual reward in the private data request. This means that the second smart contract does not disclose all private data to the first smart contract at once. Instead, it generates target private data based on the virtual reward and sends the target private data to the first smart contract. This ensures that all providers of private data receive the virtual reward corresponding to the target private data, further increasing blockchain users' enthusiasm for sharing private data.
[0019] It can be seen that through the technical solution of this application, the purpose of establishing an incentive mechanism for sharing private data in the blockchain has been achieved, thereby increasing the enthusiasm of blockchain users to share private data, and further solving the technical problem of low data sharing efficiency in the existing private data sharing process. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0021] Figure 1 is a flow chart of an optional blockchain-based data sharing method according to an embodiment of the present invention;
[0022] Figure 2 is a schematic diagram of a blockchain system supporting differentially private computing according to an embodiment of the present invention;
[0023] Figure 3 is a flow chart of a privacy data service evaluation and reward distribution method according to an embodiment of the present invention;
[0024] Figure 4 is a flow chart of an optional blockchain-based data sharing method according to an embodiment of the present invention;
[0025] Figure 5 is a flow chart of a method for sharing private data and charging for virtual rewards according to an embodiment of the present invention;
[0026] Figure 6 is a flowchart of a privacy data service registration processing method according to an embodiment of the present invention;
[0027] Figure 7 This is a flow chart of a method for processing blockchain privacy data entry according to an embodiment of the present invention;
[0028] Figure 8 2 is a schematic diagram of an optional blockchain-based data sharing device according to an embodiment of the present invention;
[0029] Figure 9 is a schematic diagram of an optional electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0030] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0031] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0032] In addition, it should be noted that in the technical solutions disclosed herein, the acquisition, storage and application of user personal information involved are all information authorized by the user or fully authorized by all parties.
[0033] Example 1
[0034] According to an embodiment of the present invention, a method embodiment of a blockchain-based data sharing method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in an order different from that shown here.
[0035] In addition, it should be noted that a data sharing system can serve as the executor of the blockchain-based data sharing method in an embodiment of the present invention, wherein the data sharing system includes at least a cross-contract call processing device and a virtual reward management system smart contract, and the data sharing system is also connected to a first smart contract and a second smart contract.
[0036] Figure 1 is a flowchart of an optional blockchain-based data sharing method according to an embodiment of the present invention. Figure 1 As shown, the method includes the following steps:
[0037] Step S101: Obtain a private data request initiated by a first object based on a first smart contract.
[0038] In step S101, the private data request includes at least the identifier of the second smart contract and the virtual reward offered by the first party for obtaining the private data. The second smart contract is used to provide the private data to the first smart contract. The first and second smart contracts are deployed on the blockchain. The first smart contract may be a user-defined smart contract. Specifically, a user-defined smart contract is a logic processing program developed and implemented by a user based on their business process characteristics for a specific business scenario. This logic processing program is deployed on the blockchain in the form of an electronic contract. Multiple user-defined smart contracts can exist on the blockchain, and each user-defined smart contract is relatively independent and cannot call each other. The processing logic of a user-defined smart contract includes calculation and processing logic for its own data as well as calculation and processing logic for the private data of other users. If a user-defined smart contract needs to use the private data of other users, it must first send a private data request to the cross-contract call processing device in the data sharing system, which then processes the private data request uniformly.
[0039] Alternatively, the second smart contract can be a private data system smart contract. Specifically, a private data system smart contract is a smart contract developed by users of the private data system smart contract to provide their own private data query services to specific user-defined smart contracts. Private data system smart contracts are generally independent of specific business scenarios and are abstract public services. Multiple private data system smart contracts can exist on a blockchain, and each is relatively independent and cannot call upon another.
[0040] In addition, virtual rewards are digital quantification tools for digital rights and interests in the blockchain. Virtual rewards are used to digitally quantify tangible or intangible assets, interests, rights and professional capabilities in the real world, and can be confirmed on the blockchain for value transactions and circulation.
[0041] Step S102: Send the private data request to the second smart contract according to the identifier of the second smart contract.
[0042] In step S102, after receiving the private data request, the cross-contract call processing device in the data sharing system forwards the private data request to the second smart contract. Since multiple private data system smart contracts may exist in a blockchain, the cross-contract call processing device can determine the second smart contract from among the multiple private data system smart contracts based on the second smart contract identifier included in the private data request.
[0043] Step S103: Receive target private data provided by the second smart contract based on the virtual reward in the private data request.
[0044] In step S103, the second smart contract is also connected to a differential privacy processing device. After receiving the private data request, the second smart contract first calculates a privacy budget based on the virtual reward in the private data request. The second smart contract then sends the calculated privacy budget to the differential privacy processing device. After obtaining the privacy budget, the differential privacy processing device generates target private data based on the privacy budget. The privacy budget represents the degree of publicity of the target private data and is positively correlated with the degree of publicity of the target private data. Generally speaking, a smaller privacy budget indicates greater privacy protection for the data, i.e., less public the data is, and therefore, less available the data is. A larger privacy budget indicates greater data availability, but poorer privacy protection, i.e., greater public the data is. Furthermore, if the virtual reward is greater, the corresponding privacy budget will be larger, and ultimately, the target private data generated by the differential privacy processing device will be more public and more available.
[0045] In addition, before the second smart contract reads the private data, it needs to meet two requirements. First, the identity of the owner of the second smart contract needs to be verified. Here, the second smart contract is only allowed to read the private data when the owner of the second smart contract matches the owner of the private data; second, only the first smart contract registered in the access list of the second smart contract can use the private data provided by the second smart contract. Here, the access list of the second smart contract is maintained by the second smart contract itself and sent to the cross-contract call processing device along with the registration request of the second smart contract. The cross-contract call processing device stores and manages the access list of the second smart contract.
[0046] Step S104: Send the target private data to the first smart contract.
[0047] In step S104, after generating the target privacy data, the differential privacy processing device will send the target privacy data to the second smart contract, and then the second smart contract will return the target privacy data to the cross-contract call processing device in the data sharing system. Finally, the cross-contract call processing device will send the target privacy data to the first smart contract, thereby realizing the sharing of the target privacy data.
[0048] Based on the above steps S101 to S104, it can be seen that in this embodiment of the present invention, a virtual reward is provided to the subject providing private data. After obtaining a private data request initiated by a first subject based on a first smart contract, the private data request is sent to a second smart contract based on the identifier of the second smart contract. The second smart contract then receives the target private data provided by the second smart contract based on the virtual reward in the private data request, and finally sends the target private data to the first smart contract. The private data request includes at least the identifier of the second smart contract and the virtual reward provided by the first subject for obtaining the private data. The second smart contract is used to provide the private data to the first smart contract. The first and second smart contracts are deployed on a blockchain.
[0049] As can be seen from the above, since both the first and second smart contracts are deployed on the blockchain, the security of private data during transmission is guaranteed based on the blockchain's protection mechanism. Furthermore, the private data request also includes the virtual reward offered by the first party for obtaining the private data. Therefore, providers of private data can receive the virtual reward after providing the private data, thereby increasing blockchain users' enthusiasm for sharing private data and making private data sharing more efficient. Furthermore, after receiving the private data request, the second smart contract provides the first smart contract with the target private data based on the virtual reward in the private data request. This means that the second smart contract does not disclose all private data to the first smart contract at once. Instead, it generates target private data based on the virtual reward and sends the target private data to the first smart contract. This ensures that all providers of private data receive the virtual reward corresponding to the target private data, further increasing blockchain users' enthusiasm for sharing private data.
[0050] It can be seen that through the technical solution of this application, the purpose of establishing a reward mechanism for sharing private data in the blockchain is achieved, thereby achieving the effect of increasing the enthusiasm of blockchain users to share private data, and further solving the technical problem of low data sharing efficiency in the existing private data sharing process.
[0051] In an optional embodiment, Figure 2A schematic diagram of a blockchain system supporting differentially private computing is shown. The system includes a first smart contract, a second smart contract, a cross-contract call processing device, a differential privacy processing device, and a token (virtual reward) management system smart contract. Furthermore, the first and second smart contracts do not communicate directly with the token management system smart contract, but rather route communication through the cross-contract call processing device. The underlying layer of the second smart contract is compatible with various types of differential privacy processing devices. The cross-contract call processing device and the token (virtual reward) management system smart contract form a data sharing system.
[0052] In an optional embodiment, the second smart contract is used to calculate a privacy budget based on the virtual reward and generate target private data based on the privacy budget. The privacy budget represents the degree of disclosure of the target private data, and the privacy budget is positively correlated with the degree of disclosure of the target private data. Specifically, the operator can construct a privacy budget calculation model using differential privacy protection technology. The second smart contract can then call the privacy budget calculation model to calculate the privacy budget based on the virtual reward. The privacy budget calculation model is a mathematical model that describes the degree of data privacy protection and data availability. For example, the following is an example of a privacy budget calculation model:
[0053]
[0054] Algorithm A is a differentially private algorithm that satisfies ε (ε-DP), where ε ≥ 0, D and D' are any two adjacent datasets that differ by only one element, and ε is called the privacy budget. Furthermore, when calculating the privacy budget based on virtual rewards, smaller virtual rewards result in a smaller privacy budget, greater data privacy protection (i.e., less data disclosure), and lower data availability. Larger virtual rewards result in a larger privacy budget, better data availability, but lower privacy protection (i.e., greater data disclosure). It's easy to notice that calculating the privacy budget is actually a trade-off between converting virtual rewards into a trade-off between privacy protection and data availability.
[0055] Optionally, the second smart contract is also connected to a differential privacy processing device. After obtaining the privacy budget, the second smart contract will send the privacy budget to the differential privacy processing device, and the differential privacy processing device will generate target privacy data based on the privacy budget.
[0056] It's important to note that differential privacy is a cryptographic technique designed to maximize the accuracy of data queries while minimizing the chance of identifying records when querying statistical data. The idea is to perturb and add noise to data before collection or release, thereby concealing the true data and preventing attackers with background knowledge from guessing private information. Therefore, by generating target private data using differential privacy protection technology, we can ensure that the specific private data records are not leaked while providing the statistical results of private information (i.e., the target private data), thereby achieving more secure sharing of private data.
[0057] In an optional embodiment, before sending the target private data to the first smart contract, the data sharing system transfers the virtual reward from the first virtual account to the second virtual account, wherein the first virtual account is the virtual account of the first object, the second virtual account is the virtual account of the second object, and the second object is the object that provides the target private data.
[0058] Optionally, the Token Management System smart contract in the data sharing system is mainly used to implement the issuance of virtual rewards or consumption expenditures. Specifically, when a first smart contract wants to obtain the private data of a second smart contract, if the second smart contract has generated target virtual information based on the virtual rewards that the first smart contract can provide, the second smart contract will send the target virtual information to the cross-contract call processing device. At this time, the cross-contract call processing device will first temporarily save the target virtual information, and then call the Token Management System smart contract to transfer the virtual rewards from the first virtual account to the second virtual account. After the transfer is successful, the Token Management System smart contract will provide the cross-contract call processing device with a transfer success message. Only after receiving the transfer success message will the cross-contract call processing device send the target virtual information to the first smart contract.
[0059] In an optional embodiment, the privacy data request also includes the identity of the first object. Before transferring the virtual reward from the first virtual account to the second virtual account, the data sharing system will determine the first virtual account based on the identity of the first object and then freeze the virtual reward in the first virtual account.
[0060] Optionally, in order to ensure that the virtual reward can be smoothly transferred from the first virtual account to the second virtual account, after receiving the private data request, the cross-contract call processing device first sends a virtual reward lock message to the Token Management System Smart Contract, wherein the virtual reward lock message contains at least the identity identifier of the first object and the amount of the virtual reward. After receiving the virtual reward lock message, the Token Management System Smart Contract verifies the identity information of the first object based on the identity identifier of the first object. After the verification is passed, it determines the first virtual account based on the identifier of the first object, and then freezes the virtual rewards in the first virtual account. The Token Management System Smart Contract will only freeze the virtual rewards included in the private data request. For example, if there are 1,000 virtual rewards in the first virtual account, and the virtual rewards provided by the first object in the private data request to obtain private data are 100, then the Token Management System Smart Contract will only freeze the 100 virtual rewards in the first virtual account.
[0061] It should be noted that, through the above process, it can be ensured that the virtual reward can be smoothly transferred from the first virtual account to the second virtual account, thereby avoiding the problem of the second object suffering losses due to the first object misappropriating the virtual reward.
[0062] In an optional embodiment, after receiving the target privacy data, the cross-contract mobilization processing device will call the Token management system smart contract to unfreeze the frozen virtual rewards in the first virtual account, and at the same time, the Token management system smart contract will transfer the unfrozen virtual rewards from the first virtual account to the second virtual account.
[0063] In an optional embodiment, before transferring the unfrozen virtual reward from the first virtual account to the second virtual account, the data sharing system obtains the first virtual reward from the unfrozen virtual reward and stores the first virtual reward in the preset virtual account, wherein the first virtual reward is smaller than the unfrozen virtual reward.
[0064] Optionally, the cross-contract call processing device includes a fee module, wherein, before transferring the unfrozen virtual reward from the first virtual account to the second virtual account, the fee module will call the Token management system smart contract to extract a preset proportion of the first virtual reward from the unfrozen virtual reward as a handling fee. The extracted first virtual reward is used to regularly distribute rewards to the second smart contract with a higher evaluation.
[0065] In an optional embodiment, after the target private data is sent to the first smart contract, the data sharing system obtains the evaluation score made by the first object for the target private data through the first smart contract, and when the evaluation score is greater than the preset score, the first virtual reward is transferred from the preset virtual account to the second virtual account.
[0066] Optional, Figure 3 A flowchart shows a method for evaluating and distributing rewards for blockchain privacy data services, involving a first smart contract, a cross-contract call processing device, and a token management system smart contract. The cross-contract call processing device in the blockchain regularly updates the first smart contract's evaluation score for a second smart contract, ultimately distributing a virtual reward to the second smart contract whose rating score exceeds a preset score. The specific steps are as follows:
[0067] Step S301: The cross-contract call processing device triggers a scheduled task to collect the evaluation score of the first smart contract on the second smart contract in the blockchain.
[0068] Step S302: The first smart contract may use the target private data provided by the second smart contract to build a model, and evaluate the second smart contract based on the accuracy of the generated model;
[0069] Step S303: When multiple first smart contracts simultaneously obtain the target private data provided by the second smart contract, the cross-contract call processing device collects the evaluation scores fed back by each first smart contract. The first smart contract that consumes more virtual rewards has a greater corresponding weight of the evaluation score. A weighted average is calculated based on all the evaluation scores and the weight corresponding to each evaluation score to obtain the final evaluation score.
[0070] Step S304: If the final evaluation score is greater than the preset score, it is determined that the target privacy data of the second smart contract is good, and the cross-contract call processing device sends a reward distribution instruction to the Token Management System smart contract;
[0071] Step S305: The Token management system smart contract verifies the identity information of the second object. After the verification is passed, a virtual reward is issued to the second virtual account. The amount of the issued virtual reward can be the same as the amount of the first virtual reward, or it can be another amount of virtual reward.
[0072] In an optional embodiment, Figure 4 A flowchart of a data sharing method based on blockchain is shown. Figure 4As shown, the cross-contract call processing device receives a privacy data request from a first smart contract, wherein the first smart contract is used to process non-privacy data and privacy data; the cross-contract call processing device routes the privacy data request to one or more second smart contracts, wherein the privacy data request at least includes the virtual reward consumed by the first smart contract in order to use the service of the second smart contract; the second smart contract confirms the privacy budget based on the virtual reward in the privacy data request, and then calls the differential privacy processing device to generate target privacy data based on the privacy budget; after receiving the target privacy data, the cross-contract call processing device triggers the virtual reward transfer process, and sends the target privacy data to the first smart contract after the virtual reward transfer is successful; after obtaining the target privacy data, the first smart contract continues other processing; if the first smart contract uses the target privacy data for business modeling, the accuracy of the business model is counted and regularly fed back to the blockchain; the higher the accuracy of the business modeling, the higher the virtual reward obtained by the second smart contract, and ultimately forms a benign ecology of privacy data sharing in the blockchain.
[0073] The following example illustrates the use of target private data for business modeling in an embodiment of the present invention. Specifically, assume that home improvement equipment company A and real estate developers B and C are all users in a blockchain system. Each real estate developer's on-chain data contains sales data for multiple cities. Because this sales data is private, it must be processed using differential privacy techniques before being provided to home improvement equipment company A. Furthermore, home improvement equipment company A is willing to pay the same virtual reward for the private data provided by B and C, but the differential privacy calculation result provided by B is closer to the true value than that provided by C. Over time, home improvement equipment company A discovers that the sales volume for a specific city provided by real estate developer B over a recent period of time more closely matches the sales volume of its own products over a certain period of time. Therefore, home improvement equipment company A determines that the data provided by real estate developer B will have a higher modeling accuracy. On this basis, home improvement equipment company A established its own sales model for one month later based on the current sales patterns of real estate developer B (assuming that the changes in consumer consumption of home improvement equipment lag slightly behind real estate consumption by one month). Based on the sales model, it can then count the cities that will generate higher sales, and effectively allocate more inventory to cities with higher sales, and invest more marketing costs in promotions in those cities.
[0074] It can be seen that the combined use of blockchain and differential privacy technology allows data owners to provide some statistical services of private data to other blockchain users, so that other regional chain users can better conduct their own business based on the statistical results, thereby reducing the cost of enterprise operations.
[0075] In an optional embodiment, Figure 5The following is a flowchart of a method for processing blockchain privacy data sharing and virtual reward charging. Figure 5 The specific steps are as follows:
[0076] Step S501: Access the processing flow of the first smart contract to complete the processing flow of non-private data.
[0077] Step S502: If the contract processing flow of the first smart contract includes a private data request, execute S503; otherwise, terminate the processing.
[0078] Step S503: The first smart contract initiates a private data request, where the private data request includes the identity of the first object, the identifier of the second smart contract, and the consumed virtual reward.
[0079] Step S504: The cross-contract call processing device initiates a lock virtual reward message to lock the virtual reward to be consumed by the first object, and sends the lock virtual reward message to the Token management system smart contract, wherein the virtual reward lock message includes the identity identifier and virtual reward of the first object.
[0080] Step S505: The Token management system smart contract verifies the identity of the first object and locks the virtual reward in the first virtual account according to the virtual reward locking message.
[0081] Step S506: The cross-contract calling processing device determines whether the virtual reward is locked successfully. If so, execute S507, otherwise return.
[0082] Step S507: The cross-contract call processing device forwards the private data request to the second smart contract.
[0083] Step S508: The second smart contract calculates the privacy budget based on the virtual reward, and sends the second smart contract identifier, privacy budget, and privacy data request to the differential privacy processing device.
[0084] Step S509: The differential privacy processing device verifies that the second object is the owner of the private data based on the identifier of the second smart contract before continuing with the subsequent processing, otherwise it returns an error.
[0085] Step S510: The differential privacy processing device generates target private data according to the privacy budget and the privacy data request, and returns the target private data to the cross-contract call processing device.
[0086] Step S511: After receiving the target private data, the cross-contract call processing device sends a virtual reward transfer instruction to the Token management system smart contract, wherein the virtual reward transfer instruction includes at least the identity identifier of the first object.
[0087] Step S512: The Token management system smart contract verifies the identity of the first object and executes the virtual reward transfer instruction to transfer the virtual reward from the first virtual account to the second virtual account.
[0088] Step S513: After the cross-contract call processing device determines that the virtual reward transfer is successful, it executes S514, otherwise it returns directly.
[0089] Step S514: After the virtual reward is successfully transferred, the cross-contract call processing device returns the target private data to the first smart contract.
[0090] Step S515: The first smart contract uses the target private data to continue subsequent calculation processing.
[0091] It's important to note that some valuable information on the blockchain isn't directly accessible through smart contracts due to user privacy concerns. Therefore, it's a shame that valuable information on the blockchain isn't fully utilized. This application combines differential privacy technology with blockchain technology to share private data without revealing specific user records, further leveraging the value of data on the blockchain. Furthermore, to encourage owners of private blockchain data to share, this application incorporates virtual rewards within the blockchain to design an incentive mechanism. Essentially, the first user of the blockchain's private data service consumes a virtual reward, while the second user who shares their private data receives a virtual reward. Virtual rewards and privacy budgets are exchanged for each other. The more virtual rewards consumed, the larger the privacy budget, and the more accurate the target private data obtained, thereby increasing users' enthusiasm for sharing private data.
[0092] In an optional embodiment, the cross-contract call processing device also includes a second smart contract registration module, which is used to provide registration services to each second smart contract. During registration, the second smart contract registration module will check the identity of the owner of the privacy data, and record or update the access list of the second smart contract in the cross-contract call processing device. When the first smart contract wants to obtain the privacy data in the second smart contract, the second smart contract registration module will also check whether the first smart contract is in the access list of the second smart contract. If not, the privacy data request sent by the first smart contract will be rejected.
[0093] Optional, Figure 6 A flowchart of a blockchain privacy data service registration and processing method is shown, involving a cross-contract call processing device and a second smart contract. After the second smart contract is activated, the steps for registering with the cross-contract call processing device and establishing an access list are as follows:
[0094] Step S601: The second smart contract initiates a registration request, which includes the identifier of the second smart contract, the identity identifier of the second object, and the admission list of the second smart contract.
[0095] Step S602: The cross-contract call processing device verifies the identity of the second object. After confirming that the identity of the second object is legal, it continues with the subsequent S603 processing step, otherwise executes S604.
[0096] Step S603: If the second object's identity verification passes, the cross-contract call processing device updates the second smart contract's access list, recording the second smart contract's identifier, the second object's identifier, and the second smart contract's access list. After registration is complete, a connection is established between the cross-contract call processing device and the second smart contract.
[0097] Step S604: If the identity authentication of the second object fails, the cross-contract call processing device rejects the registration request of the second smart contract.
[0098] In an optional embodiment, Figure 7 A flowchart of a method for processing blockchain privacy data entry is shown, involving a first smart contract and a cross-contract call processing device. The processing steps are as follows:
[0099] Step S701: The first smart contract determines whether the data to be entered is private data. Non-private data is entered directly. If it is private data, S702 is executed.
[0100] Step S702: The first smart contract sets a binding relationship between the private data to be entered and the identity of the owner of the private data, and sends the binding relationship to the cross-contract calling device.
[0101] Step S703: The cross-contract call processing device collects the binding relationships provided by each first smart contract and records the private data and the identity information of the owner of the private data.
[0102] It should be noted that by recording the identity information of private data and the owner of the private data, the owner of the private data can be authenticated when the private data is subsequently called, thereby avoiding the problem of private data leakage and achieving the effect of improving the security of private data.
[0103] Example 2
[0104] According to an embodiment of the present invention, there is also provided an embodiment of a data sharing device based on blockchain, wherein: Figure 8 Schematic diagram of an optional data sharing device based on blockchain according to an embodiment of the present invention. Figure 8 As shown, the device includes: an acquisition module 801, a first sending module 802, a receiving module 803 and a second sending module 804.
[0105] Among them, the acquisition module 801 is used to obtain a private data request initiated by the first object based on the first smart contract, wherein the private data request includes at least the identifier of the second smart contract and the virtual reward provided by the first object to obtain the private data, and the second smart contract is used to provide private data for the first smart contract. The first smart contract and the second smart contract are deployed in the blockchain; the first sending module 802 is used to send the private data request to the second smart contract according to the identifier of the second smart contract; the receiving module 803 is used to receive the target private data provided by the second smart contract based on the virtual reward in the private data request; the second sending module is used to send the target private data to the first smart contract.
[0106] It should be noted that the above-mentioned acquisition module 801, first sending module 802, receiving module 803 and second sending module 804 correspond to steps S101 to S104 in the above-mentioned embodiment. The examples and application scenarios implemented by the four modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above-mentioned embodiment 1.
[0107] Optionally, the second smart contract is used to calculate a privacy budget based on the virtual reward and generate target privacy data based on the privacy budget, wherein the privacy budget represents the degree of publicity of the target privacy data, and the privacy budget is positively correlated with the degree of publicity of the target privacy data.
[0108] Optionally, the blockchain-based data sharing device also includes: a transfer module, used to transfer the virtual reward from the first virtual account to the second virtual account, wherein the first virtual account is the virtual account of the first object, the second virtual account is the virtual account of the second object, and the second object is the object providing the target private data.
[0109] Optionally, the blockchain-based data sharing device further includes: a determination module and a freezing module, wherein the determination module is configured to determine the first virtual account based on the identity identifier of the first object; and the freezing module is configured to freeze the virtual reward in the first virtual account.
[0110] Optionally, the transfer module further includes: a thawing module and a first transfer module, wherein the thawing module is used to thawing the frozen virtual rewards in the first virtual account; and the first transfer module is used to transfer the thawing virtual rewards from the first virtual account to the second virtual account.
[0111] Optionally, the blockchain-based data sharing device further includes: a first acquisition module and a storage module. The first acquisition module is configured to acquire a first virtual reward from the unfrozen virtual reward, wherein the first virtual reward is smaller than the unfrozen virtual reward; and the storage module is configured to store the first virtual reward in a preset virtual account.
[0112] Optionally, the blockchain-based data sharing device further includes: a second acquisition module and a second transfer module. The second acquisition module is configured to obtain an evaluation score of the first object on the target private data through the first smart contract; and the second transfer module is configured to transfer the first virtual reward from the preset virtual account to the second virtual account when the evaluation score is greater than a preset score.
[0113] Example 3
[0114] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is further provided, in which a computer program is stored, wherein the computer program is configured to execute the blockchain-based data sharing method in the above-mentioned embodiment 1 when running.
[0115] Example 4
[0116] According to another aspect of an embodiment of the present invention, a computer program product is also provided, including a computer program / instruction, which, when executed by a processor, implements the blockchain-based data sharing method in the above-mentioned embodiment 1.
[0117] Example 5
[0118] According to another aspect of an embodiment of the present invention, an electronic device is provided, comprising one or more processors; a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors are enabled to run the programs, wherein the programs are configured to execute the above-mentioned blockchain-based data sharing method when running. Figure 9 is a schematic diagram of an optional electronic device according to an embodiment of the present invention, such as Figure 9 As shown, the electronic device includes a processor, a memory, and a program stored in the memory and capable of running on the processor. When the processor executes the program, the following steps are implemented:
[0119] Obtain a private data request initiated by a first object based on a first smart contract, wherein the private data request includes at least an identifier of a second smart contract and a virtual reward provided by the first object for obtaining the private data, the second smart contract is used to provide private data to the first smart contract, and the first and second smart contracts are deployed in a blockchain; send the private data request to the second smart contract based on the identifier of the second smart contract; receive target private data provided by the second smart contract based on the virtual reward in the private data request; and send the target private data to the first smart contract.
[0120] Optionally, when executing the program, the processor further implements the following steps: the second smart contract is used to calculate the privacy budget based on the virtual reward, and generate target privacy data based on the privacy budget, wherein the privacy budget represents the degree of publicity of the target privacy data, and the privacy budget is positively correlated with the degree of publicity of the target privacy data.
[0121] Optionally, when executing the program, the processor also implements the following steps: before sending the target private data to the first smart contract, transferring the virtual reward from the first virtual account to the second virtual account, wherein the first virtual account is the virtual account of the first object, the second virtual account is the virtual account of the second object, and the second object is the object providing the target private data.
[0122] Optionally, when executing the program, the processor also implements the following steps: the privacy data request also includes the identity of the first object; before transferring the virtual reward from the first virtual account to the second virtual account, the first virtual account is determined based on the identity of the first object; and the virtual reward in the first virtual account is frozen.
[0123] Optionally, when executing the program, the processor further implements the following steps: unfreezing the frozen virtual reward in the first virtual account; and transferring the unfrozen virtual reward from the first virtual account to the second virtual account.
[0124] Optionally, when executing the program, the processor further implements the following steps: before transferring the unfrozen virtual reward from the first virtual account to the second virtual account, obtaining a first virtual reward from the unfrozen virtual reward, wherein the first virtual reward is smaller than the unfrozen virtual reward; and storing the first virtual reward in a preset virtual account.
[0125] Optionally, when executing the program, the processor also implements the following steps: after sending the target private data to the first smart contract, obtaining the evaluation score made by the first object for the target private data through the first smart contract; when the evaluation score is greater than the preset score, transferring the first virtual reward from the preset virtual account to the second virtual account.
[0126] The serial numbers of the above embodiments of the present invention are for description only and do not represent the advantages or disadvantages of the embodiments.
[0127] In the above embodiments of the present invention, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0128] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only exemplary. For example, the division of units can be a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0129] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple units. Some or all of the units may be selected to achieve the purpose of the present embodiment according to actual needs.
[0130] In addition, the functional units in the various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0131] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk, etc. Various media that can store program codes.
[0132] The above are only preferred embodiments of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A data sharing method based on blockchain, characterized in that: include: Obtaining a private data request initiated by a first object based on a first smart contract, wherein the private data request includes at least an identifier of a second smart contract and a virtual reward provided by the first object for obtaining the private data, the second smart contract being configured to provide the private data to the first smart contract, and the first and second smart contracts being deployed on a blockchain; Sending the private data request to the second smart contract according to the identifier of the second smart contract; Receiving target private data provided by the second smart contract based on the virtual reward in the private data request; Sending the target private data to the first smart contract; The method further includes: the second smart contract is used to calculate a privacy budget based on the virtual reward, and generate the target private data based on the privacy budget, wherein the privacy budget represents the degree of disclosure of the target private data, and the privacy budget is positively correlated with the degree of disclosure of the target private data; The step of generating the target private data according to the privacy budget includes generating the target private data according to the privacy budget by using a differential privacy protection method.
2. The method according to claim 1, characterized in that Before sending the target private data to the first smart contract, the method further includes: The virtual reward is transferred from a first virtual account to a second virtual account, wherein the first virtual account is the virtual account of the first object, the second virtual account is the virtual account of the second object, and the second object is the object that provides the target private data.
3. The method according to claim 2, characterized in that The private data request further includes an identity identifier of the first object. Before transferring the virtual reward from the first virtual account to the second virtual account, the method further includes: determining the first virtual account according to the identity identifier of the first object; Freeze the virtual rewards in the first virtual account.
4. The method according to claim 3, characterized in that Transferring the virtual reward from the first virtual account to the second virtual account includes: Unfreezing the frozen virtual rewards in the first virtual account; The unfrozen virtual reward is transferred from the first virtual account to the second virtual account.
5. The method according to claim 4, characterized in that Before transferring the unfrozen virtual reward from the first virtual account to the second virtual account, the method further includes: Obtaining a first virtual reward from the unfrozen virtual reward, wherein the first virtual reward is smaller than the unfrozen virtual reward; The first virtual reward is stored in a preset virtual account.
6. The method according to claim 5, characterized in that After sending the target private data to the first smart contract, the method further includes: Obtaining an evaluation score of the first object on the target private data through the first smart contract; When the evaluation score is greater than a preset score, the first virtual reward is transferred from the preset virtual account to the second virtual account.
7. A data sharing device based on blockchain, characterized in that: include: an acquisition module configured to acquire a private data request initiated by a first object based on a first smart contract, wherein the private data request includes at least an identifier of a second smart contract and a virtual reward provided by the first object for obtaining the private data, the second smart contract being configured to provide the private data to the first smart contract, and the first and second smart contracts being deployed on a blockchain; A first sending module, sending the private data request to the second smart contract according to the identifier of the second smart contract; a receiving module, configured to receive target private data provided by the second smart contract based on the virtual reward in the private data request; A second sending module sends the target private data to the first smart contract; The blockchain-based data sharing device also includes: the second smart contract is used to calculate a privacy budget based on the virtual reward, and generate the target private data based on the privacy budget, wherein the privacy budget represents the degree of publicity of the target private data, and the privacy budget is positively correlated with the degree of publicity of the target private data; wherein generating the target private data based on the privacy budget includes: generating the target private data based on the privacy budget through differential privacy protection.
8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the blockchain-based data sharing method described in any one of claims 1 to 6 when running.
9. An electronic device, characterized in that: The electronic device includes one or more processors; A memory for storing one or more programs, which, when executed by the one or more processors, enables the one or more processors to run the programs, wherein the programs are configured to execute the blockchain-based data sharing method described in any one of claims 1 to 6 when run.
10. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the blockchain-based data sharing method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Blockchain private data sharing method and device, computer equipment and storage medium
CN111935208A
Blockchain-based data circulation smart contract implementation method and system
CN113159769A