A data sharing method based on blockchain

Through the blockchain-based data sharing method, the consistency and reliability issues in data sharing are solved, users are encouraged to upload high-quality data, data quality and management efficiency are improved, and data security is ensured.

CN118467643BActive Publication Date: 2024-10-01CENT SOUTH UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410926471.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-11
Publication Date
2024-10-01
Estimated Expiration
2044-07-11

AI Technical Summary

Technical Problem

Existing data sharing methods have problems with data consistency and reliability, and lack effective incentive mechanisms, resulting in data islands, low resource utilization, and low quality of shared data.

Method used

Adopt a blockchain-based data sharing method to adjust the new data uploaded by user nodes, calculate its scarcity score and sensitivity score, perform clustering, determine the relative contribution coefficient, and adjust the access rights of user nodes based on this coefficient duration to improve data consistency and reliability and motivate users to upload high-quality data.

Benefits of technology

It achieves improved data consistency and reliability, improves the real-time and importance assessment of data, reasonably encourages users to upload high-quality data, improves the quality of shared data, and at the same time ensures data security and management efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118467643B_ABST
    Figure CN118467643B_ABST
Patent Text Reader

Abstract

The present application is applicable to the field of data sharing technology, and provides a data sharing method based on blockchain, which includes: adjusting new data according to existing shared data to obtain new shared data; calculating scarcity scores and sensitivity scores according to the new shared data, and calculating scarcity scores and sensitivity scores according to the existing shared data; clustering based on the scarcity scores and sensitivity scores of the new shared data and the scarcity scores and sensitivity scores of the existing shared data to obtain a target cluster; determining the benchmark shared data of the target cluster, and calculating the relative contribution coefficient of the new shared data based on the scarcity scores and sensitivity scores of the benchmark shared data; determining the additional duration level based on the relative contribution coefficient, and calculating the access permission duration according to the additional duration level; and controlling the duration of the user node accessing the existing shared data according to the access permission duration. The method of the present application can improve the quality of shared data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data sharing technology, and in particular to a data sharing method based on blockchain. Background Art

[0002] In recent years, data sharing has played an increasingly important role in various fields. For example, in the field of industrial manufacturing, data sharing among multiple factories has become crucial to improve production efficiency, reduce costs, and optimize supply chain management. However, existing data sharing methods have some significant shortcomings: 1) Data consistency and reliability issues. When multiple parties already have shared data, maintaining data consistency and reliability is a major challenge, and the accuracy and timeliness of the data are difficult to guarantee; 2) Lack of effective incentive mechanisms. Traditional methods lack effective incentive mechanisms to encourage data sharing, resulting in data island problems and low resource utilization. It can be seen that existing data sharing methods have the problem of low quality of shared data. Summary of the invention

[0003] This application provides a data sharing method based on blockchain, which can solve the problem of low quality of shared data.

[0004] In a first aspect, an embodiment of the present application provides a data sharing method based on blockchain, the data sharing method comprising:

[0005] According to all the existing shared data in the blockchain, the new data uploaded by the user node is adjusted to obtain new shared data;

[0006] Calculate the scarcity score and sensitivity score of the new shared data based on the new shared data, and calculate the scarcity score and sensitivity score of each existing shared data based on each existing shared data; the scarcity score is used to describe the scarcity of data in the blockchain within a preset future time period, and the sensitivity score is used to describe the importance of data;

[0007] Based on the scarcity score and sensitivity score of the new shared data and the scarcity score and sensitivity score of all existing shared data in the blockchain, the new shared data and all existing shared data are clustered to obtain the target cluster to which the new shared data belongs;

[0008] Determine the benchmark shared data of the target cluster from all the existing shared data in the target cluster, and calculate the relative contribution coefficient of the new shared data based on the scarcity score and sensitivity score of the benchmark shared data; the benchmark shared data is the existing shared data that can represent the characteristics of the target cluster among all the existing shared data of the target cluster;

[0009] Based on the relative contribution coefficient of the newly shared data, determine the additional duration level of the user node, and calculate the access permission duration of the user node according to the additional duration level of the newly shared data;

[0010] Based on the duration of the user node's access rights, the duration for which the user node can access each existing shared data through the blockchain is controlled.

[0011] Optionally, after the step of adjusting the new data uploaded by the user node according to all existing shared data in the blockchain to obtain new shared data, the data sharing method further includes:

[0012] The new shared data is stored in any block of the blockchain, and the new shared data is migrated to other blocks based on the attribute information of the new shared data.

[0013] Optionally, the new shared data is migrated to other blocks based on the attribute information of the new shared data, including:

[0014] By formula:

[0015] ;

[0016] Build The first layer of blockchain Blocks and Hash links between blocks ;

[0017] in, represents a hash function, Indicates The first layer of blockchain blocks, Indicates The first layer of blockchain blocks, , Indicates The total number of blocks in the layer blockchain, Indicates encryption operation;

[0018] By formula:

[0019] ;

[0020] Build Layer 1 blockchain and Hash links between layer blockchains ;

[0021] in, Indicates The first layer of blockchain blocks, , Indicates The total number of blocks in the layer blockchain, , , Indicates the number of blockchain layers;

[0022] If the attribute information of the new shared data indicates that the data size of the new shared data is larger than the average size of the existing shared data in the block where the new shared data is located, the new shared data is migrated using the hash links between blocks in the same layer of blockchain;

