CN114065246B - Medical block chain data uplink method and device - Google Patents

Medical block chain data uplink method and device Download PDF

Info

Publication number
CN114065246B
CN114065246B CN202111351991.4A CN202111351991A CN114065246B CN 114065246 B CN114065246 B CN 114065246B CN 202111351991 A CN202111351991 A CN 202111351991A CN 114065246 B CN114065246 B CN 114065246B
Authority
CN
China
Prior art keywords
node
hospital
hash value
uplink
nodes
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111351991.4A
Other languages
Chinese (zh)
Other versions
CN114065246A (en
Inventor
秦晓宏
汪振兴
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Clinbrain Information Technology Co Ltd
Original Assignee
Shanghai Clinbrain Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Clinbrain Information Technology Co Ltd filed Critical Shanghai Clinbrain Information Technology Co Ltd
Priority to CN202111351991.4A priority Critical patent/CN114065246B/en
Publication of CN114065246A publication Critical patent/CN114065246A/en
Application granted granted Critical
Publication of CN114065246B publication Critical patent/CN114065246B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • Computer Hardware Design (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Bioethics (AREA)
  • Databases & Information Systems (AREA)
  • Medical Treatment And Welfare Office Work (AREA)

Abstract

The application provides a medical block chain data uplink method and a medical block chain data uplink device, wherein the method comprises the following steps: the alliance management node generates a first Hash value; receiving second Hash values calculated by the plurality of hospital nodes according to the block chain information of the hospital nodes; receiving uplink requests broadcast by a plurality of hospital nodes in a first time period, wherein each uplink request comprises medical data corresponding to the to-be-uplink; calculating the matching degree between each second Hash value and the first Hash value; and selecting one of the plurality of hospital nodes as a master node according to the matching degree, and broadcasting master node confirmation information to enable the master node to perform packaging and uplink on the medical data in the first time period. The method and the device can improve the efficiency of the main node confirmation, and further improve the efficiency of data chaining.

Description

Medical block chain data uplink method and device
Technical Field
The present application relates to the field of blockchain technology, and more particularly, to a method and an apparatus for uplink of medical blockchain data.
Background
Due to the characteristics of unforgeability and collective maintenance, the blockchain technology is also increasingly applied in the medical field. By utilizing the block chain storage technology, the medical data of the patients can be shared among hospitals, the repeated examination of the patients is avoided, the diagnosis and treatment efficiency is improved, and the cost is reduced.
However, in the conventional technology, in the process of performing uplink of medical data of a patient, a voting master node needs to be performed among hospitals, and the elected master node performs uplink of medical data of the patient, so as to realize data sharing among the hospitals. However, the process of voting for the master node in the conventional method is too complicated, resulting in inefficient uplink of the patient's medical data.
Disclosure of Invention
Accordingly, there is a need for a method and apparatus for uplink of data in a block link in a medical system that improves uplink efficiency.
A first aspect of the present application provides a method for uplink of medical blockchain data, the method including:
the alliance management node generates a first Hash value;
receiving second Hash values calculated by the plurality of hospital nodes according to the block chain information of the hospital nodes;
receiving uplink requests broadcast by a plurality of hospital nodes in a first time period, wherein each uplink request comprises medical data corresponding to the to-be-uplink;
calculating the matching degree between each second Hash value and the first Hash value;
and selecting one of the plurality of hospital nodes as a main node according to the matching degree, and broadcasting main node confirmation information to enable the main node to perform packaging and uplink on the medical data in the first time period.
In one embodiment, the receiving the second Hash value calculated by the plurality of hospital nodes according to the own blockchain information includes:
and receiving second Hash values generated by the plurality of hospital nodes according to the block heights, the random values and the tree root Hash values of the plurality of hospital nodes in the first time period.
In one embodiment, before the selecting one of the plurality of hospital nodes as the master node according to the matching degree, the method further includes:
receiving verification results of the plurality of hospital nodes on the uplink request;
and when the verification result is that uplink is approved, selecting one of the plurality of hospital nodes as a main node according to the matching degree.
A second aspect of the present application provides a method for uplink of medical blockchain data, the method including:
the hospital node M generates a second Hash value;
broadcasting an uplink request, wherein the uplink request comprises medical data M1 corresponding to the medical data to be uplink;
receiving an uplink request broadcast by a hospital node N in a first time period, wherein the uplink request comprises medical data N1 corresponding to be uplink;
acquiring main node confirmation information generated according to a second Hash value of at least one hospital node;
and when the determined main node is the hospital node M, performing packaging uplink on the medical data M1 and the medical data N1 according to a preset uplink rule.
In one embodiment, the obtaining of the master node confirmation information generated according to the second Hash value of at least one hospital node comprises: acquiring main node confirmation information generated according to the matching degree between the second Hash value of each hospital node and the first Hash value of the alliance management node; the second Hash value is generated by the corresponding hospital node according to the block height, the random value and the tree root Hash value of the corresponding hospital node in the first time period, and the main node confirmation information is information which takes the hospital node corresponding to the second Hash value with the highest matching degree with the first Hash value as the main node.
In one embodiment, the obtaining of the master node confirmation information generated according to the matching degree between the second Hash value of each hospital node and the first Hash value of the federation management node includes:
and acquiring the main node confirmation information broadcasted by the alliance management node, calculating the matching degree between each second Hash value and the first Hash value by the alliance management node, and selecting one from the plurality of hospital nodes as the main node according to the matching degree.
In one embodiment, when the master node confirmation information broadcasted by the alliance management node is not received in the second time period, the last generated first Hash value of the alliance management node is obtained, and the last generated first Hash value is used as the first Hash value of the second time period;
acquiring a second Hash value of the hospital node N;
calculating the matching degree of each second Hash value and the first Hash value;
and selecting the hospital node corresponding to the second Hash value with the highest matching degree as the main node.
In one embodiment, the method further comprises: obtaining voting result information selected aiming at the main node, and executing the hospital node M to generate a second Hash value when the voting result does not generate the main node;
the obtaining of the master node confirmation information generated according to the second Hash value of at least one hospital node includes:
and acquiring main node confirmation information generated according to the matching degree between the second Hash value of each candidate node and the second Hash value of the node to be voted, wherein the node to be voted is the last node to be voted in a main node voting selection link, and the candidate node is determined according to the voting result information.
In one embodiment, the packaging and winding the medical data M1 and the medical data N1 according to a preset winding rule includes:
sequencing the medical data M1 and the medical data N1 and broadcasting a cochain check request;
receiving verification result information broadcast by other hospital nodes after the sequenced medical data are verified according to a preset verification rule;
counting whether the number of the received verification result information which represents that the verification is passed reaches a first value or not, and if yes, performing uplink transmission on the medical data M1 and the medical data N1.
In one embodiment, before the broadcasting the uplink request, the method further comprises:
acquiring data to be uplink;
acquiring an encryption key;
encrypting the data to be uplinked according to the encryption key, and taking the encrypted data as the medical data M1;
after the packaging and winding the medical data M1 and the medical data N1 according to preset winding rules, the method further includes:
and generating an identification code according to a decryption key corresponding to the encryption key, so that the other hospital nodes can obtain the decryption key for decrypting the medical data M1 through the identification code.
A third aspect of the present application provides a medical blockchain data uplink apparatus, including:
a Hash value generating first module for generating a first Hash value; receiving second Hash values calculated by the plurality of hospital nodes according to the block chain information of the hospital nodes;
a first module for requesting to receive uplink requests broadcasted by a plurality of hospital nodes in a first time period, wherein each uplink request comprises medical data corresponding to the to-be-uplink;
the main node confirms a first module which is used for calculating the matching degree between each second Hash value and the first Hash value; and selecting one of the plurality of hospital nodes as a master node according to the matching degree, and broadcasting master node confirmation information to enable the master node to perform packaging and uplink on the medical data in the first time period.
A fourth aspect of the present application provides a medical blockchain data chaining apparatus, the apparatus comprising:
the Hash value generation second module is used for generating a second Hash value; broadcasting an uplink request, wherein the uplink request comprises medical data M1 corresponding to the medical data to be uplink;
a request receiving second module, configured to receive a uplink request broadcast by a hospital node N in a first time period, where the uplink request includes medical data N1 to be uplink;
the main node confirmation second module is used for acquiring main node confirmation information generated according to a second Hash value of at least one hospital node;
and the data uplink module is used for performing packaged uplink on the medical data M1 and the medical data N1 according to a preset uplink rule when the determined main node is the hospital node M.
According to the medical blockchain data uplink method, the first Hash value is generated through alliance management connection, each hospital node generates the second Hash value, the alliance management nodes determine which hospital node is used as the main node of uplink according to the matching degree of the second Hash value and the first Hash value, and the main node confirmation information is broadcasted after the main node is confirmed, so that the main node confirmed by the alliance management nodes in the blockchain network carries out uplink on medical data to be uplink according to the uplink rule. According to the method, the alliance management nodes are introduced, the main nodes are determined through comparison of Hash values, the complicated main node election links such as voting consensus among hospital nodes are not needed, the main node confirmation efficiency is improved, and the data uplink efficiency is further improved. Meanwhile, the Hash values are generated according to the same rule and are confirmed by the alliance management node, so that the risk that the elected main node is a bad node is reduced.
Drawings
FIG. 1 is a diagram illustrating an example of a process for uplink data transmission in a block chain;
FIG. 2 is a flowchart illustrating a method for uplink of medical blockchain data according to an embodiment;
FIG. 3 is a flowchart illustrating a method for uplink of medical blockchain data according to another embodiment;
FIG. 4 is a schematic diagram illustrating a procedure of performing a packaged uplink on the medical data M1 and the medical data N1 according to a preset uplink rule according to an embodiment;
FIG. 5 is a flowchart illustrating a method for uplink of medical blockchain data according to another embodiment;
FIG. 6 is a block diagram of an apparatus for medical blockchain data uplink in one embodiment;
FIG. 7 is a block diagram of an apparatus for uplink of medical blockchain data according to another embodiment;
fig. 8 is a block diagram of a medical blockchain data uplink apparatus according to another embodiment.
Detailed Description
Hereinafter, embodiments of the present application will be described with reference to the accompanying drawings. It should be understood that the description is illustrative only and is not intended to limit the scope of the present application. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present application.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The words "a", "an" and "the" and the like as used herein are also intended to include the meanings of "a plurality" and "the" unless the context clearly dictates otherwise. Furthermore, the terms "comprises," "comprising," and the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It is noted that the terms used herein should be interpreted as having a meaning that is consistent with the context of this specification and should not be interpreted in an idealized or overly formal sense.
The method for uplink of medical blockchain data provided by the present application can be applied to the scenario shown in fig. 1. The blockchain network includes alliance management nodes and a plurality of hospital nodes (only 4 hospital nodes a, B, C, and D are shown in the figure, and may further include more hospital nodes), the alliance management nodes may be background servers for managing the blockchain network, and may set permissions of each node in the blockchain network for reading and writing data, and the like, the hospital nodes are servers or server portions in the blockchain network that can share blockchain data, and each server may be one or more nodes in the blockchain network. Data to be uplink is generated in real time in the blockchain network, for example, there is a hospital node a that needs to uplink medical data M1, and it can be understood that there are a plurality of hospital nodes generating medical data to be uplink in the same time period. The alliance management node can select a main node for performing data uplink in the time period from each hospital node, and the selected main node completes or leads each medical data uplink in the time period according to a preset uplink rule. For example, the primary node directly performs uplink transmission on the packed data, or the primary node determines an uplink transmission rule, for example, determines a root Hash value of the next block, and other nodes perform data uplink transmission individually or jointly according to the rule.
In one embodiment, as shown in fig. 2, a method for uplink of a health care block chain data is provided, which is described by taking the method as an example of being applied to a federation management node shown in a scenario of fig. 1, and the method includes:
in step 202, the federation management node generates a first Hash value.
In this embodiment, the alliance management node may be an alliance chain background management server, and the server may be a server of a hospital initiating an alliance chain in the blockchain network. The alliance management node can set the authority of other hospital nodes for reading, writing, modifying and the like of data.
The first Hash value is a Hash value generated by the alliance management node, and the Hash value is a character string with a preset length. The first Hash value is a character string used for comparing with Hash values generated by other hospital nodes, the generation result of the first Hash value is related to the actual situation of the current block chain of the alliance management node, the latest blocks in the block chain data are different under the common situation, and the first Hash values generated by the alliance management node are different.
And 204, receiving second Hash values calculated by the plurality of hospital nodes according to the block chain information of the plurality of hospital nodes.
There may be multiple hospital nodes in the blockchain network, and each hospital node may be a server of a corresponding hospital. Such as having 10 hospital nodes or 20 hospital nodes, etc. In this embodiment, each node may be a server or a client, where as a server, it may be connected to other hospital nodes, and as a client, it may be connected to other hospital nodes.
The second Hash value is a Hash value generated by the hospital node, is a character string with a preset length corresponding to the first Hash value, and is used for comparing with the first Hash value. The same Hash value generation rule is preset in the block chain network, each hospital node can calculate according to the same rule to generate respective Hash value, and therefore fairness generated by the identification code main node can be guaranteed, and fairness confirmed by the main node at the back is improved.
In one embodiment, the first and second Hash values are numeric values, the result of which is related to one or more parameters in the corresponding block chain. Such as relating to one or more parameters of its own block height, tree root Hash value, etc. Specifically, the first Hash value and the second Hash value are both long integer type values, such as 2, 10, 16, etc. For example, the length of the first Hash value may be "ACB 539CD 25" and the length of the second Hash value may be "92578 BAC 42", and it is understood that the length of the Hash value may be longer.
In one embodiment, each hospital node generates a second Hash value and sends the second Hash value to the federation management node, and the federation management node can receive the second Hash value sent by each hospital node. Each hospital node only sends the Hash value generated by the hospital node to the alliance management node, but not to other hospital nodes. Or, each hospital node only sends the Hash value generated by the hospital node to the alliance management node in real time, and the Hash value generated by the hospital node is delayed to be disclosed in the block chain network. Therefore, the risk of cheating caused by the fact that other hospital nodes acquire the Hash value of the hospital nodes before the Hash value is generated can be prevented.
Step 206, receive uplink requests broadcast by a plurality of hospital nodes in a first time period, where each uplink request includes medical data to be uplink-linked.
In this embodiment, the hospital node that generates the data to be uplink may directly broadcast the uplink request to the blockchain network, where the uplink request includes the medical data to be uplink and also includes its own node identifier, so that each node can identify the identity of the corresponding hospital node according to the node identifier. The hospital node can broadcast the uplink request in real time or periodically, time period division can be performed in the block chain network, and the medical data contained in the uplink request generated in the first time period is used as a group of data to perform packet uplink.
For example, the divided time period may be a time period of any suitable duration, such as 5 minutes, 10 minutes, 8 minutes, etc., and the divided time period may be a fixed duration or an active duration, which may be set according to the data generation condition of the hospital node in the specific blockchain network. For example, the peak period may generate a large amount of data, and the set time period is short.
Wherein, there are uplink requests broadcast by other hospital nodes in the blockchain network in the first time period. It can be understood that, since there are multiple hospital nodes in the blockchain network, there may be multiple hospital nodes broadcasting uplink requests at the same time or in the same time period. Each uplink request comprises a node identifier of the hospital node and corresponding medical data. Other hospital nodes can know which node broadcasts the uplink request according to the node identification, and know what data needs to be uplink according to the relevant information, so as to perform subsequent uplink common identification operation. In one embodiment, the node identification may be a node public key, such as a public key of a hospital.
The medical data M1 of a certain hospital node M existing in the blockchain network may be related data received by the hospital node M from a corresponding data center, or data to be linked formed after processing the related data. When the medical data received or generated by the hospital node M meets specific requirements, it can be used as the data to be linked M1. Wherein the specific requirement may be that the received data reaches a predetermined data amount or reaches a predetermined time period. For example, the hospital node M may submit the uplink request every 10 minutes or any other suitable time period, and the corresponding data to be uplink is the data received within the predetermined time period. It may also be medical data M1 generated by a patient at the visit of hospital M, which node M of hospital M needs to chain up the medical data M1 into the blockchain.
After the hospital node M generates the data M1 that needs to be uplink linked, the hospital node may broadcast an uplink request to the corresponding blockchain network, where the uplink request carries the node identifier M of the hospital node M and the related data of the medical data M1, where the related data may be the medical data M1 itself, or the data obtained by encrypting the medical data M1, or the data obtained by performing an operation according to a certain rule.
In an embodiment, the execution sequence between the steps 202 to 206 is not limited, for example, the steps 202 to 206 may be executed in sequence, or may be executed in parallel, or the step 204 is executed first and then the step 202 is executed.
For example, when the hospital node is in need of uplink data, a second Hash value may be generated accordingly, and the second Hash value is broadcasted together with the uplink request. Or the hospital node may also send a uplink request first, and after receiving the uplink request of a certain hospital, the alliance management node broadcasts a piece of information, where the information is used to prompt other hospital nodes to generate a second Hash value and sends the generated second Hash value to the alliance management node. Or the alliance management node generates the first Hash value immediately after receiving the second Hash value sent by a certain hospital node. Or the time sequence of generating the first Hash value and the second Hash value in the same time period is not limited.
Step 208, calculating the matching degree between each second Hash value and the first Hash value.
Wherein, the matching degree is used for representing the approximation degree or the difference absolute value between the second Hash value and the first Hash value, and the like. The federation management node may establish a matching table that stores the node identifier of each node, the second Hash value, and the degree of matching of the second Hash value with the first Hash value. The second Hash value is also the Hash value generated during the first time period.
The absolute value of the difference is the absolute value of the difference between the first Hash value and the second Hash value, and the approximation degree or the proximity degree can be the percentage obtained by dividing the second Hash value by the first Hash value.
And step 210, selecting one of the plurality of hospital nodes as a master node according to the matching degree, and broadcasting the master node confirmation information to enable the master node to perform packaging and uplink on the medical data in the first time period.
Specifically, after calculating each matching degree, the matching degree ranking of each hospital node may be known, and the federation management node may select a hospital node corresponding to the highest matching degree as a master node, where the master node is used for performing data packaging uplink. The federation management node may broadcast a master node acknowledgement message to the blockchain network, the acknowledgement message including a node identification of the confirmed master node. Such as the determined master node being hospital node M.
After the primary node is determined, the primary node can perform packaging uplink on the medical data in the same time period according to preset uplink rules.
In one embodiment, before step 210, the method further includes: receiving the verification results of the plurality of hospital nodes on the uplink request, and if the verification results are uplink approval, performing step 210.
In this embodiment, the data uplink request can be equally broadcast among the hospital nodes, the checking is equally performed, and after the checking result achieves the common identification of the uplink grant, the primary node selection is performed, and the uplink is performed by the primary node.
According to the medical blockchain data uplink method, the first Hash value is generated through alliance management connection, each hospital node generates the second Hash value, the alliance management nodes determine which hospital node is used as the main node of uplink according to the matching degree of the second Hash value and the first Hash value, and the main node confirmation information is broadcasted after the main node is confirmed, so that the main node confirmed by the alliance management nodes in the blockchain network carries out uplink on medical data to be uplink according to the uplink rule. According to the method, the alliance management nodes are introduced, the main nodes are determined through comparison of Hash values, the complicated main node election links such as voting consensus among hospital nodes are not needed, the main node confirmation efficiency is improved, and the data uplink efficiency is further improved. Meanwhile, because the Hash values are generated according to the same rule and are confirmed by the alliance management nodes, even if the bad nodes interfere or are damaged in the Hash values, the Hash values generated by the bad nodes cannot ensure the highest matching degree with the Hash values of the alliance management nodes, and the risk that the selected main nodes are the bad nodes is reduced.
In one embodiment, step 204 comprises: and receiving second Hash values generated by the plurality of hospital nodes according to the block heights, the random values and the tree root Hash values of the plurality of hospital nodes in the first time period.
The block height may be a current block height of a block chain database (system) stored by the corresponding node itself, each hospital node stores information of the block chain database (system), and the random value may be a randomly generated numerical value according to the current block height, for example, the height is 10, 100, 205, and the like, the tree root Hash value is a tree root Hash value of a last block in the block chain stored by the corresponding hospital node, and each hospital node is provided with the same Hash value generation rule. Each hospital node can perform Hash operation according to the parameters and the same generation rule to generate a Hash value, and the Hash value is used as the Hash value sent to the alliance management node. Generally, the block heights of all nodes are the same, and if not, the nodes are declared as waste nodes.
The federation management node may randomly generate a Hash value, which is the first Hash value. Optionally, the alliance management node may also generate a first Hash value according to the block height of the alliance management node, the random value and the tree root Hash value, and the generation rule of the first Hash value is consistent with the Hash value generation rule of the hospital node.
The first Hash value and the second Hash value are long integer type long values with preset lengths, for example, 16-system values with appropriate lengths such as 20 bits, 30 bits, 100 bits, and the like can be specifically used. The federation management node may compare the proximity or closeness or absolute difference between each second Hash value and the first Hash value, etc. And selecting the hospital node corresponding to the second Hash value closest to the first Hash value according to the comparison result.
In one embodiment, it is generally not possible to generate the same Hash value in a block chain. When a second Hash value is received to be the same as the first Hash value or a plurality of second Hash values are received to be the same as the first Hash value, the alliance management node judges that the node is a bad node or a malicious node, and then the node is prevented from participating in subsequent packaging uplink work. And continuing to select the master node from other nodes.
In this embodiment, the second Hash value is generated by using data related to the block structure in the block chain, and the Hash value is generated by using the same Hash value generation rule, so that fairness in selecting the master node can be ensured, and a risk of generating a bad master node is reduced.
In one embodiment, as shown in fig. 3, another method for uplink data of medical blockchain is provided, which is described by taking the method as an example for application to any hospital node shown in the scenario of fig. 1, and the method includes:
step 302, hospital node M generates a second Hash value.
The second Hash value generated by the hospital node M is the second Hash value, and the second Hash value can be sent to only the alliance management node, or can be broadcasted, so that other nodes can also obtain the second Hash value. When broadcasting the second Hash value, the hospital node can broadcast the second Hash value simultaneously with the uplink request or separately, and when broadcasting simultaneously, the hospital node can carry the corresponding second Hash value in the uplink request. For example, the uplink request includes the medical data M1 and the second Hash value, and the uplink request includes the medical data N1 and the second Hash value.
As described above, the second Hash value is a Hash value generated by the hospital node, and the second Hash value is a character string of a preset length and is used for comparison with the first Hash value. Each hospital node can operate according to the same rule to generate a respective second Hash value, such as the second Hash value generated by the hospital node M, and the second Hash value generated by the hospital node N.
In step 304, a UL request is broadcast.
The uplink request includes the medical data M1 corresponding to the to-be-uplink. The alliance management node comprises a plurality of hospital nodes, and one hospital node M is used for illustration. Specifically, when the hospital node M needs to uplink the medical data, it records the medical data as medical data M1, and the uplink request broadcasted is recorded as an uplink request, which can be broadcasted into the blockchain network, and each node in the blockchain network can receive the uplink request.
Each hospital node can broadcast uplink requests in real time or periodically, time period division can be carried out in the block chain network, and medical data contained in the uplink requests generated in the first time period are used as a group of data to carry out packed uplink.
In one embodiment, when the data amount of the patient medical data received cumulatively reaches the preset data amount, the hospital node M generates an uplink request, or generates an uplink request according to a predetermined frequency, and uses the patient medical data received in the current period as the data to be uplink. The preset data amount may be any suitable data amount such as 100M, 1G, etc., and the preset frequency may be once every 10 minutes, or once every half hour, etc. The method and the system can also be combined, when the medical data of the patient with the preset data volume is reached in the preset period, a primary uplink request is generated and broadcasted, and when the medical data of the patient with the preset data volume is not reached in the preset period, the primary uplink request is also generated when the medical data of the patient with the preset data volume is waited to reach the preset period. After generating an uplink request, the method proceeds to the stage of generating the next uplink request period.
Step 306, receiving a uplink request broadcast by the hospital node N in the first time period, where the uplink request includes medical data N1 to be uplink-linked.
In a certain hospital node N existing in the blockchain network, except for the hospital node M, the hospital node M broadcasts an uplink request to other hospital nodes in the first time period, and the hospital node N also broadcasts the uplink request in the first time period, wherein the uplink request includes medical data N1. Similar to the medical data M1, the medical data N1 may be related data received by the hospital node N from a corresponding data center, or to-be-linked data formed after processing the related data. When the medical data received or generated by the hospital node N meets a specific requirement, it can be used as the data to be linked N1. Wherein the specific requirement may be that the received data reaches a predetermined data amount or reaches a predetermined time period. For example, the hospital node N may submit the uplink request every 10 minutes or any other suitable time duration, and the corresponding data to be uplink transmitted is the data received within the predetermined time duration. It may also be medical data N1 generated by a patient at the visit of hospital N, node N of hospital N needing to chain up the medical data N1 into the blockchain.
After the hospital node N generates the data N1 that needs to be uplink, the hospital node may broadcast an uplink request to the corresponding blockchain network, where the uplink request carries the node identifier N of the hospital node N and the related data of the medical data N1, where the related data may be the medical data N1 itself, or the data obtained by encrypting the medical data N1, or the data obtained by performing an operation according to a certain rule.
And 308, acquiring the main node confirmation information generated according to the second Hash value of at least one hospital node.
In this embodiment, the master node information may be determined according to the second Hash value of at least one hospital node, for example, according to the matching degree of the second Hash value of each hospital node and the first Hash value, or according to the matching degree of the second Hash values among a plurality of hospital nodes.
In one embodiment, step 308 comprises: and acquiring the main node confirmation information generated according to the second Hash value of each hospital node and the first Hash value of the alliance management node.
As described above, the first Hash value is a Hash value generated by the federation management node, and the master node confirmation information may be information broadcast by the federation management node, which the hospital node may receive.
For example, the hospital node may receive a master node confirmation message sent by the federation management node, where the confirmation message indicates that node M is the master node.
In one embodiment, the master node confirmation information may also be confirmed by the hospital node itself. Each hospital node can obtain the second Hash value of the hospital node, the second Hash values of other hospital nodes and the first Hash value generated by the alliance management node, and then the matching degree between each second Hash value and the first Hash value is calculated, so that the node corresponding to the second Hash value with the highest matching degree is selected and used as the main node. Specifically, each hospital node may broadcast the host node calculated by itself, receive host nodes broadcast by other hospital nodes, compare whether the obtained host nodes are consistent, and determine that the corresponding hospital node is the host node if the comparison result is consistent. If the inconsistency exists, counting the times of voting and selecting the hospital nodes as the main nodes, and selecting the hospital node with the most acquisition times as the main node.
For example, if there are 20 hospital nodes, and there are 12 pieces of confirmation information indicating that the hospital node M is the master node and 2 pieces of confirmation information indicating that the hospital node N is the master node in the master node confirmation information broadcast by each hospital node, it may be determined that the hospital node M is the master node.
In step 310, when the determined master node is the hospital node M, the medical data M1 and the medical data N1 are packaged and uplink-linked according to the preset uplink rule.
When the determined master node is the hospital node M, the master node may perform the packet uplink on the medical data in the same time period according to the preset uplink rule, where the medical data in the time period includes the medical data M1 and the medical data N1. The predetermined uplink rule may be an uplink rule based on a Byzantine Fault Tolerant (BFT) consensus mechanism or a Practical Byzantine Fault Tolerant (PBFT) consensus mechanism.
For example, before determining the primary node, each hospital node may perform a consensus check on the corresponding medical data, and after obtaining a result of the consensus on the uplink grant, the determined primary node performs a packed uplink on the medical data.
According to the medical blockchain data uplink method, the first Hash value is generated through alliance management connection, each hospital node generates the second Hash value, then which hospital node is used as the main node of uplink is determined according to the matching degree of the second Hash value and the first Hash value, and the main node confirmation information is broadcasted after the main node is confirmed, so that the main node confirmed by the alliance management node in the blockchain network carries out uplink on medical data to be uplink according to uplink rules. The method simplifies the link of selecting the main node, improves the efficiency of confirming the main node and further improves the efficiency of data chaining. Meanwhile, the Hash values are generated according to the same rule, so that even if one or more bad nodes do not generate the Hash values according to the same rule, the Hash values (such as the first Hash value) needing to be matched cannot be obtained in advance, the bad nodes are difficult to generate the Hash value with the highest matching degree with the Hash values needing to be matched, and the risk that the selected main node is the bad node is also reduced.
In one embodiment, the second Hash value is generated by the corresponding hospital node according to the block height, the random value and the tree root Hash value of the corresponding hospital node in the first time period, and the master node confirmation information is information which takes the hospital node corresponding to the second Hash value with the highest matching degree with the first Hash value as the master node.
In this embodiment, the second Hash value is generated by using data related to the block structure in the block chain, and the Hash value is generated by using the same Hash value generation rule, so that fairness in selecting the master node can be ensured, and a risk of generating a bad master node is reduced. In one embodiment, step 308 comprises: and acquiring the main node confirmation information broadcasted by the alliance management node, calculating the matching degree between each second Hash value and each first Hash value by the alliance management node, and selecting one from the plurality of hospital nodes as the main node according to the matching degree.
In this embodiment, the master node confirmation information is determined by the federation management nodes, each master node may send the generated second Hash value to the federation management nodes, the federation management nodes may also generate the first Hash values themselves, and calculate the matching degrees between each second Hash value and the first Hash value, and select the hospital node with the highest matching degree as the master node according to the calculated matching degrees.
In the embodiment, the alliance management node is introduced, and the alliance management node determines the main node, so that the fairness of the main node determination is further improved, and the generation of bad main nodes is reduced.
In one embodiment, when the master node confirmation information broadcasted by the alliance management node is not received in a second time period, a first Hash value generated last time by the alliance management node is obtained, and the first Hash value generated last time is used as a first Hash value of the second time period; acquiring a second Hash value of the hospital node N; calculating the matching degree of each second Hash value and the first Hash value; and selecting the hospital node corresponding to the second Hash value with the highest matching degree as the main node.
In this embodiment, the master node confirmation information is generally generated by the federation management node by default, and when the federation management node does not generate the master node confirmation information in time, a fault may occur in the federation management node, and at this time, the Hash value generated last time by the federation management node may be used as the first Hash value in the second time period, and the master node is confirmed by each common node.
The second time period may be the same time period as the first time period, or the expiration time of the second time period is later than the expiration time of the first time period. When the expiration of the second time period is later than the expiration of the first time period, sufficient time may be reserved for the federation management node to determine the master node.
When the first Hash value or the main node confirmation information broadcasted by the alliance management node is not acquired in the second time period, the common node in the block chain network can take the first Hash value generated last time by the alliance management node as the first Hash value of the second time period and broadcast the second Hash value generated respectively to the block chain network. The second Hash value is a Hash value generated in the first time period, and only delayed broadcasting is performed to prevent each node from directly using the first Hash value as the Hash value generated by the node itself, or modifying the previously generated second Hash value.
The hospital node M can broadcast the calculated main node, receive the main nodes broadcast by other hospital nodes, compare whether the obtained main nodes are consistent, and if the comparison result is consistent, determine that the corresponding hospital node is the main node. If the inconsistency exists, counting the times of voting and selecting the hospital nodes as the main nodes, and selecting the hospital node with the most acquisition times as the main node.
In the method, after the main node confirmation information broadcasted by the alliance management node is not received in the second time period, the main node can be obtained through self-calculation based on the same main node confirmation rule, the flexibility of main node confirmation is improved, and the problem that the data uplink fails due to the fact that the main node cannot be obtained when the alliance management node fails is avoided.
In one embodiment, the method further comprises: and acquiring voting result information selected by the main node, and executing the step 302 when the voting result does not generate the main node. Step 308 comprises: and acquiring main node confirmation information generated according to the matching degree between the second Hash value of each candidate node and the second Hash value of the node to be voted, wherein the node to be voted selects the last node to be voted in a main node link for voting, and the candidate node is determined according to voting result information.
In this embodiment, the selection link of the master node does not need participation of the alliance management node, and master node selection voting can be performed among all the common nodes. Specifically, the hospital node M, the hospital node N, and the like may both broadcast the master node voting information, where the voting information includes the node identifier broadcasting the information and the node identifier voted by the node M as the master node.
After each node receives the voting information broadcast by a sufficient number of nodes (such as all nodes, more than 90% nodes, or only one node without voting), the number of votes selected by each node as the master node can be counted, and the node with the highest and unique number of votes is selected as the master node.
Specifically, the voting result information includes the node identifier of the node with the highest vote number, and when there is only one node identifier, the corresponding node is determined to be the master node. When the contained node identification has two or more than two, the number of the nodes obtaining the highest ticket is not unique, and the corresponding non-unique nodes can be used as candidate nodes.
The common node M may obtain master node confirmation information generated according to a matching degree between the second Hash value of each candidate node and the second Hash value of the node to be voted.
Each candidate node can generate a second Hash value according to the Hash value generation rule, and the second Hash value is broadcasted in the block chain network or is sent to the node to be voted independently. And the nodes to be voted also generate second Hash values according to the same Hash value generation rule, the matching degree of the second Hash value of each candidate node and the second Hash value generated by the node to be voted is compared, the candidate node corresponding to the second Hash value with the highest matching degree is selected as the main node, and the main node confirmation information is broadcasted.
The node to be voted is a common node in which the last bit in the voting link is not voted yet, or a common node in which the vote is latest or earliest in the voted nodes, such as a common node M or a common node N.
In the embodiment, the master node is selected by the common node, so that the intervention of the alliance management node is not needed, and the situation that the master node cannot be selected when the alliance management node fails is avoided.
In an embodiment, the primary node may also be selected first, and the primary node performs consensus check with other nodes according to a preset consensus check rule, and completes uplink of the medical data. As shown in fig. 4, step 310 includes:
step 402, sequencing the medical data M1 and the medical data N1 and broadcasting a UL check request.
In this embodiment, all data to be placed in the new block in the first time period including the medical data M1 and the medical data N1 may be sorted, and sorting information may be generated and broadcast. The broadcast uplink check request includes information corresponding to the medical data to be uplink and the uplink request sequencing order of each medical data. So that each node can perform consensus checking on the medical data according to a specified order.
In one embodiment, the master node sorts a plurality of medical data collected from the blockchain network to be placed in a new block and stores the sorted medical data in a list, and broadcasts a uplink check request including the sorted list with the sorted list.
And step 404, receiving verification result information broadcasted by other hospital nodes after the sequenced medical data is verified according to a preset verification rule.
Other common nodes in the block chain network can check corresponding medical data to generate a consensus check result, wherein the check result information comprises the node identification of the corresponding node and the consensus check result, and the check result comprises check results of uplink approval, uplink rejection and the like.
In one embodiment, step 406 may be entered after receiving the check result information from a predetermined number of common nodes, without waiting for all nodes to make the consensus feedback information. The preset number is a suitable number set by the system according to the total number of nodes in the network, for example, the preset number may be 90% of the total number of nodes. After the check result information of a proper number of nodes is received, the consensus result can be calculated, and the condition that the uplink consensus operation efficiency is too low due to long-time waiting for the feedback of one or more common nodes is avoided.
In one embodiment, step 404 includes: and receiving verification result information broadcasted after the common node performs consensus verification on the uplink verification request before the preset cut-off time, and defaulting the common node which does not broadcast the consensus feedback information before the preset cut-off time to make one verification result.
When the check result information of the common node is not received before the preset cutoff time or the check result information is not broadcast by the common node, the check result information of the common node can be defaulted to be the common identification check result of the approved uplink or the result of the rejected uplink, and the common identification check result information is included in the subsequent uplink common identification operation. For example, all nodes that have not broadcast the results of the common acknowledgement check for the overdue period may be defaulted to the result that the uplink is granted, or may be defaulted to the result that the uplink is rejected, or 50% of the nodes may be defaulted to the result that the uplink is granted, and the remaining 50% may be defaulted to the result that the uplink is rejected.
The cutoff time may be any suitable time after a preset time period, and the time may be determined automatically according to a predetermined rule or manually. For example, the expiration time is the latest time of the predetermined time period plus a suitable time period. The duration may be a fixed duration or a duration automatically determined according to the size of the data amount to be uplinked in the current time period. Such as for example, 1 minute or 5 minutes.
When a plurality of nodes exist in the blockchain network, the nodes which do not feed back the result at the specified time are defaulted to be fed back at a certain feedback result, so that the condition that the uplink common identification operation efficiency is too low due to long-time waiting for the feedback of one or more common nodes can be avoided.
For example, there are 100 nodes participating in the consensus check on the uplink data M1 in the blockchain network, when the deadline is reached, 90 nodes have broadcast the check result information, and the remaining 10 nodes have not broadcast the check result information, and the 10 nodes can be defaulted as the feedback result of making the uplink grant. By defaulting the 10 nodes as feedback results of the approved uplink, the success rate of the approved uplink can be improved, and the efficiency of uplink of the medical data M1 is also improved.
Step 406, counting whether the number of the received verification result information indicating that the verification passes reaches a first value, and if so, performing uplink on the packaged data.
After the common node M obtains the check result information of a plurality of other common nodes, the number of various results can be counted, and when it is recognized that the number of a certain check result reaches a preset first value, it is indicated that a consensus is formed, for example, the number of check result information indicating that the check is passed reaches the first value. After agreement on the approved uplink, the packaged data may be generated into a new chunk, which includes the medical data M1 and the medical data N1. Wherein the first value may be any suitable value. For example, the first value may be any suitable number of the total number of nodes 1/3 or 1/2, or a number established according to the principles of Byzantine Fault Tolerant (BFT) consensus mechanism or Practical Byzantine Fault Tolerant (PBFT) consensus mechanism.
In one embodiment, the check result information includes a commit message, and step 404 includes: receiving Hash abstracts of new blocks generated by simulation of uplink by other hospital nodes according to the sequence; and receiving commit messages broadcast by other hospital nodes, and broadcasting the commit messages when a certain node receives the same Hash digests broadcast by other nodes as the Hash digests generated by the node and the number of the Hash digests broadcast by other nodes reaches a second value.
Specifically, each hospital node can perform analog uplink according to the received sequencing information of each medical data, generate a new block in an analog mode, acquire the Hash abstract of the new block, and broadcast the Hash abstract information obtained through analog calculation to the block chain network.
Each hospital node can count the number of the received Hash abstracts, which is the same as the number of the Hash abstracts calculated by the hospital node, and when the number reaches a second value, a commit message is broadcasted to the whole network. Wherein, the second value can be 2f, and f is the above-mentioned tolerable number of Byzantine nodes. The second value may be 2f, where f is the tolerable number of byzantine nodes, which may be set according to the total number of nodes in the current block-chain network.
Step 406 includes: and counting the number of the received commit messages, and when the counted number of the received commit messages reaches a first value, uplink is carried out on the packed data.
In one embodiment, the number of first values may be 2f + 1. If a node receives 2f +1 (including its own generated commit message) commit messages, it can determine that uplink consensus is agreed. After the consensus is achieved, the hospital node M may submit the data to be uplink to the local block chain and state database of the node M according to a predetermined sequence, so as to implement uplink of the medical data.
In one embodiment, before step 304, the method further comprises: acquiring data to be uplinked; acquiring an encryption key; and encrypting the data to be linked up according to the encryption key, and taking the encrypted data as medical data M1. After step 310, further comprising: the identification code is generated based on the decryption key corresponding to the encryption key, so that the other hospital node can acquire the decryption key for decrypting the medical data M1 through the identification code.
In this embodiment, the medical data M1 is encrypted data in the blockchain. The data end is a data production end of the hospital M, for example, a database, and can generate relevant user medical data. The node M may acquire the data as to-be-uplink data according to a certain frequency. The hospital identification is used for uniquely identifying a character string of the hospital identity, and each node in the data link network can determine corresponding identity information according to the hospital identification.
In one embodiment, the encryption key is a user public key and the decryption key is a user private key. After the hospital identity is determined, the node M may obtain a user identifier corresponding to the user data, where the user identifier may be an identity card of the user, and the like, and the node M may generate a corresponding user private key according to the user identifier and according to a key generation rule, and generate a user public key according to the generated user private key. The user public key is a key for encrypting user data, and the user private key is a key for decrypting the encrypted data. After generating the user private key, the user data may be encrypted according to the user private key, thereby forming encrypted data, which is used as the medical data M1 to be linked.
Specifically, the hospital node M may perform Hash operation on the acquired user data first, so as to generate a Digest of fixed length, and then encrypt the Digest by using the public key to generate a corresponding digital Signature. Further, the hospital node M may encrypt the Signature using the node M private key. The digital signature and the digest are the data M1 to be uplink.
In this embodiment, the private key and the public key of the user are generated by using the user identifier, and then the user data that needs to be uplink is encrypted, so that the user data in the broadcast uplink request is encrypted data, and thus the security of the user data can be ensured.
In one embodiment, for the generated decryption key, the identification code may be generated according to a generation rule of the identification code, so that the formed identification code includes information of the corresponding decryption key and/or information such as data identification of one or more pieces of medical data decrypted by the corresponding decryption key. The other hospital nodes can acquire the decryption key according to the identification code and decrypt the corresponding block data according to the decryption key.
In one embodiment, when the identification code comprises one or more data identifiers, the hospital node is enabled to scan the identification code to obtain a decryption key and one or more data identifiers, and the medical data corresponding to each data identifier is decrypted according to the decryption key; and when the identification code does not contain the data identification, the hospital node obtains the decryption key by scanning the identification code, and decrypts all medical data corresponding to the user identification according to the decryption key.
When the identification code contains a decryption key but not a data identifier, all medical data of a corresponding user can be decrypted through the decryption key; when the data identifier is included, the decryption key can only decrypt the medical data corresponding to the data identifier. The data identification contained in the identification code can be multiple, namely one decryption key can decrypt one or more medical data. The hospital node can use the camera to scan the identification code, analyze the identification code to obtain a decryption key, detect whether the identification code also contains a data identifier, and decrypt all medical data of the corresponding user in the block chain by using the decryption key when the identification code does not contain the data identifier to obtain the decrypted medical data of the user. When one or more data identifications are contained, the corresponding medical data can be searched according to each data identification, and the searched medical data can be decrypted according to the decryption key.
In one embodiment, the identification code may be one or more of a two-dimensional code or a bar code.
In the above scheme, taking a hospital scene as an example, the two-dimensional code generated by the hospital node M corresponding to the hospital M includes a decryption key for decrypting medical data of a certain patient and a plurality of data identifiers, and the hospital can print the two-dimensional code on a medical record of the patient. When a patient visits another hospital, the two-dimensional code can be provided, and when the hospital node N corresponding to the other hospital N obtains the decryption key in the two-dimensional code, the decryption key can be used to decrypt the patient medical data corresponding to each data identifier in the blockchain, so that the sharing of the patient medical data is realized.
Whether the identification code contains the data identification or not is set, so that whether the medical data of the corresponding patient are all suitable for sharing or not is distinguished, when the medical data of the patient are all suitable for sharing, the identification code does not contain the data identification, so that all the medical data of the patient can be decrypted by other nodes, when part of the medical data are not convenient to share, the identification code contains the data identification corresponding to the medical data which can be shared, and the other nodes can decrypt the medical data which can be shared according to the provided data identification. For the medical data which is not convenient to share, a key or an encryption mode different from the encryption key can be set, so that when the medical data which is not convenient to share needs to be provided, the medical data is decrypted through other corresponding decryption modes to further protect the privacy of the user.
In one embodiment, as shown in fig. 5, a further method for uplink data of medical block chains is provided, the method comprising:
step 502, the federation management node generates a first Hash value.
The alliance management node can generate a first Hash value according to a certain frequency, wherein the first Hash value is a character string or a numerical value of a fixed length generated by the alliance management node according to the Hash operation. Wherein the frequency may be a frequency that generates a Hash value once within a preset time period.
In an embodiment, if the alliance management node fails and cannot generate the first Hash value in time, the Hash value generated last time can be used as the Hash value to be used this time.
At step 504, the hospital node M generates a second Hash value.
And 505, the hospital node N generates a second Hash value and sends the second Hash value to the alliance management node.
The second Hash value generated by each hospital node has the same format as the first Hash value, and may also be a character string or a numerical value with a fixed length. In one embodiment, the first Hash value and the second Hash value are both numerical values, and in particular, may be long integer type long numerical values. The alliance management node can randomly generate a Hash value, wherein the Hash value is a first Hash value; each hospital node can perform Hash operation according to the block height, the random value and the tree root Hash value of each hospital node to generate a corresponding Hash value, wherein the Hash value is the corresponding second Hash value. The random value may be any random value generated to prevent Hash values generated by hospital nodes from being the same.
In step 506, the hospital node M broadcasts an uplink request.
In step 507, the hospital node N broadcasts an uplink request.
In this embodiment, there is an uplink request for medical data broadcast by other hospital nodes in the blockchain network during the first time period. The execution sequence between steps 502-508 may not be limited, that is, the uplink request of each node may be obtained first, and then the Hash value information is received, or the Hash value information may be received first, and then the uplink request is received, or both may be generated simultaneously.
And step 508, the alliance management node calculates the matching degree between each second Hash value and the first Hash value.
The federation management node may compare the degree of match between each received second Hash value and the first Hash value and form a degree of match ranking.
And step 510, the alliance management node selects one of the plurality of hospital nodes as a main node according to the matching degree and broadcasts the main node confirmation information.
In this embodiment, after determining the matching degree, the federation management nodes may determine the master nodes in accordance with the matching degree sequence. For example, the node with the highest matching degree may be selected as the master node, so that the selected master node performs the uplink packaging on all the medical data in the first time period. For example, if the Hash value calculated by node M described above matches best with the Hash value of the federation management node, node M may be considered the master node.
In one embodiment, when the hospital node does not receive the main node confirmation information broadcast by the alliance management node in the second time period, the hospital node acquires the Hash value generated last time by the alliance management node, and takes the Hash value generated last time as the first Hash value; acquiring a second Hash value of the hospital node N; calculating the matching degree of each second Hash value and the first Hash value; and selecting the hospital node corresponding to the second Hash value with the highest matching degree as the main node.
In step 512, when the determined master node is the hospital node M, the hospital node M sorts the medical data M1 and the medical data N1 and broadcasts a uplink check request.
The main node sorts and stores a plurality of medical data collected from the block chain network and needing to be placed in a new block into a list, and broadcasts an uplink verification request, wherein the request comprises the stored list with the sort.
In step 514, the hospital node M broadcasts a Hash digest of the new blocks generated by analog uplink in order.
Step 515, the hospital node N broadcasts a Hash digest of the new blocks generated by analog uplink in order.
Each hospital node can carry out analog uplink according to the received sequencing information of each medical data, generate a new block in an analog mode, obtain the Hash abstract of the new block, and broadcast Hash abstract information obtained through analog calculation to a block chain network.
In step 516, hospital node M counts the number of Hash digests that are the same as its own Hash digest.
Step 517, the hospital node N counts the number of Hash digests identical to the Hash digest of itself.
In step 518, when the same number counted by the hospital node M reaches the second value, a commit message is broadcast.
In step 519, when the same number counted by the hospital node N reaches a second value, a commit message is broadcast.
Each hospital node can count the number of the received Hash abstracts, which is the same as the number of the Hash abstracts calculated by the hospital node, and when the number reaches a second value, a commit message is broadcasted to the whole network.
In step 520, the hospital node M counts the number of commit messages received.
In step 522, when the number of the commit messages received by the hospital node M reaches a first value, the medical data M1 and the medical data N1 are uplinked.
In one embodiment, the first value and the second value may be any values. Taking the example where there are N hospital nodes, the first and second values may each be 2f +1 (including the commit message generated by itself). Wherein f can be a tolerable number of byzantine nodes, and the value can be a positive integer less than N, which is determined as appropriate according to actual conditions, wherein N is any number greater than or equal to 4. For example, N =10, and f =1, the first and second values are both 3; if N =10 and f =2, the first and second values are both 5.
If a node receives 2f +1 (including its own generated commit message) commit messages, it can determine that uplink consensus is agreed. After the consensus is achieved, the hospital node M may submit the data to be uplink to the local block chain and state database of the node M according to a predetermined sequence, so as to implement uplink of the medical data.
According to the medical block chain data uplink method, the Hash values generated by the alliance management node and the hospital node respectively determine the main node for performing data uplink according to the matching degree between the Hash value of the hospital node and the Hash value of the alliance management node, so that the main node packs and uplinks all medical data to be uplinked in the time period, the data uplink efficiency can be improved, meanwhile, the main node is selected according to the matching degree, the bad node can be prevented from being selected, and the safety of the medical block chain data uplink process is improved. By determining the main node by using the alliance management node, other hospital nodes only need to perform consensus calculation, and the uplink efficiency can be improved. In addition, the alliance management node utilizes the Hash value to calculate, so that the randomness and the reasonability of uplink sequence distribution can be improved.
In one embodiment, as shown in fig. 6, a medical blockchain data uplink apparatus is provided, the apparatus comprising:
a Hash value generating first module 602, configured to generate a first Hash value; and receiving second Hash values calculated by the plurality of hospital nodes according to the block chain information of the plurality of hospital nodes.
A first module 604 for requesting to receive uplink requests broadcasted by a plurality of hospital nodes in a first time period, wherein each uplink request includes medical data to be uplink.
The master node determines a first module 606 for calculating a matching degree between each second Hash value and the first Hash value; and selecting one from the plurality of hospital nodes as a main node according to the matching degree, and broadcasting the main node confirmation information to enable the main node to perform packaging and uplink on the medical data in the first time period.
In one embodiment, the Hash value generation first module 602 is further configured to receive a second Hash value generated by the plurality of hospital nodes according to the block heights, the random values, and the tree root Hash values of the plurality of hospital nodes in the first time period.
In one embodiment, the primary node confirmation first module 606 is further configured to receive a verification result of uplink requests from a plurality of hospital nodes, and select one of the plurality of hospital nodes as the primary node according to the matching degree when the verification result indicates that uplink is approved.
In one embodiment, as shown in fig. 7, another medical blockchain data uplink apparatus is provided, the apparatus comprising:
a Hash value generating second module 702, configured to generate a second Hash value; and broadcasting an uplink request, wherein the uplink request comprises the medical data M1 corresponding to the to-be-uplink.
A second module 704 for requesting to receive a uplink request broadcasted by the hospital node N in the first time period, where the uplink request includes the medical data N1 to be uplink.
A master node confirmation second module 706, configured to obtain master node confirmation information generated according to a second Hash value of at least one hospital node;
the data uplink module 708 is configured to perform packet uplink on the medical data M1 and the medical data N1 according to a preset uplink rule when the determined primary node is the hospital node M.
In one embodiment, the master node confirmation second module 706 is further configured to obtain master node confirmation information generated according to a matching degree between the second Hash value of each hospital node and the first Hash value of the federation management node.
In one embodiment, the second Hash value is generated by the corresponding hospital node according to the block height, the random value and the tree root Hash value of the corresponding hospital node in the first time period, and the master node confirmation information is information which takes the hospital node corresponding to the second Hash value with the highest matching degree with the first Hash value as the master node.
In an embodiment, the master node confirmation second module 706 is further configured to obtain master node confirmation information broadcasted by the federation management nodes, where the federation management nodes calculate a matching degree between each second Hash value and the first Hash value, and select one of the plurality of hospital nodes as the master node according to the matching degree.
In an embodiment, the master node confirmation second module 706 is further configured to, when the master node confirmation information broadcast by the federation management node is not received in the second time period, obtain a first Hash value generated last time by the federation management node, and use the first Hash value generated last time as the first Hash value of the second time period; acquiring a second Hash value of the hospital node N; calculating the matching degree of each second Hash value and the first Hash value; and selecting the hospital node corresponding to the second Hash value with the highest matching degree as the main node.
In an embodiment, the master node confirmation second module 706 is further configured to obtain voting result information selected by the master node, and when the voting result does not generate the master node, obtain master node confirmation information generated according to a matching degree between the second Hash value of each candidate node and the second Hash value of the node to be voted, where the node to be voted is a last node to be voted in the voting master node link, and the candidate node is a candidate node determined according to the voting result information.
In one embodiment, the data uplink module is further configured to 708 sort the medical data M1 and the medical data N1 and broadcast a uplink check request; receiving verification result information broadcast by other hospital nodes after the sequenced medical data are verified according to a preset verification rule; and counting whether the number of the received verification result information which shows that the verification is passed reaches a first value or not, and if so, performing uplink on the medical data M1 and the medical data N1.
In one embodiment, as shown in fig. 8, there is provided a further medical blockchain data uplink apparatus, further comprising:
an encryption and decryption module 710, configured to obtain data to be uplinked; acquiring an encryption key; encrypting the data to be uplinked according to the encryption key, and taking the encrypted data as medical data M1; and generating an identification code according to the decryption key corresponding to the encryption key, and enabling other hospital nodes to acquire the decryption key for decrypting the medical data M1 through the identification code.
Although example embodiments have been described, it will be apparent to those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the inventive concept. Accordingly, it should be understood that the above-described exemplary embodiments are not limiting, but illustrative.

Claims (10)

1. A method for uplink of medical blockchain data, the method performed by a federation management node, comprising:
the alliance management node generates a first Hash value;
receiving second Hash values calculated by a plurality of hospital nodes according to the block chain information of the hospital nodes, wherein the first Hash values and the second Hash values have the same generation rule;
receiving uplink requests broadcast by a plurality of hospital nodes in a first time period, wherein each uplink request comprises medical data corresponding to the to-be-uplink;
calculating the matching degree between each second Hash value and the first Hash value;
and selecting one of the plurality of hospital nodes as a main node according to the matching degree, and broadcasting main node confirmation information to enable the main node to perform packaging and uplink on the medical data in the first time period.
2. The method of claim 1, wherein receiving the second Hash value calculated by the plurality of hospital nodes according to their own blockchain information comprises:
and receiving second Hash values generated by the plurality of hospital nodes according to the block heights, the random values and the tree root Hash values of the plurality of hospital nodes in the first time period.
3. The method according to claim 1, further comprising, before said selecting one of said plurality of hospital nodes as a master node based on said matching degree:
receiving verification results of the plurality of hospital nodes on the uplink request;
and when the verification result is that uplink is approved, selecting one of the plurality of hospital nodes as a main node according to the matching degree.
4. A medical blockchain data uplink method, performed by a hospital node M, comprising:
the hospital node M generates a second Hash value;
broadcasting an uplink request to other hospital nodes in a first time period, wherein the uplink request comprises medical data M1 corresponding to the medical data to be uplink;
receiving a uplink request broadcast by a hospital node N in the other hospital nodes in a first time period, wherein the uplink request broadcast by the hospital node N in the first time period comprises medical data N1 corresponding to the medical data to be uplink;
obtaining primary node confirmation information generated based on a second Hash value of at least one hospital node, comprising: acquiring main node confirmation information generated according to the matching degree between a second Hash value of each hospital node and a first Hash value of a alliance management node, wherein the first Hash value and the second Hash value have the same generation rule;
and when the determined main node is the hospital node M, performing packaging uplink on the medical data in a first time period according to a preset uplink rule, wherein the medical data in the first time period comprise the medical data M1 and the medical data N1.
5. The method according to claim 4, wherein the second Hash value of the hospital node is a second Hash value generated by the corresponding hospital node according to a block height of the corresponding hospital node, a random value of the corresponding hospital node, and a tree root Hash value in the first time period, and the master node confirmation information is information regarding the hospital node corresponding to the second Hash value having a highest matching degree with the first Hash value as the master node.
6. The method according to claim 5, wherein the obtaining of the master node confirmation information generated according to the matching degree between the second Hash value of each hospital node and the first Hash value of the federation management node comprises:
acquiring main node confirmation information broadcast by the alliance management nodes, calculating the matching degree between each second Hash value and the first Hash value by the alliance management nodes, and selecting one of the hospital nodes as a main node according to the matching degree;
when the main node confirmation information broadcasted by the alliance management node is not received in a second time period, obtaining a first Hash value generated last time by the alliance management node, and taking the first Hash value generated last time as a first Hash value of the second time period;
acquiring a second Hash value of each hospital node;
calculating the matching degree of the second Hash value of each hospital node and the first Hash value of the second time period;
and selecting the hospital node corresponding to the second Hash value with the highest matching degree as the main node.
7. The method of claim 4, further comprising:
obtaining voting result information selected aiming at the main node, and executing the hospital node M to generate a second Hash value when the voting result does not generate the main node;
the obtaining of the master node confirmation information generated according to the second Hash value of at least one hospital node includes:
and acquiring main node confirmation information generated according to the matching degree between the second Hash value of each candidate node and the second Hash value of the node to be voted, wherein the node to be voted is the last node to be voted in the main node voting selection link, and the candidate node is determined according to the voting result information.
8. The method of claim 4, further comprising, prior to the broadcasting of the uplink request to other hospital nodes for the first time period:
acquiring data to be uplink;
acquiring an encryption key;
encrypting the data to be uplinked according to the encryption key, and taking the encrypted data as the medical data M1;
and generating an identification code according to a decryption key corresponding to the encryption key, so that the other hospital nodes can obtain a decryption key for decrypting the medical data M1 through the identification code.
9. A medical blockchain data uplink apparatus, the apparatus comprising:
the Hash value generating module is used for generating a first Hash value through the alliance management node; receiving second Hash values calculated by a plurality of hospital nodes according to self block chain information through the alliance management node, wherein the first Hash values and the second Hash values have the same generation rule;
a first module for requesting to receive, by the federation management node, a uplink request broadcasted by a plurality of hospital nodes in a first time period, where each uplink request includes medical data to be uplink-linked;
and the master node confirmation first module is used for calculating the matching degree between each second Hash value and the first Hash value through the alliance management nodes, selecting one from the plurality of hospital nodes as a master node according to the matching degree, and broadcasting master node confirmation information through the alliance management nodes to enable the master node to pack and chain the medical data in the first time period.
10. A medical blockchain data chaining apparatus, the apparatus comprising:
the Hash value generation second module is used for generating a second Hash value through the hospital node M; broadcasting a winding-up request to other hospital nodes in a first time period, wherein the winding-up request comprises medical data M1 corresponding to be wound up;
a second module for requesting to receive, by the hospital node M, an uplink request broadcast by a hospital node N in the other hospital nodes in a first time period, where the uplink request broadcast by the hospital node N in the first time period includes medical data N1 to be uplink;
a master node confirmation second module, configured to acquire, by the hospital node M, master node confirmation information generated according to a matching degree between a second Hash value of each hospital node and a first Hash value of a federation management node, where a generation rule of the first Hash value is the same as a generation rule of the second Hash value;
and a data uplink module, configured to, when the master node determined by the hospital node M is the hospital node M, perform uplink packaging on medical data in a first time period according to a preset uplink rule by the master node, where the medical data in the first time period includes the medical data M1 and the medical data N1.
CN202111351991.4A 2021-11-16 2021-11-16 Medical block chain data uplink method and device Active CN114065246B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111351991.4A CN114065246B (en) 2021-11-16 2021-11-16 Medical block chain data uplink method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111351991.4A CN114065246B (en) 2021-11-16 2021-11-16 Medical block chain data uplink method and device

Publications (2)

Publication Number Publication Date
CN114065246A CN114065246A (en) 2022-02-18
CN114065246B true CN114065246B (en) 2022-08-19

Family

ID=80272526

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111351991.4A Active CN114065246B (en) 2021-11-16 2021-11-16 Medical block chain data uplink method and device

Country Status (1)

Country Link
CN (1) CN114065246B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117857159A (en) * 2023-12-25 2024-04-09 慧之安信息技术股份有限公司 Method and system for processing data of aviation material enterprise equipment based on block chain

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111444258A (en) * 2020-02-11 2020-07-24 江苏荣泽信息科技股份有限公司 Medical data sharing method based on block chain
CN112118239A (en) * 2020-09-03 2020-12-22 腾讯科技(深圳)有限公司 Block chain consensus method and device, electronic equipment and storage medium
WO2020258831A1 (en) * 2019-06-28 2020-12-30 创新先进技术有限公司 Method and device for master node handover processing in blockchain system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109345386B (en) * 2018-08-31 2020-04-14 阿里巴巴集团控股有限公司 Transaction consensus processing method and device based on block chain and electronic equipment
CN112486736A (en) * 2020-12-28 2021-03-12 山西中液互联能源有限公司 Block chain based data backup system and backup method
CN113342902B (en) * 2021-08-09 2021-11-12 腾讯科技(深圳)有限公司 Data processing method and device for block chain network, computer equipment and medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020258831A1 (en) * 2019-06-28 2020-12-30 创新先进技术有限公司 Method and device for master node handover processing in blockchain system
CN111444258A (en) * 2020-02-11 2020-07-24 江苏荣泽信息科技股份有限公司 Medical data sharing method based on block chain
CN112118239A (en) * 2020-09-03 2020-12-22 腾讯科技(深圳)有限公司 Block chain consensus method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN114065246A (en) 2022-02-18

Similar Documents

Publication Publication Date Title
CN111914027B (en) Block chain transaction keyword searchable encryption method and system
CN107294727B (en) Electronic voting method, terminal equipment and block chain network
CN109872152B (en) Block chain consensus method based on share authorization certification mechanism and related equipment
US10848315B2 (en) Contract agreement method, agreement verification method, contract agreement system, agreement verification device, contract agreement device, contract agreement program and agreement verification program
EP1700261B1 (en) Method and arrangement for real-time betting with an off-line terminal
CN108809953B (en) Anonymous identity authentication method and device based on block chain
CN109194702B (en) Medical data recording method, system, computer device and storage medium
US10783733B2 (en) Electronic voting system and control method
CN110602217B (en) Block chain-based alliance management method, device, equipment and storage medium
CN111427957A (en) Block chain voting information verification method, device, equipment and storage medium
CN110995751B (en) Big data intelligent medical treatment and old age care service method and system based on block chain
CN112118239B (en) Block chain consensus method and device, electronic equipment and storage medium
CN111881481A (en) Block chain-based medical data processing method, device, equipment and storage medium
CN114065246B (en) Medical block chain data uplink method and device
CN111654395B (en) Voting information processing method, device, equipment and storage medium
CN113497823B (en) Labor service subcontracting personnel management system based on block chain
CN115065679A (en) Block chain based electronic health profile sharing model, method, system, and medium
CN112115193A (en) Case ratio query method, device, equipment and storage medium based on block chain
CN113395164A (en) Electronic voting method based on ring signature and block chain
CN112509654A (en) Medical data acquisition method based on block chain
US9100419B2 (en) Long-term signature terminal, long-term signature server, long-term signature terminal program, and long-term signature server program
KR102457915B1 (en) Electronic vote system using smart contract of blockchain and method thereof
CN115086049B (en) Block chain medical data sharing system and method based on verifiable delay function
CN115065689B (en) Alliance chain block data storage method and system based on historical evaluation
JP3314900B2 (en) Information delivery method and system using zero knowledge proof protocol

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: Medical blockchain data uploading methods and devices

Granted publication date: 20220819

Pledgee: China Construction Bank Corporation Shanghai Xuhui sub branch

Pledgor: Shanghai kelinbrui Information Technology Co.,Ltd.

Registration number: Y2024310000434