A Blockchain-Based Agricultural Data Secure Storage Method and System

By introducing dynamic key management and blockchain technology into agricultural data storage, dynamic target key sets are generated, and agricultural data is encrypted and stored, solving the security and efficiency problems of traditional agricultural data storage methods and achieving efficient and secure data storage.

CN118536135BActive Publication Date: 2025-06-13CHONGQING INST OF ENG
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410613412.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-16
Publication Date
2025-06-13
Estimated Expiration
2044-05-16

AI Technical Summary

Technical Problem

Traditional agricultural data storage methods have problems such as low data security, poor traceability, and low sharing and transmission efficiency. Existing encryption algorithms are prone to attacks, affecting the security of agricultural data on blockchain.

Method used

By introducing dynamic key management and combining blockchain technology, agricultural data uploaded by user nodes are obtained, accessed nodes are determined based on data identification, key tables and locations of each accessible node are obtained, dynamic target key sets are generated based on hierarchical differences and location information, data is encrypted, and encrypted data is stored in the blockchain.

Benefits of technology

It realizes efficient and secure storage of agricultural data. Through dynamic key management and blockchain technology, encryption complexity and data security are improved, malicious attacks are effectively prevented, and agricultural data on blockchain are protected.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118536135B_ABST
    Figure CN118536135B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and system for secure storage of agricultural data based on blockchain, relating to the technical fields of blockchain technology and data storage security technology. The method includes: obtaining agricultural data uploaded by a user node, where the agricultural data includes a user node identifier and a data identifier; determining accessible nodes according to the data identifier; obtaining the key tables and locations of each accessible node, filtering and fusing the key tables according to the location and the level difference between the user node and the accessible nodes to obtain a target key set; encrypting the agricultural data by using the target key set to obtain encrypted agricultural data, and storing the encrypted agricultural data in the blockchain. By comprehensively considering data types, data levels, node level differences, and location information, the present invention generates a dynamic target key set, greatly improving the complexity of encryption and the security of data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of blockchain technology and data security storage, and particularly relates to a method and system for secure storage of agricultural data based on blockchain. Background Art

[0002] With the continuous development and popularization of information technology, the secure storage and management of agricultural data have become increasingly important. Agricultural data covers many key information such as farmland soil, climate, and crop growth conditions, which is of great significance for agricultural production, scientific research, and policy making. However, traditional agricultural data storage methods often have problems such as low data security, poor traceability, and low sharing and transmission efficiency.

[0003] Then, in existing agricultural data storage systems, when storing data, encryption algorithms such as RSA encryption and DSA are used to encrypt the agricultural data to be stored. These encryption methods are too simple and vulnerable to attacks, which greatly affects the security of agricultural data on the blockchain. Summary of the Invention

[0004] In view of the deficiencies in the prior art, the present invention provides a method and system for secure storage of agricultural data based on blockchain.

[0005] On the one hand, an embodiment of the present invention provides a method for secure storage of agricultural data based on blockchain, the method comprising:

[0006] Obtain agricultural data uploaded by a user node, the agricultural data including a user node identifier and a data identifier;

[0007] Determine accessible nodes according to the data identifier; obtain the key tables and locations of each accessible node, and filter and fuse the key tables according to the location and the level difference between the user node and the accessible nodes to obtain a target key set;

[0008] Encrypt the agricultural data by using the target key set to obtain encrypted agricultural data, and store the encrypted agricultural data in the blockchain.

[0009] Preferably, determining accessible nodes according to the data identifier includes:

[0010] Determine the data type to which the agricultural data belongs according to the data identifier;

[0011] Determine accessible nodes according to the data type.

[0012] Preferably, each accessible node corresponds to a key table, and the key table is used to store the association relationship between the data level and the key.

[0013] Preferably, filtering and fusing the key table according to the position and the level difference between the user node and the accessible node to obtain a target key, including:

[0014] Determining a data level according to the data identifier, and determining a first table key according to the data level;

[0015] Determining a user level according to the user node identifier, determining an accessible node level according to the accessible node identifier, and calculating a difference between the user level and the accessible node level to obtain a level difference;

[0016] When the level difference is greater than zero, determining a preset number of target table keys from above the first table key;

[0017] When the level difference is equal to zero, using the first table key as the target table key;

[0018] When the level difference is less than zero, determining a preset number of target table keys from below the first table key;

