Blockchain Consensus Mechanism Automatic Update Method and System for Medical Big Data
By obtaining the differences in the distribution of medical data characteristics and the similarity of cumulative reward sequences, the adaptive update of the consensus mechanism solves the problems of vicious competition and unreasonable distribution in traditional blockchain storage, and promotes the improvement of hospital medical services.
Patent Information
- Application Number
- CN202111102555.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-20
- Publication Date
- 2025-07-04
- Estimated Expiration
- 2041-09-20
AI Technical Summary
The traditional blockchain consensus mechanism may lead to vicious competition and unreasonable distribution polarization in medical big data storage, which cannot effectively explore the data characteristics of various medical institutions and affect the progress of the medical and health industry.
By obtaining the distribution differences in medical data characteristics and the similarity of cumulative reward sequences, we adaptively update the consensus mechanism to avoid internal refined competition and encourage hospitals to improve the level of medical services.
Adaptive update of the consensus mechanism has been achieved to avoid excessive differences in reward distribution, promote hospitals to actively participate in the generation of new blocks, and improve the level of medical services.
Smart Images

Figure CN114169384B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of blockchain technology, and particularly to a method and system for automatically updating a blockchain consensus mechanism for medical big data. Background Art
[0002] With the continuous progress of society, the medical level has also been continuously improved, and medical institutions of all sizes have emerged one after another. Each medical institution itself generates a large amount of medical data, such as the diagnosis results of patients' conditions, the consumption data of patients, the prices of hospital drugs, etc. These data contain various characteristic information, and it is necessary to store these medical data.
[0003] Currently, traditional data storage is to store it in the blockchain. However, the traditional consensus mechanism may cause vicious competition or polarization of unreasonable distribution, and it cannot mine the characteristics of the data of each medical institution, which does not play a good role in the progress of the medical and health cause. Summary of the Invention
[0004] In order to solve the above technical problems, the purpose of the present invention is to provide a method and system for automatically updating a blockchain consensus mechanism for medical big data, and the specific technical solutions adopted are as follows:
[0005] In a first aspect, an embodiment of the present invention provides a method for automatically updating a blockchain consensus mechanism for medical big data, and the method includes the following steps:
[0006] When a new block is added to the blockchain in the first hospital, obtain the cumulative reward of the first hospital; a plurality of medical data features are stored in the block; the cumulative reward is the sum of the weights of the rewards corresponding to each medical data feature with the distribution difference of each medical data as the weight; the distribution difference is the feature distribution difference of the corresponding medical data feature in the main component direction in the blockchain;
[0007] Obtain the cumulative reward sequence when a plurality of new blocks are added to the blockchain in the first hospital; obtain the similarity of the cumulative reward sequences between the corresponding hospitals on the blockchain; classify according to the size of the similarity, and obtain the reward ratio of each hospital in each category to obtain the reward distribution difference of each category of the reward ratio;
[0008] When it is determined that the current consensus mechanism is unreasonable according to the feature distribution difference and the reward distribution difference, update the consensus mechanism.
[0009] Preferably, the step of obtaining the feature distribution difference of the medical data feature in the main component direction includes:
[0010] Obtain the final feature vectors of the medical data of each hospital, and calculate the unit vectors of the final feature vectors in their principal component directions;
[0011] Obtain the projection lengths of each of the final feature vectors on the unit vectors, and take the entropy of all the projection lengths as the feature distribution difference.
[0012] Preferably, the step of adding a new block to the blockchain includes:
[0013] Obtain an evaluation result as a consensus mechanism based on the feature distribution difference and the projection length, and connect the block that meets the consensus mechanism to the blockchain; the evaluation result is positively correlated with the feature distribution difference.
[0014] Preferably, the step of obtaining the similarity of the cumulative reward sequences between the corresponding hospitals on the blockchain includes:
[0015] Obtain the difference sequence of the cumulative reward sequences between two hospitals, calculate the sum of all elements in the difference sequence, and obtain the similarity of the cumulative reward sequences between the hospitals based on the sum of all elements.
[0016] Preferably, the step of obtaining the reward ratio of each hospital in each category includes:
[0017] Take each hospital as a node, use the similarity of the cumulative reward sequences between the nodes as the edge weights, and perform clustering according to the magnitude of the similarity to obtain multiple categories;
[0018] According to the ratio of the cumulative reward of the nodes in any one of the categories to the cumulative reward of the nodes in all the categories, obtain the reward proportion of any one of the categories, which is called the reward ratio proportion.
[0019] Preferably, the step of obtaining the cumulative reward of the first hospital includes:
[0020] Obtain the reward vectors of the first hospital in all medical feature dimensions, use the feature distribution difference of the medical features as weights, and obtain the sum of all the reward vectors of the first hospital in the new block, so as to obtain the cumulative reward.
[0021] Preferably, the step of obtaining the reward distribution difference of each category of reward ratio includes:
[0022] Obtain the per capita reward proportion of each node in the category according to the reward ratio proportion of each category, obtain the variance of the per capita reward proportions of all categories, and take the variance as the reward distribution difference.
[0023] Preferably, the step of determining the current consensus mechanism according to the feature distribution difference and the reward distribution difference includes:
[0024] Obtain the ratio of the maximum value of the reward distribution difference to the feature distribution difference, and use the ratio as the unreasonableness degree of the consensus mechanism.
[0025] Preferably, the step of updating the consensus mechanism includes:
[0026] When the unreasonableness degree is greater than the preset unreasonableness degree threshold, obtain the updated medical data features of the hospital, and re-obtain the feature distribution difference for calculation, so as to update the consensus mechanism.
[0027] In a second aspect, another embodiment of the present invention provides a blockchain consensus mechanism automatic update system for medical big data. The system includes: a memory, a processor, and a computer program stored in the memory and executable on the processor. It is characterized in that when the processor executes the computer program, the steps of the above method are implemented.
[0028] The beneficial effects of the embodiments of the present invention are as follows: By obtaining the distribution difference between the medical data features of the first hospital to obtain the feature distribution difference, using the feature distribution difference as the weight to obtain the cumulative reward of the first hospital when adding multiple new blocks, further obtaining the cumulative reward sequence of the first hospital adding multiple new blocks connected to the blockchain, calculating the similarity of the cumulative reward sequences between different hospitals to obtain the reward distribution difference, and judging the unreasonableness degree of the consensus mechanism according to the reward distribution difference and the feature distribution difference, so as to achieve the purpose of adaptive update of the consensus mechanism, effectively avoid the phenomenon of internal lean competition and excessive reward distribution difference, encourage hospitals to actively participate in the generation of new blocks, and play a positive role in promoting hospitals to improve their medical service levels in all aspects. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0030] Figure 1 It is a flowchart of a method for automatically updating a blockchain consensus mechanism for medical big data provided by an embodiment of the present invention;
[0031] Figure 2A flowchart of a method for calculating the cumulative reward when a new block of a first hospital is connected to a blockchain according to an embodiment of the present invention. Detailed implementation manners
[0032] In order to further elaborate on the technical means and effects adopted by the present invention to achieve the intended invention purpose, the following describes in detail a method and system for automatically updating a blockchain consensus mechanism for medical big data proposed according to the present invention, its specific implementation manners, structures, features, and effects, in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. In addition, the specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form.
[0033] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the technical field to which the present invention belongs.
[0034] Embodiments of the present invention are specifically applied to each hospital. Each hospital generates a large amount of medical data that needs to be stored, such as the number of patients admitted, the time of patient admission, the diagnosis results of patients, whether they are critically ill patients, and the costs of medical equipment used by patients. Therefore, a new block needs to be generated to package all the medical data and store it on the existing blockchain. The process of selecting the blocks generated by the hospital for data packaging is called a consensus mechanism. By judging the unreasonable degree of the consensus mechanism through the feature distribution difference of the final feature vectors of the medical characteristics of the hospital and the reward distribution difference of each hospital, when the consensus mechanism is unreasonable, the unit vector and feature distribution difference of the final feature vector in the principal component direction are recalculated to achieve the purpose of data update, thereby realizing the adaptive change of the consensus mechanism.
[0035] The following specifically describes the specific solution of a method and system for automatically updating a blockchain consensus mechanism for medical big data provided by the present invention in combination with the accompanying drawings.
[0036] Please refer to Figure 1 , which shows a flowchart of a method for automatically updating a blockchain consensus mechanism for medical big data provided by an embodiment of the present invention, specifically as follows:
[0037] Step S100, when a new block of the first hospital is connected to the blockchain, obtain the cumulative reward of the first hospital; multiple medical data features are stored in the block; the cumulative reward is the sum of the weights of the rewards corresponding to each medical data feature with the distribution difference of each medical data as the weight; the distribution difference is the feature distribution difference of the corresponding medical data feature in the principal component direction in the blockchain.
[0038] Any hospital can generate a block, and the medical data of the corresponding hospital is stored in the block. When the block is newly added to the blockchain, the blockchain determines whether to accept the addition of the block according to the consensus mechanism. Among them, the consensus mechanism is a judgment mechanism for newly added blocks in the blockchain, allowing blocks that meet the consensus mechanism to be connected to the blockchain. And in order to encourage hospitals to better improve their medical service levels, rewards are allocated to the hospitals corresponding to the newly added blocks; for each newly added block, a certain amount of rewards can be allocated to the corresponding hospital, so the more blocks a hospital adds, the more cumulative rewards it will get. Specifically, the steps for the First Hospital to obtain cumulative rewards include:
[0039] Step S101, obtain the feature distribution difference of medical data features in the principal component direction.
[0040] First, obtain the final feature vectors of the medical data of each hospital. Then, calculate the unit vectors of each final feature vector in its principal component direction. Finally, obtain the projection lengths of each final feature vector on the unit vector, and take the entropy of all projection lengths as the feature distribution difference. Specifically:
[0041] 1) Obtain the final feature vectors of each hospital. The specific method is:
[0042] Set a readable probability for each block on the blockchain , then the probability of not being able to read the medical data stored in the block is . Each hospital selectively reads blocks when traversing the medical data on the blockchain. Since selective reading can enable each hospital to quickly and as much as possible traverse the medical data in the blocks compared with the traditional method of traversing one by one.
[0043] It should be noted that when a hospital traverses a block, it can read all the medical data stored in the block.
[0044] Within a certain period of time, a hospital can traverse multiple blocks and read the medical data of multiple blocks, and extract the corresponding medical data features from the read medical data. The medical data features obtained for each hospital are formed into a row vector, which is called the first feature vector of the corresponding hospital.
[0045] Preferably, in the embodiment of the present invention, the length of the time period is set to 1 minute, and the medical data features are evaluated using medical data that can be used to evaluate the service and medical capabilities of the hospital as evaluation indicators. For example, the medical data features are the average price of drugs in the hospital, the number of patients admitted daily, the recovery rate of critically ill patients, and the average charge of medical equipment.
[0046] Thus, a hospital can obtain the feature vectors of multiple hospitals from the blockchain through traversal, that is, one hospital corresponds to multiple first feature vectors.
[0047] Perform mean shift clustering on the multiple first feature vectors obtained by traversing a hospital, extract the noise data and the data with little reference value or possible anomalies, obtain the final clustering result, calculate the mean of all the first feature vectors in the clustering result, and use the obtained mean vector as the final feature vector obtained by the hospital.
[0048] 2) Obtain the feature distribution differences of each final feature vector. The specific method is as follows:
[0049] First, perform principal component analysis on the final feature vectors obtained by each hospital to obtain the unit vectors where the principal component directions of all the final feature vectors are located , which are respectively:
[0050] ;
[0051] Among them, represents the number of principal component directions, represents the th principal component direction.
[0052] Then, calculate the projection lengths of each final feature vector in each principal component direction. The projection length of the final feature vector of the th hospital in the th principal component direction is:
[0053] ;
[0054] Among them, represents the projection length of the th hospital in the th principal component direction, represents the final feature vector of the th hospital, represents the th principal component direction.
[0055] Furthermore, normalize all the projection lengths in the th principal component direction. The specific method is as follows:
[0056] ;
[0057] Among them, represents the projection length of the th hospital in the th principal component direction after normalization, represents the number of all hospitals.
[0058] It should be noted that the normalization method adopted in the embodiments of the present invention is Softmax, and different methods can be adopted according to actual situations in other embodiments.
[0059] Finally, calculate the entropy of the projected length after normalization, and the formula is:
[0060] ;
[0061] where represents the entropy in the direction of the th principal component, represents the projected length after normalization.
[0062] The larger the entropy in the direction of the th principal component indicates that the projected length of the final feature vector of the hospital in the direction of the th principal component is longer, that is, in the direction of the th principal component, the feature distribution of the final feature vector of the hospital varies greatly, with large differences and uncertainties.
[0063] In the embodiments of the present invention, the entropy is used as the feature distribution difference, and thus a sequence of feature distribution differences can be obtained .
[0064] Step S102, obtain an evaluation result according to the feature distribution difference as a consensus mechanism.
[0065] Considering that different hospitals have different feature distribution differences in medical data features, the greater the feature distribution difference indicates that the hospital has a larger competitive space or room for improvement in these medical data features. Obtain an evaluation result according to the feature distribution difference and the projected length, and link the block that meets the evaluation result to the blockchain, that is, evaluate each hospital according to the feature distribution difference between the final feature vectors of each hospital, and decide which hospital's generated medical data can be packaged into a block and connected to the blockchain according to the evaluation result, which can avoid the hospital's fine-grained competition on some medical data features with small feature distribution differences. This evaluation method is used as the consensus mechanism in the embodiments of the present invention.
[0066] In other embodiments, the evaluation can be performed by calculating the length of the feature vector of each hospital. The longer the length of the hospital, the more advantageous it is in medical services. However, this method ignores the distribution differences of different hospitals in different medical data features.
[0067] It should be noted that the consensus mechanism in the embodiments of the present invention is adaptively variable, and when certain conditions are met, the calculation method of the consensus mechanism will change.
[0068] The specific method for obtaining the evaluation result according to the difference in feature distribution is as follows:
[0069] ;
[0070] Among them, represents the evaluation result of the th hospital, represents the projection length of the th hospital in the direction of the th principal component, represents the difference in feature distribution in the direction of the th principal component.
[0071] The evaluation result is positively correlated with the difference in feature distribution, that is, the greater the projection length of the hospital in the principal component direction with a large difference in feature distribution, the greater the evaluation result.
[0072] The hospital with the largest evaluation result is called the first hospital. The larger the evaluation result, the greater the competitive space or room for improvement in the medical data features of the hospital. Package the data generated by the first hospital into a block, connect the block to the blockchain, and allocate a reward to the first hospital, which can encourage the first hospital to better improve its medical service level, enhance its competitiveness in medical data with large differences in feature distribution, and avoid fine-grained competition among all hospitals.
[0073] In summary, according to the unit vector in the principal component direction and the difference in feature distribution , the evaluation result of each hospital can be obtained, and the hospital with the largest evaluation result can be obtained, and a reward is given to this hospital. This process is called the consensus mechanism.
[0074] Then, when the unit vector in the principal component direction and the difference in feature distribution are known, a consensus mechanism can be obtained.
[0075] Step S103, allocate a reward to the first hospital according to the established consensus mechanism.
[0076] In the existing blockchain, the rewards allocated to users are generally virtual currencies, etc. In the embodiments of the present invention, the reward allocated to the first hospital is a high-dimensional vector, called the reward vector.
[0077] Specifically, assume that the first hospital that obtains the reward is hospital , and the final feature vector of this first hospital is . Transform this final feature vector into a unit vector . Then the obtained reward vector corresponding to the first hospital is:
[0078] ;
[0079] Among them, represents the value of the reward vector in the direction of the -th principal component of the m-th hospital, is the unit vector of the final feature vector of the m-th hospital, represents the -th principal component direction.
[0080] It should be noted that represents a principal component direction of the final feature vector of the first hospital , where each dimension in the final feature vector represents a medical data feature, and each medical data feature corresponds to a basis vector.
[0081] Furthermore, for example, the average drug price of the hospital, represents a linear combination of the basis vectors of the final feature vector , that is, each dimension in the final feature vector corresponds to a feature data. Then corresponds to a combination of multiple feature data.
[0082] Therefore, the reward vector represents the reward obtained by each hospital for the feature combination corresponding to each principal component direction. It is not only judged whether to obtain the reward based on the single data feature of the hospital, but whether this hospital can obtain the reward is judged according to the characteristics of different data features combined together.
[0083] It should be noted that the reward vector assigned to the first hospital is a virtual vector, and this reward vector can be traded. In the embodiments of the present invention, each dimension of this reward vector is given preferential treatment separately. For example, according to the size of the first dimension, the discount rate of the drug price during drug wholesale is given, and according to the size of the fourth dimension, the first hospital is subsidized when using medical equipment, etc. When the hospital is motivated by the reward vector, it can actively participate in the competition of the hospital to promote the generation of new blocks.
[0084] Step S104, when a new block is added to the blockchain in the first hospital, obtain the cumulative reward of the first hospital.
[0085] From the method for generating a new block under the consensus mechanism obtained in step S102, a new block needs to be generated at the current moment and connected to the original blockchain.
[0086] Obtain the reward vectors of the first hospital in all medical feature dimensions, and use the feature distribution difference of the medical features as the weight to obtain the sum of all reward vectors in the new block of the first hospital, so as to obtain the cumulative reward.
[0087] Specifically, assume that new blocks are added to the blockchain within a period of time. When the th new block is added, among which , the reward vector sequence of the First Hospital is , where represents the reward vector of the First Hospital at the th dimension for the th new block. Then, when the First Hospital adds the th block to the blockchain, the cumulative reward of the First Hospital is:
[0088] ;
[0089] where represents the cumulative reward of the First Hospital when adding the th block, represents the reward vector sequence of the First Hospital at the th new block, and is the entropy of the feature distribution difference.
[0090] Step S200: Obtain the cumulative reward sequence when multiple new blocks added by the First Hospital are connected to the blockchain; obtain the similarity of the cumulative reward sequences between the corresponding hospitals on the blockchain; classify according to the size of the similarity, and obtain the reward ratio of each hospital in each category to obtain the reward distribution difference of each category of reward ratios. Specifically, it includes:
[0091] 1) Obtain the similarity of the cumulative reward sequences between different hospitals.
[0092] The cumulative reward of the First Hospital is obtained from Step S104. Similarly, the cumulative reward sequence of the First Hospital can be obtained , and this cumulative reward sequence represents the change trend of the cumulative reward obtained by the First Hospital for each newly added block.
[0093] Based on the same principle, obtain the cumulative reward sequence of another hospital, and calculate the similarity of the cumulative reward sequences between the two hospitals.
[0094] Preferably, in the embodiment of the present invention, subtract the corresponding elements between the cumulative reward sequence of the First Hospital and the cumulative reward sequence of another hospital to obtain the difference sequence of the reward cumulative sequences between the two hospitals, calculate the sum of all elements in this difference sequence, and obtain the similarity of the cumulative reward sequences between the hospitals according to the sum of all elements. Then, the calculation of the similarity of the reward cumulative sequences between the two hospitals is:
[0095] ;
[0096] Among them, represents the similarity, which represents the sum of all elements in the difference sequence.
[0097] It should be noted that the minimum value of is 0, and the smaller the absolute value of
[0098] 2) Obtain the reward distribution difference according to the similarity between the cumulative reward sequences of different hospitals.
[0099] Taking each hospital as a node, with the value of the node being the cumulative reward of the hospital, and using the similarity of the cumulative reward sequences between two nodes as the edge weight value, a graph data structure is obtained. Spectral clustering is performed on the nodes on this graph according to the magnitude of the similarity of the cumulative reward sequences between two nodes, and categories are obtained, and the nodes in each category have similar cumulative reward change sequences;
[0100] It should be noted that when the edge weight value is less than a certain threshold, the edge weight value is set to 0.
[0101] Obtain the per capita reward proportion of each node in each category according to the reward ratio proportion of each category, obtain the variance of all per capita reward proportions, and use the variance as the reward distribution difference.
[0102] Specifically, obtain the sum of all nodes in the th category and the sum of all nodes on the graph, calculate the ratio of the sum of all nodes in the th category to the sum of all nodes on the graph, and thus obtain the reward proportion of the th category, which is called the reward ratio.
[0103] Calculate the per capita reward proportion of each hospital in the th category, and the formula is as follows:
[0104] ;
[0105] Among them, represents the per capita reward proportion, represents the reward ratio of the th category, represents the number of nodes in the th category.
[0106] The per capita reward proportion of each category is positively correlated with the reward ratio of that category and negatively correlated with the number of nodes in each category.
[0107] Obtain the per capita reward ratio of hospitals in all categories and calculate all categories of the variance. The larger the variance, the greater the difference in the per capita reward ratio among hospitals, and the more concentrated the rewards are among a few users. Therefore, the variance is called the reward distribution difference.
[0108] Step S300, when it is determined that the current consensus mechanism is unreasonable based on the feature distribution difference and the reward distribution difference, update the consensus mechanism.
[0109] Obtain the ratio of the maximum value of the reward distribution difference to the feature distribution difference, and use this ratio as the unreasonable degree of the consensus mechanism. Therefore, the unreasonable degree of the consensus mechanism is calculated as:
[0110] ;
[0111] Among them, represents the unreasonable degree, represents the reward distribution difference, represents the maximum value in the feature distribution difference.
[0112] It should be noted that the maximum value of the feature distribution difference is the maximum feature distribution difference in the principal component direction .
[0113] The unreasonable degree is positively correlated with the reward distribution difference and negatively correlated with the feature distribution difference. That is, when the reward distribution difference among hospitals is large and the maximum feature distribution difference is small, the value of the unreasonable degree is larger, indicating that the consensus mechanism is more unreasonable.
[0114] Compare the obtained value of the unreasonable degree with a preset threshold. When it is greater than the preset threshold, the consensus mechanism needs to be updated.
[0115] Furthermore, in order to avoid updating the consensus mechanism multiple times in a short period, the unit vector in the principal component direction and the feature distribution difference can be regarded as fixed constants to evaluate hospitals, obtain the evaluation results and subsequent reward results, and further obtain the final unreasonable degree.
[0116] Therefore, when the unreasonable conditions are met and the consensus mechanism needs to be updated, recalculate the unit vector in the principal component direction of the final feature vector and the feature distribution difference, and further obtain the subsequent data results, so as to update the consensus mechanism and achieve the purpose of the adaptive change of the consensus mechanism.
[0117] In summary, in the embodiments of the present invention, the unit vector sequence in the principal component direction is obtained by using the final feature vectors of each hospital, and the feature distribution difference is further obtained. A consensus mechanism is formulated based on the unit vector sequence and the reward distribution difference to determine the hospital that obtains the reward. The cumulative reward obtained by the hospital when connecting several blocks is calculated, and the reward distribution difference is calculated. The unreasonableness degree of the consensus mechanism is judged according to the feature distribution difference and the reward distribution difference of the hospital. When the consensus mechanism is unreasonable, the unit vector sequence and the feature distribution difference of the hospital are recalculated, so as to update the data to obtain a new consensus mechanism. Through the adaptive change of the consensus mechanism, it can effectively assist the hospital to improve its medical capabilities in all aspects, avoid internal lean competition, and promote the hospital to improve its own medical service level.
[0118] Based on the same inventive concept as the above method embodiments, the embodiments of the present invention also provide a blockchain consensus mechanism automatic update system for medical big data. The system includes: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps in the above embodiments of a method for automatically updating a blockchain consensus mechanism for medical big data, such as Figure 1 the steps shown. The method for automatically updating a blockchain consensus mechanism for medical big data has been described in detail in the above embodiments and will not be repeated here.
[0119] It should be noted that: the above sequence of the embodiments of the present invention is only for description and does not represent the advantages or disadvantages of the embodiments. And the above specific embodiments of this specification have been described. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be executed in a different order than in the embodiments and still achieve the desired results. Additionally, the processes depicted in the figures do not necessarily require the particular order or sequential order shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0120] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments.
[0121] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for automatically updating a blockchain consensus mechanism for medical big data, characterized in that, The method includes the following steps: When a new block of the first hospital is added to the blockchain, obtain the cumulative reward of the first hospital; a plurality of medical data features are stored in the block; the cumulative reward is the sum of the weights of the rewards of the corresponding medical data features with the distribution difference of each medical data; the distribution difference is the feature distribution difference of the corresponding medical data feature in the main component direction in the blockchain; Obtain the cumulative reward sequence when a plurality of the blocks of the first hospital are added to the blockchain; obtain the similarity of the cumulative reward sequences between the corresponding hospitals on the blockchain; classify according to the size of the similarity, and obtain the reward ratio of each hospital in each category to obtain the reward distribution difference of each category of the reward ratio; When it is determined that the current consensus mechanism is unreasonable according to the feature distribution difference and the reward distribution difference, update the consensus mechanism.
2. The method according to claim 1, wherein The step of obtaining the feature distribution difference of the medical data feature in the main component direction includes: Obtain the final feature vector of the medical data of each hospital, and calculate the unit vector of the final feature vector in its main component direction; Obtain the projection length of each final feature vector on the unit vector, and use the entropy of all the projection lengths as the feature distribution difference.
3. The method according to claim 1, wherein The step of adding a new block to the blockchain includes: Obtain the evaluation result as the consensus mechanism according to the feature distribution difference and the projection length, and connect the block that meets the consensus mechanism to the blockchain; the evaluation result has a positive correlation with the feature distribution difference.
4. The method according to claim 1, characterized in that, The step of obtaining the similarity of the cumulative reward sequences between the corresponding hospitals on the blockchain includes: Obtain the difference sequence of the cumulative reward sequences between two hospitals, calculate the sum of all elements in the difference sequence, and obtain the similarity of the cumulative reward sequences between the hospitals according to the sum of all elements.
5. The method according to claim 1, wherein The step of obtaining the reward ratio of each hospital in each category includes: Take each hospital as a node, use the similarity of the cumulative reward sequences between the nodes as the edge weight value, and perform clustering according to the size of the similarity to obtain multiple categories; According to the ratio of the cumulative reward of the nodes in any one category to the cumulative reward of the nodes in all categories, obtain the reward proportion of any one category, which is called the reward ratio proportion.
6. The method according to claim 1, wherein The step of obtaining the cumulative reward of the first hospital includes: Obtain the reward vector of the first hospital in all medical feature dimensions, use the feature distribution difference of the medical feature as the weight, and obtain the sum of all the reward vectors of the first hospital in the new block, so as to obtain the cumulative reward.
7. The method according to claim 5, characterized in that The step of obtaining the reward distribution difference of each category of the reward ratio includes: Obtain the per capita reward proportion of each node in the category according to the reward ratio proportion of each category, obtain the variance of the per capita reward proportions of all categories, and use the variance as the reward distribution difference.
8. The method according to claim 1, wherein The step of judging the current consensus mechanism according to the feature distribution difference and the reward distribution difference includes: Obtain the ratio of the maximum value of the reward distribution difference to the feature distribution difference, and use this ratio as the unreasonableness degree of the consensus mechanism.
9. The method according to claim 8, characterized in that, The step of updating the consensus mechanism includes: When the unreasonableness degree is greater than a preset unreasonableness degree threshold, obtain the updated medical data features of the hospital, and re-obtain the feature distribution difference for calculation, so as to update the consensus mechanism.
10. A blockchain consensus mechanism automatic update system for medical big data, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1-9.
Citation Information
Patent Citations
Block chain dynamic DPoS consensus method based on reputation mechanism and DPBFT algorithm
CN111131181A
Medical data security consensus method based on credit rating
CN112599249A