WO2022120938A1 - 数据共享方法、系统、装置、设备和存储介质 - Google Patents

数据共享方法、系统、装置、设备和存储介质 Download PDF

Info

Publication number
WO2022120938A1
WO2022120938A1 PCT/CN2020/138055 CN2020138055W WO2022120938A1 WO 2022120938 A1 WO2022120938 A1 WO 2022120938A1 CN 2020138055 W CN2020138055 W CN 2020138055W WO 2022120938 A1 WO2022120938 A1 WO 2022120938A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
blockchain system
target
encrypted
request
Prior art date
Application number
PCT/CN2020/138055
Other languages
English (en)
French (fr)
Inventor
李伟
邱炜伟
匡立中
曾磊
曹东辉
Original Assignee
杭州趣链科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 杭州趣链科技有限公司 filed Critical 杭州趣链科技有限公司
Publication of WO2022120938A1 publication Critical patent/WO2022120938A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/10Network architectures or network communication protocols for network security for controlling access to devices or network resources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]

Definitions

  • the present application relates to the field of blockchain technology, and in particular, to a data sharing method, system, apparatus, device and storage medium.
  • the data of the opposite end can be obtained between the two devices through an interface or the like.
  • this data sharing method on the one hand, due to the network communication involved, the data is easily attacked and tampered with;
  • the present application provides a data sharing method, system, device, device and storage medium, which can ensure the security of the data transmission process, thereby ensuring that the obtained data is credible and cannot be tampered with.
  • a data sharing method comprising: a first device stores target data in a blockchain system; after the first device receives a data use request sent by a second device, sending the data to the The blockchain system sends a data acquisition request, and the data acquisition request carries the identifier of the data user; after receiving the data acquisition request, the blockchain system uses the public key of the data provider to encrypt the target data, obtain encrypted data; set the data user identifier to have the permission to use the target data; send the encrypted data to the second device; after the second device receives the encrypted data, send the data to the district
  • the blockchain system sends a data viewing request, and the data viewing request carries the data user identifier and the encrypted data; after the blockchain system receives the data viewing request, if it determines that the data viewing request carries If the data user identifier has the right to use the target data, then use the private key of the data provider to decrypt the encrypted data carried in the data viewing request to obtain decrypted data; send the decrypt
  • a data sharing system in a second aspect, includes a first device, a second device and a blockchain system;
  • the first device is configured to store target data in the blockchain system; the first device is further configured to send the data to the blockchain system after receiving the data usage request sent by the second device Send a data acquisition request, where the data acquisition request carries the identifier of the data user; the blockchain system is configured to encrypt the target data using the public key of the data provider after receiving the data acquisition request, and obtain encrypting data; setting the data user identifier to have the right to use the target data; sending the encrypted data to the second device; the second device is configured to send the encrypted data to the second device after receiving the encrypted data
  • the blockchain system sends a data viewing request, and the data viewing request carries the data user identifier and the encrypted data; the blockchain system is configured to, after receiving the data viewing request, determine the The data user identifier carried in the data viewing request has the right to use the target data, then use the private key of the data provider to decrypt the encrypted data carried in the data viewing request to obtain decrypted data; decrypt the decrypted data sent to the second device.
  • a data sharing method is provided, which is applied to a blockchain system in a data sharing system.
  • the data sharing system includes a first device, a second device, and the blockchain system, and the method includes:
  • the target data in the first device; after receiving the data acquisition request carrying the identifier of the data user sent by the first device, encrypting the target data using the public key of the data provider to obtain encrypting data; setting the data user identifier to have the right to use the target data; sending the encrypted data to the second device; receiving a data sent by the second device that carries the data user identifier and After the data viewing request of the encrypted data, if it is determined that the data user identifier carried in the data viewing request has the permission to use the target data, the private key of the data provider is used to verify the data carried in the data viewing request. Decrypt the encrypted data to obtain decrypted data; and send the decrypted data to the second device.
  • a data sharing device which is applied to a blockchain system in a data sharing system, the data sharing system includes a first device, a second device and the blockchain system, and the device includes:
  • the storage module is used to store the target data in the first device; the encryption module is used to use the public data of the data provider after receiving the data acquisition request sent by the first device and carrying the identifier of the data user. encrypting the target data with a key to obtain encrypted data; setting the data user identifier to have the use authority of the target data; a sending module, configured to send the encrypted data to the second device; a decryption module, After receiving the data viewing request carrying the data user identifier and the encrypted data sent by the second device, if it is determined that the data user identifier carried in the data viewing request has the use of the target data permission, then use the private key of the data provider to decrypt the encrypted data carried in the data viewing request to obtain decrypted data; the sending module is further configured to send the decrypted data to the second device.
  • a computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being executed by the processor When implementing the data sharing method described in the third aspect.
  • a computer-readable storage medium where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the data sharing method described in the third aspect above is implemented.
  • a computer program product comprising instructions, which, when executed on a computer, cause the computer to perform the steps of the data sharing method described in the third aspect above.
  • the blockchain system After the blockchain system stores the target data in the first device, if it receives a data acquisition request sent by the first device, it encrypts the target data with the public key of the data provider, and obtains the encrypted data and Send it to the second device, and set the data user identifier to have the permission to use the target data. Due to the immutability of the blockchain, the source of the encrypted data obtained by the second device from the blockchain system can be guaranteed, and the encrypted data is safe and reliable. After that, if the blockchain system receives the data viewing request sent by the second device, it can use the private key of the data provider to decrypt the encrypted data when it is determined that the data user identifier has the right to use the target data. Decrypted data is obtained and sent to the second device. In this way, the data transmission process is secure, and the obtained decrypted data can be guaranteed to be credible and tamper-proof.
  • FIG. 1 is a schematic structural diagram of a blockchain system provided by an embodiment of the present application.
  • FIG. 2 is a schematic diagram of a blockchain provided by an embodiment of the present application.
  • FIG. 3 is a schematic diagram of a data sharing system provided by an embodiment of the present application.
  • FIG. 6 is a schematic structural diagram of a data sharing apparatus provided by an embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of a computer device provided by an embodiment of the present application.
  • FIG. 1 is a schematic structural diagram of a blockchain system provided by an embodiment of the present application.
  • the blockchain system 100 refers to a system for sharing data between nodes.
  • the blockchain system 100 may include multiple nodes 101 , and multiple nodes 101 may refer to the system in the blockchain system 100 . each client.
  • Each node 101 can receive input information during normal work, and maintain shared data within the blockchain system 100 based on the received input information.
  • an information connection may exist between each node 101 in the blockchain system 100, and information transmission may be performed between the nodes 101 through the information connection.
  • any node 101 in the blockchain system 100 receives input information
  • other nodes 101 in the blockchain system 100 obtain the input information according to the consensus algorithm, and store the input information as data in the shared data , so that the data stored on all nodes 101 in the blockchain system 100 are consistent.
  • Each node 101 in the blockchain system 100 stores an identical blockchain.
  • the blockchain consists of multiple blocks.
  • the founding block includes a block header and a block body.
  • the block header stores the input information feature value, version number, timestamp and difficulty value.
  • the block body stores Input information;
  • the next block of the genesis block takes the genesis block as the parent block, the next block also includes the block header and the block body, and the block header stores the input information characteristic value of the current block, the parent block's
  • the block header feature value, version number, timestamp, and difficulty value, and so on make the block data stored in each block in the blockchain associated with the block data stored in the parent block, ensuring that Security of the information entered in the block.
  • the blockchain system 100 has computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm.
  • the blockchain system 100 is a distributed shared ledger and database, which has the characteristics of decentralization, non-tampering, full traces, traceability, collective maintenance, openness and transparency, etc. These features ensure the shared openness, authenticity, integrity, security and reliability of the blockchain.
  • FIG. 3 is a schematic diagram of a data sharing system provided by an embodiment of the present application.
  • the data sharing system includes: a first device 301 , a second device 302 and a blockchain system 303 .
  • the first device 301 is a data provider's device.
  • the first device 301 may be a general purpose computer device or a special purpose computer device.
  • the first device 301 may be a desktop computer, a portable computer, a network server, a palmtop computer, a mobile phone, a tablet computer, a wireless terminal device, a communication device, or an embedded device, and the embodiment of the present application does not limit the first device 301 type, as long as the first device 301 can be used by the data provider.
  • a data provider is a party that provides data that can be shared.
  • the second device 302 is the data consumer's device.
  • the second device 302 may be a general purpose computer device or a special purpose computer device.
  • the second device 302 may be a desktop computer, a portable computer, a network server, a palmtop computer, a mobile phone, a tablet computer, a wireless terminal device, a communication device, or an embedded device, and the embodiment of the present application does not limit the second device 302 type, as long as the second device 302 can be used by the data consumer.
  • the data consumer is the party used to use the shared data.
  • the blockchain system 303 may be the blockchain system 100 described in the embodiments of FIGS. 1-2 above.
  • the first device 301 is a device capable of directly communicating with the blockchain system 303, for example, the first device 301 may be a network server or the like. In this way, the first device 301 can communicate with the blockchain system 303 through a wired network or a wireless network. In another possible manner, the first device 301 is a device that cannot directly communicate with the blockchain system 303, for example, the first device 301 may be a terminal device or the like.
  • the data sharing system can also include a business system, and the first device 301 can communicate with the blockchain system 303 through the business system, that is, the business system can forward the information sent by the first device 301 to the blockchain system 303 , and can also forward the information sent by the blockchain system 303 to the first device 301 .
  • the second device 302 is a device capable of directly communicating with the blockchain system 303, for example, the second device 302 may be a network server or the like. In this way, the second device 302 can communicate with the blockchain system 303 through a wired network or a wireless network. In another possible manner, the second device 302 is a device that cannot directly communicate with the blockchain system 303, for example, the second device 302 may be a terminal device or the like.
  • the data sharing system can also include a business system
  • the second device 302 can communicate with the blockchain system 303 through the business system, that is, the business system can forward the information sent by the second device 302 to the blockchain system 303 , and can also forward the information sent by the blockchain system 303 to the second device 302 .
  • the first device 301 , the second device 302 and the blockchain system 303 may execute the data sharing method described in the embodiment of FIG. 4 below to realize the acquisition of the target data shared by the first device 301 by the second device 302 .
  • data providers and data users can first register their identities in the blockchain system.
  • the identity registration process for data providers and data consumers is described below.
  • the identity registration process of the data provider may include the following steps (1)-step (3):
  • the first device sends an identity registration request to the blockchain system.
  • the identity registration request is used to request identity registration for the data provider, and the identity registration request carries the identity information of the data provider.
  • the blockchain system After receiving the identity registration request sent by the first device, the blockchain system performs identity registration for the data provider according to the identity information. When the identity registration is successful, it allocates the public key, private key and data provider to the data provider. party logo.
  • the data provider identification is used to identify the identity of the data provider.
  • the identifier of the data provider may be the account of the data provider, the identifier of the first device, and the like.
  • the first device identifier is used to identify the first device.
  • the first device identifier can be the UUID (Universally) of the first device. Unique Identifier, Universal Unique Identifier), MAC (Media Access Control, Media Access Control) address, IP (Internet Protocol, Internet Protocol) address, or factory serial number, etc.
  • the public and private keys assigned to the data provider are a pair of keys, one of the public and private keys of the data provider is used for encryption and the other is used for decryption.
  • the blockchain system can store the public key, private key and data provider ID allocated by the data provider correspondingly, so that the public key or private key of the data provider can be obtained subsequently according to the data provider ID.
  • the operation of the blockchain system to perform identity registration for the data provider according to the identity information may be: the blockchain system verifies the identity information; if the identity information is verified, it is determined that the identity registration of the data provider is successful; If the authentication of the identity information fails, it is determined that the identity registration of the data provider fails.
  • the blockchain system sends the identity of the data provider to the first device.
  • the blockchain system only sends the data provider identification to the first device.
  • the public and private keys of the data provider are hosted in the blockchain system.
  • the identity registration process of the data user may include the following steps (1)-step (3):
  • the second device sends an identity registration request to the blockchain system.
  • the identity registration request is used to request identity registration for the data user, and the identity registration request carries the identity information of the data user.
  • the blockchain system After receiving the identity registration request sent by the second device, the blockchain system performs identity registration for the data user according to the identity information. When the identity registration is successful, it allocates the public key, private key and data usage to the data user. party logo.
  • the data consumer ID is used to identify the identity of the data consumer.
  • the identifier of the data user may be the account of the data user, the identifier of the second device, or the like.
  • the second device identifier is used to identify the second device.
  • the second device identifier may be the UUID, MAC address, IP address, or factory serial number of the second device.
  • the public and private keys assigned to the data consumer are a pair of keys, one of the public and private keys of the data consumer is used for encryption and the other is used for decryption.
  • the blockchain system can store the public key, private key and data user ID allocated to the data user correspondingly, so that the public key or private key of the data user can be obtained later according to the data user ID.
  • the operation of the blockchain system to perform identity registration for the data user according to the identity information may be: the blockchain system verifies the identity information; if the identity information is verified, it is determined that the identity registration of the data user is successful; If the authentication of the identity information fails, it is determined that the identity registration of the data user fails.
  • the blockchain system sends the identity of the data user to the second device.
  • the blockchain system only sends the identity of the data user to the first device.
  • the public and private keys of data users are hosted in the blockchain system.
  • FIG. 4 is a flowchart of a data sharing method provided by an embodiment of the present application. Referring to Figure 4, the following steps are included.
  • Step 401 The first device stores the target data in the blockchain system.
  • the target data is the data provided by the data provider that can be shared.
  • step 401 may include the following steps (1)-step (3):
  • the first device sends a data escrow request to the blockchain system.
  • the data hosting request is used to request that the target data be hosted on the blockchain system.
  • the data escrow request carries the target data and attribute information of the target data, and the attribute information of the target data may include one or more attribute information such as the identifier of the data provider, the usage period, and the applicable scenario.
  • the blockchain system After receiving the data escrow request sent by the first device, the blockchain system stores the target data carried in the data escrow request to obtain the target data storage information; the identity of the data provider carried in the data escrow request and the target Data storage information corresponds to storage.
  • the target data when the blockchain system stores the target data, the target data can be stored in the blockchain; or, the hash value of the target data can be stored in the blockchain, and the target data can be stored in the database.
  • the target data when the blockchain system stores the target data in the blockchain, the target data can be uploaded to the chain according to the smart contract. That is, the blockchain system can invoke a smart contract to generate a block storing the target data and add the block to the shared blockchain. In this way, the target data will not be tampered with.
  • the operation of the blockchain system to store the hash value of the target data in the blockchain is similar to the operation of the above-mentioned blockchain system to store the target data in the blockchain, which will not be repeated in this embodiment of the present application.
  • Smart contracts are based on the trusted and immutable data of the blockchain, and can automatically execute some predefined rules and terms.
  • smart contracts are stored in blocks of the blockchain in the form of on-chain code. Specific actions can be performed by invoking smart contracts.
  • the target data storage information is used to indicate the storage location of the target data, and the target data can be acquired according to the target data storage information.
  • the target data storage information may be some information used to identify the target data itself, for example, the target data storage information may be the name of the target data, and the like.
  • the target data storage information may be some information used to identify the block in which the target data is stored, for example, the target data storage information may be the block height, etc. .
  • the blockchain system sends the target data storage information to the first device.
  • Step 402 The second device sends a data usage request to the first device.
  • the data usage request is used to request to use the data shared by the first device.
  • the data usage request may carry the data user identifier and data feature information.
  • the data characteristic information is used to indicate the characteristics of the data that the data consumer wants to use.
  • the data feature information may include data release time, data nature, and the like. For example, the data feature information is used to indicate that the data user wants to use the financial data released in August.
  • a data sharing page may be displayed on the second device, and a data search box and a download option are displayed on the data sharing page. If the data user wants to use the data, he can enter the data characteristic information in the data search box, and then click the download option to trigger the data usage instruction. After detecting the data usage instruction, the second device may send a data usage request to the first device.
  • Step 403 After receiving the data use request sent by the second device, the first device sends a data acquisition request to the blockchain system.
  • the data acquisition request is used to request to acquire encrypted data corresponding to the target data stored in the blockchain system by the first device.
  • the data acquisition request may carry the identifier of the data user. Further, the data acquisition request may also carry target data storage information.
  • the first device when it sends a data acquisition request to the blockchain system, it can call the smart contract shared data acquisition interface to send the data acquisition request to the blockchain system.
  • the first device before the first device sends a data acquisition request to the blockchain system, it can first search for data in the data shared by the first device that has the same feature information as the data feature information carried in the data usage request. If the feature information of the target data is Consistent with the data feature information, a data acquisition request is sent to the blockchain system.
  • the feature information of the target data is used to indicate the feature of the target data.
  • the feature information of the target data may include the release time, nature, and the like of the target data.
  • the characteristic information of the target data may be used to indicate that the target data is financial data released on August 24th.
  • the first device It can be determined that the characteristic information of the target data is consistent with the characteristic information of the data, and at this time, the first device can send a data acquisition request to the blockchain system.
  • the first device can also review the data use request, and then search the shared data after the review is passed.
  • the feature information is consistent with the data feature information carried in the data usage request.
  • the first device may review the data use request automatically, for example, the first device may review the data use request according to preset data use conditions, which may be preset according to specific business requirements. If the data use request satisfies the data use condition, the first device determines that the data use request is approved; if the data use request does not meet the data use condition, the first device determines that the data use request is not approved.
  • the first device may review the data use request manually, for example, the data use request may be reviewed by a data provider.
  • the data provider determines that there is no problem with the data use request, it can trigger the approval instruction, and after the first device detects the approval instruction, it determines that the data use request is approved; when the data provider determines that there is a problem with the data use request, The review failure instruction may be triggered, and after detecting the review failure instruction, the first device determines that the data usage request review fails.
  • Step 404 After receiving the data acquisition request sent by the first device, the blockchain system uses the public key of the data provider to encrypt the target data to obtain encrypted data; the data user identifier is set to have the permission to use the target data.
  • the blockchain system uses the public key of the data provider to encrypt the target data, and before obtaining the encrypted data, the target data can be obtained according to the target data storage information carried in the data obtaining request;
  • the target data storage information corresponds to the stored data provider identifier, and the data provider's public key is obtained according to the obtained data provider identifier, and then the target data is encrypted using the data provider's public key to obtain encrypted data.
  • the operation of the blockchain system to set the data user identifier to have the right to use the target data may be as follows: the blockchain system uses the data provider identifier as the encryption party identifier, the data user identifier as the authorization party identifier, and the encrypted data The encrypted data identification of the encrypted data, the encryption party identification and the authorized party identification are stored correspondingly.
  • the encrypted data identifier of the encrypted data is used to identify the encrypted data, for example, the encrypted data identifier of the encrypted data may be the name of the encrypted data and the like.
  • the encrypted data identification of the encrypted data can be obtained directly from the encrypted data without decrypting the encrypted data.
  • the encryption party identifier is used to indicate which party the encrypted data is encrypted by.
  • the authorized party ID is used to indicate to which party the encrypted data is available.
  • the blockchain system uses the identity of the data provider as the identity of the encryption party and the identity of the data user as the identity of the authorized party. After the encrypted data identity of the encrypted data, the identity of the encryption party and the identity of the authorized party are stored correspondingly, it means The encrypted data is encrypted by the data provider and available to the data consumer. Since the encrypted data is obtained by encrypting the target data, the identity of the data user has the right to use the target data at this time.
  • Step 405 The blockchain system sends the encrypted data to the second device.
  • the blockchain system can send the encrypted data to the first device, and the first device sends the encrypted data to the second device.
  • the blockchain system can send this encrypted data directly to the second device.
  • the contract logic can be executed to realize that the first device sends a data acquisition request to the blockchain system, and the blockchain system acquires the encrypted data corresponding to the target data and sends it to the first device. 2. This series of operations in which the device and the blockchain system set the data user's permission to use the target data.
  • the first device needs to instruct the blockchain system to set the data user's permission to use the target data. That is to say, if the data user wants to use the target data, it needs to obtain the permission to use the target data after the approval of the data provider.
  • the blockchain system sends the encrypted data to the second device, for the encrypted data in the hands of the data user, since the data user has obtained the permission to use the target data, the data user can obtain the encrypted data according to the encrypted data. target data. If there is malicious dissemination of the encrypted file, the third party still cannot obtain the target data without the approval of the data provider, and only after the approval of the data provider can the target data be obtained. Only then can the target data be obtained from the encrypted data.
  • the use rights of the target data can be controlled. For example, if the data provider wants to restrict the use of the target data by the data user, it can cancel the data user's permission to use the target data.
  • the first device may send a data restriction request to the blockchain system, where the data restriction request carries the data user identifier and the encrypted data identifier of the encrypted data; after the blockchain system receives the data restriction request, The data user ID in the authority ID stored corresponding to the encrypted data ID can be deleted, so that the data user ID no longer has the right to use the target data.
  • Step 406 After receiving the encrypted data, the second device sends a data viewing request to the blockchain system.
  • the data viewing request is used to request to view the decrypted data corresponding to the encrypted data, that is, to request to view the target data.
  • the data viewing request carries the data user identifier and the encrypted data.
  • a data sharing page may be displayed on the second device, and a download option is displayed on the data sharing page. If the data user wants to use the data, he can click the download option to instruct the second device to send a data use request to the first device. Afterwards, the second device will receive the encrypted data, and at this time, the second device may display the encrypted data on the data sharing page. In this way, the data user can obtain the encrypted data corresponding to the data to be used by clicking the download option on the data sharing page.
  • a data viewing page may be displayed on the second device, and a data uploading entry is displayed on the data viewing page.
  • the second device After the data user uploads the encrypted data through the data upload portal, the second device will send a data viewing request to the blockchain system.
  • Step 407 After the blockchain system receives the data viewing request sent by the second device, if it is determined that the data user identifier carried in the data viewing request has the right to use the target data, it uses the private key of the data provider to view the data. The encrypted data carried by the request is decrypted to obtain decrypted data.
  • the blockchain system may first obtain the authorized party identifier and the encrypted party identifier stored corresponding to the encrypted data identifier of the encrypted data carried in the data viewing request. If the authority identifier includes the data user identifier carried in the data viewing request, it is determined that the data user identifier has the right to use the target data. After that, the blockchain system obtains the private key of the data provider according to the obtained encryption party identification (that is, the data provider identification), and uses the private key of the data provider to decrypt the encrypted data carried in the data viewing request to obtain the decrypted data. .
  • Step 408 The blockchain system sends the decrypted data to the second device.
  • the blockchain system can also detect whether the decrypted data has been tampered with. If the decrypted data has not been tampered with, the blockchain system sends the decrypted data to the second device; if the decrypted data has been tampered with, the blockchain system does not send the decrypted data to the second device, but sends the decrypted data to the second device. The second device sends an alert message to alert the data user that there is a problem with the encrypted data it obtains.
  • the blockchain system can obtain the target data corresponding to the encrypted data from the blockchain; if the obtained target data If the decrypted data is the same as the decrypted data, it can be determined that the decrypted data has not been tampered with and is the target data; if the obtained target data is different from the decrypted data, it can be determined that the decrypted data has been tampered with and is not the target data.
  • the blockchain system can obtain the hash value of the target data corresponding to the encrypted data from the blockchain. value as the first hash value, and then calculate the hash value of the decrypted data as the second hash value; if the first hash value is the same as the second hash value, it can be determined that the decrypted data has not been tampered with, which is the target data; if the first hash value is different from the second hash value, it can be determined that the decrypted data has been tampered with and is not the target data.
  • the blockchain system can also obtain the expiration date of the target data corresponding to the encrypted data; if the current time is within the expiration date of the target data, the decrypted data will be sent to the second device. To the second device; if the current time is not within the use period of the target data, the decrypted data will not be sent to the second device, but a reminder message will be sent to the second device to remind the data user that the current limit of the target data has exceeded. Period of use.
  • the operation of the blockchain system sending the decrypted data to the second device may be: the blockchain system generates a page for displaying the decrypted data.
  • the blockchain system embeds watermark information in the page, and the watermark information may include one or more attribute information of the target data, such as one or more of the identification of the data provider, period of use, applicable scenarios, etc.; and/ Or, the blockchain system sets the content saving function of this page to be disabled.
  • the blockchain system sends the page to the second device for display.
  • the blockchain system After the blockchain system embeds the watermark information in the page, if the second device takes a screenshot of the page, the image obtained by the screenshot will contain the watermark information. After the blockchain system sets the content saving function of the page to a disabled state, the second device will not be able to save the content of the page locally.
  • the second device after receiving the page, the second device can display the page, and the data user can view the decrypted data on the page, but cannot save the decrypted data locally, which can effectively prevent the decrypted data. maliciously spread.
  • a data viewing page may be displayed on the second device, and a data uploading entry is displayed on the data viewing page.
  • the second device After the data user uploads the encrypted data through the data upload portal, the second device will send a data viewing request to the blockchain system. Afterwards, the second device will receive the page that contains the decrypted data corresponding to the encrypted data returned by the blockchain system, and the second device can display the page for the data user to view.
  • the blockchain system after the blockchain system stores the target data in the first device, if it receives a data acquisition request sent by the first device, it encrypts the target data using the public key of the data provider to obtain the encrypted data.
  • the data is sent to the second device, and the identity of the data user is set to have the permission to use the target data. Due to the immutability of the blockchain, the source of the encrypted data obtained by the second device from the blockchain system can be guaranteed, and the encrypted data is safe and reliable.
  • the blockchain system receives the data viewing request sent by the second device, it can use the private key of the data provider to decrypt the encrypted data when it is determined that the data user identifier has the right to use the target data. Decrypted data is obtained and sent to the second device. In this way, the data transmission process is secure, and the obtained decrypted data can be guaranteed to be credible and tamper-proof.
  • FIG. 5 is a flowchart of a data sharing method provided by an embodiment of the present application.
  • the method is applied to a blockchain system, and the blockchain system may be the blockchain system 100 described in the embodiments of FIG. 1 to FIG. 2 above.
  • the method may include the following steps:
  • Step 501 Store the target data in the first device. Relevant content of step 501 has been described in detail in step 401 in the embodiment of FIG. 4 above, which is not repeated in this embodiment of the present application.
  • Step 502 After receiving the data acquisition request carrying the data user identifier sent by the first device, encrypt the target data with the public key of the data provider to obtain encrypted data; set the data user identifier to have the use authority of the target data .
  • Relevant content of step 502 has been described in detail in step 403 and step 404 in the embodiment of FIG. 4 above, which is not repeated in this embodiment of the present application.
  • Step 503 Send the encrypted data to the second device. Relevant content of step 503 has been described in detail in step 405 in the embodiment of FIG. 4 above, which is not repeated in this embodiment of the present application.
  • Step 504 After receiving the data viewing request that carries the data user identifier and the encrypted data sent by the second device, if it is determined that the data user identifier carried in the data viewing request has the right to use the target data, use the data provider's identifier.
  • the private key decrypts the encrypted data carried in the data viewing request to obtain decrypted data.
  • the related content of step 504 has been described in detail in step 406 and step 407 in the above embodiment of FIG. 4 , which is not repeated in this embodiment of the present application.
  • Step 505 Send the decrypted data to the second device.
  • the related content of step 505 has been described in detail in step 408 in the above embodiment of FIG. 4 , which is not repeated in this embodiment of the present application.
  • the blockchain system after the blockchain system stores the target data in the first device, if it receives a data acquisition request sent by the first device, it encrypts the target data using the public key of the data provider to obtain the encrypted data.
  • the data is sent to the second device, and the identity of the data user is set to have the permission to use the target data. Due to the immutability of the blockchain, the source of the encrypted data obtained by the second device from the blockchain system can be guaranteed, and the encrypted data is safe and reliable.
  • the blockchain system receives the data viewing request sent by the second device, it can use the private key of the data provider to decrypt the encrypted data when it is determined that the data user identifier has the right to use the target data. Decrypted data is obtained and sent to the second device. In this way, the data transmission process is secure, and the obtained decrypted data can be guaranteed to be credible and tamper-proof.
  • FIG. 6 is a schematic structural diagram of a data sharing device provided by an embodiment of the present application.
  • the device can be applied to a blockchain system, and the blockchain system can be the blockchain system 100 in the embodiments of FIG. 1 to FIG. 2 above.
  • the apparatus includes: a storage module 601 , an encryption module 602 , a sending module 603 , and a decryption module 604 .
  • the storage module 601 is used to store the target data in the first device; the encryption module 602 is used to use the public key pair of the data provider after receiving the data acquisition request sent by the first device and carrying the identifier of the data user.
  • the target data is encrypted to obtain encrypted data; the data user identifier is set to have the use authority of the target data; the sending module 603 is used to send the encrypted data to the second device; the decryption module 604 is used to receive the data sent by the second device.
  • the encrypted data carried in the data viewing request is decrypted using the private key of the data provider.
  • the sending module 603 is further configured to send the decrypted data to the second device.
  • the storage module 601 is configured to: receive a data hosting request sent by the first device, where the data hosting request carries target data and attribute information of the target data, and the attribute information of the target data includes a data provider identifier; store the target data, Obtaining the target data storage information; storing the data provider identifier corresponding to the target data storage information; and sending the target data storage information to the first device.
  • the data acquisition request carries the data user identifier and target data storage information.
  • the device further includes: an acquisition module, configured to acquire the target data from the blockchain according to the target data storage information carried in the data acquisition request after receiving the data acquisition request; and acquire the target data storage information carried in the data acquisition request.
  • the encryption module 602 is configured to use the identifier of the data provider as the identifier of the encryptor, the identifier of the data user as the identifier of the authority, and store the encrypted data identifier, the identifier of the encryptor and the identifier of the authority of the encrypted data correspondingly.
  • the decryption module 604 is configured to: obtain the authorized party identifier and the encrypted party identifier stored corresponding to the encrypted data identifier of the encrypted data carried in the data viewing request; if the obtained authorized party identification includes the data user carried in the data viewing request.
  • the sending module 603 is configured to: generate a page for displaying decrypted data; embed watermark information in the page, where the watermark information includes a data provider identifier; and/or, set the content saving function of the page to be in a disabled state; sent to the second device for display.
  • the device further includes: a receiving module for receiving an identity registration request sent by the first device, where the identity registration request carries the identity information of the data provider; a registration module for performing identity registration for the data provider according to the identity information , when the identity registration is successful, assign a public key, a private key and a data provider identifier to the data provider; the sending module 603 is further configured to send the data provider identifier to the first device.
  • the blockchain system after the blockchain system stores the target data in the first device, if it receives a data acquisition request sent by the first device, it encrypts the target data using the public key of the data provider to obtain the encrypted data.
  • the data is sent to the second device, and the identity of the data user is set to have the permission to use the target data. Due to the immutability of the blockchain, the source of the encrypted data obtained by the second device from the blockchain system can be guaranteed, and the encrypted data is safe and reliable.
  • the blockchain system receives the data viewing request sent by the second device, it can use the private key of the data provider to decrypt the encrypted data when it is determined that the data user identifier has the right to use the target data. Decrypted data is obtained and sent to the second device. In this way, the data transmission process is secure, and the obtained decrypted data can be guaranteed to be credible and tamper-proof.
  • FIG. 7 is a schematic structural diagram of a computer device according to an embodiment of the present application.
  • the computer device 7 includes: a processor 70 , a memory 71 , and a computer program 72 stored in the memory 71 and executable on the processor 70 .
  • the processor 70 executes the computer program 72 , the above implementation in FIG. 5 is implemented The steps in the data sharing method in the example.
  • the computer device 7 may be a general purpose computer device or a special purpose computer device.
  • the computer device 7 may be a server cluster composed of multiple servers.
  • FIG. 7 is only an example of the computer device 7, and does not constitute a limitation to the computer device 7, and may include more or less components than the one shown, or combine some components, or different components , for example, it may also include input and output devices, network access devices, and so on.
  • the processor 70 may be a central processing unit (Central Processing Unit, CPU), the processor 70 can also be other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application-specific integrated circuits (Application Specific Integrated Circuit, ASIC), off-the-shelf Programmable Gate Array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • a general-purpose processor may be a microprocessor or it may be any conventional processor.
  • the memory 71 may in some embodiments be an internal storage unit of the computer device 7 , such as a hard disk or a memory of the computer device 7 . In other embodiments, the memory 71 may also be an external storage device of the computer device 7 , such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) equipped on the computer device 7 . card, Flash Card, etc. Further, the memory 71 may also include both an internal storage unit of the computer device 7 and an external storage device. The memory 71 is used to store an operating system, an application program, a boot loader (Boot Loader), data, and other programs, such as program codes of computer programs, and the like. The memory 71 can also be used to temporarily store data that has been output or is to be output.
  • the memory 71 can also be used to temporarily store data that has been output or is to be output.
  • Embodiments of the present application further provide a computer device, the computer device comprising: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, the processor executing the computer program
  • the steps in any of the foregoing method embodiments are implemented at the same time.
  • Embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the steps in the foregoing method embodiments can be implemented.
  • the embodiments of the present application provide a computer program product, which, when running on a computer, causes the computer to execute the steps in the above-mentioned respective method embodiments.
  • the integrated unit if implemented as a software functional unit and sold or used as a stand-alone product, may be stored in a computer-readable storage medium.
  • all or part of the processes in the above method embodiments can be implemented by a computer program that instructs relevant hardware.
  • the computer program can be stored in a computer-readable storage medium, and the computer program can be When executed by the processor, the steps of the foregoing method embodiments may be implemented.
  • the computer program includes computer program code, and the computer program code may be in the form of source code, object code, executable file or some intermediate form, and the like.
  • the computer-readable medium may include at least: any entity or device capable of carrying the computer program code to the photographing device/terminal device, recording medium, computer memory, ROM (Read-Only Memory, read-only memory), RAM (Random Access Memory) , random access memory), CD-ROM (Compact Disc Read-Only Memory, CD-ROM), magnetic tapes, floppy disks, and optical data storage devices, etc.
  • the computer-readable storage medium mentioned in this application may be a non-volatile storage medium, in other words, may be a non-transitory storage medium.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Storage Device Security (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

一种数据共享方法、系统、装置、设备和存储介质,属于区块链技术领域。包括:第一设备将目标数据存储至区块链系统。第一设备接收到第二设备发送的数据使用请求后,向区块链系统发送携带有数据使用方标识的数据获取请求。区块链系统使用数据提供方的公钥对目标数据进行加密,得到加密数据并发送给第二设备,设置数据使用方标识具有目标数据的使用权限。第二设备向区块链系统发送携带有数据使用方标识和加密数据的数据查看请求。区块链系统在数据使用方标识具有目标数据的使用权限时,使用数据提供方的私钥对加密数据进行解密,得到解密数据并发送给第二设备。上述方法的数据传输过程安全,可以保证获得的解密数据可信、不可篡改。

Description

数据共享方法、系统、装置、设备和存储介质
本申请要求于2020年12月09日提交的申请号为202011432334.8、发明名称为“数据共享方法、系统、装置、设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及区块链技术领域,特别涉及一种数据共享方法、系统、装置、设备和存储介质。
背景技术
随着计算机网络技术的不断发展,不同部门、不同地区间的信息交流逐步增加,数据共享需求也随之增长。
目前,两个设备之间可以通过接口等方式获取到对端的数据。然而,这种数据共享方式中,一方面,由于涉及到网络通信,所以数据容易被攻击和篡改,另一方面,可能会存在第三方冒充对端身份来拿到数据。
技术问题
本申请提供了一种数据共享方法、系统、装置、设备和存储介质,可以保证数据传输过程安全,从而保证获得的数据可信、不可篡改。
技术解决方案
第一方面,提供了一种数据共享方法,所述方法包括:第一设备将目标数据存储至区块链系统;所述第一设备接收到第二设备发送的数据使用请求后,向所述区块链系统发送数据获取请求,所述数据获取请求携带数据使用方标识;所述区块链系统接收到所述数据获取请求后,使用数据提供方的公钥对所述目标数据进行加密,得到加密数据;设置所述数据使用方标识具有所述目标数据的使用权限;将所述加密数据发送给所述第二设备;所述第二设备接收到所述加密数据后,向所述区块链系统发送数据查看请求,所述数据查看请求携带所述数据使用方标识和所述加密数据;所述区块链系统接收到所述数据查看请求后,若确定所述数据查看请求携带的数据使用方标识具有所述目标数据的使用权限,则使用所述数据提供方的私钥对所述数据查看请求携带的加密数据进行解密,得到解密数据;将所述解密数据发送给所述第二设备。
第二方面,提供了一种数据共享系统,所述数据共享系统包括第一设备、第二设备和区块链系统;
所述第一设备,用于将目标数据存储至所述区块链系统;所述第一设备,还用于接收到所述第二设备发送的数据使用请求后,向所述区块链系统发送数据获取请求,所述数据获取请求携带数据使用方标识;所述区块链系统,用于接收到所述数据获取请求后,使用数据提供方的公钥对所述目标数据进行加密,得到加密数据;设置所述数据使用方标识具有所述目标数据的使用权限;将所述加密数据发送给所述第二设备;所述第二设备,用于接收到所述加密数据后,向所述区块链系统发送数据查看请求,所述数据查看请求携带所述数据使用方标识和所述加密数据;所述区块链系统,用于接收到所述数据查看请求后,若确定所述数据查看请求携带的数据使用方标识具有所述目标数据的使用权限,则使用所述数据提供方的私钥对所述数据查看请求携带的加密数据进行解密,得到解密数据;将所述解密数据发送给所述第二设备。
第三方面,提供了一种数据共享方法,应用于数据共享系统中的区块链系统,所述数据共享系统包括第一设备、第二设备和所述区块链系统,所述方法包括:
对所述第一设备中的目标数据进行存储;接收到所述第一设备发送的携带有数据使用方标识的数据获取请求后,使用数据提供方的公钥对所述目标数据进行加密,得到加密数据;设置所述数据使用方标识具有所述目标数据的使用权限;将所述加密数据发送给所述第二设备;接收到所述第二设备发送的携带有所述数据使用方标识和所述加密数据的数据查看请求后,若确定所述数据查看请求携带的数据使用方标识具有所述目标数据的使用权限,则使用所述数据提供方的私钥对所述数据查看请求携带的加密数据进行解密,得到解密数据;将所述解密数据发送给所述第二设备。
第四方面,提供了一种数据共享装置,应用于数据共享系统中的区块链系统,所述数据共享系统包括第一设备、第二设备和所述区块链系统,所述装置包括:
存储模块,用于对所述第一设备中的目标数据进行存储;加密模块,用于接收到所述第一设备发送的携带有数据使用方标识的数据获取请求后,使用数据提供方的公钥对所述目标数据进行加密,得到加密数据;设置所述数据使用方标识具有所述目标数据的使用权限;发送模块,用于将所述加密数据发送给所述第二设备;解密模块,用于接收到所述第二设备发送的携带有所述数据使用方标识和所述加密数据的数据查看请求后,若确定所述数据查看请求携带的数据使用方标识具有所述目标数据的使用权限,则使用所述数据提供方的私钥对所述数据查看请求携带的加密数据进行解密,得到解密数据;所述发送模块,还用于将所述解密数据发送给所述第二设备。
第五方面,提供了一种计算机设备,所述计算机设备包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,所述计算机程序被所述处理器执行时实现上述第三方面所述的数据共享方法。
第六方面,提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现上述第三方面所述的数据共享方法。
第七方面,提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第三方面所述的数据共享方法的步骤。
有益效果
在本申请中,区块链系统将第一设备中的目标数据存储后,若接收到第一设备发送的数据获取请求,则使用数据提供方的公钥对目标数据进行加密,得到加密数据并发送给第二设备,以及设置数据使用方标识具有目标数据的使用权限。由于区块链的不可篡改性,所以第二设备从区块链系统获取到的加密数据的来源可保证,该加密数据安全可信。之后,若区块链系统接收到第二设备发送的数据查看请求,则在确定数据使用方标识具有目标数据的使用权限的情况下,可以使用数据提供方的私钥对该加密数据进行解密,得到解密数据并发送给第二设备。如此,数据传输过程安全,可以保证获得的解密数据可信、不可篡改。
附图说明
图1是本申请实施例提供的一种区块链系统的结构示意图;
图2是本申请实施例提供的一种区块链的示意图;
图3是本申请实施例提供的一种数据共享系统的示意图;
图4是本申请实施例提供的一种数据共享方法的流程图;
图5是本申请实施例提供的另一种数据共享方法的流程图;
图6是本申请实施例提供的一种数据共享装置的结构示意图;
图7是本申请实施例提供的一种计算机设备的结构示意图。
本发明的实施方式
为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。
在对本申请实施例进行解释说明之前,先对区块链的相关内容予以说明。
图1是本申请实施例提供的一种区块链系统的结构示意图。
参见图1,区块链系统100是指用于进行节点与节点之间数据共享的系统,区块链系统100中可以包括多个节点101,多个节点101可以是指区块链系统100中各个客户端。每个节点101在进行正常工作可以接收到输入信息,并基于接收到的输入信息维护区块链系统100内的共享数据。为了保证区块链系统100内的信息互通,区块链系统100中的每个节点101之间可以存在信息连接,节点101之间可以通过该信息连接进行信息传输。比如,当区块链系统100中的任意节点101接收到输入信息时,区块链系统100中的其他节点101便根据共识算法获取该输入信息,将该输入信息作为共享数据中的数据进行存储,使得区块链系统100中全部节点101上存储的数据一致。
区块链系统100中的每个节点101均存储一条相同的区块链。参见图2,区块链由多个区块组成,创始块中包括区块头和区块主体,区块头中存储有输入信息特征值、版本号、时间戳和难度值,区块主体中存储有输入信息;创始块的下一区块以创始块为父区块,下一区块中同样包括区块头和区块主体,区块头中存储有当前区块的输入信息特征值、父区块的区块头特征值、版本号、时间戳和难度值,并以此类推,使得区块链中每个区块中存储的区块数据均与父区块中存储的区块数据存在关联,保证了区块中输入信息的安全性。
区块链系统100具有分布式数据存储、点对点传输、共识机制、加密算法等计算机技术。区块链系统100是一个分布式的共享账本和数据库,具有去中心化、不可篡改、全程留痕、可以追溯、集体维护、公开透明等特点。这些特点保证了区块链的共享开放、真实完整和安全可靠。
下面对本申请实施例涉及的系统架构予以说明。
图3是本申请实施例提供的一种数据共享系统的示意图。参见图3,该数据共享系统包括:第一设备301、第二设备302和区块链系统303。
第一设备301是数据提供方的设备。第一设备301可以是一个通用计算机设备或一个专用计算机设备。在具体实现中,第一设备301可以是台式机、便携式电脑、网络服务器、掌上电脑、移动手机、平板电脑、无线终端设备、通信设备或嵌入式设备,本申请实施例不限定第一设备301的类型,只要第一设备301可以被数据提供方所使用即可。数据提供方是用于提供可被共享的数据的一方。
第二设备302是数据使用方的设备。第二设备302可以是一个通用计算机设备或一个专用计算机设备。在具体实现中,第二设备302可以是台式机、便携式电脑、网络服务器、掌上电脑、移动手机、平板电脑、无线终端设备、通信设备或嵌入式设备,本申请实施例不限定第二设备302的类型,只要第二设备302可以被数据使用方所使用即可。数据使用方是用于使用被共享的数据的一方。
区块链系统303可以是上文图1-图2实施例所述的区块链系统100。
在一种可能的方式中,第一设备301是能够与区块链系统303直接通信的设备,如第一设备301可以是网络服务器等。这种方式下,第一设备301可以通过有线网络或无线网络与区块链系统303进行通信。在另一种可能的方式中,第一设备301是不能与区块链系统303直接通信的设备,如第一设备301可以是终端设备等。这种方式下,该数据共享系统还可以包括业务系统,第一设备301可以通过业务系统与区块链系统303进行通信,即业务系统可以转发第一设备301发送给区块链系统303的信息,同时也可以转发区块链系统303发送给第一设备301的信息。
在一种可能的方式中,第二设备302是能够与区块链系统303直接通信的设备,如第二设备302可以是网络服务器等。这种方式下,第二设备302可以通过有线网络或无线网络与区块链系统303进行通信。在另一种可能的方式中,第二设备302是不能与区块链系统303直接通信的设备,如第二设备302可以是终端设备等。这种方式下,该数据共享系统还可以包括业务系统,第二设备302可以通过业务系统与区块链系统303进行通信,即业务系统可以转发第二设备302发送给区块链系统303的信息,同时也可以转发区块链系统303发送给第二设备302的信息。
第一设备301、第二设备302和区块链系统303可以执行下文图4实施例所述的数据共享方法,来实现第二设备302对第一设备301所共享的目标数据的获取。
为了保证接入区块链系统的用户身份可靠,数据提供方和数据使用方可以先在区块链系统进行身份注册。下面对数据提供方和数据使用方的身份注册过程进行说明。
数据提供方的身份注册过程可以包括如下步骤(1)-步骤(3):
(1)第一设备向区块链系统发送身份注册请求。该身份注册请求用于请求为数据提供方进行身份注册,该身份注册请求携带数据提供方的身份信息。
(2)区块链系统接收到第一设备发送的身份注册请求后,根据该身份信息为数据提供方进行身份注册,在身份注册成功时,为数据提供方分配公钥、私钥和数据提供方标识。
数据提供方标识用于标识数据提供方的身份。比如,数据提供方标识可以为数据提供方账号、第一设备标识等。第一设备标识用于标识第一设备,如第一设备标识可以是第一设备的UUID(Universally Unique Identifier,通用唯一识别码)、MAC(Media Access Control,介质访问控制)地址、IP(Internet Protocol,互联网协议)地址、或出厂序列号等。
为数据提供方分配的公钥和私钥是一对密钥,数据提供方的公钥和私钥中的一个用于加密,另一个用于解密。区块链系统可以将为数据提供方分配的公钥、私钥和数据提供方标识对应存储,如此后续可以根据数据提供方标识,获取数据提供方的公钥或私钥。
其中,区块链系统根据该身份信息为数据提供方进行身份注册的操作可以为:区块链系统对该身份信息进行验证;若该身份信息验证通过,则确定数据提供方的身份注册成功;若该身份信息验证失败,则确定数据提供方的身份注册失败。
(3)区块链系统将数据提供方标识发送给第一设备。区块链系统仅将数据提供方标识发送给第一设备。数据提供方的公钥和私钥均托管于区块链系统。
数据使用方的身份注册过程可以包括如下步骤(1)-步骤(3):
(1)第二设备向区块链系统发送身份注册请求。该身份注册请求用于请求为数据使用方进行身份注册,该身份注册请求携带数据使用方的身份信息。
(2)区块链系统接收到第二设备发送的身份注册请求后,根据该身份信息为数据使用方进行身份注册,在身份注册成功时,为数据使用方分配公钥、私钥和数据使用方标识。
数据使用方标识用于标识数据使用方的身份。比如,数据使用方标识可以为数据使用方账号、第二设备标识等。第二设备标识用于标识第二设备,如第二设备标识可以是第二设备的UUID、MAC地址、IP地址、或出厂序列号等。
为数据使用方分配的公钥和私钥是一对密钥,数据使用方的公钥和私钥中的一个用于加密,另一个用于解密。区块链系统可以将为数据使用方分配的公钥、私钥和数据使用方标识对应存储,如此后续可以根据数据使用方标识,获取数据使用方的公钥或私钥。
其中,区块链系统根据该身份信息为数据使用方进行身份注册的操作可以为:区块链系统对该身份信息进行验证;若该身份信息验证通过,则确定数据使用方的身份注册成功;若该身份信息验证失败,则确定数据使用方的身份注册失败。
(3)区块链系统将数据使用方标识发送给第二设备。区块链系统仅将数据使用方标识发送给第一设备。数据使用方的公钥和私钥均托管于区块链系统。
下面对本申请实施例提供的数据共享方法进行详细地解释说明。
图4是本申请实施例提供的一种数据共享方法的流程图。参见图4,包括以下步骤。
步骤401:第一设备将目标数据存储至区块链系统。
目标数据为数据提供方提供的可被共享的数据。
具体地,步骤401可以包括如下步骤(1)-步骤(3):
(1)第一设备向区块链系统发送数据托管请求。
该数据托管请求用于请求将目标数据托管于区块链系统上。该数据托管请求携带目标数据和目标数据的属性信息,目标数据的属性信息可以包括数据提供方标识、使用期限、适用场景等一个或多个属性信息。
(2)区块链系统接收到第一设备发送的数据托管请求后,对该数据托管请求携带的目标数据进行存储,得到目标数据存储信息;将该数据托管请求携带的数据提供方标识与目标数据存储信息对应存储。
其中,区块链系统对目标数据进行存储时,可以将目标数据存储至区块链;或者,可以将目标数据的哈希值存储至区块链,将目标数据存储至数据库中。
其中,区块链系统将目标数据存储至区块链时,可以根据智能合约将目标数据上链。也即,区块链系统可以调用智能合约来生成存储有目标数据的区块,并将该区块添加到共享的区块链中。如此,目标数据将不可被篡改。
其中,区块链系统将目标数据的哈希值存储至区块链的操作与上述区块链系统将目标数据存储至区块链的操作类似,本申请实施例对此不再赘述。
智能合约是基于区块链可信的不可篡改的数据,可以自动化的执行一些预先定义好的规则和条款。在区块链架构中,智能合约以链上代码的形式储存在区块链的区块中。可以通过调用智能合约来执行特定的操作。
目标数据存储信息用于指示目标数据的存储位置,根据目标数据存储信息可以获取到目标数据。示例地,目标数据存储信息可以为用于标识目标数据本身的一些信息,如目标数据存储信息可以为目标数据的名称等。或者,当区块链系统是直接将目标数据存储至区块链时,目标数据存储信息可以为用于标识存储有目标数据的区块的一些信息,如目标数据存储信息可以为区块高度等。
(3)区块链系统将目标数据存储信息发送给第一设备。
步骤402:第二设备向第一设备发送数据使用请求。
该数据使用请求用于请求使用第一设备共享的数据。该数据使用请求可以携带数据使用方标识和数据特征信息。该数据特征信息用于指示数据使用方想要使用的数据的特征。该数据特征信息可以包括数据发布时间、数据性质等。比如,该数据特征信息用于指示数据使用方想要使用的是在8月发布的财政数据。
一种可能的实现方式中,第二设备上可以显示有数据共享页面,该数据共享页面中显示有数据搜索框和下载选项。若数据使用方想要使用数据,则可以在数据搜索框中输入数据特征信息,然后点击下载选项来触发数据使用指令。第二设备检测到该数据使用指令后,可以向第一设备发送数据使用请求。
步骤403:第一设备接收到第二设备发送的数据使用请求后,向区块链系统发送数据获取请求。
该数据获取请求用于请求获取第一设备存储到区块链系统的目标数据对应的加密数据。该数据获取请求可以携带数据使用方标识。进一步地,该数据获取请求还可以携带目标数据存储信息。
其中,第一设备向区块链系统发送数据获取请求时,可以调用智能合约共享数据获取接口来向区块链系统发送该数据获取请求。
进一步地,第一设备向区块链系统发送数据获取请求之前,可以先在第一设备共享的数据中查找特征信息与该数据使用请求携带的数据特征信息一致的数据,若目标数据的特征信息与该数据特征信息一致,再向区块链系统发送数据获取请求。
目标数据的特征信息用于指示目标数据的特征。目标数据的特征信息可以包括目标数据的发布时间、性质等。比如,目标数据的特征信息可以用于指示目标数据是在8月24日发布的财政数据。
假设该数据特征信息用于指示数据使用方想要使用的是在8月发布的财政数据,且目标数据的特征信息用于指示目标数据是在8月24日发布的财政数据,则第一设备可以确定目标数据的特征信息与该数据特征信息一致,此时第一设备可以向区块链系统发送数据获取请求。
更进一步地,第一设备在共享的数据中查找特征信息与该数据使用请求携带的数据特征信息一致的数据之前,还可以先审核该数据使用请求,在审核通过后再在共享的数据中查找特征信息与该数据使用请求携带的数据特征信息一致的数据。
第一设备对该数据使用请求的审核可以是自动进行的,比如第一设备可以按照预设的数据使用条件对该数据使用请求进行审核,该数据使用条件可以根据具体的业务需求进行预先设置。若该数据使用请求满足该数据使用条件,则第一设备确定该数据使用请求审核通过;若该数据使用请求不满足该数据使用条件,则第一设备确定该数据使用请求审核未通过。
或者,第一设备对该数据使用请求的审核可以是手动进行的,比如可以由数据提供方来对该数据使用请求进行审核。数据提供方确定该数据使用请求不存在问题时,可以触发审核通过指令,第一设备检测到该审核通过指令后,确定该数据使用请求审核通过;数据提供方确定该数据使用请求存在问题时,可以触发审核未通过指令,第一设备检测到该审核未通过指令后,确定该数据使用请求审核未通过。
步骤404:区块链系统接收到第一设备发送的数据获取请求后,使用数据提供方的公钥对目标数据进行加密,得到加密数据;设置数据使用方标识具有目标数据的使用权限。
进一步地,区块链系统使用数据提供方的公钥对目标数据进行加密,得到加密数据之前,可以先根据该数据获取请求携带的目标数据存储信息获取目标数据;获取与该数据获取请求携带的目标数据存储信息对应存储的数据提供方标识,根据获取到的数据提供方标识获取数据提供方的公钥,之后,再使用数据提供方的公钥对目标数据进行加密,得到加密数据。
其中,区块链系统设置数据使用方标识具有目标数据的使用权限的操作可以为:区块链系统将数据提供方标识作为加密方标识,将数据使用方标识作为权限方标识,将该加密数据的加密数据标识、该加密方标识和该权限方标识对应存储。
该加密数据的加密数据标识用于标识该加密数据,如该加密数据的加密数据标识可以为该加密数据的名称等。该加密数据的加密数据标识可以在不解密该加密数据的情况下从该加密数据直接获得。
该加密方标识用于指示该加密数据是由哪方加密。该权限方标识用于指示该加密数据可供哪方使用。如此,区块链系统将数据提供方标识作为加密方标识,将数据使用方标识作为权限方标识,将该加密数据的加密数据标识、该加密方标识和该权限方标识对应存储后,就表示该加密数据是由数据提供方加密,且可供数据使用方进行使用。由于该加密数据是对目标数据加密得到,所以此时数据使用方标识就具有了目标数据的使用权限。
步骤405:区块链系统将该加密数据发送给第二设备。
可选地,区块链系统可以将该加密数据发送给第一设备,由第一设备将该加密数据发送给第二设备。或者,区块链系统可以直接将该加密数据发送给第二设备。
本申请实施例中,通过调用智能合约共享数据获取接口,可以执行合约逻辑,来实现第一设备向区块链系统发送数据获取请求、区块链系统获取目标数据对应的加密数据并发送给第二设备、区块链系统设置数据使用方对目标数据的使用权限的这一系列操作。
值得说明的是,本申请实施例中,第二设备若想使用目标数据,则需要通过第一设备来指示区块链系统设置数据使用方对目标数据的使用权限。也就是说,数据使用方若想使用目标数据,需要在通过数据提供方的审批后,才能拿到对目标数据的使用权限。如此,区块链系统将该加密数据发送给第二设备后,对于数据使用方手中的该加密数据,因数据使用方拿到了对目标数据的使用权限,所以数据使用方可以根据该加密数据获得目标数据。而如果存在对该加密文件恶意散播的情况,第三方在未通过数据提供方的审批的情况下仍旧是不能获得目标数据的,只有在通过数据提供方的审批后方可获得目标数据的使用权限,然后才能通过该加密数据获得目标数据。
对于数据提供方来说,可以对目标数据的使用权限进行控制。比如,数据提供方若想限制数据使用方对目标数据的使用,则可以取消数据使用方对目标数据的使用权限。具体地,第一设备可以向区块链系统发送数据限制使用请求,该数据限制使用请求携带数据使用方标识和该加密数据的加密数据标识;区块链系统接收到该数据限制使用请求后,可以将与该加密数据标识对应存储的权限方标识中的数据使用方标识删除,如此,数据使用方标识就不再具有目标数据的使用权限。
步骤406:第二设备接收到该加密数据后,向区块链系统发送数据查看请求。
该数据查看请求用于请求查看该加密数据对应的解密数据,即请求查看目标数据。该数据查看请求携带数据使用方标识和该加密数据。
一种可能的实现方式中,第二设备上可以显示有数据共享页面,该数据共享页面中显示有下载选项。若数据使用方想要使用数据,则可以点击下载选项,以指示第二设备向第一设备发送数据使用请求。之后,第二设备会接收到该加密数据,此时第二设备可以将该加密数据显示在该数据共享页面上。如此,数据使用方通过点击该数据共享页面上的下载选项就实现了对想要使用的数据所对应的加密数据的获取。
一种可能的实现方式中,第二设备上可以显示有数据查看页面,该数据查看页面中显示有数据上传入口。数据使用方通过该数据上传入口上传该加密数据后,第二设备就会向区块链系统发送数据查看请求。
步骤407:区块链系统接收到第二设备发送的数据查看请求后,若确定该数据查看请求携带的数据使用方标识具有目标数据的使用权限,则使用数据提供方的私钥对该数据查看请求携带的加密数据进行解密,得到解密数据。
具体地,区块链系统接收到第二设备发送的数据查看请求后,可以先获取与该数据查看请求携带的加密数据的加密数据标识对应存储的权限方标识和加密方标识,若获取到的权限方标识包括该数据查看请求携带的数据使用方标识,则确定数据使用方标识具有目标数据的使用权限。之后,区块链系统根据获取到的加密方标识(即数据提供方标识)获取数据提供方的私钥,使用数据提供方的私钥对该数据查看请求携带的加密数据进行解密,得到解密数据。
步骤408:区块链系统将解密数据发送给第二设备。
进一步地,区块链系统将该解密数据发送给第二设备之前,还可以先检测该解密数据是否被篡改。若该解密数据未被篡改,则区块链系统将该解密数据发送给第二设备;若该解密数据已被篡改,则区块链系统不将该解密数据发送给第二设备,而是向第二设备发送提醒消息,以提醒数据使用方其获得的加密数据存在问题。
一种可能的方式中,若区块链系统此前是将目标数据直接存储至区块链,则区块链系统可以从区块链中获取该加密数据对应的目标数据;若获取到的目标数据与该解密数据相同,则可以确定该解密数据未被篡改,就是目标数据;若获取到的目标数据与该解密数据不同,则可以确定该解密数据已被篡改,不是目标数据。
另一种可能的方式中,若区块链系统此前是将目标数据的哈希值存储至区块链,则区块链系统可以从区块链中获取该加密数据对应的目标数据的哈希值作为第一哈希值,然后计算该解密数据的哈希值作为第二哈希值;若第一哈希值与第二哈希值相同,则可以确定该解密数据未被篡改,就是目标数据;若第一哈希值与第二哈希值不同,则可以确定该解密数据已被篡改,不是目标数据。
进一步地,区块链系统将该解密数据发送给第二设备之前,还可以先获取该加密数据对应的目标数据的使用期限;若当前时间处于目标数据的使用期限内,则将该解密数据发送给第二设备;若当前时间不处于目标数据的使用期限内,则不将该解密数据发送给第二设备,而是向第二设备发送提醒消息,以提醒数据使用方当前已超过目标数据的使用期限。
具体地,区块链系统将该解密数据发送给第二设备的操作可以为:区块链系统生成用于展示该解密数据的页面。区块链系统在该页面中嵌入水印信息,该水印信息可以包括目标数据的一个或多个属性信息,如可以包括数据提供方标识、使用期限、适用场景等中的一个或多个;和/或,区块链系统设置该页面的内容保存功能处于禁用状态。区块链系统将该页面发送给第二设备进行显示。
区块链系统在该页面中嵌入水印信息后,若第二设备对该页面进行截图,则截图得到的图像中会包含有该水印信息。区块链系统设置该页面的内容保存功能处于禁用状态后,第二设备将不能将该页面中的内容保存到本地。
这种情况下,第二设备接收到该页面后,可以显示该页面,数据使用方可以在该页面上查看该解密数据,但不能将该解密数据单独保存到本地,从而可以有效防止该解密数据被恶意扩散。
一种可能的实现方式中,第二设备上可以显示有数据查看页面,该数据查看页面中显示有数据上传入口。数据使用方通过该数据上传入口上传该加密数据后,第二设备就会向区块链系统发送数据查看请求。之后,第二设备会接收到区块链系统返回的包含有该加密数据对应的解密数据的页面,第二设备可以显示该页面,以供数据使用方查看。
在本申请实施例中,区块链系统将第一设备中的目标数据存储后,若接收到第一设备发送的数据获取请求,则使用数据提供方的公钥对目标数据进行加密,得到加密数据并发送给第二设备,以及设置数据使用方标识具有目标数据的使用权限。由于区块链的不可篡改性,所以第二设备从区块链系统获取到的加密数据的来源可保证,该加密数据安全可信。之后,若区块链系统接收到第二设备发送的数据查看请求,则在确定数据使用方标识具有目标数据的使用权限的情况下,可以使用数据提供方的私钥对该加密数据进行解密,得到解密数据并发送给第二设备。如此,数据传输过程安全,可以保证获得的解密数据可信、不可篡改。
图5是本申请实施例提供的一种数据共享方法的流程图。该方法应用于区块链系统,该区块链系统可以是上文图1-图2实施例所述的区块链系统100。参见图5,该方法可以包括如下步骤:
步骤501:对第一设备中的目标数据进行存储。步骤501的相关内容已在上文图4实施例中的步骤401进行详细说明,本申请实施例对此不再赘述。
步骤502:接收到第一设备发送的携带有数据使用方标识的数据获取请求后,使用数据提供方的公钥对目标数据进行加密,得到加密数据;设置数据使用方标识具有目标数据的使用权限。步骤502的相关内容已在上文图4实施例中的步骤403和步骤404进行详细说明,本申请实施例对此不再赘述。
步骤503:将该加密数据发送给第二设备。步骤503的相关内容已在上文图4实施例中的步骤405进行详细说明,本申请实施例对此不再赘述。
步骤504:接收到第二设备发送的携带有数据使用方标识和该加密数据的数据查看请求后,若确定数据查看请求携带的数据使用方标识具有目标数据的使用权限,则使用数据提供方的私钥对数据查看请求携带的加密数据进行解密,得到解密数据。步骤504的相关内容已在上文图4实施例中的步骤406和步骤407进行详细说明,本申请实施例对此不再赘述。
步骤505:将该解密数据发送给第二设备。步骤505的相关内容已在上文图4实施例中的步骤408进行详细说明,本申请实施例对此不再赘述。
在本申请实施例中,区块链系统将第一设备中的目标数据存储后,若接收到第一设备发送的数据获取请求,则使用数据提供方的公钥对目标数据进行加密,得到加密数据并发送给第二设备,以及设置数据使用方标识具有目标数据的使用权限。由于区块链的不可篡改性,所以第二设备从区块链系统获取到的加密数据的来源可保证,该加密数据安全可信。之后,若区块链系统接收到第二设备发送的数据查看请求,则在确定数据使用方标识具有目标数据的使用权限的情况下,可以使用数据提供方的私钥对该加密数据进行解密,得到解密数据并发送给第二设备。如此,数据传输过程安全,可以保证获得的解密数据可信、不可篡改。
图6是本申请实施例提供的一种数据共享装置的结构示意图,该装置可以应用于区块链系统,该区块链系统可以为上文图1-图2实施例的区块链系统100。参见图6,该装置包括:存储模块601、加密模块602、发送模块603、解密模块604。
存储模块601,用于对第一设备中的目标数据进行存储;加密模块602,用于接收到第一设备发送的携带有数据使用方标识的数据获取请求后,使用数据提供方的公钥对目标数据进行加密,得到加密数据;设置数据使用方标识具有目标数据的使用权限;发送模块603,用于将加密数据发送给第二设备;解密模块604,用于接收到第二设备发送的携带有数据使用方标识和加密数据的数据查看请求后,若确定数据查看请求携带的数据使用方标识具有目标数据的使用权限,则使用数据提供方的私钥对数据查看请求携带的加密数据进行解密,得到解密数据;发送模块603,还用于将该解密数据发送给第二设备。
可选地,存储模块601用于:接收第一设备发送的数据托管请求,数据托管请求携带目标数据和目标数据的属性信息,目标数据的属性信息包括数据提供方标识;对目标数据进行存储,得到目标数据存储信息;将数据提供方标识与目标数据存储信息对应存储;将目标数据存储信息发送给第一设备。可选地,数据获取请求携带数据使用方标识和目标数据存储信息。可选地,该装置还包括:获取模块,用于接收到数据获取请求后,根据数据获取请求携带的目标数据存储信息从区块链获取目标数据;获取与数据获取请求携带的目标数据存储信息对应存储的数据提供方标识,根据获取到的数据提供方标识获取数据提供方的公钥。可选地,加密模块602用于:将数据提供方标识作为加密方标识,将数据使用方标识作为权限方标识,将加密数据的加密数据标识、加密方标识和权限方标识对应存储。可选地,解密模块604用于:获取与数据查看请求携带的加密数据的加密数据标识对应存储的权限方标识和加密方标识;若获取到的权限方标识包括数据查看请求携带的数据使用方标识,则根据获取到的加密方标识获取数据提供方的私钥,使用数据提供方的私钥对数据查看请求携带的加密数据进行解密,得到解密数据。可选地,发送模块603用于:生成用于展示解密数据的页面;在页面中嵌入水印信息,水印信息包括数据提供方标识;和/或,设置页面的内容保存功能处于禁用状态;将页面发送给第二设备进行显示。可选地,该装置还包括:接收模块,用于接收第一设备发送的身份注册请求,身份注册请求携带数据提供方的身份信息;注册模块,用于根据身份信息为数据提供方进行身份注册,在身份注册成功时,为数据提供方分配公钥、私钥和数据提供方标识;发送模块603,还用于将数据提供方标识发送给第一设备。
在本申请实施例中,区块链系统将第一设备中的目标数据存储后,若接收到第一设备发送的数据获取请求,则使用数据提供方的公钥对目标数据进行加密,得到加密数据并发送给第二设备,以及设置数据使用方标识具有目标数据的使用权限。由于区块链的不可篡改性,所以第二设备从区块链系统获取到的加密数据的来源可保证,该加密数据安全可信。之后,若区块链系统接收到第二设备发送的数据查看请求,则在确定数据使用方标识具有目标数据的使用权限的情况下,可以使用数据提供方的私钥对该加密数据进行解密,得到解密数据并发送给第二设备。如此,数据传输过程安全,可以保证获得的解密数据可信、不可篡改。
需要说明的是:上述实施例提供的数据共享装置在数据共享时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。
上述实施例提供的数据共享装置与数据共享方法实施例属于同一构思,上述实施例中单元、模块的具体工作过程及带来的技术效果,可参见方法实施例部分,此处不再赘述。
图7为本申请实施例提供的一种计算机设备的结构示意图。如图7所示,计算机设备7包括:处理器70、存储器71以及存储在存储器71中并可在处理器70上运行的计算机程序72,处理器70执行计算机程序72时实现上文图5实施例中的数据共享方法中的步骤。
计算机设备7可以是通用计算机设备或专用计算机设备。在具体实现中,计算机设备7可以是由多台服务器组成的服务器集群。本领域技术人员可以理解,图7仅仅是计算机设备7的举例,并不构成对计算机设备7的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,比如还可以包括输入输出设备、网络接入设备等。
处理器70可以是中央处理单元(Central Processing Unit,CPU),处理器70还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者也可以是任何常规的处理器。
存储器71在一些实施例中可以是计算机设备7的内部存储单元,比如计算机设备7的硬盘或内存。存储器71在另一些实施例中也可以是计算机设备7的外部存储设备,比如计算机设备7上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,存储器71还可以既包括计算机设备7的内部存储单元也包括外部存储设备。存储器71用于存储操作系统、应用程序、引导装载程序(BootLoader)、数据以及其他程序等,比如计算机程序的程序代码等。存储器71还可以用于暂时地存储已经输出或者将要输出的数据。
本申请实施例还提供了一种计算机设备,该计算机设备包括:至少一个处理器、存储器以及存储在该存储器中并可在该至少一个处理器上运行的计算机程序,该处理器执行该计算机程序时实现上述任意各个方法实施例中的步骤。
本申请实施例还提供了一种计算机可读存储介质,该计算机可读存储介质存储有计算机程序,该计算机程序被处理器执行时实现可实现上述各个方法实施例中的步骤。
本申请实施例提供了一种计算机程序产品,当其在计算机上运行时,使得计算机执行上述各个方法实施例中的步骤。
集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述方法实施例中的全部或部分流程,可以通过计算机程序来指令相关的硬件来完成,该计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,该计算机程序包括计算机程序代码,该计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。该计算机可读介质至少可以包括:能够将计算机程序代码携带到拍照装置/终端设备的任何实体或装置、记录介质、计算机存储器、ROM(Read-Only Memory,只读存储器)、RAM(Random Access Memory,随机存取存储器)、CD-ROM(Compact Disc Read-Only Memory,只读光盘)、磁带、软盘和光数据存储设备等。本申请提到的计算机可读存储介质可以为非易失性存储介质,换句话说,可以是非瞬时性存储介质。
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。

Claims (12)

  1. 一种数据共享方法,其特征在于,所述方法包括:
    第一设备将目标数据存储至区块链系统;
    所述第一设备接收到第二设备发送的数据使用请求后,向所述区块链系统发送数据获取请求,所述数据获取请求携带数据使用方标识;
    所述区块链系统接收到所述数据获取请求后,使用数据提供方的公钥对所述目标数据进行加密,得到加密数据;设置所述数据使用方标识具有所述目标数据的使用权限;将所述加密数据发送给所述第二设备;
    所述第二设备接收到所述加密数据后,向所述区块链系统发送数据查看请求,所述数据查看请求携带所述数据使用方标识和所述加密数据;
    所述区块链系统接收到所述数据查看请求后,若确定所述数据查看请求携带的数据使用方标识具有所述目标数据的使用权限,则使用所述数据提供方的私钥对所述数据查看请求携带的加密数据进行解密,得到解密数据;将所述解密数据发送给所述第二设备。
  2. 如权利要求1所述的方法,其特征在于,所述第一设备将目标数据存储至区块链系统,包括:
    所述第一设备向所述区块链系统发送数据托管请求,所述数据托管请求携带所述目标数据和所述目标数据的属性信息,所述目标数据的属性信息包括数据提供方标识;
    所述区块链系统接收到所述数据托管请求后,对所述目标数据进行存储,得到目标数据存储信息;将所述数据提供方标识与所述目标数据存储信息对应存储;将所述目标数据存储信息发送给所述第一设备。
  3. 如权利要求2所述的方法,其特征在于,所述第一设备接收到第二设备发送的数据使用请求后,向所述区块链系统发送数据获取请求,包括:
    所述第一设备接收所述第二设备发送的数据使用请求,所述数据使用请求携带所述数据使用方标识和数据特征信息;
    若所述目标数据的特征信息与所述数据特征信息一致,则所述第一设备向所述区块链系统发送数据获取请求,所述数据获取请求携带所述数据使用方标识和所述目标数据存储信息。
  4. 如权利要求3所述的方法,其特征在于,所述方法还包括:
    所述区块链系统接收到所述数据获取请求后,根据所述数据获取请求携带的目标数据存储信息获取所述目标数据;获取与所述数据获取请求携带的目标数据存储信息对应存储的数据提供方标识,根据获取到的数据提供方标识获取所述数据提供方的公钥;
    所述区块链系统设置所述数据使用方标识具有所述目标数据的使用权限,包括:
    所述区块链系统将所述数据提供方标识作为加密方标识,将所述数据使用方标识作为权限方标识,将所述加密数据的加密数据标识、所述加密方标识和所述权限方标识对应存储。
  5. 如权利要求4所述的方法,其特征在于,所述若所述区块链系统确定所述数据查看请求携带的数据使用方标识具有所述目标数据的使用权限,则使用所述数据提供方的私钥对所述数据查看请求携带的加密数据进行解密,得到解密数据,包括:
    所述区块链系统获取与所述数据查看请求携带的加密数据的加密数据标识对应存储的权限方标识和加密方标识;
    若获取到的权限方标识包括所述数据查看请求携带的数据使用方标识,则所述区块链系统根据获取到的加密方标识获取所述数据提供方的私钥,使用所述数据提供方的私钥对所述数据查看请求携带的加密数据进行解密,得到解密数据。
  6. 如权利要求2-5任一所述的方法,其特征在于,所述区块链系统将所述解密数据发送给所述第二设备,包括:
    所述区块链系统生成用于展示所述解密数据的页面;
    所述区块链系统在所述页面中嵌入水印信息,所述水印信息包括所述数据提供方标识;和/或,设置所述页面的内容保存功能处于禁用状态;
    所述区块链系统将所述页面发送给所述第二设备进行显示。
  7. 如权利要求1-5任一所述的方法,其特征在于,所述第一设备将目标数据存储至区块链系统之前,还包括:
    所述第一设备向所述区块链系统发送身份注册请求,所述身份注册请求携带所述数据提供方的身份信息;
    所述区块链系统接收到所述身份注册请求后,根据所述身份信息为所述数据提供方进行身份注册,在身份注册成功时,为所述数据提供方分配公钥、私钥和数据提供方标识;将所述数据提供方标识发送给所述第一设备。
  8. 一种数据共享系统,其特征在于,所述数据共享系统包括第一设备、第二设备和区块链系统;
    所述第一设备,用于将目标数据存储至所述区块链系统;
    所述第一设备,还用于接收到所述第二设备发送的数据使用请求后,向所述区块链系统发送数据获取请求,所述数据获取请求携带数据使用方标识;
    所述区块链系统,用于接收到所述数据获取请求后,使用数据提供方的公钥对所述目标数据进行加密,得到加密数据;设置所述数据使用方标识具有所述目标数据的使用权限;将所述加密数据发送给所述第二设备;
    所述第二设备,用于接收到所述加密数据后,向所述区块链系统发送数据查看请求,所述数据查看请求携带所述数据使用方标识和所述加密数据;
    所述区块链系统,用于接收到所述数据查看请求后,若确定所述数据查看请求携带的数据使用方标识具有所述目标数据的使用权限,则使用所述数据提供方的私钥对所述数据查看请求携带的加密数据进行解密,得到解密数据;将所述解密数据发送给所述第二设备。
  9. 一种数据共享方法,其特征在于,应用于数据共享系统中的区块链系统,所述数据共享系统包括第一设备、第二设备和所述区块链系统,所述方法包括:
    对所述第一设备中的目标数据进行存储;
    接收到所述第一设备发送的携带有数据使用方标识的数据获取请求后,使用数据提供方的公钥对所述目标数据进行加密,得到加密数据;设置所述数据使用方标识具有所述目标数据的使用权限;
    将所述加密数据发送给所述第二设备;
    接收到所述第二设备发送的携带有所述数据使用方标识和所述加密数据的数据查看请求后,若确定所述数据查看请求携带的数据使用方标识具有所述目标数据的使用权限,则使用所述数据提供方的私钥对所述数据查看请求携带的加密数据进行解密,得到解密数据;
    将所述解密数据发送给所述第二设备。
  10. 一种数据共享装置,其特征在于,应用于数据共享系统中的区块链系统,所述数据共享系统包括第一设备、第二设备和所述区块链系统,所述装置包括:
    存储模块,用于对所述第一设备中的目标数据进行存储;
    加密模块,用于接收到所述第一设备发送的携带有数据使用方标识的数据获取请求后,使用数据提供方的公钥对所述目标数据进行加密,得到加密数据;设置所述数据使用方标识具有所述目标数据的使用权限;
    发送模块,用于将所述加密数据发送给所述第二设备;
    解密模块,用于接收到所述第二设备发送的携带有所述数据使用方标识和所述加密数据的数据查看请求后,若确定所述数据查看请求携带的数据使用方标识具有所述目标数据的使用权限,则使用所述数据提供方的私钥对所述数据查看请求携带的加密数据进行解密,得到解密数据;
    所述发送模块,还用于将所述解密数据发送给所述第二设备。
  11. 一种计算机设备,其特征在于,所述计算机设备包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,所述计算机程序被所述处理器执行时实现如权利要求9所述的方法。
  12. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求9所述的方法。
PCT/CN2020/138055 2020-12-09 2020-12-21 数据共享方法、系统、装置、设备和存储介质 WO2022120938A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011432334.8A CN112532646B (zh) 2020-12-09 2020-12-09 数据共享方法、系统、装置、设备和存储介质
CN202011432334.8 2020-12-09

Publications (1)

Publication Number Publication Date
WO2022120938A1 true WO2022120938A1 (zh) 2022-06-16

Family

ID=74998789

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/138055 WO2022120938A1 (zh) 2020-12-09 2020-12-21 数据共享方法、系统、装置、设备和存储介质

Country Status (2)

Country Link
CN (1) CN112532646B (zh)
WO (1) WO2022120938A1 (zh)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113792318A (zh) * 2021-09-18 2021-12-14 上海数据交易中心有限公司 数据授权方法及装置、计算机可读存储介质、计算机设备
CN114221791B (zh) * 2021-11-19 2023-06-23 建信金融科技有限责任公司 数据处理方法、装置、设备及存储介质
CN113935070B (zh) * 2021-12-16 2022-06-07 北京百度网讯科技有限公司 基于区块链的数据处理方法、装置、设备以及存储介质
CN116504365A (zh) * 2023-06-25 2023-07-28 安徽影联云享医疗科技有限公司 一种医学影像信息共享方法及相关装置

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6839838B2 (en) * 2000-03-01 2005-01-04 Canon Kabushiki Kaisha Data management system, information processing apparatus, authentification management apparatus, method and storage medium
CN109639753A (zh) * 2018-10-26 2019-04-16 众安信息技术服务有限公司 一种基于区块链的数据共享方法及系统
CN110336833A (zh) * 2019-07-30 2019-10-15 中国工商银行股份有限公司 基于区块链的图片内容共识方法、服务器
CN111460400A (zh) * 2020-03-31 2020-07-28 腾讯科技(深圳)有限公司 一种数据处理方法、装置及计算机可读存储介质
CN111797415A (zh) * 2020-06-30 2020-10-20 远光软件股份有限公司 基于区块链的数据共享方法、电子设备和存储介质

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106992990A (zh) * 2017-05-19 2017-07-28 北京牛链科技有限公司 数据共享方法和系统以及区块链系统和计算设备
CN108462568B (zh) * 2018-02-11 2021-08-06 西安电子科技大学 一种基于区块链的安全文件存储和共享方法、云存储系统
CN108632284B (zh) * 2018-05-10 2021-02-23 网易(杭州)网络有限公司 基于区块链的用户数据授权方法、介质、装置和计算设备
CN108923925B (zh) * 2018-06-22 2022-11-08 北京京东尚科信息技术有限公司 应用于区块链的数据存储方法和装置
CN110535833B (zh) * 2019-08-07 2020-06-09 中国石油大学(北京) 一种基于区块链的数据共享控制方法
CN110719163B (zh) * 2019-09-29 2022-09-23 联想(北京)有限公司 一种信息处理方法、设备及存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6839838B2 (en) * 2000-03-01 2005-01-04 Canon Kabushiki Kaisha Data management system, information processing apparatus, authentification management apparatus, method and storage medium
CN109639753A (zh) * 2018-10-26 2019-04-16 众安信息技术服务有限公司 一种基于区块链的数据共享方法及系统
CN110336833A (zh) * 2019-07-30 2019-10-15 中国工商银行股份有限公司 基于区块链的图片内容共识方法、服务器
CN111460400A (zh) * 2020-03-31 2020-07-28 腾讯科技(深圳)有限公司 一种数据处理方法、装置及计算机可读存储介质
CN111797415A (zh) * 2020-06-30 2020-10-20 远光软件股份有限公司 基于区块链的数据共享方法、电子设备和存储介质

Also Published As

Publication number Publication date
CN112532646A (zh) 2021-03-19
CN112532646B (zh) 2022-08-16

Similar Documents

Publication Publication Date Title
US11301575B2 (en) Secure data synchronization
EP3404891B1 (en) Method and system for distributing digital content in peer-to-peer network
US11868509B2 (en) Method and arrangement for detecting digital content tampering
US11115205B2 (en) Method and apparatus for trusted computing
US10284372B2 (en) Method and system for secure management of computer applications
US9223988B1 (en) Extending browser functionality with dynamic on-the-fly downloading of untrusted browser components
RU2762141C2 (ru) Абстрактная идентификация анклава
WO2022120938A1 (zh) 数据共享方法、系统、装置、设备和存储介质
TW201931275A (zh) 用於具有分散式共識之分散式系統中之契約資料之存取控制方法及其契約產生器及驗證伺服器
CN110199288A (zh) 交叉平台包围区数据密封
US20220114249A1 (en) Systems and methods for secure and fast machine learning inference in a trusted execution environment
CN110199286A (zh) 利用密封包围区的数据密封
CN110214324A (zh) 密钥保管库包围区
CN110199284A (zh) 交叉平台包围区身份
CN110199285A (zh) 从属包围区二进制文件
CN110214321A (zh) 嵌套包围区身份
TWI817002B (zh) 文檔上傳下載方法、裝置、電腦裝置及介質
US20220092193A1 (en) Encrypted file control
US8495749B2 (en) Method, apparatus and computer program product for a content protection system for protecting personal content
JP6741236B2 (ja) 情報処理装置
CN115470525B (zh) 一种文件保护方法、系统、计算设备及存储介质
CN113407213B (zh) 资源包更新方法、装置、设备及存储介质
US20240004986A1 (en) Cla certificateless authentication of executable programs
CN116055105A (zh) 云存储数据的处理方法、装置和服务器
JP5180264B2 (ja) 装置鍵

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20964870

Country of ref document: EP

Kind code of ref document: A1