Medical data safe and credible sharing method based on block chain and differential privacy

Through a hierarchical system architecture and improved Bayesian network structure learning, combined with differential privacy mechanism and blockchain smart contracts, the problems of privacy leakage and high computational cost in high-dimensional medical data sharing are solved, secure and reliable data sharing and access control are achieved, and the scalability of the system and data practicality are improved.

CN120785518APending Publication Date: 2025-10-14YUNNAN UNIVERSITY OF FINANCE AND ECONOMICS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511119298.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-11
Publication Date
2025-10-14

AI Technical Summary

Technical Problem

Existing technologies have problems in high-dimensional medical data sharing, such as privacy leakage risks, high computational costs, uneven distribution of privacy budgets, and insufficient flexibility of blockchain smart contracts, which affect the security and effectiveness of data sharing.

Method used

It adopts a layered system architecture, combined with improved Bayesian network structure learning and differential privacy mechanism, realizes fine-grained access control through blockchain smart contracts, dynamically adjusts privacy budget and access strategy, and ensures the security and reliability of data sharing.

Benefits of technology

It achieves privacy protection and trusted access control of high-dimensional medical data, improves the security, controllability and traceability of data sharing, and optimizes system scalability and data practicality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120785518A_ABST
    Figure CN120785518A_ABST
Patent Text Reader

Abstract

The invention discloses a medical data safe and credible sharing method based on a block chain and differential privacy, and the method employs a layered system architecture which comprises a data access layer, an access control layer, a differential privacy layer, and a data storage layer. And receiving, verifying, processing and responding to the access request are completed respectively. According to the method, the dynamic Bayesian network is designed and realized to capture the complex relationship between the attributes, and a privacy budget allocation strategy realized by comprehensive sensitivity driving is provided, so that the privacy protection strength is ensured while the data availability is improved. Dynamic and fine-grained authority management is realized based on the introduction of access control realized by the smart contract. Therefore, the privacy security of the medical data in the on-chain sharing process is effectively guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a medical data security algorithm, and in particular to a medical data security and trustworthy sharing method based on blockchain and differential privacy. Background Art

[0002] With the rapid growth of medical data and the widespread collection of multi-source heterogeneous data, how to securely share high-dimensional sensitive data while protecting user privacy has become a key research topic in the fields of intelligent healthcare and data governance. Ensuring the privacy and integrity of high-dimensional sensitive information, as well as the practicality of data during sharing, is crucial for protecting medical data privacy.

[0003] Differential privacy methods have achieved initial success in high-dimensional data publishing and blockchain scenarios, but existing solutions still face three key issues: First, modeling methods such as Bayesian networks suffer from node selection uncertainty during the structural learning process, which can easily lead to privacy leaks and fluctuations in data availability; the algorithms are complex, communication costs are high, and they rely on prior knowledge. Second, privacy budget allocation strategies lack a systematic design, making it difficult to achieve a dynamic balance between protection strength and data utility; third, the integration of differential privacy mechanisms with blockchain smart contracts is not yet close, ignoring the high on-chain computing overhead, storage costs, and the need for flexibility in contract-level privacy policy configuration. These issues collectively restrict the widespread application and performance optimization of differential privacy in high-dimensional medical data sharing within the blockchain environment. Summary of the Invention

[0004] This paper proposes a secure and trusted medical data sharing method based on blockchain and differential privacy. This protection scheme addresses the high computational costs of blockchain, the trade-off between data privacy and utility during the release of high-dimensional data, and the uneven distribution of privacy budgets within differential privacy mechanisms. By integrating improved Bayesian network structure learning, differential privacy, and blockchain smart contract mechanisms, a secure medical data sharing framework is constructed. This innovative approach achieves privacy protection and trusted access control for high-dimensional sensitive medical data, improving the reliability and utility of data sharing.

[0005] This paper proposes a secure and trustworthy medical data sharing method based on blockchain and differential privacy. It adopts a layered system architecture, including a data requester (DR), an access control layer (AC), a differential privacy layer (DP), and a data storage layer (DS). These layers receive, verify, process, and respond to access requests respectively.

[0006] Data requester DR: The data requester initiates a query request to the system through a blockchain address, the system receives and encapsulates the user query and its identity credential information, and submits it as a transaction input to the smart contract of the access control layer to start the transaction and initiate the access process;

[0007] Access control layer AC: When the access request is issued, the smart contract verifies the legality of the access address: if the address has been marked as abnormal or denied access due to violation of rules, the system will directly reject the request and record it in the log, and at the same time, the address will be listed in the blacklist; if the verification is passed, the corresponding access credential is granted for the subsequent authorized execution of data request;

[0008] Differential privacy layer DP: This layer will feed back the sensitivity index and privacy budget consumption state to the access control module in real time for dynamic adjustment of access authorization strategy;

