Data sharing method, device, equipment and readable storage medium based on blockchain
By acquiring and transferring virtual assets on the blockchain, the problem of low data viewing efficiency in the existing technology is solved, and automated resource data transfer and permission management are realized, improving the efficiency of data viewing.
Patent Information
- Application Number
- CN201911115036.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-11-14
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2039-12-10
AI Technical Summary
In the prior art, when users view shared data that needs to be provided with virtual assets, they need to manually transfer virtual resources, resulting in low data viewing efficiency.
Using a blockchain-based data sharing method, by obtaining the target multimedia data sent by the user equipment, and by triggering a smart contract based on the data reading request, automatically obtaining and transferring the required resource data, generating blocks and rolling them, and granting reading permissions.
It improves the automation of resource data transfer, simplifies the user's permission process for obtaining multimedia data, and improves the efficiency of data viewing.
Smart Images

Figure CN110909314B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a blockchain-based data sharing method, device, equipment and readable storage medium. Background Art
[0002] With the rise of the sharing economy in the Internet era, free knowledge sharing can no longer meet people's needs, because the invisible knowledge possessed by individuals often requires a long period of accumulation or research, and they are usually unwilling to share this knowledge with others for free. Then paid high-value knowledge sharing has gradually become a demand. Sharers can get virtual asset rewards after sharing data, and readers need to provide corresponding virtual assets to read the shared data.
[0003] In the prior art, when users view shared data that requires virtual assets, they are often required to enter a password to transfer the virtual assets, and can only view the data after the transfer is completed. The manual transfer of virtual resources makes viewing data inefficient.
[0004] Application Contents
[0005] The embodiments of the present application provide a blockchain-based data sharing method, device, equipment, and readable storage medium, which can improve the automation of resource data transfer and thereby improve the efficiency of data viewing.
[0006] On the one hand, an embodiment of the present application provides a data sharing method based on blockchain, including:
[0007] Acquire target multimedia data sent by a first user device, and upload the target multimedia data to a blockchain; the first user device corresponds to first user information;
[0008] Acquire a data reading request sent by a second user device; the data reading request is used to request to read the target multimedia data provided by the first user device; the second user device corresponds to second user information;
[0009] Based on the data reading request, triggering a smart contract, and determining consumption resources required for reading the target multimedia data according to the smart contract;
[0010] Acquire first resource data belonging to the second user information according to the consumed resources, and generate first data transfer information of the second user information for the first user information according to the first resource data;
[0011] Generate a first block according to the first data transfer information, the first user information, the second user information, the target multimedia data, and the smart contract;
[0012] If the first block is successfully uploaded to the blockchain, it is determined that the first user information has the right to use the first resource data, and the second user information is assigned the right to read the target multimedia data.
[0013] The step of obtaining the target multimedia data sent by the first user equipment and uploading the target multimedia data to the blockchain includes:
[0014] Acquire the target multimedia data sent by the first user equipment;
[0015] Generate a target block to be added to the blockchain according to the target multimedia data and the first user information;
[0016] Broadcasting the target block to all blockchain consensus nodes on the blockchain;
[0017] When it is determined that a consensus is reached among all the blockchain consensus nodes on the blockchain, the target block is added to the blockchain.
[0018] The step of generating a target block to be added to the blockchain according to the target multimedia data and the first user information includes:
[0019] Obtain a block with a maximum generation timestamp from the blockchain as a parent block;
[0020] Performing hash calculation on the target multimedia data to obtain a hash value of the target block;
[0021] Obtaining a parent block hash value of the parent block;
[0022] Constructing a Merkle tree according to the target multimedia data and the first user information;
[0023] Based on the parent block hash value, the Merkle tree, the hash value of the target block, the target multimedia data, and the first user information, the target block to be added to the blockchain is generated.
[0024] The acquiring of first resource data belonging to the second user information according to the consumed resources, and generating first data transfer information of the second user information for the first user information according to the first resource data, includes:
[0025] Acquire first resource data belonging to the second user information according to the consumed resource, and generate transaction data according to the first resource data, the public key of the transfer object, the source account address of the first resource data, and the account address of the transfer object;
[0026] Sign the transaction data according to the private key of the second user information to obtain a user signature;
[0027] The transaction data and the user signature are encapsulated as the first data transfer information.
[0028] The acquiring first resource data corresponding to the second user information according to the consumed resources, and generating first data transfer information of the second user information for the first user information according to the first resource data, includes:
[0029] Acquire first resource data belonging to the second user information according to the consumed resource, and generate transaction data according to the first resource data, the public key of the transfer object, the source account address of the first resource data, and the account address of the transfer object;
[0030] Sending the transaction data to the second user terminal, so that the second user terminal signs the transaction data based on a private key to obtain a user signature;
[0031] Acquire the user signature sent by the second user terminal, verify the user signature based on the public key of the second user information, and determine the legitimacy of the transaction data when the verification passes;
[0032] When the transaction data is legitimate data, the transaction data and the user signature are encapsulated as the first data transfer information.
[0033] The source account address is the account address of the source user; the source user is the user who has transferred the historical resource data to the second user information; the account address of the transfer object includes the account address of the sharing platform and the account address of the first user information;
[0034] Then, determining that the first user information has the permission to use the first resource data includes:
[0035] It is determined that the first user information has the right to use the user-allocated resource data, and it is determined that the sharing platform has the right to use the platform-allocated resource data; the first resource data is the sum of the user-allocated resource data and the platform-allocated resource data.
[0036] Among them, it also includes:
[0037] If the target multimedia data is successfully uploaded to the blockchain, the smart contract is called to determine the reward resources corresponding to the target multimedia data according to the smart contract;
[0038] Acquire second resource data belonging to the sharing platform according to the reward resource, and generate second data transfer information of the sharing platform for the first user information according to the second resource data;
[0039] Generate a second block according to the second data transfer information, the first user information, the information of the sharing platform, the target multimedia data, and the smart contract;
[0040] If the second block is successfully uploaded to the blockchain, it is determined that the first user information has the right to use the second resource data.
[0041] On the one hand, an embodiment of the present application provides a data sharing device based on blockchain, including:
[0042] An uplink module, used to obtain target multimedia data sent by a first user device, and to upload the target multimedia data to a blockchain; the first user device corresponds to first user information;
[0043] an acquisition module, configured to acquire a data reading request sent by a second user device; the data reading request is used to request reading of the target multimedia data provided by the first user device; and the second user device corresponds to second user information;
[0044] A first determination module, configured to trigger a smart contract based on the data reading request, and determine, according to the smart contract, the consumption resources required for reading the target multimedia data;
[0045] A first generating module, configured to obtain first resource data belonging to the second user information according to the consumed resources, and generate first data transfer information of the second user information for the first user information according to the first resource data;
[0046] A second generating module, configured to generate a first block according to the first data transfer information, the first user information, the second user information, the target multimedia data, and the smart contract;
[0047] A second determination module, configured to determine that the first user information has the right to use the first resource data if the first block is successfully uploaded to the blockchain;
[0048] An allocating module is used to allocate the reading authority for the target multimedia data to the second user information.
[0049] Wherein, the uplink module includes:
[0050] an acquiring unit, configured to acquire the target multimedia data sent by the first user equipment;
[0051] A first generating unit, configured to generate a target block to be added to the blockchain according to the target multimedia data and the first user information;
[0052] A broadcast unit, used to broadcast the target block to all blockchain consensus nodes on the blockchain;
[0053] An adding unit is used to add the target block to the blockchain when it is determined that a consensus is reached among all the blockchain consensus nodes on the blockchain.
[0054] Wherein, the first generating unit includes:
[0055] An acquisition subunit, used to acquire a block with a maximum generation timestamp from the blockchain as a parent block;
[0056] A calculation subunit, configured to perform a hash calculation on the target multimedia data to obtain a hash value of the target block;
[0057] The acquisition subunit is further used to obtain the parent block hash value of the parent block;
[0058] A construction subunit, configured to construct a Merkle tree according to the target multimedia data and the first user information;
[0059] A generating subunit is used to generate the target block to be added to the blockchain based on the parent block hash value, the Merkle tree, the hash value of the target block, the target multimedia data and the first user information.
[0060] Wherein, the first generation module includes:
[0061] a second generating unit, configured to obtain first resource data belonging to the second user information according to the consumed resources, and generate transaction data according to the first resource data, a public key of a transfer object, a source account address of the first resource data, and an account address of the transfer object;
[0062] A first signature unit, used to sign the transaction data according to the private key of the second user information to obtain a user signature;
[0063] The first encapsulation unit is used to encapsulate the transaction data and the user signature into the first data transfer information.
[0064] Wherein, the first generation module includes:
[0065] a third generating unit, configured to obtain first resource data belonging to the second user information according to the consumed resources, and generate transaction data according to the first resource data, a public key of a transfer object, a source account address of the first resource data, and an account address of the transfer object;
[0066] A second signing unit, configured to send the transaction data to the second user terminal, so that the second user terminal signs the transaction data based on a private key to obtain a user signature;
[0067] a verification unit, configured to obtain the user signature sent by the second user terminal, verify the user signature based on the public key of the second user information, and determine the legitimacy of the transaction data when the verification passes;
[0068] The second encapsulation unit is used to encapsulate the transaction data and the user signature into the first data transfer information when the transaction data is legal data.
[0069] The source account address is the account address of the source user; the source user is the user who has transferred the historical resource data to the second user information; the account address of the transfer object includes the account address of the sharing platform and the account address of the first user information;
[0070] The second determining module includes:
[0071] The first determination unit is used to determine whether the first user information has the right to use the user-allocated resource data, and whether the shared platform has the right to use the platform-allocated resource data; the first resource data is the sum of the user-allocated resource data and the platform-allocated resource data.
[0072] Wherein, the second determining module further includes:
[0073] A calling unit, configured to call the smart contract if the target multimedia data is successfully uploaded to the blockchain, and determine the reward resources corresponding to the target multimedia data according to the smart contract;
[0074] A fourth generating unit, configured to obtain second resource data belonging to the sharing platform according to the reward resource, and generate second data transfer information of the sharing platform for the first user information according to the second resource data;
[0075] The fourth generating unit is further used to generate a second block according to the second data transfer information, the first user information, the information of the sharing platform, the target multimedia data and the smart contract;
[0076] The second determination unit is used to determine that the first user information has the right to use the second resource data if the second block is successfully uploaded to the blockchain.
[0077] An embodiment of the present application provides a computer device, including: a processor and a memory;
[0078] The memory stores a computer program, and when the computer program is executed by the processor, the processor executes the method in the embodiment of the present application.
[0079] On the one hand, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the method in the embodiment of the present application is executed.
[0080] The embodiment of the present application obtains target multimedia data sent by a first user device and links the target multimedia data to a blockchain; the first user device corresponds to first user information; obtains a data reading request sent by a second user device; the data reading request is used to request to read the target multimedia data provided by the first user device; the second user device corresponds to second user information; based on the data reading request, a smart contract is triggered, and the consumed resources required for reading the target multimedia data are determined according to the smart contract; first resource data belonging to the second user information is obtained according to the consumed resources, and first data transfer information of the second user information for the first user information is generated according to the first resource data; a first block is generated according to the first data transfer information, the first user information, the second user information, the target multimedia data and the smart contract; if the first block is successfully linked to the blockchain, it is determined that the first user information has the right to use the first resource data, and the reading right for the target multimedia data is allocated to the second user. From the above, it can be seen that by obtaining the user's resource data, generating blocks based on the resource data and uploading them to the chain, the resource data can be automatically transferred. If the user wants to have the authority to read multimedia data, there is no need to enter the transfer password of the resource data. Only a data reading request is needed to read the multimedia data. This can improve the automation of resource data transfer and thus improve the efficiency of data viewing. BRIEF DESCRIPTION OF THE DRAWINGS
[0081] In order to more clearly illustrate the embodiments of the present invention 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, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0082] Figure 1 This is a network architecture diagram provided by an embodiment of the present application;
[0083] Figure 2a It is a scenario diagram of a data sharing method provided in an embodiment of the present application;
[0084] Figure 2b is a scenario diagram of another data sharing method provided in an embodiment of the present application;
[0085] Figure 3 This is a flowchart of a data sharing method based on blockchain provided in an embodiment of the present application;
[0086] Figure 4 It is a schematic diagram of a process for generating data transfer information provided by an embodiment of the present application;
[0087] Figure 5 is another flow chart of generating data transfer information provided by an embodiment of the present application;
[0088] Figure 6 This is a schematic diagram of a scenario provided by an embodiment of the present application;
[0089] Figure 7a This is another scenario schematic diagram provided by an embodiment of the present application;
[0090] Figure 7b This is another scenario schematic diagram provided by an embodiment of the present application;
[0091] Figure 8 This is a schematic diagram of the structure of a data sharing device based on blockchain provided in an embodiment of the present application;
[0092] Fig. 9 It is a structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0093] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0094] Figure 1 This is a network architecture diagram provided by an embodiment of the present application. Figure 1 As shown, the network architecture may include a blockchain node and a user terminal cluster, and the user terminal cluster may include multiple user terminals, such as Figure 1As shown, it may specifically include user terminal 100a, user terminal 100b, user terminal 100c, ..., user terminal 100n.
[0095] like Figure 1 As shown, user terminal 100a, user terminal 100b, user terminal 100c, ..., user terminal 100n can respectively establish a network connection with the blockchain node, so that each user terminal can interact with the blockchain node through the network connection.
[0096] like Figure 1 As shown, each user terminal in the user terminal cluster may be integrated with a target application. When the target application is running in each user terminal, it may be respectively connected to the above Figure 1 The target application may include an application with data information functions such as displaying text, images, audio, and video.
[0097] The embodiments of the present application can be Figure 1 A user terminal is selected from the multiple user terminals shown as the target user terminal, and the target user terminal may include: a smart phone, a tablet computer, a desktop computer, or other smart terminal with a function of displaying and playing data information. Figure 1 The user terminal 100a shown serves as the target user terminal, and the above-mentioned target application can be integrated into the target user terminal. At this time, the target user terminal can realize data interaction with the blockchain node through the business data platform corresponding to the target application.
[0098] Please also see Figure 2a , is a schematic diagram of a scenario of a data sharing method provided in an embodiment of the present application. Figure 2a In the example, user terminal 100a can be a first user device. After the first user accesses the target application in user terminal 100a, he can enter and upload the data that the first user wants to share (such as the method of playing chess, the method of baking salmon, etc.) in the target application. The data shared by the first user here is the target multimedia data. The user terminal 100a can send the target multimedia data to the blockchain node, and the blockchain node then adds the multimedia data to block 1001 in the blockchain 100 to complete the chain-up process of the multimedia data. That is to say, after being chained, the multimedia data is stored in the blockchain 100.
[0099] Please also see Figure 2b , is a schematic diagram of another data sharing method provided in an embodiment of the present application. Figure 2bIn the example, the user terminal 100b may be a second user device. After the second user accesses the target application in the user terminal 100b, the second user may request to read all multimedia data in the target application. For example, the second user may request to read Figure 2a The user terminal 100b sends the reading request to the blockchain node. After the blockchain node obtains the reading request, it can obtain block 1001 from the blockchain 100, and the multimedia data can be obtained on block 1001. Based on the multimedia data, the blockchain node can determine the consumable resources required to read the multimedia data. The consumable resources here can refer to funds, points, coupons, or electronic coins, etc. Subsequently, the blockchain node can obtain the resource data of the second user (that is, the consumable resources required to read the multimedia data) from the user terminal 100b. For example, if it takes 5 reading coins to read the multimedia data, the blockchain node can obtain 5 reading coins from the user terminal 100b. In terminal 100b, 5 reading coins of the second user are obtained; according to the resource data, the blockchain node can generate data transfer information, and the data transfer information is used to represent that the second user transfers the resource data to the first user. The blockchain node generates block 1002 based on the data transfer information, the information of the first user, the information of the second user, the multimedia data and the smart contract of the blockchain. If the block 1002 is successfully uploaded to the blockchain 100, it indicates that the resource data of the second user has been successfully transferred to the first user, and the first user has the right to use the resource data. Then, the blockchain node can assign the second user the right to read the multimedia data, and the second user can read the multimedia data.
[0100] See also Figure 3 , is a flowchart of a data sharing method based on blockchain provided in an embodiment of the present application. Figure 3 As shown, the data sharing method may include:
[0101] Step S101, obtaining target multimedia data sent by a first user device, and uploading the target multimedia data to a blockchain; the first user device corresponds to first user information.
[0102] In the present application, the target multimedia data may include contents such as pictures, documents, text, audio and video. The target multimedia data may be the experience knowledge shared by the first user based on the first user device, and may be entered and filled in by the first user in the target application (such as sharing platform A) in the first user device. For example, the first user shared the experience of "how to use JS to extract the last three characters" in the target application of the first user device, and the experience is the target multimedia data.
[0103] The first user device can send the target multimedia data to the blockchain node. The blockchain node can generate a target block to be added to the blockchain based on the target multimedia data and the information of the first user. The blockchain node broadcasts the target block to all other blockchain consensus nodes on the blockchain. When it is determined that all blockchain consensus nodes have reached a consensus, the blockchain node adds the target block to the blockchain.
[0104] Among them, the process of the blockchain node generating a target block to be added to the blockchain based on the target multimedia data and the information of the first user can be that the blockchain node obtains the block with the maximum generation timestamp from the blockchain (that is, the latest generated block on the blockchain) as the parent block, and obtains the hash value of the parent block. The blockchain node performs hash calculation on the target multimedia data to obtain the hash value of the target block. The blockchain node can construct a Merkle tree based on the multimedia data and the first user information, and can generate the target block based on the parent block hash value, the Merkle tree, the hash value of the target block, the target multimedia data and the first user information.
[0105] Step S102, obtaining a data reading request sent by a second user device; the data reading request is used to request reading of the target multimedia data provided by the first user device; the second user device corresponds to second user information.
[0106] In the present application, the second user can select the multimedia data that he wants to read in the target application of the second user device, and the second user device can send the reading request of the second user to the blockchain node.
[0107] Step S103: triggering a smart contract based on the data reading request, and determining the consumption resources required for reading the target multimedia data according to the smart contract.
[0108] In the present application, the consumable resources may be funds, points, electronic coins, coupons, etc., and the consumable resources are determined by the data type of the multimedia data. For example, the consumable resources of multimedia data whose data type is common sense type are lower than the consumable resources of multimedia data whose data type is artificial intelligence type, because the data type level of common sense type is lower than that of artificial intelligence type.
[0109] Step S104: acquiring first resource data belonging to the second user information according to the consumed resources, and generating first data transfer information of the second user information for the first user information according to the first resource data.
[0110] In the present application, the first resource data here corresponds to the consumable resources of the target multimedia data requested by the second user to read. The resource data can be funds or points or electronic coins or coupons, etc. The blockchain node can obtain the first resource data of the second user from the second user device based on the consumable resources of the target multimedia data. For example, if the consumable resources required for the target multimedia data requested by the second user to read are 2 yuan, the blockchain node can obtain 2 yuan from the second user's account in the second user device, and 2 yuan is the first resource data of the second user. Subsequently, the blockchain node generates data transfer information of the second user information for the first user information based on the first resource data. The data transfer information is used to characterize that the first resource data of the second user has been obtained, and the first resource data is transferred to the first user who sent the target multimedia data. Among them, for the specific implementation method of generating the first data transfer information, please refer to the subsequent Figure 4 or Figure 5 The description in the corresponding embodiment.
[0111] Step S105: generating a first block according to the first data transfer information, the first user information, the second user information, the target multimedia data and the smart contract.
[0112] Step S106: If the first block is successfully uploaded to the blockchain, it is determined that the first user information has the right to use the first resource data, and the second user information is assigned the right to read the target multimedia data.
[0113] In the present application, the blockchain node can upload the first block to the chain. If the first block is uploaded to the chain successfully, it can be determined that the first resource data of the second user has been successfully transferred to the first user. The blockchain node can then determine that the first user has the right to use the first resource data. The blockchain node can then assign reading permissions to the second user so that the second user can read the target multimedia data.
[0114] Among them, determining that the first user information has the right to use the first resource data here can include determining that the sharing platform has the right to use the allocated resource data and determining that the first user has the right to use the allocated resource data, that is, the first resource data is the sum of the first user's allocated resource data and the platform's allocated resource data. The blockchain node can allocate the first resource data according to the allocation ratio so that the sharing platform and the first user have part of the resource data of the first resource data. It can be understood that the blockchain node obtains the first resource data (10 yuan), and can allocate part of the resource data (3 yuan) of the first resource data to the sharing platform so that the sharing platform has the right to the part of the resource data. The blockchain node can allocate the remaining part of the resource data (7 yuan) of the first resource data to the first user so that the first user has the right to the remaining part of the resource data. Here, the allocation ratio between the sharing platform and the first user is 3:7. Among them, the resource data allocation ratio between the sharing platform and the first user can be 0:1 or 2:8. This application does not limit the resource data allocation ratio between the sharing platform and the first user.
[0115] The embodiment of the present application obtains target multimedia data sent by a first user device and links the target multimedia data to a blockchain; the first user device corresponds to first user information; obtains a data reading request sent by a second user device; the data reading request is used to request to read the target multimedia data provided by the first user device; the second user device corresponds to second user information; based on the data reading request, a smart contract is triggered, and the consumed resources required for reading the target multimedia data are determined according to the smart contract; first resource data belonging to the second user information is obtained according to the consumed resources, and first data transfer information of the second user information for the first user information is generated according to the first resource data; a first block is generated according to the first data transfer information, the first user information, the second user information, the target multimedia data and the smart contract; if the first block is successfully linked to the blockchain, it is determined that the first user information has the right to use the first resource data, and the reading right for the target multimedia data is allocated to the second user. From the above, it can be seen that by obtaining the user's resource data, generating blocks based on the resource data and uploading them to the chain, the resource data can be automatically transferred. If the user wants to have the authority to read multimedia data, there is no need to enter the transfer password of the resource data. Only a data reading request is needed to read the multimedia data. This can improve the automation of resource data transfer and thus improve the efficiency of data viewing.
[0116] Further, please participate Figure 4 , is a schematic diagram of a process for generating data transfer information provided by an embodiment of the present application. Figure 4As shown, the process may include:
[0117] Step S201, obtaining first resource data belonging to the second user information according to the consumed resources, and generating transaction data according to the first resource data, the public key of the transfer object, the source account address of the first resource data, and the account address of the transfer object.
[0118] In the present application, the source account address of the first resource data may be the account address of the source user, and the source user may be the user who has transferred historical resource data to the second user. For example, user A is the second user, the first resource data is 10 yuan, and the blockchain node obtains 10 yuan from user A's account. The 10 yuan is transferred from user Q to user A, then user Q is the source user, and user Q's account is the source account address. The transfer object may include a sharing platform and a first user, and the sharing platform is a platform for the first user and the second user to share or read multimedia data. The account address of the transfer object may include the account address of the sharing platform and the account address of the first user. The blockchain node may encrypt the first resource data to generate a ciphertext according to the public key of the transfer object. When the transfer object receives the encrypted first resource data, it needs to decrypt and verify the ciphertext through the private key of the transfer object. Only after the decryption is successful can the first resource data be used. The blockchain node can generate transaction data with the ciphertext and the source account address of the first resource data and the account address of the transfer object.
[0119] Step S202: Sign the transaction data according to the private key of the second user information to obtain a user signature.
[0120] In the present application, the blockchain node has the public key and private key of the second user. The blockchain node can use the private key to sign the transaction data to obtain the user signature information.
[0121] Step S203: encapsulate the transaction data and the user signature into the first data transfer information.
[0122] In the present application, the blockchain node can encapsulate the transaction data and the user signature information, and determine the encapsulated result as the first data transfer information.
[0123] The embodiment of the present application acquires target multimedia data sent by a first user device and links the target multimedia data to a blockchain; the first user device corresponds to first user information; acquires a data reading request sent by a second user device; the data reading request is used to request to read the target multimedia data provided by the first user device; the second user device corresponds to second user information; based on the data reading request, a smart contract is triggered, and the consumed resources required for reading the target multimedia data are determined according to the smart contract; first resource data belonging to the second user information is acquired according to the consumed resources, and first data transfer information of the second user information for the first user information is generated according to the first resource data; a first block is generated according to the first data transfer information, the first user information, the second user information, the target multimedia data and the smart contract; if the first block is successfully linked to the blockchain, it is determined that the first user information has the right to use the first resource data, and the reading right for the target multimedia data is allocated to the second user. From the above, it can be seen that by obtaining the user's resource data, generating blocks based on the resource data and uploading them to the chain, the resource data can be automatically transferred. If the user wants to have the authority to read multimedia data, there is no need to enter the transfer password of the resource data. Only a data reading request is needed to read the multimedia data. This can improve the automation of resource data transfer and thus improve the efficiency of data viewing.
[0124] For further information, see Figure 5 , is another flow chart of generating data transfer information provided by an embodiment of the present application. Figure 5 As shown, the process may include:
[0125] Step S301, obtaining first resource data belonging to the second user information according to the consumed resources, and generating transaction data according to the first resource data, the public key of the transfer object, the source account address of the first resource data, and the account address of the transfer object.
[0126] The specific implementation of step S301 can be found in the above Figure 4 The step S201 in the corresponding embodiment will not be described in detail here.
[0127] Step S302: Send the transaction data to the second user terminal, so that the second user terminal signs the transaction data based on a private key to obtain a user signature.
[0128] In this application, the blockchain node has the public key of the second user, but does not have the private key of the second user, and the second user terminal needs to use the private key to sign the transaction data. The blockchain node can send the transaction data to the second user terminal, so that the second user terminal signs the transaction data based on the private key of the second user to obtain user signature information.
[0129] Step S303: Acquire the user signature sent by the second user terminal, verify the user signature based on the public key of the second user information, and determine the legitimacy of the transaction data when the verification passes.
[0130] In the present application, the second user terminal can send the user signature information to the blockchain node, and the blockchain node can verify the user signature information based on the public key of the second user to determine whether the transaction data is legal data.
[0131] Step S304: When the transaction data is legitimate data, encapsulate the transaction data and the user signature into the first data transfer information.
[0132] In the present application, if the above-mentioned verification is passed, the transaction data is determined to be legal data, and the blockchain node can encapsulate the legal transaction data with the user signature information, and determine the encapsulated result as the first data transfer information.
[0133] The embodiment of the present application obtains target multimedia data sent by a first user device and links the target multimedia data to a blockchain; the first user device corresponds to first user information; obtains a data reading request sent by a second user device; the data reading request is used to request to read the target multimedia data provided by the first user device; the second user device corresponds to second user information; based on the data reading request, a smart contract is triggered, and the consumed resources required for reading the target multimedia data are determined according to the smart contract; first resource data belonging to the second user information is obtained according to the consumed resources, and first data transfer information of the second user information for the first user information is generated according to the first resource data; a first block is generated according to the first data transfer information, the first user information, the second user information, the target multimedia data and the smart contract; if the first block is successfully linked to the blockchain, it is determined that the first user information has the right to use the first resource data, and the reading right for the target multimedia data is allocated to the second user. From the above, it can be seen that by obtaining the user's resource data, generating blocks based on the resource data and uploading them to the chain, the resource data can be automatically transferred. If the user wants to have the authority to read multimedia data, there is no need to enter the transfer password of the resource data. Only a data reading request is needed to read the multimedia data. This can improve the automation of resource data transfer and thus improve the efficiency of data viewing.
[0134] See also Figure 6 , is a schematic diagram of a scenario provided by an embodiment of the present application. Figure 6 As shown, user A can be the first user. User A can input the data he wants to share in the sharing platform of the user terminal. As shown in the figure, user A can view the data classification in the sharing platform in the display interface 1000a. User A can choose any type to view. In the display interface 1000a, user A can also click the publish button M to publish the data. After user A clicks the publish button M, the interface jumps from the display interface 1000a to the display interface 1000b. User A can select the content type of the data to be published in the display interface. The options include text, pictures, and videos. As shown in the figure, user A can select text, and the interface jumps from display 1000b to display interface 1000c. User A can enter the content he wants to publish in the input box. After user A completes the input and chooses to publish, the user terminal can send the data input by user A to the blockchain node, and the blockchain node can link the data to the blockchain so that the data is saved in the blockchain. Among them, the specific implementation method of the blockchain node linking the data to the blockchain can be referred to above. Figure 3 The step S101 in the corresponding embodiment will not be described in detail here.
[0135] like Figure 6As shown, user B can be the second user. User B can select any multimedia data in display interface 2000 for reading. As shown in the figure, user B selects the data "How to Cook Shredded Pork with Green Peppers" published by user A above, and the interface jumps from display interface 2000 to display interface 2000b. User B can view part of the content of the data in display interface 2000b. User B can view the remaining content of the data by clicking the Continue Reading button. User B clicks the Continue Reading button, and the user terminal generates a data reading request and sends the data reading request to the blockchain node. The blockchain node obtains the data from the blockchain and the consumed resources required to read the data, and generates data transfer information of user B for user A based on the consumed resources. The blockchain node can generate blocks based on the data transfer information, user A's information, user B's information and the data. If the blockchain is successfully uploaded, the blockchain node can assign the reading authority of the data to user B. After obtaining the reading authority, user B can read the entire content of the data in display interface 2000c. Among them, the specific implementation method of generating data transfer information of user B for user A based on the consumed resources can be referred to above Figure 4 or Figure 5 The description in the corresponding embodiment will not be repeated here; the specific implementation method of the blockchain node assigning reading permissions to user B can be found in the above Figure 3 Steps S105 and S106 in the corresponding embodiment will not be described in detail here.
[0136] See also Figure 7a , is another scenario diagram provided by the embodiment of the present application. Figure 7a As shown, user C can be the first user. User C can send the target multimedia data to the blockchain node through the user device. The blockchain node can calculate the hash value of the target multimedia data. The blockchain node can query the hash values of all blocks in the blockchain 100. If there is a hash value consistent with the hash value of the target multimedia data, such as the hash value of block 1006 is consistent with the hash value of the target multimedia data, then the blockchain node can determine that the multimedia data in block 1006 is the same data as the target multimedia data. Then the blockchain node can determine that user C has plagiarized and can send a warning message to user C to remind user C that plagiarism is strictly prohibited.
[0137] Optionally, if there is no hash value identical to the target multimedia data in the blockchain 100, the target multimedia data can be successfully uploaded to the blockchain. Since all blocks in the blockchain 100 have an uploaded timestamp, user C can use the timestamp to protect his legal rights. For example, if user C finds that other users' data have a lot of similar content to user C's target multimedia data, that is, other users have copied user C's data and uploaded it to the sharing platform to benefit, because the uploaded timestamp of user C's data is earlier than the uploaded timestamp of other users' data, it can be determined that user C is the original creator of the data, and user C can complain to the sharing platform to protect his rights and interests.
[0138] For further information, see Figure 7b , is another scenario diagram provided by the embodiment of the present application. Figure 7b As shown, user C sends the target multimedia data to the blockchain node through the user device. After the blockchain node successfully uploads the target multimedia data to the blockchain 100, the blockchain node can call the smart contract and determine the reward resource corresponding to the target multimedia data based on the smart contract. The reward resource can be money or points. Based on the reward resource, the blockchain node can obtain the second resource data belonging to the sharing platform from the resource database. For example, if the reward resource of the target multimedia data is 6 points, the blockchain node can obtain 6 points from the resource database, and the 6 points are the second resource data; the blockchain node can generate the second data transfer information of the sharing platform for the user C according to the second resource data, and the second data transfer information is used to represent that the sharing platform transfers the second resource data to the user C. Subsequently, the blockchain node can generate block 1009 according to the second data transfer information, the information of the user C, the information of the sharing platform, the target multimedia data and the smart contract. The blockchain node can add the block 1009 to the blockchain 100. If the addition is successful, the upload is successful, and it can be determined that the user C has received the reward resource and the user C has the right to use the second resource data.
[0139] For further information, see Figure 8 , is a schematic diagram of a data sharing device based on blockchain provided in an embodiment of the present application. Figure 8 As shown, the data sharing device 1 may include: an uplink module 11 , an acquisition module 12 , a first determination module 13 , a first generation module 14 , a second generation module 15 , a second determination module 16 and an allocation module 17 .
[0140] The uplink module 11 is used to obtain the target multimedia data sent by the first user device and upload the target multimedia data to the blockchain; the first user device corresponds to the first user information;
[0141] An acquisition module 12 is used to acquire a data reading request sent by a second user device; the data reading request is used to request to read the target multimedia data provided by the first user device; the second user device corresponds to second user information;
[0142] A first determination module 13, configured to trigger a smart contract based on the data reading request, and determine the consumption resources required for reading the target multimedia data according to the smart contract;
[0143] A first generating module 14 is configured to obtain first resource data belonging to the second user information according to the consumed resources, and generate first data transfer information of the second user information for the first user information according to the first resource data;
[0144] A second generating module 15, configured to generate a first block according to the first data transfer information, the first user information, the second user information, the target multimedia data and the smart contract;
[0145] A second determination module 16 is configured to determine that the first user information has the right to use the first resource data if the first block is successfully uploaded to the blockchain;
[0146] The allocating module 17 is configured to allocate the reading authority for the target multimedia data to the second user information.
[0147] The specific implementation of the uplink module 11, the acquisition module 12, the first determination module 13, the first generation module 14, the second generation module 15, the second determination module 16 and the allocation module 17 can be referred to above. Figure 3 Steps S101 to S107 in the corresponding embodiment will not be described in detail here.
[0148] See also Figure 8 The uplink module 11 may include: an acquisition unit 111, a first generation unit 112, a broadcast unit 113 and an adding unit 114.
[0149] An acquiring unit 111 is configured to acquire the target multimedia data sent by the first user equipment;
[0150] A first generating unit 112, configured to generate a target block to be added to the blockchain according to the target multimedia data and the first user information;
[0151] A broadcast unit 113, configured to broadcast the target block to all blockchain consensus nodes on the blockchain;
[0152] The adding unit 114 is used to add the target block to the blockchain when it is determined that a consensus is reached among all the blockchain consensus nodes on the blockchain.
[0153] The specific implementation of the acquisition unit 111, the first generation unit 112, the broadcast unit 113 and the adding unit 114 can refer to the above Figure 4 The step S101 in the corresponding embodiment will not be described in detail here.
[0154] See also Figure 8 The first generating unit 112 may include: an acquiring subunit 1121 , a calculating subunit 1122 , a constructing subunit 1123 , and a generating subunit 1124 .
[0155] An acquisition subunit 1121 is used to acquire a block with a maximum generation timestamp from the blockchain as a parent block;
[0156] A calculation subunit 1122, configured to perform a hash calculation on the target multimedia data to obtain a hash value of the target block;
[0157] The acquisition subunit 1121 is further used to acquire the parent block hash value of the parent block;
[0158] A construction subunit 1123, configured to construct a Merkle tree according to the target multimedia data and the first user information;
[0159] The generating subunit 1124 is used to generate the target block to be added to the blockchain based on the parent block hash value, the Merkle tree, the hash value of the target block, the target multimedia data and the first user information.
[0160] The specific implementation of the acquisition subunit 1121, the calculation subunit 1122, the construction subunit 1123 and the generation subunit 1124 can be found in the above Figure 3 The step S101 in the corresponding embodiment will not be described in detail here.
[0161] See also Figure 8 The first generation module 14 may include: a second generation unit 141, a first signature unit 142 and a first encapsulation unit 143.
[0162] The second generating unit 141 is used to obtain the first resource data belonging to the second user information according to the consumed resources, and generate transaction data according to the first resource data, the public key of the transfer object, the source account address of the first resource data and the account address of the transfer object;
[0163] A first signing unit 142, configured to sign the transaction data according to the private key of the second user information to obtain a user signature;
[0164] The first encapsulation unit 143 is configured to encapsulate the transaction data and the user signature into the first data transfer information.
[0165] The specific implementation of the second generation unit 141, the first signature unit 142 and the first encapsulation unit 143 can be found in the above Figure 4 Steps S201 to S203 in the corresponding embodiment will not be described in detail here.
[0166] See also Figure 8 The first generation module 14 may include: a third generation unit 144, a second signature unit 145, a verification unit 146 and a second encapsulation unit 147.
[0167] The third generating unit 144 is used to obtain the first resource data belonging to the second user information according to the consumed resources, and generate transaction data according to the first resource data, the public key of the transfer object, the source account address of the first resource data and the account address of the transfer object;
[0168] The second signing unit 145 is used to send the transaction data to the second user terminal, so that the second user terminal signs the transaction data based on a private key to obtain a user signature;
[0169] a verification unit 146, configured to obtain the user signature sent by the second user terminal, verify the user signature based on the public key of the second user information, and determine the legitimacy of the transaction data when the verification passes;
[0170] The second encapsulation unit 147 is used to encapsulate the transaction data and the user signature into the first data transfer information when the transaction data is legal data.
[0171] The specific implementation of the third generation unit 144, the second signature unit 145, the verification unit 146 and the second packaging unit 147 can be found in the above Figure 5 Steps S301 to S304 in the corresponding embodiment will not be described in detail here.
[0172] See also Figure 8 , the second determining module 16 may include: a first determining unit 161.
[0173] The first determination unit 161 is used to determine whether the first user information has the right to use the user-allocated resource data, and whether the sharing platform has the right to use the platform-allocated resource data; the first resource data is the sum of the user-allocated resource data and the platform-allocated resource data.
[0174] The specific implementation of the first determining unit 161 can refer to the above Figure 1 Step S106 in the corresponding embodiment will not be described in detail here.
[0175] See also Figure 8 The second determining module 16 may include a first determining unit 161 , and may also include: a calling unit 162 , a fourth generating unit 163 and a second determining unit 164 .
[0176] A calling unit 162 is configured to call the smart contract if the target multimedia data is successfully uploaded to the blockchain, and determine the reward resources corresponding to the target multimedia data according to the smart contract;
[0177] A fourth generating unit 163 is configured to obtain second resource data belonging to the sharing platform according to the reward resource, and generate second data transfer information of the sharing platform for the first user information according to the second resource data;
[0178] The fourth generating unit 163 is further configured to generate a second block according to the second data transfer information, the first user information, the information of the sharing platform, the target multimedia data and the smart contract;
[0179] The second determining unit 164 is used to determine that the first user information has the right to use the second resource data if the second block is successfully uploaded to the blockchain.
[0180] The specific implementation of the calling unit 162, the fourth generating unit 163 and the second determining unit 164 can refer to the above Figure 7b The description of the process from obtaining reward resources to allocating usage rights in the corresponding embodiment will not be repeated here.
[0181] The embodiment of the present application obtains target multimedia data sent by a first user device and links the target multimedia data to a blockchain; the first user device corresponds to first user information; obtains a data reading request sent by a second user device; the data reading request is used to request to read the target multimedia data provided by the first user device; the second user device corresponds to second user information; based on the data reading request, a smart contract is triggered, and the consumed resources required for reading the target multimedia data are determined according to the smart contract; first resource data belonging to the second user information is obtained according to the consumed resources, and first data transfer information of the second user information for the first user information is generated according to the first resource data; a first block is generated according to the first data transfer information, the first user information, the second user information, the target multimedia data and the smart contract; if the first block is successfully linked to the blockchain, it is determined that the first user information has the right to use the first resource data, and the reading right for the target multimedia data is allocated to the second user. From the above, it can be seen that by obtaining the user's resource data, generating blocks based on the resource data and uploading them to the chain, the resource data can be automatically transferred. If the user wants to have the authority to read multimedia data, there is no need to enter the transfer password of the resource data. Only a data reading request is needed to read the multimedia data. This can improve the automation of resource data transfer and thus improve the efficiency of data viewing.
[0182] For further information, see Fig. 9 , is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. Fig. 9 As shown above Figure 8 The device 1 in the corresponding embodiment can be applied to the computer device 1000, and the computer device 1000 may include: a processor 1001, a network interface 1004 and a memory 1005. In addition, the computer device 1000 also includes: a user interface 1003, and at least one communication bus 1002. The communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display) and a keyboard (Keyboard), and the user interface 1003 may optionally include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or a non-volatile memory (non-volatile memory), such as at least one disk storage. The memory 1005 may optionally also be at least one storage device located away from the aforementioned processor 1001. Fig. 9As shown, the memory 1005 as a computer-readable storage medium may include an operating system, a network communication module, a user interface module, and a device control application program.
[0183] exist Fig. 9 In the computer device 1000 shown, the network interface 1004 can provide a network communication function; the user interface 1003 is mainly used to provide an input interface for the user; and the processor 1001 can be used to call the device control application stored in the memory 1005 to achieve:
[0184] Acquire target multimedia data sent by a first user device, and upload the target multimedia data to a blockchain; the first user device corresponds to first user information;
[0185] Acquire a data reading request sent by a second user device; the data reading request is used to request to read the target multimedia data provided by the first user device; the second user device corresponds to second user information;
[0186] Based on the data reading request, triggering a smart contract, and determining consumption resources required for reading the target multimedia data according to the smart contract;
[0187] Acquire first resource data belonging to the second user information according to the consumed resources, and generate first data transfer information of the second user information for the first user information according to the first resource data;
[0188] Generate a first block according to the first data transfer information, the first user information, the second user information, the target multimedia data, and the smart contract;
[0189] If the first block is successfully uploaded to the blockchain, it is determined that the first user information has the right to use the first resource data, and the second user information is assigned the right to read the target multimedia data.
[0190] In one embodiment, when the processor 1001 executes the steps of obtaining the target multimedia data sent by the first user equipment and uploading the target multimedia data to the blockchain, the processor 1001 specifically performs the following steps:
[0191] Acquire the target multimedia data sent by the first user equipment;
[0192] Generate a target block to be added to the blockchain according to the target multimedia data and the first user information;
[0193] Broadcasting the target block to all blockchain consensus nodes on the blockchain;
[0194] When it is determined that a consensus is reached among all the blockchain consensus nodes on the blockchain, the target block is added to the blockchain.
[0195] In one embodiment, when the processor 1001 generates a target block to be added to the blockchain according to the target multimedia data and the first user information, the processor 1001 specifically performs the following steps:
[0196] Obtain a block with a maximum generation timestamp from the blockchain as a parent block;
[0197] Performing hash calculation on the target multimedia data to obtain a hash value of the target block;
[0198] Obtaining a parent block hash value of the parent block;
[0199] Constructing a Merkle tree according to the target multimedia data and the first user information;
[0200] Based on the parent block hash value, the Merkle tree, the hash value of the target block, the target multimedia data, and the first user information, the target block to be added to the blockchain is generated.
[0201] In one embodiment, when the processor 1001 executes the steps of acquiring first resource data belonging to the second user information according to the consumed resources and generating first data transfer information of the second user information for the first user information according to the first resource data, the processor 1001 specifically performs the following steps:
[0202] Acquire first resource data belonging to the second user information according to the consumed resource, and generate transaction data according to the first resource data, the public key of the transfer object, the source account address of the first resource data, and the account address of the transfer object;
[0203] Sign the transaction data according to the private key of the second user information to obtain a user signature;
[0204] The transaction data and the user signature are encapsulated as the first data transfer information.
[0205] In one embodiment, when the processor 1001 executes the steps of acquiring the first resource data corresponding to the second user information according to the consumed resources and generating the first data transfer information of the second user information for the first user information according to the first resource data, the processor 1001 specifically performs the following steps:
[0206] Acquire first resource data belonging to the second user information according to the consumed resource, and generate transaction data according to the first resource data, the public key of the transfer object, the source account address of the first resource data, and the account address of the transfer object;
[0207] Sending the transaction data to the second user terminal, so that the second user terminal signs the transaction data based on a private key to obtain a user signature;
[0208] Acquire the user signature sent by the second user terminal, verify the user signature based on the public key of the second user information, and determine the legitimacy of the transaction data when the verification passes;
[0209] When the transaction data is legitimate data, the transaction data and the user signature are encapsulated as the first data transfer information.
[0210] In one embodiment, the source account address is the account address of the source user; the source user is the user who has transferred the historical resource data to the second user information; the account address of the transfer object includes the account address of the sharing platform and the account address of the first user information;
[0211] When the processor 1001 performs the step of determining whether the first user information has the right to use the first resource data, the following steps may be performed:
[0212] It is determined that the first user information has the right to use the user-allocated resource data, and it is determined that the sharing platform has the right to use the platform-allocated resource data; the first resource data is the sum of the user-allocated resource data and the platform-allocated resource data.
[0213] In one embodiment, the processor 1001 further performs the following steps:
[0214] If the target multimedia data is successfully uploaded to the blockchain, the smart contract is called to determine the reward resources corresponding to the target multimedia data according to the smart contract;
[0215] Acquire second resource data belonging to the sharing platform according to the reward resource, and generate second data transfer information of the sharing platform for the first user information according to the second resource data;
[0216] Generate a second block according to the second data transfer information, the first user information, the information of the sharing platform, the target multimedia data, and the smart contract;
[0217] If the second block is successfully uploaded to the blockchain, it is determined that the first user information has the right to use the second resource data.
[0218] The embodiment of the present application acquires target multimedia data sent by a first user device and links the target multimedia data to a blockchain; the first user device corresponds to first user information; acquires a data reading request sent by a second user device; the data reading request is used to request to read the target multimedia data provided by the first user device; the second user device corresponds to second user information; based on the data reading request, a smart contract is triggered, and the consumed resources required for reading the target multimedia data are determined according to the smart contract; first resource data belonging to the second user information is acquired according to the consumed resources, and first data transfer information of the second user information for the first user information is generated according to the first resource data; a first block is generated according to the first data transfer information, the first user information, the second user information, the target multimedia data and the smart contract; if the first block is successfully linked to the blockchain, it is determined that the first user information has the right to use the first resource data, and the reading right for the target multimedia data is allocated to the second user. From the above, it can be seen that by obtaining the user's resource data, generating blocks based on the resource data and uploading them to the chain, the resource data can be automatically transferred. If the user wants to have the authority to read multimedia data, there is no need to enter the transfer password of the resource data. Only a data reading request is needed to read the multimedia data. This can improve the automation of resource data transfer and thus improve the efficiency of data viewing.
[0219] In addition, it should be pointed out here that: the embodiment of the present application also provides a computer-readable storage medium, and the computer-readable storage medium stores a computer program executed by the data processing computer device 1000 mentioned above, and the computer program includes program instructions. When the processor executes the program instructions, it can execute the above-mentioned Figure 3 The description of the data processing method in the embodiment corresponding to FIG. 7 is omitted here. In addition, the description of the beneficial effects of the same method is omitted here. For technical details not disclosed in the computer-readable storage medium embodiment involved in the present application, please refer to the description of the method embodiment of the present application.
[0220] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0221] The above disclosure is only the preferred embodiment of the present application, which certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.
Claims
1. A data sharing method based on blockchain, It is characterized in that include: Acquire target multimedia data sent by the first user equipment, and upload the target multimedia data to the blockchain; The first user equipment corresponds to first user information; Obtaining a data reading request sent by a second user device; The data reading request is used to request to read the target multimedia data provided by the first user equipment; The second user equipment corresponds to second user information; Based on the data reading request, triggering a smart contract, and determining consumption resources required for reading the target multimedia data according to the smart contract; Acquire the first resource data belonging to the second user information according to the consumed resources, and generate the first data transfer information of the second user information for the first user information according to the first resource data, including: acquire the first resource data belonging to the second user information according to the consumed resources, generate transaction data according to the first resource data, the public key of the transfer object, the source account address of the first resource data, and the account address of the transfer object, wherein the source account address is the account address of the source user, and the source user is the user who has transferred historical resource data to the second user information; sign the transaction data according to the private key of the second user information to obtain the user signature; encapsulate the transaction data and the user signature into the first data transfer information; wherein the public key of the transfer object is used to encrypt the first resource data to generate a ciphertext, so that when the transfer object receives the encrypted first resource data, the ciphertext is decrypted and verified by the private key of the transfer object, and the first resource data is used after the decryption is successful; Generate a first block according to the first data transfer information, the first user information, the second user information, the target multimedia data, and the smart contract; If the first block is successfully uploaded to the blockchain, it is determined that the first user information has the right to use the first resource data, and the second user information is assigned the right to read the target multimedia data.
2. The method according to claim 1, It is characterized in that The obtaining of target multimedia data sent by the first user equipment and uploading the target multimedia data to the blockchain includes: Acquire the target multimedia data sent by the first user equipment; Generate a target block to be added to the blockchain according to the target multimedia data and the first user information; Broadcasting the target block to all blockchain consensus nodes on the blockchain; When it is determined that a consensus is reached among all the blockchain consensus nodes on the blockchain, the target block is added to the blockchain.
3. The method according to claim 2, It is characterized in that The step of generating a target block to be added to the blockchain according to the target multimedia data and the first user information includes: Obtain a block with a maximum generation timestamp from the blockchain as a parent block; Performing hash calculation on the target multimedia data to obtain a hash value of the target block; Obtaining a parent block hash value of the parent block; Constructing a Merkle tree according to the target multimedia data and the first user information; Based on the parent block hash value, the Merkle tree, the hash value of the target block, the target multimedia data, and the first user information, the target block to be added to the blockchain is generated.
4. The method according to claim 1, It is characterized in that Encapsulating the transaction data and the user signature into the first data transfer information includes: Acquire the user signature sent by the second user terminal, verify the user signature based on the public key of the second user information, and determine the legitimacy of the transaction data when the verification passes; When the transaction data is legitimate data, the transaction data and the user signature are encapsulated as the first data transfer information.
5. The method according to claim 1 or 4, It is characterized in that The account address of the transfer object includes the account address of the sharing platform and the account address of the first user information; Then, determining that the first user information has the permission to use the first resource data includes: Determining that the first user information has the authority to use the user-allocated resource data, and determining that the sharing platform has the authority to use the platform-allocated resource data; The first resource data is the sum of the user allocated resource data and the platform allocated resource data.
6. The method according to claim 5, It is characterized in that Also includes: If the target multimedia data is successfully uploaded to the blockchain, the smart contract is called to determine the reward resources corresponding to the target multimedia data according to the smart contract; Acquire second resource data belonging to the sharing platform according to the reward resource, and generate second data transfer information of the sharing platform for the first user information according to the second resource data; Generate a second block according to the second data transfer information, the first user information, the information of the sharing platform, the target multimedia data, and the smart contract; If the second block is successfully uploaded to the blockchain, it is determined that the first user information has the right to use the second resource data.
7. A data sharing device based on blockchain, It is characterized in that include: An uplink module, used to obtain target multimedia data sent by the first user equipment, and uplink the target multimedia data to the blockchain; The first user equipment corresponds to first user information; An acquisition module, used to acquire a data reading request sent by a second user device; The data reading request is used to request to read the target multimedia data provided by the first user equipment; The second user equipment corresponds to second user information; A first determination module, configured to trigger a smart contract based on the data reading request, and determine, according to the smart contract, the consumption resources required for reading the target multimedia data; A first generating module is used to obtain first resource data belonging to the second user information according to the consumed resources, and generate first data transfer information of the second user information for the first user information according to the first resource data, including: obtaining the first resource data belonging to the second user information according to the consumed resources, generating transaction data according to the first resource data, the public key of the transfer object, the source account address of the first resource data, and the account address of the transfer object, wherein the source account address is the account address of the source user, and the source user is the user who has transferred historical resource data to the second user information; signing the transaction data according to the private key of the second user information to obtain the user signature; encapsulating the transaction data and the user signature into the first data transfer information; wherein the public key of the transfer object is used to encrypt the first resource data to generate a ciphertext, so that when the transfer object receives the encrypted first resource data, the ciphertext is decrypted and verified by the private key of the transfer object, and the first resource data is used after the decryption is successful; A second generating module, configured to generate a first block according to the first data transfer information, the first user information, the second user information, the target multimedia data, and the smart contract; A second determination module, configured to determine that the first user information has the right to use the first resource data if the first block is successfully uploaded to the blockchain; An allocating module is used to allocate the reading authority for the target multimedia data to the second user information.
8. A computer device, It is characterized in that include: Processor and memory; The memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the method according to any one of claims 1 to 6 is executed.