[0019] Wherein, the preset data is determined according to the size of the difference, and the larger the difference, the larger the preset number.

[0020] Preferably, filtering and fusing the key table according to the position and the level difference between the user node and the accessible node to obtain a target key, further including:

[0021] Based on the position of the accessible node, clustering and fusing the target table keys by using a clustering algorithm to obtain a target key;

[0022] Obtaining the data size of the agricultural data, and determining a set key number according to the data size;

[0023] Randomly determining a target key set from the target sequence according to the set key number.

[0024] Preferably, filtering and fusing the key table according to the position and the level difference between the user node and the accessible node to obtain a target key, further including:

[0025] Obtaining a set of accessible nodes corresponding to the target key after clustering, and determining the accessible data type of the clustering cluster according to the set of accessible nodes;

[0026] Calculating the similarity between the accessible data type of the clustering cluster and the accessible data type of the user node, and sorting the target keys from small to large according to the similarity to obtain a target key sequence.

[0027] On the other hand, the present invention provides an agricultural data security storage system based on a blockchain, including:

[0028] An acquisition module, configured to acquire agricultural data uploaded by a user node, where the agricultural data includes a user node identifier and a data identifier;

[0029] A processing module, configured to determine accessible nodes according to the data identifier; acquire key tables and locations of each accessible node, filter and fuse the key tables according to the location and the level difference between the user node and the accessible nodes, to obtain a target key set;

[0030] A storage module, configured to encrypt the agricultural data by using the target key set to obtain encrypted agricultural data, and store the encrypted agricultural data in a blockchain.

[0031] The beneficial effects of the present invention are embodied in that: by introducing dynamic key management and combining blockchain technology, the present invention realizes efficient and secure storage of agricultural data. By comprehensively considering data types, data levels, node level differences, and location information, a dynamic target key set is generated, greatly improving the complexity of encryption and the security of data. At the same time, by introducing a clustering algorithm and node distance, the selection of keys is made more flexible and dynamic, effectively preventing malicious attacks and protecting the security of agricultural data on the blockchain. Description of the Drawings

[0032] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for the description of the specific embodiments or the prior art. In all the drawings, similar elements or parts are generally identified by similar reference numerals. In the drawings, the elements or parts do not necessarily draw according to the actual ratio.

[0033] Figure 1 It is a flowchart of a method for secure storage of agricultural data based on a blockchain provided by an embodiment of the present invention;

[0034] Figure 2 It is a system block diagram of a system for secure storage of agricultural data based on a blockchain provided by an embodiment of the present invention. Detailed Embodiments

[0035] The following will combine the drawings to describe the embodiments of the technical solutions of the present invention in detail. The following embodiments are only used to more clearly illustrate the technical solutions of the present invention, so they are only examples and cannot be used to limit the protection scope of the present invention.

[0036] It should be noted that unless otherwise specified, the technical terms or scientific terms used in this application should be the ordinary meanings understood by those skilled in the art to which the present invention belongs.

[0037] Embodiment 1

[0038] AsFigure 1 As shown in Figure 1 , an embodiment of the present invention provides a method for securely storing agricultural data based on a blockchain. The method includes:

[0039] Step 1, obtain the agricultural data uploaded by the user node, where the agricultural data includes a user node identifier and a data identifier.

[0040] The agricultural data includes agricultural environment and resource data, agricultural production data, agricultural market data, agricultural management data, etc. These data are further divided into multiple data types, and each data type corresponds to a different data identifier. Specifically, the data identifier can be the identifier filled in by the user when uploading, or the data identifier obtained through classification model analysis, which is not limited in this embodiment.

[0041] Step 2, determine the accessible nodes according to the data identifier; obtain the key tables and locations of each accessible node, and filter and fuse the key tables according to the location and the level difference between the user node and the accessible nodes to obtain a target key set. Among them, each accessible node corresponds to a key table, and the key table is used to store the association relationship between the data level and the key.

[0042] In the embodiment of the present invention, determining the accessible nodes according to the data identifier includes: determining the data type to which the agricultural data belongs according to the data identifier; determining the accessible nodes according to the data type.

[0043] A mapping relationship table between the stored data identifier and the accessible nodes is set in the database. According to this table, the accessible nodes corresponding to each data type can be determined. In the blockchain network, when these nodes access these data, it needs to be realized through the blockchain. Therefore, in this embodiment, the agricultural data uploaded by the user is encrypted by combining the accessible nodes.

