WO2023030450A1 - Data sharing method and electronic device - Google Patents

Data sharing method and electronic device Download PDF

Info

Publication number
WO2023030450A1
WO2023030450A1 PCT/CN2022/116520 CN2022116520W WO2023030450A1 WO 2023030450 A1 WO2023030450 A1 WO 2023030450A1 CN 2022116520 W CN2022116520 W CN 2022116520W WO 2023030450 A1 WO2023030450 A1 WO 2023030450A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
information
client
data sharing
accessed
Prior art date
Application number
PCT/CN2022/116520
Other languages
French (fr)
Chinese (zh)
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 WO2023030450A1 publication Critical patent/WO2023030450A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/176Support for shared access to files; File sharing support
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures

Definitions

  • This application belongs to the field of blockchain, and specifically relates to a data sharing method and electronic equipment.
  • Big data is called the "new oil" of the future. At present, whoever has more data resources will have more markets and users in this era of big data. However, while enjoying the convenience and benefits brought by data, it also bears the risk of personal information being leaked and personal life being disturbed. Therefore, it is necessary to introduce advanced technologies and solutions to realize the safe sharing of data resources.
  • the data user In the current way of sharing data resources, the data user usually obtains the plaintext data to be shared on the storage server through the data sharing platform after obtaining access rights. In this way, after the data user obtains the plaintext data, there is a possibility of illegally forwarding the plaintext data to other users, which leads to the inability to effectively guarantee the security and privacy of the shared data.
  • the purpose of the embodiments of the present application is to provide a data sharing method and an electronic device, which can solve the problem that the security and privacy of shared data cannot be effectively guaranteed.
  • the embodiment of the present application provides a data sharing method, which is applied to the first client, and the method includes:
  • the server receiving the first storage information and first permission information sent by the server based on the first smart contract, wherein the first smart contract belongs to the first block in the blockchain, and the first permission information is used to indicate the An access operation that the first client can perform on the data to be accessed;
  • the embodiment of the present application provides a data sharing method, which is applied to the second client, and the method includes:
  • the server Sending a data sharing request to the server, the data sharing request carrying second data sharing information and the digital signature of the second client, wherein the second data sharing information is used to describe the data to be shared;
  • the storage server stores the third encrypted data package and key information corresponding to the third encrypted data package.
  • the embodiment of the present application provides a data sharing method, which is applied to the server, and the method includes:
  • the first smart contract belongs to the first block in the block chain, the first storage information is used to obtain the data to be accessed from the storage server, and the first permission information indicates that the first user The access operation that the terminal can perform on the data to be accessed;
  • the data sharing request carries second data sharing information and a digital signature of the second client, and the second data sharing information is used to describe the data to be shared;
  • the second block includes a second smart contract
  • the second smart contract is used to indicate that the third storage information and the second permission information are output when the access conditions of the second smart contract are met.
  • the third storage information is used to acquire the data to be shared from a storage server.
  • the embodiment of the present application provides a data sharing device, which is applied to the first client, and the device includes:
  • the first sending module is configured to send a data access request to the server, the data access request carries first data sharing information, and the first data sharing information is associated with the data to be accessed;
  • the first receiving module is configured to receive the first storage information and the first authority information sent by the server based on the first smart contract, wherein the first smart contract belongs to the first block in the block chain, and the first The permission information is used to indicate the access operations that the first client can perform on the data to be accessed;
  • a first obtaining module configured to obtain a first encrypted data packet from a storage server according to the first storage information
  • a decryption module configured to decrypt the first encrypted data packet to obtain the data to be accessed, wherein the first encrypted data packet is generated based on the data to be accessed and metadata of the data to be accessed;
  • An access module configured to perform an access operation on the data to be accessed according to the first permission information.
  • the embodiment of the present application provides a data sharing device, which is applied to the second client, and the device includes:
  • the first smart contract belongs to the first block in the block chain, the first storage information is used to obtain the data to be accessed from the storage server, and the first permission information indicates that the first user The access operation that the terminal can perform on the data to be accessed;
  • Receive a data sharing request sent by a second client the data sharing request carries second data sharing information and a digital signature of the second client, and the second data sharing information is used to describe the data to be shared;
  • the second block includes a second smart contract
  • the second smart contract is used to indicate that the third storage information and the second permission information are output when the access conditions of the second smart contract are satisfied.
  • the third storage information is used to acquire the data to be shared from a storage server.
  • the embodiment of the present application provides a data sharing device, which is applied to the server, and the device includes:
  • the second receiving module is configured to receive a data access request sent by the first client, where the data access request carries first data sharing information, and the first data sharing information is associated with the data to be accessed;
  • the third sending module is configured to send the first storage information and the first authority information to the first smart contract according to the first smart contract when the first client meets the access conditions of the first smart contract user terminal;
  • the first smart contract belongs to the first block in the block chain
  • the first storage information is used to obtain the data to be accessed from the storage server
  • the first permission information indicates that the first user The access operation that the terminal can perform on the data to be accessed.
  • the third receiving module is configured to receive the data sharing request sent by the second client, the data sharing request carries the second data sharing information and the digital signature of the second client, and the second data sharing information is used to describe the share data;
  • a second generating module configured to generate second permission information according to the second data sharing information, where the second permission information is used to indicate access operations that can be performed on the data to be shared;
  • a third generating module configured to generate a second block according to the second data sharing information and the digital signature of the second client
  • the second block includes a second smart contract
  • the second smart contract is used to indicate that the third storage information and the second permission information are output when the access conditions of the second smart contract are met.
  • the third storage information is used to acquire the data to be shared from a storage server.
  • the embodiment of the present application provides an electronic device, the electronic device includes a processor, a memory, and a program or instruction stored in the memory and operable on the processor, and the program or instruction is executed by When executed, the processor implements the steps of the method described in the first aspect, or implements the steps of the method described in the second aspect, or implements the steps of the method described in the third aspect.
  • the embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented , or implement the steps of the method described in the second aspect, or the steps of the method described in the third aspect.
  • the embodiment of the present application provides a chip, the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is used to run programs or instructions, so as to implement the first aspect Said method, or implements the steps of the method described in the second aspect, or implements the steps of the method described in the third aspect.
  • the embodiment of the present application provides a computer program/program product, the computer program/program product is stored in a non-volatile storage medium, and the computer program/program product is executed by at least one processor to Implement the steps of the method described in the first aspect, or implement the steps of the method described in the second aspect, or implement the steps of the method described in the third aspect.
  • the embodiment of the present application provides a communication device configured to perform the steps of the method described in the first aspect, or configured to perform the steps of the method described in the second aspect, or configured to perform The steps of the method described in the third aspect.
  • the first client can send a data access request to the server, and receive the first storage information and the first permission information sent by the server based on the first smart contract, and use the first storage information to obtain data from the storage server.
  • Obtain the first encrypted data packet perform decryption to obtain the data to be accessed, and perform an access operation on the data to be accessed according to the first permission information, because the first permission information is used to indicate that the first client can be accessed Therefore, by controlling the access rights of the first client to the data to be accessed, it is possible to prevent the first client from illegally sending the data to be accessed to other users, reducing the risk of data leakage and improving data privacy sex and safety.
  • Fig. 1 is one of the flow charts of the steps of the data sharing method provided by the embodiment of the present application;
  • Fig. 2 is the second flow chart of the steps of the data sharing method provided by the embodiment of the present application.
  • FIG. 3 is the third flowchart of the steps of the data sharing method provided by the embodiment of the present application.
  • FIG. 4 is the fourth flowchart of the steps of the data sharing method provided by the embodiment of the present application.
  • FIG. 5 is one of the scene architecture diagrams provided by the embodiment of the present application.
  • FIG. 6 is the second scenario architecture diagram provided by the embodiment of the present application.
  • FIG. 7 is one of the schematic diagrams of the interaction process provided by the embodiment of the present application.
  • Fig. 8 is the second schematic diagram of the interaction process provided by the embodiment of the present application.
  • FIG. 9 is one of the structural schematic diagrams of the data sharing device provided by the embodiment of the present application.
  • Fig. 10 is the second structural diagram of the data sharing device provided by the embodiment of the present application.
  • Fig. 11 is the third structural diagram of the data sharing device provided by the embodiment of the present application.
  • Fig. 12 is the fourth schematic diagram of the structure of the data sharing device provided by the embodiment of the present application.
  • Fig. 13 is the fifth structural diagram of the data sharing device provided by the embodiment of the present application.
  • Fig. 14 is one of the structural schematic diagrams of the electronic device provided by the embodiment of the present application.
  • FIG. 15 is a second schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • FIG. 1 is a flow chart of the steps of the data sharing method provided by the embodiment of the present application.
  • the method can be applied to the first client, and the method includes:
  • Step 101 Send a data access request to a server, where the data access request carries first data sharing information, and the first data sharing information is associated with the data to be accessed.
  • Step 102 Receive the first storage information and the first permission information sent by the server based on the first smart contract, wherein the first smart contract belongs to the first block in the blockchain, and the first permission information is used for An access operation that the first client can perform on the data to be accessed is indicated.
  • Step 103 Acquire a first encrypted data package from a storage server according to the first storage information.
  • Step 104 Decrypt the first encrypted data packet to obtain the data to be accessed, wherein the first encrypted data packet is generated based on the data to be accessed and metadata of the data to be accessed.
  • Step 105 Perform an access operation on the data to be accessed according to the first permission information.
  • the above-mentioned first client can be understood as a data demander, specifically, it can be a mobile electronic device, or it can be a non-mobile electronic device.
  • the mobile electronic device may be a mobile phone, a tablet computer, a notebook computer, a palmtop computer, a vehicle electronic device, a wearable device, etc., which will not be listed here.
  • the server can be understood as a platform for sharing data.
  • the above-mentioned server can be connected to the blockchain network, and record the relevant information of the shared data through the blocks in the blockchain, and can display it to the data demander, so that the data demander can obtain the required data.
  • the above server may be composed of one or more servers, which are equivalent to different functional modules of the server.
  • the above-mentioned first client end may be communicatively connected with the server end, so as to send a data access request to the server end.
  • the above-mentioned data access request may be based on the user's input, for example, by clicking on the button or link to obtain the data to be accessed on the first user terminal.
  • the above-mentioned data access request may also be triggered by itself according to preset conditions, which is not limited here.
  • the above-mentioned data access request may carry the identity information of the first client and the first data sharing information, wherein the identity information of the first client may include an identity (Identity Document, ID) of the first client, so as to facilitate the service
  • the client determines the client sending the data access request.
  • the above identity information may also include the industry information, company information and personal information of the first client to represent the industry and company represented by the first client and the information of the user of the first client.
  • the above-mentioned identity information can be filled in by the user of the first client, for example, when registering an account, the above-mentioned identity information is filled in, so that the server can determine whether the first client has the right to access the data to be accessed.
  • the above-mentioned first data sharing information is used to describe the data to be accessed, and may be specifically determined by the data to be accessed. It can be understood that the server may store relevant information describing the data to be accessed, and may display part of the information to the first client. After the user determines the data to be accessed, the user may input , for example, click to obtain the interactive button or link corresponding to the data to be accessed to determine the above-mentioned first data sharing information.
  • the above-mentioned first data sharing information may also be manually filled in by the user, for example, by filling in the ID or name corresponding to the data to be accessed, publisher information, etc., to determine the data to be accessed that needs to be obtained.
  • the above-mentioned first storage information and first permission information are sent by the server based on the first smart contract.
  • the above-mentioned server is connected to the block chain network, so the above-mentioned first smart contract can be obtained from the first block in the block chain, and the above-mentioned first client meets the first access condition of the first smart contract
  • the server can send the above-mentioned first storage information and first permission information to the first client according to the instruction of the first smart contract.
  • the above-mentioned first storage information is used to obtain the data to be accessed from the storage server.
  • the above-mentioned first storage information may include verification information, which is used to check the authority with the storage server; in order to avoid data leakage, the data to be accessed is usually encrypted and stored, so the above-mentioned first storage information may also include decryption keys and storage Address and other related information are used to obtain the decryption key and encrypted data.
  • the above-mentioned storage server may be the server responsible for the storage function in the above-mentioned server, and may also be an external storage server.
  • the above-mentioned data to be shared may be stored in the above-mentioned storage server after encrypted processing, which is not limited herein.
  • the server can send the first permission information to the first client while sending the first storage information, the first permission information is used to indicate the access operations that the first client can perform on the data to be accessed, so that the access Control the operation authority to improve the privacy of the data to be accessed and avoid data leakage.
  • the above-mentioned access operations may include read operations, edit operations, and copy operations, etc.
  • the above-mentioned first permission information may be provided by the data provider, for example, the data provider specifies that the data to be accessed is read-only data.
  • the data provider may also provide the server with a permission list, including various allowed access operations, and the first client determines and receives the first permission information sent by the server according to the access operations performed as required.
  • both the above-mentioned first storage information and first permission information may be transmitted in the form of encrypted data packets, so as to improve the security of data transmission.
  • the user can obtain the first encrypted data package from the storage server according to the first storage information.
  • the above-mentioned first encrypted data packet is generated by encapsulating the data to be accessed and the metadata of the data to be accessed, and the metadata of the data to be accessed can be data information describing the data to be accessed, so that it can be determined according to the metadata of the data to be accessed.
  • the data to be accessed, and the first encrypted data packet corresponding to the data to be accessed is generated by encapsulating the data to be accessed and the metadata of the data to be accessed, and the metadata of the data to be accessed can be data information describing the data to be accessed, so that it can be determined according to the metadata of the data to be accessed.
  • the above-mentioned metadata of the data to be accessed may be generated by the data provider as follows:
  • Generate data information including but not limited to encrypted data packet identification, data provider identification, data provider's public key, address for executing data sharing smart contracts, etc.;
  • the data information and the signature on the data information together form the metadata of the data to be accessed.
  • the above-mentioned first encrypted data package is a file obtained by package processing, so it can be packaged and unpacked repeatedly, and the first client can perform the access operation on the data to be accessed after unpacking the first encrypted data package,
  • the data to be accessed is re-stored locally in the form of an encrypted data packet, thereby avoiding data leakage caused by the first client directly sending the data to be accessed to other illegal or unauthorized users for access by other illegal or unauthorized users.
  • the first client can obtain the above-mentioned first encrypted data packet through the first storage information, and can use the key information in the first storage information to decrypt the above-mentioned first encrypted data packet , get the data to be accessed.
  • the first user terminal can perform an access operation on the data to be accessed according to the first permission information.
  • the above steps 104 and 105 can be executed at the same time or in time division.
  • the first user end can read the first permission information at the same time, and only process the data to be accessed, so as to disable the data to be accessed except those indicated by the first permission information
  • the access operation other than the access operation obtains the processed data to be accessed.
  • the first client can send a data access request to the server, and receive the first storage information and the first permission information sent by the server based on the first smart contract, and use the first storage information to obtain data from the storage server.
  • Obtain the first encrypted data packet perform decryption to obtain the data to be accessed, and perform an access operation on the data to be accessed according to the first permission information, because the first permission information is used to indicate that the first client can be accessed Therefore, by controlling the access rights of the first client to the data to be accessed, it is possible to prevent the first client from illegally sending the data to be accessed to other users, reducing the risk of data leakage and improving data privacy sex and safety.
  • the first storage information includes first key information and first address information
  • the above step 103 includes:
  • the above step 104 includes:
  • the above-mentioned storage server may include the above-mentioned storage server may include a key storage server and a data storage server, and the above-mentioned to-be-accessed data may be encrypted to obtain an encrypted data packet and stored in the above-mentioned data storage server.
  • the first key information for decryption may be stored in the key storage server.
  • the above-mentioned first storage information may include first key information for obtaining access authority of the key server and first address information indicating a storage address of the first encrypted data packet.
  • the above-mentioned first key information may include a key and a storage address of the second key information, and the first client may access the storage server through the key, and obtain the second key information through the storage address of the second key information.
  • the first user can also obtain the first encrypted data packet from the storage server according to the first address information, so that the first encrypted data packet can be decrypted by using the second key information to obtain the data to be accessed.
  • the first client by storing the second key information and the first encrypted data package independently, the first client needs to obtain the second key information and the first encrypted data package from the storage server respectively, so as to obtain the Access to data further enhances data security.
  • the method further includes any of the following:
  • the data to be accessed is encapsulated to obtain a second encrypted data packet, and the stored Describe the second encrypted data packet.
  • the first client in order to prevent the first client from performing other operations on the data to be accessed locally after the first client end completes the access operation, in this embodiment of the application, after the above access operation is terminated, the first The user end can delete the data to be accessed and the first encrypted data package.
  • the first client can also repackage the data to be accessed and the metadata of the data to be accessed in the first encrypted data packet to obtain the second encrypted data packet and store it locally to avoid the first After the client decrypts the data to be accessed, it illegally shares the data to be accessed with other users to improve the security and privacy of the data.
  • the embodiment of the present application also provides a data sharing method, which is applied to the second client, and the method includes:
  • Step 201 Obtain second storage information of the data to be shared, where the second storage information indicates that the data to be shared corresponds to information stored in the storage server;
  • Step 202 Send a data sharing request to the server, the data sharing request carries second data sharing information and the digital signature of the second client, the second data sharing information is generated based on the second storage information, and is used for describe the data to be shared;
  • Step 203 generating a third encrypted data packet based on the metadata of the data to be shared and the data to be shared;
  • Step 204 According to the second storage information, store the third encrypted data package and key information corresponding to the third encrypted data package in the storage server.
  • the above-mentioned second client can be understood as a data provider, specifically, it can be a mobile electronic device, or it can be a non-mobile electronic device.
  • the mobile electronic device may be a mobile phone, a tablet computer, a notebook computer, a palmtop computer, a vehicle electronic device, a wearable device, etc., which will not be listed here.
  • the above-mentioned second client can also communicate with the server. It can be understood that the second client may or may not be the data provider of the first client. That is, the above steps 101-105 and steps 201-204 may be combined, or may be mutually independent interactive processes, which are not limited here. It can be understood that, when the second client is the data provider of the first client, the data referred to by the data to be accessed and the data referred to by the data to be shared are the same data.
  • the above-mentioned second storage information may be the registration information obtained by the second client from pre-registering with the storage server, which may include relevant information such as the storage address of the third encrypted data packet.
  • the data sharing request may be based on the user's input, for example, by clicking the release data button on the first user terminal.
  • the data sharing request may also be triggered automatically according to preset conditions, which is not limited here.
  • the data sharing request may carry the second data sharing information and the digital signature of the second client.
  • the digital signature of the second client is a character string generated by the second client to prove the authenticity of the information sent by the second client.
  • the above-mentioned second data sharing information may be used to describe the data to be shared.
  • the above-mentioned second data sharing information may include the identity information of the second user end, and the identity information of the second user end may include the ID of the second user end, and may also include the first The public key of the second client, so that the server can determine the client sending the data sharing request.
  • the above identity information can also include the industry information, company information and personal information of the second client to represent the industry represented by the second client , the company, and the user's own information on the second client end, when the shared data is released on the server end, it is convenient for the data demander to view the relevant information of the data provider.
  • the above-mentioned identity information can be filled in by the user of the second client terminal, for example, when registering an account, the above-mentioned identity information is filled in, and details will not be repeated here.
  • the above-mentioned second data sharing information may also include data storage information, data profile information, and sharing policy information, wherein the above-mentioned data storage information may include the storage address of the data to be shared, and if the data to be shared is ciphertext data, the identification ID of the ciphertext , key ID and key storage address, etc., so that the data demander can obtain the above-mentioned data to be shared according to the data storage information.
  • the above data profile information is used to characterize the attributes of the data to be shared, such as the category, profile, nature, purpose, and price of the data to be shared, so that the data demander can determine the required data based on the data profile information.
  • the above-mentioned sharing policy information is used to represent the user group that the second client terminal intends to share.
  • the above-mentioned sharing policy information may include target industry information and target group information, so that the server can judge whether the data demander can obtain the data based on the sharing policy information.
  • the above data to be shared may include target industry information and target group information, so that the server can judge whether the data demander can obtain the data based on the sharing policy information. The above data to be shared.
  • the above-mentioned second data sharing information may also include price and payment bill information to represent the revenue that the data provider intends to obtain for the above-mentioned data to be shared.
  • the above-mentioned second data sharing information may also include authorization information indicating that the data provider allows the access operations to be performed on the shared data, so that the data provider can choose the access operations it needs and obtain the corresponding access operations through payment operations. permission information.
  • the information contained in the above-mentioned second data sharing information can be filled in by the second client, for example, an information template can be created in the application program corresponding to the second client for the user of the second client to fill in , may also be automatically generated by the second client terminal according to the acquired data, which is not limited here.
  • the above-mentioned third encrypted data packet can be generated based on the data to be shared and the metadata of the data to be shared after packet processing, and the metadata of the above-mentioned data to be shared can be a description of the data to be shared
  • the data information, so that the data to be shared and the third encrypted data package corresponding to the data to be shared can be determined according to the metadata of the data to be shared.
  • the second client may upload the above-mentioned third encrypted data package and its corresponding key information to the storage server according to the second storage information registered in the storage server.
  • the second client when uploading the data to be shared, may process the data to be shared and the metadata package of the data to be shared to obtain the third encrypted data packet, and store the third encrypted data packet in the storage server , so that when the data demander obtains the data to be shared, the third encrypted data package can be obtained from the storage server. Since the third encrypted data packet can be encapsulated and decapsulated multiple times, it is ensured that the data to be shared is always stored locally on the data demand side in encrypted data packets, preventing the data demand side from performing illegal access operations on the shared data and improving data security. sex and privacy.
  • step 203 includes:
  • first data information corresponding to the data to be shared, where the first data information includes at least one of the following: a first identification indicating the second client, a second identification indicating the third encrypted data packet, and second address information indicating the second smart contract;
  • the second address information is sent by the server, the second smart contract belongs to the second block in the block chain, and the second smart contract is used to indicate that the second smart contract is satisfied
  • the server outputs third storage information and second permission information, the third storage information is used to obtain the data to be shared in the storage server, and the second permission information is used to indicate Access operations that can be performed on the data to be shared;
  • the above-mentioned metadata of the data to be shared may be generated based on the first data information, and the first data information includes but not limited to the first identification, the second identification and the second address information.
  • the above-mentioned second identifier may include an ID indicating the data provider, and may also include a public key of the data provider, which is not limited here.
  • the above-mentioned second smart contract is a smart contract generated by the server based on blockchain technology, which is used to indicate that the server outputs the third storage information and the second permission information when the access conditions of the second smart contract are met, That is, the third storage information and the second permission information are sent to the user terminal.
  • the above-mentioned second address information is the address for executing the second smart contract.
  • the above-mentioned second address information may be a Uniform Resource Locator (Uniform Resource Locator, URL) or a Uniform Resource Identifier (Uniform Resource Identifier, URI) address.
  • the above-mentioned third storage information is similar to the first storage information in the above-mentioned embodiment, and the above-mentioned second permission information is similar to the above-mentioned first permission information. To avoid repetition, details are not repeated here.
  • the digital signature operation performed by the second client on the first data information may specifically be that the second client first performs hash (Hash) calculation on the first data information. Then use the private key to sign the result of the hash calculation.
  • hash hash
  • the third encrypted data packet may be based on the first identifier indicating the second client, the second identifier indicating the third encrypted data packet, and the second address information indicating the second smart contract waiting to share data.
  • Metadata generation ensures that the third encrypted data package can be packaged and decapsulated multiple times according to the metadata of the data to be shared, thus ensuring that the data to be shared is always stored locally on the data demand side in an encrypted data package, preventing the data demand side from treating sharing
  • the data performs illegal access operations, which improves the security and privacy of the data.
  • the embodiment of the present application also provides a data sharing method, which is applied to the server, and the method includes:
  • Step 301 Receive a data access request sent by a first client, where the data access request carries first data sharing information, and the first data sharing information is associated with the data to be accessed;
  • Step 302 when the first client meets the access conditions of the first smart contract, according to the first smart contract, send the first storage information and the first authority information to the first client;
  • the first smart contract belongs to the first block in the block chain
  • the first storage information is used to obtain the data to be accessed from the storage server
  • the first permission information indicates that the first user The access operation that the terminal can perform on the data to be accessed.
  • Step 401 Receive a data sharing request sent by a second client, where the data sharing request carries second data sharing information and a digital signature of the second client, and the second data sharing information is used to describe the data to be shared;
  • Step 402 Generate third permission information according to the second data sharing information, the third permission information is used to determine second permission information, and the second permission information is used to indicate the actions that can be performed on the data to be shared access operation;
  • Step 403 generating a second block according to the second data sharing information and the digital signature of the second client;
  • the second block includes a second smart contract
  • the second smart contract is used to indicate that the third storage information and the second permission information are output when the access conditions of the second smart contract are satisfied.
  • the third storage information is used to acquire the data to be shared from a storage server.
  • the above-mentioned server may only perform the above-mentioned steps 301-302, or may only perform the above-mentioned steps 401-403, or may perform the above-mentioned steps 301-302 and steps 401-403 together.
  • the above-mentioned server end performs the above-mentioned steps 301-302 and the above-mentioned steps 401-403 together
  • the above-mentioned second client end can be the data provider of the above-mentioned first client end
  • the above-mentioned first client end can be the data provider of the above-mentioned second client end
  • the demand side that is, the data to be shared and the data to be accessed may be the same data.
  • the above-mentioned step 301 corresponds to the above-mentioned step 101, and in order to avoid repetition, details are not repeated here.
  • the server can determine whether the first client meets the access conditions of the first smart contract according to the identity information of the first client.
  • the access conditions of the first smart contract can be determined by the data provider to represent data
  • the user group that the provider intends to share, for example, the access conditions of the above-mentioned first smart contract can limit the target industry and target group, so that it can be judged based on the identity information of the first client whether the first client meets the requirements of the above-mentioned first smart contract.
  • the access condition is to send the first stored information corresponding to the data to be accessed to the first client according to the first smart contract when the first client meets the access condition of the first smart contract.
  • the above-mentioned first smart contract belongs to the first block in the blockchain, and the first block can be generated based on the data sharing information sent by the data provider corresponding to the data to be accessed.
  • the specific process can refer to the following The process of generating the second block will not be explained here. It can be understood that, if the data provider corresponding to the data to be accessed is the second client, the data sharing information is the second data sharing information.
  • the server after receiving the data access request from the first client, can send the first storage information and the first permission information to the first client, so that the first client can obtain the data to be accessed, and can perform an access operation on the data to be accessed according to the first permission information, since the first permission information is used to indicate the access operation that the first client can perform on the data to be accessed, it is possible to control the first
  • the access rights of the user end to the data to be accessed are used to prevent the first user end from illegally sending the data to be accessed to other users, reducing the risk of data leakage and improving the privacy and security of data.
  • the first client may first perform mutual authentication with the server, and the authentication credential may be a digital certificate or a key. After the authentication is successful, the above step 301 is then performed, thereby avoiding illegal user access data, improving the security of data sharing.
  • the above method before sending the first storage information and the first permission information to the first client, the above method further includes:
  • the third block includes an access record corresponding to the data to be accessed.
  • the server when the first client meets the access conditions of the first smart contract, the server can form a blockchain transaction based on the above-mentioned first data sharing information, and the server can transfer the above-mentioned blockchain to The transaction is sent to the existing blockchain infrastructure platform, and the above-mentioned third block is generated based on the existing open-source blockchain platform (such as Hyperledger Fabric, Ethereum Quorum), and the above-mentioned third block can include the above-mentioned data to be accessed
  • the corresponding access records are convenient for data providers or data demanders to query.
  • the above-mentioned blockchain transactions correspond to the above-mentioned access records and the first data sharing information, that is, each time the server receives a piece of first data sharing information, it can generate a Blockchain transactions and generate an access record.
  • the above-mentioned third block can also include multiple access records, that is, the server can generate M blockchain transactions after receiving M pieces of first data sharing information, and finally integrate The formed third block includes M access records.
  • M is a positive integer, and its value can be determined according to the maximum capacity of the third block.
  • M is greater than 1, the third block can include multiple access records, thereby avoiding the limitation of block capacity. waste.
  • the above-mentioned data access request also carries the identity information of the first client and the digital signature of the first client, and before the step of sending the first stored information to the first client, the method further includes :
  • the fourth block includes a third smart contract, the third smart contract is associated with the first smart contract, and is used to indicate that when the payment information sent by the first client is received, sending the first storage information and the first permission information to the first client;
  • the fifth block After receiving the payment information sent by the first client, generating a fifth block according to the payment information and the digital signature of the first client, the fifth block includes a payment record corresponding to the payment information;
  • step 302 comprises:
  • the second client When the first client meets the access conditions of the first smart contract and receives the payment information sent by the first client, according to the first smart contract and the third smart contract, the second The stored information and the first permission information are sent to the first user terminal.
  • the server can realize payment and billing functions during data sharing, so that the data provider can obtain benefits from the data demander. That is to say, when the above-mentioned data demander sends the data sharing information to the server, it can send the billing information associated with the above-mentioned data to be accessed, so that the server can send the above-mentioned billing information to first client.
  • the server when the server determines that the first client meets the access conditions of the first smart contract, the server can determine the data to be accessed according to the first data sharing information, and share the data with the identity information of the first client and the first data. information and the digital signature of the first client to generate a block chain transaction, the server can send the block chain transaction to the existing block chain infrastructure platform, based on the existing open source block chain platform (such as Hyperledger Fabric, Ethereum Quorum) generates the above-mentioned fourth block, the above-mentioned fourth block may include a third smart contract, the above-mentioned third smart contract is associated with the first smart contract, and is used to indicate that the payment sent by the first client is received In the case of information, the first storage information and the first permission information are sent to the first user terminal.
  • the existing open source block chain platform such as Hyperledger Fabric, Ethereum Quorum
  • the above-mentioned third smart contract has a one-to-one correspondence with the above-mentioned blockchain transaction and the above-mentioned first data sharing information
  • the fourth block may contain one or more third smart contracts , when the server receives multiple pieces of first data sharing information, it can generate multiple blockchain transactions, and integrate multiple third smart contracts to generate the above fourth block to improve the utilization rate of the block , to avoid the waste of block capacity, so I won’t go into details here.
  • the server After the server receives the payment information sent by the first client, it indicates that the payment is complete. At this time, the server can send the above-mentioned first storage information and first permission information to the Describe the first client. At the same time, in order to facilitate the data provider or the first client to query the payment record, the server can simultaneously generate a fifth block according to the payment information and the digital signature of the first client, the fifth block includes the payment record corresponding to the payment information, The method of generating the above-mentioned fifth block is similar to the method of generating the first block to the fourth block in the above-mentioned embodiment, and will not be repeated here to avoid repetition.
  • the server can realize payment and billing functions during data sharing, which improves user experience.
  • the above step 401 corresponds to the above step 201 .
  • the above-mentioned second permission information may be generated based on the second data sharing information sent by the second client, for example, when sending a data sharing request, the second client may send an access permission list corresponding to the data to be shared, It includes all access operations that can be performed on the data to be shared, so that the server can generate the second permission information according to the access permission list.
  • the above step 402 may include:
  • the access authority list including the second authority information
  • the second permission information is acquired from the access permission list.
  • the server can also display the above-mentioned access permission list to the data demander, and determine the final output second permission information through the request sent by the data demander, so that the data provider can realize the data access permission more conveniently. Control, improve data security and privacy, and benefit from it.
  • the server can show the data demander that the purchase methods of the current document include the purchase of read-only rights, the purchase of shareable rights and the purchase of editable rights. After the data demander chooses the purchase method, the final document can be determined.
  • the second permission information sent to the data requester may also be generated by the server itself according to the access permission list and preset policies.
  • the server can form a zone based on the above-mentioned second data sharing information and the digital signature of the second client.
  • Block chain transaction the block chain transaction is used to realize the sharing of the data to be shared corresponding to the above second data sharing information, after which, the server can send the above block chain transaction to the existing block chain infrastructure Platform, based on the existing open source blockchain platform (such as Hyperledger Fabric, Ethereum Quorum) to generate the above second block, the above second block includes the second smart contract corresponding to the second data sharing information, and the newly generated
  • the second block is issued to each server node connected to the blockchain network to inform of a new data sharing request.
  • the digital signature of the second client is in one-to-one correspondence with the second data sharing information, that is, whenever the second client needs to access a piece of data to be accessed, it needs to send a digital A data access request for sharing information, and for different data access requests, the digital signatures of the second client are also different.
  • the above-mentioned second smart contract is generated based on the second data sharing information, and may include access conditions determined according to the second data sharing information.
  • the server can output the above-mentioned data to be shared Corresponding third storage information and second permission information.
  • the above-mentioned third storage information is similar to the first storage information, and the above-mentioned third storage information may be generated based on the above-mentioned second data sharing information, for example, it may be address information, key information, and the like.
  • the above-mentioned blockchain transaction and the above-mentioned second smart contract are in one-to-one correspondence with the above-mentioned data sharing request, that is, each time the server receives a digital signature data carrying the second data sharing information and the second client
  • the sharing request means that a blockchain transaction can be generated according to the second data sharing information and the digital signature of the second client, and a second smart contract can be generated.
  • the above-mentioned second block can also include multiple second smart contracts, that is, the server can generate N blockchain transactions after receiving N data access requests, and finally integrate
  • the formed second block includes N second smart contracts. It can be understood that N is a positive integer, and its value can be determined according to the maximum capacity of the second block. waste.
  • the above method of forming the second block can be set according to the existing block generation method of the open source blockchain platform (such as Hyperledger Fabric, Ethereum Quorum), and no further description will be made here.
  • the open source blockchain platform such as Hyperledger Fabric, Ethereum Quorum
  • the server after receiving the data sharing request from the second client, the server can generate the second block according to the second data sharing information and the digital signature of the second client, since the second block includes the Two smart contracts, so that when the access conditions of the second smart contract are satisfied, the server can output the third storage information and the second permission information to instruct the data demander to obtain the data to be shared according to the third storage information , the access operation of the data to be shared is performed through the second permission information, thereby improving the security and privacy of the data through permission control.
  • the second client can perform mutual authentication with the server first, and the authentication credential can be a digital certificate or key.
  • the server can also query the identity information of the second client. Whether the second client has the authority to publish data sharing, and if it has the authority to publish data sharing, the above-mentioned second block can be generated, so that illegal or unauthorized users can be avoided as data providers, and the security of data sharing can be improved. .
  • the second data sharing information includes identity information and data profile information of the second client, and after the above step 403, the above method further includes:
  • the server after the server generates the second block including the above-mentioned second smart contract, it can generate the second address information indicating the above-mentioned second smart contract, and the above-mentioned second address information can be a uniform resource locator ( Uniform Resource Locator, URL) or Uniform Resource Identifier (Uniform Resource Identifier, URI) address
  • the data demander after receiving the above-mentioned second address information, the data demander can use the user's input, such as clicking the link of the access address, to execute the above-mentioned The second smart contract, so that the third storage information and the second permission information can be output when the data demander satisfies the second access condition of the second smart contract.
  • the second client itself may also be a subscribing client, so as described in the above embodiment, the metadata of the data to be shared can be generated based on the second address information to generate the third encrypted data package.
  • identity information and data profile information of the second client in the above-mentioned second data sharing information can be sent together with the above-mentioned second address information to the subscribed client, and the client can display the identity of the second client Information and data profile information, so that users can know the publisher of the data to be shared and the related attributes and types of the data to be shared, so as to determine whether to access the data to be shared.
  • the above information sending process can be implemented based on the publish-subscribe model, with the server serving as the publisher and the subscribed client serving as the subscriber, which will not be repeated here.
  • the embodiment of the present application also provides a data sharing system, including a server, a first client, and a second client, wherein the server is used to execute the data sharing system applied to the server as described above.
  • the first client is used to execute the method steps of any one of the above-mentioned data sharing method embodiments applied to the first client
  • the second client is used to execute the above-mentioned one applied to the second method. 2.
  • the overall structure of the data sharing method is established through the server, the first client and the second client, providing a complete, systematic and achievable solution for data sharing based on blockchain technology, using the above data sharing system to achieve Data sharing can improve the security of data sharing.
  • the above server can include a user management module, an authentication and authorization module, a data sharing policy formulation and management module, a data sharing access record module, a data sharing information release module, a data sharing information reservation module, a data sharing token management module, a data sharing Billing management module, data sharing payment management module and access rights management module.
  • the above functional modules can be implemented by different server nodes in the server, and the server can use the capabilities of the above functional modules for the client application software to call through the application programming interface (Application Programming Interface, API).
  • API Application Programming Interface
  • the user management module is used to manage the identity information of various users (such as data provider, data demander, payment center, key storage service provider, data storage service provider), such as user identity ID, digital certificate, Roles, etc., and manage the query, addition, modification, and deletion processes of various user accounts.
  • the authentication and authorization module is used for: mutual authentication with the client (such as data provider, data demander), authentication methods include password, shared key, digital certificate, etc.; view users (such as data provider, data demander) Whether there is permission to publish or access data, and authorize it.
  • the formulation and management module of the data sharing strategy is used to: receive the data access strategy (including data sharing information) and the corresponding digital signature defined by the second client, and form A blockchain transaction; submit the transaction to the underlying module blockchain infrastructure module and smart contract management module to form a smart contract for data sharing, and publish it to the nodes of each blockchain network; notify the second client and data In the shared information publishing module, the smart contract for data sharing is generated; it provides management of data sharing policy records for the second client, such as query and modification.
  • the data sharing access recording module is used to: receive a data access request from the first client (including data demander information, information requiring access to data, etc.), and check whether the user is eligible for access sharing according to the data sharing policy of the required access data.
  • the conditions of the data (such as which industries the data can be used for, which users the data can use, etc.); according to the identity information of the received data user, the data information that needs to be accessed and the digital signature, a block chain system is formed.
  • the system supports billing and payment for data sharing/transactions, it is also necessary to notify the data sharing billing management module that a new billing smart contract has been generated; to receive the notification from the data sharing token management module, the The notification contains the access token; the relevant information (such as address, digital certificate, etc.) and authority information of the access token, the key storage server and the data storage server are sent to the first client; Management, such as queries.
  • the data sharing information release module is used to: receive a notification from the formulation and management module of the data sharing policy, the notification contains new data sharing information; publish new data sharing information; notify the data sharing information subscription module that there is new data sharing information .
  • the data sharing information subscribing module is used to: receive a notification from the data sharing information publishing module, the notification includes new data sharing information; send the new data sharing information to the subscribing client.
  • the data sharing token management module is used to: receive a notification from the data sharing access record module that an access token needs to be generated; generate an access token for data access; send the generated access token to the data sharing access record module.
  • the data sharing billing management module is used to: receive the notification from the formulation and management module of the data sharing policy, notify the generation of a new billing smart contract, the notification contains new billing information; generate a new billing bill, and Sign the new billing bill; form the billing bill and signature into a blockchain transaction; submit the transaction to the underlying blockchain infrastructure module to form a payment smart contract, and publish it to the nodes of each blockchain network; Notify the data sharing payment management module that a new payment smart contract has been generated.
  • the underlying blockchain infrastructure modules are generated based on existing blockchain platforms such as Hyperledger Fabric or Ethereum Quorum and will not be described here.
  • the data sharing payment management module is used to: receive a notification from the data sharing billing management module, notify the generation of a new payment smart contract, the notification contains new payment information; generate a new payment bill, make a payment, and make a payment for the new payment Sign the bill; form a blockchain transaction with the payment bill and signature; submit the transaction to the underlying blockchain infrastructure module to form a payment transaction record, and publish it to the nodes of each blockchain network; notify all transaction participants , the new payment is completed.
  • the access rights management module is used to: receive notifications from the formulation and management module of data sharing policies, store the access rights and policies related to this shared data; receive notifications from the data sharing access/usage record module, and provide Generate access rights, encrypt the access rights with the public key of the data user to form a rights data package; send the generated rights data package to the data sharing access/use recording module.
  • the first user end may be a data demander, and the application program and/or client software in the first user end may have the following functions: subscribe/sign up to release data sharing messages; search through the information release column, or book release Information, or methods recommended by others, to obtain data sharing information (such as the identity of the data publisher, which industries the data can be used for, which users the data can use, and the category of data, data content introduction, nature, use, price and other attributes), determine the data that needs to be accessed according to the published data sharing information;
  • data sharing information such as the identity of the data publisher, which industries the data can be used for, which users the data can use, and the category of data, data content introduction, nature, use, price and other attributes
  • the authentication and authorization module of the server Before accessing the shared data, mutual authentication with the authentication and authorization module of the server is required; its identity information, such as the identity of the data user, the public key of the data user, and the data information that needs to be accessed, such as the identity of the data publisher, The data publisher's public key, ciphertext ID, key ID, etc., as well as the digital signature of its identity information and data information to be accessed, are sent to the data sharing access record module of the server; receiving the notification from the data sharing access record module, The notification includes key storage address, data storage address, access token and permission information, etc.;
  • the access token to the token verification module of the key storage server to obtain the decryption key; according to the address of the ciphertext storage, request to obtain the data corresponding to the ciphertext identification ID; according to the obtained data
  • the decryption key decrypts the encrypted data packet, obtains the data to be accessed, and executes the access operation to the data to be accessed according to the authority information; deletes the data to be accessed after the access operation or repackages the data to be accessed; management Shared data records that you have accessed, such as queries.
  • the second client can be a data provider, and the application program and/or client software in the second client can have the following functions: collect raw data, and perform desensitization without affecting the quality of data sharing (such as anonymity, Delete private information such as bank card numbers, Alipay account numbers); generate data encryption keys; use data encryption keys to package shared data to obtain encrypted data packets; securely store encrypted data packets and encryption keys corresponding to shared data Stored in a local or remote server; mutual authentication with the authentication and authorization module of the server; fill in the data sharing information to be released, such as the identity of the data publisher, according to the formulation of the data sharing policy and the management module of the server.
  • data sharing such as anonymity, Delete private information such as bank card numbers, Alipay account numbers
  • the above system may also include a key storage server, and the key storage server includes:
  • Token verification module receive the access token from the first client, authenticate the first client; verify the validity of the access token; optionally, when verifying the token, the token verification module of the key storage server May need to communicate with the data sharing token management module; send the verification result to the data key storage management module.
  • Data key storage management module receive the request from the second client, need to store the data encryption key; authenticate the identity of the second client; securely store the encryption key; notify the second client that the encryption key is stored; A notification from the token verification module, the notification indicating the verification result of the token; returning the decryption key to the first user in a secure encrypted manner.
  • the above function modules can also be invoked by client application software in the form of API.
  • the above-mentioned system can also include a data storage server, and the data storage server includes:
  • the data distribution module is configured to: receive a request from the first client; authenticate the first client; and send the encrypted data packet to the first client.
  • the data storage management module is used to: receive a request from the second client to store the encrypted data packet of the shared data; perform identity authentication on the second client; securely store the encrypted data packet of the shared data; notify the second client that the shared data An encrypted packet of data is stored.
  • the above function modules can also be invoked by client application software in the form of API.
  • FIG. 6 is a scene architecture diagram provided by the embodiment of the present application for realizing access control of data to be accessed and data to be shared.
  • the data provider can encapsulate the data to be shared and related data information with a key to obtain an encrypted data package.
  • the data demander can obtain the encrypted data package, permission data package and key data package through the data sharing/exchange platform. After decrypting the encrypted data package through the key data package, it can execute according to the access rights in the permission data package. Access operations on data.
  • FIG. 7 shows an interaction process between the second client and the server, that is, the data publishing process, including the following steps:
  • Step 501 the second client collects raw data, and performs desensitization processing (such as anonymizing, deleting sensitive information such as bank card numbers and account numbers) without affecting the quality of data sharing.
  • desensitization processing such as anonymizing, deleting sensitive information such as bank card numbers and account numbers
  • Step 502 the second client registers with the local or remote server for the data to be shared and the encryption key, specifically including:
  • Step 5021 register the encryption key to be stored in the key storage server, and obtain the encryption key identifier and its storage address.
  • Step 5022 register the encrypted data to be stored in the data storage server, and obtain the identifier and storage address of the encrypted data.
  • Step 503 the second client generates a data encryption key and the key ID, uses the data encryption key to encrypt the data to be shared to form a data ciphertext, and then generates data sharing information for the data to be shared: such as data Publisher identity, data publisher public key, encrypted data packet ID, encrypted data packet storage address, key ID, key storage address, which industries the data can be used for, and which access operations the data can perform , which users the data is available for, and other attributes of the data (such as category, data content introduction, nature, purpose, price, etc.).
  • Step 504 before issuing the data sharing policy, the second client needs to perform mutual authentication with the authentication and authorization module of the server. 2. Whether the client has permission to publish data sharing;
  • the second client fills in the data sharing information to be released according to the data sharing policy formulation and management module requirements of the server: such as data publisher identity, data publisher public key, cipher text ID, password
  • the second client forms the data sharing policy together with the data sharing information and other information, performs hash (Hash) processing on the data policy, and digitally signs it with its own private key.
  • Step 505 the second client sends the data sharing strategy and the corresponding digital signature to the data sharing strategy formulation and management module of the server, and the transmission of information needs to be encrypted and integrity protected;
  • Step 506 After receiving the data sharing policy and corresponding digital signature from the second client, the data sharing policy formulation and management module first verifies the digital signature, and then prepares to form a transaction in a block according to the data sharing policy and digital signature .
  • Step 507 the data sharing policy formulation and management module and the second client confirm: the second client has stored the data encryption key in the key storage server, and stored the encrypted data in the data storage server, if there is no Need to do the following:
  • Step 5071 the second client stores the data encryption key in the key storage server
  • Step 5072 the second client will form an encrypted data packet according to the following steps, and store the encrypted data packet in the data storage server;
  • Step 50721 generate data information (including but not limited to): encrypted data package identifier, data provider identifier, data provider's public key, address for executing data sharing smart contract, etc.;
  • Step 50722 perform Hash calculation on the generated data information and sign the result obtained by the Hash calculation using its private key
  • Step 50723 form metadata together with the data information and the signature on the data information
  • Step 5072 encapsulating metadata and encrypted shared data to form an encrypted data package
  • Step 50725 store the encrypted data package in the data storage server.
  • steps 5071 and 5072 are not sequenced, and only need to be completed before generating a new blockchain transaction.
  • Step 508 the data sharing strategy formulation and management module performs hash (Hash) processing on the received one or more transactions, and then uses the private key of the data sharing strategy formulation and management module to digitally hash (Hash) the value Sign, and then submit the one or more transactions and digital signatures to the underlying module blockchain infrastructure module and smart contract management module to form a new block, which contains one or more shared data Smart contract, and publish the newly generated block to the nodes of each blockchain network.
  • hash hash
  • Sign digitally hash
  • the value Sign digitally hash
  • the value Sign submit the one or more transactions and digital signatures to the underlying module blockchain infrastructure module and smart contract management module to form a new block, which contains one or more shared data Smart contract, and publish the newly generated block to the nodes of each blockchain network.
  • the transaction is loaded on the chain, it depends on the underlying specific implementation technology (such as Hyperledger Fabric platform, Ethereum Quorum platform), which is not discussed here. repeat.
  • Step 509 the formulation and management module of the data sharing strategy notifies the relevant parties that the smart contract for data sharing has been generated:
  • Step 5091 notify the second client that the smart contract for data sharing has been generated, and send the address for executing the smart contract.
  • Step 5092 notify the data sharing information release module that the data sharing smart contract has been generated, and notify the corresponding new data sharing information, and the transmission of the information needs to be encrypted and integrity protected.
  • Step 5093 notify the access rights management module that the smart contract for data sharing is generated (including the address for executing the smart contract), and notify to record the related access rights.
  • Step 5094 the access rights management module receives the notification from the formulation and management module of the data sharing policy, and stores the access rights and policies related to the shared data this time.
  • Step 510 the data sharing information release module receives the notification from the data sharing strategy formulation and management module, and releases new data sharing information, including:
  • Step 5101 the data sharing information publishing module notifies the data sharing information subscription module that the smart contract for data sharing has been generated, and the notification includes the address for executing the smart contract and new data sharing information.
  • Step 5102 the data sharing information subscription module receives the notification from the data sharing information publishing module, and sends the address for executing the smart contract and new data sharing information to the subscribing user.
  • FIG. 8 shows an interaction process between the first client and the server, that is, the data access process, including the following steps:
  • Step 601 the first client obtains the address for executing the data sharing smart contract by searching on the information release column, or ordering to release information, or recommended by others, or by forwarding the metadata of the encrypted data package, and according to the published data sharing information (such as the identity of the data publisher, which industries the data can be used for, which users the data can use, and the type of data, data content introduction, nature, purpose, price and other attributes), determine the data that needs to be accessed;
  • the published data sharing information such as the identity of the data publisher, which industries the data can be used for, which users the data can use, and the type of data, data content introduction, nature, purpose, price and other attributes
  • Step 602 before the first client executes the data sharing smart contract to access the shared data, it needs to perform mutual authentication with the authentication and authorization module of the data sharing/exchange platform.
  • the authentication method is recommended to use digital certificates. After the authentication is successful, authentication and authorization The module also needs to check whether the data user has permission to access the data shared on the platform;
  • Step 603 after the authentication is successful and authorization is obtained, the first client sends its identity information (such as the identity of the data user, the public key of the data user, and the data information to be accessed (such as the identity of the data issuer, the public key of the data issuer) , ciphertext identification ID, key identification ID, etc.) and the digital signature of the first client's identity information and data information to be accessed are sent to the data sharing access recording module of the data sharing/exchange platform.
  • identity information such as the identity of the data user, the public key of the data user, and the data information to be accessed (such as the identity of the data issuer, the public key of the data issuer) , ciphertext identification ID, key identification ID, etc.
  • Step 604 the data sharing access record module receives the identity information from the first client, the data information to be accessed and the digital signature, verifies the digital signature, and then executes the data sharing smart contract according to the data access request provided by the first client to check the Whether the user meets the conditions for accessing the shared data (such as which industries the data can be used for, which users can use the data, etc.); if all policies for data sharing are met, the data sharing access record module will use the data according to the received data
  • the identity information of the user, the data information to be accessed and the digital signature form a transaction in a block; the data sharing access record module performs hash (Hash) processing on one or more received transactions before using the data sharing access record
  • the private key of the module digitally signs the hash (Hash) value, and then submits the one or more transactions and the digital signature to the underlying blockchain infrastructure module to form a new block.
  • Step 6051 After the access record of the shared data is successfully uploaded to the chain, the data sharing access record module notifies the data sharing token management module that an access token needs to be generated.
  • Step 6052 notify the access rights management that an access rights data packet needs to be generated.
  • Step 6061 the data sharing token management module receives the notification from the data sharing access record module, and generates an access token for this data access.
  • Step 6062 the access rights management module receives the notification from the data sharing access/use recording module, generates access rights for this data access, encrypts the access rights with the public key of the data user, and forms a rights data packet.
  • Step 6071 the data sharing token management module sends the generated access token to the data sharing access record module.
  • Step 6072 the access rights management module sends the generated rights data packet to the data sharing access/use recording module.
  • Step 608 the data sharing access record module receives the access token from the data sharing token management module and the permission data packet from the access right management, and then correlates the access token, the permission data packet, the key storage server and the data storage server
  • the information (such as address, digital certificate, etc.) is sent to the first client; the access token and related information of the key storage server and the data storage server need to consider confidentiality protection and integrity protection during the transmission process.
  • Step 609 the first client receives a notification from the data sharing access record module, the notification includes the permission data packet, the access token, the key storage server and the relevant information of the data storage server (such as address, digital certificate, etc.); then, According to the address of the key storage, the first client sends the access token to the token verification module of the key storage server to obtain the decryption key; confidentiality protection and integrity protection need to be considered during the transmission of the access token.
  • the notification includes the permission data packet, the access token, the key storage server and the relevant information of the data storage server (such as address, digital certificate, etc.); then, According to the address of the key storage, the first client sends the access token to the token verification module of the key storage server to obtain the decryption key; confidentiality protection and integrity protection need to be considered during the transmission of the access token.
  • Step 6091 the token verification module of the key storage server receives the access token from the first client, and verifies the validity of the access token; optionally, when verifying the token, the token verification module of the key storage server may need To communicate with the data sharing token management module, the data in the communication process needs to consider confidentiality and integrity protection.
  • Step 6092 the token verification module sends the verification result to the data key storage management module.
  • Step 610 the data key storage management module receives the verification result notification of the access token from the token verification module, and then encrypts the decryption key with the public key of the data user to form a key data packet for secure encryption way to return to the first client.
  • Step 611 the first client receives the decryption key from the data key storage management module, and the first client requests to obtain the data corresponding to the ID of the encrypted data packet according to the address stored in the encrypted data packet.
  • Step 612 the data distribution module receives the encrypted data packet request from the first client, and verifies the request from the first client, such as performing identity authentication.
  • Step 613 the data distribution module sends the encrypted data packet corresponding to the ID to the first client;
  • Step 614 the first client decrypts the authority data package and the key data package, obtains the decryption key and access authority, and then decrypts the encrypted data package according to the decryption key, and presents the plaintext data to the corresponding application program; the application program is closed After that, the decrypted data still exists locally in the form of encrypted data packets.
  • the data provider may obtain certain economic benefits from the data user.
  • the specific process is shown in Figure 8.
  • step 604 also includes:
  • Step 6041 the data sharing access record module checks whether the user meets the conditions for accessing shared data (such as which industries the data can be used for, which users the data can use, etc.) according to the data sharing strategy (such as price, payment method, etc.) ); if all policies of data sharing are satisfied, the data sharing access record module forms a blockchain transaction according to the received data user’s identity information, data information to be accessed and digital signature, and submits it to the underlying block
  • the blockchain infrastructure module and the smart contract management module form a record of access to shared data, as well as the corresponding billing smart contract, and publish it to the nodes of each blockchain network.
  • Step 6042 the data sharing access record module notifies the data sharing billing management module that a new billing smart contract (including billing information) is generated; the data sharing billing management module generates it immediately or periodically according to the billing smart contract Pay bills, and digitally sign the payment bills to form a transaction in the block; the data sharing billing management module digitally signs one or more payment bill transactions, and then the one or more transactions and digital signatures pass through the underlying
  • the blockchain infrastructure module and the smart contract management module form a new block, which contains one or more payment smart contracts, and publish the newly formed block to the nodes of each blockchain network;
  • Step 6043 the data sharing billing management module notifies the data sharing payment management module that a new payment smart contract (including payment information) is generated; the data sharing payment management module immediately or periodically pays for the payment bill according to the payment smart contract ; After the payment is completed, the data sharing payment management module signs the payment information to form a payment transaction in a block; the data sharing payment management module digitally signs one or more payment transactions, and then passes the underlying block chain basis The facility module forms a new block, which contains one or more payment records, and publishes the newly formed block to the nodes of each blockchain network.
  • the data sharing payment management module notifies the data sharing access record module that after the payment is completed, the next operation can be performed.
  • the data sharing system provided by the embodiment of the present application is designed based on the existing open source block chain platform (such as Hyperledger Fabric, Ethereum Quorum) by reusing the existing technology, which can improve the system development efficiency, reliability and stability, and at the same time
  • the above-mentioned data sharing system is based on the security protection of data transmission, security protection of data storage, and access control of data use.
  • Individual users or enterprise users can act as data providers and share their own data safely according to their own requirements and policies.
  • individual users or enterprise users can automatically and quasi-real-time obtain certain rewards or benefits, which improves the security of data sharing and improves the user experience.
  • the data demander needs to perform access operations on the data according to the access rights, avoiding the illegal dissemination of the data, and improving the security and privacy of the data.
  • the execution subject may be a data sharing device, or a control module in the data sharing device for executing the data sharing method.
  • the data sharing device provided in the embodiment of the present application is described by taking the data sharing device executing the data sharing method as an example.
  • the embodiment of the present application provides a data sharing device 900
  • the data sharing device 900 may be a first client
  • the data sharing device 900 includes:
  • the first sending module 901 is configured to send a data access request to the server, where the data access request carries first data sharing information, and the first data sharing information is associated with the data to be accessed;
  • the first receiving module 902 is configured to receive the first storage information and the first authority information sent by the server based on the first smart contract, wherein the first smart contract belongs to the first block in the block chain, and the first A piece of permission information is used to indicate the access operations that the first client can perform on the data to be accessed;
  • the first obtaining module 903 is configured to obtain the first encrypted data package from the storage server according to the first storage information
  • a decryption module 904 configured to decrypt the first encrypted data packet to obtain the data to be accessed, wherein the first encrypted data packet is generated based on the data to be accessed and the metadata of the data to be accessed ;
  • the access module 905 is configured to perform an access operation on the data to be accessed according to the first permission information.
  • the first client can send a data access request to the server through the first sending module 901, and receive the first storage information and the first storage information sent by the server based on the first smart contract through the first receiving module 902 Permission information, using the first storage information, through the first acquisition module 903 to obtain the first encrypted data packet from the storage server, through the decryption module 904 to decrypt the data to be accessed, and through the access module 905 according to the first permission information, execute For the access operation of the data to be accessed, since the first permission information is used to indicate the access operation that the first client can perform on the data to be accessed, it is possible to avoid the first The client illegally sends the data to be accessed to other users, which reduces the risk of data leakage and improves data privacy and security.
  • the first acquiring module 903 includes:
  • a first obtaining unit configured to obtain second key information when the first key information passes the verification of the storage server
  • a second obtaining unit configured to obtain the first encrypted data packet from the storage server according to the first address information
  • Decryption module 904 including:
  • a decryption unit configured to use the second key information to decrypt the first encrypted data packet to obtain the data to be accessed.
  • the device also includes any of the following:
  • a deletion module configured to delete the data to be accessed and the first encrypted data packet after the access operation is terminated
  • a repackaging module configured to encapsulate the data to be accessed based on the data to be accessed and the metadata of the data to be accessed in the first encrypted data packet after the access operation is terminated to obtain a second
  • An encrypted data packet is used to store the second encrypted data packet.
  • the embodiment of the present application also provides a data sharing device 1000, which may be a second client, and the device includes:
  • the second acquiring module 1001 is configured to acquire second storage information of the data to be shared, where the second storage information indicates that the data to be shared corresponds to information stored in the storage server;
  • the second sending module 1002 is configured to send a data sharing request to the server, the data sharing request carries second data sharing information and the digital signature of the second client, the second data sharing information is based on the second storage generating information for describing the data to be shared;
  • a first generation module 1003, configured to generate a third encrypted data package based on the metadata of the data to be shared and the data to be shared;
  • the first storage module 1004 is configured to store the third encrypted data package and key information corresponding to the third encrypted data package in the storage server according to the second stored information.
  • the first generating module 1003 includes:
  • a first generating unit configured to generate first data information corresponding to the data to be shared, where the first data information includes at least one of the following: indicating the first identification of the second client, indicating the third encryption the second identification of the data packet, and the second address information indicating the second smart contract;
  • the second address information is sent by the server, the second smart contract belongs to the second block in the block chain, and the second smart contract is used to indicate that the second smart contract is satisfied
  • the server outputs third storage information and second permission information, the third storage information is used to obtain the data to be shared in the storage server, and the second permission information is used to indicate Access operations that can be performed on the data to be shared;
  • a second generating unit configured to generate metadata of the data to be shared according to the first data information and the digital signature of the second client on the first data information
  • An encapsulating unit configured to encapsulate the metadata of the data to be shared and the data to be shared to obtain the third encrypted data package.
  • the embodiment of the present application also provides a data sharing device, which is applied to the server, and the device includes:
  • the second receiving module 1101 is configured to receive a data access request sent by a first client, where the data access request carries first data sharing information, and the first data sharing information is associated with the data to be accessed;
  • the third sending module 1102 is configured to send the first storage information and the first permission information to the first smart contract according to the first smart contract when the first client meets the access conditions of the first smart contract. a client;
  • the first smart contract belongs to the first block in the block chain
  • the first storage information is used to obtain the data to be accessed from the storage server
  • the first permission information indicates that the first user The access operation that the terminal can perform on the data to be accessed.
  • the third receiving module 1203 is configured to receive a data sharing request sent by a second client, the data sharing request carries second data sharing information and a digital signature of the second client, and the second data sharing information is used to describe data to be shared;
  • the second generation module 1204 is configured to generate second permission information according to the second data sharing information, and the second permission information is used to indicate access operations that can be performed on the data to be shared;
  • a third generating module 1205, configured to generate a second block according to the second data sharing information and the digital signature of the second client;
  • the second block includes a second smart contract
  • the second smart contract is used to indicate that the third storage information and the second permission information are output when the access conditions of the second smart contract are satisfied.
  • the third storage information is used to acquire the data to be shared from a storage server.
  • the second generation module 1204 includes:
  • a third generating unit configured to generate an access authority list according to the second data sharing information, where the access authority list includes the second authority information
  • a third obtaining unit configured to obtain the second permission information from the access permission list when receiving a permission request associated with the second permission information.
  • the data sharing device 1100 , the data sharing device 1200 and the data sharing device 1300 can all be the above data sharing devices applied to the server.
  • the data sharing device in the embodiment of the present application may be a device, or a component, an integrated circuit, or a chip in a terminal.
  • the device may be a mobile electronic device or a non-mobile electronic device.
  • the mobile electronic device can be a mobile phone, a tablet computer, a notebook computer, a handheld computer, a vehicle electronic device, a wearable device, an ultra-mobile personal computer (Ultra-Mobile Personal Computer, UMPC), a netbook or a personal digital assistant (Personal Digital Assistant).
  • non-mobile electronic devices can be servers, network attached storage (Network Attached Storage, NAS), personal computer (Personal Computer, PC), television (TeleVision, TV), teller machine or self-service machine, etc., this application Examples are not specifically limited.
  • Network Attached Storage NAS
  • PC Personal Computer
  • TV TeleVision, TV
  • teller machine or self-service machine etc.
  • the data sharing device in the embodiment of the present application may be a device with an operating system.
  • the operating system may be an Android operating system, an ios operating system, or other possible operating systems, which are not specifically limited in the embodiments of the present application.
  • the data sharing device provided by the embodiment of the present application can realize various processes realized by the method embodiments in FIG. 1 to FIG. 8 , and details are not repeated here to avoid repetition.
  • the embodiment of the present application further provides an electronic device 1400, including a processor 1401, a memory 1402, and programs or instructions stored in the memory 1402 and operable on the processor 1401,
  • an electronic device 1400 including a processor 1401, a memory 1402, and programs or instructions stored in the memory 1402 and operable on the processor 1401,
  • the program or instruction is executed by the processor 1401
  • each process of the above-mentioned data sharing method embodiment can be realized, and the same technical effect can be achieved. To avoid repetition, details are not repeated here.
  • the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.
  • FIG. 15 is a schematic diagram of a hardware structure of an electronic device implementing an embodiment of the present application.
  • the electronic device 1500 can be a first client, a second client and a server, and the electronic device 1500 includes but not limited to: a radio frequency unit 1501, a network module 1502, an audio output unit 1503, an input unit 1504, a sensor 1505, and a display unit 1506 , a user input unit 1507, an interface unit 1508, a memory 1509, a processor 1510 and other components.
  • the electronic device 1500 can also include a power supply (such as a battery) for supplying power to various components, and the power supply can be logically connected to the processor 1510 through the power management system, so that the management of charging, discharging, and function can be realized through the power management system. Consumption management and other functions.
  • a power supply such as a battery
  • the structure of the electronic device shown in FIG. 15 does not constitute a limitation to the electronic device.
  • the electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange different components, and details will not be repeated here. .
  • the radio frequency unit 1501 is used to send a data access request to the server, the data access request carries first data sharing information, and the first data sharing information is associated with the data to be accessed ;
  • a processor 1510 configured to acquire a first encrypted data packet from a storage server according to the first storage information
  • the processor 1510 is further configured to obtain second key information when the first key information is verified by the storage server;
  • the processor 1510 is further configured to obtain the first encrypted data packet from the storage server according to the first address information
  • the processor 1510 is further configured to use the second key information to decrypt the first encrypted data packet to obtain the data to be accessed.
  • the processor 1510 is further configured to delete the data to be accessed and the first encrypted data package after the access operation is terminated;
  • the processor 1510 is further configured to, after the access operation is terminated, based on the data to be accessed and metadata of the data to be accessed in the first encrypted data packet, encapsulate the data to be accessed to obtain a second A second encrypted data packet, storing the second encrypted data packet.
  • the processor 1510 is configured to acquire second storage information of the data to be shared, the second storage information indicating that the data to be shared corresponds to information stored in the storage server;
  • the radio frequency unit 1501 is configured to send a data sharing request to the server, where the data sharing request carries second data sharing information and a digital signature of the second client, and the second data sharing information is generated based on the second stored information , used to describe the data to be shared;
  • the processor 1510 is further configured to generate a third encrypted data package based on the metadata of the data to be shared and the data to be shared;
  • the processor 1510 is further configured to store the third encrypted data package and key information corresponding to the third encrypted data package in the storage server according to the second stored information.
  • the processor 1510 is further configured to generate first data information corresponding to the data to be shared, where the first data information includes at least one of the following: indicating the first identifier of the second client, indicating the The second identification of the third encrypted data packet, and the second address information indicating the second smart contract;
  • the second address information is sent by the server, the second smart contract belongs to the second block in the block chain, and the second smart contract is used to indicate that the second smart contract is satisfied
  • the server outputs third storage information and second permission information, the third storage information is used to obtain the data to be shared in the storage server, and the second permission information is used to indicate Access operations that can be performed on the data to be shared;
  • the processor 1510 is further configured to generate metadata of the data to be shared according to the first data information and the digital signature of the second client on the first data information;
  • the processor 1510 is further configured to encapsulate the metadata of the data to be shared and the data to be shared to obtain the third encrypted data package.
  • the processor 1510 is configured to receive a data access request sent by the first client, the data access request carries first data sharing information, and the first data sharing information is associated with the data to be accessed ;
  • the radio frequency unit 1501 is configured to send the first storage information and the first permission information to the first user according to the first smart contract when the first user meets the access conditions of the first smart contract end;
  • the first smart contract belongs to the first block in the block chain
  • the first storage information is used to obtain the data to be accessed from the storage server
  • the first permission information indicates that the first user The access operation that the terminal can perform on the data to be accessed.
  • the radio frequency unit 1501 is configured to receive a data sharing request sent by a second client, where the data sharing request carries second data sharing information and a digital signature of the second client, and the second data sharing information is used to describe the data to be shared data;
  • the processor 1510 is configured to generate second permission information according to the second data sharing information, where the second permission information is used to indicate access operations that can be performed on the data to be shared;
  • the processor 1510 is further configured to generate a second block according to the second data sharing information and the digital signature of the second client;
  • the second block includes a second smart contract
  • the second smart contract is used to indicate that the third storage information and the second permission information are output when the access conditions of the second smart contract are met.
  • the third storage information is used to acquire the data to be shared from a storage server.
  • the processor 1510 is further configured to generate an access permission list according to the second data sharing information, where the access permission list includes the second permission information;
  • the processor 1510 is further configured to acquire the second permission information from the access permission list when receiving the permission request associated with the second permission information.
  • the electronic device 1500 adopts all the technical solutions of the above-mentioned embodiments, it at least has all the beneficial effects brought by the technical solutions of the embodiments, which will not be repeated here.
  • the input unit 1504 may include a graphics processor (Graphics Processing Unit, GPU) 15041 and a microphone 15042, and the graphics processor 15041 is used for the image capture device (such as the image data of the still picture or video obtained by the camera) for processing.
  • the display unit 1506 may include a display panel 15061, and the display panel 15061 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like.
  • the user input unit 1507 includes a touch panel 15071 and other input devices 15072 . Touch panel 15071, also called touch screen.
  • the touch panel 15071 may include two parts, a touch detection device and a touch controller.
  • Other input devices 15072 may include, but are not limited to, physical keyboards, function keys (such as volume control keys, switch keys, etc.), trackballs, mice, and joysticks, which will not be repeated here.
  • the memory 1509 can be used to store software programs as well as various data, including but not limited to application programs and operating systems.
  • the processor 1510 may integrate an application processor and a modem processor, wherein the application processor mainly processes operating systems, user interfaces, and application programs, and the modem processor mainly processes wireless communications. It can be understood that the foregoing modem processor may not be integrated into the processor 1510 .
  • the embodiment of the present application also provides a readable storage medium, the readable storage medium stores a program or an instruction, and when the program or instruction is executed by a processor, each process of the above-mentioned data sharing method embodiment is realized, and the same To avoid repetition, the technical effects will not be repeated here.
  • the processor is the processor in the electronic device described in the above embodiments.
  • the readable storage medium includes computer readable storage medium, such as computer read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk, etc.
  • the embodiment of the present application further provides a chip, the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the above data sharing method embodiment
  • the chip includes a processor and a communication interface
  • the communication interface is coupled to the processor
  • the processor is used to run programs or instructions to implement the above data sharing method embodiment
  • chips mentioned in the embodiments of the present application may also be called system-on-chip, system-on-chip, system-on-a-chip, or system-on-a-chip.
  • the present application also provides a computer program product, the computer program product is stored in a non-volatile storage medium, and the computer program product is executed by at least one processor to implement the various processes of the foregoing data sharing method embodiments, and The same technical effect can be achieved, so in order to avoid repetition, details will not be repeated here.
  • the present application also provides a communication device, which is configured to execute the various processes of the above data sharing method embodiment, and can achieve the same technical effect. To avoid repetition, details are not repeated here.
  • the term “comprising”, “comprising” or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article or apparatus comprising a set of elements includes not only those elements, It also includes other elements not expressly listed, or elements inherent in the process, method, article, or device. Without further limitations, an element defined by the phrase “comprising a " does not preclude the presence of additional identical elements in the process, method, article, or apparatus comprising that element.
  • the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved. Functions are performed, for example, the described methods may be performed in an order different from that described, and various steps may also be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Bioethics (AREA)
  • Software Systems (AREA)
  • Computer Hardware Design (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Storage Device Security (AREA)

Abstract

The present application belongs to the field of blockchains, and discloses a data sharing method and an electronic device. The method comprises: sending a data access request to a server, the data access request carrying first data sharing information, and the first data sharing information being associated with data to be accessed; receiving first storage information and first permission information sent by the server on the basis of a first smart contract, wherein the first smart contract belongs to a first block in a blockchain, and the first permission information is used to indicate an access operation that a first client may perform on the data; according to the first storage information, obtaining a first encrypted data packet from a storage server; decrypting the first encrypted data packet to obtain the data, wherein the first encrypted data packet is generated on the basis of the data and metadata of the data; and performing the access operation on the data according to the first permission information.

Description

数据共享方法和电子设备Data sharing method and electronic device
相关申请的交叉引用Cross References to Related Applications
本申请主张在2021年09月03日在中国提交的中国专利申请No.202111031567.1的优先权,其全部内容通过引用包含于此。This application claims priority to Chinese Patent Application No. 202111031567.1 filed in China on September 3, 2021, the entire contents of which are hereby incorporated by reference.
技术领域technical field
本申请属于区块链领域,具体涉及一种数据共享方法和电子设备。This application belongs to the field of blockchain, and specifically relates to a data sharing method and electronic equipment.
背景技术Background technique
大数据被称为未来“新石油”。在目前,谁拥有的数据资源多,谁就会在这个大数据时代拥有更多的市场和用户。然而,在享受着数据带来的便利与好处的同时,也承受着个人信息被泄露、个人生活被打扰的风险。因此需要引入先进的技术和解决方案,实现数据资源的安全共享。Big data is called the "new oil" of the future. At present, whoever has more data resources will have more markets and users in this era of big data. However, while enjoying the convenience and benefits brought by data, it also bears the risk of personal information being leaked and personal life being disturbed. Therefore, it is necessary to introduce advanced technologies and solutions to realize the safe sharing of data resources.
目前数据资源的共享方式中,往往是由数据使用方在获取访问权限后,通过数据共享平台在存储服务器上获取到待共享的明文数据。这样,数据使用方在获取到明文数据后,存在将明文数据非法转发给其他用户的可能,这导致共享数据的安全性和私密性不能得到有效保障。In the current way of sharing data resources, the data user usually obtains the plaintext data to be shared on the storage server through the data sharing platform after obtaining access rights. In this way, after the data user obtains the plaintext data, there is a possibility of illegally forwarding the plaintext data to other users, which leads to the inability to effectively guarantee the security and privacy of the shared data.
发明内容Contents of the invention
本申请实施例的目的是提供一种数据共享方法和电子设备,能够解决共享数据的安全性和私密性不能得到有效保障的问题。The purpose of the embodiments of the present application is to provide a data sharing method and an electronic device, which can solve the problem that the security and privacy of shared data cannot be effectively guaranteed.
第一方面,本申请实施例提供了一种数据共享方法,应用于第一用户端,该方法包括:In the first aspect, the embodiment of the present application provides a data sharing method, which is applied to the first client, and the method includes:
向服务端发送数据访问请求,所述数据访问请求携带第一数据共享信息,所述第一数据共享信息与待访问数据关联;Sending a data access request to the server, where the data access request carries first data sharing information, and the first data sharing information is associated with the data to be accessed;
接收服务端基于第一智能合约发送的第一存储信息和第一权限信息,其中,所述第一智能合约属于区块链中的第一区块,所述第一权限信息用于指示所述第一用户端可对所述待访问数据执行的访问操作;receiving the first storage information and first permission information sent by the server based on the first smart contract, wherein the first smart contract belongs to the first block in the blockchain, and the first permission information is used to indicate the An access operation that the first client can perform on the data to be accessed;
根据所述第一存储信息,从存储服务器中获取第一加密数据包;Acquiring a first encrypted data packet from a storage server according to the first storage information;
对所述第一加密数据包进行解密处理,得到所述待访问数据,其中,所述第一加密数据包是基于所述待访问数据和所述待访问数据的元数据生成;Decrypting the first encrypted data packet to obtain the data to be accessed, wherein the first encrypted data packet is generated based on the data to be accessed and metadata of the data to be accessed;
根据所述第一权限信息,执行对所述待访问数据的访问操作。Perform an access operation on the data to be accessed according to the first permission information.
第二方面,本申请实施例提供了一种数据共享方法,应用于第二用户端,该方法包括:In the second aspect, the embodiment of the present application provides a data sharing method, which is applied to the second client, and the method includes:
获取待共享数据的第二存储信息,所述第二存储信息指示所述待共享数据对应在存储服务器中存储的信息;Acquiring second storage information of the data to be shared, the second storage information indicating that the data to be shared corresponds to information stored in the storage server;
向服务端发送数据共享请求,所述数据共享请求携带第二数据共享信息和所述第二用户端的数字签名,其中,所述第二数据共享信息用于描述所述待共享数据;Sending a data sharing request to the server, the data sharing request carrying second data sharing information and the digital signature of the second client, wherein the second data sharing information is used to describe the data to be shared;
基于所述待共享数据的元数据和所述待共享数据生成第三加密数据包;generating a third encrypted data packet based on the metadata of the data to be shared and the data to be shared;
根据所述第二存储信息,在所述存储服务器存储所述第三加密数据包和所述第三加密数据包对应的密钥信息。According to the second storage information, the storage server stores the third encrypted data package and key information corresponding to the third encrypted data package.
第三方面,本申请实施例提供了一种数据共享方法,应用于服务端,该方法包括:In the third aspect, the embodiment of the present application provides a data sharing method, which is applied to the server, and the method includes:
接收第一用户端发送的数据访问请求,所述数据访问请求携带第一数据共享信息,所述第一数据共享信息与待访问数据关联;receiving a data access request sent by the first client, where the data access request carries first data sharing information, and the first data sharing information is associated with the data to be accessed;
在所述第一用户端满足第一智能合约的访问条件的情况下,根据所述第一智能合约,将第一存储信息和第一权限信息发送至所述第一用户端;When the first client meets the access conditions of the first smart contract, according to the first smart contract, send the first storage information and the first permission information to the first client;
其中,所述第一智能合约属于区块链中的第一区块,所述第一存储信息用于从存储服务器中获取所述待访问数据,所述第一权限信息指示所述第一用户端可对所述待访问数据执行的访问操作;Wherein, the first smart contract belongs to the first block in the block chain, the first storage information is used to obtain the data to be accessed from the storage server, and the first permission information indicates that the first user The access operation that the terminal can perform on the data to be accessed;
和/或,and / or,
接收第二用户端发送的数据共享请求,所述数据共享请求携带第二数据共享信息和所述第二用户端的数字签名,所述第二数据共享信息用于描述待共享数据;receiving a data sharing request sent by a second client, where the data sharing request carries second data sharing information and a digital signature of the second client, and the second data sharing information is used to describe the data to be shared;
根据所述第二数据共享信息,生成第二权限信息,所述第二权限信息用于指示可对所述待共享数据执行的访问操作;generating second permission information according to the second data sharing information, where the second permission information is used to indicate access operations that can be performed on the data to be shared;
根据所述第二数据共享信息和所述第二用户端的数字签名生成第二区块;generating a second block according to the second data sharing information and the digital signature of the second client;
其中,所述第二区块包括第二智能合约,所述第二智能合约用于指示在满足所述第二智能合约的访问条件的情况下,输出第三存储信息和所述第二权限信息,所述第三存储信息用于从存储服务器中获取所述待共享数据。Wherein, the second block includes a second smart contract, and the second smart contract is used to indicate that the third storage information and the second permission information are output when the access conditions of the second smart contract are met. , the third storage information is used to acquire the data to be shared from a storage server.
第四方面,本申请实施例提供了一种数据共享装置,应用于第一用户端,该装置包括:In the fourth aspect, the embodiment of the present application provides a data sharing device, which is applied to the first client, and the device includes:
第一发送模块,用于向服务端发送数据访问请求,所述数据访问请求携带第一数据共享信息,所述第一数据共享信息与待访问数据关联;The first sending module is configured to send a data access request to the server, the data access request carries first data sharing information, and the first data sharing information is associated with the data to be accessed;
第一接收模块,用于接收服务端基于第一智能合约发送的第一存储信息和第一权限信息,其中,所述第一智能合约属于区块链中的第一区块,所述第一权限信息用于指示所述第一用户端可对所述待访问数据执行的访问操作;The first receiving module is configured to receive the first storage information and the first authority information sent by the server based on the first smart contract, wherein the first smart contract belongs to the first block in the block chain, and the first The permission information is used to indicate the access operations that the first client can perform on the data to be accessed;
第一获取模块,用于根据所述第一存储信息,从存储服务器中获取第一加密数据包;A first obtaining module, configured to obtain a first encrypted data packet from a storage server according to the first storage information;
解密模块,用于对所述第一加密数据包进行解密处理,得到所述待访问数据,其中,所述第一加密数据包基于所述待访问数据和所述待访问数据的元数据生成;A decryption module, configured to decrypt the first encrypted data packet to obtain the data to be accessed, wherein the first encrypted data packet is generated based on the data to be accessed and metadata of the data to be accessed;
访问模块,用于根据所述第一权限信息,执行对所述待访问数据的访问操作。An access module, configured to perform an access operation on the data to be accessed according to the first permission information.
第五方面,本申请实施例提供了一种数据共享装置,应用于第二用户端,该装置包括:In the fifth aspect, the embodiment of the present application provides a data sharing device, which is applied to the second client, and the device includes:
接收第一用户端发送的数据访问请求,所述数据访问请求携带第一数据共享信息,所述第一数据共享信息与待访问数据关联;receiving a data access request sent by the first client, where the data access request carries first data sharing information, and the first data sharing information is associated with the data to be accessed;
在所述第一用户端满足第一智能合约的访问条件的情况下,根据所述第一智能合约,将第一存储信息和第一权限信息发送至所述第一用户端;When the first client meets the access conditions of the first smart contract, according to the first smart contract, send the first storage information and the first permission information to the first client;
其中,所述第一智能合约属于区块链中的第一区块,所述第一存储信息用于从存储服务器中获取所述待访问数据,所述第一权限信息指示所述第一用户端可对所述待访问数据执行的访问操作;Wherein, the first smart contract belongs to the first block in the block chain, the first storage information is used to obtain the data to be accessed from the storage server, and the first permission information indicates that the first user The access operation that the terminal can perform on the data to be accessed;
和/或,and / or,
接收第二用户端发送的数据共享请求,所述数据共享请求携带第二数据 共享信息和所述第二用户端的数字签名,所述第二数据共享信息用于描述待共享数据;Receive a data sharing request sent by a second client, the data sharing request carries second data sharing information and a digital signature of the second client, and the second data sharing information is used to describe the data to be shared;
根据所述第二数据共享信息,生成第二权限信息,所述第二权限信息用于指示可对所述待共享数据执行的访问操作;generating second permission information according to the second data sharing information, where the second permission information is used to indicate access operations that can be performed on the data to be shared;
根据所述第二数据共享信息和所述第二用户端的数字签名生成第二区块;generating a second block according to the second data sharing information and the digital signature of the second client;
其中,所述第二区块包括第二智能合约,所述第二智能合约用于指示在满足所述第二智能合约的访问条件的情况下,输出第三存储信息和所述第二权限信息,所述第三存储信息用于从存储服务器中获取所述待共享数据。Wherein, the second block includes a second smart contract, and the second smart contract is used to indicate that the third storage information and the second permission information are output when the access conditions of the second smart contract are satisfied. , the third storage information is used to acquire the data to be shared from a storage server.
第六方面,本申请实施例提供了一种数据共享装置,应用于服务端,该装置包括:In the sixth aspect, the embodiment of the present application provides a data sharing device, which is applied to the server, and the device includes:
第二接收模块,用于接收第一用户端发送的数据访问请求,所述数据访问请求携带第一数据共享信息,所述第一数据共享信息与待访问数据关联;The second receiving module is configured to receive a data access request sent by the first client, where the data access request carries first data sharing information, and the first data sharing information is associated with the data to be accessed;
第三发送模块,用于在所述第一用户端满足第一智能合约的访问条件的情况下,根据所述第一智能合约,将第一存储信息和第一权限信息发送至所述第一用户端;The third sending module is configured to send the first storage information and the first authority information to the first smart contract according to the first smart contract when the first client meets the access conditions of the first smart contract user terminal;
其中,所述第一智能合约属于区块链中的第一区块,所述第一存储信息用于从存储服务器中获取所述待访问数据,所述第一权限信息指示所述第一用户端可对所述待访问数据执行的访问操作。Wherein, the first smart contract belongs to the first block in the block chain, the first storage information is used to obtain the data to be accessed from the storage server, and the first permission information indicates that the first user The access operation that the terminal can perform on the data to be accessed.
和/或,and / or,
第三接收模块,用于接收第二用户端发送的数据共享请求,所述数据共享请求携带第二数据共享信息和所述第二用户端的数字签名,所述第二数据共享信息用于描述待共享数据;The third receiving module is configured to receive the data sharing request sent by the second client, the data sharing request carries the second data sharing information and the digital signature of the second client, and the second data sharing information is used to describe the share data;
第二生成模块,用于根据所述第二数据共享信息,生成第二权限信息,所述第二权限信息用于指示可对所述待共享数据执行的访问操作;A second generating module, configured to generate second permission information according to the second data sharing information, where the second permission information is used to indicate access operations that can be performed on the data to be shared;
第三生成模块,用于根据所述第二数据共享信息和所述第二用户端的数字签名生成第二区块;A third generating module, configured to generate a second block according to the second data sharing information and the digital signature of the second client;
其中,所述第二区块包括第二智能合约,所述第二智能合约用于指示在满足所述第二智能合约的访问条件的情况下,输出第三存储信息和所述第二权限信息,所述第三存储信息用于从存储服务器中获取所述待共享数据。Wherein, the second block includes a second smart contract, and the second smart contract is used to indicate that the third storage information and the second permission information are output when the access conditions of the second smart contract are met. , the third storage information is used to acquire the data to be shared from a storage server.
第七方面,本申请实施例提供了一种电子设备,该电子设备包括处理器、存储器及存储在所述存储器上并可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现如第一方面所述的方法的步骤,或者实现如第二方面所述的方法的步骤,或者如第三方面所述的方法的步骤。In the seventh aspect, the embodiment of the present application provides an electronic device, the electronic device includes a processor, a memory, and a program or instruction stored in the memory and operable on the processor, and the program or instruction is executed by When executed, the processor implements the steps of the method described in the first aspect, or implements the steps of the method described in the second aspect, or implements the steps of the method described in the third aspect.
第八方面,本申请实施例提供了一种可读存储介质,所述可读存储介质上存储程序或指令,所述程序或指令被处理器执行时实现如第一方面所述的方法的步骤,或者实现如第二方面所述的方法的步骤,或者如第三方面所述的方法的步骤。In an eighth aspect, the embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented , or implement the steps of the method described in the second aspect, or the steps of the method described in the third aspect.
第九方面,本申请实施例提供了一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现如第一方面所述的方法,或者实现如第二方面所述的方法的步骤,或者如第三方面所述的方法的步骤。In the ninth aspect, the embodiment of the present application provides a chip, the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is used to run programs or instructions, so as to implement the first aspect Said method, or implements the steps of the method described in the second aspect, or implements the steps of the method described in the third aspect.
第十方面,本申请实施例提供了一种计算机程序/程序产品,所述计算机程序/程序产品被存储在非易失的存储介质中,所述计算机程序/程序产品被至少一个处理器执行以实现如第一方面所述的方法的步骤,或者实现如第二方面所述的方法的步骤,或者如第三方面所述的方法的步骤。In a tenth aspect, the embodiment of the present application provides a computer program/program product, the computer program/program product is stored in a non-volatile storage medium, and the computer program/program product is executed by at least one processor to Implement the steps of the method described in the first aspect, or implement the steps of the method described in the second aspect, or implement the steps of the method described in the third aspect.
第十一方面,本申请实施例提供了一种通信设备,被配置为执行第一方面所述的方法的步骤,或者被配置为执行第二方面所述的方法的步骤,或者被配置为执行第三方面所述的方法的步骤。In the eleventh aspect, the embodiment of the present application provides a communication device configured to perform the steps of the method described in the first aspect, or configured to perform the steps of the method described in the second aspect, or configured to perform The steps of the method described in the third aspect.
在本申请实施例中,第一用户端可以向服务端发送数据访问请求,并接收服务端基于第一智能合约发送的第一存储信息和第一权限信息,利用第一存储信息,从存储服务器中获取第一加密数据包,进行解密处理后得到待访问数据,并根据第一权限信息,执行对所述待访问数据的访问操作,由于第一权限信息用于指示第一用户端可对待访问数据执行的访问操作,因此可以通过控制第一用户端对待访问数据的访问权限,来避免第一用户端将待访问数据非法地发送至其他用户,降低了数据泄露的风险,提升了数据的私密性和安全性。In this embodiment of the application, the first client can send a data access request to the server, and receive the first storage information and the first permission information sent by the server based on the first smart contract, and use the first storage information to obtain data from the storage server. Obtain the first encrypted data packet, perform decryption to obtain the data to be accessed, and perform an access operation on the data to be accessed according to the first permission information, because the first permission information is used to indicate that the first client can be accessed Therefore, by controlling the access rights of the first client to the data to be accessed, it is possible to prevent the first client from illegally sending the data to be accessed to other users, reducing the risk of data leakage and improving data privacy sex and safety.
附图说明Description of drawings
图1是本申请实施例提供的数据共享方法的步骤流程图之一;Fig. 1 is one of the flow charts of the steps of the data sharing method provided by the embodiment of the present application;
图2是本申请实施例提供的数据共享方法的步骤流程图之二;Fig. 2 is the second flow chart of the steps of the data sharing method provided by the embodiment of the present application;
图3是本申请实施例提供的数据共享方法的步骤流程图之三;FIG. 3 is the third flowchart of the steps of the data sharing method provided by the embodiment of the present application;
图4是本申请实施例提供的数据共享方法的步骤流程图之四;FIG. 4 is the fourth flowchart of the steps of the data sharing method provided by the embodiment of the present application;
图5是本申请实施例提供的场景架构图之一;FIG. 5 is one of the scene architecture diagrams provided by the embodiment of the present application;
图6是本申请实施例提供的场景架构图之二;FIG. 6 is the second scenario architecture diagram provided by the embodiment of the present application;
图7是本申请实施例提供的交互流程示意图之一;FIG. 7 is one of the schematic diagrams of the interaction process provided by the embodiment of the present application;
图8是本申请实施例提供的交互流程示意图之二;Fig. 8 is the second schematic diagram of the interaction process provided by the embodiment of the present application;
图9是本申请实施例提供的数据共享装置的结构示意图之一;FIG. 9 is one of the structural schematic diagrams of the data sharing device provided by the embodiment of the present application;
图10是本申请实施例提供的数据共享装置的结构示意图之二;Fig. 10 is the second structural diagram of the data sharing device provided by the embodiment of the present application;
图11是本申请实施例提供的数据共享装置的结构示意图之三;Fig. 11 is the third structural diagram of the data sharing device provided by the embodiment of the present application;
图12是本申请实施例提供的数据共享装置的结构示意图之四;Fig. 12 is the fourth schematic diagram of the structure of the data sharing device provided by the embodiment of the present application;
图13是本申请实施例提供的数据共享装置的结构示意图之五;Fig. 13 is the fifth structural diagram of the data sharing device provided by the embodiment of the present application;
图14是本申请实施例提供的电子设备的结构示意图之一;Fig. 14 is one of the structural schematic diagrams of the electronic device provided by the embodiment of the present application;
图15是本申请实施例提供的电子设备的结构示意图之二。FIG. 15 is a second schematic structural diagram of an electronic device provided by an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员获得的所有其他实施例,都属于本申请保护的范围。The following will clearly describe the technical solutions in the embodiments of the present application with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, but not all of them. All other embodiments obtained by persons of ordinary skill in the art based on the embodiments in this application belong to the protection scope of this application.
本申请的说明书和权利要求书中的术语“第一”、“第二”等是用于区别类似的对象,而不用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施,且“第一”、“第二”等所区分的对象通常为一类,并不限定对象的个数,例如第一对象可以是一个,也可以是多个。此外,说明书以及权利要求中“和/或”表示所连接对象的至少其中之一,字符“/”,一般表示前后关联对象是一种“或”的关系。The terms "first", "second" and the like in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific sequence or sequence. It should be understood that the terms so used are interchangeable under appropriate circumstances such that the embodiments of the application can be practiced in sequences other than those illustrated or described herein, and that references to "first," "second," etc. distinguish Objects are generally of one type, and the number of objects is not limited. For example, there may be one or more first objects. In addition, "and/or" in the specification and claims means at least one of the connected objects, and the character "/" generally means that the related objects are an "or" relationship.
下面结合附图,通过具体的实施例及其应用场景对本申请实施例提供的 数据共享方法进行详细地说明。The data sharing method provided by the embodiment of the present application will be described in detail below through specific embodiments and application scenarios in conjunction with the accompanying drawings.
参照图1,图1为本申请实施例提供的数据共享方法的步骤流程图,该方法可以应用于第一用户端,该方法包括:Referring to FIG. 1, FIG. 1 is a flow chart of the steps of the data sharing method provided by the embodiment of the present application. The method can be applied to the first client, and the method includes:
步骤101、向服务端发送数据访问请求,所述数据访问请求携带第一数据共享信息,所述第一数据共享信息与待访问数据关联。 Step 101. Send a data access request to a server, where the data access request carries first data sharing information, and the first data sharing information is associated with the data to be accessed.
步骤102、接收服务端基于第一智能合约发送的第一存储信息和第一权限信息,其中,所述第一智能合约属于区块链中的第一区块,所述第一权限信息用于指示所述第一用户端可对所述待访问数据执行的访问操作。Step 102: Receive the first storage information and the first permission information sent by the server based on the first smart contract, wherein the first smart contract belongs to the first block in the blockchain, and the first permission information is used for An access operation that the first client can perform on the data to be accessed is indicated.
步骤103、根据所述第一存储信息,从存储服务器中获取第一加密数据包。 Step 103. Acquire a first encrypted data package from a storage server according to the first storage information.
步骤104、对所述第一加密数据包进行解密处理,得到所述待访问数据,其中,所述第一加密数据包基于所述待访问数据和所述待访问数据的元数据生成。Step 104: Decrypt the first encrypted data packet to obtain the data to be accessed, wherein the first encrypted data packet is generated based on the data to be accessed and metadata of the data to be accessed.
步骤105、根据所述第一权限信息,执行对所述待访问数据的访问操作。 Step 105. Perform an access operation on the data to be accessed according to the first permission information.
在上述步骤101中,上述第一用户端可以理解为数据需求方,具体可以为移动电子设备,也可以为非移动电子设备。示例性的,移动电子设备可以为手机、平板电脑、笔记本电脑、掌上电脑、车载电子设备、可穿戴设备等,在此不再一一列举。In the above step 101, the above-mentioned first client can be understood as a data demander, specifically, it can be a mobile electronic device, or it can be a non-mobile electronic device. Exemplarily, the mobile electronic device may be a mobile phone, a tablet computer, a notebook computer, a palmtop computer, a vehicle electronic device, a wearable device, etc., which will not be listed here.
而服务端可以理解为共享数据的平台。其中,上述服务端可以与区块链网络连接,并通过区块链中的区块记录共享数据的相关信息,并可以向数据需求方进行展示,以便于数据需求方获取到所需的数据。可以理解的是,上述服务端可以由一台或多台服务器组成,相当于服务端不同的功能模块。The server can be understood as a platform for sharing data. Among them, the above-mentioned server can be connected to the blockchain network, and record the relevant information of the shared data through the blocks in the blockchain, and can display it to the data demander, so that the data demander can obtain the required data. It can be understood that the above server may be composed of one or more servers, which are equivalent to different functional modules of the server.
其中,上述第一用户端可以与服务端通信连接,从而可以向服务端发送数据访问请求。上述数据访问请求可以基于用户的输入,例如通过在第一用户端点选获取待访问数据的按键或者链接,当然,上述数据访问请求也可以根据预设条件自行触发,在此不作限定。Wherein, the above-mentioned first client end may be communicatively connected with the server end, so as to send a data access request to the server end. The above-mentioned data access request may be based on the user's input, for example, by clicking on the button or link to obtain the data to be accessed on the first user terminal. Of course, the above-mentioned data access request may also be triggered by itself according to preset conditions, which is not limited here.
可以理解的是,上述数据访问请求可以携带第一用户端的身份信息和第一数据共享信息,其中,第一用户端的身份信息可以包括第一用户端的身份标识(Identity Document,ID),以便于服务端确定发送数据访问请求的用户 端。当然,上述身份信息还可以包括第一用户端的行业信息、公司信息以及个人信息,以表征第一用户端所代表的行业、公司以及第一用户端的用户自身的信息。上述身份信息可以由第一用户端的用户自行填写,例如在注册账户时,填写上述身份信息,以便于服务端确定第一用户端的是否有访问待访问数据的权限。It can be understood that the above-mentioned data access request may carry the identity information of the first client and the first data sharing information, wherein the identity information of the first client may include an identity (Identity Document, ID) of the first client, so as to facilitate the service The client determines the client sending the data access request. Of course, the above identity information may also include the industry information, company information and personal information of the first client to represent the industry and company represented by the first client and the information of the user of the first client. The above-mentioned identity information can be filled in by the user of the first client, for example, when registering an account, the above-mentioned identity information is filled in, so that the server can determine whether the first client has the right to access the data to be accessed.
上述第一数据共享信息,用于描述待访问数据,具体可以由待访问数据确定。可以理解的是,服务端可以存储有描述待访问数据的相关信息,并可以将其中的部分信息向上述第一用户端进行展示,在用户确定待访问数据后,可以通过对第一用户端的输入,例如点选获取待访问数据对应的交互按键或链接,来确定上述第一数据共享信息。The above-mentioned first data sharing information is used to describe the data to be accessed, and may be specifically determined by the data to be accessed. It can be understood that the server may store relevant information describing the data to be accessed, and may display part of the information to the first client. After the user determines the data to be accessed, the user may input , for example, click to obtain the interactive button or link corresponding to the data to be accessed to determine the above-mentioned first data sharing information.
当然,上述第一数据共享信息也可以由用户手动填写,例如通过填写待访问数据对应的ID或者名称、发布者信息等,来确定所需要获取的待访问数据。Certainly, the above-mentioned first data sharing information may also be manually filled in by the user, for example, by filling in the ID or name corresponding to the data to be accessed, publisher information, etc., to determine the data to be accessed that needs to be obtained.
在上述步骤102中,上述第一存储信息和第一权限信息由服务端基于第一智能合约发送。应理解,上述服务端与区块链网络连接,因此可以从区块链中的第一区块获取到上述第一智能合约,在上述第一用户端满足第一智能合约的第一访问条件的情况下,服务端即可以根据第一智能合约的指示,将上述第一存储信息和第一权限信息发送至第一用户端。In the above-mentioned step 102, the above-mentioned first storage information and first permission information are sent by the server based on the first smart contract. It should be understood that the above-mentioned server is connected to the block chain network, so the above-mentioned first smart contract can be obtained from the first block in the block chain, and the above-mentioned first client meets the first access condition of the first smart contract In this case, the server can send the above-mentioned first storage information and first permission information to the first client according to the instruction of the first smart contract.
上述第一存储信息,用于从存储服务器中获取待访问数据。具体地,上述第一存储信息可以包括验证信息,用于与存储服务器进行权限校验;为避免数据泄露,待访问数据通常为加密存储,因此上述第一存储信息还可以包括解密密钥和存储地址等相关信息,用于获取解密的密钥和加密数据。The above-mentioned first storage information is used to obtain the data to be accessed from the storage server. Specifically, the above-mentioned first storage information may include verification information, which is used to check the authority with the storage server; in order to avoid data leakage, the data to be accessed is usually encrypted and stored, so the above-mentioned first storage information may also include decryption keys and storage Address and other related information are used to obtain the decryption key and encrypted data.
上述存储服务器可以为上述服务端中负责存储功能的服务器,也可以为外部存储服务器,上述待共享数据可以在加密处理后存储于上述存储服务器中,在此不作限定。The above-mentioned storage server may be the server responsible for the storage function in the above-mentioned server, and may also be an external storage server. The above-mentioned data to be shared may be stored in the above-mentioned storage server after encrypted processing, which is not limited herein.
进一步地,若第一用户端通过解密密文数据的方式,得到明文数据,即待访问数据,那么第一用户端就可以将待访问数据分享给非法或无访问资格的用户,这无疑降低了数据的私密性。因此,服务端可以在发送第一存储信息的同时,向第一用户端发送第一权限信息,第一权限信息用于指示第一用 户端可对待访问数据执行的访问操作,从而可以通过对访问操作权限的控制,来提升待访问数据的私密性,避免数据泄露。Further, if the first client obtains the plaintext data, that is, the data to be accessed, by decrypting the ciphertext data, then the first client can share the data to be accessed with illegal or unqualified users, which undoubtedly reduces the Data privacy. Therefore, the server can send the first permission information to the first client while sending the first storage information, the first permission information is used to indicate the access operations that the first client can perform on the data to be accessed, so that the access Control the operation authority to improve the privacy of the data to be accessed and avoid data leakage.
应理解,上述访问操作,可以包括读取操作、编辑操作和复制操作等,上述第一权限信息可以由数据提供方提供,例如由数据提供方规定待访问数据为只读数据。当然,数据提供方也可以向服务端提供权限列表,包括多种允许执行的访问操作,由第一用户端根据需要执行的访问操作,确定并接收服务端发送的第一权限信息。It should be understood that the above-mentioned access operations may include read operations, edit operations, and copy operations, etc., and the above-mentioned first permission information may be provided by the data provider, for example, the data provider specifies that the data to be accessed is read-only data. Of course, the data provider may also provide the server with a permission list, including various allowed access operations, and the first client determines and receives the first permission information sent by the server according to the access operations performed as required.
可选地,上述第一存储信息和第一权限信息,均可以以加密数据包的形式传输,以提升数据传输时的安全性。Optionally, both the above-mentioned first storage information and first permission information may be transmitted in the form of encrypted data packets, so as to improve the security of data transmission.
相应地,在上述步骤103中,用户即可以根据第一存储信息,从存储服务器中获取到第一加密数据包。上述第一加密数据包由待访问数据和待访问数据的元数据经封包处理后生成,上述待访问数据的元数据可以为描述待访问数据的数据信息,从而可以根据待访问数据的元数据确定待访问数据,以及待访问数据对应的第一加密数据包。Correspondingly, in the above step 103, the user can obtain the first encrypted data package from the storage server according to the first storage information. The above-mentioned first encrypted data packet is generated by encapsulating the data to be accessed and the metadata of the data to be accessed, and the metadata of the data to be accessed can be data information describing the data to be accessed, so that it can be determined according to the metadata of the data to be accessed The data to be accessed, and the first encrypted data packet corresponding to the data to be accessed.
示例性地,上述待访问数据的元数据可以由数据提供方如下述流程生成:Exemplarily, the above-mentioned metadata of the data to be accessed may be generated by the data provider as follows:
生成数据信息,数据信息包括但不限于加密数据包标识、数据提供者标识、数据提供者的公钥、执行数据共享智能合约的地址等;Generate data information, including but not limited to encrypted data packet identification, data provider identification, data provider's public key, address for executing data sharing smart contracts, etc.;
对生成的数据信息进行哈希(Hash)计算并对哈希计算得到的结果使用私钥进行签名;Perform Hash calculation on the generated data information and use the private key to sign the hash calculation result;
将数据信息和对数据信息的签名一起形成待访问数据的元数据。The data information and the signature on the data information together form the metadata of the data to be accessed.
可以理解的是,上述第一加密数据包为封包处理得到的文件,因此可以反复封包和解封,第一用户端可以在解封第一加密数据包后,执行完成对待访问数据的访问操作后,将待访问数据重新以加密数据包的形式存储在本地,从而可以避免第一用户端直接将待访问数据发送给其他非法或无权限用户,供其他非法或无权限用户访问而导致的数据泄露。It can be understood that the above-mentioned first encrypted data package is a file obtained by package processing, so it can be packaged and unpacked repeatedly, and the first client can perform the access operation on the data to be accessed after unpacking the first encrypted data package, The data to be accessed is re-stored locally in the form of an encrypted data packet, thereby avoiding data leakage caused by the first client directly sending the data to be accessed to other illegal or unauthorized users for access by other illegal or unauthorized users.
在上述步骤104和步骤105中,第一用户端可以通过第一存储信息,获取到上述第一加密数据包,并可以利用第一存储信息中的密钥信息对上述第一加密数据包进行解密,得到待访问数据。此时,第一用户端即可以根据上述第一权限信息,执行对待访问数据的访问操作。In the above step 104 and step 105, the first client can obtain the above-mentioned first encrypted data packet through the first storage information, and can use the key information in the first storage information to decrypt the above-mentioned first encrypted data packet , get the data to be accessed. At this point, the first user terminal can perform an access operation on the data to be accessed according to the first permission information.
需要说明的是,上述步骤104和105之间无时序关系,也即上述步骤104和步骤105可以同时执行,也可以分时执行。例如,在上述第一用户端获取到上述待访问数据的过程,第一用户端可以同时读取第一权限信息,并对待访问数据仅处理,以禁用待访问数据中除第一权限信息指示的访问操作外的访问操作,得到处理后的待访问数据。It should be noted that there is no time sequence relationship between the above steps 104 and 105, that is, the above steps 104 and 105 can be executed at the same time or in time division. For example, in the process of obtaining the data to be accessed by the first user end, the first user end can read the first permission information at the same time, and only process the data to be accessed, so as to disable the data to be accessed except those indicated by the first permission information The access operation other than the access operation obtains the processed data to be accessed.
在本申请实施例中,第一用户端可以向服务端发送数据访问请求,并接收服务端基于第一智能合约发送的第一存储信息和第一权限信息,利用第一存储信息,从存储服务器中获取第一加密数据包,进行解密处理后得到待访问数据,并根据第一权限信息,执行对所述待访问数据的访问操作,由于第一权限信息用于指示第一用户端可对待访问数据执行的访问操作,因此可以通过控制第一用户端对待访问数据的访问权限,来避免第一用户端将待访问数据非法地发送至其他用户,降低了数据泄露的风险,提升了数据的私密性和安全性。In this embodiment of the application, the first client can send a data access request to the server, and receive the first storage information and the first permission information sent by the server based on the first smart contract, and use the first storage information to obtain data from the storage server. Obtain the first encrypted data packet, perform decryption to obtain the data to be accessed, and perform an access operation on the data to be accessed according to the first permission information, because the first permission information is used to indicate that the first client can be accessed Therefore, by controlling the access rights of the first client to the data to be accessed, it is possible to prevent the first client from illegally sending the data to be accessed to other users, reducing the risk of data leakage and improving data privacy sex and safety.
可选地,第一存储信息包括第一密钥信息和第一地址信息,所述上述步骤103,包括:Optionally, the first storage information includes first key information and first address information, and the above step 103 includes:
在所述第一密钥信息通过所述存储服务器的验证的情况下,获取第二密钥信息;acquiring second key information when the first key information is verified by the storage server;
根据所述第一地址信息,在所述存储服务器获取所述第一加密数据包;Obtaining the first encrypted data packet from the storage server according to the first address information;
上述步骤104,包括:The above step 104 includes:
利用所述第二密钥信息对所述第一加密数据包进行解密处理,得到所述待访问数据。Decrypting the first encrypted data packet by using the second key information to obtain the data to be accessed.
在本申请实施例中,上述存储服务器可以包括上述存储服务器可以包括密钥存储服务器和数据存储服务器,上述待访问数据可以经加密处理后得到加密数据包并存储于上述数据存储服务器中,而用于解密的第一密钥信息可以存储于密钥存储服务器中。In the embodiment of the present application, the above-mentioned storage server may include the above-mentioned storage server may include a key storage server and a data storage server, and the above-mentioned to-be-accessed data may be encrypted to obtain an encrypted data packet and stored in the above-mentioned data storage server. The first key information for decryption may be stored in the key storage server.
上述第一存储信息可以包括用于获取密钥服务器的访问权限的第一密钥信息以及指示第一加密数据包存储地址的第一地址信息。上述第一密钥信息可以包括密钥和第二密钥信息的存储地址,第一用户端可以通过密钥访问存储服务器,而通过第二密钥信息的存储地址获取到第二密钥信息。The above-mentioned first storage information may include first key information for obtaining access authority of the key server and first address information indicating a storage address of the first encrypted data packet. The above-mentioned first key information may include a key and a storage address of the second key information, and the first client may access the storage server through the key, and obtain the second key information through the storage address of the second key information.
第一用户还可以根据第一地址信息,在所述存储服务器获取第一加密数据包,从而可以通过第二密钥信息对第一加密数据包进行解密处理,得到待访问数据。The first user can also obtain the first encrypted data packet from the storage server according to the first address information, so that the first encrypted data packet can be decrypted by using the second key information to obtain the data to be accessed.
在本申请实施例中,通过将第二密钥信息和第一加密数据包独立存储,第一用户端需要分别从存储服务器获取第二密钥信息和第一加密数据包,从而才能获取到待访问数据,进一步提升了数据的安全性。In the embodiment of this application, by storing the second key information and the first encrypted data package independently, the first client needs to obtain the second key information and the first encrypted data package from the storage server respectively, so as to obtain the Access to data further enhances data security.
可选地,上述步骤105之后,所述方法还包括以下任一项:Optionally, after the above step 105, the method further includes any of the following:
在所述访问操作终止后,删除所述待访问数据和所述第一加密数据包;After the access operation is terminated, delete the data to be accessed and the first encrypted data package;
在所述访问操作终止后,基于所述待访问数据和所述第一加密数据包中所述待访问数据的元数据,对所述待访问数据进行封装以得到第二加密数据包,存储所述第二加密数据包。After the access operation is terminated, based on the data to be accessed and the metadata of the data to be accessed in the first encrypted data packet, the data to be accessed is encapsulated to obtain a second encrypted data packet, and the stored Describe the second encrypted data packet.
在本申请实施例中,为避免第一用户端在访问操作完成后,用户通过在第一用户端的本地执行对待访问数据的其他操作,在本申请实施例中,上述访问操作终止后,第一用户端可以删除待访问数据和第一加密数据包。当然,上述访问操作终止后,第一用户端也可以将待访问数据和第一加密数据包中待访问数据的元数据重新进行封包,得到第二加密数据包并在本地存储,以避免第一用户端在解密得到待访问数据后,将待访问数据非法分享给其他用户,提升数据的安全性和私密性。In this embodiment of the application, in order to prevent the first client from performing other operations on the data to be accessed locally after the first client end completes the access operation, in this embodiment of the application, after the above access operation is terminated, the first The user end can delete the data to be accessed and the first encrypted data package. Of course, after the above-mentioned access operation is terminated, the first client can also repackage the data to be accessed and the metadata of the data to be accessed in the first encrypted data packet to obtain the second encrypted data packet and store it locally to avoid the first After the client decrypts the data to be accessed, it illegally shares the data to be accessed with other users to improve the security and privacy of the data.
应理解,上述实施例中的方法步骤,可以基于第一用户端中的应用程序实现,也即通过应用程序内调用待访问数据,执行访问操作,可以便于应用程序后续对待访问数据的控制。It should be understood that the method steps in the above embodiments can be implemented based on the application program in the first client, that is, by calling the data to be accessed in the application program and performing an access operation, it can facilitate the subsequent control of the data to be accessed by the application program.
参照图2,本申请实施例还提供了一种数据共享方法,应用于第二用户端,该方法包括:Referring to FIG. 2, the embodiment of the present application also provides a data sharing method, which is applied to the second client, and the method includes:
步骤201、获取待共享数据的第二存储信息,所述第二存储信息指示所述待共享数据对应在所述存储服务器存储的信息; Step 201. Obtain second storage information of the data to be shared, where the second storage information indicates that the data to be shared corresponds to information stored in the storage server;
步骤202、向服务端发送数据共享请求,所述数据共享请求携带第二数据共享信息和所述第二用户端的数字签名,所述第二数据共享信息基于所述第二存储信息生成,用于描述所述待共享数据;Step 202: Send a data sharing request to the server, the data sharing request carries second data sharing information and the digital signature of the second client, the second data sharing information is generated based on the second storage information, and is used for describe the data to be shared;
步骤203、基于所述待共享数据的元数据和所述待共享数据生成第三加 密数据包; Step 203, generating a third encrypted data packet based on the metadata of the data to be shared and the data to be shared;
步骤204、根据所述第二存储信息,在所述存储服务器存储所述第三加密数据包和所述第三加密数据包对应的密钥信息。 Step 204. According to the second storage information, store the third encrypted data package and key information corresponding to the third encrypted data package in the storage server.
在本申请实施例中,上述第二用户端可以理解为数据提供方,具体可以为移动电子设备,也可以为非移动电子设备。示例性的,移动电子设备可以为手机、平板电脑、笔记本电脑、掌上电脑、车载电子设备、可穿戴设备等,在此不再一一列举。In the embodiment of the present application, the above-mentioned second client can be understood as a data provider, specifically, it can be a mobile electronic device, or it can be a non-mobile electronic device. Exemplarily, the mobile electronic device may be a mobile phone, a tablet computer, a notebook computer, a palmtop computer, a vehicle electronic device, a wearable device, etc., which will not be listed here.
上述第二用户端同样可以与服务端通信连接。可以理解的是,上述第二用户端可以为第一用户端的数据提供方,也可以不为第一用户端的数据提供方。也即上述步骤101~105和步骤201~204可以结合,也可以为相互独立的交互流程,在此不作限定。可以理解的是,在上述第二用户端为第一用户端的数据提供方时,上述待访问数据所指代的数据和待共享数据所指代的数据为同一数据。The above-mentioned second client can also communicate with the server. It can be understood that the second client may or may not be the data provider of the first client. That is, the above steps 101-105 and steps 201-204 may be combined, or may be mutually independent interactive processes, which are not limited here. It can be understood that, when the second client is the data provider of the first client, the data referred to by the data to be accessed and the data referred to by the data to be shared are the same data.
在上述步骤201中,上述第二存储信息,可以为第二用户端预先在存储服务器注册得到的注册信息,其可以包括第三加密数据包的存储地址等相关信息。In the above-mentioned step 201, the above-mentioned second storage information may be the registration information obtained by the second client from pre-registering with the storage server, which may include relevant information such as the storage address of the third encrypted data packet.
在上述步骤202中,上述数据共享请求可以基于用户的输入,例如通过在第一用户端点选发布数据的按键,当然,上述数据共享请求也可以根据预设条件自行触发,在此不作限定。In the above step 202, the data sharing request may be based on the user's input, for example, by clicking the release data button on the first user terminal. Of course, the data sharing request may also be triggered automatically according to preset conditions, which is not limited here.
可以理解的是,为了实现数据共享,上述数据共享请求可以携带第二数据共享信息和上述第二用户端的数字签名。其中,上述第二用户端的数字签名为由上述第二用户端生成的字符串,以对第二用户端发送信息的真实性进行证明。It can be understood that, in order to realize data sharing, the data sharing request may carry the second data sharing information and the digital signature of the second client. Wherein, the digital signature of the second client is a character string generated by the second client to prove the authenticity of the information sent by the second client.
上述第二数据共享信息可以用于描述待共享数据,具体地,上述第二数据共享信息可以包括第二用户端的身份信息,第二用户端的身份信息可以包括第二用户端的ID,还可以包括第二用户端的公钥,以便于服务端确定发送数据共享请求的用户端,当然,上述身份信息还可以包括第二用户端的行业信息、公司信息以及个人信息,以表征第二用户端所代表的行业、公司以及第二用户端的用户自身的信息,可以在服务端发布共享数据时,便于数据需 求方查看数据提供方的相关信息。上述身份信息可以由第二用户端的用户自行填写,例如在注册账户时,填写上述身份信息,在此不再赘述。The above-mentioned second data sharing information may be used to describe the data to be shared. Specifically, the above-mentioned second data sharing information may include the identity information of the second user end, and the identity information of the second user end may include the ID of the second user end, and may also include the first The public key of the second client, so that the server can determine the client sending the data sharing request. Of course, the above identity information can also include the industry information, company information and personal information of the second client to represent the industry represented by the second client , the company, and the user's own information on the second client end, when the shared data is released on the server end, it is convenient for the data demander to view the relevant information of the data provider. The above-mentioned identity information can be filled in by the user of the second client terminal, for example, when registering an account, the above-mentioned identity information is filled in, and details will not be repeated here.
上述第二数据共享信息还可以包括数据存储信息、数据简介信息和共享策略信息,其中,上述数据存储信息可以包括待共享数据的存储地址,若待共享数据为密文数据,密文的标识ID、密钥ID和密钥的存储地址等,以便于数据需求方根据数据存储信息获取到上述待共享数据。The above-mentioned second data sharing information may also include data storage information, data profile information, and sharing policy information, wherein the above-mentioned data storage information may include the storage address of the data to be shared, and if the data to be shared is ciphertext data, the identification ID of the ciphertext , key ID and key storage address, etc., so that the data demander can obtain the above-mentioned data to be shared according to the data storage information.
上述数据简介信息用于表征待共享数据的属性,例如待共享数据的类别、简介、性质、用途和价格等,以便于数据需求方根据数据简介信息确定所需的数据。The above data profile information is used to characterize the attributes of the data to be shared, such as the category, profile, nature, purpose, and price of the data to be shared, so that the data demander can determine the required data based on the data profile information.
上述共享策略信息用于表征第二用户端意向共享的用户人群,例如,上述共享策略信息可以包括目标行业信息以及目标人群信息等,从而服务端可以根据共享策略信息,判断数据需求方是否可以获取上述待共享数据。The above-mentioned sharing policy information is used to represent the user group that the second client terminal intends to share. For example, the above-mentioned sharing policy information may include target industry information and target group information, so that the server can judge whether the data demander can obtain the data based on the sharing policy information. The above data to be shared.
在一些实施例中,上述第二数据共享信息还可以包括价格、支付账单信息,以表征数据提供方针对上述待共享数据意向获取的收益。In some embodiments, the above-mentioned second data sharing information may also include price and payment bill information to represent the revenue that the data provider intends to obtain for the above-mentioned data to be shared.
在一些实施例中,上述第二数据共享信息还可以包括指示数据提供方允许对待共享数据执行的访问操作的权限信息,以便于数据提供方选择自己所需的访问操作并可以通过支付操作获取相应的权限信息。In some embodiments, the above-mentioned second data sharing information may also include authorization information indicating that the data provider allows the access operations to be performed on the shared data, so that the data provider can choose the access operations it needs and obtain the corresponding access operations through payment operations. permission information.
可以理解的是,上述第二数据共享信息中所包含的信息均可以由第二用户端自行填写,例如可以在第二用户端对应的应用程序中创建信息模板以供第二用户端的用户进行填写,也可以由第二用户端根据获取的数据自动生成,在此不作限定。It can be understood that the information contained in the above-mentioned second data sharing information can be filled in by the second client, for example, an information template can be created in the application program corresponding to the second client for the user of the second client to fill in , may also be automatically generated by the second client terminal according to the acquired data, which is not limited here.
在上述步骤203中,与上述实施例类似地,上述第三加密数据包可以基于待共享数据和待共享数据的元数据经封包处理后生成,上述待共享数据的元数据可以为描述待共享数据的数据信息,从而可以根据待共享数据的元数据确定待共享数据,以及待共享数据对应的第三加密数据包。In the above-mentioned step 203, similar to the above-mentioned embodiment, the above-mentioned third encrypted data packet can be generated based on the data to be shared and the metadata of the data to be shared after packet processing, and the metadata of the above-mentioned data to be shared can be a description of the data to be shared The data information, so that the data to be shared and the third encrypted data package corresponding to the data to be shared can be determined according to the metadata of the data to be shared.
在上述步骤204中,第二用户端可以根据在存储服务器注册的第二存储信息,将上述第三加密数据包和其对应的密钥信息上传至存储服务器。In the above step 204, the second client may upload the above-mentioned third encrypted data package and its corresponding key information to the storage server according to the second storage information registered in the storage server.
在本申请实施例中,第二用户端可以在上传待共享数据时,即将待共享数据和待共享数据的元数据封包处理得到第三加密数据包,并将第三加密数 据包存储至存储服务器,从而数据需求方在获取待共享数据时,可以通过从存储服务器中获取到第三加密数据包。由于第三加密数据包可以经过多次封包和解封,因此保证了待共享数据始终以加密数据包在数据需求方本地存储,避免数据需求方对待共享数据执行非法的访问操作,提升了数据的安全性和私密性。In the embodiment of the present application, when uploading the data to be shared, the second client may process the data to be shared and the metadata package of the data to be shared to obtain the third encrypted data packet, and store the third encrypted data packet in the storage server , so that when the data demander obtains the data to be shared, the third encrypted data package can be obtained from the storage server. Since the third encrypted data packet can be encapsulated and decapsulated multiple times, it is ensured that the data to be shared is always stored locally on the data demand side in encrypted data packets, preventing the data demand side from performing illegal access operations on the shared data and improving data security. sex and privacy.
可选地,上述步骤203,包括:Optionally, the above step 203 includes:
生成与所述待共享数据对应的第一数据信息,所述第一数据信息包括以下至少一项:指示所述第二用户端的第一标识、指示所述第三加密数据包的第二标识、以及指示第二智能合约的第二地址信息;generating first data information corresponding to the data to be shared, where the first data information includes at least one of the following: a first identification indicating the second client, a second identification indicating the third encrypted data packet, and second address information indicating the second smart contract;
其中,所述第二地址信息由所述服务端发送,所述第二智能合约属于区块链中的第二区块,所述第二智能合约用于指示在满足所述第二智能合约的访问条件的情况下,所述服务端输出第三存储信息和第二权限信息,所述第三存储信息用于在所述存储服务器获取所述待共享数据,所述第二权限信息用于指示可对所述待共享数据执行的访问操作;Wherein, the second address information is sent by the server, the second smart contract belongs to the second block in the block chain, and the second smart contract is used to indicate that the second smart contract is satisfied In the case of access conditions, the server outputs third storage information and second permission information, the third storage information is used to obtain the data to be shared in the storage server, and the second permission information is used to indicate Access operations that can be performed on the data to be shared;
根据所述第一数据信息和所述第二用户端对所述第一数据信息的数字签名,生成所述待共享数据的元数据;generating metadata of the data to be shared according to the first data information and the digital signature of the second client on the first data information;
将所述待共享数据的元数据和所述待共享数据进行封装,得到所述第三加密数据包。Encapsulating the metadata of the data to be shared and the data to be shared to obtain the third encrypted data package.
在本申请实施例中,上述待共享数据的元数据可以基于第一数据信息生成,第一数据信息包括但不限于第一标识、第二标识和第二地址信息。应理解,上述第二标识,可以包括指示数据提供者的ID,还可以包括数据提供者的公钥,在此不作限定。In this embodiment of the present application, the above-mentioned metadata of the data to be shared may be generated based on the first data information, and the first data information includes but not limited to the first identification, the second identification and the second address information. It should be understood that the above-mentioned second identifier may include an ID indicating the data provider, and may also include a public key of the data provider, which is not limited here.
上述第二智能合约,即为服务端基于区块链技术生成的智能合约,用指示于在满足第二智能合约的访问条件的情况下,由服务端输出第三存储信息和第二权限信息,也即将第三存储信息和第二权限信息发送至用户端。而上述第二地址信息,即为执行第二智能合约的地址。上述第二地址信息可以为统一资源定位器(Uniform Resource Locator,URL)或统一资源标识符(Uniform Resource Identifier,URI)地址。The above-mentioned second smart contract is a smart contract generated by the server based on blockchain technology, which is used to indicate that the server outputs the third storage information and the second permission information when the access conditions of the second smart contract are met, That is, the third storage information and the second permission information are sent to the user terminal. The above-mentioned second address information is the address for executing the second smart contract. The above-mentioned second address information may be a Uniform Resource Locator (Uniform Resource Locator, URL) or a Uniform Resource Identifier (Uniform Resource Identifier, URI) address.
上述第三存储信息与上述实施例中的第一存储信息类似,上述第二权限 信息与上述第一权限信息类似,为避免重复,在此不再赘述。The above-mentioned third storage information is similar to the first storage information in the above-mentioned embodiment, and the above-mentioned second permission information is similar to the above-mentioned first permission information. To avoid repetition, details are not repeated here.
可以理解,上述第二用户端对所述第一数据信息的数字签名操作,具体可以为第二用户端首先对第一数据信息进行哈希(Hash)计算。而后对哈希计算得到的结果使用私钥进行签名。It can be understood that the digital signature operation performed by the second client on the first data information may specifically be that the second client first performs hash (Hash) calculation on the first data information. Then use the private key to sign the result of the hash calculation.
在本申请实施例中,上述第三加密数据包可以基于指示第二用户端的第一标识、指示第三加密数据包的第二标识、以及指示第二智能合约的第二地址信息等待共享数据的元数据生成,保证了第三加密数据包可以根据待共享数据的元数据经过多次封包和解封,因此保证了待共享数据始终以加密数据包在数据需求方本地存储,避免数据需求方对待共享数据执行非法的访问操作,提升了数据的安全性和私密性。In the embodiment of the present application, the third encrypted data packet may be based on the first identifier indicating the second client, the second identifier indicating the third encrypted data packet, and the second address information indicating the second smart contract waiting to share data. Metadata generation ensures that the third encrypted data package can be packaged and decapsulated multiple times according to the metadata of the data to be shared, thus ensuring that the data to be shared is always stored locally on the data demand side in an encrypted data package, preventing the data demand side from treating sharing The data performs illegal access operations, which improves the security and privacy of the data.
参照图3,本申请实施例还提供一种数据共享方法,应用于服务端,该方法包括:Referring to FIG. 3 , the embodiment of the present application also provides a data sharing method, which is applied to the server, and the method includes:
步骤301、接收第一用户端发送的数据访问请求,所述数据访问请求携带第一数据共享信息,所述第一数据共享信息与待访问数据关联; Step 301. Receive a data access request sent by a first client, where the data access request carries first data sharing information, and the first data sharing information is associated with the data to be accessed;
步骤302、在所述第一用户端满足第一智能合约的访问条件的情况下,根据所述第一智能合约,将第一存储信息和第一权限信息发送至所述第一用户端; Step 302, when the first client meets the access conditions of the first smart contract, according to the first smart contract, send the first storage information and the first authority information to the first client;
其中,所述第一智能合约属于区块链中的第一区块,所述第一存储信息用于从存储服务器中获取所述待访问数据,所述第一权限信息指示所述第一用户端可对所述待访问数据执行的访问操作。Wherein, the first smart contract belongs to the first block in the block chain, the first storage information is used to obtain the data to be accessed from the storage server, and the first permission information indicates that the first user The access operation that the terminal can perform on the data to be accessed.
和/或包括:and/or include:
步骤401、接收第二用户端发送的数据共享请求,所述数据共享请求携带第二数据共享信息和所述第二用户端的数字签名,所述第二数据共享信息用于描述待共享数据; Step 401. Receive a data sharing request sent by a second client, where the data sharing request carries second data sharing information and a digital signature of the second client, and the second data sharing information is used to describe the data to be shared;
步骤402、根据所述第二数据共享信息,生成第三权限信息,所述第三权限信息用于确定第二权限信息,所述第二权限信息用于指示可对所述待共享数据执行的访问操作;Step 402: Generate third permission information according to the second data sharing information, the third permission information is used to determine second permission information, and the second permission information is used to indicate the actions that can be performed on the data to be shared access operation;
步骤403、根据所述第二数据共享信息和所述第二用户端的数字签名生成第二区块; Step 403, generating a second block according to the second data sharing information and the digital signature of the second client;
其中,所述第二区块包括第二智能合约,所述第二智能合约用于指示在满足所述第二智能合约的访问条件的情况下,输出第三存储信息和所述第二权限信息,所述第三存储信息用于从存储服务器中获取所述待共享数据。Wherein, the second block includes a second smart contract, and the second smart contract is used to indicate that the third storage information and the second permission information are output when the access conditions of the second smart contract are satisfied. , the third storage information is used to acquire the data to be shared from a storage server.
应理解,在本申请实施例中,上述服务端可以仅执行上述步骤301~302,也可以仅执行上述步骤401~403,也可以一并执行上述步骤301~302和步骤401~403。在上述服务端一并执行上述步骤301~302和上述步骤401~403时,上述第二用户端可以为上述第一用户端的数据提供方,而上述第一用户端可以为上述第二用户端的数据需求方,也即上述待共享数据和待访问数据可以为同一数据。It should be understood that, in this embodiment of the present application, the above-mentioned server may only perform the above-mentioned steps 301-302, or may only perform the above-mentioned steps 401-403, or may perform the above-mentioned steps 301-302 and steps 401-403 together. When the above-mentioned server end performs the above-mentioned steps 301-302 and the above-mentioned steps 401-403 together, the above-mentioned second client end can be the data provider of the above-mentioned first client end, and the above-mentioned first client end can be the data provider of the above-mentioned second client end The demand side, that is, the data to be shared and the data to be accessed may be the same data.
上述步骤301与上述步骤101对应,为避免重复,在此不再赘述。The above-mentioned step 301 corresponds to the above-mentioned step 101, and in order to avoid repetition, details are not repeated here.
在上述步骤302中,服务端可以根据第一用户端的身份信息确定第一用户端是否满足第一智能合约的访问条件,上述第一智能合约的访问条件可以由数据提供方确定,用于表征数据提供方意向共享的用户人群,例如,上述第一智能合约的访问条件可以限定目标行业以及目标人群等,从而可以根据第一用户端的身份信息来判断第一用户端是否满足上述第一智能合约的访问条件,在第一用户端满足第一智能合约的访问条件的情况下,根据第一智能合约将上述待访问数据对应的第一存储信息发送至上述第一用户端。In the above step 302, the server can determine whether the first client meets the access conditions of the first smart contract according to the identity information of the first client. The access conditions of the first smart contract can be determined by the data provider to represent data The user group that the provider intends to share, for example, the access conditions of the above-mentioned first smart contract can limit the target industry and target group, so that it can be judged based on the identity information of the first client whether the first client meets the requirements of the above-mentioned first smart contract. The access condition is to send the first stored information corresponding to the data to be accessed to the first client according to the first smart contract when the first client meets the access condition of the first smart contract.
需要说明的是,上述第一智能合约,属于区块链中的第一区块,第一区块可以基于待访问数据对应的数据提供方所发送的数据共享信息生成,具体流程可以参照下述生成第二区块的流程,在此暂不展开说明。可以理解的是,若上述待访问数据对应的数据提供方为第二用户端,则上述数据共享信息即为上述第二数据共享信息。It should be noted that the above-mentioned first smart contract belongs to the first block in the blockchain, and the first block can be generated based on the data sharing information sent by the data provider corresponding to the data to be accessed. The specific process can refer to the following The process of generating the second block will not be explained here. It can be understood that, if the data provider corresponding to the data to be accessed is the second client, the data sharing information is the second data sharing information.
上述第一存储信息和上述第一权限信息可以参照对上述步骤101的解释说明,为避免重复,在此不再赘述。For the above-mentioned first storage information and the above-mentioned first permission information, reference may be made to the explanation of the above-mentioned step 101, and to avoid repetition, details are not repeated here.
本申请实施例中,服务端可以在接收到第一用户端的数据访问请求后,将第一存储信息和第一权限信息发送至第一用户端,从而第一用户端可以根据第一存储信息获取待访问数据,并可以根据第一权限信息,执行对所述待访问数据的访问操作,由于第一权限信息用于指示第一用户端可对待访问数据执行的访问操作,因此可以通过控制第一用户端对待访问数据的访问权限, 来避免第一用户端将待访问数据非法地发送至其他用户,降低了数据泄露的风险,提升了数据的私密性和安全性。In this embodiment of the application, after receiving the data access request from the first client, the server can send the first storage information and the first permission information to the first client, so that the first client can obtain the data to be accessed, and can perform an access operation on the data to be accessed according to the first permission information, since the first permission information is used to indicate the access operation that the first client can perform on the data to be accessed, it is possible to control the first The access rights of the user end to the data to be accessed are used to prevent the first user end from illegally sending the data to be accessed to other users, reducing the risk of data leakage and improving the privacy and security of data.
可选地,在上述步骤301之前,第一用户端可以先与服务端进行相互认证,认证凭证可以为数字证书或密钥,在认证成功后,再执行上述步骤301,从而可以避免非法用户访问数据,提升了数据共享的安全性。Optionally, before the above step 301, the first client may first perform mutual authentication with the server, and the authentication credential may be a digital certificate or a key. After the authentication is successful, the above step 301 is then performed, thereby avoiding illegal user access data, improving the security of data sharing.
可选地,上述将第一存储信息和第一权限信息发送至所述第一用户端之前,上述方法还包括:Optionally, before sending the first storage information and the first permission information to the first client, the above method further includes:
在所述第一用户端满足第一智能合约的访问条件的情况下,根据所述第一用户端的身份信息和所述第一数据共享信息及第一用户端的数字签名生成第三区块,所述第三区块包括所述待访问数据对应的访问记录。When the first client meets the access conditions of the first smart contract, generate a third block according to the identity information of the first client, the first data sharing information, and the digital signature of the first client, so The third block includes an access record corresponding to the data to be accessed.
在本申请实施例中,在第一用户端满足第一智能合约的访问条件的情况下,服务端可以根据上述第一数据共享信息,形成一个区块链交易,服务端可以将上述区块链交易发送至现有的区块链的基础设施平台,基于已有的开源区块链平台(例如Hyperledger Fabric、Ethereum Quorum)生成上述第三区块,上述第三区块中可以包括上述待访问数据对应的访问记录,以便于数据提供方或数据需求方查询。In the embodiment of this application, when the first client meets the access conditions of the first smart contract, the server can form a blockchain transaction based on the above-mentioned first data sharing information, and the server can transfer the above-mentioned blockchain to The transaction is sent to the existing blockchain infrastructure platform, and the above-mentioned third block is generated based on the existing open-source blockchain platform (such as Hyperledger Fabric, Ethereum Quorum), and the above-mentioned third block can include the above-mentioned data to be accessed The corresponding access records are convenient for data providers or data demanders to query.
需要说明的是,上述区块链交易与上述访问记录以及第一数据共享信息均一一对应,也即,服务端每接收到一条第一数据共享信息,即可以根据第一数据共享信息生成一个区块链交易,并生成一条访问记录。为了避免区块链资源的浪费,上述第三区块中也可以包括多条访问记录,也即服务端可以在接收到M条第一数据共享信息之后,生成M个区块链交易,最终整合形成的第三区块中包括M个访问记录。It should be noted that the above-mentioned blockchain transactions correspond to the above-mentioned access records and the first data sharing information, that is, each time the server receives a piece of first data sharing information, it can generate a Blockchain transactions and generate an access record. In order to avoid the waste of blockchain resources, the above-mentioned third block can also include multiple access records, that is, the server can generate M blockchain transactions after receiving M pieces of first data sharing information, and finally integrate The formed third block includes M access records.
可以理解的是,M为正整数,其值可以根据第三区块的最大容量确定,在M为大于1的情况下,第三区块可以包括多条访问记录,从而避免了区块容量的浪费。It can be understood that M is a positive integer, and its value can be determined according to the maximum capacity of the third block. When M is greater than 1, the third block can include multiple access records, thereby avoiding the limitation of block capacity. waste.
可选地,上述数据访问请求还携带所述第一用户端的身份信息和所述第一用户端的数字签名,上述将第一存储信息发送至所述第一用户端的步骤之前,所述方法还包括:Optionally, the above-mentioned data access request also carries the identity information of the first client and the digital signature of the first client, and before the step of sending the first stored information to the first client, the method further includes :
在所述第一用户端满足第一智能合约的第一访问条件的情况下,根据所 述第一用户端的身份信息和所述第一数据共享信息以及所述第一用户端的数字签名生成第四区块,所述第四区块包括第三智能合约,所述第三智能合约与所述第一智能合约关联,用于指示在接收到所述第一用户端发送的支付信息的情况下,将第一存储信息和第一权限信息发送至所述第一用户端;When the first client meets the first access condition of the first smart contract, generate a fourth Block, the fourth block includes a third smart contract, the third smart contract is associated with the first smart contract, and is used to indicate that when the payment information sent by the first client is received, sending the first storage information and the first permission information to the first client;
将与所述待访问数据关联的账单信息发送至所述第一用户端;sending billing information associated with the data to be accessed to the first client;
在接收到所述第一用户端发送的支付信息后,根据所述支付信息以及第一用户端的数字签名生成第五区块,所述第五区块包括所述支付信息对应的支付记录;After receiving the payment information sent by the first client, generating a fifth block according to the payment information and the digital signature of the first client, the fifth block includes a payment record corresponding to the payment information;
上述步骤302包括:Above-mentioned step 302 comprises:
在所述第一用户端满足第一智能合约的访问条件,且接收到所述第一用户端发送的支付信息的情况下,根据所述第一智能合约和所述第三智能合约,将第一存储信息和第一权限信息发送至所述第一用户端。When the first client meets the access conditions of the first smart contract and receives the payment information sent by the first client, according to the first smart contract and the third smart contract, the second The stored information and the first permission information are sent to the first user terminal.
在本申请实施例中,服务端可以在数据共享时实现支付和计费的功能,从而以便于数据提供方从数据需求方处获取收益。也即,上述数据需求方在向服务端发送数据共享信息时,即可以发送与上述待访问数据关联的账单信息,从而服务端可以在接收到上述数据访问请求后,可以将上述账单信息发送至第一用户端。In the embodiment of this application, the server can realize payment and billing functions during data sharing, so that the data provider can obtain benefits from the data demander. That is to say, when the above-mentioned data demander sends the data sharing information to the server, it can send the billing information associated with the above-mentioned data to be accessed, so that the server can send the above-mentioned billing information to first client.
具体地,在服务端确定第一用户端满足第一智能合约的访问条件的情况下,服务端可以根据第一数据共享信息确定待访问数据,并由第一用户端的身份信息和第一数据共享信息以及第一用户端的数字签名生成一个区块链交易,服务端可以将区块链交易发送至现有的区块链的基础设施平台,基于已有的开源区块链平台(例如Hyperledger Fabric、Ethereum Quorum)生成上述第四区块,上述第四区块中可以包括第三智能合约,上述第三智能合约与第一智能合约关联,用于指示在接收到所述第一用户端发送的支付信息的情况下,将第一存储信息和第一权限信息发送至所述第一用户端。Specifically, when the server determines that the first client meets the access conditions of the first smart contract, the server can determine the data to be accessed according to the first data sharing information, and share the data with the identity information of the first client and the first data. information and the digital signature of the first client to generate a block chain transaction, the server can send the block chain transaction to the existing block chain infrastructure platform, based on the existing open source block chain platform (such as Hyperledger Fabric, Ethereum Quorum) generates the above-mentioned fourth block, the above-mentioned fourth block may include a third smart contract, the above-mentioned third smart contract is associated with the first smart contract, and is used to indicate that the payment sent by the first client is received In the case of information, the first storage information and the first permission information are sent to the first user terminal.
与上述实施例类似地,上述第三智能合约与上述区块链交易,以及上述第一数据共享信息均为一一对应的关系,且第四区块中可以包含一个或多个第三智能合约,在服务端接收到多条第一数据共享信息的情况下,即可以生成多条区块链交易,并将多个第三智能合约整合生成上述第四区块,以提升 区块的利用率,避免区块容量浪费,在此不再赘述。Similar to the above-mentioned embodiment, the above-mentioned third smart contract has a one-to-one correspondence with the above-mentioned blockchain transaction and the above-mentioned first data sharing information, and the fourth block may contain one or more third smart contracts , when the server receives multiple pieces of first data sharing information, it can generate multiple blockchain transactions, and integrate multiple third smart contracts to generate the above fourth block to improve the utilization rate of the block , to avoid the waste of block capacity, so I won’t go into details here.
在服务端接收到第一用户端发送的支付信息后,即表明支付完成,此时服务端可以根据第一智能合约和第三智能合约,将上述第一存储信息和第一权限信息发送至所述第一用户端。同时,为了便于数据提供方或第一用户端查询支付记录,服务端可以同时根据支付信息以及第一用户端的数字签名生成第五区块,第五区块包括所述支付信息对应的支付记录,生成上述第五区块的方式与上述实施例中第一区块至第四区块的生成方式类似,为避免重复,在此不再赘述。After the server receives the payment information sent by the first client, it indicates that the payment is complete. At this time, the server can send the above-mentioned first storage information and first permission information to the Describe the first client. At the same time, in order to facilitate the data provider or the first client to query the payment record, the server can simultaneously generate a fifth block according to the payment information and the digital signature of the first client, the fifth block includes the payment record corresponding to the payment information, The method of generating the above-mentioned fifth block is similar to the method of generating the first block to the fourth block in the above-mentioned embodiment, and will not be repeated here to avoid repetition.
在本申请实施例中,服务端可以在数据共享时实现支付和计费的功能,提升了用户体验。In this embodiment of the application, the server can realize payment and billing functions during data sharing, which improves user experience.
上述步骤401与上述步骤201对应。在上述步骤402中,上述第二权限信息,可以基于第二用户端发送的第二数据共享信息生成,例如第二用户端可以在发送数据共享请求时,发送待共享数据对应的访问权限列表,其中即包括了可对待共享数据执行的所有访问操作,从而服务端可以根据访问权限列表生成第二权限信息。The above step 401 corresponds to the above step 201 . In the above step 402, the above-mentioned second permission information may be generated based on the second data sharing information sent by the second client, for example, when sending a data sharing request, the second client may send an access permission list corresponding to the data to be shared, It includes all access operations that can be performed on the data to be shared, so that the server can generate the second permission information according to the access permission list.
可选地,上述步骤402可以包括:Optionally, the above step 402 may include:
根据所述第二数据共享信息,生成访问权限列表,所述访问权限列表包括所述第二权限信息;generating an access authority list according to the second data sharing information, the access authority list including the second authority information;
在接收到与所述第二权限信息关联的权限请求时,从所述访问权限列表中获取所述第二权限信息。When a permission request associated with the second permission information is received, the second permission information is acquired from the access permission list.
可选地,服务端还可以向数据需求方展示上述访问权限列表,通过数据需求方发送的请求,来确定最终输出的第二权限信息,从而数据提供方可以更便捷地实现对数据访问权限的控制,提升数据的安全性和私密性,也可以从中获取收益。Optionally, the server can also display the above-mentioned access permission list to the data demander, and determine the final output second permission information through the request sent by the data demander, so that the data provider can realize the data access permission more conveniently. Control, improve data security and privacy, and benefit from it.
在一具体的实施例中,服务端可以向数据需求方展示当前文档的购买方式包括只读权限购买、可分享权限购买和可编辑权限购买,由数据需求方选择购买方式后,即可以确定最终向数据需求方发送的第二权限信息。当然,在其他可选的实施例中,上述第二权限信息也可以由服务端根据访问权限列表和预设策略自行生成。In a specific embodiment, the server can show the data demander that the purchase methods of the current document include the purchase of read-only rights, the purchase of shareable rights and the purchase of editable rights. After the data demander chooses the purchase method, the final document can be determined. The second permission information sent to the data requester. Of course, in other optional embodiments, the above second permission information may also be generated by the server itself according to the access permission list and preset policies.
在上述步骤403中,在服务端接收到上述数据共享请求之后,由于服务端可以与区块链网络连接,因此服务端可以根据上述第二数据共享信息和第二用户端的数字签名,形成一个区块链交易,该区块链交易用于实现上述第二数据共享信息对应的待共享数据的共享,在此之后,服务端可以将上述区块链交易发送至现有的区块链的基础设施平台,基于已有的开源区块链平台(例如Hyperledger Fabric、Ethereum Quorum)生成上述第二区块,上述第二区块中包括第二数据共享信息对应的第二智能合约,并将新生成的第二区块发布到接入区块链网络的各个服务器节点,以告知有新的数据共享请求。In the above step 403, after the server receives the above-mentioned data sharing request, since the server can connect to the blockchain network, the server can form a zone based on the above-mentioned second data sharing information and the digital signature of the second client. Block chain transaction, the block chain transaction is used to realize the sharing of the data to be shared corresponding to the above second data sharing information, after which, the server can send the above block chain transaction to the existing block chain infrastructure Platform, based on the existing open source blockchain platform (such as Hyperledger Fabric, Ethereum Quorum) to generate the above second block, the above second block includes the second smart contract corresponding to the second data sharing information, and the newly generated The second block is issued to each server node connected to the blockchain network to inform of a new data sharing request.
可以理解的是,上述第二用户端的数字签名与上述第二数据共享信息一一对应,也即每当第二用户端需要访问一个待访问数据,就需要发送一次携带有数字签名和第二数据共享信息的数据访问请求,而对于不同的数据访问请求而言,第二用户端的数字签名也不相同。It can be understood that the digital signature of the second client is in one-to-one correspondence with the second data sharing information, that is, whenever the second client needs to access a piece of data to be accessed, it needs to send a digital A data access request for sharing information, and for different data access requests, the digital signatures of the second client are also different.
上述第二智能合约基于第二数据共享信息生成,可以包括根据第二数据共享信息确定的访问条件,在数据需求方满足第二智能合约的访问条件的情况下,服务端可以输出上述待共享数据对应的第三存储信息和第二权限信息。上述第三存储信息与第一存储信息类似,上述第三存储信息可以基于上述第二数据共享信息生成,例如可以为地址信息、密钥信息等。The above-mentioned second smart contract is generated based on the second data sharing information, and may include access conditions determined according to the second data sharing information. When the data demander meets the access conditions of the second smart contract, the server can output the above-mentioned data to be shared Corresponding third storage information and second permission information. The above-mentioned third storage information is similar to the first storage information, and the above-mentioned third storage information may be generated based on the above-mentioned second data sharing information, for example, it may be address information, key information, and the like.
需要说明的是,上述区块链交易和上述第二智能合约均与上述数据共享请求一一对应,也即,服务端每接收到一条携带有第二数据共享信息和第二用户端的数字签名数据共享请求,即可以根据第二数据共享信息和第二用户端的数字签名生成一个区块链交易,并生成一个第二智能合约。为了避免区块链资源的浪费,上述第二区块中也可以包括多个第二智能合约,也即服务端可以在接收到N条数据访问请求之后,生成N个区块链交易,最终整合形成的第二区块中包括N个第二智能合约。可以理解的是,N为正整数,其值可以根据第二区块的最大容量确定,在N为多个的情况下,第二区块可以包括多个智能合约,从而避免了区块容量的浪费。It should be noted that the above-mentioned blockchain transaction and the above-mentioned second smart contract are in one-to-one correspondence with the above-mentioned data sharing request, that is, each time the server receives a digital signature data carrying the second data sharing information and the second client The sharing request means that a blockchain transaction can be generated according to the second data sharing information and the digital signature of the second client, and a second smart contract can be generated. In order to avoid the waste of blockchain resources, the above-mentioned second block can also include multiple second smart contracts, that is, the server can generate N blockchain transactions after receiving N data access requests, and finally integrate The formed second block includes N second smart contracts. It can be understood that N is a positive integer, and its value can be determined according to the maximum capacity of the second block. waste.
上述形成第二区块的方式可以根据开源区块链平台(例如Hyperledger Fabric、Ethereum Quorum)现有的区块生成方式进行设置,在此不作进一步的说明。The above method of forming the second block can be set according to the existing block generation method of the open source blockchain platform (such as Hyperledger Fabric, Ethereum Quorum), and no further description will be made here.
本申请实施例中,服务端可以在接收到第二用户端的数据共享请求后,可以根据所述第二数据共享信息和第二用户端的数字签名生成第二区块,由于第二区块包括第二智能合约,从而在满足所述第二智能合约的访问条件的情况下,服务端可以输出第三存储信息和所述第二权限信息,以指示数据需求方根据第三存储信息获取待共享数据,通过第二权限信息执行对待共享数据的访问操作,从而通过权限控制,提升了数据的安全性和私密性。In this embodiment of the application, after receiving the data sharing request from the second client, the server can generate the second block according to the second data sharing information and the digital signature of the second client, since the second block includes the Two smart contracts, so that when the access conditions of the second smart contract are satisfied, the server can output the third storage information and the second permission information to instruct the data demander to obtain the data to be shared according to the third storage information , the access operation of the data to be shared is performed through the second permission information, thereby improving the security and privacy of the data through permission control.
可选地,在上述步骤401之前,第二用户端可以先与服务端进行相互认证,认证凭证可以为数字证书或密钥,在认证成功后,服务端还可以根据第二用户端的身份信息查询第二用户端是否有权限发布数据共享,在有权限发布数据共享的情况下,再生成上述第二区块,从而可以避免非法或无权限的用户作为数据提供方,提升了数据共享的安全性。Optionally, before the above step 401, the second client can perform mutual authentication with the server first, and the authentication credential can be a digital certificate or key. After the authentication is successful, the server can also query the identity information of the second client. Whether the second client has the authority to publish data sharing, and if it has the authority to publish data sharing, the above-mentioned second block can be generated, so that illegal or unauthorized users can be avoided as data providers, and the security of data sharing can be improved. .
可选地,所述第二数据共享信息包括第二用户端的身份信息和数据简介信息,上述步骤403之后,上述方法还包括:Optionally, the second data sharing information includes identity information and data profile information of the second client, and after the above step 403, the above method further includes:
生成用于指示所述第二智能合约的第二地址信息;generating second address information indicative of the second smart contract;
将所述第二用户端的身份信息、所述数据简介信息和所述第二地址信息发送至已订阅的用户端。Sending the identity information of the second client, the data brief information and the second address information to the subscribed client.
在本申请实施例中,服务端在生成包括上述第二智能合约的第二区块后,可以生成指示上述第二智能合约的第二地址信息,上述第二地址信息可以为统一资源定位器(Uniform Resource Locator,URL)或统一资源标识符(Uniform Resource Identifier,URI)地址,数据需求方在接收到上述第二地址信息后,可以通过用户的输入,例如单击访问地址的链接,以执行上述第二智能合约,从而可以在数据需求方满足第二智能合约的第二访问条件的情况下,输出第三存储信息和第二权限信息。当然,第二用户端自身也可以为订阅用户端,从而可以如上述实施例中所述,基于根据第二地址信息生成待共享数据的元数据,以生成第三加密数据包。In this embodiment of the application, after the server generates the second block including the above-mentioned second smart contract, it can generate the second address information indicating the above-mentioned second smart contract, and the above-mentioned second address information can be a uniform resource locator ( Uniform Resource Locator, URL) or Uniform Resource Identifier (Uniform Resource Identifier, URI) address, after receiving the above-mentioned second address information, the data demander can use the user's input, such as clicking the link of the access address, to execute the above-mentioned The second smart contract, so that the third storage information and the second permission information can be output when the data demander satisfies the second access condition of the second smart contract. Of course, the second client itself may also be a subscribing client, so as described in the above embodiment, the metadata of the data to be shared can be generated based on the second address information to generate the third encrypted data package.
需要说明的是,上述第二数据共享信息中的第二用户端的身份信息和数据简介信息,可以与上述第二地址信息一并发送至已订阅的用户端,用户端可以显示第二用户端的身份信息和数据简介信息,以便于用户获知待共享数据的发布者和待共享数据的相关属性和类型等,从而可以确定是否需要访问 待共享数据。It should be noted that the identity information and data profile information of the second client in the above-mentioned second data sharing information can be sent together with the above-mentioned second address information to the subscribed client, and the client can display the identity of the second client Information and data profile information, so that users can know the publisher of the data to be shared and the related attributes and types of the data to be shared, so as to determine whether to access the data to be shared.
上述信息发送流程可以基于发布-订阅模式实现,由服务端作为发布者,而已订阅的用户端作为订阅者,在此不再赘述。The above information sending process can be implemented based on the publish-subscribe model, with the server serving as the publisher and the subscribed client serving as the subscriber, which will not be repeated here.
此外,参照图5,本申请实施例还提供了一种数据共享系统,包括服务端、第一用户端和第二用户端,其中,服务端用于执行如上任一所述应用于服务端的数据共享方法实施例的方法步骤,第一用户端用于执行如上任一所述应用于第一用户端的数据共享方法实施例的方法步骤,第二用户端用于执行如上任一所述应用于第二用户端的数据共享方法实施例的方法步骤。也即,如图5中的所示的数据交换/共享平台即可以为上述服务端,数据提供方即可以为上述第二用户端,数据需求方即可以为上述第一用户端。In addition, referring to FIG. 5 , the embodiment of the present application also provides a data sharing system, including a server, a first client, and a second client, wherein the server is used to execute the data sharing system applied to the server as described above. In the method steps of the sharing method embodiment, the first client is used to execute the method steps of any one of the above-mentioned data sharing method embodiments applied to the first client, and the second client is used to execute the above-mentioned one applied to the second method. 2. Method steps of the embodiment of the data sharing method at the user end. That is, the data exchange/sharing platform as shown in FIG. 5 can be the above-mentioned server, the data provider can be the above-mentioned second client, and the data demander can be the above-mentioned first client.
通过服务端、第一用户端和第二用户端组建了实现数据共享方法的整体架构,为基于区块链技术的数据共享提供了完整、系统、可实现的解决方案,利用上述数据共享系统实现数据共享,可以提升数据共享的安全性。The overall structure of the data sharing method is established through the server, the first client and the second client, providing a complete, systematic and achievable solution for data sharing based on blockchain technology, using the above data sharing system to achieve Data sharing can improve the security of data sharing.
基于上述系统,参照图5至图6,本申请实施例的具体实现流程可以为如下所述:Based on the above system, referring to Fig. 5 to Fig. 6, the specific implementation process of the embodiment of the present application may be as follows:
上述服务端可以包括用户管理模块、认证和授权模块、数据共享策略的制定和管理模块、数据共享访问记录模块、数据共享信息发布模块、数据共享信息预订模块、数据共享令牌管理模块、数据共享计费管理模块、数据共享支付管理模块和访问权限管理模块。The above server can include a user management module, an authentication and authorization module, a data sharing policy formulation and management module, a data sharing access record module, a data sharing information release module, a data sharing information reservation module, a data sharing token management module, a data sharing Billing management module, data sharing payment management module and access rights management module.
上述功能模块可以通过服务端中的不同服务器节点实现,服务端可以将以上功能模块的能力,通过应用编程接口(Application Programming Interface,API)供客户端应用软件调用。The above functional modules can be implemented by different server nodes in the server, and the server can use the capabilities of the above functional modules for the client application software to call through the application programming interface (Application Programming Interface, API).
其中,用户管理模块用于管理各种用户(如数据提供方、数据需求方、支付中心、密钥存储服务提供方、数据存储服务提供方)的身份信息,如用户身份标识ID、数字证书、角色等,以及管理各种用户账户的查询、增加、修改、删除流程。Among them, the user management module is used to manage the identity information of various users (such as data provider, data demander, payment center, key storage service provider, data storage service provider), such as user identity ID, digital certificate, Roles, etc., and manage the query, addition, modification, and deletion processes of various user accounts.
认证和授权模块用于:与用户端(如数据提供方、数据需求方)进行相互认证,认证的方式有口令、共享密钥、数字证书等;查看用户(如数据提供方、数据需求方)是否有权限发布或访问数据,并对其进行授权。The authentication and authorization module is used for: mutual authentication with the client (such as data provider, data demander), authentication methods include password, shared key, digital certificate, etc.; view users (such as data provider, data demander) Whether there is permission to publish or access data, and authorize it.
数据共享策略的制定和管理模块用于:接收来自第二用户端所定义的数据访问策略(包含数据共享信息)和相应的数字签名,并根据收到的数据访问策略和相应的数字签名,形成一个区块链交易;将该交易提交给底层的模块区块链基础设施模块和智能合约管理模块,形成数据共享的智能合约,并发布到各区块链网络的节点;通知第二用户端和数据共享信息发布模块,该数据共享的智能合约生成完毕;对第二用户端提供数据共享策略记录的管理,如查询、修改。The formulation and management module of the data sharing strategy is used to: receive the data access strategy (including data sharing information) and the corresponding digital signature defined by the second client, and form A blockchain transaction; submit the transaction to the underlying module blockchain infrastructure module and smart contract management module to form a smart contract for data sharing, and publish it to the nodes of each blockchain network; notify the second client and data In the shared information publishing module, the smart contract for data sharing is generated; it provides management of data sharing policy records for the second client, such as query and modification.
数据共享访问记录模块用于:接收来自第一用户端的数据访问请求(包含数据需求方信息、需要访问数据的信息等),根据所需访问数据的数据共享策略,检查该使用者是否符合访问共享数据的条件(如该数据可供哪些行业使用、该数据可供哪些用户使用等);根据收到的数据使用者的身份信息、需要访问的数据信息及数字签名,形成一个区块链系统的交易;将该交易提交给底层的区块链基础设施模块,形成访问共享数据的记录,并发布到各区块链网络的节点;可选地,如果系统支持数据共享/交易的计费和支付,则将该交易提交给底层的模块区块链基础设施模块和智能合约管理模块,进一步形成相应的计费智能合约,并发布到各区块链网络的节点;通知数据共享令牌管理模块,需要生成访问令牌。The data sharing access recording module is used to: receive a data access request from the first client (including data demander information, information requiring access to data, etc.), and check whether the user is eligible for access sharing according to the data sharing policy of the required access data. The conditions of the data (such as which industries the data can be used for, which users the data can use, etc.); according to the identity information of the received data user, the data information that needs to be accessed and the digital signature, a block chain system is formed. transaction; submit the transaction to the underlying blockchain infrastructure module, form a record of access to shared data, and publish it to the nodes of each blockchain network; optionally, if the system supports data sharing/transaction billing and payment, Then submit the transaction to the underlying module blockchain infrastructure module and smart contract management module, further form the corresponding billing smart contract, and publish it to the nodes of each blockchain network; notify the data sharing token management module that it needs to generate access token.
可选地,如果系统支持数据共享/交易的计费和支付,还需要通知数据共享计费管理模块,有新的计费账单智能合约已生成;接收来自数据共享令牌管理模块的通知,该通知包含访问令牌;将访问令牌、密钥存储服务器和数据存储服务器的相关信息(如地址、数字证书等)和权限信息发送给第一用户端;对数据使用者提供数据共享访问记录的管理,如查询。Optionally, if the system supports billing and payment for data sharing/transactions, it is also necessary to notify the data sharing billing management module that a new billing smart contract has been generated; to receive the notification from the data sharing token management module, the The notification contains the access token; the relevant information (such as address, digital certificate, etc.) and authority information of the access token, the key storage server and the data storage server are sent to the first client; Management, such as queries.
数据共享信息发布模块用于:接收来自数据共享策略的制定和管理模块的通知,该通知包含新的数据共享信息;发布新的数据共享信息;通知数据共享信息预订模块,有新的数据共享信息。The data sharing information release module is used to: receive a notification from the formulation and management module of the data sharing policy, the notification contains new data sharing information; publish new data sharing information; notify the data sharing information subscription module that there is new data sharing information .
数据共享信息预订模块用于:接收来自数据共享信息发布模块的通知,该通知包含新的数据共享信息;将新的数据共享信息发送给预订用户端。The data sharing information subscribing module is used to: receive a notification from the data sharing information publishing module, the notification includes new data sharing information; send the new data sharing information to the subscribing client.
数据共享令牌管理模块用于:接收来自数据共享访问记录模块需要生成访问令牌的通知;为数据访问生成访问令牌;将生成的访问令牌发送给数据 共享访问记录模块。The data sharing token management module is used to: receive a notification from the data sharing access record module that an access token needs to be generated; generate an access token for data access; send the generated access token to the data sharing access record module.
数据共享计费管理模块用于:接收来自数据共享策略的制定和管理模块的通知,通知新的计费智能合约的生成,该通知包含新的计费信息;生成新的计费账单,并对新的计费账单进行签名;将计费账单和签名形成一个区块链交易;将该交易提交给底层的区块链基础设施模块,形成支付智能合约,并发布到各区块链网络的节点;通知数据共享支付管理模块,新的支付智能合约已生成。The data sharing billing management module is used to: receive the notification from the formulation and management module of the data sharing policy, notify the generation of a new billing smart contract, the notification contains new billing information; generate a new billing bill, and Sign the new billing bill; form the billing bill and signature into a blockchain transaction; submit the transaction to the underlying blockchain infrastructure module to form a payment smart contract, and publish it to the nodes of each blockchain network; Notify the data sharing payment management module that a new payment smart contract has been generated.
其中,底层的区块链基础设施模块基于现有的区块链平台如Hyperledger Fabric或Ethereum Quorum生成在此不再赘述。Among them, the underlying blockchain infrastructure modules are generated based on existing blockchain platforms such as Hyperledger Fabric or Ethereum Quorum and will not be described here.
数据共享支付管理模块用于:接收来自数据共享计费管理模块的通知,通知新的支付智能合约的生成,该通知包含新的支付信息;生成新的支付账单,进行支付,并对新的支付账单进行签名;将支付账单和签名形成一个区块链交易;将该交易提交给底层的区块链基础设施模块,形成支付交易记录,并发布到各区块链网络的节点;通知各交易参与方,新的支付完成。The data sharing payment management module is used to: receive a notification from the data sharing billing management module, notify the generation of a new payment smart contract, the notification contains new payment information; generate a new payment bill, make a payment, and make a payment for the new payment Sign the bill; form a blockchain transaction with the payment bill and signature; submit the transaction to the underlying blockchain infrastructure module to form a payment transaction record, and publish it to the nodes of each blockchain network; notify all transaction participants , the new payment is completed.
访问权限管理模块用于:接收来自数据共享策略的制定和管理模块的通知,存储与本次共享数据相关的访问权限和策略;接收来自数据共享访问/使用记录模块的通知,为此次数据访问生成访问权限,使用数据使用者的公钥对该访问权限进行加密,形成权限数据包;将生成的权限数据包发送给数据共享访问/使用记录模块。The access rights management module is used to: receive notifications from the formulation and management module of data sharing policies, store the access rights and policies related to this shared data; receive notifications from the data sharing access/usage record module, and provide Generate access rights, encrypt the access rights with the public key of the data user to form a rights data package; send the generated rights data package to the data sharing access/use recording module.
其中,第一用户端可以为数据需求方,第一用户端中的应用程序和/或客户端软件可以具备如下功能:预订/签约发布的数据共享消息;通过信息发布栏上查找、或预订发布信息、或别人推荐的方式,获得数据共享信息(如数据发布者身份标识、该数据可供哪些行业使用、该数据可供哪些用户使用、以及数据的类别、数据内容简介、性质、用途、价格等其他属性),根据发布的数据共享信息,确定需要访问的数据;Wherein, the first user end may be a data demander, and the application program and/or client software in the first user end may have the following functions: subscribe/sign up to release data sharing messages; search through the information release column, or book release Information, or methods recommended by others, to obtain data sharing information (such as the identity of the data publisher, which industries the data can be used for, which users the data can use, and the category of data, data content introduction, nature, use, price and other attributes), determine the data that needs to be accessed according to the published data sharing information;
在访问共享的数据之前,需要和服务端的认证和授权模块进行相互认证;将其身份信息,如数据使用者身份标识、数据使用者公钥和需要访问的数据信息,如数据发布者身份标识、数据发布者公钥、密文标识ID、密钥标识ID等以及对其身份信息和需要访问数据信息的数字签名,发送给服务端的数据 共享访问记录模块;接收来自数据共享访问记录模块的通知,该通知包括密钥存储地址、数据存储地址、访问令牌和权限信息等;Before accessing the shared data, mutual authentication with the authentication and authorization module of the server is required; its identity information, such as the identity of the data user, the public key of the data user, and the data information that needs to be accessed, such as the identity of the data publisher, The data publisher's public key, ciphertext ID, key ID, etc., as well as the digital signature of its identity information and data information to be accessed, are sent to the data sharing access record module of the server; receiving the notification from the data sharing access record module, The notification includes key storage address, data storage address, access token and permission information, etc.;
根据密钥存储的地址,将访问令牌发送给密钥存储服务器的令牌验证模块,以获取解密密钥;根据密文存储的地址,请求获取密文标识ID对应的数据;根据获得的数据解密密钥对加密数据包进行解密,获得所需要访问的数据,根据权限信息执行对需要访问的数据的访问操作;在访问操作后删除需要访问的数据或者重新对需要访问的数据进行封包;管理自己所访问过的共享数据记录,如查询。According to the address of the key storage, send the access token to the token verification module of the key storage server to obtain the decryption key; according to the address of the ciphertext storage, request to obtain the data corresponding to the ciphertext identification ID; according to the obtained data The decryption key decrypts the encrypted data packet, obtains the data to be accessed, and executes the access operation to the data to be accessed according to the authority information; deletes the data to be accessed after the access operation or repackages the data to be accessed; management Shared data records that you have accessed, such as queries.
第二用户端可以为数据提供方,第二用户端中的应用程序和/或客户端软件可以具备如下功能:收集原始数据,在不影响数据共享质量的情况下进行脱敏处理(如匿名、删除如银行卡号、支付宝账号等隐私信息);生成数据加密密钥;使用数据加密密钥对共享的数据进行封包处理,得到加密数据包;将共享数据对应的加密数据包及加密密钥安全地存储在本地或远端服务器;与服务端的认证和授权模块进行相互认证;根据服务端的数据共享策略的制定和管理模块要求填写即将发布的数据共享信息,如数据发布者身份标识。The second client can be a data provider, and the application program and/or client software in the second client can have the following functions: collect raw data, and perform desensitization without affecting the quality of data sharing (such as anonymity, Delete private information such as bank card numbers, Alipay account numbers); generate data encryption keys; use data encryption keys to package shared data to obtain encrypted data packets; securely store encrypted data packets and encryption keys corresponding to shared data Stored in a local or remote server; mutual authentication with the authentication and authorization module of the server; fill in the data sharing information to be released, such as the identity of the data publisher, according to the formulation of the data sharing policy and the management module of the server.
此外可选地,上述系统还可以包括密钥存储服务器,密钥存储服务器包括:In addition, optionally, the above system may also include a key storage server, and the key storage server includes:
令牌验证模块:接收来自第一用户端的访问令牌,对第一用户端进行身份认证;验证访问令牌的有效性;可选地,验证令牌时,密钥存储服务器的令牌验证模块可能需要和数据共享令牌管理模块进行通信;将验证结果发送给数据密钥存储管理模块。Token verification module: receive the access token from the first client, authenticate the first client; verify the validity of the access token; optionally, when verifying the token, the token verification module of the key storage server May need to communicate with the data sharing token management module; send the verification result to the data key storage management module.
数据密钥存储管理模块:接收来自第二用户端的请求,需要存储数据加密密钥;对第二用户端进行身份认证;安全存储加密密钥;通知第二用户端加密密钥存储完毕;接收来自令牌验证模块的通知,该通知指示令牌的验证结果;将解密密钥以安全加密的方式返回给第一用户。Data key storage management module: receive the request from the second client, need to store the data encryption key; authenticate the identity of the second client; securely store the encryption key; notify the second client that the encryption key is stored; A notification from the token verification module, the notification indicating the verification result of the token; returning the decryption key to the first user in a secure encrypted manner.
以上功能模块,同样可以以API的方式供客户端应用软件调用。The above function modules can also be invoked by client application software in the form of API.
上述系统还可以包括数据存储服务器,数据存储服务器包括:The above-mentioned system can also include a data storage server, and the data storage server includes:
数据分发模块,用于:接收来自第一用户端的请求;对第一用户端进行身份认证;将加密数据包发送给第一用户端。The data distribution module is configured to: receive a request from the first client; authenticate the first client; and send the encrypted data packet to the first client.
数据存储管理模块,用于:接收来自第二用户端的请求,需要存储共享数据的加密数据包;对第二用户端进行身份认证;安全存储共享数据的加密数据包;通知第二用户端,共享数据的加密数据包存储完毕。The data storage management module is used to: receive a request from the second client to store the encrypted data packet of the shared data; perform identity authentication on the second client; securely store the encrypted data packet of the shared data; notify the second client that the shared data An encrypted packet of data is stored.
以上功能模块,同样可以以API的方式供客户端应用软件调用。The above function modules can also be invoked by client application software in the form of API.
如图6所示,图6中为本申请实施例为实现对待访问数据和待共享数据的访问权限控制而提供的场景架构图。如图所示,数据提供方可以将待共享的数据以及相关的数据信息通过密钥封装,得到加密数据包。数据需求方在通过数据共享/交换平台,可以获取到加密数据包、权限数据包和密钥数据包,通过密钥数据包对加密数据包解密后,可以根据权限数据包中的访问权限,执行对数据的访问操作。As shown in FIG. 6 , FIG. 6 is a scene architecture diagram provided by the embodiment of the present application for realizing access control of data to be accessed and data to be shared. As shown in the figure, the data provider can encapsulate the data to be shared and related data information with a key to obtain an encrypted data package. The data demander can obtain the encrypted data package, permission data package and key data package through the data sharing/exchange platform. After decrypting the encrypted data package through the key data package, it can execute according to the access rights in the permission data package. Access operations on data.
参照图7,图7示出了第二用户端与服务端的一种交互流程,即数据发布流程,包括如下步骤:Referring to FIG. 7, FIG. 7 shows an interaction process between the second client and the server, that is, the data publishing process, including the following steps:
步骤501、第二用户端收集原始数据,在不影响数据共享质量的情况下进行脱敏处理(如匿名、删除如银行卡号、账号等敏感信息)。Step 501, the second client collects raw data, and performs desensitization processing (such as anonymizing, deleting sensitive information such as bank card numbers and account numbers) without affecting the quality of data sharing.
步骤502、第二用户端为即将共享的数据及加密密钥在本地或远端服务器进行注册,具体包括:Step 502, the second client registers with the local or remote server for the data to be shared and the encryption key, specifically including:
步骤5021、在密钥存储服务器为即将存储的加密密钥进行注册,获得加密密钥标识及其存储地址。Step 5021, register the encryption key to be stored in the key storage server, and obtain the encryption key identifier and its storage address.
步骤5022、在数据存储服务器为即将存储的加密数据进行注册,获得加密数据的标识及其存储地址。Step 5022, register the encrypted data to be stored in the data storage server, and obtain the identifier and storage address of the encrypted data.
步骤503、第二用户端生成数据加密密钥且密钥标识ID,使用该数据加密密钥对即将共享的数据进行加密,形成数据密文,然后为即将共享的数据生成数据共享信息:如数据发布者身份标识、数据发布者公钥、加密数据包标识ID、加密数据包存储的地址、密钥标识ID、密钥存储的地址、该数据可供哪些行业使用、该数据可执行哪些访问操作、该数据可供哪些用户使用、以及数据的其他属性(如类别、数据内容简介、性质、用途、价格等)。Step 503, the second client generates a data encryption key and the key ID, uses the data encryption key to encrypt the data to be shared to form a data ciphertext, and then generates data sharing information for the data to be shared: such as data Publisher identity, data publisher public key, encrypted data packet ID, encrypted data packet storage address, key ID, key storage address, which industries the data can be used for, and which access operations the data can perform , which users the data is available for, and other attributes of the data (such as category, data content introduction, nature, purpose, price, etc.).
步骤504、第二用户端在发布数据共享策略之前,需要和服务端的认证和授权模块进行相互认证,认证的方式可以采用验证数字证书的方式,认证成功后,认证和授权模块还需要查看该第二用户端是否有权限发布数据共享;Step 504, before issuing the data sharing policy, the second client needs to perform mutual authentication with the authentication and authorization module of the server. 2. Whether the client has permission to publish data sharing;
认证成功并获得授权后,第二用户端根据服务端的数据共享策略的制定和管理模块要求填写即将发布的数据共享信息:如数据发布者身份标识、数据发布者公钥、密文标识ID、密文存储的地址、密钥标识ID、密钥存储的地址、该数据可供哪些行业使用、该数据可供哪些用户使用、以及数据的其他属性(如类别、数据内容简介、性质、用途、价格等);第二用户端将数据共享信息和其他信息一起形成数据共享策略,对该数据策略进行哈希(Hash)处理后并用自己的私钥对其进行数字签名。After successful authentication and authorization, the second client fills in the data sharing information to be released according to the data sharing policy formulation and management module requirements of the server: such as data publisher identity, data publisher public key, cipher text ID, password The address of the file storage, the key identification ID, the address of the key storage, which industries the data can be used for, which users the data can use, and other attributes of the data (such as category, data content introduction, nature, use, price, etc.) etc.); the second client forms the data sharing policy together with the data sharing information and other information, performs hash (Hash) processing on the data policy, and digitally signs it with its own private key.
步骤505、第二用户端将数据共享策略和相应的数字签名发送给服务端的数据共享策略的制定和管理模块,信息的传输需要进行加密和完整性保护;Step 505, the second client sends the data sharing strategy and the corresponding digital signature to the data sharing strategy formulation and management module of the server, and the transmission of information needs to be encrypted and integrity protected;
步骤506、数据共享策略的制定和管理模块收到来自第二用户端的数据共享策略和相应的数字签名后,先验证数字签名,然后根据该数据共享策略和数字签名准备形成一个区块中的交易。Step 506: After receiving the data sharing policy and corresponding digital signature from the second client, the data sharing policy formulation and management module first verifies the digital signature, and then prepares to form a transaction in a block according to the data sharing policy and digital signature .
步骤507、数据共享策略的制定和管理模块和第二用户端确认:第二用户端已经将将数据加密密钥存储在密钥存储服务器,并将加密后的数据存储在数据存储服务器,如果没有需要进行如下操作:Step 507, the data sharing policy formulation and management module and the second client confirm: the second client has stored the data encryption key in the key storage server, and stored the encrypted data in the data storage server, if there is no Need to do the following:
步骤5071、第二用户端将数据加密密钥存储在密钥存储服务器;Step 5071, the second client stores the data encryption key in the key storage server;
步骤5072、第二用户端将按照如下步骤形成加密数据包后,并将加密数据包存储在数据存储服务器;Step 5072, the second client will form an encrypted data packet according to the following steps, and store the encrypted data packet in the data storage server;
步骤50721、生成数据信息(包含但不限于):加密数据包标识、数据提供者标识、数据提供者的公钥、执行数据共享智能合约的地址等;Step 50721, generate data information (including but not limited to): encrypted data package identifier, data provider identifier, data provider's public key, address for executing data sharing smart contract, etc.;
步骤50722、对生成的数据信息进行Hash计算并对Hash计算得到的结果使用其私钥进行签名;Step 50722, perform Hash calculation on the generated data information and sign the result obtained by the Hash calculation using its private key;
步骤50723、将数据信息和对数据信息的签名一起形成元数据;Step 50723, form metadata together with the data information and the signature on the data information;
步骤50724、封装元数据和加密的共享数据,形成加密数据包;Step 50724, encapsulating metadata and encrypted shared data to form an encrypted data package;
步骤50725、将加密数据包存储在数据存储服务器。Step 50725, store the encrypted data package in the data storage server.
需要说明的是,上述步骤5071和5072没有先后之分,仅需要在生成新的区块链交易之前完成。It should be noted that the above steps 5071 and 5072 are not sequenced, and only need to be completed before generating a new blockchain transaction.
步骤508、数据共享策略的制定和管理模块对接收到的一条或多条交易进行哈希(Hash)处理后再使用数据共享策略的制定和管理模块的私钥对哈希 (Hash)值进行数字签名,然后将这一条或多条交易以及数字签名提交给底层的模块区块链基础设施模块和智能合约管理模块,形成一个新的区块,该新的区块包含一个或多个数据共享的智能合约,并将该新生成的区块发布到各区块链网络的节点,至于该交易如何加载到链上,视底层具体实现技术(如Hyperledger Fabric平台、Ethereum Quorum平台)而定,在此不在赘述。Step 508, the data sharing strategy formulation and management module performs hash (Hash) processing on the received one or more transactions, and then uses the private key of the data sharing strategy formulation and management module to digitally hash (Hash) the value Sign, and then submit the one or more transactions and digital signatures to the underlying module blockchain infrastructure module and smart contract management module to form a new block, which contains one or more shared data Smart contract, and publish the newly generated block to the nodes of each blockchain network. As for how the transaction is loaded on the chain, it depends on the underlying specific implementation technology (such as Hyperledger Fabric platform, Ethereum Quorum platform), which is not discussed here. repeat.
步骤509、数据共享策略的制定和管理模块通知相关方,数据共享的智能合约已经生成完毕:Step 509, the formulation and management module of the data sharing strategy notifies the relevant parties that the smart contract for data sharing has been generated:
步骤5091、通知第二用户端,该数据共享的智能合约生成完毕,并发送执行智能合约的地址。Step 5091, notify the second client that the smart contract for data sharing has been generated, and send the address for executing the smart contract.
步骤5092、通知数据共享信息发布模块,该数据共享的智能合约生成完毕,并告知相应的新的数据共享信息,信息的传输需要进行加密和完整性保护。Step 5092, notify the data sharing information release module that the data sharing smart contract has been generated, and notify the corresponding new data sharing information, and the transmission of the information needs to be encrypted and integrity protected.
步骤5093、通知访问权限管理模块,该数据共享的智能合约生成完毕(包含执行智能合约的地址),通知记录相关的访问权限。Step 5093, notify the access rights management module that the smart contract for data sharing is generated (including the address for executing the smart contract), and notify to record the related access rights.
上述步骤5091~5093之间无先后顺序之分。There is no sequence between the above steps 5091-5093.
步骤5094、访问权限管理模块接收来自数据共享策略的制定和管理模块的通知,存储与本次共享数据相关的访问权限和策略。Step 5094, the access rights management module receives the notification from the formulation and management module of the data sharing policy, and stores the access rights and policies related to the shared data this time.
步骤510、数据共享信息发布模块接收来自数据共享策略的制定和管理模块的通知,发布新的数据共享信息,包括:Step 510, the data sharing information release module receives the notification from the data sharing strategy formulation and management module, and releases new data sharing information, including:
步骤5101、数据共享信息发布模块通知数据共享信息预订模块该数据共享的智能合约生成完毕,该通知包含有执行智能合约的地址和新的数据共享信息。Step 5101, the data sharing information publishing module notifies the data sharing information subscription module that the smart contract for data sharing has been generated, and the notification includes the address for executing the smart contract and new data sharing information.
步骤5102、数据共享信息预订模块接收来自数据共享信息发布模块的通知,将执行智能合约的地址和新的数据共享信息发送给预订用户。Step 5102, the data sharing information subscription module receives the notification from the data sharing information publishing module, and sends the address for executing the smart contract and new data sharing information to the subscribing user.
参照图8,图8示出了第一用户端与服务端的一种交互流程,即数据访问流程,包括如下步骤:Referring to FIG. 8, FIG. 8 shows an interaction process between the first client and the server, that is, the data access process, including the following steps:
步骤601、第一用户端通过信息发布栏上查找、或预订发布信息、或别人推荐的方式、或通过转发得到加密数据包的元数据获得执行数据共享智能合约的地址,根据发布的数据共享信息(如数据发布者身份标识、该数据可 供哪些行业使用、该数据可供哪些用户使用、以及数据的类别、数据内容简介、性质、用途、价格等其他属性),确定需要访问的数据;Step 601, the first client obtains the address for executing the data sharing smart contract by searching on the information release column, or ordering to release information, or recommended by others, or by forwarding the metadata of the encrypted data package, and according to the published data sharing information (such as the identity of the data publisher, which industries the data can be used for, which users the data can use, and the type of data, data content introduction, nature, purpose, price and other attributes), determine the data that needs to be accessed;
步骤602、第一用户端在执行数据共享智能合约访问共享的数据之前,需要和数据共享/交换平台的认证和授权模块进行相互认证,认证的方式建议采用数字证书,认证成功后,认证和授权模块还需查看该数据使用者是否有权限访问该平台上共享的数据;Step 602, before the first client executes the data sharing smart contract to access the shared data, it needs to perform mutual authentication with the authentication and authorization module of the data sharing/exchange platform. The authentication method is recommended to use digital certificates. After the authentication is successful, authentication and authorization The module also needs to check whether the data user has permission to access the data shared on the platform;
步骤603、认证成功并获得授权后,第一用户端将其身份信息(如数据使用者身份标识、数据使用者公钥和需要访问的数据信息(如数据发布者身份标识、数据发布者公钥、密文标识ID、密钥标识ID等)以及第一用户端对其身份信息和需要访问的数据信息的数字签名,发送给数据共享/交换平台的数据共享访问记录模块。Step 603, after the authentication is successful and authorization is obtained, the first client sends its identity information (such as the identity of the data user, the public key of the data user, and the data information to be accessed (such as the identity of the data issuer, the public key of the data issuer) , ciphertext identification ID, key identification ID, etc.) and the digital signature of the first client's identity information and data information to be accessed are sent to the data sharing access recording module of the data sharing/exchange platform.
步骤604、数据共享访问记录模块接收来自第一用户端的身份信息和需要访问的数据信息及数字签名,验证其数字签名,然后根据第一用户端提供的数据访问请求执行数据共享智能合约,检查该使用者是否符合访问共享数据的条件(如该数据可供哪些行业使用、该数据可供哪些用户使用等);如果满足数据共享的所有策略,则数据共享访问记录模块根据将收到的数据使用者的身份信息、需要访问的数据信息及数字签名,形成一个区块中的交易;数据共享访问记录模块对接收到的一条或多条交易进行哈希(Hash)处理后再使用数据共享访问记录模块的私钥对哈希(Hash)值进行数字签名,然后将这一条或多条交易以及数字签名提交给底层的区块链基础设施模块,形成一个新的区块,该新的区块中包含一个或多个访问共享数据的记录,并发布到各区块链网络的节点,至于该交易如何加载到链上,视底层具体实现技术(如Hyperledger Fabric平台、Ethereum Quorum平台)而定,在此不在赘述。Step 604, the data sharing access record module receives the identity information from the first client, the data information to be accessed and the digital signature, verifies the digital signature, and then executes the data sharing smart contract according to the data access request provided by the first client to check the Whether the user meets the conditions for accessing the shared data (such as which industries the data can be used for, which users can use the data, etc.); if all policies for data sharing are met, the data sharing access record module will use the data according to the received data The identity information of the user, the data information to be accessed and the digital signature form a transaction in a block; the data sharing access record module performs hash (Hash) processing on one or more received transactions before using the data sharing access record The private key of the module digitally signs the hash (Hash) value, and then submits the one or more transactions and the digital signature to the underlying blockchain infrastructure module to form a new block. Contains one or more records of access to shared data, and publishes to the nodes of each blockchain network. As for how the transaction is loaded onto the chain, it depends on the underlying specific implementation technology (such as Hyperledger Fabric platform, Ethereum Quorum platform), here I won't go into details.
步骤6051、在共享数据的访问记录成功上链后,数据共享访问记录模块通知数据共享令牌管理模块,需要生成访问令牌。Step 6051. After the access record of the shared data is successfully uploaded to the chain, the data sharing access record module notifies the data sharing token management module that an access token needs to be generated.
步骤6052、通知访问权限管理,需要生成访问权限数据包。Step 6052, notify the access rights management that an access rights data packet needs to be generated.
步骤6061、数据共享令牌管理模块接收来自数据共享访问记录模块的通知,为此次数据访问生成访问令牌。Step 6061, the data sharing token management module receives the notification from the data sharing access record module, and generates an access token for this data access.
步骤6062、访问权限管理模块接收来自数据共享访问/使用记录模块的通 知,为此次数据访问生成访问权限,使用数据使用者的公钥对该访问权限进行加密,形成权限数据包。Step 6062, the access rights management module receives the notification from the data sharing access/use recording module, generates access rights for this data access, encrypts the access rights with the public key of the data user, and forms a rights data packet.
步骤6071、数据共享令牌管理模块将生成的访问令牌发送给数据共享访问记录模块.Step 6071, the data sharing token management module sends the generated access token to the data sharing access record module.
步骤6072、访问权限管理模块将生成的权限数据包发送给数据共享访问/使用记录模块。Step 6072, the access rights management module sends the generated rights data packet to the data sharing access/use recording module.
步骤608、数据共享访问记录模块接收来自数据共享令牌管理模块的访问令牌和来自访问权限管理的权限数据包,然后将访问令牌、权限数据包、密钥存储服务器和数据存储服务器的相关信息(如地址、数字证书等)发送给第一用户端;访问令牌及密钥存储服务器和数据存储服务器的相关信息在传输过程中需要考虑机密性保护和完整性保护。Step 608, the data sharing access record module receives the access token from the data sharing token management module and the permission data packet from the access right management, and then correlates the access token, the permission data packet, the key storage server and the data storage server The information (such as address, digital certificate, etc.) is sent to the first client; the access token and related information of the key storage server and the data storage server need to consider confidentiality protection and integrity protection during the transmission process.
步骤609、第一用户端接收来自数据共享访问记录模块的通知,该通知包含权限数据包、访问令牌、密钥存储服务器和数据存储服务器的相关信息(如地址、数字证书等);然后,第一用户端根据密钥存储的地址,将访问令牌发送给密钥存储服务器的令牌验证模块,以获取解密密钥;访问令牌在传输过程中需要考虑机密性保护和完整性保护。Step 609, the first client receives a notification from the data sharing access record module, the notification includes the permission data packet, the access token, the key storage server and the relevant information of the data storage server (such as address, digital certificate, etc.); then, According to the address of the key storage, the first client sends the access token to the token verification module of the key storage server to obtain the decryption key; confidentiality protection and integrity protection need to be considered during the transmission of the access token.
步骤6091、密钥存储服务器的令牌验证模块接收来自第一用户端的访问令牌,验证访问令牌的有效性;可选地,验证令牌时,密钥存储服务器的令牌验证模块可能需要和数据共享令牌管理模块进行通信,通信过程中的数据需要考虑机密性和完整性保护。Step 6091, the token verification module of the key storage server receives the access token from the first client, and verifies the validity of the access token; optionally, when verifying the token, the token verification module of the key storage server may need To communicate with the data sharing token management module, the data in the communication process needs to consider confidentiality and integrity protection.
步骤6092、令牌验证模块将验证结果发送给数据密钥存储管理模块。Step 6092, the token verification module sends the verification result to the data key storage management module.
步骤610、数据密钥存储管理模块接收来自令牌验证模块的访问令牌的验证结果通知,然后将解密密钥使用数据使用者的公钥对其进行加密,形成密钥数据包,以安全加密的方式返回给第一用户端。Step 610, the data key storage management module receives the verification result notification of the access token from the token verification module, and then encrypts the decryption key with the public key of the data user to form a key data packet for secure encryption way to return to the first client.
步骤611、第一用户端接收来自数据密钥存储管理模块的解密密钥,第一用户端根据加密数据包存储的地址,请求获取加密数据包标识ID对应的数据。Step 611, the first client receives the decryption key from the data key storage management module, and the first client requests to obtain the data corresponding to the ID of the encrypted data packet according to the address stored in the encrypted data packet.
步骤612、数据分发模块接收来自第一用户端的加密数据包请求,验证来自第一用户端的请求,如进行身份认证。Step 612, the data distribution module receives the encrypted data packet request from the first client, and verifies the request from the first client, such as performing identity authentication.
步骤613、数据分发模块将标识ID对应的加密数据包发送给第一用户端;Step 613, the data distribution module sends the encrypted data packet corresponding to the ID to the first client;
步骤614、第一用户端解密权限数据包和密钥数据包,获得解密密钥和访问权限,然后根据解密密钥对加密数据包解密,获得明文的数据呈现给相应的应用程序;应用程序关闭后,解密后的数据仍然以加密数据包的方式存在本地。Step 614, the first client decrypts the authority data package and the key data package, obtains the decryption key and access authority, and then decrypts the encrypted data package according to the decryption key, and presents the plaintext data to the corresponding application program; the application program is closed After that, the decrypted data still exists locally in the form of encrypted data packets.
在数据共享中,数据提供方可能会从数据使用者那获得一定的经济收益,具体流程如图8所示。In data sharing, the data provider may obtain certain economic benefits from the data user. The specific process is shown in Figure 8.
图8中,上述步骤604还包括:In FIG. 8, the above step 604 also includes:
步骤6041、数据共享访问记录模块根据数据共享策略(如价格、支付方式等),检查该使用者是否符合访问共享数据的条件(如该数据可供哪些行业使用、该数据可供哪些用户使用等);如果满足数据共享的所有策略,则数据共享访问记录模块根据将收到的数据使用者的身份信息、需要访问的数据信息及数字签名,形成一个区块链交易,提交给底层的区块链基础设施模块和智能合约管理模块,形成访问共享数据的记录,以及相应的计费智能合约,并发布到各区块链网络的节点。Step 6041, the data sharing access record module checks whether the user meets the conditions for accessing shared data (such as which industries the data can be used for, which users the data can use, etc.) according to the data sharing strategy (such as price, payment method, etc.) ); if all policies of data sharing are satisfied, the data sharing access record module forms a blockchain transaction according to the received data user’s identity information, data information to be accessed and digital signature, and submits it to the underlying block The blockchain infrastructure module and the smart contract management module form a record of access to shared data, as well as the corresponding billing smart contract, and publish it to the nodes of each blockchain network.
步骤6042、数据共享访问记录模块通知数据共享计费管理模块,有新的计费智能合约(包含有计费信息)生成;数据共享计费管理模块根据计费智能合约,立即或周期性的生成支付账单,并对支付账单进行数字签名,形成区块中的一个交易;数据共享计费管理模块将一个或多个支付账单交易进行数字签名,然后这一个或多个交易及数字签名通过底层的区块链基础设施模块和智能合约管理模块,形成一个新的区块,该新的区块包含一个或多个支付智能合约,将新形成的区块发布到各区块链网络的节点;Step 6042, the data sharing access record module notifies the data sharing billing management module that a new billing smart contract (including billing information) is generated; the data sharing billing management module generates it immediately or periodically according to the billing smart contract Pay bills, and digitally sign the payment bills to form a transaction in the block; the data sharing billing management module digitally signs one or more payment bill transactions, and then the one or more transactions and digital signatures pass through the underlying The blockchain infrastructure module and the smart contract management module form a new block, which contains one or more payment smart contracts, and publish the newly formed block to the nodes of each blockchain network;
步骤6043、数据共享计费管理模块通知数据共享支付管理模块,有新的支付智能合约(包含支付信息)生成;数据共享支付管理模块根据支付智能合约,立即或周期性的针对支付账单,进行支付;支付完毕后,数据共享支付管理模块对支付信息进行签名,形成一个区块中的一个支付交易;数据共享支付管理模块将一个或多个支付交易进行数字签名,然后通过底层的区块链基础设施模块,形成一个新的区块,该新的区块包含一个或多个支付记录,将新形成的区块发布到各区块链网络的节点。Step 6043, the data sharing billing management module notifies the data sharing payment management module that a new payment smart contract (including payment information) is generated; the data sharing payment management module immediately or periodically pays for the payment bill according to the payment smart contract ; After the payment is completed, the data sharing payment management module signs the payment information to form a payment transaction in a block; the data sharing payment management module digitally signs one or more payment transactions, and then passes the underlying block chain basis The facility module forms a new block, which contains one or more payment records, and publishes the newly formed block to the nodes of each blockchain network.
数据共享支付管理模块通知数据共享访问记录模块,支付完毕,可以进行下一步的操作。The data sharing payment management module notifies the data sharing access record module that after the payment is completed, the next operation can be performed.
本申请实施例提供的数据共享系统,是重用现有技术即基于已有的开源区块链平台(如Hyperledger Fabric、Ethereum Quorum)进行设计的,能提高系统开发效率及可靠性、稳定性,同时上述数据共享系统基于数据传输的安全保护、数据存储的安全保护以及数据使用的访问控制,个人用户或企业用户等可以作为数据提供方,根据自己的要求和策略来安全共享自己的数据。同时,基于智能合约的数据共享,个人用户或企业用户能自动且准实时的获得一定的报酬或收益,在提升了数据共享的安全性的同时,提升了用户的使用体验。同时,数据需求方需要根据访问权限来对数据执行访问操作,避免了数据被非法传播,提升了数据的安全性和私密性。The data sharing system provided by the embodiment of the present application is designed based on the existing open source block chain platform (such as Hyperledger Fabric, Ethereum Quorum) by reusing the existing technology, which can improve the system development efficiency, reliability and stability, and at the same time The above-mentioned data sharing system is based on the security protection of data transmission, security protection of data storage, and access control of data use. Individual users or enterprise users can act as data providers and share their own data safely according to their own requirements and policies. At the same time, based on the data sharing of smart contracts, individual users or enterprise users can automatically and quasi-real-time obtain certain rewards or benefits, which improves the security of data sharing and improves the user experience. At the same time, the data demander needs to perform access operations on the data according to the access rights, avoiding the illegal dissemination of the data, and improving the security and privacy of the data.
需要说明的是,本申请实施例提供的数据共享方法,执行主体可以为数据共享装置,或者该数据共享装置中的用于执行数据共享方法的控制模块。本申请实施例中以数据共享装置执行数据共享方法为例,说明本申请实施例提供的数据共享装置。It should be noted that, for the data sharing method provided in the embodiment of the present application, the execution subject may be a data sharing device, or a control module in the data sharing device for executing the data sharing method. In the embodiment of the present application, the data sharing device provided in the embodiment of the present application is described by taking the data sharing device executing the data sharing method as an example.
参照图9,本申请实施例提供了一种数据共享装置900,所述数据共享装置900可以为第一用户端,所述数据共享装置900包括:Referring to FIG. 9 , the embodiment of the present application provides a data sharing device 900, the data sharing device 900 may be a first client, and the data sharing device 900 includes:
第一发送模块901,用于向服务端发送数据访问请求,所述数据访问请求携带第一数据共享信息,所述第一数据共享信息与待访问数据关联;The first sending module 901 is configured to send a data access request to the server, where the data access request carries first data sharing information, and the first data sharing information is associated with the data to be accessed;
第一接收模块902,用于接收服务端基于第一智能合约发送的第一存储信息和第一权限信息,其中,所述第一智能合约属于区块链中的第一区块,所述第一权限信息用于指示所述第一用户端可对所述待访问数据执行的访问操作;The first receiving module 902 is configured to receive the first storage information and the first authority information sent by the server based on the first smart contract, wherein the first smart contract belongs to the first block in the block chain, and the first A piece of permission information is used to indicate the access operations that the first client can perform on the data to be accessed;
第一获取模块903,用于根据所述第一存储信息,从存储服务器中获取第一加密数据包;The first obtaining module 903 is configured to obtain the first encrypted data package from the storage server according to the first storage information;
解密模块904,用于对所述第一加密数据包进行解密处理,得到所述待访问数据,其中,所述第一加密数据包基于所述待访问数据和所述待访问数据的元数据生成;A decryption module 904, configured to decrypt the first encrypted data packet to obtain the data to be accessed, wherein the first encrypted data packet is generated based on the data to be accessed and the metadata of the data to be accessed ;
访问模块905,用于根据所述第一权限信息,执行对所述待访问数据的 访问操作。The access module 905 is configured to perform an access operation on the data to be accessed according to the first permission information.
在本申请实施例中,第一用户端可以通过第一发送模块901向服务端发送数据访问请求,并通过第一接收模块902接收服务端基于第一智能合约发送的第一存储信息和第一权限信息,利用第一存储信息,通过第一获取模块903从存储服务器获取第一加密数据包,通过解密模块904进行解密处理后得到待访问数据,并通过访问模块905根据第一权限信息,执行对所述待访问数据的访问操作,由于第一权限信息用于指示第一用户端可对待访问数据执行的访问操作,因此可以通过控制第一用户端对待访问数据的访问权限,来避免第一用户端将待访问数据非法地发送至其他用户,降低了数据泄露的风险,提升了数据的私密性和安全性。In this embodiment of the application, the first client can send a data access request to the server through the first sending module 901, and receive the first storage information and the first storage information sent by the server based on the first smart contract through the first receiving module 902 Permission information, using the first storage information, through the first acquisition module 903 to obtain the first encrypted data packet from the storage server, through the decryption module 904 to decrypt the data to be accessed, and through the access module 905 according to the first permission information, execute For the access operation of the data to be accessed, since the first permission information is used to indicate the access operation that the first client can perform on the data to be accessed, it is possible to avoid the first The client illegally sends the data to be accessed to other users, which reduces the risk of data leakage and improves data privacy and security.
可选地,所述第一获取模块903,包括:Optionally, the first acquiring module 903 includes:
第一获取单元,用于在所述第一密钥信息通过所述存储服务器的验证的情况下,获取第二密钥信息;a first obtaining unit, configured to obtain second key information when the first key information passes the verification of the storage server;
第二获取单元,用于根据所述第一地址信息,在所述存储服务器获取所述第一加密数据包;a second obtaining unit, configured to obtain the first encrypted data packet from the storage server according to the first address information;
解密模块904,包括: Decryption module 904, including:
解密单元,用于利用所述第二密钥信息对所述第一加密数据包进行解密处理,得到所述待访问数据。A decryption unit, configured to use the second key information to decrypt the first encrypted data packet to obtain the data to be accessed.
可选地,所述装置还包括以下任一项:Optionally, the device also includes any of the following:
删除模块,用于在所述访问操作终止后,删除所述待访问数据和所述第一加密数据包;A deletion module, configured to delete the data to be accessed and the first encrypted data packet after the access operation is terminated;
重封装模块,用于在所述访问操作终止后,基于所述待访问数据和所述第一加密数据包中所述待访问数据的元数据,对所述待访问数据进行封装以得到第二加密数据包,存储所述第二加密数据包。A repackaging module, configured to encapsulate the data to be accessed based on the data to be accessed and the metadata of the data to be accessed in the first encrypted data packet after the access operation is terminated to obtain a second An encrypted data packet is used to store the second encrypted data packet.
参照图10,本申请实施例还提供了一种数据共享装置1000,所述数据共享装置1000可以为第二用户端,所述装置包括:Referring to FIG. 10 , the embodiment of the present application also provides a data sharing device 1000, which may be a second client, and the device includes:
第二获取模块1001,用于获取待共享数据的第二存储信息,所述第二存储信息指示所述待共享数据对应在所述存储服务器存储的信息;The second acquiring module 1001 is configured to acquire second storage information of the data to be shared, where the second storage information indicates that the data to be shared corresponds to information stored in the storage server;
第二发送模块1002,用于向服务端发送数据共享请求,所述数据共享请 求携带第二数据共享信息和所述第二用户端的数字签名,所述第二数据共享信息基于所述第二存储信息生成,用于描述所述待共享数据;The second sending module 1002 is configured to send a data sharing request to the server, the data sharing request carries second data sharing information and the digital signature of the second client, the second data sharing information is based on the second storage generating information for describing the data to be shared;
第一生成模块1003,用于基于所述待共享数据的元数据和所述待共享数据生成第三加密数据包;A first generation module 1003, configured to generate a third encrypted data package based on the metadata of the data to be shared and the data to be shared;
第一存储模块1004,用于根据所述第二存储信息,在所述存储服务器存储所述第三加密数据包和所述第三加密数据包对应的密钥信息。The first storage module 1004 is configured to store the third encrypted data package and key information corresponding to the third encrypted data package in the storage server according to the second stored information.
可选地,所述第一生成模块1003,包括:Optionally, the first generating module 1003 includes:
第一生成单元,用于生成与所述待共享数据对应的第一数据信息,所述第一数据信息包括以下至少一项:指示所述第二用户端的第一标识、指示所述第三加密数据包的第二标识、以及指示第二智能合约的第二地址信息;A first generating unit, configured to generate first data information corresponding to the data to be shared, where the first data information includes at least one of the following: indicating the first identification of the second client, indicating the third encryption the second identification of the data packet, and the second address information indicating the second smart contract;
其中,所述第二地址信息由所述服务端发送,所述第二智能合约属于区块链中的第二区块,所述第二智能合约用于指示在满足所述第二智能合约的访问条件的情况下,所述服务端输出第三存储信息和第二权限信息,所述第三存储信息用于在所述存储服务器获取所述待共享数据,所述第二权限信息用于指示可对所述待共享数据执行的访问操作;Wherein, the second address information is sent by the server, the second smart contract belongs to the second block in the block chain, and the second smart contract is used to indicate that the second smart contract is satisfied In the case of access conditions, the server outputs third storage information and second permission information, the third storage information is used to obtain the data to be shared in the storage server, and the second permission information is used to indicate Access operations that can be performed on the data to be shared;
第二生成单元,用于根据所述第一数据信息和所述第二用户端对所述第一数据信息的数字签名,生成所述待共享数据的元数据;a second generating unit, configured to generate metadata of the data to be shared according to the first data information and the digital signature of the second client on the first data information;
封装单元,用于将所述待共享数据的元数据和所述待共享数据进行封装,得到所述第三加密数据包。An encapsulating unit, configured to encapsulate the metadata of the data to be shared and the data to be shared to obtain the third encrypted data package.
参照图11-13,本申请实施例还提供了一种数据共享装置,应用于服务端,所述装置包括:Referring to Figures 11-13, the embodiment of the present application also provides a data sharing device, which is applied to the server, and the device includes:
第二接收模块1101,用于接收第一用户端发送的数据访问请求,所述数据访问请求携带第一数据共享信息,所述第一数据共享信息与待访问数据关联;The second receiving module 1101 is configured to receive a data access request sent by a first client, where the data access request carries first data sharing information, and the first data sharing information is associated with the data to be accessed;
第三发送模块1102,用于在所述第一用户端满足第一智能合约的访问条件的情况下,根据所述第一智能合约,将第一存储信息和第一权限信息发送至所述第一用户端;The third sending module 1102 is configured to send the first storage information and the first permission information to the first smart contract according to the first smart contract when the first client meets the access conditions of the first smart contract. a client;
其中,所述第一智能合约属于区块链中的第一区块,所述第一存储信息用于从存储服务器中获取所述待访问数据,所述第一权限信息指示所述第一 用户端可对所述待访问数据执行的访问操作。Wherein, the first smart contract belongs to the first block in the block chain, the first storage information is used to obtain the data to be accessed from the storage server, and the first permission information indicates that the first user The access operation that the terminal can perform on the data to be accessed.
和/或包括:and/or include:
第三接收模块1203,用于接收第二用户端发送的数据共享请求,所述数据共享请求携带第二数据共享信息和所述第二用户端的数字签名,所述第二数据共享信息用于描述待共享数据;The third receiving module 1203 is configured to receive a data sharing request sent by a second client, the data sharing request carries second data sharing information and a digital signature of the second client, and the second data sharing information is used to describe data to be shared;
第二生成模块1204,用于根据所述第二数据共享信息,生成第二权限信息,所述第二权限信息用于指示可对所述待共享数据执行的访问操作;The second generation module 1204 is configured to generate second permission information according to the second data sharing information, and the second permission information is used to indicate access operations that can be performed on the data to be shared;
第三生成模块1205,用于根据所述第二数据共享信息和所述第二用户端的数字签名生成第二区块;A third generating module 1205, configured to generate a second block according to the second data sharing information and the digital signature of the second client;
其中,所述第二区块包括第二智能合约,所述第二智能合约用于指示在满足所述第二智能合约的访问条件的情况下,输出第三存储信息和所述第二权限信息,所述第三存储信息用于从存储服务器中获取所述待共享数据。Wherein, the second block includes a second smart contract, and the second smart contract is used to indicate that the third storage information and the second permission information are output when the access conditions of the second smart contract are satisfied. , the third storage information is used to acquire the data to be shared from a storage server.
可选地,所述第二生成模块1204,包括:Optionally, the second generation module 1204 includes:
第三生成单元,用于根据所述第二数据共享信息,生成访问权限列表,所述访问权限列表包括所述第二权限信息;A third generating unit, configured to generate an access authority list according to the second data sharing information, where the access authority list includes the second authority information;
第三获取单元,用于在接收到与所述第二权限信息关联的权限请求时,从所述访问权限列表中获取所述第二权限信息。A third obtaining unit, configured to obtain the second permission information from the access permission list when receiving a permission request associated with the second permission information.
如图11至图13所示,数据共享装置1100、数据共享装置1200和数据共享装置1300均可以为上述应用于服务端的数据共享装置。As shown in FIG. 11 to FIG. 13 , the data sharing device 1100 , the data sharing device 1200 and the data sharing device 1300 can all be the above data sharing devices applied to the server.
本申请实施例中的数据共享装置可以是装置,也可以是终端中的部件、集成电路、或芯片。该装置可以是移动电子设备,也可以为非移动电子设备。示例性的,移动电子设备可以为手机、平板电脑、笔记本电脑、掌上电脑、车载电子设备、可穿戴设备、超级移动个人计算机(Ultra-Mobile Personal Computer,UMPC)、上网本或者个人数字助理(Personal Digital Assistant,PDA)等,非移动电子设备可以为服务器、网络附属存储器(Network Attached Storage,NAS)、个人计算机(Personal Computer,PC)、电视机(TeleVision,TV)、柜员机或者自助机等,本申请实施例不作具体限定。The data sharing device in the embodiment of the present application may be a device, or a component, an integrated circuit, or a chip in a terminal. The device may be a mobile electronic device or a non-mobile electronic device. Exemplary, the mobile electronic device can be a mobile phone, a tablet computer, a notebook computer, a handheld computer, a vehicle electronic device, a wearable device, an ultra-mobile personal computer (Ultra-Mobile Personal Computer, UMPC), a netbook or a personal digital assistant (Personal Digital Assistant). Assistant, PDA), etc., non-mobile electronic devices can be servers, network attached storage (Network Attached Storage, NAS), personal computer (Personal Computer, PC), television (TeleVision, TV), teller machine or self-service machine, etc., this application Examples are not specifically limited.
本申请实施例中的数据共享装置可以为具有操作系统的装置。该操作系统可以为安卓(Android)操作系统,可以为ios操作系统,还可以为其他可 能的操作系统,本申请实施例不作具体限定。The data sharing device in the embodiment of the present application may be a device with an operating system. The operating system may be an Android operating system, an ios operating system, or other possible operating systems, which are not specifically limited in the embodiments of the present application.
本申请实施例提供的数据共享装置能够实现图1至图8的方法实施例实现的各个过程,为避免重复,这里不再赘述。The data sharing device provided by the embodiment of the present application can realize various processes realized by the method embodiments in FIG. 1 to FIG. 8 , and details are not repeated here to avoid repetition.
可选地,如图14所示,本申请实施例还提供一种电子设备1400,包括处理器1401,存储器1402,存储在存储器1402上并可在所述处理器1401上运行的程序或指令,该程序或指令被处理器1401执行时实现上述数据共享方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。Optionally, as shown in FIG. 14 , the embodiment of the present application further provides an electronic device 1400, including a processor 1401, a memory 1402, and programs or instructions stored in the memory 1402 and operable on the processor 1401, When the program or instruction is executed by the processor 1401, each process of the above-mentioned data sharing method embodiment can be realized, and the same technical effect can be achieved. To avoid repetition, details are not repeated here.
需要说明的是,本申请实施例中的电子设备包括上述所述的移动电子设备和非移动电子设备。It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.
图15为实现本申请实施例的一种电子设备的硬件结构示意图。FIG. 15 is a schematic diagram of a hardware structure of an electronic device implementing an embodiment of the present application.
该电子设备1500可以为第一用户端、第二用户端和服务端,电子设备1500包括但不限于:射频单元1501、网络模块1502、音频输出单元1503、输入单元1504、传感器1505、显示单元1506、用户输入单元1507、接口单元1508、存储器1509、以及处理器1510等部件。The electronic device 1500 can be a first client, a second client and a server, and the electronic device 1500 includes but not limited to: a radio frequency unit 1501, a network module 1502, an audio output unit 1503, an input unit 1504, a sensor 1505, and a display unit 1506 , a user input unit 1507, an interface unit 1508, a memory 1509, a processor 1510 and other components.
本领域技术人员可以理解,电子设备1500还可以包括给各个部件供电的电源(比如电池),电源可以通过电源管理系统与处理器1510逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。图15中示出的电子设备结构并不构成对电子设备的限定,电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置,在此不再赘述。Those skilled in the art can understand that the electronic device 1500 can also include a power supply (such as a battery) for supplying power to various components, and the power supply can be logically connected to the processor 1510 through the power management system, so that the management of charging, discharging, and function can be realized through the power management system. Consumption management and other functions. The structure of the electronic device shown in FIG. 15 does not constitute a limitation to the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange different components, and details will not be repeated here. .
其中,电子设备1500为第一用户端时,射频单元1501,用于向服务端发送数据访问请求,所述数据访问请求携带第一数据共享信息,所述第一数据共享信息与待访问数据关联;Wherein, when the electronic device 1500 is the first client, the radio frequency unit 1501 is used to send a data access request to the server, the data access request carries first data sharing information, and the first data sharing information is associated with the data to be accessed ;
还用于接收服务端基于第一智能合约发送的第一存储信息和第一权限信息,其中,所述第一智能合约属于区块链中的第一区块,所述第一权限信息用于指示所述第一用户端可对所述待访问数据执行的访问操作;It is also used to receive the first storage information and the first permission information sent by the server based on the first smart contract, wherein the first smart contract belongs to the first block in the block chain, and the first permission information is used for Instructing the first client to perform access operations on the data to be accessed;
处理器1510,用于根据所述第一存储信息,从存储服务器中获取第一加密数据包;A processor 1510, configured to acquire a first encrypted data packet from a storage server according to the first storage information;
还用于对所述第一加密数据包进行解密处理,得到所述待访问数据,其 中,所述第一加密数据包基于所述待访问数据和所述待访问数据的元数据生成;It is also used to decrypt the first encrypted data packet to obtain the data to be accessed, wherein the first encrypted data packet is generated based on the data to be accessed and the metadata of the data to be accessed;
还用于根据所述第一权限信息,执行对所述待访问数据的访问操作。It is also used for performing an access operation on the data to be accessed according to the first permission information.
可选地,处理器1510,还用于在所述第一密钥信息通过所述存储服务器的验证的情况下,获取第二密钥信息;Optionally, the processor 1510 is further configured to obtain second key information when the first key information is verified by the storage server;
处理器1510,还用于根据所述第一地址信息,在所述存储服务器获取所述第一加密数据包;The processor 1510 is further configured to obtain the first encrypted data packet from the storage server according to the first address information;
处理器1510,还用于利用所述第二密钥信息对所述第一加密数据包进行解密处理,得到所述待访问数据。The processor 1510 is further configured to use the second key information to decrypt the first encrypted data packet to obtain the data to be accessed.
可选地,处理器1510,还用于在所述访问操作终止后,删除所述待访问数据和所述第一加密数据包;Optionally, the processor 1510 is further configured to delete the data to be accessed and the first encrypted data package after the access operation is terminated;
处理器1510,还用于在所述访问操作终止后,基于所述待访问数据和所述第一加密数据包中所述待访问数据的元数据,对所述待访问数据进行封装以得到第二加密数据包,存储所述第二加密数据包。The processor 1510 is further configured to, after the access operation is terminated, based on the data to be accessed and metadata of the data to be accessed in the first encrypted data packet, encapsulate the data to be accessed to obtain a second A second encrypted data packet, storing the second encrypted data packet.
电子设备1500为第二用户端时,处理器1510,用于获取待共享数据的第二存储信息,所述第二存储信息指示所述待共享数据对应在所述存储服务器存储的信息;When the electronic device 1500 is the second client, the processor 1510 is configured to acquire second storage information of the data to be shared, the second storage information indicating that the data to be shared corresponds to information stored in the storage server;
射频单元1501,用于向服务端发送数据共享请求,所述数据共享请求携带第二数据共享信息和所述第二用户端的数字签名,所述第二数据共享信息基于所述第二存储信息生成,用于描述所述待共享数据;The radio frequency unit 1501 is configured to send a data sharing request to the server, where the data sharing request carries second data sharing information and a digital signature of the second client, and the second data sharing information is generated based on the second stored information , used to describe the data to be shared;
处理器1510,还用于基于所述待共享数据的元数据和所述待共享数据生成第三加密数据包;The processor 1510 is further configured to generate a third encrypted data package based on the metadata of the data to be shared and the data to be shared;
处理器1510,还用于根据所述第二存储信息,在所述存储服务器存储所述第三加密数据包和所述第三加密数据包对应的密钥信息。The processor 1510 is further configured to store the third encrypted data package and key information corresponding to the third encrypted data package in the storage server according to the second stored information.
可选地,处理器1510,还用于生成与所述待共享数据对应的第一数据信息,所述第一数据信息包括以下至少一项:指示所述第二用户端的第一标识、指示所述第三加密数据包的第二标识、以及指示第二智能合约的第二地址信息;Optionally, the processor 1510 is further configured to generate first data information corresponding to the data to be shared, where the first data information includes at least one of the following: indicating the first identifier of the second client, indicating the The second identification of the third encrypted data packet, and the second address information indicating the second smart contract;
其中,所述第二地址信息由所述服务端发送,所述第二智能合约属于区 块链中的第二区块,所述第二智能合约用于指示在满足所述第二智能合约的访问条件的情况下,所述服务端输出第三存储信息和第二权限信息,所述第三存储信息用于在所述存储服务器获取所述待共享数据,所述第二权限信息用于指示可对所述待共享数据执行的访问操作;Wherein, the second address information is sent by the server, the second smart contract belongs to the second block in the block chain, and the second smart contract is used to indicate that the second smart contract is satisfied In the case of access conditions, the server outputs third storage information and second permission information, the third storage information is used to obtain the data to be shared in the storage server, and the second permission information is used to indicate Access operations that can be performed on the data to be shared;
处理器1510,还用于根据所述第一数据信息和所述第二用户端对所述第一数据信息的数字签名,生成所述待共享数据的元数据;The processor 1510 is further configured to generate metadata of the data to be shared according to the first data information and the digital signature of the second client on the first data information;
处理器1510,还用于将所述待共享数据的元数据和所述待共享数据进行封装,得到所述第三加密数据包。The processor 1510 is further configured to encapsulate the metadata of the data to be shared and the data to be shared to obtain the third encrypted data package.
在电子设备1500为服务端时,处理器1510,用于接收第一用户端发送的数据访问请求,所述数据访问请求携带第一数据共享信息,所述第一数据共享信息与待访问数据关联;When the electronic device 1500 is the server, the processor 1510 is configured to receive a data access request sent by the first client, the data access request carries first data sharing information, and the first data sharing information is associated with the data to be accessed ;
射频单元1501,用于在所述第一用户端满足第一智能合约的访问条件的情况下,根据所述第一智能合约,将第一存储信息和第一权限信息发送至所述第一用户端;The radio frequency unit 1501 is configured to send the first storage information and the first permission information to the first user according to the first smart contract when the first user meets the access conditions of the first smart contract end;
其中,所述第一智能合约属于区块链中的第一区块,所述第一存储信息用于从存储服务器中获取所述待访问数据,所述第一权限信息指示所述第一用户端可对所述待访问数据执行的访问操作。Wherein, the first smart contract belongs to the first block in the block chain, the first storage information is used to obtain the data to be accessed from the storage server, and the first permission information indicates that the first user The access operation that the terminal can perform on the data to be accessed.
和/或:and / or:
射频单元1501,用于接收第二用户端发送的数据共享请求,所述数据共享请求携带第二数据共享信息和所述第二用户端的数字签名,所述第二数据共享信息用于描述待共享数据;The radio frequency unit 1501 is configured to receive a data sharing request sent by a second client, where the data sharing request carries second data sharing information and a digital signature of the second client, and the second data sharing information is used to describe the data to be shared data;
处理器1510,用于根据所述第二数据共享信息,生成第二权限信息,所述第二权限信息用于指示可对所述待共享数据执行的访问操作;The processor 1510 is configured to generate second permission information according to the second data sharing information, where the second permission information is used to indicate access operations that can be performed on the data to be shared;
处理器1510,还用于根据所述第二数据共享信息和所述第二用户端的数字签名生成第二区块;The processor 1510 is further configured to generate a second block according to the second data sharing information and the digital signature of the second client;
其中,所述第二区块包括第二智能合约,所述第二智能合约用于指示在满足所述第二智能合约的访问条件的情况下,输出第三存储信息和所述第二权限信息,所述第三存储信息用于从存储服务器中获取所述待共享数据。Wherein, the second block includes a second smart contract, and the second smart contract is used to indicate that the third storage information and the second permission information are output when the access conditions of the second smart contract are met. , the third storage information is used to acquire the data to be shared from a storage server.
可选地,处理器1510,还用于根据所述第二数据共享信息,生成访问权 限列表,所述访问权限列表包括所述第二权限信息;Optionally, the processor 1510 is further configured to generate an access permission list according to the second data sharing information, where the access permission list includes the second permission information;
处理器1510,还用于在接收到与所述第二权限信息关联的权限请求时,从所述访问权限列表中获取所述第二权限信息。The processor 1510 is further configured to acquire the second permission information from the access permission list when receiving the permission request associated with the second permission information.
由于电子设备1500采用了上述实施例的全部技术方案,因此至少具有实施例的技术方案所带来的所有有益效果,在此不再一一赘述。Since the electronic device 1500 adopts all the technical solutions of the above-mentioned embodiments, it at least has all the beneficial effects brought by the technical solutions of the embodiments, which will not be repeated here.
应理解的是,本申请实施例中,输入单元1504可以包括图形处理器(Graphics Processing Unit,GPU)15041和麦克风15042,图形处理器15041对在视频捕获模式或图像捕获模式中由图像捕获装置(如摄像头)获得的静态图片或视频的图像数据进行处理。显示单元1506可包括显示面板15061,可以采用液晶显示器、有机发光二极管等形式来配置显示面板15061。用户输入单元1507包括触控面板15071以及其他输入设备15072。触控面板15071,也称为触摸屏。触控面板15071可包括触摸检测装置和触摸控制器两个部分。其他输入设备15072可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆,在此不再赘述。存储器1509可用于存储软件程序以及各种数据,包括但不限于应用程序和操作系统。处理器1510可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器1510中。It should be understood that, in the embodiment of the present application, the input unit 1504 may include a graphics processor (Graphics Processing Unit, GPU) 15041 and a microphone 15042, and the graphics processor 15041 is used for the image capture device ( Such as the image data of the still picture or video obtained by the camera) for processing. The display unit 1506 may include a display panel 15061, and the display panel 15061 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. The user input unit 1507 includes a touch panel 15071 and other input devices 15072 . Touch panel 15071, also called touch screen. The touch panel 15071 may include two parts, a touch detection device and a touch controller. Other input devices 15072 may include, but are not limited to, physical keyboards, function keys (such as volume control keys, switch keys, etc.), trackballs, mice, and joysticks, which will not be repeated here. The memory 1509 can be used to store software programs as well as various data, including but not limited to application programs and operating systems. The processor 1510 may integrate an application processor and a modem processor, wherein the application processor mainly processes operating systems, user interfaces, and application programs, and the modem processor mainly processes wireless communications. It can be understood that the foregoing modem processor may not be integrated into the processor 1510 .
本申请实施例还提供一种可读存储介质,所述可读存储介质上存储有程序或指令,该程序或指令被处理器执行时实现上述数据共享方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。The embodiment of the present application also provides a readable storage medium, the readable storage medium stores a program or an instruction, and when the program or instruction is executed by a processor, each process of the above-mentioned data sharing method embodiment is realized, and the same To avoid repetition, the technical effects will not be repeated here.
其中,所述处理器为上述实施例中所述的电子设备中的处理器。所述可读存储介质,包括计算机可读存储介质,如计算机只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等。Wherein, the processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer readable storage medium, such as computer read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk, etc.
本申请实施例另提供了一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现上述数据共享方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。The embodiment of the present application further provides a chip, the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the above data sharing method embodiment Each process can achieve the same technical effect, so in order to avoid repetition, it will not be repeated here.
应理解,本申请实施例提到的芯片还可以称为系统级芯片、系统芯片、芯片系统或片上系统芯片等。It should be understood that the chips mentioned in the embodiments of the present application may also be called system-on-chip, system-on-chip, system-on-a-chip, or system-on-a-chip.
本申请还提供了一种计算机程序产品,所述计算机程序产品存储在非易失的存储介质中,所述计算机程序产品被至少一个处理器执行以实现上述数据共享方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。The present application also provides a computer program product, the computer program product is stored in a non-volatile storage medium, and the computer program product is executed by at least one processor to implement the various processes of the foregoing data sharing method embodiments, and The same technical effect can be achieved, so in order to avoid repetition, details will not be repeated here.
本申请还提供了一种通信设备,被配置为执行如上述数据共享方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。The present application also provides a communication device, which is configured to execute the various processes of the above data sharing method embodiment, and can achieve the same technical effect. To avoid repetition, details are not repeated here.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。此外,需要指出的是,本申请实施方式中的方法和装置的范围不限按示出或讨论的顺序来执行功能,还可包括根据所涉及的功能按基本同时的方式或按相反的顺序来执行功能,例如,可以按不同于所描述的次序来执行所描述的方法,并且还可以添加、省去、或组合各种步骤。另外,参照某些示例所描述的特征可在其他示例中被组合。It should be noted that, in this document, the term "comprising", "comprising" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article or apparatus comprising a set of elements includes not only those elements, It also includes other elements not expressly listed, or elements inherent in the process, method, article, or device. Without further limitations, an element defined by the phrase "comprising a ..." does not preclude the presence of additional identical elements in the process, method, article, or apparatus comprising that element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved. Functions are performed, for example, the described methods may be performed in an order different from that described, and various steps may also be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以计算机软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus a necessary general-purpose hardware platform, and of course also by hardware, but in many cases the former is better implementation. Based on such an understanding, the technical solution of the present application can be embodied in the form of computer software products, which are stored in a storage medium (such as ROM/RAM, magnetic disk, etc.) , optical disc), including several instructions to enable a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of the present application.
上面结合附图对本申请的实施例进行了描述,但是本申请并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本申请的启示下,在不脱离本申请宗旨和权利要求 所保护的范围情况下,还可做出很多形式,均属于本申请的保护之内。The embodiments of the present application have been described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementations. The above-mentioned specific implementations are only illustrative and not restrictive. Those of ordinary skill in the art will Under the inspiration of this application, without departing from the purpose of this application and the scope of protection of the claims, many forms can also be made, all of which belong to the protection of this application.

