arXiv:2409.12171cs.CRcs.AI2024-09被引 11

用知识图谱自动生成符合医疗标准的智能合约。

Semantic Interoperability on Blockchain by Generating Smart Contracts Based on Knowledge Graphs

  • 用领域知识图谱定义合约逻辑,再转为具体代码
  • 生成的合约在医保场景中正确性高且链上执行成本低
  • 适合需要跨机构可信协作的医疗区块链应用

健康3.0时代,决策依赖于来自多个机构的纵向患者数据。在此分布式环境下,区块链智能合约可作为中立中介实现可信决策。为实现语义互操作性,传输数据需遵循标准(如HL7 FHIR)。智能合约需兼容该标准,构建复杂通信机制(如使用预言机),并以区块链语言(如Solidity)开发。本文提出基于高阶语义知识图谱编码合约逻辑,利用领域标准概念表达规则,并将该知识图谱部署于区块链。离线阶段,代码生成流水线将知识图谱编译为具体智能合约,再部署上线。该流水线采用中间桥接表示,可转译为特定区块链语言。此设计避免了链上规则引擎,降低计算开销和不可预测成本,符合区块链经济规律。我们在美国医疗保险(Medicare)的3个保险案例中应用该方法,评估显示生成的合约在正确性和链上执行成本(gas)方面表现良好。结论表明,基于语义知识图谱自动生成智能合约是可行的,且符合区块链经济约束。未来工作包括引入大语言模型优化流程,并在其他区块链上进行验证。

原文摘要 · Abstract (English)

Background: Health 3.0 allows decision making to be based on longitudinal data from multiple institutions, from across the patient's healthcare journey. In such a distributed setting, blockchain smart contracts can act as neutral intermediaries to implement trustworthy decision making. Objective: In a distributed setting, transmitted data will be structured using standards (such as HL7 FHIR) for semantic interoperability. In turn, the smart contract will require interoperability with this standard, implement a complex communication setup (e.g., using oracles), and be developed using blockchain languages (e.g., Solidity). We propose the encoding of smart contract logic using a high-level semantic Knowledge Graph, using concepts from the domain standard. We then deploy this semantic KG on blockchain. Methods: Off-chain, a code generation pipeline compiles the KG into a concrete smart contract, which is then deployed on-chain. Our pipeline targets an intermediary bridge representation, which can be transpiled into a specific blockchain language. Our choice avoids on-chain rule engines, with unpredictable and likely higher computational cost; it is thus in line with the economic rules of blockchain. Results: We applied our code generation approach to generate smart contracts for 3 health insurance cases from Medicare. We discuss the suitability of our approach - the need for a neutral intermediary - for a number of healthcare use cases. Our evaluation finds that the generated contracts perform well in terms of correctness and execution cost ("gas") on blockchain. Conclusions: We showed that it is feasible to automatically generate smart contract code based on a semantic KG, in a way that respects the economic rules of blockchain. Future work includes studying the use of Large Language Models (LLM) in our approach, and evaluations on other blockchains.

知识图谱智能合约医疗区块链自动代码生成

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。