[0044] In the embodiment of the present invention, filtering and fusing the key table according to the location and the level difference between the user node and the accessible nodes to obtain a target key includes: determining the data level according to the data identifier, and determining the first table key according to the data level; determining the user level according to the user node identifier, determining the accessible node level according to the accessible node identifier, calculating the difference between the user level and the accessible node level to obtain a level difference; when the level difference is greater than zero, determining a preset number of target table keys from above the first table key; when the level difference is equal to zero, using the first table key as the target table key; when the level difference is less than zero, determining a preset number of target table keys from below the first table key; where the preset data is determined according to the size of the difference, and the larger the difference, the larger the preset number.

[0045] In this embodiment, by considering the level difference between the user node and the accessible node, the selection range of the key can be dynamically adjusted to ensure that only keys meeting the security requirements are used for data encryption. This method improves the security of the data and increases the flexibility of key management.

[0046] In the embodiment of the present invention, filtering and fusing the key table according to the position and the level difference between the user node and the accessible node to obtain the target key further includes: clustering and fusing the target table keys based on the position of the accessible node by using a clustering algorithm to obtain the target key; obtaining the data size of the agricultural data, and determining the set number of keys according to the data size; randomly determining a target key set from the target sequence according to the set number of keys.

[0047] Among them, the clustering algorithm includes but is not limited to K-means.

[0048] It should be noted that this embodiment adopts an improved clustering algorithm to achieve clustering. Since the traditional clustering algorithm needs to specify the number of clustering clusters in advance, that is, the K value is fixed, and the positions of the accessible nodes generally cluster in one or several regions, and the specific number of regions is not determined in advance, that is, the data of K is uncertain. Therefore, there are certain limitations in using the conventional clustering algorithm.

[0049] Specifically, the improved clustering method is: taking each accessible node as a clustering cluster, merging the two closest clustering clusters until the distance between the two farthest points in the same cluster is greater than the first set distance. After clustering, several target table keys corresponding to each cluster can be fused into a new target table key, and the target table key after clustering is the target key.

[0050] Since nodes in close proximity may collude or be more vulnerable to attacks, this embodiment clusters the target table keys of adjacent accessible nodes to reduce the number of keys and at the same time reduce the proportion of target table keys in close proximity in the target key set to improve the security of the target key.

[0051] In the embodiment of the present invention, filtering and fusing the key table according to the position and the level difference between the user node and the accessible node to obtain the target key further includes: obtaining the set of accessible nodes corresponding to the target key after clustering, and determining the accessible data type of the clustering cluster according to the set of accessible nodes; calculating the similarity between the accessible data type of the clustering cluster and the accessible data type of the user node, and sorting the target keys from small to large according to the similarity to obtain the target key sequence.

[0052] If the accessible data types of each cluster overlap significantly, then their correlation is high and there may be more interactions. If one is breached, the other is also likely to be breached, resulting in low security. To further ensure the security of the key, in this embodiment, the target key is also screened.

[0053] Step 4: Use the target key set to encrypt the agricultural data to obtain encrypted agricultural data, and store the encrypted agricultural data in the blockchain.

[0054] Specifically, each key in the target key set can be used to encrypt the agricultural data sequentially, or the keys in the target key set can be fused and then used to encrypt the agricultural data. Among them, the fusion includes, but is not limited to, splicing or other fusion methods.

[0055] In summary, through the introduction of dynamic key management and the combination of blockchain technology, the present invention realizes the efficient and secure storage of agricultural data. By comprehensively considering data types, data levels, node level differences, and location information, a dynamic target key set is generated, greatly improving the complexity of encryption and the security of data. At the same time, through the introduction of clustering algorithms and node distances, the selection of keys is made more flexible and dynamic, effectively preventing malicious attacks and protecting the security of agricultural data on the blockchain.

[0056] Embodiment 2

[0057] As Figure 2 shown, the present invention provides a blockchain-based agricultural data secure storage system, which includes:

[0058] An acquisition module, configured to acquire agricultural data uploaded by a user node, where the agricultural data includes a user node identifier and a data identifier;

[0059] A processing module, configured to determine accessible nodes according to the data identifier; acquire the key tables and locations of each accessible node, and filter and fuse the key tables according to the location and the level difference between the user node and the accessible node to obtain a target key set;

[0060] An encryption module, configured to use the target key set to encrypt the agricultural data to obtain encrypted agricultural data, and store the encrypted agricultural data in the blockchain

[0061] It should be understood that the blockchain-based agricultural data secure storage system of the present invention and the blockchain-based agricultural data secure storage method provided in the above embodiment are based on the same inventive concept. For the more specific working principles of each module in the embodiment of the present invention, reference can be made to the above embodiment, and details are not described in this embodiment.

[0062] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present invention, and they should all be covered by the scope of the claims and the description of the present invention.

Claims

1. A blockchain-based agricultural data security storage method, characterized in that: include: Acquire agricultural data uploaded by a user node, wherein the agricultural data includes a user node identifier and a data identifier; Determine the accessible nodes according to the data identifier; obtain the key table and position of each accessible node, filter and merge the key table according to the position and the level difference between the user node and the accessible node, and obtain the target key set; Encrypting agricultural data using the target key set to obtain encrypted agricultural data, and storing the encrypted agricultural data in a blockchain; The key table is filtered and merged according to the position and the level difference between the user node and the accessible node to obtain a target key set, including: Determine a data level according to the data identifier, and determine a first table key according to the data level; Determine the user level according to the user node identifier, determine the accessible node level according to the accessible node identifier, calculate the difference between the user level and the accessible node level, and obtain the level difference; When the level difference is greater than zero, determining a preset number of target table keys from above the first table key; When the level difference is equal to zero, using the first table key as the target table key; When the level difference is less than zero, a preset number of target table keys are determined from below the first table key; wherein the preset number is determined according to the difference value, and the larger the difference value, the larger the preset number; Based on the location of accessible nodes, clustering algorithm is used to cluster and merge the target table keys to obtain the target key; Obtaining an accessible node set corresponding to the clustered target key, and determining the accessible data type of the cluster cluster according to the accessible node set; Calculate the similarity between the accessible data types of the clusters and the accessible data types of the user nodes, and sort the target keys from small to large according to the similarity to obtain a target key sequence; Acquire the data size of the agricultural data, and determine the number of keys K to be set according to the data size; According to the set key quantity K, the first K target keys of the target key sequence are determined as the target key set.

2. According to claim 1, a blockchain-based agricultural data security storage method is characterized in that: Determining the accessible node according to the data identifier includes: Determining the data type of the agricultural data according to the data identifier; An accessible node is determined according to the data type.

3. According to the method for secure storage of agricultural data based on blockchain in claim 1, it is characterized in that: Each accessible node corresponds to a key table, and the key table is used to store the association relationship between data levels and keys.

4. A blockchain-based agricultural data security storage system, characterized in that: include: An acquisition module, used to acquire agricultural data uploaded by a user node, wherein the agricultural data includes a user node identifier and a data identifier; A processing module, configured to determine an accessible node according to the data identifier; obtain a key table and a position of each accessible node, filter and merge the key table according to the position and the level difference between the user node and the accessible node, and obtain a target key set; A storage module, which encrypts the agricultural data using the target key set to obtain encrypted agricultural data, and stores the encrypted agricultural data in a blockchain; The key table is filtered and merged according to the position and the level difference between the user node and the accessible node to obtain a target key set, including: Determine a data level according to the data identifier, and determine a first table key according to the data level; Determine the user level according to the user node identifier, determine the accessible node level according to the accessible node identifier, calculate the difference between the user level and the accessible node level, and obtain the level difference; When the level difference is greater than zero, determining a preset number of target table keys from above the first table key; When the level difference is equal to zero, using the first table key as the target table key; When the level difference is less than zero, a preset number of target table keys are determined from below the first table key; wherein the preset number is determined according to the difference value, and the larger the difference value, the larger the preset number; Based on the location of accessible nodes, clustering algorithm is used to cluster and merge the target table keys to obtain the target key; Obtaining an accessible node set corresponding to the clustered target key, and determining the accessible data type of the cluster cluster according to the accessible node set; Calculate the similarity between the accessible data types of the clusters and the accessible data types of the user nodes, and sort the target keys from small to large according to the similarity to obtain a target key sequence; Acquire the data size of the agricultural data, and determine the number of keys K to be set according to the data size; According to the set key quantity K, the first K target keys from the target key sequence are determined as the target key set.

Citation Information

Patent Citations

  • Information security and secrecy method, system, equipment and medium

    CN115001813A