Claims (19)

  1. 一种数据共享方法,应用于第一用户端,所述方法包括:A data sharing method applied to a first client, the method comprising:
    向服务端发送数据访问请求,所述数据访问请求携带第一数据共享信息,所述第一数据共享信息与待访问数据关联;Sending a data access request to the server, where the data access request carries first data sharing information, and the first data sharing information is associated with the data to be accessed;
    接收服务端基于第一智能合约发送的第一存储信息和第一权限信息,其中,所述第一智能合约属于区块链中的第一区块,所述第一权限信息用于指示所述第一用户端可对所述待访问数据执行的访问操作;receiving the first storage information and first permission information sent by the server based on the first smart contract, wherein the first smart contract belongs to the first block in the blockchain, and the first permission information is used to indicate the An access operation that the first client can perform on the data to be accessed;
    根据所述第一存储信息,从存储服务器中获取第一加密数据包;Acquiring a first encrypted data packet from a storage server according to the first storage information;
    对所述第一加密数据包进行解密处理,得到所述待访问数据,其中,所述第一加密数据包是基于所述待访问数据和所述待访问数据的元数据生成;Decrypting the first encrypted data packet to obtain the data to be accessed, wherein the first encrypted data packet is generated based on the data to be accessed and metadata of the data to be accessed;
    根据所述第一权限信息,执行对所述待访问数据的访问操作。Perform an access operation on the data to be accessed according to the first permission information.
  2. 根据权利要求1所述的方法,其中,所述第一存储信息包括第一密钥信息和第一地址信息,所述根据所述第一存储信息,从存储服务器中获取第一加密数据包,包括:The method according to claim 1, wherein the first stored information includes first key information and first address information, and the first encrypted data packet is obtained from a storage server according to the first stored information, include:
    在所述第一密钥信息通过所述存储服务器的验证的情况下,获取第二密钥信息;acquiring second key information when the first key information is verified by the storage server;
    根据所述第一地址信息,在所述存储服务器获取所述第一加密数据包;Obtaining the first encrypted data packet from the storage server according to the first address information;
    所述对所述第一加密数据包进行解密处理,得到所述待访问数据,包括:The decrypting the first encrypted data packet to obtain the data to be accessed includes:
    利用所述第二密钥信息对所述第一加密数据包进行解密处理,得到所述待访问数据。Decrypting the first encrypted data packet by using the second key information to obtain the data to be accessed.
  3. 根据权利要求1所述的方法,其中,所述根据所述第一权限信息,执行对所述待访问数据的访问操作的步骤之后,所述方法还包括以下任一项:The method according to claim 1, wherein, after the step of performing an access operation on the data to be accessed according to the first permission information, the method further includes any of the following:
    在所述访问操作终止后,删除所述待访问数据和所述第一加密数据包;After the access operation is terminated, delete the data to be accessed and the first encrypted data packet;
    在所述访问操作终止后,基于所述待访问数据和所述第一加密数据包中所述待访问数据的元数据,对所述待访问数据进行封装以得到第二加密数据包,存储所述第二加密数据包。After the access operation is terminated, based on the data to be accessed and the metadata of the data to be accessed in the first encrypted data packet, the data to be accessed is encapsulated to obtain a second encrypted data packet, and the stored Describe the second encrypted data packet.
  4. 一种数据共享方法,应用于第二用户端,所述方法包括:A data sharing method applied to a second client, the method comprising:
    获取待共享数据的第二存储信息,所述第二存储信息指示所述待共享数 据对应在存储服务器中存储的信息;Acquiring second storage information of the data to be shared, the second storage information indicating that the data to be shared corresponds to information stored in the storage server;
    向服务端发送数据共享请求,所述数据共享请求携带第二数据共享信息和所述第二用户端的数字签名,其中,所述第二数据共享信息用于描述所述待共享数据;Sending a data sharing request to the server, the data sharing request carrying second data sharing information and the digital signature of the second client, wherein the second data sharing information is used to describe the data to be shared;
    基于所述待共享数据的元数据和所述待共享数据生成第三加密数据包;generating a third encrypted data packet based on the metadata of the data to be shared and the data to be shared;
    根据所述第二存储信息,在所述存储服务器存储所述第三加密数据包和所述第三加密数据包对应的密钥信息。According to the second storage information, the storage server stores the third encrypted data package and key information corresponding to the third encrypted data package.
  5. 根据权利要求4所述的方法,其中,所述基于所述待共享数据的元数据和所述待共享数据生成第三加密数据包,包括:The method according to claim 4, wherein said generating a third encrypted data package based on the metadata of the data to be shared and the data to be shared comprises:
    生成与所述待共享数据对应的第一数据信息,所述第一数据信息包括以下至少一项:指示所述第二用户端的第一标识、指示所述第三加密数据包的第二标识、以及指示第二智能合约的第二地址信息;generating first data information corresponding to the data to be shared, where the first data information includes at least one of the following: a first identification indicating the second client, a second identification indicating the third encrypted data packet, and second address information indicating the second smart contract;
    其中,所述第二地址信息由所述服务端发送,所述第二智能合约属于区块链中的第二区块,所述第二智能合约用于指示在满足所述第二智能合约的访问条件的情况下,所述服务端输出第三存储信息和第二权限信息,所述第三存储信息用于在所述存储服务器获取所述待共享数据,所述第二权限信息用于指示可对所述待共享数据执行的访问操作;Wherein, the second address information is sent by the server, the second smart contract belongs to the second block in the block chain, and the second smart contract is used to indicate that the second smart contract is satisfied In the case of access conditions, the server outputs third storage information and second permission information, the third storage information is used to obtain the data to be shared in the storage server, and the second permission information is used to indicate Access operations that can be performed on the data to be shared;
    根据所述第一数据信息和所述第二用户端对所述第一数据信息的数字签名,生成所述待共享数据的元数据;generating metadata of the data to be shared according to the first data information and the digital signature of the second client on the first data information;
    将所述待共享数据的元数据和所述待共享数据进行封装,得到所述第三加密数据包。Encapsulating the metadata of the data to be shared and the data to be shared to obtain the third encrypted data package.
  6. 一种数据共享方法,应用于服务端,所述方法包括:A data sharing method applied to a server, the method comprising:
    接收第一用户端发送的数据访问请求,所述数据访问请求携带第一数据共享信息,所述第一数据共享信息与待访问数据关联;receiving a data access request sent by the first client, where the data access request carries first data sharing information, and the first data sharing information is associated with the data to be accessed;
    在所述第一用户端满足第一智能合约的访问条件的情况下,根据所述第一智能合约,将第一存储信息和第一权限信息发送至所述第一用户端;When the first client meets the access conditions of the first smart contract, according to the first smart contract, send the first storage information and the first permission information to the first client;
    其中,所述第一智能合约属于区块链中的第一区块,所述第一存储信息用于从存储服务器中获取所述待访问数据,所述第一权限信息指示所述第一用户端可对所述待访问数据执行的访问操作;Wherein, the first smart contract belongs to the first block in the block chain, the first storage information is used to obtain the data to be accessed from the storage server, and the first permission information indicates that the first user The access operation that the terminal can perform on the data to be accessed;
    和/或,and / or,
    接收第二用户端发送的数据共享请求,所述数据共享请求携带第二数据共享信息和所述第二用户端的数字签名,所述第二数据共享信息用于描述待共享数据;receiving a data sharing request sent by a second client, where the data sharing request carries second data sharing information and a digital signature of the second client, and the second data sharing information is used to describe the data to be shared;
    根据所述第二数据共享信息,生成第二权限信息,所述第二权限信息用于指示可对所述待共享数据执行的访问操作;generating second permission information according to the second data sharing information, where the second permission information is used to indicate access operations that can be performed on the data to be shared;
    根据所述第二数据共享信息和所述第二用户端的数字签名生成第二区块;generating a second block according to the second data sharing information and the digital signature of the second client;
    其中,所述第二区块包括第二智能合约,所述第二智能合约用于指示在满足所述第二智能合约的访问条件的情况下,输出第三存储信息和所述第二权限信息,所述第三存储信息用于从存储服务器中获取所述待共享数据。Wherein, the second block includes a second smart contract, and the second smart contract is used to indicate that the third storage information and the second permission information are output when the access conditions of the second smart contract are satisfied. , the third storage information is used to acquire the data to be shared from a storage server.
  7. 根据权利要求6所述的方法,其中,所述根据所述第二数据共享信息,生成第二权限信息,包括:The method according to claim 6, wherein said generating second permission information according to said second data sharing information comprises:
    根据所述第二数据共享信息,生成访问权限列表,所述访问权限列表包括所述第二权限信息;generating an access authority list according to the second data sharing information, the access authority list including the second authority information;
    在接收到与所述第二权限信息关联的权限请求时,从所述访问权限列表中获取所述第二权限信息。When a permission request associated with the second permission information is received, the second permission information is acquired from the access permission list.
  8. 一种数据共享装置,应用于第一用户端,所述装置包括:A data sharing device, applied to a first user end, said device comprising:
    第一发送模块,用于向服务端发送数据访问请求,所述数据访问请求携带第一数据共享信息,所述第一数据共享信息与待访问数据关联;The first sending module is configured to send a data access request to the server, the data access request carries first data sharing information, and the first data sharing information is associated with the data to be accessed;
    第一接收模块,用于接收服务端基于第一智能合约发送的第一存储信息和第一权限信息,其中,所述第一智能合约属于区块链中的第一区块,所述第一权限信息用于指示所述第一用户端可对所述待访问数据执行的访问操作;The first receiving module is configured to receive the first storage information and the first authority information sent by the server based on the first smart contract, wherein the first smart contract belongs to the first block in the block chain, and the first The permission information is used to indicate the access operations that the first client can perform on the data to be accessed;
    第一获取模块,用于根据所述第一存储信息,从存储服务器中获取第一加密数据包;A first obtaining module, configured to obtain a first encrypted data packet from a storage server according to the first storage information;
    解密模块,用于对所述第一加密数据包进行解密处理,得到所述待访问数据,其中,所述第一加密数据包基于所述待访问数据和所述待访问数据的元数据生成;A decryption module, configured to decrypt the first encrypted data packet to obtain the data to be accessed, wherein the first encrypted data packet is generated based on the data to be accessed and metadata of the data to be accessed;
    访问模块,用于根据所述第一权限信息,执行对所述待访问数据的访问操作。An access module, configured to perform an access operation on the data to be accessed according to the first permission information.
  9. 根据权利要求8所述的装置,其中,所述第一存储信息包括第一密钥信息和第一地址信息,所述第一获取模块,包括:The device according to claim 8, wherein the first storage information includes first key information and first address information, and the first obtaining module includes:
    第一获取单元,用于在所述第一密钥信息通过所述存储服务器的验证的情况下,获取第二密钥信息;a first obtaining unit, configured to obtain second key information when the first key information passes the verification of the storage server;
    第二获取单元,用于根据所述第一地址信息,在所述存储服务器获取所述第一加密数据包;a second obtaining unit, configured to obtain the first encrypted data packet from the storage server according to the first address information;
    解密模块,包括:Decryption module, including:
    解密单元,用于利用所述第二密钥信息对所述第一加密数据包进行解密处理,得到所述待访问数据。A decryption unit, configured to use the second key information to decrypt the first encrypted data packet to obtain the data to be accessed.
  10. 根据权利要求8所述的装置,其中,所述装置还包括以下任一项:The device according to claim 8, wherein the device further comprises any of the following:
    删除模块,用于在所述访问操作终止后,删除所述待访问数据和所述第一加密数据包;A deletion module, configured to delete the data to be accessed and the first encrypted data packet after the access operation is terminated;
    重封装模块,用于在所述访问操作终止后,基于所述待访问数据和所述第一加密数据包中所述待访问数据的元数据,对所述待访问数据进行封装以得到第二加密数据包,存储所述第二加密数据包。A repackaging module, configured to encapsulate the data to be accessed based on the data to be accessed and the metadata of the data to be accessed in the first encrypted data packet after the access operation is terminated to obtain a second An encrypted data packet is used to store the second encrypted data packet.
  11. 一种数据共享装置,应用于第二用户端,所述装置包括:A data sharing device applied to a second user end, the device comprising:
    第二获取模块,用于获取待共享数据的第二存储信息,所述第二存储信息指示所述待共享数据对应在所述存储服务器存储的信息;A second acquiring module, configured to acquire second storage information of the data to be shared, where the second storage information indicates that the data to be shared corresponds to information stored in the storage server;
    第二发送模块,用于向服务端发送数据共享请求,所述数据共享请求携带第二数据共享信息和所述第二用户端的数字签名,所述第二数据共享信息基于所述第二存储信息生成,用于描述所述待共享数据;The second sending module is configured to send a data sharing request to the server, the data sharing request carries second data sharing information and a digital signature of the second client, and the second data sharing information is based on the second storage information Generated to describe the data to be shared;
    第一生成模块,用于基于所述待共享数据的元数据和所述待共享数据生成第三加密数据包;A first generation module, configured to generate a third encrypted data package based on the metadata of the data to be shared and the data to be shared;
    第一存储模块,用于根据所述第二存储信息,在所述存储服务器存储所述第三加密数据包和所述第三加密数据包对应的密钥信息。The first storage module is configured to store the third encrypted data package and key information corresponding to the third encrypted data package in the storage server according to the second stored information.
  12. 根据权利要求11所述的装置,其中,所述第一生成模块,包括:The device according to claim 11, wherein the first generating module comprises:
    第一生成单元,用于生成与所述待共享数据对应的第一数据信息,所述第一数据信息包括以下至少一项:指示所述第二用户端的第一标识、指示所述第三加密数据包的第二标识、以及指示第二智能合约的第二地址信息;A first generating unit, configured to generate first data information corresponding to the data to be shared, where the first data information includes at least one of the following: indicating the first identification of the second client, indicating the third encryption the second identification of the data packet, and the second address information indicating the second smart contract;
    其中,所述第二地址信息由所述服务端发送,所述第二智能合约属于区块链中的第二区块,所述第二智能合约用于指示在满足所述第二智能合约的访问条件的情况下,所述服务端输出第三存储信息和第二权限信息,所述第三存储信息用于在所述存储服务器获取所述待共享数据,所述第二权限信息用于指示可对所述待共享数据执行的访问操作;Wherein, the second address information is sent by the server, the second smart contract belongs to the second block in the block chain, and the second smart contract is used to indicate that the second smart contract is satisfied In the case of access conditions, the server outputs third storage information and second permission information, the third storage information is used to obtain the data to be shared in the storage server, and the second permission information is used to indicate Access operations that can be performed on the data to be shared;
    第二生成单元,用于根据所述第一数据信息和所述第二用户端对所述第一数据信息的数字签名,生成所述待共享数据的元数据;a second generating unit, configured to generate metadata of the data to be shared according to the first data information and the digital signature of the second client on the first data information;
    封装单元,用于将所述待共享数据的元数据和所述待共享数据进行封装,得到所述第三加密数据包。An encapsulating unit, configured to encapsulate the metadata of the data to be shared and the data to be shared to obtain the third encrypted data package.
  13. 一种数据共享装置,应用于服务端,所述装置包括:A data sharing device applied to a server, the device comprising:
    第二接收模块,用于接收第一用户端发送的数据访问请求,所述数据访问请求携带第一数据共享信息,所述第一数据共享信息与待访问数据关联;The second receiving module is configured to receive a data access request sent by the first client, where the data access request carries first data sharing information, and the first data sharing information is associated with the data to be accessed;
    第三发送模块,用于在所述第一用户端满足第一智能合约的访问条件的情况下,根据所述第一智能合约,将第一存储信息和第一权限信息发送至所述第一用户端;The third sending module is configured to send the first storage information and the first authority information to the first smart contract according to the first smart contract when the first client meets the access conditions of the first smart contract user terminal;
    其中,所述第一智能合约属于区块链中的第一区块,所述第一存储信息用于从存储服务器中获取所述待访问数据,所述第一权限信息指示所述第一用户端可对所述待访问数据执行的访问操作;Wherein, the first smart contract belongs to the first block in the block chain, the first storage information is used to obtain the data to be accessed from the storage server, and the first permission information indicates that the first user The access operation that the terminal can perform on the data to be accessed;
    和/或,and / or,
    第三接收模块,用于接收第二用户端发送的数据共享请求,所述数据共享请求携带第二数据共享信息和所述第二用户端的数字签名,所述第二数据共享信息用于描述待共享数据;The third receiving module is configured to receive the data sharing request sent by the second client, the data sharing request carries the second data sharing information and the digital signature of the second client, and the second data sharing information is used to describe the share data;
    第二生成模块,用于根据所述第二数据共享信息,生成第二权限信息,所述第二权限信息用于指示可对所述待共享数据执行的访问操作;A second generating module, configured to generate second permission information according to the second data sharing information, where the second permission information is used to indicate access operations that can be performed on the data to be shared;
    第三生成模块,用于根据所述第二数据共享信息和所述第二用户端的数字签名生成第二区块;A third generating module, configured to generate a second block according to the second data sharing information and the digital signature of the second client;
    其中,所述第二区块包括第二智能合约,所述第二智能合约用于指示在满足所述第二智能合约的访问条件的情况下,输出第三存储信息和所述第二权限信息,所述第三存储信息用于从存储服务器中获取所述待共享数据。Wherein, the second block includes a second smart contract, and the second smart contract is used to indicate that the third storage information and the second permission information are output when the access conditions of the second smart contract are satisfied. , the third storage information is used to acquire the data to be shared from a storage server.
  14. 根据权利要求13所述的装置,其中,所述第二生成模块,包括:The device according to claim 13, wherein the second generating module comprises:
    第三生成单元,用于根据所述第二数据共享信息,生成访问权限列表,所述访问权限列表包括所述第二权限信息;A third generating unit, configured to generate an access authority list according to the second data sharing information, where the access authority list includes the second authority information;
    第三获取单元,用于在接收到与所述第二权限信息关联的权限请求时,从所述访问权限列表中获取所述第二权限信息。A third obtaining unit, configured to obtain the second permission information from the access permission list when receiving a permission request associated with the second permission information.
  15. 一种电子设备,包括处理器,存储器及存储在所述存储器上并可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现以下至少一项所述的数据共享方法的步骤:An electronic device, including a processor, a memory, and a program or instruction stored on the memory and operable on the processor, when the program or instruction is executed by the processor, at least one of the following Steps of the data sharing method:
    如权利要求1-3所述的数据共享方法的步骤;The steps of the data sharing method as claimed in claims 1-3;
    如权利要求4-5所述的数据共享方法的步骤;The steps of the data sharing method as claimed in claims 4-5;
    如权利要求6-7所述的数据共享方法的步骤。The steps of the data sharing method as claimed in claims 6-7.
  16. 一种可读存储介质,所述可读存储介质上存储程序或指令,所述程序或指令被处理器执行时实现以下至少一项所述的数据共享方法的步骤:A readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, at least one of the following steps of the data sharing method is implemented:
    如权利要求1-3所述的数据共享方法的步骤;The steps of the data sharing method as claimed in claims 1-3;
    如权利要求4-5所述的数据共享方法的步骤;The steps of the data sharing method as claimed in claims 4-5;
    如权利要求6-7所述的数据共享方法的步骤。The steps of the data sharing method as claimed in claims 6-7.
  17. 一种芯片,包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现以下至少一项所述的数据共享方法的步骤:A chip, including a processor and a communication interface, the communication interface is coupled to the processor, the processor is used to run programs or instructions, and implement the steps of at least one of the following data sharing methods:
    如权利要求1-3所述的数据共享方法的步骤;The steps of the data sharing method as claimed in claims 1-3;
    如权利要求4-5所述的数据共享方法的步骤;The steps of the data sharing method as claimed in claims 4-5;
    如权利要求6-7所述的数据共享方法的步骤。The steps of the data sharing method as claimed in claims 6-7.
  18. 一种计算机程序产品,所述计算机程序产品被存储在非易失的存储介质中,所述计算机程序产品被至少一个处理器执行时实现以下至少一项所述的数据共享方法的步骤:A computer program product, the computer program product is stored in a non-volatile storage medium, and when the computer program product is executed by at least one processor, the steps of at least one of the following data sharing methods are implemented:
    如权利要求1-3所述的数据共享方法的步骤;The steps of the data sharing method as claimed in claims 1-3;
    如权利要求4-5所述的数据共享方法的步骤;The steps of the data sharing method as claimed in claims 4-5;
    如权利要求6-7所述的数据共享方法的步骤。The steps of the data sharing method as claimed in claims 6-7.
  19. 一种通信设备,被配置为执行以下至少一项所述的数据共享方法的 步骤:A communication device configured to perform the steps of at least one of the following data sharing methods:
    如权利要求1-3所述的数据共享方法的步骤;The steps of the data sharing method as claimed in claims 1-3;
    如权利要求4-5所述的数据共享方法的步骤;The steps of the data sharing method as claimed in claims 4-5;
    如权利要求6-7所述的数据共享方法的步骤。The steps of the data sharing method as claimed in claims 6-7.
