Data trusted sharing method and apparatus

By using national cryptographic algorithms and blockchain technology, a dynamic authorization mechanism and in-situ computation mechanism are constructed, which solves the problems of data security and compliance in cross-domain data sharing, realizes the local encrypted processing and querying of data, and ensures that data sovereignty is not transferred.

CN121792253BActive Publication Date: 2026-05-15BEIJING ACADEMY OF AGRICULTURE & FORESTRY SCIENCES
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202610275693.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-03-06
Publication Date
2026-05-15
Estimated Expiration
2046-03-06

AI Technical Summary

Technical Problem

Existing cross-domain data sharing technologies lack deep binding mechanisms, making it impossible to achieve dynamic authorization and in-situ computation without exposing the physical location and content of the original HDFS data blocks, leading to data security and compliance issues.

Method used

A blockchain-driven dynamic authorization mechanism is constructed using national cryptographic algorithms. An index content identifier is generated through the InterPlanetary File System, and the ownership and domain identifier are verified by combining the blockchain. A temporary key is generated and transmitted in encrypted form, enabling in-situ computation and encrypted logic processing of data locally.

Benefits of technology

While meeting national cryptographic compliance requirements, it prevents the outflow of raw data from the local storage domain, ensuring that the data is available but not visible, and that sovereignty is not transferred due to sharing, thus solving the problems of data privacy leakage and compliance with information technology innovation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121792253B_ABST
    Figure CN121792253B_ABST
Patent Text Reader

Abstract

The application provides a data trusted sharing method and device, and belongs to the technical field of data sharing. The application effectively solves the problems of privacy leakage and compliance of data sharing across domains by constructing a national secret authorization system based on a block chain and an HDFS in-situ computer mechanism. The ownership and domain identifier are strictly checked by using the block chain combined with the national secret asymmetric encryption algorithm, the HDFS block position and other meta information are anchored on the chain, and the non-tamperable digital asset ownership is established. After checking the access certificate based on the temporary key of the national secret symmetric encryption algorithm generated on the chain, only the encrypted query logic is received and executed in the local HDFS, and only the calculation result checked by the national secret hash algorithm and encrypted by the national secret symmetric encryption algorithm is outputted. The architecture of the ciphertext logic in and the statistical result out truly realizes the data usability and invisibility and the sovereignty not being transferred due to sharing under the premise that the whole process meets the national secret compliance requirements.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data sharing technology, and in particular to a reliable data sharing method and apparatus. Background Technology

[0002] In building a collaborative architecture for multiple Hadoop data warehouses, to break down the barriers of physical storage domains, leveraging the content addressing capabilities of the InterPlanetary File System (IPFS) to index and host the HDFS metadata of the data warehouses, and combining this with the distributed ledger characteristics of blockchain technology to record asset ownership information, has become the mainstream paradigm for realizing cross-domain data asset registration. This architecture aims to build a trusted interaction bridge while maintaining the independence of each data warehouse by indexing on the blockchain and reserving data on-premises.

[0003] However, existing cross-domain interaction technologies mostly focus on application-layer API interface interfaces or low-level full-data encrypted transmission, lacking a deep binding mechanism between the HDFS underlying block storage location and the upper-layer blockchain ownership identification. Existing solutions often rely on centralized services to distribute static keys during the authorization process, failing to utilize blockchain to achieve dynamic signature verification based on communication whitelists and national cryptographic asymmetric encryption algorithms, as well as the generation of temporary keys for national cryptographic symmetric encryption algorithms. More importantly, conventional solutions cannot support ciphertext logic injection and local in-situ computation modes, resulting in the need to decrypt the original data or migrate it to computing nodes when performing complex queries, thus compromising the physical sovereignty boundaries of the data.

[0004] Therefore, how to construct a blockchain-driven dynamic authorization and in-situ computation response mechanism using full-link national cryptographic algorithms without exposing the physical location and content of the original HDFS data blocks has become an urgent problem to be solved in this field. Summary of the Invention

[0005] This invention provides a trusted data sharing method and apparatus to solve the technical problem of how to construct a blockchain-driven dynamic authorization and in-situ computation response mechanism using full-link national cryptographic algorithms without exposing the physical location and content of the original HDFS data blocks.

[0006] This invention provides a trusted data sharing method, applied to a first data warehouse, comprising:

[0007] Upload the metadata of the local data to be shared to the InterPlanetary File System (IPS) to obtain the index content identifier generated by the IPS; the metadata includes the data hash of the national cryptographic hash algorithm, the domain identifier of the first data warehouse, and the HDFS block location;

[0008] The ownership information, including the index content identifier, the data hash of the national cryptographic hash algorithm, the owner's account of the data to be shared, the domain identifier, the data access rules that do not leave the domain, and the signature value of the national cryptographic asymmetric encryption algorithm, is uploaded to the blockchain. This triggers the blockchain to use the national cryptographic asymmetric encryption algorithm to verify the legality of the owner's account and the domain identifier, and records the ownership information after the verification is passed.

[0009] The authorization information, including the index content identifier, the authorized party account of the second data warehouse, the authorization type, the de-identification rules, and the signature value of the national cryptographic asymmetric encryption algorithm, is uploaded to the blockchain. This triggers the blockchain to use the national cryptographic asymmetric encryption algorithm to verify whether the owner is the on-chain confirmation subject, whether the authorized party account is in the communication whitelist, and whether the authorization type is in the whitelist. After the verification is passed, an access credential containing the national cryptographic symmetric encryption algorithm temporary key is generated based on the national cryptographic asymmetric encryption algorithm. The access credential encrypted with the national cryptographic symmetric encryption algorithm is uploaded to the InterPlanetary File System (IPS) to obtain the credential content identifier generated by the IPS. The authorization information and the national cryptographic hash algorithm credential hash are recorded.

[0010] In response to a query request initiated by the second data warehouse containing an access credential signed with a national cryptographic asymmetric encryption algorithm and query logic encrypted with a national cryptographic symmetric encryption algorithm, the system uses a national cryptographic asymmetric encryption algorithm to verify the validity of the access credential signature, a national cryptographic hash algorithm to verify the completeness of the query logic, and the timeliness and legality of the query request. After the verification is passed, the system reads the data to be shared encrypted with a national cryptographic symmetric encryption algorithm from the HDFS block location, executes the query logic on the data to be shared, obtains the query result, and sends the query result, which is encrypted with a national cryptographic symmetric encryption algorithm and hash verified with a national cryptographic hash algorithm, to the second data warehouse.

[0011] The second data warehouse is used to query the credential content identifier from the blockchain based on the index content identifier and the authorized party account, download the access credential corresponding to the credential content identifier from the InterPlanetary File System, and decrypt the access credential using the private key of the Chinese national cryptographic asymmetric encryption algorithm.

[0012] According to the data trust sharing method provided by the present invention, the rights confirmation information also includes the rights confirmation time, and the authorization information also includes the authorization duration;

[0013] Verify the validity of the validity period, including:

[0014] The ownership confirmation time is queried from the blockchain based on the index content identifier, and the authorization duration is queried from the blockchain based on the index content identifier and the authorized party account.

[0015] Verify whether the time of initiating the query request is less than or equal to the sum of the time of confirmation of rights and the duration of authorization;

[0016] If the time of initiating the query request is less than or equal to the sum of the time of confirmation of rights and the duration of authorization, then the statute of limitations is valid.

[0017] According to a data trusted sharing method provided by the present invention, the method reads the data to be shared encrypted with the national standard symmetric encryption algorithm at the HDFS block location, and performs query logic on the data to be shared, including:

[0018] The local computing engine reads the data to be shared, which is encrypted using the national standard symmetric encryption algorithm at the location of the HDFS block, and executes query logic on the data to be shared.

[0019] According to the data trust sharing method provided by the present invention, the second data warehouse is also used to decrypt the encrypted query results using a temporary key of the national cryptographic symmetric encryption algorithm.

[0020] This invention also provides a trusted data sharing method, applied to a second data warehouse, comprising:

[0021] The credential content identifier is retrieved from the blockchain based on the index content identifier and the local authorized party account.

[0022] Download the access credential corresponding to the credential content identifier from the InterPlanetary File System, and decrypt the access credential using the private key of the Chinese national cryptographic asymmetric encryption algorithm.