[0009] Data storage layer DS: It is the bottom support module of the system, responsible for the management and scheduling of raw medical data, and according to the requirements of access control and privacy protection, it migrates the data to be processed from the edge node to the differential privacy layer, and completes the data calling and publishing.

[0010] Preferably, the access control layer AC introduces a differential privacy feedback mechanism on the basis of traditional attribute-based access control ABAC, the access control strategy is realized through the smart contract deployed on the alliance chain, and the data requester can initiate a query request by calling the requestPrivacyData function, and the access control process includes four stages: initialization stage, data sharing stage, log management stage, and permission revocation stage.

[0011] In the initialization stage, each medical institution needs to apply for a certificate for each entity OB that joins the network, the OB is an entity object that needs to be accessed or protected in the system, in the medical data sharing system in this paper, OB refers to an entity object that joins the network, which can be a medical data access subject (such as a doctor, a researcher, a patient), or a system account / node related to data access, this entity will be assigned attributes (such as identity, role, organization, privacy budget, access frequency, etc.), and these attributes will be used for strategy matching in access control), needs to apply for a certificate to CA, the CA is a certificate authority responsible for issuing digital certificates for entity OB, the certificate contains the attribute description of the entity (such as identity, role, permission, etc.), which is used for subsequent access control and on-chain verification. The certificate contains the description of the OB attributes;

[0012] In the data sharing stage, the smart contract is called to create an Rxrequest transaction, the specific formula is:

[0013]

[0014] The requested data can be uniquely identified by RID, which is a Resource ID. In the data sharing stage, it is used to uniquely identify the data request target and ensure the accurate location of the accessed data resources in the chain and differential privacy module. DR is the data accessor, which can be medical institutions at all levels, scientific research institutions and other entities with legitimate data access needs. It is necessary to provide a description of the accessed data and the purpose of the access. First, through the DR's attribute set Verify its attributes and the legitimacy of its access purpose. It then extracts parameters related to the requested data attributes, including frequency and attribute sensitivity, and passes them to the differential privacy module. Datades stands for Data Description. The data requester's brief description of the target data and access purpose in the access request is used by the access control module to determine the legitimacy and rationality of the access request.

[0015] The differential privacy module dynamically updates the Bayesian network structure based on these parameters and recalculates the Maximum Information Coefficient (MIC) value for each attribute. Combined with the current privacy budget allocation strategy, the module feeds the analysis results back to the access control layer. Subsequently, the access control smart contract quantitatively assesses the sensitivity of the target data based on the MIC value and the access purpose, and grants the corresponding access rights, i.e., access credentials. The requester holding this credential can access the aggregated data published by the differential privacy module.

[0016] The log management stage will fully record the requester information, operation time, access path and permission decision results of each access behavior;

[0017] During the permission revocation stage, when the visitor's permissions expire or there is abnormal behavior, the data owner administrator can execute the permission revocation operation through the smart contract and update the access control policy and permission configuration in a timely manner to ensure the integrity and security of the source data.

[0018] Preferably, the differential privacy layer DP is responsible for performing differential privacy processing on authorized requests from the access control layer. Under the premise of ensuring legal access, the medical data to be queried is added with noise and then synthesized and published. Specifically, the process includes initialization, Bayesian network construction, and privacy budget allocation based on the comprehensive sensitivity mechanism:

[0019] The initialization: targeting the hybrid characteristics of medical data, a differentiated privacy protection strategy is adopted to balance data privacy and practicality;

[0020] The Bayesian network construction: constructs an accurate Bayesian network structure based on the NOTEARS method, and the specific formula is:

[0021]

[0022] in, is the data matrix; is the reconstruction error, i.e., linear regression loss; ∥W∥1 is used to encourage sparsity; is a continuously differentiable acyclic constraint function; the optimization objective includes loss function, regularization and acyclic constraint;

[0023] d is the number of nodes;

[0024] W is a d×d weight matrix, which represents the edge weights of the Bayesian network structure. The weight value indicates the degree of dependence. s is a sensitivity-related variable that controls the weight when allocating the privacy budget.

[0025] t is the time variable, the number of iteration steps;

[0026] λ is the regularization coefficient;

[0027] XW is the product of the data matrix and the weight matrix;

[0028] n is the number of samples, and 2n is used as the denominator to normalize the loss;

[0029] tr is the matrix trace operation;

[0030] F is the Frobenius norm;

[0031] The Bayesian Information Criterion (BIC) is introduced to score the candidate structures:

[0032]

[0033] Where G is the current candidate graph structure; D is the current dataset; is the maximum likelihood parameter under the structure G; Dim(G) is the number of parameters of the graph, that is, the complexity of the model;

