Data sharing method and device, storage medium and product
By generating consensus transactions based on reputation value and network activity on the blockchain, the problem of selfish users manipulating reputation mechanisms to manipulate shared networks is solved, and the security of data transactions is improved.
Patent Information
- Application Number
- CN202411564320.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-04
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2044-11-04
AI Technical Summary
In blockchain technology, selfish users can seek their own interests by manipulating reputation mechanisms, resulting in the risk of being manipulated by other users to share the network.
By receiving the data transaction request sent by the data requester, based on the committee node and data transaction request, the data owner participating in the transaction is selected from the blockchain, and the transaction is voted on through an authoritative organization to generate a consensus transaction. Consensus transactions are voted comprehensively based on the reputation values of data requesters and data owners, and the reputation values are inversely proportional to network activity.
It effectively avoids selfish users manipulating transactions through abnormal operations, reduces the possibility that consensus transactions are manipulated by other users in the blockchain, and improves the security of data transactions.
Smart Images

Figure CN119449825A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of blockchain technology, and in particular to a data sharing method, device, storage medium and computer program product. Background Art
[0002] Data sharing can connect many Internet and wearable devices. In any data sharing application, the most important thing is how to share data between various nodes while ensuring the privacy and security of all users participating in data sharing. Blockchain is a distributed and immutable ledger that can provide tamper-proof and decentralized functions, so it is widely used in data sharing between various users.
[0003] However, despite the potential of blockchain technology in improving security and privacy, in order to incentivize users to participate in shared networks and encourage them to cooperate, a reputation mechanism is usually used to assign certain reputation scores to each node in the blockchain. However, in this case, selfish users can manipulate the mechanism to pursue their own interests. Therefore, how to avoid being manipulated by other users in the shared network during transactions has become an urgent problem to be solved.
[0004] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention
[0005] The main purpose of this application is to provide a data sharing method, device, storage medium and computer program product, which aims to solve the technical problem in related technologies that a reputation mechanism is used to give certain reputation scores to each node in the blockchain, but in this case selfish users can manipulate the mechanism to pursue their own interests, making it easy for other users to manipulate the shared network.
[0006] To achieve the above purpose, the present application proposes a data sharing method, which includes: Receive data transaction requests sent by data requesters; Based on the committee node and the data transaction request, select the data owner who participates in the transaction from the blockchain; Receive a first transaction request sent by the data owner, and vote on the transaction corresponding to the first transaction request through an authoritative organization to generate a consensus transaction, wherein the consensus transaction is obtained through a comprehensive vote based on the reputation value of the data requester and the data owner, and the reputation value is inversely proportional to the network activity of the data requester and / or the data owner; After the consensus transaction is executed, the data corresponding to the consensus transaction is stored in the corresponding node of the blockchain through the record manager.
[0007] In one embodiment, the step of voting on the transaction corresponding to the first transaction request through an authoritative institution to generate a consensus transaction includes: Voting on the transaction corresponding to the first transaction request through an authoritative organization and a decision maker to obtain voting data; The voting data is verified and processed through a preset consensus algorithm, and a consensus transaction is generated after it is determined that all parties and decision makers in the authoritative organization have reached a consensus.
[0008] In one embodiment, before the step of obtaining voting data by voting on the transaction corresponding to the first transaction request through an authority and a decision maker, the step further includes: Obtain the number of collaborations and network activity between any data owner and data requester within a preset transaction period; Based on the network activity, calculating the reputation rate of the data owner or data requester to obtain a user reputation rate; Calculating a user reputation value based on the user reputation rate and the number of cooperation times; Assigning the user reputation value to the data owner and the data requester; The step of obtaining voting data by voting on the transaction corresponding to the first transaction request through an authority and a decision maker includes: According to the user reputation value, an authoritative organization and a decision maker vote on the transaction corresponding to the first transaction request to obtain voting data.
[0009] In one embodiment, the step of calculating the reputation rate of the data owner or data requester based on the network activity to obtain the user reputation rate includes: Based on the network activity, the reputation rate of the data owner or data requester is calculated to obtain the user reputation rate, wherein the formula of the user reputation rate is as follows:
[0010] in, For network activity, , is the preset network activity threshold, , , Indicates the three values of user credibility under different network activities.
[0011] In one embodiment, the step of verifying the voting data by a preset consensus algorithm and generating a consensus transaction after determining that all parties and decision makers in the authority have reached a consensus includes: determining voting options for parties in said authority; If the number of votes in favor of the voting option is greater than the number of votes against, it is determined that the parties and decision makers in the authority have reached a consensus and a consensus transaction is generated; If the number of affirmative votes in the voting option is equal to the number of negative votes, a target trust factor is calculated based on a preset consensus algorithm, where the target trust factor includes the first trust factor of the data owner, the second trust factor of the data requester, and the transaction trust factor corresponding to the current transaction; If it is determined that the transaction trust factor is less than a first preset threshold, the first list of personnel corresponding to the affirmative votes in the voting option and the target trust factor are sent to the leader, so that the leader can impose a reputation penalty on the first list of personnel based on the target trust factor, wherein the leader is randomly selected from the parties of the authority; If the second trust factor is greater than a second preset threshold, sending the second list of personnel corresponding to the negative votes in the voting option and the target trust factor to the leader, so that the leader can impose a reputation penalty on the second list of personnel based on the target trust factor; After the reputation penalty is executed, the consensus reached by all parties and decision makers in the authority is determined based on the ratio of votes in favor and against, and a consensus transaction is generated.
[0012] In one embodiment, the step of calculating the target trust factor based on a preset consensus algorithm includes: Based on the preset consensus algorithm, the target trust factor is calculated, wherein the calculation formula of the first trust factor of the data owner, the second trust factor of the data requester, and the transaction trust factor corresponding to the current transaction is as follows:
[0013]
[0014]
[0015] in, is the transaction trust factor, The first trust factor, is the second trust factor, is the user's credibility rate, and are the current reputations of the data owner and the data requester, respectively, is the number of all previous transactions of the data owner, The quantities of all previous transactions of the data requester are recorded.
[0016] In one embodiment, the step of storing the data corresponding to the consensus transaction in the corresponding node of the blockchain through the record manager includes: Packing the data corresponding to the consensus transaction into data blocks through the record manager; Sending the data block to the nodes in the blockchain network for consensus verification; After verification, the data block is added to the end node of the blockchain network to complete the on-chain storage of the data block.
[0017] In addition, to achieve the above objectives, the present application also proposes a data sharing device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the data sharing method described above.
[0018] In addition, to achieve the above objectives, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the data sharing method described above are implemented.
[0019] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the data sharing method described above are implemented.
[0020] The present application proposes a data sharing method, device, storage medium and computer program product. The present application receives a data transaction request from a data requester, analyzes and processes the data transaction request through a committee node, selects a data owner who participates in the transaction from the blockchain, and after receiving a first transaction request sent by the data owner, votes on the transaction corresponding to the first transaction request through an authoritative organization to generate a consensus transaction. Because the consensus transaction is obtained after a comprehensive vote based on the reputation value of the data requester and the data owner, and the reputation value is inversely proportional to the network activity of the data requester and / or the data owner, it avoids users who attempt to maximize their reputation by manipulating the system to manipulate the transaction through abnormal operations, reduces the possibility of consensus transactions being manipulated by other users in the blockchain, avoids the shared network being manipulated by other users during the transaction, and improves the security of data transactions. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0022] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0023] Figure 1 A flowchart of the first embodiment of the data sharing method of this application is provided; Figure 2 This is a schematic diagram of the data request process involved in the data sharing method of this application; Figure 3 This is a schematic diagram of the overall execution process involved in the data sharing method of this application; Figure 4 This is a schematic diagram of the overall system architecture involved in the data sharing method of this application; Figure 5 A flowchart of the second embodiment of the data sharing method of this application is provided; Figure 6 This is a schematic diagram of the module structure of the data sharing device according to an embodiment of the present application; Figure 7 Schematic diagram of the device structure of the hardware operating environment involved in the data sharing method in the embodiment of the present application.
[0024] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0025] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0026] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0027] The main solution of the embodiment of the present application is: receiving a data transaction request sent by a data requester; Based on the committee node and the data transaction request, select the data owner who participates in the transaction from the blockchain; Receive a first transaction request sent by the data owner, and vote on the transaction corresponding to the first transaction request through an authoritative organization to generate a consensus transaction, wherein the consensus transaction is obtained through a comprehensive vote based on the reputation value of the data requester and the data owner, and the reputation value is inversely proportional to the network activity of the data requester and / or the data owner; After the consensus transaction is executed, the data corresponding to the consensus transaction is stored in the corresponding node of the blockchain through the record manager.
[0028] Although blockchain technology has the potential to improve security and privacy, the complexity faced by consensus algorithms in ensuring effective blockchain verification often leads to major problems such as high energy consumption, weighted voting, high communication costs and delays. In addition, any data sharing network needs to incentivize users to participate and encourage them to cooperate. To achieve this, reputation mechanisms are usually adopted, but in this case selfish users can manipulate the mechanism for their own interests.
[0029] The present application proposes a data sharing method, device, storage medium and computer program product. The present application receives a data transaction request from a data requester, analyzes and processes the data transaction request through a committee node, selects a data owner who participates in the transaction from the blockchain, and after receiving a first transaction request sent by the data owner, votes on the transaction corresponding to the first transaction request through an authoritative organization to generate a consensus transaction. Because the consensus transaction is obtained after a comprehensive vote based on the reputation value of the data requester and the data owner, and the reputation value is inversely proportional to the network activity of the data requester and / or the data owner, it avoids users who attempt to maximize their reputation by manipulating the system to manipulate the transaction through abnormal operations, reduces the possibility of consensus transactions being manipulated by other users in the blockchain, avoids the shared network being manipulated by other users during the transaction, and improves the security of data transactions.
[0030] It should be noted that the execution subject of this embodiment may be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a data sharing device, a transaction manager, etc. The following takes the transaction manager as an example to illustrate this embodiment and the following embodiments.
[0031] Based on this, the embodiment of the present application provides a data sharing method, which is applied to a transaction manager in a data sharing system, wherein the data sharing system also includes a record manager, referring to Figure 1 , Figure 1 This is a flowchart of the first embodiment of the data sharing method of this application.
[0032] In this embodiment, the data sharing method includes steps S10 to S40: Step S10, receiving a data transaction request sent by a data requester; It should be noted that the data requester can be a user who wants to trade data. The data requester searches for the data he needs on the blockchain by issuing a data transaction request.
[0033] It should be noted that the data sharing system consists of two controllers, the transaction manager and the record manager. The transaction manager plays an intermediary role between all types of users, including data owners, requesters, authorities, and decision makers. The transaction manager is mainly used to: first, receive data from data owners and prevent suspicious data submission; second, receive requests from requesters and ensure the integrity of transactions between trusted owners and requesters. On the other hand, the record manager interacts with the database and blockchain to securely receive new data from owners and retrieve data for data requesters. Each manager consists of multiple sub-parts. The transaction manager consists of programs such as committees, transaction pools, and voting processing, while the record manager part consists of permission processing programs, blockchains, and encryption / decryption.
[0034] It should be noted that the data request process is as follows Figure 2 As shown, first, the requester sends a permission verification request, and the permission handler verifies the requester's permission. When the permission is not passed, the requester is denied access. After that, the requester accesses the encrypted data address in the blockchain. The record manager retrieves the response data from the database according to the encrypted data address provided by the requester. The retrieved data is encrypted and the original data can be restored by performing decryption processing. It is necessary to ensure that encryption is always used during the transmission process.
[0035] Step S20, based on the committee node and the data transaction request, selecting a data owner who participates in the transaction from the blockchain; It should be noted that the committee nodes can be composed of a group of fixed, trusted nodes that are generated through some kind of election or selection mechanism. The committee is responsible for performing specific tasks, such as verifying transactions, generating blocks, or participating in the consensus process.
[0036] It should be noted that after receiving a data transaction request, the transaction manager will broadcast the required data as a message among the data owners on the blockchain. The data owner who meets the requirements and responds first becomes the selected data owner, provides the requested data, and is responsible for generating the corresponding transaction.
[0037] Step S30, receiving the first transaction request sent by the data owner, and voting on the transaction corresponding to the first transaction request through an authoritative organization to generate a consensus transaction, wherein the consensus transaction is obtained after comprehensive voting based on the reputation value of the data requester and the data owner, and the reputation value is inversely proportional to the network activity of the data requester and / or the data owner; It should be noted that when the data owner determines that data transaction is needed, he / she sends the first transaction request to the transaction manager. The authoritative agency is in the alliance chain or private chain scenario, and when blockchain technology is applied to regulated fields such as finance and law, external regulatory agencies (such as governments, central banks, industry associations, etc.) will supervise and manage blockchain projects. These regulatory agencies ensure the compliance of blockchain projects by formulating rules, reviewing transactions, and imposing penalties. Therefore, they are also important authoritative agencies in the blockchain ecosystem.
[0038] It should be noted that the transaction corresponding to the first transaction request is voted on by an authoritative agency to determine whether to allow it to conduct normal transactions to avoid the occurrence of abnormal transactions. The consensus transaction includes the transaction data obtained after the authoritative agency and other decision makers reach a consensus, and also includes the transaction result corresponding to whether to determine whether to conduct the transaction, where the transaction result can be approval of the transaction or disapproval of the transaction.
[0039] It should be noted that both the data requester and the data owner will have corresponding reputation values. In existing blockchains, a common way is for two users to generate a large number of false transactions with each other in a short period of time to improve their reputations and show that they are active participants on the network. In order to reduce the possibility of such manipulation, we adopt a reputation granting scheme as follows:
[0040] Among them, M represents the reputation value, It is a critical trading period The number of collaborations between a certain owner and requester is equivalent to the user's network activity. Therefore, the formula is set to reflect that the reputation value is inversely proportional to the network activity. is the protection factor, for Initial transaction within =1), the user gets higher reputation, as the number of transactions in P increases (e.g. =10), between any two participants, the reputation value is reduced due to the previous transaction, so The value can be optimally determined based on the data traffic of a specific application. The credibility rate.
[0041] It should be noted that reputation values are also assigned to other users, authorities, and decision-makers. Granting reputation means giving a certain amount of trust or recognition to these authorities and decision-makers. In this case, reputation can be regarded as an evaluation standard used to measure the performance, professional ability, or integrity of an organization or individual in a specific field. By granting reputation to authorities and decision-makers, people can rely on their decisions, suggestions, or behaviors with greater confidence.
[0042] In a feasible implementation manner, the step S20 of voting on the transaction corresponding to the first transaction request by an authoritative institution to generate a consensus transaction includes: Voting on the transaction corresponding to the first transaction request through an authoritative organization and a decision maker to obtain voting data; It should be noted that the authorities and decision makers are pre-selected based on their reputation, and the decision maker's obligation is to ensure the honest behavior of the authority by monitoring its activities. Similarly, the authority is responsible for verifying the transaction based on the reputation of the owner and requester.
[0043] It should be noted that during the voting process, the decision is made jointly by authoritative agencies. When the authoritative agencies cannot reach a consensus, the decision maker will make a decision on the transaction to determine whether to approve the transaction.
[0044] It should be noted that the voting data may be the approval or disapproval votes cast by various authoritative organizations.
[0045] The voting data is verified and processed through a preset consensus algorithm, and a consensus transaction is generated after it is determined that all parties and decision makers in the authoritative organization have reached a consensus.
[0046] It should be noted that the preset consensus algorithm is a key step to verify and confirm the validity and correctness of data sharing transactions. When data requesters make data requests or data owners contribute data, these transactions are first added to the transaction pool. Then, these transactions are verified by the consensus algorithm to ensure the legitimacy and reliability of the transactions.
[0047] During the verification process, the verification process is composed of trust factors. guide. It shows the security of the transaction, which consists of three important factors: transaction trust factor , Owner Trust Factor and the requester trust factor These factors are used by the authority when validating any transaction, and after consensus is reached among all parties in the authority, a consensus transaction is generated.
[0048] In a feasible implementation, the step of verifying the voting data by a preset consensus algorithm and generating a consensus transaction after determining that all parties and decision makers in the authority have reached a consensus includes: determining voting options for parties in said authority; If the number of votes in favor of the voting option is greater than the number of votes against, it is determined that the parties and decision makers in the authority have reached a consensus and a consensus transaction is generated; It should be noted that the voting options include affirmative votes and negative votes. When the affirmative votes are greater than the negative votes, it can be determined that the transaction is passed, that is, the transaction can be executed. Conversely, when the affirmative votes are less than the negative votes, it can be determined that the transaction is rejected and cannot be executed.
[0049] If the number of affirmative votes in the voting option is equal to the number of negative votes, a target trust factor is calculated based on a preset consensus algorithm, where the target trust factor includes the first trust factor of the data owner, the second trust factor of the data requester, and the transaction trust factor corresponding to the current transaction; It should be noted that when the number of votes in favor and against is equal, the target trust factor is calculated through the preset consensus algorithm. The target trust factor shows the security of the transaction. It is composed of three important factors: transaction trust factor , the first trust factor and the second trust factor .
[0050] In a feasible implementation, the step of calculating the target trust factor based on a preset consensus algorithm includes: Based on the preset consensus algorithm, the target trust factor is calculated, wherein the calculation formula of the first trust factor of the data owner, the second trust factor of the data requester, and the transaction trust factor corresponding to the current transaction is as follows:
[0051]
[0052]
[0053] in, is the transaction trust factor, The first trust factor, is the second trust factor, is the user's credibility rate, and are the current reputations of the data owner and the data requester, respectively, is the number of all previous transactions of the data owner, The quantities of all previous transactions of the data requester are recorded.
[0054] It should be noted that when an authority approves a <1), the decision maker verifies such activity to confirm the decision. If dishonest activity is suspected, the authority is penalized by reducing the reputation value. >1). Through this process, the decision maker can monitor the validation decisions of each authority and ensure that only honest authorities are rewarded.
[0055] In another embodiment, considering that the current trust factor is calculated based on static rules, in order to make it dynamically adjustable, we define the current activity of the network in combination with the actual situation. , recent transaction success rate and the number of dishonest behaviors detected , based on the above parameters, define the dynamic adjustment coefficient of the owner's trust factor and the dynamic adjustment coefficient of the requester's trust factor :
[0056]
[0057] in, and is the base adjustment factor of the owner trust factor and the requester trust factor; , and Represents activity, transaction success rate and detected dishonest behavior and the extent of the impact; and They represent the benchmark values of activity and transaction success rate respectively.
[0058] In calculating and After that, we can further get In the real-time process of dynamically adjusting strategies, continuously monitor the status of the network and the results of transactions, and regularly adjust , , , and and other parameters to ensure the effectiveness of the dynamic adjustment strategy.
[0059]
[0060]
[0061]
[0062] If it is determined that the transaction trust factor is less than a first preset threshold, the first list of personnel corresponding to the affirmative votes in the voting option and the target trust factor are sent to the leader, so that the leader can impose a reputation penalty on the first list of personnel based on the target trust factor, wherein the leader is randomly selected from the parties of the authority; It should be noted that the first preset threshold value may be 1 or other data, and is not specifically limited. Taking the first preset threshold value as 1 as an example, the following steps are performed: If the number of votes in favor = the number of votes against, execute: Leader Decision Making if <1, execute: Save the members who voted in favor to the list The list and Send to Leader If there is any penalty, then: Reduce reputation from list members.
[0063] If the second trust factor is greater than a second preset threshold, sending the second list of personnel corresponding to the negative votes in the voting option and the target trust factor to the leader, so that the leader can impose a reputation penalty on the second list of personnel based on the target trust factor; It should be noted that the second preset threshold may be 3 or other data, and is not specifically limited. Taking the second preset threshold as 3 as an example, the following steps are performed: if >3. Execute: Save members who voted against to the list Send List and For Leaders If there is any penalty, Reduce reputation from list members.
[0064] After the reputation penalty is executed, the consensus reached by all parties and decision makers in the authority is determined based on the ratio of votes in favor and against, and a consensus transaction is generated.
[0065] It should be noted that when the two votes are the same, according to the size of the trust factor, the members who voted in favor or against will be punished, and their reputation will be reduced, thereby resetting the ratio of votes in favor and against. The data sharing system in this application enhances security through two management sub-parts. In the transaction manager, users must obtain a high reputation to be included in the group of potential authorities and have the possibility of becoming a randomly selected leader. This approach significantly reduces the possibility of self-attacks. Even in the case of malicious users among the validators, most authorities will decide to accept or cancel the transaction. In addition, during the voting process, the trust factor helps to identify misbehaving authorities. In the record manager, the permission handler module adds the approved transaction to the user's permission list. Even if the blockchain is attacked and the data address information is accessed, the record manager will cancel the data retrieval for those users who do not have the corresponding data ID in the permission list.
[0066] Specifically, the consensus voting algorithm can execute the following process:
[0067] Step S40, after the consensus transaction is executed, the data corresponding to the consensus transaction is stored in the corresponding node of the blockchain through the record manager.
[0068] It should be noted that after the consensus transaction is executed, the transaction data generated by the formula transaction is stored through the record manager and stored in the corresponding node on the blockchain, making the transaction traceable.
[0069] In a feasible implementation, the step S40 of storing the data corresponding to the consensus transaction in the corresponding node of the blockchain through the record manager includes: Packing the data corresponding to the consensus transaction into data blocks through the record manager; It should be noted that the data blocks may be in the form of data packets, which are packaged into data packets to facilitate storage of the data.
[0070] Sending the data block to the nodes in the blockchain network for consensus verification; It should be noted that after packaging is completed, the data block needs to be verified by consensus to confirm that it is a transaction approved by an authoritative agency after voting, which is equivalent to legality certification. Only after the certification is completed can the data block be stored on the blockchain.
[0071] After verification, the data block is added to the end node of the blockchain network to complete the on-chain storage of the data block.
[0072] It should be noted that the purpose of adding the data block to the end node of the blockchain network is that each new data block contains a reference to the previous block (usually through a hash value), and this chain structure ensures the continuity of the data. Adding new blocks to the end makes the entire blockchain a growing chain, ensuring that all transaction records from the genesis block to the current block are continuous and complete.
[0073] Once data is added to the blockchain, it is almost impossible to tamper with or delete it. This is because to modify the data of a block, all blocks after it need to be modified at the same time, which is computationally infeasible. Therefore, new blocks are continuously added to the end to enhance the immutability of the data.
[0074] Specifically, in the transaction manager component module, the committee is a useful tool to connect data owners and requesters. The main processes of the transaction manager are as follows: Figure 3 shown.
[0075] The requester transmits a data request containing specific requirements and types to the transaction manager, and the committee then broadcasts the required data as messages among data owners.
[0076] The data owner who meets the requirements and responds first becomes the selected data owner, provides the requested data, and is responsible for generating the corresponding transaction.
[0077] Each transaction should contain the encrypted identities of the data owner and the data requester, and provide information about the relevant data storage location. The data storage location will be provided to the corresponding data owner so that data can be found more quickly during future sharing.
[0078] After validating the received transactions, the committee will forward such transactions to the voting handler. The voting handler performs the validation process by sending transactions to the authorities. When the authorities reach a consensus, rewards may be distributed among all participating authorities based on their contributions, while authorities that did not participate in any consensus process will not receive rewards. If the voting handler observes dishonest activities among the authorities, the decider will verify the response of each authority and verify the previous record in combination with its trust factor. Similarly, for transactions that cannot reach consensus due to voting disagreements, the decider will make the final decision on whether such transactions should be approved.
[0079] Specifically, Figure 4As shown, the system architecture in this application consists of two controllers, the "Transaction Manager" and the "Record Manager". The transaction manager plays an intermediary role between all types of users, including data owners, requesters, authorities, and decision makers. The transaction manager is mainly used for: first, receiving data from data owners and preventing suspicious data submission; second, receiving requests from requesters and ensuring the integrity of transactions between trusted owners and requesters. On the other hand, the record manager interacts with the database and blockchain, securely receives new data from owners, and retrieves data for data requesters. Each manager consists of multiple sub-parts. The transaction manager consists of programs such as the committee, transaction pool, and voting processing, while the record manager part consists of permission processing programs, blockchain, and encryption / decryption.
[0080] In another embodiment, the overall execution algorithm flow chart is as follows:
[0081] The present application proposes a data sharing method, device, storage medium and computer program product. The present application receives a data transaction request from a data requester, analyzes and processes the data transaction request through a committee node, selects a data owner who participates in the transaction from the blockchain, and after receiving a first transaction request sent by the data owner, votes on the transaction corresponding to the first transaction request through an authoritative organization to generate a consensus transaction. Because the consensus transaction is obtained after a comprehensive vote based on the reputation value of the data requester and the data owner, and the reputation value is inversely proportional to the network activity of the data requester and / or the data owner, it avoids users who attempt to maximize their reputation by manipulating the system to manipulate the transaction through abnormal operations, reduces the possibility of consensus transactions being manipulated by other users in the blockchain, avoids the shared network being manipulated by other users during the transaction, and improves the security of data transactions.
[0082] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 5 , before the step of voting on the transaction corresponding to the first transaction request through the authority and the decision maker to obtain the voting data, it also includes: Step S200, obtaining the number of collaborations and network activity between any data owner and data requester within a preset transaction time period; It should be noted that the preset trading time period can be 1 day, 2 days, etc., without specific limitation.
[0083] It should be noted that the number of collaborations refers to the number of transactions between the two parties and the level of activity on the blockchain network.
[0084] Step S210, calculating the reputation rate of the data owner or data requester based on the network activity to obtain a user reputation rate; It should be noted that the user's credibility rate varies with different network activity levels, and the user's credibility rate can reflect the user's level of trust over a period of time.
[0085] In a feasible implementation manner, the step S210 of calculating the reputation rate of the data owner or data requester based on the network activity to obtain the user reputation rate includes: Based on the network activity, the reputation rate of the data owner or data requester is calculated to obtain the user reputation rate, wherein the formula of the user reputation rate is as follows:
[0086] in, For network activity, , is the preset network activity threshold, , , Indicates the three values of user credibility under different network activities.
[0087] It should be noted that in practical applications, it is necessary to dynamically adjust it according to the network activity. Specifically, a mapping function from activity to reputation can be defined. ,in For network activity, Mainly realize dynamic credit adjustment. It can be expressed as:
[0088] When A is below a certain threshold hour, Can be set to a higher value , to encourage user participation; when A and In between, Can be maintained at a baseline value ; When A is higher than hour, Can be set to a lower value A is based on the data collected from the network over the past period of time to make reasonable plans, and based on historical data analysis and business needs, sets a preliminary and Threshold. It should be set in an area with low network activity, It should be set in an area with high network activity.
[0089] To avoid Sudden changes in the value have an impact on network stability. This article uses polynomial interpolation to define the relationship between the reputation rate β and the network activity A, as shown below:
[0090] In practical applications, in order to avoid Sudden changes in the value affect the stability of the network. This paper designs the network activity To credit rate The mapping function When , polynomial interpolation is used for dynamic adjustment, which can be specifically expressed as follows: First, set the interpolation conditions: hour, ;when hour, , then define:
[0091] The coefficient of determination and , the above two interpolation conditions need to be met, and substitution can be obtained:
[0092]
[0093] Can get
[0094]
[0095] In summary:
[0096] Step S220, calculating the user reputation value based on the user reputation rate and the number of cooperations; It should be noted that the user reputation value can be calculated as follows:
[0097] in, During the scheduled trading period The number of collaborations between an owner and a requester within a . is the protection factor. Initial transaction within =1), the user gets higher reputation. As the number of transactions in P increases (e.g. =10), between any two participants, the reputation value is reduced due to the previous transaction, so The value can be optimally determined based on the data traffic of a specific application. The credibility rate.
[0098] Specifically, a prediction model can also be used to obtain the optimal reputation value. A prediction model can be trained based on time series analysis using historical data to predict network activity and user behavior patterns in the future, thereby dynamically adjusting the reputation rate or reputation value to adapt to changes in the network environment.
[0099] Step S230, assigning the user reputation value to the data owner and the data requester; It should be noted that the user reputation value is assigned to the data owner and the data requester to determine the reputation value of both parties to the data transaction, so as to comprehensively judge whether to agree to the transaction between the two parties based on the reputation value.
[0100] It should be noted that before a consensus vote is conducted, this reputation granting scheme can also be used to grant reputation values to authoritative institutions or decision makers to determine whether they can become a voting member, thereby increasing the credibility of the voting results.
[0101] The step of obtaining voting data by voting on the transaction corresponding to the first transaction request through an authority and a decision maker includes: According to the user reputation value, an authoritative organization and a decision maker vote on the transaction corresponding to the first transaction request to obtain voting data.
[0102] It should be noted that after assigning user reputation values to data requesters and data owners, the authority is responsible for verifying the transaction based on the reputation of the owner and requester, and combining various trust factors to obtain more accurate voting results.
[0103] In this embodiment, this adaptive method is used to grant reputation to each user, and the relationship between the reputation rate β and the network activity A is defined by using polynomial interpolation, and the user's reputation value is dynamically adjusted to prevent other users from manipulating the shared network for their own interests.
[0104] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the data sharing method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0105] This application also provides a data sharing device, please refer to Figure 6 , the data sharing device comprises: The receiving module 10 is used to receive a data transaction request sent by a data requester; A selection module 20, configured to select a data owner who participates in the transaction from the blockchain based on the committee node and the data transaction request; A voting module 30 is used to receive the first transaction request sent by the data owner, and vote on the transaction corresponding to the first transaction request through an authority to generate a consensus transaction, wherein the consensus transaction is obtained through a comprehensive vote based on the reputation value of the data requester and the data owner, and the reputation value is inversely proportional to the network activity of the data requester and / or the data owner; The storage module 40 is used to store the data corresponding to the consensus transaction in the corresponding node of the blockchain through the record manager after the consensus transaction is executed.
[0106] Optionally, the voting module includes: A voting unit, configured to vote on the transaction corresponding to the first transaction request through an authority and a decision maker to obtain voting data; The processing unit is used to verify the voting data through a preset consensus algorithm, and generate a consensus transaction after it is determined that all parties and decision makers in the authoritative organization have reached a consensus.
[0107] Optionally, the voting module further includes: An acquisition unit, used to acquire the number of collaborations and network activity between any data owner and data requester within a preset transaction time period; A first calculation unit, configured to calculate a reputation rate for the data owner or the data requester based on the network activity to obtain a user reputation rate; A second calculation unit, configured to calculate a user reputation value based on the user reputation rate and the number of cooperation times; The assigning unit is used to assign the user reputation value to the data owner and the data requester.
[0108] Optionally, the first computing unit includes: The first calculation subunit is used to calculate the reputation rate of the data owner or the data requester based on the network activity to obtain the user reputation rate, wherein the formula of the user reputation rate is as follows:
[0109] in, For network activity, , is the preset network activity threshold, , , Indicates the three values of user credibility under different network activities.
[0110] Optionally, the processing unit includes: A first determination subunit, configured to determine voting options of each party in the authority; A second determination subunit is used to determine that all parties and decision makers in the authority have reached a consensus and generate a consensus transaction if the number of affirmative votes in the voting option is greater than the number of negative votes; A second calculation subunit is configured to calculate a target trust factor based on a preset consensus algorithm if the number of affirmative votes in the voting option is equal to the number of negative votes, wherein the target trust factor includes the first trust factor of the data owner, the second trust factor of the data requester, and the transaction trust factor corresponding to the current transaction; A first sending subunit is configured to send a first list of personnel corresponding to the affirmative votes in the voting option and the target trust factor to a leader if it is determined that the transaction trust factor is less than a first preset threshold, so that the leader can perform a reputation penalty on the first list of personnel based on the target trust factor, wherein the leader is randomly selected from the parties of the authority; A second sending subunit is configured to send a second list of personnel corresponding to negative votes in the voting option and the target trust factor to the leader if the second trust factor is greater than a second preset threshold, so that the leader can impose a reputation penalty on the second list of personnel based on the target trust factor; The generation subunit is used to determine the consensus reached by all parties and decision makers in the authority and generate a consensus transaction based on the ratio of votes in favor and against after the reputation penalty is executed.
[0111] Optionally, the second computing subunit includes: A calculation component is used to calculate the target trust factor based on a preset consensus algorithm, wherein the calculation formula of the first trust factor of the data owner, the second trust factor of the data requester, and the transaction trust factor corresponding to the current transaction is as follows:
[0112]
[0113]
[0114] in, is the transaction trust factor, The first trust factor, is the second trust factor, is the user's credibility rate, and are the current reputations of the data owner and the data requester, respectively, is the number of all previous transactions of the data owner, The quantities of all previous transactions of the data requester are recorded.
[0115] Optionally, the storage module includes: A packaging unit, used for packaging the data corresponding to the consensus transaction into data blocks through the record manager; A consensus verification unit, used to send the data block to a node in the blockchain network for consensus verification; The adding unit is used to add the data block to the end node of the blockchain network after the verification is passed to complete the on-chain storage of the data block.
[0116] The data sharing device provided by the present application adopts the data sharing method in the above embodiment to solve the technical problem of data sharing. Compared with the prior art, the beneficial effects of the data sharing device provided by the present application are the same as the beneficial effects of the data sharing method provided by the above embodiment, and other technical features in the data sharing device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0117] The present application provides a data sharing device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the data sharing method in the above-mentioned embodiment 1.
[0118] Reference below Figure 5 , which shows a schematic diagram of the structure of a data sharing device suitable for implementing the embodiment of the present application. The data sharing device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The data sharing device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0119] like Figure 5As shown, the data sharing device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the data sharing device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the data sharing device to communicate with other devices wirelessly or by wire to exchange data. Although the data sharing device with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.
[0120] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0121] The data sharing device provided by the present application adopts the data sharing method in the above embodiment to solve the technical problem of data sharing. Compared with the prior art, the beneficial effects of the data sharing device provided by the present application are the same as the beneficial effects of the data sharing method provided by the above embodiment, and the other technical features in the data sharing device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0122] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0123] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0124] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, wherein the computer-readable program instructions are used to execute the data sharing method in the above-mentioned embodiment.
[0125] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.
[0126] The computer-readable storage medium may be included in the data sharing device; or may exist independently without being assembled into the data sharing device.
[0127] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the data sharing device, the data sharing device: Receive data transaction requests sent by data requesters; Based on the committee node and the data transaction request, select the data owner who participates in the transaction from the blockchain; Receive a first transaction request sent by the data owner, and vote on the transaction corresponding to the first transaction request through an authoritative organization to generate a consensus transaction, wherein the consensus transaction is obtained through a comprehensive vote based on the reputation value of the data requester and the data owner, and the reputation value is inversely proportional to the network activity of the data requester and / or the data owner; After the consensus transaction is executed, the data corresponding to the consensus transaction is stored in the corresponding node of the blockchain through the record manager.
[0128] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0129] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0130] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0131] The readable storage medium provided in this application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned data sharing method, and can solve the technical problem of data sharing. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the data sharing method provided in the above-mentioned embodiment, and will not be described in detail here.
[0132] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned data sharing method when executed by a processor.
[0133] The computer program product provided by this application can solve the technical problem of data sharing. Compared with the prior art, the beneficial effects of the computer program product provided by this application are the same as the beneficial effects of the data sharing method provided by the above embodiment, which will not be repeated here.
[0134] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A data sharing method, characterized in that: A transaction manager applied to a data sharing system, wherein the data sharing system further comprises a record manager, wherein the method comprises: Receive data transaction requests sent by data requesters; Based on the committee node and the data transaction request, select the data owner who participates in the transaction from the blockchain; Receive a first transaction request sent by the data owner, and vote on the transaction corresponding to the first transaction request through an authoritative organization to generate a consensus transaction, wherein the consensus transaction is obtained through a comprehensive vote based on the reputation value of the data requester and the data owner, and the reputation value is inversely proportional to the network activity of the data requester and / or the data owner; After the consensus transaction is executed, the data corresponding to the consensus transaction is stored in the corresponding node of the blockchain through the record manager.
2. The method according to claim 1, characterized in that The step of voting on the transaction corresponding to the first transaction request through an authoritative institution to generate a consensus transaction includes: Voting on the transaction corresponding to the first transaction request through an authoritative organization and a decision maker to obtain voting data; The voting data is verified and processed through a preset consensus algorithm, and a consensus transaction is generated after it is determined that all parties and decision makers in the authoritative organization have reached a consensus.
3. The method according to claim 2, characterized in that Before the step of voting on the transaction corresponding to the first transaction request through an authority and a decision maker to obtain voting data, the method further includes: Obtain the number of collaborations and network activity between any data owner and data requester within a preset transaction period; Based on the network activity, calculating the reputation rate of the data owner or data requester to obtain a user reputation rate; Calculating a user reputation value based on the user reputation rate and the number of cooperation times; Assigning the user reputation value to the data owner and the data requester; The step of obtaining voting data by voting on the transaction corresponding to the first transaction request through an authority and a decision maker includes: According to the user reputation value, an authoritative organization and a decision maker vote on the transaction corresponding to the first transaction request to obtain voting data.
4. The method according to claim 3, characterized in that The step of calculating the reputation rate of the data owner or data requester based on the network activity to obtain the user reputation rate includes: Based on the network activity, the reputation rate of the data owner or data requester is calculated to obtain the user reputation rate, wherein the formula of the user reputation rate is as follows: in, For network activity, , is the preset network activity threshold, , , Indicates the three values of user credibility under different network activities.
5. The method according to claim 2, characterized in that The step of verifying the voting data by using a preset consensus algorithm and generating a consensus transaction after determining that all parties and decision makers in the authoritative organization have reached a consensus includes: determining voting options for parties in said authority; If the number of votes in favor of the voting option is greater than the number of votes against, it is determined that the parties and decision makers in the authority have reached a consensus and a consensus transaction is generated; If the number of affirmative votes in the voting option is equal to the number of negative votes, a target trust factor is calculated based on a preset consensus algorithm, where the target trust factor includes the first trust factor of the data owner, the second trust factor of the data requester, and the transaction trust factor corresponding to the current transaction; If it is determined that the transaction trust factor is less than a first preset threshold, the first list of personnel corresponding to the affirmative votes in the voting option and the target trust factor are sent to the leader, so that the leader can impose a reputation penalty on the first list of personnel based on the target trust factor, wherein the leader is randomly selected from the parties of the authority; If the second trust factor is greater than a second preset threshold, sending the second list of personnel corresponding to the negative votes in the voting option and the target trust factor to the leader, so that the leader can impose a reputation penalty on the second list of personnel based on the target trust factor; After the reputation penalty is executed, the consensus reached by all parties and decision makers in the authority is determined based on the ratio of votes in favor and against, and a consensus transaction is generated.
6. The method according to claim 5, characterized in that The step of calculating the target trust factor based on the preset consensus algorithm includes: Based on the preset consensus algorithm, the target trust factor is calculated, wherein the calculation formula of the first trust factor of the data owner, the second trust factor of the data requester, and the transaction trust factor corresponding to the current transaction is as follows: in, is the transaction trust factor, The first trust factor is is the second trust factor, is the user's credibility rate, and are the current reputations of the data owner and the data requester, respectively, is the number of all previous transactions of the data owner, The quantities of all previous transactions of the data requester are recorded.
7. The method according to claim 1, characterized in that The step of storing the data corresponding to the consensus transaction in the corresponding node of the blockchain through the record manager includes: Packing the data corresponding to the consensus transaction into data blocks through the record manager; Sending the data block to the nodes in the blockchain network for consensus verification; After verification, the data block is added to the end node of the blockchain network to complete the on-chain storage of the data block.
8. A data sharing device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the data sharing method according to any one of claims 1 to 7.
9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the data sharing method according to any one of claims 1 to 7 are implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the data sharing method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Reputation-based PBFT consensus system and method, and block chain data processing system
CN109767199A
High-credibility science and technology service transaction method based on block chain
CN112036908A
Block chain consensus mechanism based on credibility model
CN113313378A
Block chain consensus method, block chain system and computer equipment
CN113326516A
Block chain system based on node reputation mechanism and operation method thereof
CN114172680A