PCT/CN2022/116520 2021-09-03 2022-09-01 Data sharing method and electronic device WO2023030450A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111031567.1 2021-09-03
CN202111031567.1A CN113704210A (en) 2021-09-03 2021-09-03 Data sharing method and electronic equipment

Publications (1)

Publication Number Publication Date
WO2023030450A1 true WO2023030450A1 (en) 2023-03-09

Family

ID=78659134

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/116520 WO2023030450A1 (en) 2021-09-03 2022-09-01 Data sharing method and electronic device

Country Status (2)

Country Link
CN (1) CN113704210A (en)
WO (1) WO2023030450A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116303310A (en) * 2023-05-12 2023-06-23 山东恒远智能科技有限公司 Data sharing method and system of industrial Internet
CN117319084A (en) * 2023-11-28 2023-12-29 遂宁市中心医院 Medical examination data sharing method and system based on cloud authentication

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113704210A (en) * 2021-09-03 2021-11-26 维沃移动通信有限公司 Data sharing method and electronic equipment
CN115021959A (en) * 2022-04-26 2022-09-06 河北雄安火树科技有限公司 Block chain-based data management method and related product
CN114884939A (en) * 2022-05-07 2022-08-09 中国银行股份有限公司 Screen sharing method, device and system
CN114866615A (en) * 2022-05-24 2022-08-05 深圳点宽网络科技有限公司 Service calling method, device and system based on block chain and electronic equipment
CN115580440A (en) * 2022-09-19 2023-01-06 中国银联股份有限公司 Data sharing system, method, device, equipment and medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105429994A (en) * 2015-12-10 2016-03-23 黄信开 Smart phone privacy protection method based on distributed cloud storage
CN105704085A (en) * 2014-11-24 2016-06-22 国际商业机器公司 Method and apparatus for information sharing
CN110677411A (en) * 2019-09-27 2020-01-10 浙江宇视科技有限公司 Data sharing method and system based on cloud storage
CN111143870A (en) * 2019-12-30 2020-05-12 兴唐通信科技有限公司 Distributed encryption storage device, system and encryption and decryption method
CN111526197A (en) * 2020-04-24 2020-08-11 远光软件股份有限公司 Cloud data secure sharing method
CN111797415A (en) * 2020-06-30 2020-10-20 远光软件股份有限公司 Block chain based data sharing method, electronic device and storage medium
WO2021139338A1 (en) * 2020-07-31 2021-07-15 平安科技(深圳)有限公司 Data access permission verification method and apparatus, computer device, and storage medium
CN113228011A (en) * 2018-12-29 2021-08-06 上海诺基亚贝尔股份有限公司 Data sharing
CN113704210A (en) * 2021-09-03 2021-11-26 维沃移动通信有限公司 Data sharing method and electronic equipment

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105704085A (en) * 2014-11-24 2016-06-22 国际商业机器公司 Method and apparatus for information sharing
CN105429994A (en) * 2015-12-10 2016-03-23 黄信开 Smart phone privacy protection method based on distributed cloud storage
CN113228011A (en) * 2018-12-29 2021-08-06 上海诺基亚贝尔股份有限公司 Data sharing
CN110677411A (en) * 2019-09-27 2020-01-10 浙江宇视科技有限公司 Data sharing method and system based on cloud storage
CN111143870A (en) * 2019-12-30 2020-05-12 兴唐通信科技有限公司 Distributed encryption storage device, system and encryption and decryption method
CN111526197A (en) * 2020-04-24 2020-08-11 远光软件股份有限公司 Cloud data secure sharing method
CN111797415A (en) * 2020-06-30 2020-10-20 远光软件股份有限公司 Block chain based data sharing method, electronic device and storage medium
WO2021139338A1 (en) * 2020-07-31 2021-07-15 平安科技(深圳)有限公司 Data access permission verification method and apparatus, computer device, and storage medium
CN113704210A (en) * 2021-09-03 2021-11-26 维沃移动通信有限公司 Data sharing method and electronic equipment

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116303310A (en) * 2023-05-12 2023-06-23 山东恒远智能科技有限公司 Data sharing method and system of industrial Internet
CN117319084A (en) * 2023-11-28 2023-12-29 遂宁市中心医院 Medical examination data sharing method and system based on cloud authentication
CN117319084B (en) * 2023-11-28 2024-01-30 遂宁市中心医院 Medical examination data sharing method and system based on cloud authentication