[0034] N is the number of samples in the current dataset, and logN is used to penalize model complexity in BIC;

[0035] The privacy budget allocation based on the comprehensive sensitivity mechanism: a multi-sensitivity fusion mechanism is introduced. Branch nodes use smooth sensitivity (SS); leaf nodes use local sensitivity (LS); and branch nodes use smooth sensitivity (S*). The specific formula is:

[0036]

[0037] Where β is a smoothing parameter that controls the rate at which sensitivity decays with distance d(D,D'), D and D' are two adjacent datasets; f is the query function or statistical function being evaluated, and e -βd(D,D') is an exponential decay factor, indicating that as the distance between data sets D' and D increases, the sensitivity effect decays exponentially; e is the base of the natural logarithm, which is a natural constant;

[0038] Leaf nodes use local sensitivity LS, the specific formula is:

[0039]

[0040] Among them, ∈' is the privacy budget subvalue assigned to the current query or node, which is used to control the intensity of the injected noise, is the Laplace distributed noise.

[0041] Preferably, the data accessor DR is a medical institution at all levels, a scientific research unit, or other entities with legitimate data access needs;

[0042] Preferably, the access control layer AC is deployed on the consortium chain and is responsible for making authorization decisions for all access requests. The system is based on the improved attribute-based access control (ABAC) mechanism, and introduces dynamic parameters fed back by the differential privacy layer to implement fine-grained adjustable access policies. The visitor's role information and permission policy are pre-registered in the Access Control contract.

[0043] The beneficial effects of the present invention are:

[0044] (1) We propose the IBN-DP algorithm, an improved Bayesian network differential privacy mechanism for high-dimensional medical data. We use a dynamic Bayesian network to model data dependencies, introduce the differentiable optimization framework NOTEARS into the structure learning process, and combine maximum mutual information (MIC) to evaluate dependency strength, achieving a balance between structure simplification, computational efficiency, and budget allocation optimization.

[0045] (2) Build a blockchain-driven fine-grained access control mechanism, improve traditional attribute-based access control (ABAC), and integrate differential privacy strategies. The system dynamically generates access rights based on access frequency and sensitivity level. Smart contracts automatically issue credentials and record access behavior, improving the security, controllability, and traceability of shared data.

[0046] (3) Design a layered and decoupled data sharing system architecture, divide the entire system into four layers of modules, improve the system's scalability and module independence, and provide support for building a flexible, privacy-enhanced, and sustainable evolutionary medical data sharing platform. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 For: layered system architecture diagram;

[0048] Figure 2 This is: differential privacy algorithm flow chart;

[0049] Figure 3 For: Access control flow chart;

[0050] Figure 4 For: Smart contract sequence diagram; DETAILED DESCRIPTION

[0051] The present invention is described in further detail below in conjunction with specific embodiments.

[0052] This paper proposes a secure and trustworthy method for sharing medical data based on blockchain and differential privacy, built on a consortium blockchain architecture and using smart contracts to implement a regularized allocation of privacy budgets. The immutability of blockchain ensures secure sharing of data once it's on-chain. However, given the vulnerability of data to leaks before it's uploaded, the paper further designs a layered system architecture to protect privacy throughout the data lifecycle.

[0053] The layered system architecture includes a data requester (DR), an access control layer (AC), a differential privacy layer (DP), and a data storage layer (DS). Each layer performs different functional modules and collaborates to receive, verify, process, and respond to access requests. This ensures privacy protection before medical data is uploaded to the blockchain, and access permission control ultimately enables secure data sharing.

[0054] We first adopt a score-based time series data structure learning method to learn a dynamic Bayesian network (DBN). During the process of generating conditional distributions and injecting noise, we propose a multi-sensitivity fusion mechanism. Combining smooth sensitivity and local sensitivity, we optimize the sensitivity calculation method based on the characteristics of branch and leaf nodes to improve computational efficiency and data quality. To maximize the practicality of the data, we propose a method for dynamically allocating privacy budgets. The privacy budget ratio of each attribute node is dynamically adjusted based on MIC, attribute sensitivity, and attribute access frequency. Finally, we publish the synthetic data. The details are as follows:

[0055] (1) Data accessor (DR): The data accessor initiates a query request to the system client through their blockchain address. The system receives and encapsulates the user query and identity credential information, submits it as transaction input to the smart contract of the access control layer, and begins the transaction to initiate the access process. DRs can be medical institutions at all levels, scientific research institutions, and other entities with legitimate data access needs.

[0056] (2) Access Control Layer AC: This layer is deployed on the consortium chain and is responsible for the authorization decision-making task for all access requests. The system is based on an improved attribute-based access control (ABAC) mechanism and introduces dynamic parameters fed back by the differential privacy layer (such as attribute sensitivity, access frequency, etc.) to implement fine-grained and adjustable access policies. The visitor's role information and permission policy are pre-registered in the Access Control contract. When an access request is issued, the smart contract will verify the legitimacy of the visitor's address: if the address has been marked as abnormal or denied access due to violations, the system will directly reject the request and record it in the log, and at the same time blacklist the address; if the verification is successful, the corresponding access credentials will be granted for the authorization execution of subsequent data requests.

[0057] (3) Differential Privacy Layer (DP): This layer is responsible for performing differential privacy processing on authorized requests from the access control layer. While ensuring legitimate access, the medical data being queried is noised and then synthesized and published (this invention focuses on data-level noise injection) to achieve the goal of protecting the privacy of medical data. Furthermore, this layer provides real-time feedback on sensitivity indicators and privacy budget consumption to the access control module, which is used to dynamically adjust the access authorization policy.

[0058] (4) Data Storage Layer (DS): As the underlying support module of the system, this layer is responsible for the management and scheduling of raw medical data. Data is centrally stored on the server side and maintained by the data administrator. Based on access control and privacy protection requirements, the data to be processed is migrated from the edge nodes to the differential privacy layer to complete the data call and release process.

[0059] As mentioned above, the access control layer includes the following workflow:

[0060] 1. Attribute-based access control

[0061] At the access control layer, the blockchain system is responsible for permission management of medical data access requests, and the smart contract accurately matches the access logic based on the input parameters. When a user initiates a query request to the system through its blockchain address, the client layer receives the request and triggers the access permission verification process. If the verification is successful, the system returns the access credentials; otherwise, the process is terminated and the request is rejected. Based on the different levels of visitor permissions, the system routes access requests to different processing paths: for example, those granted the highest permissions (such as system administrators) can directly access the data storage module; while ordinary users need to go through the differential privacy module before they can obtain data, thereby effectively preventing the risk of data leakage. All abnormal access requests will be logged and blacklisted to support subsequent audits and security tracking. The specific process of the blockchain-based access control management mechanism is as follows: Figure 3 shown.

[0062] Based on traditional attribute-based access control (ABAC), this paper introduces a differential privacy feedback mechanism and combines sensitivity indicators with access frequency to implement a fine-grained, dynamically adjustable medical data access control strategy.

[0063] We define the attribute set of a user as:

[0064] UA = {S, O, A, E};

[0065] (1) Subject S: The owner and access requester of medical data. In the medical data access system, subjects can include doctors, researchers, system administrators, patients, and other roles. Its attribute set OP is used to identify identity and assess qualifications, including: identity ID, role R, organization On, privacy budget ε, access frequency f, sensitivity assessment score s, and security attributes. Subject attributes can be expressed as:

[0066] S = {ID, R, On, ε, f, s};

[0067] (2) Object O: The resource or data being accessed, which can be raw medical information or data that has been processed through desensitization, aggregation, or statistical analysis, including system resources such as permission policies P and log records D. Its attributes include: data sensitivity Ds, data type Dt, storage location Sl, timestamp T, and encryption status Es. Object attributes can be expressed as:

[0068]

[0069] (3) Operation A: is the specific behavior performed by the subject on the object, including basic read, write, execute, delete, etc. For medical systems, it also includes business operations for sensitive data: requestPrivacyData, adjustPrivacyBudget, logWrite, revokePermission, etc. These operations themselves can have attributes for policy evaluation.

[0070] (4) Environment E: Environment attributes describe the dynamic conditions of the context where the access request is located, including factors related to access time, space and system state, which will affect whether to grant.

[0071] In summary, we define the medical data access authorization policy as:

[0072] Permit(S, O, A, E) = f(Attr(S), Attr(O).Attr(A), Attr(E));

[0073] When the accesser meets certain attribute conditions, and the target data accessed meets the privacy conditions, and does not violate the security rules in the current context environment, it is granted specific access rights to certain data. The specific access control process is described in Algorithm 1:

[0074]

[0075]

[0076] II. Access control based on smart contract implementation

[0077] In the access control phase, a digital signature mechanism based on secp256k1 curve (ECDSA) is introduced to realize a lightweight access identity authentication mechanism. First, the data requester generates access request data:

[0078] M = dataID || purose || timestamp;

[0079] ECDSA_SIGN(M, sk_S) is executed with private key skS to obtain signature Sign(S r ,S S ), and (M, S r ,S S ) is sent to the client to initiate a chain requestPrivacyData() call. ECDSA_VERIFY is performed in the contract to ensure that the data comes from a registered identity and has not been forged or tampered with. After verification, ABAC policy judgment, privacy budget query and adjustment are performed. Finally, if the permission conditions are met, the data is authorized to be accessed, and the audit log is written.

[0080] Among them, M is the message plaintext;

[0081] sk_S is the private key of the data requester S;

[0082] S r is the r value in the ECDSA signature result;

[0083] S S is the s value in the ECDSA signature result;

[0084] Specifically, the access control policy is implemented through smart contracts deployed on the consortium blockchain. The system maps the identity information and role permissions of data accessors to smart contracts. To implement access control, the present invention designs four core smart contracts: the Access Control Contract (ACC), the Manager Control Contract (MC), the Budget Ledger Contract (BSC), and the Audit Log Contract (ASC).

[0085] (1) ACC is used to implement ABAC rule judgment, call the privacy budget BSC contract and trigger differential privacy processing, and write the final authorization result to the log. It mainly includes the request function and the verify function.

[0086] (2) MC serves as the entry point for system governance and operation and maintenance. The subject is the data requester, represented by the corresponding address, and the attributes are the object characteristics. It centrally manages accounts, data, global thresholds, and blacklists, provides a governance function interface externally, and calls ACC, BSC, and ASC internally. Permissions are operational behaviors described by tree branches.

[0087] (3) BSC is used to maintain the privacy budget lifecycle of each entity while providing Sybil defense.

[0088] (4) ASC is used to record all key events, such as access, budget, blacklist, governance operations, etc., and provide tamper-proof evidence for off-chain traceability.

[0089] In the standard execution process of smart contracts, such as Figure 4 As shown in the figure, during the deployment phase, the contract accepts parameters such as the node information of each medical institution, the initial privacy budget, and the access frequency. Data accessors can initiate a query request by calling the requestPrivacyData function, entering the following four-stage access control process:

[0090] (1) Initialization phase: Each medical institution must first apply for a certificate from the CA for each entity OB that joins the network. The certificate contains a description of the OB's attributes. For example, a user may have the following attribute set:

[0091] S = {(ID, R, On, f, s), A};

[0092] Among them, ID is the identity, R is the role, On is the organization, f is the access frequency, s is the sensitivity assessment score, and A is Action, which is the set of operations that the subject can perform;

[0093] (2) Data sharing stage: When the data accessor DR initiates an access request to the system, the smart contract is called to create an Rxrequest transaction, which can be expressed as:

[0094]

[0095] The requested data can be uniquely identified by RID; the RID is the Resource ID, i.e., the resource unique identifier, which is used to accurately locate the requested data resource; the data accessor DR needs to provide a brief description of the accessed data and the access purpose aim; the aim access purpose is the reason or purpose for the accessor to access the data, such as scientific research, statistical analysis, diagnosis and treatment assistance, etc. First, through the DR attribute set Verify its attributes, verify the legitimacy of its access purpose, and extract the data attribute-related parameters of its request (such as access frequency, attribute sensitivity, etc.) and pass them to the differential privacy module.

[0096] The differential privacy module dynamically updates the Bayesian network structure based on these parameters and recalculates the Maximum Information Coefficient (MIC) value for each attribute. Combined with the current privacy budget allocation strategy, this module feeds the analysis results back to the access control layer. The access control smart contract then combines the MIC value with the access purpose to quantitatively assess the sensitivity of the target data and, based on this, grants appropriate access rights, known as access credentials. Requesters holding these credentials can access the aggregated data published by the differential privacy module. This implementation is shown in Algorithm 2.

[0097]

[0098]

[0099] In addition, the system presets a sensitivity threshold for access rights. For requesters seeking access to raw data, the system assesses their comprehensive sensitivity index to the target attributes. If the sensitivity value is below the threshold, the data owner adds noise to the highly sensitive attributes in the source data and authorizes access through a smart contract. If the sensitivity value is above the threshold, the request is denied and recorded in the blockchain access log for subsequent optimization of privacy budget allocation and permission management strategies. Finally, log management and member management are performed, and portions of the privacy budget are reset based on access frequency and comprehensive sensitivity values. The specific implementation is shown in Algorithm 3.

[0100]

[0101]

[0102] If the indicator exceeds the set threshold, the data administrator will authorize it as a semi-trusted user, and the system will grant it access to the desensitized raw data within a limited time window to meet the needs of high-precision medical research and modeling while ensuring the security of data privacy.

[0103] (3) Log management: The system will fully record the requester information, operation time, access path, and permission decision results of each access behavior. The access log will serve as an important basis for dynamically adjusting privacy budget allocation and sensitivity thresholds to ensure adaptive optimization of the access control mechanism.

[0104] Permission revocation stage: When the visitor's permissions expire or there is abnormal behavior, the data owner administrator can execute the permission revocation operation through the smart contract and update the access control policy and permission configuration in time to ensure the integrity and security of the source data.

[0105] As mentioned above, the differential privacy layer (DP) process consists of three stages: first, initialization. Targeting the hybrid nature of medical data, a differential privacy protection strategy is adopted to balance data privacy and practicality; second, we learn the dynamic Bayesian network (DBN) based on the Notears method; finally, blockchain nodes are configured and smart contracts are deployed to achieve automated data management, the on-chain indexing mechanism is initialized, and access logs are established to support data traceability and auditing.

[0106] 1. The Bayesian network (BN) is a directed acyclic graphical (DAG) model that combines probability theory and graph theory.

[0107] Each node V i and its parent node Pα(V i ) satisfies conditional independence, and the joint distribution can be decomposed into:

[0108]

[0109] Where V j is the jth random variable in the Bayesian network;

[0110] Function P() is a probability function, which is used to represent the probability of occurrence of an event or conditional event. It is used in BN to calculate joint distribution and conditional probability, describe the probabilistic dependency between variables, and support.

[0111] To build a more accurate network structure, this paper transforms the original discrete graph structure search problem into a continuous and differentiable optimization problem based on the NOTEARS method. Its core optimization goal is shown in the formula:

[0112]

[0113] in, is the data matrix; is the reconstruction error, i.e., linear regression loss; ∥W∥1 is used to encourage sparsity; is a continuously differentiable acyclic constraint function. This optimization objective includes the loss function, regularization, and acyclic constraints, which enables NO TEARS to simultaneously meet the three requirements of accuracy, sparsity, and legitimacy when learning causal structures.

[0114] After the structure search, the Bayesian Information Criterion (BIC) is further introduced to score the candidate structures:

[0115]

[0116] Where G is the current candidate graph structure; D is the current dataset; is the maximum likelihood parameter under structure G; Dim(G) is the number of graph parameters, i.e., the complexity of the model. The specific construction algorithm is shown in Algorithm 4.

[0117]

[0118]

[0119] To improve the causal interpretability of structure learning, we calculate the Maximum Information Coefficient (MIC) for the candidate edge set E output by NOTEARS as a posterior evaluation metric to filter out edges with low mutual information. According to the definition of mutual information, for x∈X and y∈Y, the joint distribution is p(x,y)=p{X=x,Y=y}, and the marginal distributions are p(x)=p{X=x}, p(y)=p{Y=y}.

[0120] The mutual information I(X; Y) is defined as follows, where log can take any base.

[0121]

[0122]

[0123] MICM=[MIC(X i ,X j )] i,j ;

[0124] Where X is the set of values ​​of the random variable X, Y is the set of values ​​of the random variable Y, x is a specific value in X, y is a specific value in Y, and the function p() is a probability function that represents the probability of an event occurring. I() is the mutual information, which measures the degree of dependence between X and Y. MIC() is the maximum information coefficient, which measures the strength of the relationship between two variables. MICM is the MIC matrix, which stores the MIC values ​​of all pairs of variables. i is the index variable, and j is the index variable, each ranging from 1 to n. n is the number of nodes in the network.

[0125] In the actual modeling process, we only calculate the MIC of the corresponding attributes for the edge pair (i, j) output by NOTEARS to avoid computational overhead.

[0126] 2. Privacy Budget Allocation Based on Comprehensive Sensitivity Mechanism

[0127] Differential privacy is a mathematical framework that introduces a moderate amount of noise into the results to ensure that operations on a single data point do not significantly output, thereby preventing privacy leaks. For any two adjacent data sets D and D' and any possible output set S, there is a formula:

[0128] Pr[A(D)∈S']≤e ε Pr[A(D')∈S']+δ;

[0129] Where ε is the privacy budget, which indicates the degree of privacy leakage. The smaller ε is, the stronger the privacy protection is, but it may lead to reduced output accuracy. δ represents the probability that the algorithm output does not meet strict differential privacy. Pr[A(D)∈S'] is the probability that the output result on the dataset D falls into the set S.

[0130] Where A is the data release algorithm or mechanism, D is the original dataset, S' is the set of possible outputs, and e∈ is the exponential form of privacy loss.

[0131] Differential privacy has a combinatorial nature. As shown in the following formula, when multiple differential privacy algorithms are applied consecutively to the same dataset, the total privacy budget is the sum of the budgets of each application.

[0132] ε total =ε1+ε2+...+ε k ;

[0133] Among them, ε k is the privacy budget value of the kth call, and the value of k is the number of calls.

[0134] When applying differential privacy algorithms to different sub-datasets, as shown in the following formula, the privacy budget is not cumulative. If the dataset is split into k disjoint parts, the budget for each part is independent.

[0135] ε total =max(ε1,ε2,...,ε k );

[0136] During the Bayesian network parameter learning phase, we introduce a multi-sensitivity fusion mechanism to improve the practicality of synthetic data under differential privacy protection. Taking into account the different importance of nodes in the topological structure, the nodes are divided into: branch nodes (with multiple child nodes and complex dependencies) use smooth sensitivity (SS); leaf nodes (no child nodes and limited influence range) use local sensitivity (LS). Smooth sensitivity can reduce global sensitivity, and local sensitivity can measure the maximum sensitivity of the output of function f under a given dataset D to the change of a single data point. It can reduce unnecessary noise in scenarios with little impact on privacy. Given two adjacent datasets D and D', LS is specifically defined as:

[0137]

[0138] SS adds a smoothing mechanism based on local sensitivity to prevent LS from reflecting data characteristics too directly, thereby reducing the risk of privacy leakage. SS is defined as:

[0139]

[0140] Where β is the smoothing parameter, f() is the query function or data analysis function, f is the symbolic representation of the query function, e is a natural constant, the base of the natural logarithm, and βd is the product of the smoothing parameter and the distance between the data sets, which is used to control the decay rate and the decay rate of sensitivity with distance d(D,D').

[0141] For branch nodes, use smoothing sensitivity S*, as shown in the following formula, to reduce the impact of global sensitivity on noise.

[0142]

[0143] For leaf nodes, local sensitivity LS is used, as shown in the following formula, to reduce the amount of noise injection.

[0144]

[0145] Among them, ∈' is the privacy budget sub-value assigned to the leaf node, which controls the noise intensity.

[0146] For complex Bayesian networks, the fusion mechanism can flexibly select sensitivity mechanisms based on node characteristics, avoiding overprotection or noise redundancy, improving computational efficiency while also enhancing data quality. Based on the aforementioned multi-sensitivity fusion mechanism, a detailed privacy budget allocation strategy is presented below, as shown in Algorithm 5.

[0147]

[0148] In order to balance the noise intensity and query accuracy, we designed a dynamic privacy budget allocation mechanism based on attribute features. i ), attribute sensitivity S(X i ), attribute access frequency f i The privacy budget of each attribute is defined as:

[0149]

[0150] Among them, ε i is the privacy budget allocated to the i-th attribute, w i is the weight of the i-th attribute used to allocate the budget according to importance, ε is the total privacy budget, S i is the sensitivity of the i-th attribute,

[0151] f i is the access frequency of the i-th attribute, w j is the weight of the jth attribute, MIC i is the maximum information coefficient value between the i-th attribute and other attributes, δ is a smoothing term to avoid the denominator being 0, i and j are attribute index values, and the value range is 1-n, where n is the number of nodes.

[0152] According to the sensitive mechanism selected by the node, differential privacy noise is injected into the query function and Laplace noise is injected:

[0153]

[0154] If the original frequency is c χ|Π , then:

[0155]

[0156] Among them, Xi is the i-th attribute, S is the sensitivity, εi is a privacy budget value assigned to the i-th attribute;

[0157] Normalization to get probability distribution Pr:

[0158]

[0159] After completing the structure learning and conditional probability table (CPT) construction, the synthetic data is published according to the topological order of the Bayesian network.

[0160] The above merely describes some specific embodiments of the present application, but the protection scope of the present application is not limited thereto, and any person skilled in the art can easily think of changes or replacements within the technical scope disclosed by the present application, which should be covered within the protection scope of the present application.

Claims

1. A secure and trustworthy medical data sharing method based on blockchain and differential privacy, characterized by The method adopts a layered system architecture, including a data requester (DR), an access control layer (AC), a differential privacy layer (DP), and a data storage layer (DS); which respectively complete the reception, verification, processing, and response of access requests; Data accessor DR: The data accessor initiates a query request to the system through the blockchain address. The system receives and encapsulates the user query and identity credential information, submits it as transaction input to the smart contract of the access control layer, and starts executing the transaction to initiate the access process. Access Control Layer (AC): When an access request is made, the smart contract verifies the legitimacy of the visitor's address. If the address has been marked as abnormal or denied access due to violations, the system will directly reject the request and record it in the log, and blacklist the address. If the verification is successful, the corresponding access credentials will be granted for the authorization execution of subsequent data requests; Differential Privacy Layer (DP): This layer provides real-time feedback on sensitivity indicators and privacy budget consumption to the access control module, allowing for dynamic adjustment of access authorization policies. Data storage layer DS: It is the underlying support module of the system, responsible for the management and scheduling of original medical data. According to the requirements of access control and privacy protection, it migrates the data to be processed from the edge node to the differential privacy layer to complete data call and release.

2. The method for secure and trusted sharing of medical data based on blockchain and differential privacy according to claim 1 is characterized in that: The access control layer AC introduces a differential privacy feedback mechanism based on traditional attribute-based access control (ABAC). The access control strategy is implemented through smart contracts deployed on the consortium chain. Data accessors can initiate query requests by calling the requestPrivacyData function. The access control process consists of four stages: initialization, data sharing, log management, and permission revocation. During the initialization phase, each medical institution must first apply for a certificate from a certificate authority (CA) for each entity object OB added to the network to be accessed or protected. The certificate contains a description of the OB's attributes. In the data sharing phase, the smart contract is called to create an Rxrequest transaction. The specific formula is: The requested data can be uniquely identified by the resource unique identifier RID; the data accessor DR needs to provide a description of the data to be accessed and the purpose of the access; first, through the DR's attribute set Verify its attributes, verify the legitimacy of its access purpose, and extract the relevant parameters of the data attributes of its request, including: frequency, attribute sensitivity, and pass them to the differential privacy module; datades is the data description; The differential privacy module dynamically updates the Bayesian network structure based on these parameters and recalculates the Maximum Information Coefficient (MIC) value for each attribute. Combined with the current privacy budget allocation strategy, the module feeds the analysis results back to the access control layer. Subsequently, the access control smart contract quantitatively assesses the sensitivity of the target data based on the MIC value and the access purpose, and grants the corresponding access rights, i.e., access credentials. The requester holding this credential can access the aggregated data published by the differential privacy module. The log management stage will fully record the requester information, operation time, access path and permission decision results of each access behavior; During the permission revocation stage, when the visitor's permissions expire or there is abnormal behavior, the data owner administrator can execute the permission revocation operation through the smart contract and update the access control policy and permission configuration in a timely manner to ensure the integrity and security of the source data.

3. The secure and trusted sharing method for medical data based on blockchain and differential privacy according to claim 1 is characterized by: The differential privacy layer (DP) is responsible for performing differential privacy processing on authorized requests from the access control layer. Under the premise of ensuring legal access, it adds noise to the medical data to be queried and then publishes it synthetically. This includes initialization, Bayesian network construction, and privacy budget allocation based on a comprehensive sensitivity mechanism. The initialization: targeting the hybrid characteristics of medical data, a differentiated privacy protection strategy is adopted to balance data privacy and practicality; The Bayesian network construction: constructs an accurate Bayesian network structure based on the NOTEARS method, and the specific formula is: in, is the data matrix; is the reconstruction error, i.e., linear regression loss; ∥W∥1 is used to encourage sparsity; is a continuously differentiable acyclic constraint function; the optimization objective includes loss function, regularization and acyclic constraint; d is the number of nodes; W is a d×d weight matrix, which represents the edge weights of the Bayesian network structure. The weight value indicates the degree of dependence. s is a sensitivity-related variable that controls the weight when allocating the privacy budget. t is the time variable, the number of iteration steps; λ is the regularization coefficient; XW is the product of the data matrix and the weight matrix; n is the number of samples, and 2n is used as the denominator to normalize the loss; tr is the matrix trace operation; F is the Frobenius norm; The Bayesian Information Criterion (BIC) is introduced to score the candidate structures: Where G is the current candidate graph structure; D is the current dataset; is the maximum likelihood parameter under the structure G; Dim(G) is the number of parameters of the graph, that is, the complexity of the model; N is the number of samples in the current dataset, and logN is used to penalize model complexity in BIC; The privacy budget allocation based on the comprehensive sensitivity mechanism: a multi-sensitivity fusion mechanism is introduced. Branch nodes use smooth sensitivity (SS); leaf nodes use local sensitivity (LS); and branch nodes use smooth sensitivity (S*). The specific formula is: Where β is a smoothing parameter that controls the rate at which sensitivity decays with distance d(D,D'), D and D' are two adjacent datasets; f is the query function or statistical function being evaluated, and e -βd(D,D ' ) is an exponential decay factor, indicating that as the distance between data sets D' and D increases, the sensitivity effect decays exponentially; e is the base of the natural logarithm, which is a natural constant; Leaf nodes use local sensitivity LS, the specific formula is: Among them, ∈' is the privacy budget subvalue assigned to the current query or node, which is used to control the intensity of the injected noise, is the Laplace distributed noise.

4. The method for secure and trusted sharing of medical data based on blockchain and differential privacy according to claim 1 is characterized in that: The data accessors DR are medical institutions at all levels, scientific research units and other entities with legitimate data access needs.

5. The method for secure and trusted sharing of medical data based on blockchain and differential privacy according to claim 1 is characterized in that: The access control layer AC is deployed on the consortium chain and is responsible for making authorization decisions for all access requests. The system is based on the improved attribute-based access control (ABAC) mechanism and introduces dynamic parameters fed back by the differential privacy layer to implement fine-grained and adjustable access policies. The visitor's role information and permission policy are pre-registered in the Access Control contract.