Data security sharing method and system based on block chain

By using a blockchain-based dynamic encryption strategy and storage node evaluation, the problem of insufficient security in traditional data sharing methods is solved, thereby improving the security and reliability of data sharing and storage processes.

CN121333701APending Publication Date: 2026-01-13HUBEI ENG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511511085.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-22
Publication Date
2026-01-13

AI Technical Summary

Technical Problem

Traditional data sharing methods rely on a single server or database, making it difficult to identify potential leakage or attack risks, resulting in reduced security of shared data and increased risk of data leakage or damage.

Method used

A blockchain-based dynamic encryption strategy is adopted. By sharing data characteristics, evaluating the resilience of storage nodes, and using a blockchain trust management mechanism, a shared encryption coefficient is generated. Target data is then screened for compression and risk assessment. The decision on whether to perform secondary encryption is based on the encryption risk level.

Benefits of technology

It achieves a dynamic balance between data security, recoverability, and protection priorities during data sharing and storage, thereby improving data protection capabilities and sharing reliability in multi-node environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121333701A_ABST
    Figure CN121333701A_ABST
Patent Text Reader

Abstract

The invention discloses a data security sharing method and system based on a block chain, relates to the technical field of data security sharing, and is used for solving the problem of reduced security of shared data, calling shared data through a shared database, reading block chain information, obtaining a key length and an encryption duration, and generating a shared encryption coefficient. Screening target data, compressing the target data and extracting content mode features; calling storage node information, detecting disaster recovery switching time through an operation and maintenance log, counting access permission change times in unit time, and calculating node toughness characteristics; constructing a feature vector based on a content mode and node toughness, evaluating an encryption risk level by using K-means clustering, generating an encryption priority coefficient according to sorting, calculating an encryption evaluation value in combination with normalized disaster recovery switching time, executing secondary encryption when a preset threshold value is reached, and obtaining a second encryption result; and the security, the restorability and the protection priority dynamic balance of the shared data in the storage process are realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data security sharing technology, and more specifically, to a data security sharing method and system based on blockchain. Background Technology

[0002] With the rapid development of information technology, data has become a crucial asset for enterprises and organizations. In scenarios such as big data, cloud computing, and the Internet of Things, the generation, transmission, and storage of data are experiencing explosive growth. However, data sharing and transfer are subject to security risks, including unauthorized alteration, leakage, or loss. To ensure data integrity and security, traditional data security sharing methods typically rely on centralized servers or a single encryption mechanism.

[0003] The existing technology has the following shortcomings: Currently, traditional data sharing methods typically rely on a single server or database, and mostly employ fixed encryption algorithms and key lengths. This makes it difficult to identify potential risks of leakage or attack, such as unauthorized access or frequent switching, leading to reduced security of shared data and increased risks of data leakage or damage. Therefore, this paper proposes a data security sharing method and system based on blockchain.

[0004] The information disclosed in the background section is only intended to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention

[0005] To overcome the aforementioned deficiencies of the prior art, embodiments of the present invention provide a data security sharing method and system based on blockchain, which solves the problems mentioned in the background art by employing dynamic encryption strategies based on shared data characteristics, storage node resilience assessment, and blockchain trust management mechanisms.

[0006] To achieve the above objectives, the present invention provides the following technical solution: a data security sharing method based on blockchain, comprising the following steps: Step S1: Retrieve shared data from the shared database, read the blockchain information of the shared data, obtain the key length and encryption duration of the shared data, and generate the shared encryption coefficient of the shared data by combining the key length and encryption duration; Step S2: Filter the shared data according to the shared encryption coefficient to obtain the target data, compress the target data, detect the compression status of the target data, and calculate the content pattern characteristics of the target data according to the compression status; Step S3: Retrieve the storage node of the target data, detect the disaster recovery switchover time and the number of access permission changes of the storage node, calculate the resilience characteristics of the storage node based on the number of access permission changes, and assess the encryption risk level of the target data in combination with the content mode characteristics; Step S4: Sort the target data based on the encryption risk level and generate the encryption priority coefficient of the target data. Combine the disaster recovery switchover time of the storage node to determine whether to perform secondary encryption on the target data.