Also Published As

Publication number Publication date
CN113704210A (en) 2021-11-26

Similar Documents

Publication Publication Date Title
WO2023030450A1 (en) Data sharing method and electronic device
CN109144961B (en) Authorization file sharing method and device
CN103379098B (en) Content sharing method, device and network system thereof
US7913309B2 (en) Information rights management
WO2023005838A1 (en) Data sharing method and electronic device
US9270447B2 (en) Demand based encryption and key generation and distribution systems and methods
US9003189B2 (en) Trusted third party client authentication
CN109104281A (en) Tokenized hardware security module
US20080154782A1 (en) Apparatus, method and system for protecting personal information
US20130275765A1 (en) Secure digital document distribution with real-time sender control of recipient document content access rights
CN110611657A (en) File stream processing method, device and system based on block chain
CN109583891B (en) Information processing method, device and storage medium
EP3920056B1 (en) Digital artwork display device, management method, and electronic device
US20230095123A1 (en) Systems and Methods for Digitally Signed Contracts with Verifiable Credentials
US11841960B1 (en) Systems and processes for providing secure client controlled and managed exchange of data between parties
Wang et al. CS-DRM: a cloud-based SIM DRM scheme for mobile internet
CN107920060A (en) Data access method and device based on account
US11556959B2 (en) Internet data usage control system
WO2023244993A1 (en) Systems and methods for mitigating network congestion on blockchain networks by supporting blockchain operations through off-chain interactions
US10853898B1 (en) Method and apparatus for controlled messages
JP5678150B2 (en) User terminal, key management system, and program
Yen et al. Transparent digital rights management system with superdistribution
KR100706085B1 (en) Method for applying digital rights management to multi devices
KR100747451B1 (en) Apparatus and method for digital rights management
CN114666119B (en) Data processing method, device, electronic equipment and medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22863585

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE