Block chain-based medical image data security management method and system
Technical Field
The invention relates to a medical image data security technology, in particular to a medical image data security management method and system based on a block chain.
Background
With the continuous development of the artificial intelligence technology, the artificial intelligence technology is widely applied to the medical image auxiliary diagnosis system, and the auxiliary diagnosis system performs intelligent analysis on the uploaded medical images to assist diagnosis. When the auxiliary diagnosis system is used, images to be analyzed need to be exported from a medical image information system (PACS) to a local computer and then uploaded to the auxiliary diagnosis system, most of auxiliary diagnoses are transmitted through a web front end by using an uploading component or a local file transmission program, and an AI service analysis request is sent for analysis after the file transmission is successful.
The image data is encrypted according to the characteristic in the prior art, which may have the risk of image data leakage or tampering while the current medical cloud image data is shared.
For example, the patent names: a medical image data decentralized management method based on a block chain is disclosed, and the patent application number is as follows: CN 201810746005.7; the application date is: 2018-07-09, a block chain-based medical image data decentralized management method, wherein all ends of data upload medical image data of all ends of the data, the medical image data is stored as an interplanetary file system (IPFS) file, hash values of the medical image data are taken, and public keys of all ends of the data are adopted to encrypt a link list file in the IPFS; the data usage right contract decrypts the encrypted link list file in the steps by adopting a private key of all data ends according to the intelligent contract, sends data usage end public key information and a payment token to the data usage right contract at the data usage end, and sends the decrypted link list file to the data usage end after re-encrypting the decrypted link list file by adopting a user public key when the medical image data is requested to be acquired, and meanwhile, generates a block chain for storing the hash address; and the data using end performs decryption operation on the medical image data through the private key of the data using end to obtain a linked list file, and indexes the linked list file to the interplanetary file system to obtain actual medical image data.
The technology is characterized in that a Hash address for storing data is encrypted, and the decryption authority of the address is kept in a public key and private key mode, so that only a user of a block chain can decrypt an image address to access an image.
For example, the patent name, a medical image data transmission method, apparatus, device and medium; patent application No.: CN 202010917032.3; the application date is: 2020-09-03; the patent describes a medical image data transmission method, device, equipment and medium, can filter out the data of DICOM format at first, further reject the illegal information that can not be used for AI analysis again, not only effectively avoided the influence to AI diagnosis, practiced thrift the bandwidth simultaneously, realize the normal transmission to medical image data, adopt the distributed storage technology based on the zone chain to generate the block information of every subfile, upload the block information fragmentation of a plurality of fragment data of every subfile and every subfile that corresponds to the zone chain node, not only can realize the fragmentation storage to medical image data, simultaneously because the block chain data can not be falsified, effectively improved data transmission's security. In addition, the invention can also be applied to intelligent medical treatment, thereby promoting the construction of intelligent cities and the development of digital medical treatment. The invention also relates to a block chain technology, and the fragment data and the block information can be stored in the block chain node.
Aiming at the fact that the whole image file is stored in the technology, the image file is guaranteed not to be tampered by the fact that the block chain cannot be tampered.
However, encrypting the image file or the image access address prolongs the access time of the image file, which results in delay or overlong waiting time in the access process, and reduces the efficiency of image sharing. In addition, the above-mentioned techniques cannot guarantee that the access to the image is traced after the image data is tampered.
Disclosure of Invention
The invention provides a medical image data security management method and system based on a block chain, aiming at the defects that medical cloud image data in the prior art can be tampered with, and access records can be tampered with. The integrity of the image file and the traceability of the access record are ensured while the access speed of the image file is not influenced.
In order to solve the technical problem, the invention is solved by the following technical scheme:
a medical image data safety management method based on a block chain comprises the following steps,
creating an image block chain database: selecting an image file from an image management system of any hospital, and transmitting the image file to a server; the server establishes a block chain database for the received image file, and the block chain database stores image fingerprints, access records and access record fingerprints;
storage of blockchain database: the image management system of any hospital selects an image file, uploads the file to the server, and the server randomly generates a non-repetitive image ID, encodes the image into an image fingerprint through an irreversible hash function, and stores the image fingerprint in a block of a block chain database;
the server accesses the image from the image cloud database to generate an access record, encodes the access record into an access record fingerprint through an irreversible hash function, and stores the access record and the fingerprint in a block;
fingerprints in the blocks are stored in a structure of a merkel tree, and the value (merkleRoot) of a root node of the fingerprints is used as the address value of the next block; the address of the first block is null;
updating the image block chain database: the server updates the block chain database according to the Mercker tree structure;
broadcasting of the image blockchain database:
the server broadcasts to the servers of other hospitals and sends the updated information to the servers of other hospitals.
The image fingerprints, the access records and the fingerprints of the block chain database are stored, so that the integrity of medical image data and the access records in the area is effectively protected.
Preferably, the method further comprises the integrity judgment of the image file, and the server compares the image fingerprint of the blockchain database with the image fingerprint calculated in real time by the called image file, so as to judge the integrity of the image file.
By comparing the image fingerprints of the block chain database, the image data is guaranteed not to be tampered, and records of the image data accessed by a user are stored.
Preferably, the method further comprises the step of judging the accuracy of the access record of the blockchain database, and the server confirms the blockchain information by updating the broadcast blocks, so as to confirm the accuracy of the access record of the blockchain database. By comparing the information of the block chain database, the access record of the image data is guaranteed not to be tampered.
Preferably, the step of updating the video blockchain database includes,
step 1, adding a bottom leaf node to the Mercker tree, and taking the image fingerprint of a block chain database as the hash value of the added bottom leaf node of the Mercker tree;
step 2, if the number of the newly added leaf nodes of the layer is even, the leaf nodes and the hash values of the adjacent isolated leaf nodes are spliced to form a character string, and the hash values are calculated through SHA256 to replace the original values of the previous layer;
if the newly added leaf node of the layer is an odd number, the leaf node is taken as an isolated leaf node, and the hash value of the leaf node is calculated to be a new hash value through SHA256 and is newly added to the previous layer;
step 3, repeating the step 2 for the previous layer;
and 4, repeating the step 3, and calculating a unique hash value as a merkleRoot value of the Mercker tree.
Preferably, the integrity judging step of the image file includes,
the server calls the ID data of the block chain database from the image cloud recording module and determines the calling address of the image data and the block where the image fingerprint is located;
the server acquires an image file through an image calling address, calculates a hash value of the image file through an irreversible hash function, and performs Merckel tree certification with the belonging block, so as to determine the integrity of a block chain database acquired by the server;
the server sends the image file to a terminal X and generates an access record in a json format;
the server splices random numbers at the current time, generates a hash value as the ID of the access record through an irreversible hash function, adds the access record into a block which is not packaged at present, and updates the Mercker tree of the block;
the other server broadcasts the access record and the ID of the blockchain database to all other servers in the area a, and the other servers update the blockchain to complete synchronization of the blockchain.
Preferably, the step of determining the accuracy of the access record of the blockchain database comprises,
the user checks all accessed records of the image files through the in-hospital terminal of the hospital and determines the access records;
the user modifies the access record;
the user saves the modification, the preposed server encrypts the modified access record through an irreversible hash function and updates the Mercker tree of the block on the server;
the server of the hospital detects the update of the Mercker tree in the block and broadcasts the updated access records to the servers of all other hospitals;
the server of other hospitals receives the broadcast and locates the block to which the ID belongs;
if the block is a block which is packaged and encapsulated, after the merkleRoot is calculated, comparing the merkleRoot with the prebockHash of the next block, wherein the merkleRoot and the preBlockHash are different, and the block chain information is wrong, so that the updating is proved to be tampering information, the updating is cancelled, and error information is broadcasted;
if the block is a block which is not packaged currently, performing Mercker certification on the updated access record, if the obtained merkleRoot is different from the current value, certifying that the update is tampering information, canceling the update, and broadcasting error information;
and the hospital server receives more than half of error information broadcast by the front servers, downloads the blocks from one of the front servers, and repeatedly updates, so that the user fails to tamper.
The medical image data safety management system based on the block chain comprises an image cloud database, an image cloud record and a server; selecting an image file from an image management system of any hospital, transmitting the image file to a server, and storing the image fingerprint in a block chain database; uploading the image file to an image cloud database, and sending an image file address, an image fingerprint and an image ID to an image cloud record; the server updates and broadcasts the blockchain database,
preferably, the system further comprises an integrity judgment module, the server judges the integrity of the image blockchain database, and the server calls the image file of the image cloud database to calculate the fingerprint in real time and compare the fingerprint with the image fingerprint of the blockchain database, so that the integrity of the image file is judged.
Preferably, the system further comprises an access record accuracy judging module, the server judges the accuracy of the access record of the image blockchain database, and the server confirms the blockchain information through the access record of the user so as to confirm the accuracy of the access record of the blockchain database.
Due to the adoption of the technical scheme, the invention has the remarkable technical effects that: the data are encrypted and verified based on regional medical cloud image data of the block chain, and in the process of regional medical image cloud data sharing, data cannot be tampered and access records can be traced.
Drawings
FIG. 1 is a system composition diagram of the present invention.
Fig. 2 is a system composition diagram of the present invention.
FIG. 3 is a Mercker tree diagram according to the present invention.
Detailed Description
The present invention is further described in detail with reference to the drawings and the embodiment, in which the irreversible hash function is SHA 256.
Example 1
Area a contains n hospitals. Each hospital deploys a server which is connected with the PACS, the image cloud database and the image cloud records in the hospital, the server stores a block chain database, and the block chain databases of all the servers are kept to be updated synchronously; the image cloud database stores influence data of n hospitals in the area A; the image cloud records store the affected data addresses of the image data and the preBlockHash of the block where the fingerprint of the image is located. The local block chain performs block packaging once every 10 minutes, and a next block is newly built.
A medical image data safety management method based on a block chain comprises the following steps,
creating an image block chain database: selecting an image file from an image management system of any hospital, and transmitting the image file to a server; the server establishes a block chain database for the received image file, wherein the block chain database comprises an image ID, an image address and an image fingerprint;
the PACS of hospital 1 files an example of a CT image file, the image file is transmitted to the front server, the front server uses the creation time 2020/11/2013: 00:14 of the image to splice a random number 23, and the id of the image file is 8b9e9050b61cc09a9fd334e83a3b2fdcd65fdc46554cb04f53a823765c5c85d4 calculated by SHA 256; the hash value of the image file is calculated by SHA256 and is used as an image fingerprint;
storage of the image blockchain database: the server transmits the created block chain database to the image cloud recording module, and the image cloud recording module stores the received block chain database;
updating the image block chain database: the server updates the block chain database according to the Mercker tree;
broadcasting of the image blockchain database: the server broadcasts to servers of other hospitals, and sends the image ID and the image fingerprint to servers of other hospitals.
The image ID, the image address and the image fingerprint of the block chain database are stored, so that the safety of medical image data in the area is effectively protected.
The step of updating the image blockchain database includes,
step 1, adding a bottom leaf node to the Mercker tree, and taking the image fingerprint of a block chain database as the hash value of the added bottom leaf node of the Mercker tree;
step 2, if the number of the newly added leaf nodes of the layer is even, the leaf nodes and the hash values of the adjacent isolated leaf nodes are spliced to form a character string, and the hash values are calculated through SHA256 to replace the original values of the previous layer;
if the newly added leaf node of the layer is an odd number, the leaf node is taken as an isolated leaf node, and the hash value of the leaf node is calculated to be a new hash value through SHA256 and is newly added to the previous layer;
step 3, repeating the step 2 for the previous layer;
and 4, repeating the step 3, and calculating a unique hash value as a merkleRoot value of the Mercker tree.
Example 2
On the basis of the embodiment 1, the embodiment further includes an integrity judgment of the image file, and the server performs currency matching according to the image fingerprint of the block chain database and the image fingerprint of the cloud recording module, so as to perform the integrity judgment on the image file.
By comparing the image fingerprints of the block chain database, the image data is guaranteed not to be tampered, and records of the image data accessed by a user are stored.
The user a uses the hospital terminal X (IP address 192.168.8.117 of local area network) to call the images with id 8b9e9050b61cc09a9fd334e83a3b2fdcd65fdc46554cb04f53a823765c5c85d4 in hospital 2 (IP address of public network) at 11/20/15: 30:22 in 2020.
The hospital computer X calls data of a target id from the image cloud record through the front-end server, and positions a calling address of the image data and a block where the image fingerprint is located;
after the front-end server obtains an image file through an image calling address, the hash value of the image file is calculated through SHA256, and the hash value and the block to which the image file belongs are subjected to Merckel certification to judge whether the data keep integrity and consistency;
the front-end server sends the image file to a terminal X and generates an access record in a json format, wherein the contents are as follows:
{
requestIP:192.168.8.117,
serverIP:122.225.243.242,
imageID:8b9e9050b61cc09a9fd334e83a3b2fdcd65fdc46554cb04f53a823765c5c85d4,
requestTime:2020-11-20 15:30:22
};
the front-end server uses the current time as: 2020/11/2015, splicing the random number 12 at 31:01, generating a hash value 7ff7858378d31bc63ee7fd4fc98d54de201d2acd0e512be4bbfed2ce2dc7951d as the id of the access record through SHA256, adding the access record into the current unpacked block, and updating the Merckel tree of the block;
the front server of hospital 2 broadcasts the access record and id to all front servers in area a, and other front servers update the block chain to complete the synchronization of the block chain.
Example 3
On the basis of the above embodiment, the present embodiment further includes determining the accuracy of the access record of the blockchain database, and the server confirms the blockchain information through the access record of the user, so as to confirm the accuracy of the access record of the blockchain database. By comparing the access record with the information of the block chain database, the access record of the image data is ensured not to be falsified.
The step of determining the accuracy of the access records to the blockchain database includes,
user b views all the accessed records of the image file with the id of 8b9e9050b61cc09a9fd334e83a3b2fdcd65fdc46554cb04f53a823765c5c85d4 through the in-hospital terminal Y (the local area network IP address is 192.168.8.117) of hospital c at 11/2020, 21/10: 10, and locates the accessed record with the id of 7ff7858378d31bc63ee7fd4fc98d54d 201d2acd0e512be4bbfed2ce2dc7951 d;
user b modifies the access record to modify the requestIP into 192.168.8.112;
the user b saves the modification, the front-end server encrypts the modified access record through SHA256 and updates the Mercker tree of the block on the server;
the front server of hospital c detects the update of the Mercker tree in the block and broadcasts the updated access records to the front servers of all other hospitals;
the front servers of other hospitals receive the broadcast and locate the block with id 7ff7858378d31bc63ee7fd4fc98d54de201d2acd0e512be4bbfed2ce2dc7951 d;
if the block is the block which is packaged and encapsulated, calculating a merkleRoot and comparing the merkleRoot with the block address of the next block, wherein the merkleRoot and the block address of the next block are different, block chain information is wrong, the update is proved to be tampering information, the update is cancelled, and error information is broadcasted;
if the block is a block which is not packaged currently, performing Mercker certification on the updated access record, if the obtained merkleRoot is different from the current value, certifying that the update is tampering information, canceling the update, and broadcasting error information;
and the front-end server of the hospital c receives more than half of the error information broadcast by the front-end servers, downloads the blocks from one of the front-end servers, rolls back the update, and fails to tamper with the user b.
Example 4
On the basis of the embodiment 1, the medical image data safety management system based on the block chain comprises a cloud recording module and a server; selecting an image file from an image management system of any hospital, and transmitting the image file to a server; transmitting the created block chain database to an image cloud recording module; the server updates and broadcasts the image block chain database, uploads the image block chain database to the cloud recording module, and the cloud recording module stores the received block chain database.
The medical image data safety management system based on the block chain further comprises an integrity judgment module, the server judges the integrity of the image block chain database, and the server performs currency matching according to the image fingerprints of the block chain database and the image fingerprints of the cloud recording module, so that the integrity of the image file is judged.
The medical image data safety management system based on the blockchain also comprises an access record accuracy judgment module, the server judges the accuracy of the access record of the image blockchain database, and the server confirms the information of the blockchain through the access record of the user so as to confirm the accuracy of the access record of the blockchain database.