[0023] Define the transfer function based on the attribute information of the new shared data ;

[0024] ;

[0025] in, Represents logical conditions based on the attribute information of the new shared data, Indicates that the new shared data is stored in The first layer of blockchain blocks, Indicates that the new shared data is stored in The first layer of blockchain blocks;

[0026] According to the transfer function, the new shared data is migrated using the hash links between layers.

[0027] Optionally, according to all existing shared data in the blockchain, the new data uploaded by the user node is adjusted to obtain new shared data, including:

[0028] By formula:

[0029] ;

[0030] Calculate the feature prototypes of all existing shared data ;

[0031] in, Indicates Feature vectors with shared data:

[0032] ;

[0033] in, , Indicates the total number of shared data. represents the feature extraction function, Indicates There is already shared data. Represents the parameters of the feature extraction function;

[0034] Extract features from new data to obtain feature vectors of new data;

[0035] Use the discriminator to obtain the similarity between the feature vector of the new data and the feature prototype;

[0036] Determine whether the similarity is greater than a similarity threshold;

[0037] If yes, the new data is used as new shared data;

[0038] Otherwise, the attribute information of the new data is adjusted, and the process returns to the step of extracting features from the new data to obtain a feature vector of the new data.

[0039] Optionally, a scarcity score and a sensitivity score of the newly shared data are calculated based on the newly shared data, including:

[0040] By formula:

[0041] ;

[0042] Calculate the scarcity score of newly shared data ;

[0043] in, represents the maximum scarcity score, represents the future availability of new shared data predicted by the LSTM model. represents the future availability threshold, Represents parameters;

[0044] By formula:

[0045] ;

[0046] Calculate sensitivity scores for newly shared data ;

[0047] in, represents a machine learning model for sensitivity assessment, Represents a summary of the new shared data generated using GPT4;

[0048] The scarcity score and sensitivity score of each existing shared data are calculated based on each existing shared data, including:

[0049] By formula:

[0050] ;

[0051] Calculate the The scarcity score of the shared data ;

[0052] in, Indicates that the LSTM model is used to The future availability predicted by existing shared data, , Indicates the total number of shared data;

[0053] By formula:

[0054] ;

[0055] Calculate the Sensitivity scores of existing shared data ;

[0056] in, Indicates the first A summary of the data that has been shared.

[0057] Optionally, based on the scarcity score and sensitivity score of the new shared data and the scarcity score and sensitivity score of all existing shared data in the blockchain, the new shared data and all existing shared data are clustered to obtain a target cluster to which the new shared data belongs, including:

[0058] The new shared data and each existing shared data are regarded as a data point; the coordinates of the data point are the combination of the scarcity score and the sensitivity score corresponding to the data point;

[0059] Cluster all data points according to their coordinates to obtain multiple clusters;

[0060] The cluster to which the data point corresponding to the new shared data belongs is taken as the target cluster.

[0061] Optionally, all data points are clustered according to their coordinates to obtain multiple clusters, including:

[0062] For each data point, perform the following steps:

[0063] Determine whether the number of data points within a preset neighborhood of a data point is greater than a preset number of points;

[0064] If the number of data points within the preset neighborhood of the data point is greater than the preset number of points, the data point and all data points within the preset neighborhood of the data point are regarded as a potential cluster;

[0065] If the number of data points within the preset neighborhood of a data point is less than or equal to the preset number of points, the data point is marked as a noise point;

[0066] For each potential cluster, respectively, according to the coordinates of all data points in the potential cluster, calculate the compactness index of the potential cluster and the separation index between the potential cluster and each other potential cluster;

[0067] Determine whether the compactness index of the potential cluster is less than the compactness index threshold;

[0068] If the compactness index of the potential cluster is less than the compactness index threshold, then determine whether each separation index of the potential cluster is greater than the separation index threshold;

[0069] If each separability index of a potential cluster is greater than the separability index threshold, the potential cluster is regarded as a cluster;

[0070] If at least one separability index of a potential cluster is less than or equal to the separability index threshold, the potential cluster is discarded;

[0071] If the compactness index of a potential cluster is greater than or equal to the compactness index threshold, the potential cluster is discarded.

[0072] Optionally, based on the coordinates of all data points in the potential cluster, a compactness index of the potential cluster and a separation index between the potential cluster and each other potential cluster are calculated, including:

[0073] By formula:

[0074] ;

[0075] Calculate the The compactness index of potential clusters ;

[0076] in, Indicates The set of data points in potential clusters, Represents data points The coordinates of , represents the total number of potential clusters, Q x =[ SS x , SI x ] , Represents data points The scarcity score of Represents data points The sensitivity score, Represents data points The coordinates of Q y =[ SS y , SI y ] , Represents data points The scarcity score of Represents data points sensitivity score;

[0077] By formula:

[0078] ;

[0079] Calculate the potential clusters and Separability index between potential clusters ;

[0080] in, Indicates The set of data points in potential clusters, , , Represents data points The coordinates of Q z =[ SS z , SI z ] , Represents data points The scarcity score of Represents data points sensitivity score.

[0081] Optionally, the relative contribution coefficient of the new shared data is calculated based on the scarcity score and sensitivity score of the benchmark shared data, including:

[0082] By formula:

[0083] ;

[0084] Calculate the relative contribution coefficient of the new shared data ;

[0085] in, represents the scarcity score of the new shared data, represents the sensitivity score of the newly shared data, represents the scarcity score of the benchmark shared data, represents the sensitivity score of the benchmark shared data, , Indicates the scarcity score of the first shared data in the blockchain. Indicates the first The scarcity score of the existing shared data, , Indicates the sensitivity score of the first shared data in the blockchain. Indicates the first sensitivity scores of existing shared data.

[0086] Optionally, based on the relative contribution coefficient of the new shared data, the additional duration level of the user node is determined, including:

[0087] By formula:

[0088] ;

[0089] Calculate the additional time level of the user node ;

[0090] in, Indicates the highest extra time level, Indicates rounding operation;

[0091] The access permission duration of the user node is calculated based on the additional duration level of the newly shared data, including:

[0092] By formula:

[0093] ;

[0094] Calculate the access permission duration of user nodes ;

[0095] in, Indicates the basic duration, Indicates the extra duration coefficient.

[0096] The above solution of the present application has the following beneficial effects:

[0097] In some embodiments of the present application, new shared data is obtained by adjusting the new data uploaded by the user node according to all existing shared data in the blockchain, and then the scarcity score and sensitivity score of the new shared data are calculated according to the new shared data, and the scarcity score and sensitivity score of each existing shared data are calculated according to each existing shared data, and then the new shared data and all existing shared data are clustered based on the scarcity score and sensitivity score of the new shared data and the scarcity score and sensitivity score of all existing shared data in the blockchain to obtain the target cluster to which the new shared data belongs, and then the benchmark shared data of the target cluster is determined from all existing shared data in the target cluster, and the relative contribution coefficient of the new shared data is calculated based on the scarcity score and sensitivity score of the benchmark shared data, and then the additional time level of the user node is determined based on the relative contribution coefficient of the new shared data, and the access permission duration of the user node is calculated according to the additional time level of the new shared data, and finally, according to the access permission duration of the user node, the duration of the user node's access to each existing shared data through the blockchain is controlled. Among them, adjusting the new data according to all the existing shared data can make the new data consistent with other existing shared data in terms of attributes, thereby obtaining new shared data with high consistency and reliability, obtaining the scarcity score and sensitivity score of the new shared data, and effectively evaluating the new shared data in terms of real-time and importance, thereby improving the rationality of the relative contribution coefficient, and making the additional time level based on the relative contribution coefficient more rational. By adjusting the access permission time of the user node according to the additional time level, the user node can be reasonably incentivized and rewarded, encouraging the user node to upload new data with real-time and importance, and improving the quality of shared data.

[0098] In addition, blockchain has the characteristics of immutability and encryption. Data sharing based on blockchain ensures the security of data and the information privacy of user nodes. At the same time, since blockchain has multiple blocks for storage, storing existing shared data on different blocks of the blockchain can improve the management efficiency and retrieval efficiency of existing shared data.

[0099] Other beneficial effects of the present application will be described in detail in the subsequent specific implementation section. BRIEF DESCRIPTION OF THE DRAWINGS

[0100] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0101] Figure 1 A flowchart of a blockchain-based data sharing method provided in one embodiment of the present application. DETAILED DESCRIPTION

[0102] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0103] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0104] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0105] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.

[0106] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0107] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0108] In response to the problem of low quality of existing shared data, an embodiment of the present application provides a data sharing method based on blockchain. The data sharing method adjusts the new data uploaded by the user node according to all the existing shared data in the blockchain to obtain new shared data, then calculates the scarcity score and sensitivity score of the new shared data according to the new shared data, and calculates the scarcity score and sensitivity score of each existing shared data according to each existing shared data, and then clusters the new shared data and all the existing shared data based on the scarcity score and sensitivity score of the new shared data and the scarcity score and sensitivity score of all the existing shared data in the blockchain to obtain the target cluster to which the new shared data belongs, and then determines the benchmark shared data of the target cluster from all the existing shared data in the target cluster, and calculates the relative contribution coefficient of the new shared data based on the scarcity score and sensitivity score of the benchmark shared data, and then determines the additional time level of the user node based on the relative contribution coefficient of the new shared data, and calculates the access permission duration of the user node according to the additional time level of the new shared data, and finally controls the duration of the user node's access to each existing shared data through the blockchain according to the access permission duration of the user node. Among them, adjusting the new data according to all the existing shared data can make the new data consistent with other existing shared data in terms of attributes, thereby obtaining new shared data with high consistency and reliability, obtaining the scarcity score and sensitivity score of the new shared data, and effectively evaluating the new shared data in terms of real-time and importance, thereby improving the rationality of the relative contribution coefficient, and making the additional time level based on the relative contribution coefficient more rational. By adjusting the access permission time of the user node according to the additional time level, the user node can be reasonably incentivized and rewarded, encouraging the user node to upload new data with real-time and importance, and improving the quality of shared data.

[0109] In addition, blockchain has the characteristics of immutability and encryption. Data sharing based on blockchain ensures the security of data and the information privacy of user nodes. At the same time, since blockchain has multiple blocks for storage, storing existing shared data on different blocks of the blockchain can improve the management efficiency and retrieval efficiency of existing shared data.

[0110] Next, an exemplary description is given of the blockchain-based data sharing method provided in this application.

[0111] like Figure 1 As shown, the blockchain-based data sharing method provided by this application includes the following steps:

[0112] Step 11: According to all existing shared data in the blockchain, the new data uploaded by the user node is adjusted to obtain new shared data.

[0113] The above-mentioned existing shared data and new shared data may be image data (such as factory surveillance images), video data (such as factory surveillance videos), table data (such as factory processing batch tables), etc.

[0114] It should be noted that before performing this step, the new data uploaded by the user node needs to be preprocessed, such as correcting or deleting errors and outliers, filling missing values, and converting them into a standard format.

[0115] In some embodiments of the present application, the step of adjusting the new data uploaded by the user node according to all existing shared data in the blockchain to obtain new shared data includes:

[0116] The first step is through the formula:

[0117] ;

[0118] Calculate the feature prototypes of all existing shared data .

[0119] in, Indicates Feature vectors with shared data:

[0120] ;

[0121] in, , Indicates the total number of shared data. represents the feature extraction function, Indicates There is already shared data. Represents the parameters of the feature extraction function.

[0122] The second step is to extract features from the new data and obtain the feature vector of the new data.

[0123] Exemplarily, the above-mentioned feature extraction function may be used to extract features from new data. The feature extraction function may be a function for feature extraction such as CountVectorizer().

[0124] The third step is to use the discriminator to obtain the similarity between the feature vector of the new data and the feature prototype.

[0125] Exemplarily, the above discriminator may be a discriminator of a generative adversarial network.

[0126] It should be noted that the above discriminator needs to be optimized online, specifically, through the formula:

[0127] V G,D = E x∼ p hats x w x ⋅logD x + E z∼ p z z [w G z ⋅log(1 - D G z )] ;

[0128] Calculate the loss function of the discriminator ;

[0129] in, Indicates that the discriminator correctly identifies the weighted sample shared data The expected log probability of E z∼ p z z [w G z ⋅log(1 - D G z )] Indicates that the discriminator correctly identifies the weighted new data The expected log probability of Indicates sample shared data A weighting factor that assigns different weights to different sample sharing data. This weight can be adjusted based on the type of sample sharing data, frequency of use, or other criteria; represents the sample shared data generated by the generator, Denotes the weighting factor applied to the Generated data points. It represents the weights that the generated data points get according to their type or frequency of use; Denotes the discriminator D for sample sharing data The output of represents the probability that the discriminator believes that x comes from the real data distribution. A value close to 1 means that the discriminator believes that x is very likely to be a real data sample; a value close to 0 means that the discriminator believes that x is likely to be a generated (fake) data sample; It is the output of the discriminator D for the data sample generated by the generator G, representing the probability that the discriminator believes that the sample G(z) generated by the generator comes from the real data distribution.

[0130] Then determine whether the loss function is less than the preset value of the loss function. If so, output the similarity obtained by the discriminator at this time to the next step. Otherwise, adjust the parameters of the discriminator and return to the step of using the discriminator to obtain the similarity between the feature vector of the new data and the feature prototype.

[0131] The fourth step is to determine whether the similarity is greater than the similarity threshold.

[0132] If yes, the new data is used as new shared data.

[0133] Otherwise, the attribute information of the new data is adjusted, and the process returns to the step of extracting features from the new data to obtain a feature vector of the new data.

[0134] Exemplarily, the attribute information may be the size of the data, the format of the data, the update frequency of the data, etc. If the similarity between the feature vector of the new data and the feature prototype is less than the similarity threshold, it means that the consistency between the new data and all the existing shared data is low, and the new data is adjusted, such as adjusting the content of the new data, adjusting the structure of the new data, etc. (for example, if the new data is text information and contains a large number of professional terms, then the professional terms are replaced with general expressions; if all the existing shared data give priority to certain fields or attributes, then ensure that the integrity and expression of the new data in these fields or attributes are consistent with all the existing shared data), and then obtain the feature vector of the adjusted new data, calculate the similarity, and if the similarity is greater than the similarity threshold at this time, it means that the consistency between the adjusted new data and all the existing shared data is high, and it is new shared data.

[0135] In some embodiments of the present application, the blockchain is a multi-level blockchain. After this step, the data sharing method of the present application further includes:

[0136] The new shared data is stored in any block of the blockchain, and the new shared data is migrated to other blocks based on the attribute information of the new shared data.

[0137] Specifically, first use the formula:

[0138] ;

[0139] Build The first layer of blockchain Blocks and Hash links between blocks .

[0140] in, represents a hash function, Indicates The first layer of blockchain blocks, Indicates The first layer of blockchain blocks, , Indicates The total number of blocks in the layer blockchain, Represents an encryption operation.

[0141] Then by the formula:

[0142] ;

[0143] Build Layer 1 blockchain and Hash links between layer blockchains .

[0144] in, Indicates The first layer of blockchain blocks, , Indicates The total number of blocks in the layer blockchain, , , Indicates the number of blockchain layers.

[0145] If the attribute information of the new shared data indicates that the data size of the new shared data is larger than the average size of the existing shared data in the block where the new shared data is located, the new shared data is migrated using the hash links between blocks in the same layer of blockchain.

[0146] Then, based on the attribute information of the new shared data, define the transfer function ;

[0147] ;

[0148] in, Represents logical conditions based on the attribute information of the new shared data, Indicates that the new shared data is stored in The first layer of blockchain blocks, Indicates that the new shared data is stored in The first layer of blockchain blocks.

[0149] Finally, according to the transfer function, the new shared data is migrated using the hash links between layers.

[0150] For example, if (The frequency of new shared data updates is higher than the update frequency threshold )or (The new shared data size exceeds the data size threshold ), the new shared data is added from the hierarchy Migrate to Tiers . and They are respectively the calculation functions of the update frequency and size of the data.

[0151] It should be noted that each time new shared data is stored as a data in the blockchain, the new shared data is migrated using the above steps, so that the storage of the multi-level blockchain structure does not completely depend on the type of data, but is based on factors such as the update frequency, size, importance and access frequency of the data. For example, data with high update frequency or large data volume may be stored at a higher level for fast access and processing, while data with low update frequency or small data volume is stored at a lower level. Such a dynamic storage mechanism not only improves the flexibility and efficiency of data processing, but also strengthens the security and stability of the system. Blockchains at different levels allow data to be stored in a diversion according to its importance and frequency of use. Important and frequently used data is stored at a higher level, while less frequently accessed detailed data is stored at a lower level. Through this layering, the system can more effectively process and protect large amounts of manufacturing data. The top-level blockchain can adopt stronger security measures, while the bottom layer can be optimized for faster data processing and retrieval.

[0152] In addition to new shared data, every existing shared data in the blockchain can be migrated according to the above steps when it needs to be migrated.

[0153] It is worth mentioning that by adjusting the new data according to all the existing shared data, the new data can be made consistent with other existing shared data in terms of attributes, thereby obtaining new shared data with high consistency and reliability.

[0154] In addition, blockchain has the characteristics of being tamper-proof and encrypted. Data sharing based on blockchain ensures data security and information privacy of user nodes. At the same time, since blockchain has multiple blocks for storage, storing existing shared data on different blocks of blockchain can improve the management efficiency and retrieval efficiency of existing shared data. Using hash chains to migrate new shared data can ensure the tamper-proof nature of new shared data while achieving management of new shared data.

[0155] Step 12: Calculate the scarcity score and sensitivity score of the new shared data based on the new shared data, and calculate the scarcity score and sensitivity score of each existing shared data based on each existing shared data.

[0156] The above scarcity score is used to describe the scarcity of data in the blockchain within a preset future time period, and the sensitivity score is used to describe the importance of the data.

[0157] In some embodiments of the present application, the steps of calculating the scarcity score and sensitivity score of the new shared data according to the new shared data, and calculating the scarcity score and sensitivity score of each existing shared data according to each existing shared data are specifically as follows:

[0158] In the first step, the scarcity score and sensitivity score of the newly shared data are calculated based on the newly shared data.

[0159] Specifically, through the formula:

[0160] ;

[0161] Calculate the scarcity score of newly shared data .

[0162] in, represents the maximum scarcity score, represents the future availability of new shared data predicted using the LSTM (Long Short-Term Memory) model. represents the future availability threshold, Indicates a parameter.

[0163] By formula:

[0164] ;

[0165] Calculate sensitivity scores for newly shared data .

[0166] in, represents a machine learning model for sensitivity assessment, Represents a summary of new shared data generated using Generative Pre-Trained Transformer4 (GPT4).

[0167] In the second step, the scarcity score and sensitivity score of each existing shared data are calculated based on each existing shared data.

[0168] Specifically, through the formula:

[0169] ;

[0170] Calculate the The scarcity score of the shared data .

[0171] in, Indicates that the LSTM model is used to The future availability predicted by existing shared data, , Indicates the total number of shared data.

[0172] By formula:

[0173] ;

[0174] Calculate the Sensitivity scores of existing shared data .

[0175] in, Indicates the first A summary of the data that has been shared.

[0176] Exemplarily, the machine learning model for the above sensitivity assessment may be a decision tree regression model or a support vector machine regression model.

[0177] It should be noted that in order to ensure the applicability of the formula for calculating the sensitivity score, it is necessary to convert the new shared data or the existing shared data first. When the new shared data or the existing shared data is numerical data, first calculate the descriptive statistics of the numerical data, such as the mean, median, standard deviation, maximum value, minimum value, etc., and convert the descriptive statistics into easy-to-understand text descriptions, such as "the average value of this numerical data is 56, the standard deviation is 0.7, and it is mainly concentrated in the range of 20 to 82"; when the new shared data or the existing shared data is image data, use computer vision technology, such as pre-trained convolutional neural network (CNN) models, to extract the key visual features of the image data, and then apply image classification technology to identify the main subject or object in the key visual features and convert them into text descriptions.

[0178] It is worth mentioning that obtaining the scarcity score and sensitivity score of new shared data can effectively evaluate the new shared data in terms of real-time and importance.

[0179] Step 13: Based on the scarcity score and sensitivity score of the new shared data and the scarcity score and sensitivity score of all existing shared data in the blockchain, the new shared data and all existing shared data are clustered to obtain the target cluster to which the new shared data belongs.

[0180] In some embodiments of the present application, the above-mentioned step of clustering the new shared data and all the existing shared data based on the scarcity score and sensitivity score of the new shared data and the scarcity score and sensitivity score of all the existing shared data in the blockchain to obtain the target cluster to which the new shared data belongs is specifically:

[0181] In the first step, the new shared data and each existing shared data are regarded as a data point.

[0182] The coordinates of the above data points are a combination of the scarcity score and the sensitivity score corresponding to the data points.

[0183] The second step is to cluster all data points according to their coordinates to obtain multiple clusters.

[0184] Specifically, for each data point, perform the following steps:

[0185] First, it is determined whether the number of data points within a preset neighborhood of the data point is greater than a preset number of points.

[0186] If the number of data points within the preset neighborhood of the data point is greater than the preset number of points, the data point and all data points within the preset neighborhood of the data point are regarded as a potential cluster.

[0187] If the number of data points within the preset neighborhood of a data point is less than or equal to the preset number of points, the data point is marked as a noise point.

[0188] Then, for each potential cluster, the compactness index of the potential cluster and the separation index between the potential cluster and each other potential cluster are calculated according to the coordinates of all data points in the potential cluster.

[0189] Specifically, through the formula:

[0190] ;

[0191] Calculate the The compactness index of potential clusters .

[0192] in, Indicates The set of data points in potential clusters, Represents data points The coordinates of , represents the total number of potential clusters, Q x =[ SS x , SI x ] , Represents data points The scarcity score of Represents data points The sensitivity score, Represents data points The coordinates of Q y =[ SS y , SI y ] , Represents data points The scarcity score of Represents data points sensitivity score.

[0193] By formula:

[0194] ;

[0195] Calculate the potential clusters and Separability index between potential clusters .

[0196] in, Indicates The set of data points in potential clusters, , , Represents data points The coordinates of Q z =[ SS z , SI z ] , Represents data points The scarcity score of Represents data points sensitivity score.

[0197] Then, it is determined whether the compactness index of the potential cluster is less than the compactness index threshold.

[0198] If the compactness index of the potential cluster is less than the compactness index threshold, it is determined whether each separability index of the potential cluster is greater than the separability index threshold.

[0199] If each separability index of a potential cluster is greater than the separability index threshold, the potential cluster is regarded as a cluster.

[0200] If at least one separability index of a potential cluster is less than or equal to the separability index threshold, the potential cluster is discarded.

[0201] If the compactness index of a potential cluster is greater than or equal to the compactness index threshold, the potential cluster is discarded.

[0202] The third step is to take the cluster to which the data point corresponding to the new shared data belongs as the target cluster.

[0203] Exemplarily, if the number of data points within the preset neighborhood of a data point is 12, which is greater than the preset number of points 10, then the data point and all data points within the preset neighborhood are taken as a potential cluster, and the compactness index of the potential cluster is calculated to be 2.1, and the separability index is 1.7. The compactness index is less than the compactness index threshold of 2.5, and the separability index is less than the separability index of 2.0, then the potential cluster is discarded. The compactness index of the potential cluster corresponding to another data point is 1.1, and the separability index is 2.9. The compactness index is less than the compactness index threshold and the separability index is greater than the separability index threshold, then the potential cluster is taken as a cluster.

[0204] It is worth mentioning that the target clustering of the new shared data is obtained according to the compactness index and the separability index, which can obtain multiple existing shared data similar to the new shared data in terms of compactness and separability, which is convenient for subsequent analysis of the target clustering.

[0205] Step 14: determine the benchmark shared data of the target cluster from all the existing shared data in the target cluster, and calculate the relative contribution coefficient of the new shared data based on the scarcity score and sensitivity score of the benchmark shared data.

[0206] The above-mentioned benchmark shared data is the existing shared data that can represent the characteristics of the target cluster among all the existing shared data of the target cluster. For example, if more than 90% of the existing shared data in the target cluster are picture data, and more than 70% of the picture data are in jpg format, and 80% of the existing shared data in the target cluster are factory processing data, then the benchmark shared data is the existing shared data that simultaneously meets the three characteristics of "picture data", "jpg" format, and "factory processing data". According to the above analysis process, the characteristics of multiple target clusters are determined, and the existing shared data that meets all the characteristics are screened. If the number of existing shared data that meets all the characteristics is greater than 1, then one existing shared data is randomly selected from them as the benchmark shared data. The benchmark shared data can also be obtained by analyzing all the existing shared data in the target cluster through the expert consultation method.

[0207] Specifically, through the formula:

[0208] ;

[0209] Calculate the relative contribution coefficient of the new shared data .

[0210] in, represents the scarcity score of the new shared data, represents the sensitivity score of the newly shared data, represents the scarcity score of the benchmark shared data, represents the sensitivity score of the benchmark shared data, , Indicates the scarcity score of the first shared data in the blockchain. Indicates the first The scarcity score of the existing shared data, , Indicates the sensitivity score of the first shared data in the blockchain. Indicates the first sensitivity scores of existing shared data.

[0211] For example, the relative contribution coefficient may be calculated using mathematical calculation software such as Mathematica.

[0212] It is worth mentioning that the relative contribution coefficient calculated based on the scarcity score and sensitivity score takes into account the scarcity and sensitivity attributes of the new shared data, thereby improving the rationality of the relative contribution coefficient.