[0007] In a preferred embodiment, in step S1, shared data is retrieved through a shared database, and the blockchain information of the shared data is read using the blockchain node interface associated with the shared data; Blockchain information includes the key length and encryption duration of the shared data; The encryption duration is the time interval from the time the key became effective until the current moment when it has been continuously used. The ratio of the key length to a preset key length threshold is used as the key strength score.

[0008] In a preferred embodiment, in step S1, the average encryption duration of each shared data is used as the security baseline duration. Calculate the timeliness score using the safety baseline time interval: ,in, For safety reference time interval, To encrypt the duration, It is a natural constant. Rate the timeliness; The product of the key strength score and the timeliness score is used as the shared encryption coefficient.

[0009] In a preferred embodiment, in step S2, the shared encryption coefficients of each shared data are combined into an encryption coefficient set, and the absolute value of the difference between the shared encryption coefficients and the median of the encryption coefficient set is taken as the absolute deviation. The median of each absolute deviation is used as the median absolute deviation, and the encryption coefficient threshold is calculated using the median absolute deviation. If the shared encryption coefficient is lower than the encryption coefficient threshold, the shared data will be marked as target data. Conversely, shared data is not tagged.

[0010] In a preferred embodiment, in step S2, the target data is compressed using a data compression tool. After the compression is completed, the compression status of the target data is detected. The compression status includes compression time and compression ratio. Compression rate is the ratio of the target data storage space occupied after compression to that before compression; The compression duration and compression ratio are standardized, and the ratio of the standardized compression duration to the compression ratio is used as the content mode feature.

[0011] In a preferred embodiment, in step S3, the storage node of the target data is retrieved, and the time required for the storage node to complete the disaster recovery switchover operation when a failure occurs is detected through the operation and maintenance log of the storage node, so as to obtain the disaster recovery switchover time. By retrieving the access control logs of the storage nodes, the number of access permission change events within a preset unit time window is statistically analyzed and accumulated to obtain the number of access permission changes. Calculate the resilience characteristics of storage nodes based on the number of access permission changes: ,in, Characterized by toughness, For the number of times access permissions can be changed, This is a safety factor constant.

[0012] In a preferred embodiment, in step S3, the content pattern features and resilience features are constructed into a feature vector, and the encryption risk level of the target data is evaluated based on the feature vector using a K-means clustering analysis algorithm. Set the number of clusters k, with each cluster corresponding to level 1, level 2, level 3 to level k respectively; By calculating the Euclidean distance between the feature vector of each target data and the center vector of each cluster, target data with similar features are assigned to the same cluster; After clustering is completed, the target data obtains its encryption risk level based on the label of its cluster.

[0013] In a preferred embodiment, in step S4, the target data is sorted in descending order according to the encryption risk level and an encryption priority coefficient is generated: ,in, This is the encryption priority factor. is the ordinal number of the target data in the sorted result, and k is the total number of target data; The disaster recovery switchover time is normalized to obtain the normalized disaster recovery switchover time. The encryption priority coefficient and the normalized disaster recovery switching time are input into a fusion function constructed based on the Euclidean distance formula to obtain the encryption evaluation value; Calculate the mean of the encrypted evaluation values ​​of all target data, and use it as the encrypted evaluation threshold; When the encryption evaluation value is greater than or equal to the encryption evaluation threshold, it is determined that the target data should be encrypted a second time. Conversely, it is determined that the target data will not be encrypted a second time.

[0014] A blockchain-based data security sharing system includes an information analysis module, a data feature module, a node evaluation module, and an encryption decision-making module. The functions of each module are as follows: The information analysis module retrieves shared data from the shared database, reads the blockchain information of the shared data, obtains the key length and encryption duration of the shared data, and generates the shared encryption coefficient of the shared data by combining the key length and encryption duration. The data feature module filters shared data based on the shared encryption coefficient to obtain target data, compresses the target data, detects the compression status of the target data, and calculates the content pattern features of the target data based on the compression status. The node assessment module retrieves the storage node of the target data, detects the disaster recovery switchover time and the number of access permission changes of the storage node, calculates the resilience characteristics of the storage node based on the number of access permission changes, and assesses the encryption risk level of the target data in combination with the content mode characteristics. The encryption decision module sorts the target data based on the encryption risk level and generates an encryption priority coefficient for the target data. It then determines whether to perform secondary encryption on the target data based on the disaster recovery switchover time of the storage node.