[0023] Initiate a query request to the first data warehouse containing access credentials signed with the national cryptographic asymmetric encryption algorithm and query logic encrypted with the national cryptographic symmetric encryption algorithm;

[0024] Receive query results sent by the first data warehouse;

[0025] The first data warehouse is used to upload the metadata of the local data to be shared to the InterPlanetary File System (IPS) to obtain the index content identifier generated by the IPS; the metadata includes the data hash of the Chinese cryptographic hash algorithm, the domain identifier of the first data warehouse, and the HDFS block location;

[0026] The ownership information, including the index content identifier, the data hash of the national cryptographic hash algorithm, the owner's account of the data to be shared, the domain identifier, the data access rules that do not leave the domain, and the signature value of the national cryptographic asymmetric encryption algorithm, is uploaded to the blockchain. This triggers the blockchain to use the national cryptographic asymmetric encryption algorithm to verify the legality of the owner's account and the domain identifier, and records the ownership information after the verification is passed.

[0027] The authorization information, including the index content identifier, the authorized party account, the authorization type, the de-identification rules, and the signature value of the national cryptographic asymmetric encryption algorithm, is uploaded to the blockchain. This triggers the blockchain to use the national cryptographic asymmetric encryption algorithm to verify whether the owner is the on-chain subject of the rights confirmation, whether the authorized party account is in the communication whitelist, and whether the authorization type is in the whitelist. After the verification is passed, an access credential containing the national cryptographic symmetric encryption algorithm temporary key is generated based on the national cryptographic asymmetric encryption algorithm. The access credential encrypted with the national cryptographic symmetric encryption algorithm is uploaded to the InterPlanetary File System (IPS) to obtain the credential content identifier generated by the IPS. The authorization information and the national cryptographic hash algorithm credential hash are recorded.

[0028] In response to a query request initiated by the second data warehouse containing an access credential signed with a national cryptographic asymmetric encryption algorithm and query logic encrypted with a national cryptographic symmetric encryption algorithm, the system uses a national cryptographic asymmetric encryption algorithm to verify the validity of the access credential signature, a national cryptographic hash algorithm to verify the completeness of the query logic, and the timeliness and legality of the query request. After the verification is successful, the system reads the data to be shared, which is encrypted with a national cryptographic symmetric encryption algorithm at the HDFS block location, executes the query logic on the data to be shared, obtains the query result, and sends the query result, which is encrypted with a national cryptographic symmetric encryption algorithm and hashed with a national cryptographic hash algorithm, to the second data warehouse.

[0029] According to the data trusted sharing method provided by the present invention, the access credential includes the domain controller gateway address of the first data warehouse;

[0030] Initiate a query request to the first data warehouse containing access credentials signed with the national standard asymmetric encryption algorithm and query logic encrypted with the national standard symmetric encryption algorithm, including:

[0031] Initiate a query request to the first data warehouse domain controller gateway corresponding to the domain controller gateway address.

[0032] According to a data trusted sharing method provided by the present invention, after receiving the query result sent by the first data warehouse, the method further includes:

[0033] The encrypted query results are decrypted using a temporary key obtained through the national cryptographic symmetric encryption algorithm.

[0034] The present invention also provides a trusted data sharing device, applied to a first data warehouse, comprising:

[0035] The upload module is used to upload the metadata of local data to be shared to the InterPlanetary File System (IPS) to obtain the index content identifier generated by the IPS; the metadata includes the data hash of the Chinese cryptographic hash algorithm, the domain identifier of the first data warehouse, and the HDFS block location;

[0036] The ownership information, including the index content identifier, the data hash of the national cryptographic hash algorithm, the owner's account of the data to be shared, the domain identifier, the data access rules that do not leave the domain, and the signature value of the national cryptographic asymmetric encryption algorithm, is uploaded to the blockchain. This triggers the blockchain to use the national cryptographic asymmetric encryption algorithm to verify the legality of the owner's account and the domain identifier, and records the ownership information after the verification is passed.

[0037] The authorization information, including the index content identifier, the authorized party account of the second data warehouse, the authorization type, the de-identification rules, and the signature value of the national cryptographic asymmetric encryption algorithm, is uploaded to the blockchain. This triggers the blockchain to use the national cryptographic asymmetric encryption algorithm to verify whether the owner is the on-chain confirmation subject, whether the authorized party account is in the communication whitelist, and whether the authorization type is in the whitelist. After the verification is passed, an access credential containing the national cryptographic symmetric encryption algorithm temporary key is generated based on the national cryptographic asymmetric encryption algorithm. The access credential encrypted with the national cryptographic symmetric encryption algorithm is uploaded to the InterPlanetary File System (IPS) to obtain the credential content identifier generated by the IPS. The authorization information and the national cryptographic hash algorithm credential hash are recorded.

[0038] The execution module is used to respond to query requests initiated by the second data warehouse, which contain access credentials signed with a national cryptographic asymmetric encryption algorithm and query logic encrypted with a national cryptographic symmetric encryption algorithm. It uses a national cryptographic asymmetric encryption algorithm to verify the signature validity of the access credentials, uses a national cryptographic hash algorithm to verify the integrity of the query logic, and verifies the timeliness and legality of the query request. After the verification is passed, it reads the data to be shared encrypted with a national cryptographic symmetric encryption algorithm from the HDFS block location, executes the query logic on the data to be shared, obtains the query results, and sends the query results encrypted with a national cryptographic symmetric encryption algorithm and hash verified with a national cryptographic hash algorithm to the second data warehouse.

[0039] The second data warehouse is used to query the credential content identifier from the blockchain based on the index content identifier and the authorized party account, download the access credential corresponding to the credential content identifier from the InterPlanetary File System, and decrypt the access credential using the private key of the Chinese national cryptographic asymmetric encryption algorithm.

[0040] The present invention also provides a trusted data sharing device for use in a second data warehouse, comprising:

[0041] The query module is used to query the credential content identifier from the blockchain based on the index content identifier and the local authorized party account;

[0042] The download module is used to download the access credential corresponding to the credential content identifier from the InterPlanetary File System and decrypt the access credential using the private key of the Chinese national cryptographic asymmetric encryption algorithm.

[0043] The initiation module is used to initiate a query request to the first data warehouse, which includes an access credential signed with the national cryptographic asymmetric encryption algorithm and query logic encrypted with the national cryptographic symmetric encryption algorithm.

[0044] The receiving module is used to receive query results sent by the first data warehouse;

[0045] The first data warehouse is used to upload the metadata of the local data to be shared to the InterPlanetary File System (IPS) to obtain the index content identifier generated by the IPS; the metadata includes the data hash of the Chinese cryptographic hash algorithm, the domain identifier of the first data warehouse, and the HDFS block location;

[0046] The ownership information, including the index content identifier, the data hash of the national cryptographic hash algorithm, the owner's account of the data to be shared, the domain identifier, the data access rules that do not leave the domain, and the signature value of the national cryptographic asymmetric encryption algorithm, is uploaded to the blockchain. This triggers the blockchain to use the national cryptographic asymmetric encryption algorithm to verify the legality of the owner's account and the domain identifier, and records the ownership information after the verification is passed.

[0047] The authorization information, including the index content identifier, the authorized party account, the authorization type, the de-identification rules, and the signature value of the national cryptographic asymmetric encryption algorithm, is uploaded to the blockchain. This triggers the blockchain to use the national cryptographic asymmetric encryption algorithm to verify whether the owner is the on-chain subject of the rights confirmation, whether the authorized party account is in the communication whitelist, and whether the authorization type is in the whitelist. After the verification is passed, an access credential containing the national cryptographic symmetric encryption algorithm temporary key is generated based on the national cryptographic asymmetric encryption algorithm. The access credential encrypted with the national cryptographic symmetric encryption algorithm is uploaded to the InterPlanetary File System (IPS) to obtain the credential content identifier generated by the IPS. The authorization information and the national cryptographic hash algorithm credential hash are recorded.