[0213] Step 15: determine the additional duration level of the user node based on the relative contribution coefficient of the new shared data, and calculate the access permission duration of the user node according to the additional duration level of the new shared data.

[0214] In some embodiments of the present application, the steps of determining the additional duration level of the user node based on the relative contribution coefficient of the new shared data, and calculating the access permission duration of the user node according to the additional duration level of the new shared data are specifically as follows:

[0215] In the first step, the additional time level of the user node is determined based on the relative contribution coefficient of the new shared data.

[0216] By formula:

[0217] ;

[0218] Calculate the additional time level of the user node .

[0219] in, Indicates the highest extra time level, Indicates rounding operation.

[0220] In the second step, the access permission duration of the user node is calculated according to the additional duration level of the newly shared data.

[0221] By formula:

[0222] ;

[0223] Calculate the access permission duration of user nodes .

[0224] in, Indicates the basic duration, Indicates the extra duration coefficient.

[0225] For example, the duration of access rights may be calculated using mathematical calculation software such as Mathematica.

[0226] It is worth mentioning that the relative contribution coefficient can well express the contribution degree of the new shared data uploaded by the user node to the entire blockchain database. The rationality of the access permission duration obtained based on a high rationality relative contribution coefficient is improved.

[0227] Step 16, based on the access permission duration of the user node, control the duration for which the user node accesses each existing shared data through the blockchain.

[0228] In some embodiments of the present application, the smart contract of the blockchain can be used to calculate the access permission duration of the user node through the above steps, and the duration of the user node's access to each existing shared data can be controlled according to the access permission duration.

[0229] For example, the access permission duration of a user node is 97 seconds. When the user node accesses any existing shared data in the blockchain, the user node is only allowed to access for 97 seconds. When the time expires, the access page of the user node will be closed.

[0230] It is worth mentioning that by adjusting the new data according to all the existing shared data, the new data can be kept consistent with other existing shared data in terms of attributes, thereby obtaining new shared data with high consistency and reliability, obtaining the scarcity score and sensitivity score of the new shared data, and effectively evaluating the new shared data in terms of real-time and importance, thereby improving the rationality of the relative contribution coefficient, and making the additional time level based on the relative contribution coefficient more rational. By adjusting the access permission duration of the user node according to the additional time level, the user node can be reasonably incentivized and rewarded, encouraging the user node to upload new data with real-time and importance, and improving the quality of shared data.

[0231] In addition, blockchain has the characteristics of immutability and encryption. Data sharing based on blockchain ensures the security of data and the information privacy of user nodes. At the same time, since blockchain has multiple blocks for storage, storing existing shared data on different blocks of the blockchain can improve the management efficiency and retrieval efficiency of existing shared data.

[0232] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0233] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0234] The above is a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A data sharing method based on blockchain, It is characterized in that include: According to all the existing shared data in the blockchain, the new data uploaded by the user node is adjusted to obtain new shared data; Calculate the scarcity score and sensitivity score of the new shared data according to the new shared data, and calculate the scarcity score and sensitivity score of each existing shared data according to each existing shared data; the scarcity score is used to describe the scarcity of the data in the blockchain within a preset future time period, and the sensitivity score is used to describe the importance of the data; Based on the scarcity score and sensitivity score of the new shared data and the scarcity score and sensitivity score of all existing shared data in the blockchain, cluster the new shared data and all existing shared data to obtain a target cluster to which the new shared data belongs; Determine the benchmark shared data of the target cluster from all the existing shared data in the target cluster, and calculate the relative contribution coefficient of the new shared data based on the scarcity score and sensitivity score of the benchmark shared data; the benchmark shared data is the existing shared data that can represent the characteristics of the target cluster among all the existing shared data of the target cluster; Determine the additional duration level of the user node based on the relative contribution coefficient of the new shared data, and calculate the access permission duration of the user node according to the additional duration level of the new shared data; According to the duration of the access permission of the user node, the duration for which the user node accesses each of the existing shared data through the blockchain is controlled; The step of calculating the scarcity score and the sensitivity score of the new shared data according to the new shared data includes: By formula: Calculate the scarcity score of the newly shared data ; in, represents the maximum scarcity score, represents the future availability of the new shared data predicted by the LSTM model, represents the future availability threshold, k represents the parameter; By formula: Calculate the sensitivity score of the newly shared data ; in, represents a machine learning model for sensitivity assessment, A summary of the new shared data generated using GPT4; The calculating the scarcity score and the sensitivity score of each of the existing shared data according to each of the existing shared data includes: By formula: Calculate the The scarcity score of the shared data ; in, Indicates that the LSTM model is used to The future availability predicted by existing shared data, , Indicates the total number of existing shared data; By formula: Calculate the Sensitivity scores of existing shared data ; in, Represents the first A summary of existing shared data; The method of clustering the new shared data and all existing shared data based on the scarcity score and sensitivity score of the new shared data and the scarcity score and sensitivity score of all existing shared data in the blockchain to obtain a target cluster to which the new shared data belongs includes: The new shared data and each of the existing shared data are each regarded as a data point; the coordinates of the data point are a combination of the scarcity score and the sensitivity score corresponding to the data point; Cluster all data points according to their coordinates to obtain multiple clusters; The cluster to which the data point corresponding to the new shared data belongs is taken as the target cluster; The calculating the relative contribution coefficient of the new shared data based on the scarcity score and the sensitivity score of the benchmark shared data includes: By formula: Calculate the relative contribution coefficient of the new shared data ; in, represents the scarcity score of the new shared data, represents the sensitivity score of the new shared data, represents the scarcity score of the benchmark shared data, represents the sensitivity score of the benchmark shared data, , Indicates the scarcity score of the first shared data in the blockchain. Indicates the first The scarcity score of the existing shared data, , Indicates the sensitivity score of the first shared data in the blockchain. Indicates the first sensitivity scores of existing shared data.

2. The data sharing method according to claim 1, It is characterized in that After the step of adjusting the new data uploaded by the user node according to all the existing shared data in the blockchain to obtain new shared data, the data sharing method further includes: The new shared data is stored in any block of the blockchain, and the new shared data is migrated to other blocks based on the attribute information of the new shared data.

3. The data sharing method according to claim 2, It is characterized in that The migrating the new shared data to other blocks based on the attribute information of the new shared data includes: By formula: Build Hash link between the nth block and the n-1th block in the layer blockchain ; in, represents a hash function, Indicates the The nth block in the layer blockchain, Indicates the The n-1th block in the layer blockchain, , N represents the The total number of blocks in the layer blockchain, Indicates encryption operation; By formula: Construct the Hash link between layer blockchain and layer m blockchain ; in, represents the jth block in the mth layer blockchain, m, , , L represents the number of blockchain layers, , Indicates the The total number of blocks in the layer blockchain; If the attribute information of the new shared data indicates that the data size of the new shared data is larger than the average size of the existing shared data in the block where the new shared data is located, the new shared data is migrated using the hash link between blocks in the same layer of blockchain; According to the attribute information of the new shared data, a transfer function is defined ; in, represents a logical condition based on the attribute information of the new shared data, Indicates that the new shared data is stored in The nth block in the layer blockchain, Indicates that the new shared data is stored in the jth block of the mth layer blockchain; According to the transfer function, the new shared data is migrated using hash links between layers.

4. The data sharing method according to claim 1, It is characterized in that The method adjusts the new data uploaded by the user node according to all the existing shared data in the blockchain to obtain new shared data, including: By formula: Calculate the feature prototype P of all existing shared data; in, Represents the feature vector of the i-th shared data: in, , Indicates the total number of existing shared data, represents the feature extraction function, Indicates the There is already shared data. Represents the parameters of the feature extraction function; Performing feature extraction on the new data to obtain a feature vector of the new data; Using a discriminator to obtain the similarity between the feature vector of the new data and the feature prototype; Determining whether the similarity is greater than a similarity threshold; If yes, the new data is used as new shared data; Otherwise, the attribute information of the new data is adjusted, and the process returns to the step of extracting features from the new data to obtain a feature vector of the new data.

5. The data sharing method according to claim 1, It is characterized in that The step of clustering all data points according to the coordinates of all data points to obtain multiple clusters includes: For each of the data points, perform the following steps: Determine whether the number of data points within a preset neighborhood of the data point is greater than a preset number of points; If the number of data points within the preset neighborhood of the data point is greater than the preset number of points, the data point and all data points within the preset neighborhood of the data point are taken as a potential cluster; If the number of data points within the preset neighborhood of the data point is less than or equal to the preset number of points, the data point is marked as a noise point; For each of the potential clusters, respectively, according to the coordinates of all data points in the potential cluster, calculate the compactness index of the potential cluster and the separation index between the potential cluster and each other potential cluster; Determining whether the compactness index of the potential cluster is less than a compactness index threshold; If the compactness index of the potential cluster is less than the compactness index threshold, determining whether each of the separability indexes of the potential cluster is greater than the separability index threshold; If each of the separability indexes of the potential clusters is greater than the separability index threshold, the potential clusters are regarded as a cluster; If at least one of the separability indexes of the potential clusters is less than or equal to the separability index threshold, the potential clusters are discarded; If the compactness index of the potential cluster is greater than or equal to the compactness index threshold, the potential cluster is discarded.

6. The data sharing method according to claim 5, It is characterized in that The step of calculating the compactness index of the potential cluster and the separation index between the potential cluster and each other potential cluster according to the coordinates of all data points in the potential cluster comprises: By formula: Calculate the The compactness index of potential clusters ; in, Indicates the The set of data points in potential clusters, Represents data points The coordinates of , represents the total number of potential clusters, , Represents the data point The scarcity score of Represents the data point The sensitivity score, Represents data points The coordinates of , Represents the data point The scarcity score of Represents the data point sensitivity score; By formula: Calculate the potential clusters and Separability index between potential clusters ; in, Indicates the The set of data points in potential clusters, , , Represents data points The coordinates of , Represents the data point The scarcity score of Represents the data point sensitivity score.

7. The data sharing method according to claim 1, It is characterized in that The determining the additional duration level of the user node based on the relative contribution coefficient of the new shared data includes: By formula: Calculate the additional duration level of the user node ; in, Indicates the highest extra time level, Indicates rounding operation; The calculating the access permission duration of the user node according to the additional duration level of the new shared data includes: By formula: Calculate the access permission duration of the user node ; in, Indicates the basic duration, Indicates the extra duration coefficient.