[0015] The technical effects and advantages of this invention are as follows: This invention retrieves shared data from a shared database, reads its blockchain information, obtains key length and encryption duration, and generates a shared encryption coefficient. Based on this coefficient, target data is selected and compressed. The compression status is monitored, and content pattern features are extracted. Storage node information is retrieved, and node disaster recovery switching time is monitored using operation and maintenance logs. The number of access permission changes within a unit time window is counted, and the resilience characteristics of the storage nodes are calculated. A feature vector is constructed based on the content pattern features of the target data and the resilience characteristics of the storage nodes. A K-means clustering algorithm is used to assess the encryption risk level of the target data, with the number of clusters corresponding to different encryption risk levels. The target data is sorted according to the encryption risk level, generating an encryption priority coefficient. Combined with the normalized disaster recovery switching time of the storage nodes, an encryption evaluation value is calculated using a fusion function. When the evaluation value reaches a preset threshold, secondary encryption is performed on the target data. This achieves a dynamic balance between data security, recoverability, and protection priority during sharing and storage, improving data protection capabilities and sharing reliability in multi-node environments. Attached Figure Description

[0016] Figure 1 This is a flowchart of a blockchain-based data security sharing method according to the present invention.

[0017] Figure 2 This is a schematic diagram of a blockchain-based data security sharing system according to the present invention. Detailed Implementation

[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0019] This invention retrieves shared data from a shared database, reads its blockchain information, obtains key length and encryption duration, and generates a shared encryption coefficient. Based on this coefficient, target data is selected and compressed. The compression status is monitored, and content pattern features are extracted. Storage node information is retrieved, and node disaster recovery switchover time is monitored using operation and maintenance logs. The number of access permission changes within a unit time window is counted, and the resilience characteristics of the storage nodes are calculated. A feature vector is constructed based on the content pattern features of the target data and the resilience characteristics of the storage nodes. A K-means clustering algorithm is used to assess the encryption risk level of the target data, with the number of clusters corresponding to different encryption risk levels. The target data is sorted according to the encryption risk level, generating an encryption priority coefficient. Combined with the normalized disaster recovery switchover time of the storage nodes, an encryption evaluation value is calculated using a fusion function. When the evaluation value reaches a preset threshold, secondary encryption is performed on the target data, achieving a dynamic balance between data security, recoverability, and protection priority during sharing and storage.

[0020] Example 1

[0021] Please see Figure 1 A data security sharing method based on blockchain, the specific steps of which are as follows: Step S1: Retrieve shared data from the shared database, read the blockchain information of the shared data, obtain the key length and encryption duration of the shared data, and generate the shared encryption coefficient of the shared data by combining the key length and encryption duration; Step S2: Filter the shared data according to the shared encryption coefficient to obtain the target data, compress the target data, detect the compression status of the target data, and calculate the content pattern characteristics of the target data according to the compression status; Step S3: Retrieve the storage node of the target data, detect the disaster recovery switchover time and the number of access permission changes of the storage node, calculate the resilience characteristics of the storage node based on the number of access permission changes, and assess the encryption risk level of the target data in combination with the content mode characteristics; Step S4: Sort the target data based on the encryption risk level and generate the encryption priority coefficient of the target data. Combine the disaster recovery switchover time of the storage node to determine whether to perform secondary encryption on the target data.

[0022] The specific implementation is as follows: In step S1, shared data is retrieved through a shared database. Shared data is a collection of data that can be accessed, used, and exchanged by different users or access terminals. It is protected by encryption algorithms during storage and transmission. The blockchain records the relevant metadata information of the shared data to ensure that the data is traceable, tamper-proof, and available for secure management and access. By using the on-chain anchor index associated with the shared data to call the blockchain node interface, the blockchain information of the shared data can be read. The blockchain information is a set of on-chain metadata in the blockchain ledger, which reflects the encryption and security status of the shared data. The blockchain information includes the key length and encryption duration of the shared data. Key length is the number of binary bits in the key used to encrypt shared data; The encryption duration is the time interval from the time the key became effective until the current moment when it has been continuously used. The ratio of the key length to a preset key length threshold is used as the key strength score; It should be explained that the preset key length threshold is the maximum key length supported in the blockchain, which is recorded in the parameter contract of the on-chain system.

[0023] The average encryption duration of each shared data segment is used as the security baseline duration. The timeliness score is then calculated using the security baseline duration and the encryption duration. ,in, For safety reference time interval, To encrypt the duration, It is a natural constant. Rate the timeliness; The timeliness score ranges from 0 to 1. The shorter the encryption duration, the higher the timeliness score. The product of the key strength score and the timeliness score is used as the shared encryption coefficient; The shared encryption coefficient is used to reflect the encryption security level of shared data. The longer the key length, the higher the encryption strength of the shared data, and the larger the shared encryption coefficient. The shorter the encryption duration, the higher the key freshness of the shared data, and the larger the shared encryption coefficient.

[0024] It should be noted that a shared database refers to a database system that is accessed by multiple authorized entities and is used to centrally store shared data that has been encrypted or de-identified by all parties. In this embodiment, it is used to retrieve the corresponding shared data.

[0025] In step S2, the shared encryption coefficients of each shared data are combined into an encryption coefficient set. The absolute value of the difference between the shared encryption coefficients and the median of the encryption coefficient set is taken as the absolute deviation. The median of each absolute deviation is taken as the median absolute deviation. The encryption coefficient threshold is calculated using the median absolute deviation. ,in, This represents the absolute deviation of the median. The preset adjustment factor, The median of the set of encryption coefficients. The encryption coefficient threshold; The target data is obtained by comparing the encryption coefficient threshold with the shared encryption coefficient and filtering the shared data. If the shared encryption coefficient is lower than the encryption coefficient threshold, the shared data will be marked as target data. Conversely, shared data is not tagged.

[0026] The target data is compressed using a data compression tool. After compression, the compression status of the target data is detected, including compression time and compression ratio. Compression ratio is the ratio of the target data storage space occupied after compression to that before compression, reflecting the degree of compressibility of the target data in the compression process; The compression duration and compression ratio are standardized, and the ratio of the standardized compression duration to the compression ratio is used as the content mode feature.

[0027] Content pattern characteristics reflect the data organization complexity and redundancy of the target data. The longer the compression time, the more complex the target data structure and the higher the content pattern characteristics. The higher the compression rate, the lower the redundancy of the target data, the worse the compressibility, and the lower the content pattern characteristics.

[0028] It should be explained that the preset adjustment factor is used to adjust the sensitivity of the encryption coefficient threshold. The adjustment factor can be determined based on the distribution of shared encryption coefficients in historical shared data. For example, all shared data within a preset historical period can be statistically analyzed to form an encryption coefficient set. The median and absolute deviation of the median of the encryption coefficient set can be calculated. Combined with the proportion of actual security events in historical data, the value of the adjustment factor can be adjusted so that the proportion of shared data below the encryption coefficient threshold in the total data meets the security policy requirements. The data compression tool refers to the software and hardware program used to encode data. In this embodiment, the data compression tool records the compression time and compression rate during the compression process. The standardization processing methods include, but are not limited to, standard linear transformation based on interval scaling, Z-Score standardization method based on statistics, or normalization method based on nonlinear mapping function. The application methods of standardization processing will not be elaborated here.

[0029] In step S3, the storage node of the target data is retrieved, and the storage node is a virtual storage unit that carries the target data.

[0030] The disaster recovery switchover time of storage nodes is detected by the operation and maintenance logs of storage nodes. The disaster recovery switchover time is used to measure the length of time required for a storage node to complete the disaster recovery switchover operation when a failure occurs. When a storage node experiences hardware failure, software failure, network failure, or human error, the storage node records the time of the failure in the operation and maintenance log, and then triggers a disaster recovery switchover operation, including switching to a standby node, starting a data backup and recovery program or restoring a redundant storage copy, performing data synchronization or service recovery, until the target data is restored to an accessible state, recording the recovery completion time, and using the difference between the recovery completion time and the failure occurrence time as the disaster recovery switchover time.

[0031] It should be noted that operation and maintenance logs refer to the collection of all operating status information, event trigger information, operation records, and abnormal event records automatically recorded by the management system during the operation of storage nodes, which are used to monitor, analyze, and manage the operation of storage nodes.

[0032] By retrieving the access control logs of storage nodes, the number of access permission changes is detected. Access permission changes refer to modifications to the access control policies of storage nodes, including but not limited to adding or removing user permissions, adjusting user roles, and updating access control policies. When an access permission change occurs, the storage node records it in the access control log, and the number of access permission changes within a preset unit time window is accumulated to obtain the total number of access permission changes. The preset time window length can be configured according to access control policies and monitoring needs, and the unit is usually minutes, hours, or days. For example, if the time window is set to 24 hours, all permission increases, decreases, and role adjustments that occur within 24 hours will be counted as access permission changes.

[0033] It should be noted that the access control log is a structured log file automatically generated and saved by the access control system of the storage node. It is used to record historical information about user operations on storage node resources using access control policies.

[0034] The number of access permission changes reflects the dynamism of storage nodes in adjusting access control policies. A higher value indicates that the access management of storage nodes changes frequently, making them more susceptible to data leaks or operational anomalies. A lower value indicates that the access management of storage nodes is relatively stable, which is beneficial to data security.

[0035] Based on the number of access permission changes, the resilience characteristics of the storage node are calculated, and are defined as follows: ; in, For toughness characteristics, satisfy , For the number of times access permissions can be changed, This is a constant safety factor used to adjust the impact of access permission changes on node resilience.

[0036] It should be noted that the security factor constant is a preset value, and the standard deviation of the number of historical access permission changes can be taken as the security factor constant.

[0037] The lower the number of access permission changes, the higher the resilience, the stronger the stability of the storage node in access control, and the more positive the impact on data security; conversely, the higher the number of access permission changes, the lower the resilience, and the greater the risk of data leakage or operational errors.

[0038] Content pattern features and resilience features are constructed into feature vectors, and the encryption risk level of the target data is evaluated based on the feature vectors using the K-means clustering analysis algorithm. Set the number of clusters k, and each cluster corresponds to level 1, level 2, level 3 to level k respectively. The K-means clustering analysis algorithm calculates the Euclidean distance between the feature vector of each target data and the center vector of each cluster, and assigns target data with similar features to the same cluster. The position of the center vector of each cluster in the two-dimensional feature space determines the encryption risk level of the cluster. It should be noted that the clustering number uses the variance of the feature vector as a basis. The most suitable value of k is selected by calculating the similarity between the feature vector and its own cluster and other clusters. The value of k is used as the upper limit of the level, with level 1 to level k corresponding to risks from low to high.

[0039] After clustering is completed, the target data obtains an encryption risk level based on the label of its cluster, which reflects the overall risk status of the target data. The higher the level, the greater the encryption risk. The encryption risk level provides a quantitative basis for generating encryption priority coefficients and determining whether to perform secondary encryption.

[0040] It should be noted that the K-means clustering analysis algorithm is a partition-based unsupervised learning method used to divide data objects into a predetermined number of clusters according to feature similarity. The optimization objective is to minimize the squared error within each cluster. By iteratively calculating the distance between the data object and the cluster center, the algorithm achieves automatic classification and aggregation of data objects.

[0041] In step S4, the target data is sorted in descending order according to the encryption risk level, and an encryption priority coefficient is assigned to each target data according to the sorting result. The specific calculation formula is as follows: ; in, This is the encryption priority factor. Let k be the ordinal number of the target data in the sorting result, k be the total number of target data, and the encryption priority coefficient range is [value missing]. The higher the value, the higher the priority of encryption protection.

[0042] The disaster recovery switchover time of the target data storage node is retrieved and normalized to unify the dimensions of the disaster recovery switchover time and the encryption priority coefficient. The normalization calculation formula is as follows: ; in, To normalize disaster recovery switchover time, For the disaster recovery switchover time of the target data storage node, and These represent the minimum and maximum disaster recovery failover times for all storage nodes, respectively.

[0043] The encryption priority coefficient and the normalized disaster recovery switchover time are input into the fusion function to obtain the encryption evaluation value. The fusion function is defined as follows: ; in, For encrypted evaluation value, This is the encryption priority factor. This refers to the normalized disaster recovery switchover time.

[0044] The fusion function is based on the Euclidean distance formula. The larger the encryption priority coefficient and the normalized disaster recovery switching time, the larger the encryption evaluation value.

[0045] Calculate the mean of the encrypted evaluation values ​​of all target data, and use it as the encrypted evaluation threshold; When the encryption evaluation value is greater than or equal to the encryption evaluation threshold, it is determined that the target data should be encrypted a second time. When the encryption evaluation value is less than the encryption evaluation threshold, it is determined that the target data will not be encrypted again.

[0046] It should be noted that Euclidean distance refers to the straight-line distance between two sample points in a multidimensional feature space. Its calculation formula comes from the spatial measurement method of Euclidean geometry. In this embodiment, it is used to measure the encrypted evaluation value of target data in a two-dimensional feature space.

[0047] Example 2: A blockchain-based data security sharing system includes an information analysis module, a data feature module, a node evaluation module, and an encryption decision-making module. The functions of each module are as follows: The information analysis module retrieves shared data from the shared database, reads the blockchain information of the shared data, obtains the key length and encryption duration of the shared data, and generates the shared encryption coefficient of the shared data by combining the key length and encryption duration. The data feature module filters shared data based on the shared encryption coefficient to obtain target data, compresses the target data, detects the compression status of the target data, and calculates the content pattern features of the target data based on the compression status. The node assessment module retrieves the storage node of the target data, detects the disaster recovery switchover time and the number of access permission changes of the storage node, calculates the resilience characteristics of the storage node based on the number of access permission changes, and assesses the encryption risk level of the target data in combination with the content mode characteristics. The encryption decision module sorts the target data based on the encryption risk level and generates an encryption priority coefficient for the target data. It then determines whether to perform secondary encryption on the target data based on the disaster recovery switchover time of the storage node.

[0048] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, in the form of a computer program product.

[0049] Those skilled in the art will recognize that the modules and algorithm steps of the various examples 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 implemented in hardware or software depends on the specific application and inventive constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0050] In addition, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module.

[0051] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0052] In conclusion, the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A data security sharing method based on blockchain, characterized in that: Includes the following steps: Step S1: Retrieve shared data from the shared database, read the blockchain information of the shared data, obtain the key length and encryption duration of the shared data, and generate the shared encryption coefficient of the shared data by combining the key length and encryption duration; Step S2: Filter the shared data according to the shared encryption coefficient to obtain the target data, compress the target data, detect the compression status of the target data, and calculate the content pattern characteristics of the target data according to the compression status; Step S3: Retrieve the storage node of the target data, detect the disaster recovery switchover time and the number of access permission changes of the storage node, calculate the resilience characteristics of the storage node based on the number of access permission changes, and assess the encryption risk level of the target data in combination with the content mode characteristics; Step S4: Sort the target data based on the encryption risk level and generate the encryption priority coefficient of the target data. Combine the disaster recovery switchover time of the storage node to determine whether to perform secondary encryption on the target data.

2. The data security sharing method based on blockchain according to claim 1, characterized in that: In step S1, shared data is retrieved through the shared database, and the blockchain information of the shared data is read using the blockchain node interface associated with the shared data; Blockchain information includes the key length and encryption duration of the shared data; The encryption duration is the time interval from the time the key became effective until the current moment when it has been continuously used. The ratio of the key length to a preset key length threshold is used as the key strength score.

3. The data security sharing method based on blockchain according to claim 2, characterized in that: In step S1, the average encryption duration of each shared data is used as the security baseline duration; Calculate the timeliness score using the safety baseline time interval: ,in, For safety reference time interval, To encrypt the duration, It is a natural constant. Rate the timeliness; The product of the key strength score and the timeliness score is used as the shared encryption coefficient.

4. The data security sharing method based on blockchain according to claim 1, characterized in that: In step S2, the shared encryption coefficients of each shared data are combined into an encryption coefficient set, and the absolute value of the difference between the shared encryption coefficients and the median of the encryption coefficient set is taken as the absolute deviation. The median of each absolute deviation is used as the median absolute deviation, and the encryption coefficient threshold is calculated using the median absolute deviation. If the shared encryption coefficient is lower than the encryption coefficient threshold, the shared data will be marked as target data. Conversely, shared data is not tagged.

5. A data security sharing method based on blockchain according to claim 4, characterized in that: In step S2, the target data is compressed using a data compression tool. After the compression is completed, the compression status of the target data is detected. The compression status includes compression time and compression ratio. Compression rate is the ratio of the target data storage space occupied after compression to that before compression; The compression duration and compression ratio are standardized, and the ratio of the standardized compression duration to the compression ratio is used as the content mode feature.

6. The data security sharing method based on blockchain according to claim 1, characterized in that: In step S3, the storage node of the target data is retrieved, and the time required for the storage node to complete the disaster recovery switchover operation when a failure occurs is detected through the operation and maintenance log of the storage node, so as to obtain the disaster recovery switchover time. By retrieving the access control logs of the storage nodes, the number of access permission change events within a preset unit time window is statistically analyzed and accumulated to obtain the number of access permission changes. Calculate the resilience characteristics of storage nodes based on the number of access permission changes: ,in, Characterized by toughness, For the number of times access permissions can be changed, This is a safety factor constant.

7. A data security sharing method based on blockchain according to claim 6, characterized in that: In step S3, the content pattern features and resilience features are constructed into feature vectors, and the encryption risk level of the target data is evaluated based on the feature vectors using the K-means clustering analysis algorithm. Set the number of clusters k, with each cluster corresponding to level 1, level 2, level 3 to level k respectively; By calculating the Euclidean distance between the feature vector of each target data and the center vector of each cluster, target data with similar features are assigned to the same cluster; After clustering is completed, the target data obtains its encryption risk level based on the label of its cluster.

8. A data security sharing method based on blockchain according to claim 7, characterized in that: In step S4, the target data is sorted in descending order according to the encryption risk level, and an encryption priority coefficient is generated: ,in, This is the encryption priority factor. is the ordinal number of the target data in the sorted result, and k is the total number of target data; The disaster recovery switchover time is normalized to obtain the normalized disaster recovery switchover time. The encryption priority coefficient and the normalized disaster recovery switching time are input into a fusion function constructed based on the Euclidean distance formula to obtain the encryption evaluation value; Calculate the mean of the encrypted evaluation values ​​of all target data, and use it as the encrypted evaluation threshold; When the encryption evaluation value is greater than or equal to the encryption evaluation threshold, it is determined that the target data should be encrypted a second time. Conversely, it is determined that the target data will not be encrypted a second time.

9. A blockchain-based secure data sharing system, used to implement the blockchain-based secure data sharing method according to any one of claims 1-8, characterized in that: It includes an information analysis module, a data feature module, a node evaluation module, and an encryption decision-making module. The functions of each module are as follows: The information analysis module retrieves shared data from the shared database, reads the blockchain information of the shared data, obtains the key length and encryption duration of the shared data, and generates the shared encryption coefficient of the shared data by combining the key length and encryption duration. The data feature module filters shared data based on the shared encryption coefficient to obtain target data, compresses the target data, detects the compression status of the target data, and calculates the content pattern features of the target data based on the compression status. The node assessment module retrieves the storage node of the target data, detects the disaster recovery switchover time and the number of access permission changes of the storage node, calculates the resilience characteristics of the storage node based on the number of access permission changes, and assesses the encryption risk level of the target data in combination with the content mode characteristics. The encryption decision module sorts the target data based on the encryption risk level and generates an encryption priority coefficient for the target data. It then determines whether to perform secondary encryption on the target data based on the disaster recovery switchover time of the storage node.