[0048] In response to a query request initiated by the second data warehouse containing an access credential signed with a national cryptographic asymmetric encryption algorithm and query logic encrypted with a national cryptographic symmetric encryption algorithm, the system uses a national cryptographic asymmetric encryption algorithm to verify the validity of the access credential signature, a national cryptographic hash algorithm to verify the completeness of the query logic, and the timeliness and legality of the query request. After the verification is successful, the system reads the data to be shared, which is encrypted with a national cryptographic symmetric encryption algorithm at the HDFS block location, executes the query logic on the data to be shared, obtains the query result, and sends the query result, which is encrypted with a national cryptographic symmetric encryption algorithm and hashed with a national cryptographic hash algorithm, to the second data warehouse.

[0049] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement any of the data trusted sharing methods described above.

[0050] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the data trusted sharing methods described above.

[0051] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements any of the data trusted sharing methods described above.

[0052] This invention provides a trusted data sharing method and apparatus that effectively solves the privacy leakage and compliance challenges in cross-domain data sharing by constructing a blockchain-based national cryptographic authorization system and an HDFS in-situ computing mechanism. It utilizes blockchain combined with national cryptographic asymmetric encryption algorithms to rigorously verify the ownership and domain identifier, anchoring metadata such as HDFS block locations onto the chain, thus establishing immutable digital ownership of assets. Unlike traditional data transfer models, this invention employs a logic injection paradigm. The first data warehouse, after verifying the access credentials using a temporary key generated on-chain using national cryptographic symmetric encryption, only receives encrypted query logic and executes it in a closed loop at the local HDFS, outputting only the calculation results verified by national cryptographic hash algorithms and encrypted using national cryptographic symmetric encryption algorithms. This architecture, with encrypted logic entering and statistical results exiting, physically blocks the outflow of original data from the local storage domain while meeting national cryptographic compliance requirements throughout the entire process, truly achieving data usability without visibility and sovereignty not being transferred due to sharing. Attached Figure Description

[0053] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0054] Figure 1 This is a flowchart illustrating the data trust sharing method for a first data warehouse provided by the present invention.

[0055] Figure 2 This is a flowchart illustrating the trusted data sharing method for a second data warehouse provided by the present invention.

[0056] Figure 3 This is a schematic diagram of the structure of the trusted data sharing system provided by the present invention.

[0057] Figure 4 This is a schematic diagram of the structure of the trusted data sharing device for the first data warehouse provided by the present invention.

[0058] Figure 5 This is a schematic diagram of the data trust sharing device for a second data warehouse provided by the present invention.

[0059] Figure 6 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0060] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0061] IPFS (InterPlanetary File System) is a distributed file system based on a peer-to-peer (P2P) architecture, aiming to create a global network for file storage and retrieval, with broad application prospects. However, IPFS itself still faces some challenges, including a lack of mechanisms to guarantee data availability and confidentiality. IPFS itself does not have data encryption protection; data submitted to IPFS is public to all participating nodes, and IPFS data transmission in a blockchain environment faces the risk of data leakage.

[0062] With the development of Hadoop technology, based on its ability to process massive amounts of data, high scalability, low cost, and ability to collaborate with traditional data warehouses, Hadoop has evolved from its initial purpose of solving the problem of storing massive amounts of data to its current use by more and more enterprises to process big data. Most enterprises and institutions, and those involved in cross-organizational collaboration, have deployed their own Hadoop data warehouses, each storing proprietary business data, forming "data silos." Existing cross-domain data sharing solutions relying on Hadoop data warehouses have the following core shortcomings:

[0063] Data leaving the domain security risks: Traditional solutions achieve sharing through data migration and replication. The original data is transferred across domains and stored in the target data warehouse, which is prone to data leakage and tampering, violating the security compliance requirements of data leaving the domain.

[0064] Data ownership is ambiguous: the lack of a credible ownership determination mechanism leads to frequent disputes over data sovereignty after cross-domain sharing, and the source of the data cannot be traced.

[0065] Lack of trust mechanism: Cross-domain access authorization relies on centralized servers, access control is easily bypassed, access behavior has no immutable record, and the risk of tampering and unauthorized access is high;

[0066] Efficiency versus compatibility: Some solutions use centralized gateways to forward data, which presents single points of failure and bandwidth bottlenecks; and they are difficult to be compatible with the existing batch processing architecture of Hadoop data warehouses, resulting in high transformation costs.

[0067] In existing technologies, while IPFS can achieve distributed data distribution, it cannot guarantee that data will not leave its domain and lacks compatibility with national cryptographic algorithms and authorization mechanisms; although blockchain can provide immutable records, storing massive amounts of raw data is extremely costly, and international encryption algorithms do not meet the requirements of domestic IT innovation; federated computing can only solve cross-domain computing problems and lacks reliable authorization and traceability capabilities. Therefore, there is an urgent need for a cross-domain sharing solution for multiple Hadoop data warehouses that integrates the advantages of national cryptographic algorithms, blockchain, IPFS, and HDFS (Hadoop Distributed File System) to achieve data not leaving its domain, verifiable ownership, reliable authorization, traceable access, and compliance with domestic IT innovation requirements.

[0068] The following is combined Figures 1 to 6 The present invention describes a data trust sharing method and apparatus.

[0069] Figure 1 This is a flowchart illustrating the data trusted sharing method for a first data warehouse provided by the present invention, as shown below. Figure 1 As shown, the method includes, but is not limited to, steps S11, S12, S13 and S14.

[0070] Step S11: Upload the metadata of the local data to be shared to the InterPlanetary File System (IPS) to obtain the index content identifier generated by the IPS; the metadata includes the data hash of the national cryptographic hash algorithm (SM3 algorithm), the domain identifier of the first data warehouse, and the HDFS block location.

[0071] The local data to be shared is the data in the first data warehouse, which is encrypted using the national standard symmetric encryption algorithm (SM4 algorithm). The first data warehouse is the source data warehouse. The data to be shared can be a relational database table, an unstructured document, or an object storage file.

[0072] Metadata can include the hash of the national cryptographic hash algorithm, the domain identifier of the first data warehouse, and the HDFS block location. The Index Content Identifier (Index CID) is generated based on the file content of the data to be shared. It has content addressing characteristics; any tampering with the metadata will result in a change to the Index CID. The Index CID is a unique fingerprint of the data to be shared, used to uniquely identify the data without directly exposing its original content.

[0073] By using IPFS to store the metadata of the data to be shared and generating an index CID, the decentralized and tamper-proof characteristics of IPFS ensure the authenticity and integrity of the index information of the data to be shared. Even if the metadata is distributed to multiple nodes, the consistency of the content can be accurately addressed and verified through the index CID. This solves the problem that in the existing technology, the data index information is stored on a centralized server, which is prone to single point of failure, data loss, or malicious tampering that is difficult to detect.

[0074] Step S12 involves uploading the ownership information, which includes the index content identifier, the data hash of the national cryptographic hash algorithm, the owner's account of the data to be shared, the domain identifier, the data access rules that do not leave the domain, and the signature value of the national cryptographic asymmetric encryption algorithm (SM2 algorithm), to the blockchain. This triggers the blockchain to use the national cryptographic asymmetric encryption algorithm to verify the legality of the owner's account and the domain identifier, and records the ownership information after the verification is passed.

[0075] First Data Warehouse can initiate ownership confirmation transactions using its own national cryptographic asymmetric encryption algorithm blockchain private key signature. The ownership confirmation information, including index CID, national cryptographic hash algorithm hash of metadata, owner's account of the data to be shared, domain identifier of First Data Warehouse, data access rules without leaving the domain, ownership confirmation time, and ownership confirmation signature value of national cryptographic asymmetric encryption algorithm, is uploaded to the blockchain. The blockchain smart contract will use national cryptographic asymmetric encryption algorithm to verify the legality of the owner's identity signature and domain identifier, reject ownership confirmation requests from domains other than the data's domain, ensure that data sovereignty and domain rights are bound and cannot be transferred, form an immutable transaction record, and publicly declare that the data resource belongs to First Data Warehouse.

[0076] The immutable ledger nature of blockchain enables the digital confirmation of data assets. In the event of an infringement dispute, the data owner (owner's account and domain identifier) ​​and corresponding index CID can be clearly traced through on-chain records. This provides a solid foundation of trust for the circulation of data elements and solves the problem of unclear data ownership and difficulty in proving and determining liability in disputes caused by the lack of a reliable ownership registration mechanism for data assets in the existing data sharing environment.

[0077] Step S13: Upload the authorization information, which includes the index content identifier, the authorized party account of the second data warehouse, the authorization type, the de-identification rules, and the signature value of the national cryptographic asymmetric encryption algorithm, to the blockchain. This triggers the blockchain to use the national cryptographic asymmetric encryption algorithm to verify whether the owner is the on-chain rights holder, whether the authorized party account is in the communication whitelist, and whether the authorization type is in the whitelist. After the verification is passed, an access credential containing the national cryptographic symmetric encryption algorithm temporary key is generated based on the national cryptographic asymmetric encryption algorithm. The access credential encrypted by the national cryptographic symmetric encryption algorithm is uploaded to the InterPlanetary File System (IPS) to obtain the credential content identifier generated by the IPS. The authorization information and the national cryptographic hash algorithm credential hash are recorded.

[0078] The second data warehouse is the target data warehouse, and this invention requires sharing data from the first data warehouse with the second data warehouse. Both the first and second data warehouses can be computing devices, server clusters, or cloud database instances with data storage and computing capabilities.

[0079] The first data warehouse can initiate authorized transactions signed with the national cryptographic asymmetric encryption algorithm. It uploads authorization information, including the authorized party's account, index CID, authorization type (intra-domain read-only query / joint computation), authorization duration, de-identification rules, and the national cryptographic asymmetric encryption algorithm signature value, to the blockchain. The blockchain's smart contract uses the national cryptographic asymmetric encryption algorithm to verify whether the owner is the on-chain confirmed entity, whether the authorization type is on the whitelist, and whether the authorized party's account is on the communication whitelist. After the verification is successful, the smart contract generates a one-time temporary access credential containing the national cryptographic symmetric encryption algorithm temporary key based on the national cryptographic asymmetric encryption algorithm. After being encrypted with the national cryptographic symmetric encryption algorithm, it is uploaded to IPFS to generate a credential content identifier (credential CID), recording the authorization information and the national cryptographic hash algorithm credential hash.

[0080] The second data warehouse is used to query the credential content identifier from the blockchain based on the index content identifier and the authorized party account, download the access credential corresponding to the credential content identifier from the InterPlanetary File System, and decrypt the access credential using a private key of the Chinese national cryptographic asymmetric encryption algorithm.

[0081] By combining the transparent recording capabilities of blockchain with the large-capacity, low-cost storage capabilities of IPFS, it is possible to achieve public verifiability and non-repudiation of authorization relationships. This on-chain index and off-chain storage architecture greatly reduces transaction costs, improves system scalability, and solves the problem of lack of credibility in traditional peer-to-peer authorization.

[0082] Step S14: In response to the query request initiated by the second data warehouse, which includes an access credential signed with a national cryptographic asymmetric encryption algorithm and query logic encrypted with a national cryptographic symmetric encryption algorithm, the signature validity of the access credential is verified using a national cryptographic asymmetric encryption algorithm, the integrity of the query logic is verified using a national cryptographic hash algorithm, and the timeliness and legality of the query request are verified. After the verification is passed, the data to be shared encrypted with a national cryptographic symmetric encryption algorithm at the HDFS block location is read, the query logic is executed on the data to be shared, the query result is obtained, and the query result encrypted with a national cryptographic symmetric encryption algorithm and hash verified with a national cryptographic hash algorithm is sent to the second data warehouse.

[0083] Since the CID credential is unique, the access credential is also unique. Therefore, the second data warehouse can initiate a query request to the first data warehouse using the access credential. The query request carries the access credential signed with the national standard asymmetric encryption algorithm and the query logic encrypted with the national standard symmetric encryption algorithm.

[0084] The query logic can be SQL statements, federated learning algorithm code, or predefined stored procedures.

[0085] After receiving a query request, the first data warehouse verifies the request, including verifying the access credential signature using a national cryptographic asymmetric encryption algorithm, verifying the query logic hash using a national cryptographic hash algorithm, and verifying the validity and legality of the query request. After the verification is successful, it reads the data to be shared, which is encrypted with a national cryptographic symmetric encryption algorithm at the local HDFS block location, and executes the query logic on the data to be shared to obtain the query result. The query result, which is encrypted with a national cryptographic symmetric encryption algorithm and verified by a national cryptographic hash algorithm, is then sent to the second data warehouse to complete the data sharing.

[0086] As described above, the data trusted sharing method of this invention effectively solves the problems of privacy leakage and compliance in cross-domain data sharing by constructing a blockchain-based national cryptographic authorization system and an HDFS in-situ computing mechanism. By utilizing blockchain combined with national cryptographic asymmetric encryption algorithms to strictly verify the owner and domain identifier, and anchoring metadata such as HDFS block location onto the chain, it establishes immutable digital ownership of assets. Unlike traditional data transfer models, this invention adopts a logic injection paradigm. After verifying the access certificate based on the national cryptographic symmetric encryption algorithm temporary key generated on the chain, the first data warehouse only receives encrypted query logic and executes it in a closed loop at the local HDFS, only outputting the calculation results verified by the national cryptographic hash algorithm and encrypted by the national cryptographic symmetric encryption algorithm. This architecture of ciphertext logic in and statistical results out, while meeting national cryptographic compliance requirements throughout the entire process, physically blocks the outflow of original data from the local storage domain, truly achieving data usability without visibility and sovereignty not being transferred due to sharing.

[0087] In one embodiment, the confirmation information may further include the confirmation time, and the authorization information may further include the authorization duration;

[0088] In step S14, verifying the validity of the validity period may further include:

[0089] The ownership confirmation time is queried from the blockchain based on the index content identifier, and the authorization duration is queried from the blockchain based on the index content identifier and the authorized party account.

[0090] Verify whether the time of initiating the query request is less than or equal to the sum of the time of confirmation of rights and the duration of authorization;

[0091] If the time of initiating the query request is less than or equal to the sum of the time of confirmation of rights and the duration of authorization, then the statute of limitations is valid.

[0092] Uploading the index CID, the owner's account, and the domain identifier of the data to be shared to the blockchain is for rights confirmation, and the rights confirmation time can also be uploaded. Uploading the index CID and the authorized party's account to the blockchain is for authorization of the second data warehouse, and the authorization duration can also be uploaded. Therefore, after the second data warehouse initiates a query request, it needs to verify whether the authorization to the second data warehouse has expired, that is, whether the query request initiation time is less than or equal to the sum of the rights confirmation time and the authorization duration. If the query request initiation time is less than or equal to the sum of the rights confirmation time and the authorization duration, it means that the authorization to the second data warehouse is still valid, and the validity period verification passes, and the query logic can be executed. Both the rights confirmation time and the authorization duration need to be obtained from the blockchain. The rights confirmation time is bound to the index CID, and the authorization duration is bound to the index CID and the authorized party's account.

[0093] In this way, the present invention will only execute the query logic if the authorization for the second data warehouse is still valid, which can avoid data sharing with expired authorization.

[0094] In one embodiment, step S14, reading the data to be shared encrypted using the national standard symmetric encryption algorithm at the HDFS block location, and performing query logic on the data to be shared, may further include:

[0095] The local computing engine reads the data to be shared, which is encrypted using the national standard symmetric encryption algorithm at the location of the HDFS block, and executes query logic on the data to be shared.

[0096] The local computing engine enables the reading and local computation of data to be shared locally.

[0097] In one embodiment, the second data warehouse of the present invention can also be used to decrypt the encrypted query results using a temporary key of the national cryptographic symmetric encryption algorithm.

[0098] The first data warehouse can encrypt the query results using a national standard symmetric encryption algorithm and then hash them using a national standard hash algorithm. The query results are then sent to the second data warehouse via a national standard channel combining a national standard asymmetric encryption algorithm and a national standard symmetric encryption algorithm. After downloading access credentials from IPFS, the second data warehouse can decrypt the query results using a national standard symmetric encryption algorithm temporary key and then upload the hashed query results to the blockchain using a national standard hash algorithm.

[0099] This invention establishes an end-to-end secure data channel by pre-setting a temporary key in the access credentials and combining it with encrypted transmission technology. Even if the data packets transmitted over the network are intercepted, attackers will not be able to decrypt the content due to the lack of access credentials containing the key. This greatly improves the confidentiality and security of the results delivered during data sharing and solves the problem that query results may be leaked due to man-in-the-middle attacks, eavesdropping, or interception by unauthorized parties during network transmission.

[0100] Figure 2 This is a flowchart illustrating the data trust sharing method for a second data warehouse provided by the present invention, as shown below. Figure 2 As shown, the method includes, but is not limited to, steps S21, S22, S23 and S24.

[0101] Step S21: Query the credential content identifier from the blockchain based on the index content identifier and the local authorized party account.

[0102] Step S22: Download the access credential corresponding to the credential content identifier from the InterPlanetary File System, and decrypt the access credential using the private key of the Chinese national cryptographic asymmetric encryption algorithm.

[0103] Step S23: Initiate a query request to the first data warehouse containing an access credential signed with the national cryptographic asymmetric encryption algorithm and query logic encrypted with the national cryptographic symmetric encryption algorithm.

[0104] Step S24: Receive the query results sent by the first data warehouse.

[0105] The first data warehouse is used to upload the metadata of the local data to be shared to the InterPlanetary File System (IPS) to obtain the index content identifier generated by the IPS; the metadata includes the data hash of the Chinese cryptographic hash algorithm, the domain identifier of the first data warehouse, and the HDFS block location;

[0106] The ownership information, including the index content identifier, the data hash of the national cryptographic hash algorithm, the owner's account of the data to be shared, the domain identifier, the data access rules that do not leave the domain, and the signature value of the national cryptographic asymmetric encryption algorithm, is uploaded to the blockchain. This triggers the blockchain to use the national cryptographic asymmetric encryption algorithm to verify the legality of the owner's account and the domain identifier, and records the ownership information after the verification is passed.

[0107] The authorization information, including the index content identifier, the authorized party account, the authorization type, the de-identification rules, and the signature value of the national cryptographic asymmetric encryption algorithm, is uploaded to the blockchain. This triggers the blockchain to use the national cryptographic asymmetric encryption algorithm to verify whether the owner is the on-chain subject of the rights confirmation, whether the authorized party account is in the communication whitelist, and whether the authorization type is in the whitelist. After the verification is passed, an access credential containing the national cryptographic symmetric encryption algorithm temporary key is generated based on the national cryptographic asymmetric encryption algorithm. The access credential encrypted with the national cryptographic symmetric encryption algorithm is uploaded to the InterPlanetary File System (IPS) to obtain the credential content identifier generated by the IPS. The authorization information and the national cryptographic hash algorithm credential hash are recorded.

[0108] In response to a query request initiated by the second data warehouse containing an access credential signed with a national cryptographic asymmetric encryption algorithm and query logic encrypted with a national cryptographic symmetric encryption algorithm, the system uses a national cryptographic asymmetric encryption algorithm to verify the validity of the access credential signature, a national cryptographic hash algorithm to verify the completeness of the query logic, and the timeliness and legality of the query request. After the verification is successful, the system reads the data to be shared, which is encrypted with a national cryptographic symmetric encryption algorithm at the HDFS block location, executes the query logic on the data to be shared, obtains the query result, and sends the query result, which is encrypted with a national cryptographic symmetric encryption algorithm and hashed with a national cryptographic hash algorithm, to the second data warehouse.

[0109] The data trust sharing method applied to the second data warehouse is based on the same principle as the data trust sharing method applied to the first data warehouse, and will not be repeated here.

[0110] In one embodiment, the access credentials of the present invention may include the domain controller gateway address of the first data warehouse;

[0111] Step S23 may further include:

[0112] Initiate a query request to the first data warehouse domain controller gateway corresponding to the domain controller gateway address.

[0113] The second data warehouse initiates a query request to the domain controller gateway of the first data warehouse, therefore it needs to know the address of the first data warehouse's domain controller gateway. The access credentials of this invention carry the address of the first data warehouse's domain controller gateway, so that the second data warehouse, upon obtaining the access credentials, obtains the address of the first data warehouse's domain controller gateway, thereby enabling the initiation of the query request.

[0114] In one embodiment, after step S24, the following may also be included:

[0115] The encrypted query results are decrypted using a temporary key obtained through the national cryptographic symmetric encryption algorithm.

[0116] The data trust sharing method applied to the second data warehouse is based on the same principle as the data trust sharing method applied to the first data warehouse, and will not be repeated here.

[0117] like Figure 3 As shown, the present invention also provides a trusted data sharing system, comprising a source storage layer, a domain control security layer, a trusted index layer, a blockchain trust layer and an application layer connected in sequence. Each layer is deployed independently and works collaboratively, and the entire process uses national cryptographic algorithms to ensure security.

[0118] Source storage layer: Deploy independent Hadoop data warehouses (including HDFS storage nodes and local computing engines such as Spark / Flink) to store raw data and provide intra-domain computing capabilities; HDFS enables permission isolation and national cryptographic storage encryption (using national cryptographic symmetric encryption algorithm), allowing only the domain controller gateway of the domain controller security layer to access it, and prohibiting cross-domain copying of raw data.

[0119] Domain Controller Security Layer: Deployed at the network boundary of each data warehouse domain, including the domain controller gateway and the national cryptographic encryption transmission module; the domain controller gateway is configured with a communication whitelist (only authorized IPFS nodes and blockchain nodes are allowed to communicate), and has traffic auditing and original data transmission blocking functions, allowing only cross-domain query requests and query results; the national cryptographic encryption transmission module uses the national cryptographic asymmetric encryption algorithm elliptic curve cryptography algorithm for identity authentication, the national cryptographic symmetric encryption block cipher algorithm for data encryption, and the national cryptographic hash algorithm for data integrity verification, replacing the traditional TLS1.3, and building a national cryptographic compliant end-to-end encrypted transmission channel.

[0120] Trusted Index Layer: Deploys a dedicated IPFS node cluster and DHT routing for each domain. IPFS nodes do not store raw data, but only metadata and national cryptographic encryption access credentials. The metadata includes the HDFS block location, the national cryptographic hash algorithm hash, and the domain identifier, which are used to generate a unique index CID. The national cryptographic encryption access credentials are temporary authorization information generated by the blockchain smart contract based on the national cryptographic asymmetric encryption algorithm. After being encrypted by the national cryptographic symmetric encryption algorithm, they are stored and a credential CID is generated.

[0121] Blockchain Trust Layer: Deploys consortium blockchain nodes (1-2 per domain) and national cryptographic enhanced smart contracts. The consortium blockchain nodes use a suite of national cryptographic algorithms (national cryptographic asymmetric encryption algorithm for signature / verification, national cryptographic hash algorithm for hashing, and national cryptographic symmetric encryption algorithm for storage encryption) to maintain the distributed ledger and store data ownership information, domain rules, authorization records, and access logs. The national cryptographic enhanced smart contracts include a domain rights verification module, an authorization type whitelist module, a national cryptographic credential generation module, and a violation interception module, which solidifies the rule that data cannot leave the domain. All contract interactions use national cryptographic asymmetric encryption algorithm for signing.

[0122] Application Layer: Deploys a federated computing engine, a unified query gateway, and a national cryptographic auditing platform. The federated computing engine connects to the local computing engines of each domain, supporting cross-domain queries to be pushed to the source domain for execution and result aggregation. The unified query gateway provides SQL / API query entry points, and all query requests are signed using national cryptographic asymmetric encryption algorithms and encrypted using national cryptographic symmetric encryption algorithms. The national cryptographic auditing platform collects on-chain logs and domain controller gateway logs in real time, uses national cryptographic hash algorithms to verify log integrity, and achieves visual auditing and alerting.

[0123] This invention uses the example of "first data warehouse A authorizing second data warehouse B to query agricultural product sales data" to illustrate the process in detail, and the entire process adopts the national cryptographic algorithm.

[0124] Deployment phase:

[0125] Source storage layer: Data warehouse A's HDFS stores the data to be shared / user / data / sales, with national cryptographic symmetric encryption algorithm enabled for storage encryption and access control isolation, allowing only the domain controller gateway to access it; Spark is deployed as the local computing engine, adapted to the national cryptographic algorithm interface;

[0126] Domain control security layer: Deploy one national cryptographic-compatible domain control gateway in each of data warehouses A and B, configure a communication whitelist (including the other party's IPFS node, blockchain node, and query gateway IP), enable national cryptographic asymmetric encryption algorithm + national cryptographic symmetric encryption algorithm for encrypted transmission, and deploy a local national cryptographic audit agent.

[0127] Trusted Index Layer: Data warehouses A and B each deploy a 3-node IPFS cluster adapted to Chinese cryptographic standards, disable the original data storage function, and configure a Chinese cryptographic symmetric encryption algorithm encryption module (the key is managed by the blockchain smart contract).

[0128] Blockchain Trust Layer: Deploy a 4-node national cryptographic-compatible consortium blockchain (2 nodes each for data warehouse A and B), adopt a national cryptographic algorithm suite (national cryptographic asymmetric encryption algorithm / national cryptographic hash algorithm / national cryptographic symmetric encryption algorithm), deploy national cryptographic enhanced smart contracts, and initialize domain identifiers (domain A, domain B) and communication whitelists;

[0129] Application Layer: Deploy a national cryptographic-compatible federated computing engine, a unified query gateway (port 8088, supporting national cryptographic asymmetric encryption algorithm signature / national cryptographic symmetric encryption algorithm encryption), and a national cryptographic audit platform that connects to the consortium blockchain and domain controller gateway logs, using national cryptographic hash algorithms to verify log integrity.

[0130] Operation phase:

[0131] Data index generation: Data warehouse A adapter reads the metadata of / user / data / sales (national cryptographic hash algorithm data hash: 0x89a..., domain identifier: domain A, HDFS block location: datanode-1:9866), uploads it to IPFS to generate index CID: bafyxxx;

[0132] Confirmation of Rights on the Chain: Data Warehouse A adapter uses the private key of the national cryptographic asymmetric encryption algorithm to sign and initiate a confirmation of rights transaction, and records the following on the chain: {Index CID: bafyxxx, National cryptographic hash algorithm data hash: 0x89a..., Owner account: account-A, Domain identifier: Domain A, Access rule: Calculation within the domain only, Confirmation of Rights time: t1, National cryptographic asymmetric encryption algorithm signature: 0xabc...};

[0133] Authorization on-chain: Data warehouse A initiates an authorization transaction, specifying the authorized party account: account-B, index CID, authorization type: read-only query, authorization duration: 24h, and de-identification rule: the amount is not de-identified. The transaction is signed with the national cryptographic asymmetric encryption algorithm and then uploaded to the blockchain; the smart contract generates a temporary access certificate (containing the national cryptographic symmetric encryption algorithm temporary key: 0xdef..., source domain controller gateway address), which is encrypted with the national cryptographic symmetric encryption algorithm and uploaded to IPFS to generate the certificate CID: bafyzzz. The authorization relationship and the national cryptographic hash algorithm certificate hash are recorded on the chain: 0x789...;

[0134] Cross-domain query:

[0135] Data warehouse B initiates a request through the unified query gateway:

[0136] SELECT sum(amount) FROM ipfs: / / bafyxxx WHERE date='2025-12', specifying index CID, requests signature using the national cryptographic asymmetric encryption algorithm and encryption using the national cryptographic symmetric encryption algorithm;

[0137] Data Warehouse B adapter queries the blockchain to obtain the credential CID: bafyzzz, downloads the encrypted credential from IPFS, and decrypts it with its own national cryptographic asymmetric encryption algorithm private key to obtain the national cryptographic symmetric encryption algorithm temporary key and access credential.

[0138] Data warehouse B initiates a query request to the data warehouse A domain controller gateway at the source domain controller gateway address, carrying an access credential signed with the national cryptographic asymmetric encryption algorithm and query logic encrypted with the national cryptographic symmetric encryption algorithm;

[0139] The domain controller gateway uses the national cryptographic asymmetric encryption algorithm to verify the credential signature, the national cryptographic hash algorithm to verify the query logical hash, and the validity of the time limit (query request initiation time t2≤t1+24h), where t1 is the authorization time and 24h is the authorization duration; after the verification is successful, it is forwarded to the Spark engine of data warehouse A.

[0140] The Spark engine reads the HDFS data encrypted with the national cryptographic symmetric encryption algorithm at the local HDFS block location and performs a query, obtaining the result sum(amount)=1000000, which is then encrypted with the national cryptographic symmetric encryption algorithm and hashed with the national cryptographic hash algorithm (0x345...).

[0141] The encryption result is returned to data warehouse B through the national cryptographic asymmetric encryption algorithm + national cryptographic symmetric encryption algorithm national cryptographic channel. Data warehouse B decrypts it using the national cryptographic symmetric encryption algorithm temporary key, and the result is hashed by the national cryptographic hash algorithm with 0x345... and then uploaded to the blockchain.

[0142] Audit traceability: The national cryptographic audit platform shows the entire chain of "data warehouse A rights confirmation - data warehouse B authorization - data warehouse B access - result return". The on-chain logs are signed by the national cryptographic asymmetric encryption algorithm and verified by the national cryptographic hash algorithm, which is tamper-proof and has no original data cross-domain transmission records.

[0143] In summary, this invention employs national cryptographic algorithms—including asymmetric encryption, hashing, and symmetric encryption—to achieve encrypted transmission, storage, signing, and verification. It binds data ownership and domain rights through a "sovereignty-domain dual ownership confirmation mechanism," distributes data indexes and national cryptographic encryption credentials using IPFS, and implements trusted authorization and access traceability through blockchain-based enhanced smart contracts. Domain control gateways and federated computing ensure that original data does not leave the domain, and computations are performed only within the source domain, returning national cryptographic encrypted results. This invention addresses the data security risks, ambiguous ownership, lack of trust, and insufficient adaptation to domestic IT innovation in existing multi-Hadoop data warehouse cross-domain sharing. It achieves data not leaving the domain, verifiable sovereignty, trusted authorization, traceable access, and compliance with domestic IT innovation, adapting to cross-organizational compliant collaboration scenarios, and is compatible with existing data warehouse architectures, possessing high security, practicality, and compliance.

[0144] The trusted data sharing device provided by the present invention is described below. The trusted data sharing device described below and the trusted data sharing method described above can be referred to in correspondence.

[0145] like Figure 4 As shown, the data trusted sharing device for a first data warehouse provided by the present invention includes:

[0146] The upload module is used to upload the metadata of local data to be shared to the InterPlanetary File System (IPS) to obtain the index content identifier generated by the IPS; the metadata includes the data hash of the Chinese cryptographic hash algorithm, the domain identifier of the first data warehouse, and the HDFS block location;

[0147] The ownership information, including the index content identifier, the data hash of the national cryptographic hash algorithm, the owner's account of the data to be shared, the domain identifier, the data access rules that do not leave the domain, and the signature value of the national cryptographic asymmetric encryption algorithm, is uploaded to the blockchain. This triggers the blockchain to use the national cryptographic asymmetric encryption algorithm to verify the legality of the owner's account and the domain identifier, and records the ownership information after the verification is passed.

[0148] The authorization information, including the index content identifier, the authorized party account of the second data warehouse, the authorization type, the de-identification rules, and the signature value of the national cryptographic asymmetric encryption algorithm, is uploaded to the blockchain. This triggers the blockchain to use the national cryptographic asymmetric encryption algorithm to verify whether the owner is the on-chain confirmation subject, whether the authorized party account is in the communication whitelist, and whether the authorization type is in the whitelist. After the verification is passed, an access credential containing the national cryptographic symmetric encryption algorithm temporary key is generated based on the national cryptographic asymmetric encryption algorithm. The access credential encrypted with the national cryptographic symmetric encryption algorithm is uploaded to the InterPlanetary File System (IPS) to obtain the credential content identifier generated by the IPS. The authorization information and the national cryptographic hash algorithm credential hash are recorded.

[0149] The execution module is used to respond to query requests initiated by the second data warehouse, which contain access credentials signed with a national cryptographic asymmetric encryption algorithm and query logic encrypted with a national cryptographic symmetric encryption algorithm. It uses a national cryptographic asymmetric encryption algorithm to verify the signature validity of the access credentials, uses a national cryptographic hash algorithm to verify the integrity of the query logic, and verifies the timeliness and legality of the query request. After the verification is passed, it reads the data to be shared encrypted with a national cryptographic symmetric encryption algorithm from the HDFS block location, executes the query logic on the data to be shared, obtains the query results, and sends the query results encrypted with a national cryptographic symmetric encryption algorithm and hash verified with a national cryptographic hash algorithm to the second data warehouse.

[0150] The second data warehouse is used to query the credential content identifier from the blockchain based on the index content identifier and the authorized party account, download the access credential corresponding to the credential content identifier from the InterPlanetary File System, and decrypt the access credential using the private key of the Chinese national cryptographic asymmetric encryption algorithm.

[0151] like Figure 5 As shown, the data trusted sharing device for a second data warehouse provided by the present invention includes:

[0152] The query module is used to query the credential content identifier from the blockchain based on the index content identifier and the local authorized party account;

[0153] The download module is used to download the access credential corresponding to the credential content identifier from the InterPlanetary File System and decrypt the access credential using the private key of the Chinese national cryptographic asymmetric encryption algorithm.

[0154] The initiation module is used to initiate a query request to the first data warehouse, which includes an access credential signed with the national cryptographic asymmetric encryption algorithm and query logic encrypted with the national cryptographic symmetric encryption algorithm.

[0155] The receiving module is used to receive query results sent by the first data warehouse;

[0156] The first data warehouse is used to upload the metadata of the local data to be shared to the InterPlanetary File System (IPS) to obtain the index content identifier generated by the IPS; the metadata includes the data hash of the Chinese cryptographic hash algorithm, the domain identifier of the first data warehouse, and the HDFS block location;

[0157] The ownership information, including the index content identifier, the data hash of the national cryptographic hash algorithm, the owner's account of the data to be shared, the domain identifier, the data access rules that do not leave the domain, and the signature value of the national cryptographic asymmetric encryption algorithm, is uploaded to the blockchain. This triggers the blockchain to use the national cryptographic asymmetric encryption algorithm to verify the legality of the owner's account and the domain identifier, and records the ownership information after the verification is passed.

[0158] The authorization information, including the index content identifier, the authorized party account, the authorization type, the de-identification rules, and the signature value of the national cryptographic asymmetric encryption algorithm, is uploaded to the blockchain. This triggers the blockchain to use the national cryptographic asymmetric encryption algorithm to verify whether the owner is the on-chain subject of the rights confirmation, whether the authorized party account is in the communication whitelist, and whether the authorization type is in the whitelist. After the verification is passed, an access credential containing the national cryptographic symmetric encryption algorithm temporary key is generated based on the national cryptographic asymmetric encryption algorithm. The access credential encrypted with the national cryptographic symmetric encryption algorithm is uploaded to the InterPlanetary File System (IPS) to obtain the credential content identifier generated by the IPS. The authorization information and the national cryptographic hash algorithm credential hash are recorded.

[0159] In response to a query request initiated by the second data warehouse containing an access credential signed with a national cryptographic asymmetric encryption algorithm and query logic encrypted with a national cryptographic symmetric encryption algorithm, the system uses a national cryptographic asymmetric encryption algorithm to verify the validity of the access credential signature, a national cryptographic hash algorithm to verify the completeness of the query logic, and the timeliness and legality of the query request. After the verification is successful, the system reads the data to be shared, which is encrypted with a national cryptographic symmetric encryption algorithm at the HDFS block location, executes the query logic on the data to be shared, obtains the query result, and sends the query result, which is encrypted with a national cryptographic symmetric encryption algorithm and hashed with a national cryptographic hash algorithm, to the second data warehouse.

[0160] Figure 6 The diagram illustrates the physical structure of an electronic device, which may include a processor, a communications interface, memory, and a communication bus. The processor, communications interface, and memory communicate with each other via the communication bus. The processor can invoke logical instructions from the memory to execute a trusted data sharing method.

[0161] Furthermore, the logical instructions in the aforementioned memory can be implemented as software functional units and sold or used as independent products, and can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0162] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer is able to execute the data trust sharing method provided by the above methods.

[0163] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to perform the data trust sharing methods provided by the above methods.

[0164] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0165] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of various embodiments or some parts of embodiments.

