Detailed Description
The invention is further described with reference to the following examples.
referring to fig. 1, the present embodiment provides a block chain-based medical data acquisition and management system, including: the user account management module 1 is used for receiving application information sent by a user, generating an account and a password of the user and feeding back the account and the password to the user; the block chain storage module 2 is used for storing a block chain, and the block chain comprises a plurality of storage nodes which are in communication connection; the wireless sensor network module 3 is used for acquiring medical data of a patient and storing the medical data into corresponding storage nodes on the block chain; the access authority distribution module 4 is used for distributing the access authority of the storage node in the block chain for the user according to the application information of the user; and the data management module is used for calling out the medical data corresponding to the identification information in the block chain according to the received identification information of the storage node input by the user.
Preferably, each of the storage nodes further comprises: identification information of the medical data storage node, identification information of the medical data storage node connected with the medical data storage node, a hash value and a time stamp.
Preferably, the user account management module 1 is specifically configured to receive application information of a user, generate an account and a password of the user, store the account and the password of the user in a mapping table, and feed back the account and the password to the user.
Preferably, the data management module is specifically configured to call out, according to the identification information of the storage node received from the user, the medical data corresponding to the identification information in the blockchain by using a transparent mathematical algorithm.
the system designed by the embodiment of the invention has the functions of initiating query, acquiring patient medical record, consulting desensitization medical data and the like, promotes the circulation and sharing of medical big data, and is favorable for promoting the multi-party interoperation of the medical big data.
In one embodiment, the wireless sensor network module 3 includes a single sink node, four relay nodes and a plurality of sensor nodes, the sink node is deployed at a central position of a set monitoring area, the four relay nodes are disposed at different positions in the monitoring area, distances between the four relay nodes and the sink node are the same, and the plurality of sensor nodes are deployed in the monitoring area according to actual monitoring needs; dividing the monitoring area into m virtual grid areas, and enabling each relay node to be in different virtual grid areas; when a network is initialized, selecting a relay node as a cluster head in a virtual grid area where the relay node is located, selecting a sensor node as a cluster head from each virtual grid area which does not contain the relay node, and selecting the cluster head closest to each sensor node to join in a cluster; the sensor nodes are responsible for acquiring medical data and sending the acquired medical data to the corresponding cluster heads, and the medical data received by the cluster heads of the non-relay nodes is finally sent to one of the relay nodes; the relay node directly communicates with the sink node to send the received medical data to the sink node in a single hop, and the sink node gathers the received medical data and sends the medical data to the block chain storage module 2.
In one implementation, selecting one sensor node as a cluster head from each virtual grid area not including a relay node includes:
(1) Calculating the gravity center position of the virtual grid area:
In the formula, VeRepresenting the gravity center position of a virtual grid area e, wherein x (b) represents the x-direction coordinate of the position of the b-th sensor node in the virtual grid area e, y (b) is the y-direction coordinate of the position of the b-th sensor node, z (b) is the z-direction coordinate of the position of the b-th sensor node, a convergent node is taken as the origin of coordinates, n iseThe number of sensor nodes in the virtual grid area e is the number of the sensor nodes in the virtual grid area e;
(2) Calculating the weight of each sensor node in the virtual grid area, and selecting the sensor node with the largest weight as a cluster head of the virtual grid area; the calculation formula of the weight is as follows:
In the formula, ReaFor the weight of the b-th sensor node in virtual grid area e,For the b-th sensor node and the gravity center position Vethe distance of (a) to (b),for the a-th sensor node and the gravity center position V in the virtual grid area eeThe distance of (d); wb,ois the distance between the b-th sensor node and the sink node, Wa,oIs the distance between the a-th sensor node and the sink node, nethe number of sensor nodes in a virtual grid area e, h1、h2is the set weight coefficient.
In the calculation formula, a sensor node closer to the gravity center position of the virtual grid area and the sink node has a higher probability to serve as a cluster head of the virtual grid area. In the embodiment, the sensor nodes with the highest probability are selected from each virtual grid area to serve as the cluster heads, so that the cluster heads can be uniformly distributed in the whole monitoring area as much as possible, the overall optimal performance of the clustering result can be improved, the energy consumption of collecting and transmitting medical data by the cluster heads is reduced, and the stability of the cluster heads in medical data collection is improved.
In one embodiment, the relay node is movable, a cluster head set in direct communication with the relay node is set as Q, the relay node periodically monitors energy of cluster heads in the set Q, and the energy potential of the cluster heads in the set Q is calculated according to the following formula:
In the formula, FdIs the energy potential of cluster head d in set Q, GdIs the current remaining energy of cluster head d, GdpThe current residual energy m of the p-th sensor node in the cluster corresponding to the cluster head ddThe cluster head d corresponds to the number of sensor nodes in the cluster, CdCommunication distance, G, for cluster head dlIs the current remaining energy of the ith cluster head in set Q, COA communication distance of a relay node;
If cluster heads with energy potential force larger than 0 exist in the set Q, the sink node selects the sensor node with the maximum energy potential force and the second maximum energy potential force as a target node from the cluster heads with the energy potential force larger than 0, and the coordinates of the two target nodes are respectively set as (x)1,y1,z1)、(x2,y2,z2) Then the relay node is directed to the pointis moved by a set distance; wherein the total distance that the relay node moves cannot exceed a preset upper distance limit.
The cluster head near the relay node needs to receive and forward medical data in the cluster, and needs to relay and forward medical data of other cluster heads, so that more energy needs to be consumed than other cluster heads, and thus an energy hole is easily generated near the relay node by the wireless sensor network.
Based on the problem, the relay node is arranged to be movable, a calculation formula of energy potential force is innovatively defined, and when the energy potential force of a cluster head near the relay node is larger than 0, the relay node is moved to the reference point direction determined by the cluster head with larger energy potential force by a set distance, so that the cluster head with lower energy is prompted to be too far away from the moved relay node to no longer undertake the task of relay forwarding. The embodiment is beneficial to balancing the energy of each cluster head, reduces the energy cavity phenomenon, further effectively prolongs the network survival time, and improves the stability of medical data collection.
in one embodiment, the cluster head of the non-relay node regularly sets a communication distance threshold, and when the distance from the cluster head of the non-relay node to the nearest relay node does not exceed the set communication distance threshold, the cluster head of the non-relay node directly transmits the received medical data to the nearest relay node; when the distance from the cluster head of the non-relay node to the nearest relay node exceeds the set communication distance threshold value, selecting one nearest cluster head from the rest cluster heads closer to the nearest relay node as a next hop node, and sending the received medical data to the next hop node;
The setting formula of the communication distance threshold is as follows:
In the formula, Ci(t) a communication distance threshold value set for the t-th period of the cluster head i,For the maximum communication distance that the cluster head i can adjust,Adjustable minimum communication distance, G, for cluster head iiIs the current remaining energy of cluster head i, Gi0Is the initial energy of the cluster head i, Gminis a preset minimum energy value, delta is a preset adjustment factor, and the value range of delta is [0.6,0.8 ]]。
In this embodiment, the cluster head of the non-relay node sets a communication distance threshold, compares the distance between the cluster head of the non-relay node and the closest relay node with the communication distance threshold, and selects an appropriate routing form according to the comparison result to send the medical data to the closest relay node, thereby being beneficial to optimally saving the energy cost for transmitting the medical data to the relay node by the cluster head. The distance threshold value is set according to the formula of the distance threshold value according to the current residual energy of the cluster head, the routing mode of the cluster head is adjusted according to the distance threshold value calculated through the formula, the rate of energy consumption of the cluster head is favorably reduced, rapid failure of the cluster head is avoided, the working period of the cluster head is effectively prolonged, and the reliability of medical data transmission is further improved on the whole.
Finally, it should be noted that the above embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the protection scope of the present invention, although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions can be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.