Medical insurance data interaction method based on block chain smart contract
By converting medical unstructured data into OFD format and combining it with blockchain smart contracts and IPFS storage, the problems of large file size and low transmission efficiency in PDF format are solved, and efficient and secure medical data interaction is achieved.
Patent Information
- Application Number
- CN202510627370.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-15
- Publication Date
- 2025-09-26
AI Technical Summary
In the existing technology, when unstructured data such as medical reports are stored in PDF format, the file size is large and the transmission efficiency is low, which cannot meet the real-time claims data interaction needs and seriously wastes storage resources.
Medical unstructured data is converted into the domestic OFD format and stored through the IPFS distributed file system. It is combined with blockchain smart contracts for data indexing and permission control. The efficient compression algorithm of the OFD format and the content addressing mechanism of IPFS are used to avoid duplicate storage and improve transmission efficiency.
Significantly reduce file size, shorten transmission time, reduce storage pressure, improve data circulation efficiency, ensure data security and reliability, reduce manual intervention, and improve user experience.
Smart Images

Figure CN120707306A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of commercial insurance claims process, and in particular to a medical insurance data interaction method based on blockchain smart contracts. Background Art
[0002] In the field of commercial medical insurance claims, the efficiency and security of data exchange processes are core industry concerns. Existing technologies primarily rely on blockchain technology or API-based methods for data exchange between medical systems and commercial insurance companies, involving the transmission and sharing of structured data (such as basic patient information) and unstructured data (such as medical reports, imaging materials, and electronic invoices). Blockchain technology, due to its decentralized and tamper-proof nature, is used for data storage; APIs are traditional system integration methods, but both face technical challenges when processing unstructured data.
[0003] In the existing technology, unstructured data such as electronic medical reports, images, and electronic invoices are usually stored in PDF format. Taking a physical examination report as an example, when it contains multiple examination items, the size of a PDF file can reach tens of MB. When such files are transmitted through traditional file systems or API interfaces, the following problems exist: Low transmission efficiency: Online access and transmission of large files take a long time, and users need to wait from several seconds to tens of seconds, which seriously affects the efficiency of the claims process; High storage pressure: Repeated storage of the same file leads to a waste of storage resources, especially when the business volume is large. The system needs to process massive amounts of data, further exacerbating storage and computing pressure. The security mechanism of the API interface requires reliance on complex security components to prevent data leakage and tampering when accessing data through the API interface.
[0004] The inventors of this application discovered during the implementation of the technical solution that the above technology has at least the following technical deficiencies: Inefficient processing of unstructured data: The PDF format has a limited compression rate and lacks optimization for medical scenarios, resulting in large file sizes and high transmission delays, making it unable to meet the needs of real-time claims data interaction; Summary of the Invention
[0005] In order to make up for the above shortcomings, the present invention provides a medical insurance data interaction method based on blockchain smart contracts, which aims to improve the limited compression rate of PDF format and the lack of optimization for medical scenarios, resulting in large file size and unable to meet the real-time claims data interaction needs.
[0006] In a first aspect, the present invention provides the following technical solution: a medical insurance data interaction method based on a blockchain smart contract, comprising the following steps:
[0007] S1. Build an OFD format conversion tool to convert medical unstructured data into domestic OFD format documents and store them through the IPFS distributed file system;
[0008] S2. Build a medical commercial insurance claims chain based on blockchain technology, where the blockchain includes at least one hospital node and multiple dynamically connected commercial insurance nodes;
[0009] S3. Deploy a smart contract in the blockchain, wherein the smart contract includes event notification and monitoring functions for targeted transmission of medical data index information;
[0010] S4. When the commercial insurance company initiates a data request, the hospital node uploads the structured data and the CID of the OFD file to the blockchain through the smart contract;
[0011] S5. The commercial insurance company obtains the matching medical data index by monitoring the smart contract events and retrieves the OFD source file through the IPFS system;
[0012] S6. Embed dynamic permission control logic in smart contracts to allow patients to authorize or revoke commercial insurance companies' access rights to hierarchical medical data in real time through digital identities, and generate unique encrypted tokens to bind access scopes.
[0013] By adopting the above technical solution, medical reports, imaging materials, etc. are converted into the domestic OFD format through the OFD format conversion tool, and its efficient compression algorithm (compression ratio of 40%-60%) is used to significantly reduce the file size (such as tens of MB of PDF reports compressed to 8-12MB), shortening the online access and transmission time to improve user experience; combined with the IPFS distributed storage system, the content addressing mechanism (CID) is used to uniquely identify files, automatically identify duplicate files and avoid redundant storage, reduce the pressure on medical data storage (storage requirements drop by more than 40%), and at the same time use the distributed characteristics of IPFS to improve file access speed and system reliability.
[0014] Preferably, the OFD format conversion tool is used to convert discharge summaries, electronic invoices, and imaging materials into OFD documents, and utilizes its compression characteristics to reduce file size. The IPFS system uniquely identifies files through CID to avoid duplicate storage.
[0015] Preferably, the event notification function of the smart contract achieves data isolation through preset tracking parameters. Each commercial insurance node can only listen to events that match its own number, and obtain structured data and OFD file CID list by parsing the event content. The preset tracking parameters include the commercial insurance company's private number.
[0016] Preferably, the dynamic permission control logic includes:
[0017] Medical data is divided into three levels according to sensitivity: basic information, diagnostic reports, and imaging data. Patients can authorize access to different levels.
[0018] Each authorization generates an encrypted token and is bound to the patient's digital identity. The token is time-sensitive and follows the principle of least privilege.
[0019] All authorized operations and data access records are recorded on the chain through smart contracts, forming an unalterable audit log.
[0020] Preferably, the blockchain nodes are independently operated and maintained by hospitals and commercial insurance companies, data interaction is achieved through synchronization between nodes, and medical data indexes are stored separately from OFD files. Index data is transmitted through the blockchain, and OFD files are transmitted through the IPFS system.
[0021] Preferably, the smart contract supports repeated monitoring of events to refresh local data, and ensures data consistency through the blockchain consensus mechanism to prevent tampering or abnormal status. The OFD document is embedded with a digital signature and encryption mechanism when it is generated to ensure integrity and security during transmission and storage.
[0022] Preferably, the machine learning-driven anomaly detection and automatic response mechanism integrated into the S6 smart contract includes:
[0023] S601. Training a machine learning model based on historical data access records to analyze data request behavior patterns of commercial insurance nodes in real time;
[0024] S602: When abnormal access behavior is detected, the permission freezing function of the smart contract is automatically triggered to suspend the data access permission of the node;
[0025] S603: Synchronously generate a security alert event and broadcast it to the hospital node and the patient's mobile terminal through the blockchain, requiring manual review and confirmation before restoring access;
[0026] S604. The processing process and results of all abnormal events are recorded on the chain through smart contracts, forming a closed-loop security audit.
[0027] In a second aspect, the present invention provides the following technical solution: a medical insurance data interaction system based on blockchain smart contracts, the system comprising:
[0028] OFD format conversion module, used to convert medical unstructured data into OFD format;
[0029] IPFS distributed storage module, used to store OFD files and generate unique CIDs;
[0030] The blockchain network module includes hospital nodes and commercial insurance nodes, which are used for the interaction and storage of medical index data;
[0031] Smart contract module, integrating event notification, permission control and audit tracking functions;
[0032] The patient mobile authorization module supports real-time permission management and encryption token generation. The patient mobile authorization module provides a visual interface, allowing patients to dynamically adjust the authorization scope according to data classification, and synchronize permission changes in real time through the blockchain.
[0033] In the third aspect, the invention provides the following technical solution: a computer device comprising a memory, a processor, and a computer program stored in the memory and runnable on the processor; when the processor executes the computer program, the above-mentioned medical insurance data interaction method based on blockchain smart contracts is implemented.
[0034] In a fourth aspect, the present invention provides the following technical solution: a readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, it implements the above-mentioned medical insurance data interaction method based on blockchain smart contracts.
[0035] The present invention has the following beneficial effects:
[0036] 1. This invention improves the problem of unstructured data such as discharge summaries, electronic invoices, hospitalization records, examination images, etc. in medical commercial insurance claims scenarios. The original PDF format occupies a large space and has duplicate storage problems. The OFD document format is used to effectively reduce the file storage pressure of the file storage system.
[0037] 2. The present invention improves data security and reliability through multi-party joint accounting on the blockchain; through blockchain smart contracts, contract event notifications and event monitoring, the business data of each commercial insurance company is effectively isolated, while effectively reducing data response time and improving data circulation efficiency.
[0038] 3. In this invention, IPFS uses CID to uniquely identify files, reducing duplicate storage by over 60% and storage costs by 40%. It also uses a hybrid architecture of private nodes and public gateways to balance data sovereignty and cross-institutional access. The blockchain only stores indexed data and, combined with the PBFT consensus algorithm, achieves second-level confirmation (2000+ TPS), reducing node operation and maintenance costs by 50%. The consortium chain design, which dynamically expands commercial insurance nodes, adapts to multi-institutional collaboration and avoids on-chain data expansion.
[0039] 4. In the present invention, patients can dynamically manage permissions through a mobile visual interface, synchronize changes in real time and receive abnormal warnings, strengthen data control, and collaborate with OFD conversion, IPFS storage, smart contracts and blockchain modules to automatically complete the "data request-index on-chain-event notification-authorization verification" process, reducing manual intervention by more than 70%; commercial insurance nodes accurately obtain data by monitoring events, and combine IPFS to quickly retrieve files, building an automated link of "efficient compression-secure evidence storage-precise interaction", thereby improving user experience and system collaboration efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 This is a flowchart of a method for medical insurance data interaction based on blockchain smart contracts proposed by the present invention;
[0041] Figure 2 This is the blockchain-based commercial insurance claims data circulation diagram of the present invention;
[0042] Figure 3 A schematic diagram of the business process of the present invention;
[0043] Figure 4 This is an architecture diagram of the medical insurance data interaction system based on blockchain smart contracts proposed by the present invention. DETAILED DESCRIPTION
[0044] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0045] Example 1
[0046] Reference Figure 1 In a first embodiment of the present invention, the present invention provides a medical insurance data interaction method based on a blockchain smart contract, comprising the following steps:
[0047] S1. Build an OFD format conversion tool to convert medical unstructured data into domestic OFD format documents and store them through the IPFS distributed file system;
[0048] S2. Build a medical commercial insurance claims chain based on blockchain technology, where the blockchain includes at least one hospital node and multiple dynamically connected commercial insurance nodes;
[0049] S3. Deploy a smart contract in the blockchain, wherein the smart contract includes event notification and monitoring functions for targeted transmission of medical data index information;
[0050] S4. When the commercial insurance company initiates a data request, the hospital node uploads the structured data and the CID of the OFD file to the blockchain through the smart contract;
[0051] S5. The commercial insurance company obtains the matching medical data index by monitoring the smart contract events and retrieves the OFD source file through the IPFS system;
[0052] S6. Embed dynamic permission control logic in smart contracts to allow patients to authorize or revoke commercial insurance companies' access rights to hierarchical medical data in real time through digital identities, and generate unique encrypted tokens to bind access scopes.
[0053] Specifically, S1. Build an OFD format conversion tool and store data: Develop a dedicated conversion tool to convert medical unstructured data such as discharge summaries, electronic invoices, and imaging materials from PDF / XML format to the domestic OFD format. Utilize the high compression characteristics of the OFD format to significantly reduce the file size (for example, compress a physical examination report of tens of MB to a smaller size). Upload the converted OFD document to the IPFS (InterPlanetaryFileSystem) distributed file system. The IPFS system generates a unique content identifier (CID) for each file and automatically identifies duplicate files to avoid redundant storage.
[0054] S2. Build a blockchain network for medical commercial insurance claims: Build a blockchain-based medical commercial insurance claims chain. The network includes at least one hospital node and multiple dynamically connected commercial insurance company nodes. Each institution independently operates and maintains its own blockchain node, jointly maintains the ledger data, and uses a consensus mechanism to ensure data consistency across all nodes.
[0055] S3. Deploy smart contracts: Deploy smart contracts with event notification and monitoring functions on the blockchain. The contract includes the following core functions: medical data index storage, event notification tracking (including parameters such as the commercial insurance company's private number), data isolation mechanism, dynamic permission control logic, and audit log recording.
[0056] S4. Processing the commercial insurance company's data request. The commercial insurance company initiates a data request through its node (including the company's private number LP_01). After receiving the request, the hospital HIS system retrieves the patient's basic information (structured data) and queries the OFD file CID of the required medical document. If the OFD file is not stored, it is first formatted and uploaded to IPFS to obtain the CID. The hospital node uploads the structured data and the OFD file CID list to the blockchain through the smart contract, triggering a smart contract event notification, and designating the recipient as LP_01.
[0057] S5. The commercial insurance company obtains data. The commercial insurance company LP_01 monitors blockchain events through its node, filters and parses event notifications that match its own number LP_01, and obtains from the event content: basic patient information (structured data), the OFD file CID list of the required medical documents, and uses the CID to obtain the OFD source file through the IPFS interface. It supports repeated monitoring of events to refresh local data and ensure data consistency.
[0058] S6. Dynamic permission control: Medical data is classified by sensitivity: basic information (such as patient name and age), diagnostic reports, and imaging data. After the patient passes the digital identity authentication, they can: authorize / revoke the access rights of specific commercial insurance companies to different levels of data in real time, and set the access time limit (such as only authorizing for 24 hours).
[0059] Each authorization generates a unique encrypted token, which is bound to: the patient's digital identity, the scope of authorization (data level), and the validity period. All authorized operations and data access records are stored on the chain through smart contracts, forming an unalterable audit log.
[0060] The OFD format conversion tool is used to convert discharge summaries, electronic invoices, and imaging materials into OFD documents, and use its compression characteristics to reduce file size. The IPFS system uniquely identifies files through CID to avoid duplicate storage.
[0061] Specifically, a deeply optimized OFD format conversion tool works in conjunction with an enhanced IPFS storage system to build a complete medical document processing pipeline. The conversion tool utilizes a modular design, integrating three functional modules: a multi-source data adaptation layer, an intelligent compression conversion core, and metadata enhancement processing. It supports parsing and conversion of common medical formats such as PDF, JPEG, and DICOM. Leveraging OFD's advanced compression algorithms (including dictionary-encoded text compression, configurable compression strategies for medical imaging, and incremental storage technology), it can reduce document size by 40-60%. For example, a 50-page PDF discharge report can be compressed from 25MB to 8-12MB. The conversion process simultaneously extracts structured medical metadata and embeds digital signatures to ensure compliance with electronic medical record standards. Converted OFD documents enter the improved IPFS-Cluster storage system. The system first verifies file existence through a CID (content identifier) query mechanism to avoid duplicate storage. A private hospital node cluster (3-5 nodes) is used to ensure data sovereignty, while cross-institutional access is supported through a public gateway node. The storage system implements multiple performance optimization measures, including intelligent transmission protocol selection based on file type (QUIC streaming compression is used for text reports, and TCP+UDT block-based parallel transmission is used for imaging data), an LRU caching mechanism for hot data, and security enhancements specific to medical data, such as attribute-based access control plug-ins, support for the national secret SM4 encryption, and automatic expiration data cleanup policies. The system integrates with other modules through standardized API interfaces (including two core interfaces: OFD conversion and IPFS storage). Tests have shown that this solution can reduce the storage volume of medical documents by an average of 55% and the overall storage requirements of the system by over 40%, while fully preserving the legal validity and security of medical data.
[0062] The event notification function of the smart contract achieves data isolation through preset tracking parameters. Each commercial insurance node can only listen to events that match its own number, and obtain structured data and OFD file CID list by parsing the event content. The preset tracking parameters include the commercial insurance company's private number.
[0063] Specifically, a multi-level smart contract event notification mechanism is employed to achieve secure isolation and targeted transmission of medical data. The smart contract includes a pre-defined tracking design for key parameters, including the commercial insurance company's private number (e.g., LP_01), data sensitivity classification, and patient authorization tokens. A three-tiered filtering system is established using the indexed field of the Solidity event log, ensuring that each commercial insurance node only listens to events that precisely match its own number. When an event is triggered, the commercial insurance node subscribes to the filtered event stream through interfaces such as Web3.js, parses the structured patient information and the OFD file CID list, and automatically retrieves the corresponding medical files in parallel through IPFS. The system integrates security mechanisms such as zero-knowledge proof verification, national secret SM2 encryption, and dynamic permission revocation. Furthermore, it utilizes performance enhancements such as hierarchical event topic subscription, batch processing optimization, and an off-chain cache server. This system achieved an event processing capacity of over 300 TPS in a 200-node test environment with an error rate below 0.001%, meeting the requirements for efficient medical data interaction while ensuring strict access isolation and compliance requirements.
[0064] The dynamic permission control logic includes:
[0065] Medical data is divided into three levels according to sensitivity: basic information, diagnostic reports, and imaging data. Patients can authorize access to different levels.
[0066] Each authorization generates an encrypted token and is bound to the patient's digital identity. The token is time-sensitive and follows the principle of least privilege.
[0067] All authorized operations and data access records are recorded on the chain through smart contracts, forming an unalterable audit log.
[0068] Specifically, the data grading and differentiated authorization mechanism: Medical data is divided into three levels based on sensitivity: Level 1 is basic information (such as identity information), which allows basic queries by default; Level 2 is diagnostic reports (such as test results), which require active authorization from the patient and are valid for 7 days by default; Level 3 is imaging data (such as CT images), which requires secondary confirmation and is valid for only 3 days. Patients dynamically authorize the graded data requested by the commercial insurance company through a visual interface (color-coded levels and slider adjustment range). Smart contracts automatically verify permission matching when data is requested, deny unauthorized access, and record exceptions.
[0069] Encrypted token generation and management mechanism: Tokens are formatted as JWTs and are dually encrypted using AES-256-GCM and RSA-4096. Tokens are timed according to data level (maximum 30 days for Level 1, minimum 7 days for Level 3), and only include the minimum authorization scope. After token generation, they are bound to the patient's digital identity and insurance company number. Transmission is encrypted in segments, and verification verifies timestamps, signatures, and permission scopes. Patients can revoke authorization at any time, and the smart contract broadcasts a list of invalid tokens in real time, instantly invalidating any valid tokens.
[0070] On-chain evidence storage and audit tracking system: Smart contracts store records of authorized operations, data access, and permission changes in real time, including patient information, commercial insurance company, operation time, data type, and other factors. The blockchain hash chain structure ensures that records cannot be tampered with, provides a multi-dimensional search dashboard and PDF audit reports, and automatically tags anomalies such as unauthorized access with an "abnormal" label and triggers an alarm, achieving full process traceability and security auditing.
[0071] Collaboration with Smart Contracts: Smart contracts define hierarchical data enumeration types. The grantPermission function generates encrypted tokens and stores authorization records, while the validatePermission function verifies permission compatibility. The event notification mechanism includes events such as authorization, revocation, and access attempts. Commercial insurance nodes subscribe to relevant events to update the local permission cache, triggering the data retrieval process and automating the linkage between permission control and data interaction.
[0072] Security Enhancement Design: A machine learning model analyzes historical data to establish a patient behavior baseline, detecting unusual authorization patterns (such as multiple permission changes in a short period of time) and triggering manual review. The emergency response mechanism supports a one-click freeze of the patient's authorization token, forced refresh of the digital identity key, and simultaneous notification to the commercial insurance node to cease access. Combined with on-chain evidence storage, this creates a closed-loop security incident response system.
[0073] The blockchain nodes are independently operated and maintained by hospitals and commercial insurance companies. Data interaction is achieved through synchronization between nodes, and medical data indexes are stored separately from OFD files. Index data is transmitted through the blockchain, and OFD files are transmitted through the IPFS system.
[0074] Specifically, the blockchain node's independent operation and maintenance architecture and synchronization mechanism: The blockchain utilizes a consortium chain architecture to construct a commercial medical insurance claims chain, comprised of a hospital master node and dynamic nodes from each commercial insurance company. Each party independently operates and maintains the hardware, software, and security policies of its own nodes. Commercial insurance nodes must pass CA certification before access. The consensus mechanism utilizes the PBFT or RAFT algorithm to ensure efficient and consistent data synchronization. During data exchange, hospital nodes encapsulate the structured data index and the OFD file CID into a transaction proposal and broadcast it to the commercial insurance nodes. After consensus verification, the proposal is written to each node's ledger, achieving cross-institutional data synchronization. Commercial insurance nodes filter valid data by monitoring smart contract events that match their own numbers.
[0075] Medical data indexing and OFD file storage technology: Hospitals use OFD format conversion tools to convert unstructured medical data into compressed (30%-50% compression ratio), digitally signed, and encrypted OFD documents. These documents are then uploaded to the IPFS distributed storage system, generating unique CID identifiers. When re-uploading, the system automatically identifies existing files to avoid redundancy. The blockchain only stores index data, including patient metadata, permission identifiers, and CID lists. These data are encapsulated and uploaded to the blockchain via smart contracts. A hash chain structure ensures tamper-proof access, creating a traceable audit trail and achieving a secure "index on-chain, file storage distributed" architecture.
[0076] Optimizing data exchange processes and security efficiency: After a commercial insurance company initiates a data request, the hospital's HIS system generates an OFD file and stores it in IPFS to obtain a CID. The index and CID are then broadcast to the blockchain via a smart contract. The commercial insurance node listens for matching events to obtain the index, and after permission verification, retrieves the encrypted OFD file from IPFS using the CID. This process uses the blockchain to handle permission verification and index distribution, while IPFS handles large file transfers, enabling parallel processing and improving efficiency. Furthermore, the blockchain does not store original files to ensure privacy, while smart contracts verify permissions in real time to prevent unauthorized access. Machine learning-based anomaly detection mechanisms are used to freeze offending nodes and broadcast alerts. All operations are stored on the blockchain to ensure security and auditability.
[0077] After the hospital generates an OFD file and stores it on IPFS, it uploads the index and CID to the blockchain. The commercial insurance node monitors events to obtain the index, parses it, and calls the IPFS interface to retrieve the file. Smart contracts implement targeted data index distribution through event notification and monitoring mechanisms, ensuring that each commercial insurance node only receives data relevant to it. Combining the immutability of blockchain with the efficient storage characteristics of IPFS, this creates a secure interaction model where "data is available but not visible," providing efficient and auditable technical support for medical commercial insurance claims.
[0078] The smart contract supports repeated monitoring of events to refresh local data, and ensures data consistency through the blockchain consensus mechanism to prevent tampering or abnormal status. The OFD document is embedded with a digital signature and encryption mechanism when it is generated to ensure integrity and security during transmission and storage.
[0079] Specifically, the smart contract captures blockchain data updates in real time through a repeated monitoring event mechanism, dynamically refreshes the index information cached locally by the commercial insurance node, and combines the PBFT or RAFT consensus algorithm to ensure ledger consistency between nodes, effectively preventing data tampering or abnormal states, and ensuring the credibility and real-time nature of medical index data. When generating OFD documents, a dual authentication mechanism of SHA-256 hash digital signature and RSA private key encryption is embedded. AES-256 symmetric encryption is used to protect file content, and RSA-4096 asymmetric encryption is used to manage keys. During transmission, the communication link is encrypted using the TLS1.3 protocol and the IPFS Noise protocol, ensuring the integrity and security of the document throughout the entire storage and interaction process. The two work together to form a secure closed loop of "event-driven data synchronization - consensus ensures ledger consistency - encryption ensures content credibility."
[0080] The machine learning-driven anomaly detection and automatic response mechanisms integrated into the S6 smart contract include:
[0081] S601. Training a machine learning model based on historical data access records to analyze data request behavior patterns of commercial insurance nodes in real time;
[0082] S602: When abnormal access behavior is detected, the permission freezing function of the smart contract is automatically triggered to suspend the data access permission of the node;
[0083] S603: Synchronously generate a security alert event and broadcast it to the hospital node and the patient's mobile terminal through the blockchain, requiring manual review and confirmation before restoring access;
[0084] S604. The processing process and results of all abnormal events are recorded on the chain through smart contracts, forming a closed-loop security audit.
[0085] Specifically, machine learning model construction and behavioral analysis: By collecting historical access data from commercial insurance nodes (including basic features such as access time, request frequency, data sensitivity, and behavioral features such as unauthorized attempts and invalid token use), sliding window technology is used to collect real-time features and standardize them. Using algorithms such as isolation forest, LSTM, and One-Class SVM, the model is trained using historical normal data and an anomaly score threshold is set (e.g., a score > 0.9 is considered an anomaly). The model is updated regularly. The smart contract obtains access logs in real time and transmits them to the off-chain machine learning service. The server-side prediction feeds the results back to the smart contract to trigger the response logic, enabling real-time analysis of the behavioral patterns of commercial insurance node data requests.
[0086] Permission freezing and access control: When the machine learning model outputs an "abnormal" with a confidence level >90%, the smart contract marks the commercial insurance node as FROZEN and revokes all its encrypted tokens, prohibiting access to OFD files. A tiered freezing strategy is employed: minor anomalies (such as a single unauthorized access attempt) result in a freeze of Level 3 image data access rights, while major anomalies (such as persistent and frequent unauthorized access) result in a freeze of all data access rights. A minor freeze lasts for 24 hours by default and is automatically reversible, while a major freeze requires manual confirmation before being released, enabling precise control over abnormal access behavior.
[0087] Security Alert Broadcast and Manual Review: The smart contract triggers the SecurityAlert event to broadcast exception information (including node address, exception type, timestamp, etc.). Hospital nodes and patient mobile devices receive notifications by monitoring the event, and an alarm is sent to the hospital security management system through an oracle. Hospital administrators review the exception details (including access logs and explanations of model anomaly characteristics) and call functions for reanalysis. The review results are uploaded to the chain through the smart contract. If it is a false alarm, the permissions are restored. If the anomaly is confirmed, the freeze period is extended or the node is permanently banned, forming a complete "detection-alarm-review" process.
[0088] Abnormal events are stored on-chain: The smart contract defines the AnomalyRecord structure, which contains information such as node address, timestamp, anomaly type, model confidence, verification results, and off-chain log hashes. Key nodes call functions to record and store evidence. Detailed access logs are encrypted and stored on IPFS, generating hash values that are uploaded to the chain. Regulators or hospitals can retrieve abnormal records and trace the entire process through log files. The stored evidence data complies with health and medical data security guidelines, homomorphically encrypts sensitive information, and meets compliance audit requirements, forming a closed-loop security audit.
[0089] Example 2:
[0090] Reference Figure 4 In a second embodiment of the present invention, the present invention provides a medical insurance data interaction system based on a blockchain smart contract, the system comprising:
[0091] OFD format conversion module, used to convert medical unstructured data into OFD format;
[0092] IPFS distributed storage module, used to store OFD files and generate unique CIDs;
[0093] The blockchain network module includes hospital nodes and commercial insurance nodes, which are used for the interaction and storage of medical index data;
[0094] Smart contract module, integrating event notification, permission control and audit tracking functions;
[0095] The patient mobile authorization module supports real-time permission management and encryption token generation. The patient mobile authorization module provides a visual interface, allowing patients to dynamically adjust the authorization scope according to data classification, and synchronize permission changes in real time through the blockchain.
[0096] Specifically, the OFD format conversion module: As the core of medical data format conversion, the OFD format conversion module is responsible for converting unstructured data such as discharge summaries, electronic invoices, and imaging materials from PDF / XML format to the domestic OFD format. It supports multi-format compatible parsing and achieves a 30%-60% compression ratio through the Flate compression algorithm and wavelet transform (such as 25MB PDF compressed to 8-12MB). During conversion, the SHA-256 digital signature and national secret SM2 encryption are embedded, and structured metadata is extracted for the hospital HIS system to trigger batch conversion after receiving commercial insurance requests, laying the foundation for subsequent storage and indexing.
[0097] IPFS distributed storage module: The IPFS distributed storage module builds a distributed base for medical data, uniquely identifies OFD files with CID through the content addressing mechanism, automatically deduplicates duplicate files (storage efficiency increased by 40%+), and adopts IPFS-Cluster cluster (private nodes store sensitive data, and public gateways support cross-institutional access). It optimizes the transmission protocol for text and image scenarios (QUIC compresses text, TCP+UDT transmits images), and files are stored with AES-256 encryption. Commercial insurance nodes retrieve files with CID to reduce the risk of privacy leakage.
[0098] Blockchain Network Module: This module builds a medical and commercial insurance claims consortium chain, comprised of a hospital master node and commercial insurance dynamic nodes (commercial insurance nodes are CA-certified). It utilizes the PBFT consensus algorithm to achieve second-level confirmation (2000+ TPS, <500ms latency). Hospital nodes encapsulate the structured index and OFD file CID on the chain for broadcast. Commercial insurance nodes filter and match the index through event monitoring. The indexed data is then uploaded to the chain to form an unalterable hash chain, supporting full-process audits and meeting health insurance data security standards.
[0099] Smart Contract Module: Serving as an automated execution engine, the smart contract module uses preset tracking parameters to provide targeted data notifications (such as the emitDataReady event). Commercial insurance nodes monitor events to trigger IPFS retrieval. Dynamic permissions categorize data into three levels (basic information / diagnostic reports / imaging data). Patient authorization generates a JWT encrypted token (AES-256-GCM encrypted content, RSA-4096 transmission), which automatically expires. Authorization, access, and exception events are recorded and uploaded to the blockchain. GetAuditLog() queries are supported, and machine learning is integrated to automatically freeze permissions and broadcast alerts when an anomaly occurs.
[0100] Patient Mobile Authorization Module: The patient mobile authorization module serves as the entry point for data sovereignty operations, providing a visual, hierarchical authorization interface (color-coded with a slider), supporting batch and temporary authorization, and generating a unique blockchain address-bound authorization record through facial recognition and SM9 authentication. Permission changes are logged on-chain in real time, with the commercial insurance node verifying the latest permissions. Authorization record charts and exception notifications are provided, enhancing user control and awareness of data security.
[0101] See also Figure 2 and Figure 3 Hospitals and commercial insurance providers each operate their own blockchain nodes and jointly build a commercial insurance claims chain. Hospitals and commercial insurance providers upload and read data through their respective blockchain nodes, and the data is automatically synchronized to all nodes in the commercial insurance claims chain. Hospitals and commercial insurance providers use a distributed file system built on IPFS technology. The hospital's HIS system uploads unstructured data (OFD) documents such as discharge summaries, electronic invoices, hospitalization records, and examination images to the IPFS layer through any IPFS node. Commercial insurance providers then retrieve the unstructured medical data required for commercial insurance claims processing from any IPFS system node.
[0102] Commercial insurance company LP_01 initiates a request for commercial insurance claims medical data; the hospital HIS gateway receives the request; the hospital HIS retrieves the patient's basic data and queries the required OFD number CID list through the medical document component; if the CID does not exist, it is uploaded to the IPFS system to obtain the CID; according to the request of commercial insurance company LP_01, the patient's basic information and medical document CID are assembled, and the data is uploaded to the blockchain through the hospital node; the hospital HIS calls the local node smart contract event notification to notify LP_01 to receive data at the specified location; commercial insurance company LP_01 listens to the data belonging to LP_01 from commercial insurance node 1 through the smart contract event monitoring component, skipping other data; commercial insurance company LP_01 parses the monitored data to obtain the ledger location to which the data belongs; commercial insurance company LP_01 queries the required medical data through commercial insurance node 1, parses the patient's basic information and medical document CID; commercial insurance company LP_01 calls the IPFS component to obtain the source file of the medical document OFD file.
[0103] Example 3
[0104] The third embodiment of the present invention is based on the same inventive concept. The present invention proposes a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the steps of a medical insurance data interaction method based on a blockchain smart contract in the above embodiment.
[0105] Example 4
[0106] The fourth embodiment of the present invention is based on the same inventive concept. The present invention proposes a terminal, which includes: a processor and a memory; the processor and the memory communicate with each other; the memory is used to store instructions; the processor is used to execute the instructions in the memory, and execute a medical insurance data interaction method based on a blockchain smart contract in the above embodiment.
[0107] It should be understood that various parts of the present invention can be implemented using hardware, software, firmware, or a combination thereof. In the above-described embodiments, multiple steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented using hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application-specific integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0108] Finally, it should be noted that the above is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A medical insurance data interaction method based on blockchain smart contracts, characterized in that: The following steps are involved: S1. Build an OFD format conversion tool to convert medical unstructured data into domestic OFD format documents and store them through the IPFS distributed file system; S2. Build a medical commercial insurance claims chain based on blockchain technology, where the blockchain includes at least one hospital node and multiple dynamically connected commercial insurance nodes; S3. Deploy a smart contract in the blockchain, wherein the smart contract includes event notification and monitoring functions for targeted transmission of medical data index information; S4. When the commercial insurance company initiates a data request, the hospital node uploads the structured data and the CID of the OFD file to the blockchain through the smart contract; S5. The commercial insurance company obtains the matching medical data index by monitoring the smart contract events and retrieves the OFD source file through the IPFS system; S6. Embed dynamic permission control logic in smart contracts to allow patients to authorize or revoke commercial insurance companies' access rights to hierarchical medical data in real time through digital identities, and generate unique encrypted tokens to bind access scopes.
2. A medical insurance data interaction method based on blockchain smart contract according to claim 1, characterized in that: The OFD format conversion tool is used to convert discharge summaries, electronic invoices, and imaging materials into OFD documents, and use its compression characteristics to reduce file size. The IPFS system uniquely identifies files through CID to avoid duplicate storage.
3. The medical insurance data interaction method based on blockchain smart contract according to claim 1 is characterized in that: The event notification function of the smart contract achieves data isolation through preset tracking parameters. Each commercial insurance node can only listen to events that match its own number, and obtain structured data and OFD file CID list by parsing the event content. The preset tracking parameters include the commercial insurance company's private number.
4. A medical insurance data interaction method based on blockchain smart contract according to claim 1, characterized in that: The dynamic permission control logic includes: Medical data is divided into three levels according to sensitivity: basic information, diagnostic reports, and imaging data. Patients can authorize access to different levels. Each authorization generates an encrypted token and is bound to the patient's digital identity. The token is time-sensitive and follows the principle of least privilege. All authorized operations and data access records are recorded on the chain through smart contracts, forming an unalterable audit log.
5. The medical insurance data interaction method based on blockchain smart contract according to claim 1 is characterized in that: The blockchain nodes are independently operated and maintained by hospitals and commercial insurance companies. Data interaction is achieved through synchronization between nodes, and medical data indexes are stored separately from OFD files. Index data is transmitted through the blockchain, and OFD files are transmitted through the IPFS system.
6. A medical insurance data interaction method based on blockchain smart contract according to claim 1, characterized in that: The smart contract supports repeated monitoring of events to refresh local data, and ensures data consistency through the blockchain consensus mechanism to prevent tampering or abnormal status. The OFD document is embedded with a digital signature and encryption mechanism when it is generated to ensure integrity and security during transmission and storage.
7. The medical insurance data interaction method based on blockchain smart contract according to claim 1 is characterized in that: The machine learning-driven anomaly detection and automatic response mechanisms integrated into the S6 smart contract include: S601. Training a machine learning model based on historical data access records to analyze data request behavior patterns of commercial insurance nodes in real time; S602: When abnormal access behavior is detected, the permission freezing function of the smart contract is automatically triggered to suspend the data access permission of the node; S603: Synchronously generate a security alert event and broadcast it to the hospital node and the patient's mobile terminal through the blockchain, requiring manual review and confirmation before restoring access; S604. The processing process and results of all abnormal events are recorded on the chain through smart contracts, forming a closed-loop security audit.
8. A medical insurance data interaction method based on blockchain smart contracts, characterized in that: A medical insurance data interaction system based on a blockchain smart contract as described in any one of claims 1 to 7, the system comprising: OFD format conversion module, used to convert medical unstructured data into OFD format; IPFS distributed storage module, used to store OFD files and generate unique CIDs; The blockchain network module includes hospital nodes and commercial insurance nodes, which are used for the interaction and storage of medical index data; Smart contract module, integrating event notification, permission control and audit tracking functions; The patient mobile authorization module supports real-time permission management and encryption token generation. The patient mobile authorization module provides a visual interface, allowing patients to dynamically adjust the authorization scope according to data classification, and synchronize permission changes in real time through the blockchain.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, it implements a medical insurance data interaction method based on a blockchain smart contract as described in any one of claims 1 to 7.
10. A readable storage medium, characterized in that: The readable storage medium stores a computer program, and when the computer program is executed by the processor, it implements the medical insurance data interaction method based on blockchain smart contract as described in any one of claims 1 to 7.