[0166] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A trusted data sharing method, applied to a first data warehouse, characterized in that, include: Upload the metadata of the local data to be shared to the InterPlanetary File System (IPS) to obtain the index content identifier generated by the IPS; the metadata includes the data hash of the national cryptographic hash algorithm, the domain identifier of the first data warehouse, and the HDFS block location; The ownership information, including the index content identifier, the data hash of the national cryptographic hash algorithm, the owner's account of the data to be shared, the domain identifier, the data access rules that do not leave the domain, and the signature value of the national cryptographic asymmetric encryption algorithm, is uploaded to the blockchain. This triggers the blockchain to use the national cryptographic asymmetric encryption algorithm to verify the legality of the owner's account and the domain identifier, and records the ownership information after the verification is passed. The authorization information, including the index content identifier, the authorized party account of the second data warehouse, the authorization type, the de-identification rules, and the signature value of the national cryptographic asymmetric encryption algorithm, is uploaded to the blockchain. This triggers the blockchain to use the national cryptographic asymmetric encryption algorithm to verify whether the owner is the on-chain confirmation subject, whether the authorized party account is in the communication whitelist, and whether the authorization type is in the whitelist. After the verification is passed, an access credential containing the national cryptographic symmetric encryption algorithm temporary key is generated based on the national cryptographic asymmetric encryption algorithm. The access credential encrypted with the national cryptographic symmetric encryption algorithm is uploaded to the InterPlanetary File System (IPS) to obtain the credential content identifier generated by the IPS. The authorization information and the national cryptographic hash algorithm credential hash are recorded. In response to a query request initiated by the second data warehouse containing an access credential signed with a national cryptographic asymmetric encryption algorithm and query logic encrypted with a national cryptographic symmetric encryption algorithm, the system uses a national cryptographic asymmetric encryption algorithm to verify the validity of the access credential signature, a national cryptographic hash algorithm to verify the completeness of the query logic, and the timeliness and legality of the query request. After the verification is passed, the system reads the data to be shared encrypted with a national cryptographic symmetric encryption algorithm from the HDFS block location, executes the query logic on the data to be shared, obtains the query result, and sends the query result, which is encrypted with a national cryptographic symmetric encryption algorithm and hash verified with a national cryptographic hash algorithm, to the second data warehouse. The second data warehouse is used to query the credential content identifier from the blockchain based on the index content identifier and the authorized party account, download the access credential corresponding to the credential content identifier from the InterPlanetary File System, and decrypt the access credential using the private key of the Chinese national cryptographic asymmetric encryption algorithm.

2. The data trusted sharing method according to claim 1, characterized in that, The information on the confirmation of rights also includes the time of confirmation of rights, and the information on the authorization also includes the duration of the authorization; Verify the validity of the validity period, including: The ownership confirmation time is queried from the blockchain based on the index content identifier, and the authorization duration is queried from the blockchain based on the index content identifier and the authorized party account. Verify whether the time of initiating the query request is less than or equal to the sum of the time of confirmation of rights and the duration of authorization; If the time of initiating the query request is less than or equal to the sum of the time of confirmation of rights and the duration of authorization, then the statute of limitations is valid.

3. The data trusted sharing method according to claim 1, characterized in that, Read the data to be shared, encrypted with the national standard symmetric encryption algorithm at the HDFS block location, and execute query logic on the data to be shared, including: The local computing engine reads the data to be shared, which is encrypted using the national standard symmetric encryption algorithm at the location of the HDFS block, and executes query logic on the data to be shared.

4. The data trusted sharing method according to claim 1, characterized in that, The second data warehouse is also used to decrypt encrypted query results using a temporary key obtained through the national cryptographic symmetric encryption algorithm.

5. A trusted data sharing method, applied to a second data warehouse, characterized in that, include: The credential content identifier is retrieved from the blockchain based on the index content identifier and the local authorized party account. Download the access credential corresponding to the credential content identifier from the InterPlanetary File System, and decrypt the access credential using the private key of the Chinese national cryptographic asymmetric encryption algorithm. Initiate a query request to the first data warehouse containing access credentials signed with the national cryptographic asymmetric encryption algorithm and query logic encrypted with the national cryptographic symmetric encryption algorithm; Receive query results sent by the first data warehouse; The first data warehouse is used to upload the metadata of the local data to be shared to the InterPlanetary File System (IPS) to obtain the index content identifier generated by the IPS; the metadata includes the data hash of the Chinese cryptographic hash algorithm, the domain identifier of the first data warehouse, and the HDFS block location; The ownership information, including the index content identifier, the data hash of the national cryptographic hash algorithm, the owner's account of the data to be shared, the domain identifier, the data access rules that do not leave the domain, and the signature value of the national cryptographic asymmetric encryption algorithm, is uploaded to the blockchain. This triggers the blockchain to use the national cryptographic asymmetric encryption algorithm to verify the legality of the owner's account and the domain identifier, and records the ownership information after the verification is passed. The authorization information, including the index content identifier, the authorized party account, the authorization type, the de-identification rules, and the signature value of the national cryptographic asymmetric encryption algorithm, is uploaded to the blockchain. This triggers the blockchain to use the national cryptographic asymmetric encryption algorithm to verify whether the owner is the on-chain subject of the rights confirmation, whether the authorized party account is in the communication whitelist, and whether the authorization type is in the whitelist. After the verification is passed, an access credential containing the national cryptographic symmetric encryption algorithm temporary key is generated based on the national cryptographic asymmetric encryption algorithm. The access credential encrypted with the national cryptographic symmetric encryption algorithm is uploaded to the InterPlanetary File System (IPS) to obtain the credential content identifier generated by the IPS. The authorization information and the national cryptographic hash algorithm credential hash are recorded. In response to a query request initiated by the second data warehouse containing an access credential signed with a national cryptographic asymmetric encryption algorithm and query logic encrypted with a national cryptographic symmetric encryption algorithm, the system uses a national cryptographic asymmetric encryption algorithm to verify the validity of the access credential signature, a national cryptographic hash algorithm to verify the completeness of the query logic, and the timeliness and legality of the query request. After the verification is successful, the system reads the data to be shared, which is encrypted with a national cryptographic symmetric encryption algorithm at the HDFS block location, executes the query logic on the data to be shared, obtains the query result, and sends the query result, which is encrypted with a national cryptographic symmetric encryption algorithm and hashed with a national cryptographic hash algorithm, to the second data warehouse.

6. The data trust sharing method according to claim 5, characterized in that, Access credentials include the domain controller gateway address of the first data warehouse; Initiate a query request to the first data warehouse containing access credentials signed with the national standard asymmetric encryption algorithm and query logic encrypted with the national standard symmetric encryption algorithm, including: Initiate a query request to the first data warehouse domain controller gateway corresponding to the domain controller gateway address.

7. The data trusted sharing method according to claim 5, characterized in that, After receiving the query results sent by the first data warehouse, it also includes: The encrypted query results are decrypted using a temporary key obtained through the national cryptographic symmetric encryption algorithm.

8. A trusted data sharing device, applied to a first data warehouse, characterized in that, include: The upload module is used to upload the metadata of local data to be shared to the InterPlanetary File System (IPS) to obtain the index content identifier generated by the IPS; the metadata includes the data hash of the Chinese cryptographic hash algorithm, the domain identifier of the first data warehouse, and the HDFS block location; The ownership information, including the index content identifier, the data hash of the national cryptographic hash algorithm, the owner's account of the data to be shared, the domain identifier, the data access rules that do not leave the domain, and the signature value of the national cryptographic asymmetric encryption algorithm, is uploaded to the blockchain. This triggers the blockchain to use the national cryptographic asymmetric encryption algorithm to verify the legality of the owner's account and the domain identifier, and records the ownership information after the verification is passed. The authorization information, including the index content identifier, the authorized party account of the second data warehouse, the authorization type, the de-identification rules, and the signature value of the national cryptographic asymmetric encryption algorithm, is uploaded to the blockchain. This triggers the blockchain to use the national cryptographic asymmetric encryption algorithm to verify whether the owner is the on-chain confirmation subject, whether the authorized party account is in the communication whitelist, and whether the authorization type is in the whitelist. After the verification is passed, an access credential containing the national cryptographic symmetric encryption algorithm temporary key is generated based on the national cryptographic asymmetric encryption algorithm. The access credential encrypted with the national cryptographic symmetric encryption algorithm is uploaded to the InterPlanetary File System (IPS) to obtain the credential content identifier generated by the IPS. The authorization information and the national cryptographic hash algorithm credential hash are recorded. The execution module is used to respond to query requests initiated by the second data warehouse, which contain access credentials signed with a national cryptographic asymmetric encryption algorithm and query logic encrypted with a national cryptographic symmetric encryption algorithm. It uses a national cryptographic asymmetric encryption algorithm to verify the signature validity of the access credentials, uses a national cryptographic hash algorithm to verify the integrity of the query logic, and verifies the timeliness and legality of the query request. After the verification is passed, it reads the data to be shared encrypted with a national cryptographic symmetric encryption algorithm from the HDFS block location, executes the query logic on the data to be shared, obtains the query results, and sends the query results encrypted with a national cryptographic symmetric encryption algorithm and hash verified with a national cryptographic hash algorithm to the second data warehouse. The second data warehouse is used to query the credential content identifier from the blockchain based on the index content identifier and the authorized party account, download the access credential corresponding to the credential content identifier from the InterPlanetary File System, and decrypt the access credential using the private key of the Chinese national cryptographic asymmetric encryption algorithm.

9. A trusted data sharing device, applied to a second data warehouse, characterized in that, include: The query module is used to query the credential content identifier from the blockchain based on the index content identifier and the local authorized party account; The download module is used to download the access credential corresponding to the credential content identifier from the InterPlanetary File System and decrypt the access credential using the private key of the Chinese national cryptographic asymmetric encryption algorithm. The initiation module is used to initiate a query request to the first data warehouse, which includes an access credential signed with the national cryptographic asymmetric encryption algorithm and query logic encrypted with the national cryptographic symmetric encryption algorithm. The receiving module is used to receive query results sent by the first data warehouse; The first data warehouse is used to upload the metadata of the local data to be shared to the InterPlanetary File System (IPS) to obtain the index content identifier generated by the IPS; the metadata includes the data hash of the Chinese cryptographic hash algorithm, the domain identifier of the first data warehouse, and the HDFS block location; The ownership information, including the index content identifier, the data hash of the national cryptographic hash algorithm, the owner's account of the data to be shared, the domain identifier, the data access rules that do not leave the domain, and the signature value of the national cryptographic asymmetric encryption algorithm, is uploaded to the blockchain. This triggers the blockchain to use the national cryptographic asymmetric encryption algorithm to verify the legality of the owner's account and the domain identifier, and records the ownership information after the verification is passed. The authorization information, including the index content identifier, the authorized party account, the authorization type, the de-identification rules, and the signature value of the national cryptographic asymmetric encryption algorithm, is uploaded to the blockchain. This triggers the blockchain to use the national cryptographic asymmetric encryption algorithm to verify whether the owner is the on-chain subject of the rights confirmation, whether the authorized party account is in the communication whitelist, and whether the authorization type is in the whitelist. After the verification is passed, an access credential containing the national cryptographic symmetric encryption algorithm temporary key is generated based on the national cryptographic asymmetric encryption algorithm. The access credential encrypted with the national cryptographic symmetric encryption algorithm is uploaded to the InterPlanetary File System (IPS) to obtain the credential content identifier generated by the IPS. The authorization information and the national cryptographic hash algorithm credential hash are recorded. In response to a query request initiated by the second data warehouse containing an access credential signed with a national cryptographic asymmetric encryption algorithm and query logic encrypted with a national cryptographic symmetric encryption algorithm, the system uses a national cryptographic asymmetric encryption algorithm to verify the validity of the access credential signature, a national cryptographic hash algorithm to verify the completeness of the query logic, and the timeliness and legality of the query request. After the verification is successful, the system reads the data to be shared, which is encrypted with a national cryptographic symmetric encryption algorithm at the HDFS block location, executes the query logic on the data to be shared, obtains the query result, and sends the query result, which is encrypted with a national cryptographic symmetric encryption algorithm and hashed with a national cryptographic hash algorithm, to the second data warehouse.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, The processor implements the trusted data sharing method as described in any one of claims 1 to 7 when executing a computer program.