Block chain-based ecological environment detection information management system and method
By adopting a blockchain-based encryption method in the ecological environment detection information management system, the problem of malicious modification and storage reading deviation in traditional systems is solved, and the data is stored with high accuracy and secure storage is achieved, reducing the risk of ecological environment deterioration.
Patent Information
- Application Number
- CN202411907563.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2044-12-24
AI Technical Summary
The traditional ecological environment detection information management system has the risk of data being maliciously modified, and there is a deviation in the storage and reading process, which leads to a large difference between the acquired ecological environment data and the actual situation, increasing the potential risk of ecological environment deterioration.
The blockchain-based ecological environment detection information management method is adopted, and real-time ecological environment information is collected through environmental detection equipment, and encryption is carried out based on the SHA-2 algorithm and AES encryption algorithm to generate SHA-256 ciphertext and AES-256 ciphertext, and store them in the blockchain node to ensure the accuracy and security of the data.
It effectively realizes the encryption and secure storage of data, ensures the accuracy and stability of data in transmission and storage, and reduces the potential risk of ecological environment deterioration.
Smart Images

Figure CN119788261A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of ecological environment detection, and specifically to an ecological environment detection information management system and method based on blockchain. Background Art
[0002] The ecological environment monitoring information management system collects environmental data in real time through various sensors, and uses multi-source data transmission technology to securely transmit the data to the data storage layer for integration and storage in the database. Blockchain is a distributed database technology that divides data into blocks, which are arranged in chronological order to form a chain structure.
[0003] Traditional ecological environment monitoring information management systems are mostly based on a centralized database architecture, with data storage and management permissions concentrated on a few servers, which makes the data at risk of being maliciously modified. The encryption method used in the data transmission process is relatively simple, which makes it easy for errors to occur during the data transmission process, causing data deviations in the storage and reading links, resulting in large discrepancies between the obtained ecological environment data and the actual situation, which in turn causes misjudgment of the current ecological environment status, greatly increasing the potential risk of ecological environment deterioration, and seriously affecting the smooth progress of ecological protection work and the sustainable development of the ecosystem. Summary of the invention
[0004] In order to solve the above-mentioned technical problems, an ecological environment detection information management system and method based on blockchain is provided. This technical solution solves the risk of data being maliciously modified proposed in the above-mentioned background technology, and the deviation of data in the storage and reading links, resulting in a large discrepancy between the obtained ecological environment data and the actual situation, which in turn causes misjudgment of the current ecological environment status and greatly increases the potential risk of ecological environment deterioration.
[0005] In order to achieve the above purpose, the technical solution adopted by the present invention is:
[0006] A blockchain-based ecological environment detection information management method, comprising:
[0007] Obtain the location information of each functional zone in the ecological detection area;
[0008] Collect real-time ecological environment information, and generate ecological environment information of each functional zone according to the location information of each functional zone in the ecological detection area;
[0009] According to the location information of each functional area, a unique identifier is assigned to the functional area;
[0010] Set the encryption direction based on the SHA-2 algorithm and AES encryption algorithm;
[0011] According to the encryption direction, the ecological environment information of each functional zone is encrypted to generate the corresponding SHA-256 ciphertext and AES-256 ciphertext;
[0012] Set a standard data format, obtain identifiers of SHA-256 ciphertext and AES-256 ciphertext, determine whether the data transmitted by the SHA-256 ciphertext is accurate, obtain the AES-256 ciphertext transmitted simultaneously with the accurate SHA-256 ciphertext, and generate ciphertext data marked with a timestamp;
[0013] The ciphertext data marked with timestamps are sorted according to the order of timestamps and stored in the blockchain node;
[0014] Obtain user query requirements, read blockchain node information according to user query requirements, decode blockchain node information, and generate required ecological environment information;
[0015] Set ecological environment thresholds, establish data supervision models, and determine whether the real-time ecological environment information of each functional zone is qualified.
[0016] Preferably, generating real-time ecological environment information of each functional zone according to the location information of each functional zone in the ecological detection area specifically includes:
[0017] According to the location information of each functional zone in the ecological detection area, the ecological detection area is geographically divided to generate the geographical information of each ecological planning area, wherein the geographical information of each ecological planning area includes the altitude, the location of vegetation, the location of planting land and the location of water area;
[0018] Select environmental testing equipment according to the functions of each ecological planning area;
[0019] According to the geographical information of each ecological planning area, environmental monitoring equipment is set up in open areas near water, planting areas and vegetation, and environmental monitoring equipment is set up again every 100 meters above sea level;
[0020] Collect ecological environment data every hour and organize them on a daily basis;
[0021] Obtain the ecological environment data of the previous cycle, generate the first ecological environment threshold, and determine whether the ecological environment data of the current cycle is abnormal. If so, obtain the data of the surrounding environment detection equipment for further analysis. If not, enter the ecological environment data of the current cycle into an Excel table;
[0022] Further analyze the data of the surrounding environment detection equipment to determine whether the environment detection equipment is faulty. If so, repair the environment detection equipment. If not, enter the abnormal data into an Excel spreadsheet.
[0023] Preferably, the generating of the corresponding SHA-256 ciphertext and AES-256 ciphertext specifically includes:
[0024] Based on Python language, the data in the Excel table is converted to generate ecological environment data in CSV format;
[0025] Fill the ecological environment data in CSV format to generate 512-bit byte data;
[0026] Based on the hash function, the 512-bit byte data is converted into a 256-bit binary string, and then the 256-bit binary string is represented in hexadecimal to generate the SHA-256 ciphertext;
[0027] Generate a 32-byte initial key based on a random number generator and arrange the initial key in a matrix;
[0028] Perform shift transformation on the elements in the matrix to generate round key constants;
[0029] According to the encryption direction, multiply the round key constant and the column element of the initial key to obtain the encryption method of each round;
[0030] According to the encryption method of each round, the ecological environment data corresponding to the SHA-256 ciphertext is processed to generate the AES-256 ciphertext;
[0031] Each storage node uses a different AES-256 encryption method, binds the generated different AES-256 ciphertexts and SHA-256 ciphertexts, and transmits and stores them synchronously to each storage node;
[0032] Among them, the initial key matrix is specifically:
[0033]
[0034] In the matrix, a1-a 32 Both represent bytes, and each byte consists of 8 binary bits;
[0035] The calculation formula for generating the round key constant is as follows:
[0036]
[0037] In the formula, R con [i] represents the current round key constant, R con [i-1] indicates the key constant of the previous round.
[0038] Preferably, the setting of the standard data format, obtaining the identifiers of the SHA-256 ciphertext and the AES-256 ciphertext, and determining whether the data transmitted by the SHA-256 ciphertext is accurate specifically include:
[0039] Get the SHA-256 ciphertext data of the storage node;
[0040] According to the location information of each functional partition, the data of each storage node is classified and processed to generate ecological environment information data of the same partition;
[0041] Compare the SHA-256 ciphertexts of the ecological environment information data in the same partition to determine whether the SHA-256 ciphertexts of each storage node are the same. If so, it means that the data of the storage nodes are consistent and there is no data loss or tampering. If not, it means that the information of the storage node is abnormal and needs further analysis.
[0042] Obtain the AES-256 ciphertext in the abnormal storage node, decrypt the AES-256 ciphertext according to the encryption method of the storage node, and generate the plaintext data of the abnormal storage node;
[0043] Obtain the AES-256 encryption method of the storage node with the same SHA-256 ciphertext, decrypt the AES-256 ciphertext of the storage node with the same SHA-256 ciphertext, and generate the normal storage node plaintext data;
[0044] Compare the plaintext data of the abnormal storage node with the plaintext data of the normal storage node to determine whether the two data are the same. If so, it means that the data is disturbed during transmission, resulting in data abnormality. If not, it means that the storage medium of the abnormal storage node is faulty and an abnormal reminder is issued.
[0045] Preferably, the ciphertext data marked with timestamps are sorted according to the order of timestamps and stored in the blockchain node, specifically including:
[0046] Check the correspondence between ciphertext data and timestamp to generate standard ciphertext data;
[0047] The standard ciphertext data is integrated and processed according to the timestamp-ciphertext data, and the standard ciphertext data is arranged according to the order of the timestamps;
[0048] Generate a timestamp pointer according to the ciphertext data corresponding to the timestamp, where the timestamp pointer is used to point to the network address of the node storing the ciphertext data corresponding to the timestamp;
[0049] Store the timestamp pointers into the blockchain in the order of timestamps;
[0050] According to the identifier of the SHA-256 ciphertext, a node pointer is established, the blockchain is divided, and a blockchain node is generated. The node pointer is used to point to the network address where the ecological environment information of each functional partition is stored;
[0051] According to the timestamp pointer and the node pointer, the ciphertext data corresponding to the timestamp is stored in the blockchain node.
[0052] Preferably, the blockchain node information is read according to the user's query requirements, the blockchain node information is decoded, and the required ecological environment information is generated, specifically including:
[0053] Generate corresponding timestamp and location information according to user query requirements;
[0054] According to the timestamp corresponding to the user's query requirements, determine the blockchain where the user's query information is located;
[0055] According to the location information corresponding to the user's query requirements, the blockchain node where the user's query information is located is retrieved, and combined with the timestamp pointer corresponding to the user's query requirements, the ciphertext data and AES-256 encryption method of the storage node corresponding to the timestamp in each storage node are obtained;
[0056] Compare the SHA-256 ciphertexts in each storage node and obtain the AES-256 ciphertext bound to the same SHA-256 ciphertext of the storage node;
[0057] According to the AES-256 encryption method of the storage node, the AES-256 ciphertext bound to the same SHA-256 ciphertext is decoded to generate the required ecological environment information.
[0058] Preferably, the setting of the ecological environment threshold, establishing a data supervision model, and judging whether the real-time ecological environment information of each functional zone is qualified specifically include:
[0059] According to the geographical information of each ecological planning area, set the second ecological environment threshold;
[0060] Establish a data supervision model using ecological environment thresholds as characteristic data;
[0061] Analyze the ecological environment data according to the data supervision model to determine whether the real-time ecological environment information of each functional zone exceeds the ecological environment threshold. If so, the real-time ecological environment information of the functional zone is judged to be unqualified, and the real-time ecological environment information of the functional zone is marked as abnormal. If not, the real-time ecological environment information of the functional zone is judged to be qualified.
[0062] Furthermore, a blockchain-based ecological environment detection information management system is proposed to implement the above-mentioned blockchain-based ecological environment detection information management method, including:
[0063] A data acquisition module, which is used to collect ecological environment data from various environmental detection devices and transmit the collected ecological environment data to the data integration module;
[0064] A data encryption module, which is used to convert the format of the received data, fill the converted data, encrypt the filled data, generate SHA-256 ciphertext and AES-256 ciphertext, and transmit the data to the data storage module;
[0065] A data storage module, the data storage module is used to add a timestamp to the acquired ciphertext data, generate ciphertext data marked with a timestamp, generate a timestamp pointer according to the ciphertext data corresponding to the timestamp, store the timestamp pointer in the blockchain in the order of the timestamps, and transmit the data to the data query module;
[0066] A data query module, which is used to generate corresponding timestamps and location information according to user query requirements, determine the blockchain node where the user's query information is located, retrieve the timestamp of the blockchain node where the user's query information is located, determine the timestamp pointer corresponding to the user's query requirements, obtain the ciphertext data and AES-256 encryption method of the storage node corresponding to the timestamp in each storage node, and generate the required ecological environment information;
[0067] A data warning unit, which is used to mark abnormal data and issue a reminder based on the data judgment result;
[0068] Data supervision module; the data supervision module is used to set the second ecological environment threshold according to the geographical information of each ecological planning area, establish a data supervision model, analyze the ecological environment data according to the data supervision model, and determine whether the real-time ecological environment information of each functional zone is qualified.
[0069] Optionally, the data encryption module specifically includes:
[0070] A key generation unit, the key generation unit is used to generate a 32-byte initial key based on a random number generator, arrange the initial key in a matrix, obtain the encryption method of each round according to the round key constant and the column elements of the initial key, and generate a corresponding key;
[0071] Based on the AES encryption algorithm, the ecological environment information of each functional zone is encrypted.
[0072] An encryption unit, which is used to perform encryption operations on data, encrypt the ecological environment information according to the selected SHA-2 algorithm and AES encryption algorithm through the received ecological environment information and the key, and convert it into ciphertext;
[0073] A key management unit is used to manage the storage, distribution and update of keys.
[0074] Optionally, the data storage module specifically includes:
[0075] A first judgment unit, the first judgment unit is used to compare the SHA-256 ciphertexts of the ecological environment information data in the same partition to determine whether the SHA-256 ciphertexts of each storage node are the same;
[0076] The second judgment unit is used to compare the plaintext data of the abnormal storage node with the plaintext data of the normal storage node to determine whether the two data are the same.
[0077] Compared with the prior art, the present invention has the following beneficial effects:
[0078] The present invention proposes an ecological environment detection information management method based on blockchain, which collects real-time ecological environment information through environmental detection equipment, generates ecological environment information of each functional zone according to the location information of each functional zone in the ecological detection area, sets the encryption direction, and encrypts the ecological environment information of each functional zone based on the SHA-2 algorithm and the AES encryption algorithm to generate corresponding SHA-256 ciphertext and AES-256 ciphertext, sets the standard data format, obtains the identifiers of the SHA-256 ciphertext and the AES-256 ciphertext, judges whether the data transmitted by the SHA-256 ciphertext is accurate, and obtains the SHA-256 ciphertext with accurate The AES-256 ciphertext transmitted at the same time as the 56 ciphertext is added with a timestamp to generate timestamp-marked ciphertext data, establish a blockchain node, sort the timestamp-marked ciphertext data according to the order of the timestamps, and store them in the blockchain node. According to the user's query requirements, the blockchain node information is read, the required ecological environment information is generated, the ecological environment threshold is set, and it is determined whether the real-time ecological environment information of each functional zone is qualified. In this way, data encryption can be effectively realized, the accuracy and stability of data in the transmission process are guaranteed, the reliability of storage and reading of ecological environment detection information is improved, and the potential risk of ecological environment deterioration is reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0079] Figure 1 This is a flow chart of the ecological environment detection information management method based on blockchain proposed by the present invention;
[0080] Figure 2 A diagram showing the steps for generating real-time ecological environment information for each functional zone in the present invention;
[0081] Figure 3 This is a flow chart for determining whether the data transmitted by SHA-256 ciphertext is accurate in the present invention;
[0082] Figure 4 A flowchart of the steps of storing the ciphertext data marked with the timestamp in the blockchain node in the present invention;
[0083] Figure 5 A flowchart of the steps of obtaining the required ecological environment information according to the user's query requirements in the present invention;
[0084] Figure 6 This is a structural diagram of the blockchain-based ecological environment detection information management system proposed in the present invention. DETAILED DESCRIPTION
[0085] The following description is used to disclose the present invention so that those skilled in the art can implement the present invention. The preferred embodiments described below are only examples, and those skilled in the art may think of other obvious variations.
[0086] Reference Figure 1 As shown, a method for managing ecological environment detection information based on blockchain includes:
[0087] Obtain the location information of each functional zone in the ecological detection area;
[0088] Collect real-time ecological environment information, and generate ecological environment information of each functional zone according to the location information of each functional zone in the ecological detection area;
[0089] According to the location information of each functional area, a unique identifier is assigned to the functional area;
[0090] Set the encryption direction based on the SHA-2 algorithm and AES encryption algorithm;
[0091] According to the encryption direction, the ecological environment information of each functional zone is encrypted to generate the corresponding SHA-256 ciphertext and AES-256 ciphertext;
[0092] Set a standard data format, obtain identifiers of SHA-256 ciphertext and AES-256 ciphertext, determine whether the data transmitted by the SHA-256 ciphertext is accurate, obtain the AES-256 ciphertext transmitted simultaneously with the accurate SHA-256 ciphertext, and generate ciphertext data marked with a timestamp;
[0093] The ciphertext data marked with timestamps are sorted according to the order of timestamps and stored in the blockchain node;
[0094] Obtain user query requirements, read blockchain node information according to user query requirements, decode blockchain node information, and generate required ecological environment information;
[0095] Set ecological environment thresholds, establish data supervision models, and determine whether the real-time ecological environment information of each functional zone is qualified.
[0096] This solution collects real-time ecological environment information through environmental detection equipment, generates ecological environment information of each functional zone according to the location information of each functional zone in the ecological detection area, sets the encryption direction, encrypts the ecological environment information of each functional zone based on the SHA-2 algorithm and the AES encryption algorithm, generates corresponding SHA-256 ciphertext and AES-256 ciphertext, sets the standard data format, obtains the identifiers of the SHA-256 ciphertext and the AES-256 ciphertext, determines whether the data transmitted by the SHA-256 ciphertext is accurate, obtains the AES-256 ciphertext transmitted at the same time as the accurate SHA-256 ciphertext and adds a timestamp, generates timestamp-marked ciphertext data, establishes a blockchain node, sorts the timestamp-marked ciphertext data according to the order of the timestamps, and stores it in the blockchain node, reads the blockchain node information according to the user's query requirements, generates the required ecological environment information, sets the ecological environment threshold, and determines whether the real-time ecological environment information of each functional zone is qualified. In this way, the reliability of the storage and reading of the ecological environment detection information is improved, and the potential risk of ecological environment deterioration is reduced.
[0097] Reference Figure 2 As shown, according to the location information of each functional zone in the ecological detection area, the real-time ecological environment information of each functional zone is generated, including:
[0098] According to the location information of each functional zone in the ecological detection area, the ecological detection area is geographically divided to generate the geographical information of each ecological planning area, wherein the geographical information of each ecological planning area includes the altitude, the location of vegetation, the location of planting land and the location of water area;
[0099] Select environmental testing equipment according to the functions of each ecological planning area;
[0100] According to the geographical information of each ecological planning area, environmental monitoring equipment is set up in open areas near water, planting areas and vegetation, and environmental monitoring equipment is set up again every 100 meters above sea level;
[0101] Collect ecological environment data every hour and organize them on a daily basis;
[0102] Obtain the ecological environment data of the previous cycle, generate the first ecological environment threshold, and determine whether the ecological environment data of the current cycle is abnormal. If so, obtain the data of the surrounding environment detection equipment for further analysis. If not, enter the ecological environment data of the current cycle into an Excel table;
[0103] Further analyze the data of the surrounding environment detection equipment to determine whether the environment detection equipment is faulty. If so, repair the environment detection equipment. If not, enter the abnormal data into an Excel spreadsheet.
[0104] It is understandable that different ecological planning areas have different functions, and their functions make them have specific ecological and environmental problems and key areas of concern. In vegetation areas, the productivity of the ecosystem is evaluated by measuring the total area of plant leaves on the land area and the ratio of the total area of plant leaves per unit land area to the land area. In planting areas, by detecting the organic matter content, macroelements such as nitrogen, phosphorus and potassium, and trace elements such as iron, manganese and zinc in the soil, it is determined which crops should be planted in the soil. In water areas, water temperature, color and transparency are usually tested. Water temperature affects the metabolism and reproduction of aquatic organisms, while transparency can reflect the amount of suspended particulate matter in the water body, indirectly reflecting the cleanliness of the water body. By testing chemical indicators such as dissolved oxygen, chemical oxygen demand, biochemical oxygen demand, ammonia nitrogen, total phosphorus and total nitrogen in the water, the water quality is clearly determined. The degree of organic pollution in the body is determined by the detection of heavy metals (such as mercury, cadmium, lead, chromium) and harmful substances (such as pesticides and petroleum pollutants) in the water to assess whether the ecosystem will cause serious harm to human health. With the increase in altitude, the temperature usually decreases gradually, which in turn brings about climate change, affecting vegetation. Ecological processes such as material circulation and energy flow in the ecosystem will also change with altitude. In aquatic ecosystems, the flow rate of water, water temperature and the content of dissolved nutrients in water will vary due to altitude differences. Based on the ecological environment data of the previous cycle, 5% of the ecological environment data of the previous cycle is used as the first ecological environment threshold. If the ecological environment data of the current cycle exceeds this threshold, it means that the ecological environment of the area has undergone major changes or the environmental detection equipment has failed.
[0105] Furthermore, the corresponding SHA-256 ciphertext and AES-256 ciphertext are generated, including:
[0106] Based on Python language, the data in the Excel table is converted to generate ecological environment data in CSV format;
[0107] Fill the ecological environment data in CSV format to generate 512-bit byte data;
[0108] Based on the hash function, the 512-bit byte data is converted into a 256-bit binary string, and then the 256-bit binary string is represented in hexadecimal to generate the SHA-256 ciphertext;
[0109] Generate a 32-byte initial key based on a random number generator and arrange the initial key in a matrix;
[0110] Perform shift transformation on the elements in the matrix to generate round key constants;
[0111] According to the encryption direction, multiply the round key constant and the column element of the initial key to obtain the encryption method of each round;
[0112] According to the encryption method of each round, the ecological environment data corresponding to the SHA-256 ciphertext is processed to generate the AES-256 ciphertext;
[0113] Each storage node uses a different AES-256 encryption method, binds the generated different AES-256 ciphertexts and SHA-256 ciphertexts, and transmits and stores them synchronously to each storage node;
[0114] Among them, the initial key matrix is specifically:
[0115]
[0116] In the matrix, a1-a 32 Both represent bytes, and each byte consists of 8 binary bits;
[0117] The calculation formula for generating the round key constant is as follows:
[0118]
[0119] In the formula, R con [i] represents the current round key constant, R con [i-1] indicates the key constant of the previous round.
[0120] It can be understood that data encryption is a fixed logical program, and it is necessary to ensure that the format of the input data is unified. Therefore, the ecological environment data needs to be formatted and filled to generate 512-bit byte data. The encryption direction is an important factor in determining data encryption. The encryption direction can be divided into one-way encryption and two-way encryption. In this embodiment, one-way encryption is used to generate SHA-256 ciphertext, and two-way encryption is used to generate AES-256 ciphertext. In one-way encryption, data can only be encrypted, and the original data cannot be deduced from the encrypted result. However, the accuracy of the data can be ensured by comparing the encrypted ciphertext. The encryption direction of two-way encryption is reversible, and the plaintext can be restored from the ciphertext through the key, but the accuracy of the transmitted data cannot be determined by comparing the ciphertext. In order to ensure the independence of the data, the AES-256 ciphertext of each storage node uses a different encryption method. The round key constant can be deduced through the initial key matrix, and then the decryption method of AES-256 can be obtained.
[0121] Reference Figure 3 As shown, set the standard data format, obtain the identifiers of the SHA-256 ciphertext and the AES-256 ciphertext, and determine whether the data transmitted by the SHA-256 ciphertext is accurate, including:
[0122] Get the SHA-256 ciphertext data of the storage node;
[0123] According to the location information of each functional partition, the data of each storage node is classified and processed to generate ecological environment information data of the same partition;
[0124] Compare the SHA-256 ciphertexts of the ecological environment information data in the same partition to determine whether the SHA-256 ciphertexts of each storage node are the same. If so, it means that the data of the storage nodes are consistent and there is no data loss or tampering. If not, it means that the information of the storage node is abnormal and needs further analysis.
[0125] Obtain the AES-256 ciphertext in the abnormal storage node, decrypt the AES-256 ciphertext according to the encryption method of the storage node, and generate the plaintext data of the abnormal storage node;
[0126] Obtain the AES-256 encryption method of the storage node with the same SHA-256 ciphertext, decrypt the AES-256 ciphertext of the storage node with the same SHA-256 ciphertext, and generate the normal storage node plaintext data;
[0127] Compare the plaintext data of the abnormal storage node with the plaintext data of the normal storage node to determine whether the two data are the same. If so, it means that the data is disturbed during transmission, resulting in data abnormality. If not, it means that the storage medium of the abnormal storage node is faulty and an abnormal reminder is issued.
[0128] It is understandable that because SHA-256 ciphertext uses one-way encryption, the ciphertext generated after encrypting the same data is the same. By comparing the SHA-256 ciphertext of each storage node, it can be determined whether the data of the storage node has been damaged or lost.
[0129] Reference Figure 4 As shown, the ciphertext data marked with timestamps are sorted according to the order of timestamps and stored in the blockchain node, including:
[0130] Check the correspondence between ciphertext data and timestamp to generate standard ciphertext data;
[0131] The standard ciphertext data is integrated and processed according to the timestamp-ciphertext data, and the standard ciphertext data is arranged according to the order of the timestamps;
[0132] Generate a timestamp pointer according to the ciphertext data corresponding to the timestamp, where the timestamp pointer is used to point to the network address of the node storing the ciphertext data corresponding to the timestamp;
[0133] Store the timestamp pointers into the blockchain in the order of timestamps;
[0134] According to the identifier of the SHA-256 ciphertext, a node pointer is established, the blockchain is divided, and a blockchain node is generated. The node pointer is used to point to the network address where the ecological environment information of each functional partition is stored;
[0135] According to the timestamp pointer and the node pointer, the ciphertext data corresponding to the timestamp is stored in the blockchain node.
[0136] It is understandable that the blockchain requires a specific format for storing data. If the encrypted data is converted into this specific format, the content of the encrypted data may be destroyed, resulting in the inability to correctly parse and verify the stored encrypted data. Therefore, in this embodiment, the data is connected in a pointer manner. The ciphertext data is timestamped, a timestamp pointer is generated based on the timestamp, and the timestamp pointer is stored in the blockchain. The blockchain where the timestamp pointer is stored is divided into internal structures through the SHA-256 ciphertext identifier to generate blockchain nodes. According to the source location of the SHA-256 ciphertext, a node pointer is generated and stored in the blockchain node, thereby realizing dual storage of ciphertext data.
[0137] Reference Figure 5 As shown, the blockchain node information is read according to the user's query requirements, the blockchain node information is decoded, and the required ecological environment information is generated, including:
[0138] Generate corresponding timestamp and location information according to user query requirements;
[0139] According to the timestamp corresponding to the user's query requirements, determine the blockchain where the user's query information is located;
[0140] According to the location information corresponding to the user's query requirements, the blockchain node where the user's query information is located is retrieved, and combined with the timestamp pointer corresponding to the user's query requirements, the ciphertext data and AES-256 encryption method of the storage node corresponding to the timestamp in each storage node are obtained;
[0141] Compare the SHA-256 ciphertexts in each storage node and obtain the AES-256 ciphertext bound to the same SHA-256 ciphertext of the storage node;
[0142] According to the AES-256 encryption method of the storage node, the AES-256 ciphertext bound to the same SHA-256 ciphertext is decoded to generate the required ecological environment information.
[0143] It can be understood that, according to the user's query needs, the time and location information of the required query can be obtained, the time of the required query can be compared with the timestamp, the blockchain and timestamp pointer where the user's required query information is located can be determined, and according to the location of the required query, the node pointer of the corresponding blockchain can be obtained, and based on the timestamp pointer and the node pointer, the corresponding SHA-256 ciphertext and AES-256 ciphertext are obtained from each storage node. By comparing the SHA-256 ciphertext in each storage node, the accuracy of the storage node data is determined, and the AES-256 ciphertext of the storage node is obtained. According to the AES-256 encryption method of the storage node, the round key constant is inferred, the AES-256 decryption method is obtained, and the AES-256 ciphertext is decoded to generate the required ecological environment information and transmit it to the user end.
[0144] Furthermore, we set ecological environment thresholds and establish a data supervision model to determine whether the real-time ecological environment information of each functional zone is qualified, including:
[0145] According to the geographical information of each ecological planning area, set the second ecological environment threshold;
[0146] Establish a data supervision model using ecological environment thresholds as characteristic data;
[0147] Analyze the ecological environment data according to the data supervision model to determine whether the real-time ecological environment information of each functional zone exceeds the ecological environment threshold. If so, the real-time ecological environment information of the functional zone is judged to be unqualified, and the real-time ecological environment information of the functional zone is marked as abnormal. If not, the real-time ecological environment information of the functional zone is judged to be qualified.
[0148] It is understandable that in the fertile black soil distribution area, the soil fertility is relatively high, which can provide rich nutrients and good water and fertilizer retention capabilities. The threshold value of soil organic matter content in this area can be set between 3% and 5%, and the content of major nutrients such as nitrogen, phosphorus and potassium should also be maintained at a certain level. For example, the total nitrogen content of the soil should not be less than 0.15%, the available phosphorus content should not be less than 10 mg / kg, and the available potassium content should not be less than 100 mg / kg to maintain high soil productivity. In the upper reaches of the river, the water quality is usually better. As a water source protection area, the chemical oxygen demand threshold in the water is set at no more than 15 mg / L, the ammonia nitrogen content threshold is set at no more than 0.5 mg / L, and the total phosphorus content threshold is set at no more than 0.05 mg / L to ensure the cleanliness and safety of the water source and meet the water quality requirements for living and production water of downstream residents. In the lower reaches of the river, due to the possible impact of urban sewage discharge, industrial wastewater pollution and agricultural non-point source pollution, basic water ecological functions must be guaranteed. For example, the oxygen demand threshold can be set below 40 mg / L, the ammonia nitrogen content threshold shall not exceed 2 mg / L, and the total phosphorus content threshold shall not exceed 0.2 mg / L.
[0149] Further, see Figure 6 As shown, based on the same concept as the above-mentioned blockchain-based ecological environment detection information management method, a blockchain-based ecological environment detection information management system is proposed, including:
[0150] A data acquisition module, which is used to collect ecological environment data from various environmental detection devices and transmit the collected ecological environment data to the data integration module;
[0151] A data encryption module, which is used to convert the format of the received data, fill the converted data, encrypt the filled data, generate SHA-256 ciphertext and AES-256 ciphertext, and transmit the data to the data storage module;
[0152] A data storage module, the data storage module is used to add a timestamp to the acquired ciphertext data, generate ciphertext data marked with a timestamp, generate a timestamp pointer according to the ciphertext data corresponding to the timestamp, store the timestamp pointer in the blockchain in the order of the timestamps, and transmit the data to the data query module;
[0153] A data query module, which is used to generate corresponding timestamps and location information according to user query requirements, determine the blockchain node where the user's query information is located, retrieve the timestamp of the blockchain node where the user's query information is located, determine the timestamp pointer corresponding to the user's query requirements, obtain the ciphertext data and AES-256 encryption method of the storage node corresponding to the timestamp in each storage node, and generate the required ecological environment information;
[0154] A data warning unit, which is used to mark abnormal data and issue a reminder based on the data judgment result;
[0155] Data supervision module; the data supervision module is used to set the second ecological environment threshold according to the geographical information of each ecological planning area, establish a data supervision model, analyze the ecological environment data according to the data supervision model, and determine whether the real-time ecological environment information of each functional zone is qualified.
[0156] Furthermore, the data encryption module specifically includes:
[0157] A key generation unit, the key generation unit is used to generate a 32-byte initial key based on a random number generator, arrange the initial key in a matrix, obtain the encryption method of each round according to the round key constant and the column elements of the initial key, and generate a corresponding key;
[0158] Based on the AES encryption algorithm, the ecological environment information of each functional zone is encrypted.
[0159] An encryption unit, which is used to perform encryption operations on data, encrypt the ecological environment information according to the selected SHA-2 algorithm and AES encryption algorithm through the received ecological environment information and the key, and convert it into ciphertext;
[0160] A key management unit is used to manage the storage, distribution and update of keys.
[0161] Furthermore, the data storage module specifically includes:
[0162] A first judgment unit, the first judgment unit is used to compare the SHA-256 ciphertexts of the ecological environment information data in the same partition to determine whether the SHA-256 ciphertexts of each storage node are the same;
[0163] The second judgment unit is used to compare the plaintext data of the abnormal storage node with the plaintext data of the normal storage node to determine whether the two data are the same.
[0164] To sum up, the advantages of the present invention are: it can effectively realize data encryption, ensure the accuracy of data in storage and reading, make the acquired ecological environment data consistent with the actual situation, and greatly reduce the potential risk of ecological environment deterioration.
[0165] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The above embodiments and descriptions only describe the principles of the present invention. The present invention may be subject to various changes and improvements without departing from the spirit and scope of the present invention. These changes and improvements fall within the scope of the present invention. The scope of protection claimed by the present invention is defined by the attached claims and their equivalents.
Claims
1. A blockchain-based ecological environment detection information management method, characterized in that: include: Obtain the location information of each functional zone in the ecological detection area; Collect real-time ecological environment information, and generate ecological environment information of each functional zone according to the location information of each functional zone in the ecological detection area; According to the location information of each functional area, a unique identifier is assigned to the functional area; Set the encryption direction based on the SHA-2 algorithm and AES encryption algorithm; According to the encryption direction, the ecological environment information of each functional zone is encrypted to generate the corresponding SHA-256 ciphertext and AES-256 ciphertext; Set a standard data format, obtain identifiers of SHA-256 ciphertext and AES-256 ciphertext, determine whether the data transmitted by the SHA-256 ciphertext is accurate, obtain the AES-256 ciphertext transmitted simultaneously with the accurate SHA-256 ciphertext, and generate ciphertext data marked with a timestamp; The ciphertext data marked with timestamps are sorted according to the order of timestamps and stored in the blockchain node; Obtain user query requirements, read blockchain node information according to user query requirements, decode blockchain node information, and generate required ecological environment information; Set ecological environment thresholds, establish data supervision models, and determine whether the real-time ecological environment information of each functional zone is qualified.
2. According to the blockchain-based ecological environment detection information management method of claim 1, it is characterized in that: The generating of real-time ecological environment information of each functional zone according to the location information of each functional zone in the ecological detection area specifically includes: According to the location information of each functional zone in the ecological detection area, the ecological detection area is geographically divided to generate the geographical information of each ecological planning area, wherein the geographical information of each ecological planning area includes the altitude, the location of vegetation, the location of planting land and the location of water area; Select environmental testing equipment according to the functions of each ecological planning area; According to the geographical information of each ecological planning area, environmental monitoring equipment is set up in open areas near water, planting areas and vegetation, and environmental monitoring equipment is set up again every 100 meters above sea level; Collect ecological environment data every hour and organize them on a daily basis; Obtain the ecological environment data of the previous cycle, generate the first ecological environment threshold, and determine whether the ecological environment data of the current cycle is abnormal. If so, obtain the data of the surrounding environment detection equipment for further analysis. If not, enter the ecological environment data of the current cycle into an Excel table; Further analyze the data of the surrounding environment detection equipment to determine whether the environment detection equipment is faulty. If so, repair the environment detection equipment. If not, enter the abnormal data into an Excel spreadsheet.
3. According to the blockchain-based ecological environment detection information management method of claim 2, it is characterized in that: The generating of the corresponding SHA-256 ciphertext and AES-256 ciphertext specifically includes: Based on Python language, the data in the Excel table is converted to generate ecological environment data in CSV format; Fill the ecological environment data in CSV format to generate 512-bit byte data; Based on the hash function, the 512-bit byte data is converted into a 256-bit binary string, and then the 256-bit binary string is represented in hexadecimal to generate the SHA-256 ciphertext; Generate a 32-byte initial key based on a random number generator and arrange the initial key in a matrix; Perform shift transformation on the elements in the matrix to generate round key constants; According to the encryption direction, multiply the round key constant and the column element of the initial key to obtain the encryption method of each round; According to the encryption method of each round, the ecological environment data corresponding to the SHA-256 ciphertext is processed to generate the AES-256 ciphertext; Each storage node uses a different AES-256 encryption method, binds the generated different AES-256 ciphertexts and SHA-256 ciphertexts, and transmits and stores them synchronously to each storage node; Among them, the initial key matrix is specifically: In the matrix, a1-a 32 Both represent bytes, and each byte consists of 8 binary bits; The calculation formula for generating the round key constant is as follows: In the formula, R con [i] represents the current round key constant, R con [i-1] indicates the key constant of the previous round.
4. According to the method for managing ecological environment detection information of a blockchain according to claim 3, it is characterized in that: The setting of the standard data format, obtaining the identifiers of the SHA-256 ciphertext and the AES-256 ciphertext, and determining whether the data transmitted by the SHA-256 ciphertext is accurate, specifically includes: Get the SHA-256 ciphertext data of the storage node; According to the location information of each functional partition, the data of each storage node is classified and processed to generate ecological environment information data of the same partition; Compare the SHA-256 ciphertexts of the ecological environment information data in the same partition to determine whether the SHA-256 ciphertexts of each storage node are the same. If so, it means that the data of the storage nodes are consistent and there is no data loss or tampering. If not, it means that the information of the storage node is abnormal and needs further analysis. Obtain the AES-256 ciphertext in the abnormal storage node, decrypt the AES-256 ciphertext according to the encryption method of the storage node, and generate the plaintext data of the abnormal storage node; Obtain the AES-256 encryption method of the storage node with the same SHA-256 ciphertext, decrypt the AES-256 ciphertext of the storage node with the same SHA-256 ciphertext, and generate the normal storage node plaintext data; Compare the plaintext data of the abnormal storage node with the plaintext data of the normal storage node to determine whether the two data are the same. If so, it means that the data is disturbed during transmission, resulting in data abnormality. If not, it means that the storage medium of the abnormal storage node is faulty and an abnormal reminder is issued.
5. According to the blockchain-based ecological environment detection information management method of claim 4, it is characterized in that: The ciphertext data marked with the timestamp is sorted according to the order of the timestamps and stored in the blockchain node, specifically including: Check the correspondence between ciphertext data and timestamp to generate standard ciphertext data; The standard ciphertext data is integrated and processed according to the timestamp-ciphertext data, and the standard ciphertext data is arranged according to the order of the timestamps; Generate a timestamp pointer according to the ciphertext data corresponding to the timestamp, where the timestamp pointer is used to point to the network address of the node storing the ciphertext data corresponding to the timestamp; Store the timestamp pointers into the blockchain in the order of timestamps; According to the identifier of the SHA-256 ciphertext, a node pointer is established, the blockchain is divided, and a blockchain node is generated. The node pointer is used to point to the network address where the ecological environment information of each functional partition is stored; According to the timestamp pointer and the node pointer, the ciphertext data corresponding to the timestamp is stored in the blockchain node.
6. According to the blockchain-based ecological environment detection information management method of claim 5, it is characterized in that: The blockchain node information is read according to the user's query requirements, the blockchain node information is decoded, and the required ecological environment information is generated, specifically including: Generate corresponding timestamp and location information according to user query requirements; According to the timestamp corresponding to the user's query requirements, determine the blockchain where the user's query information is located; According to the location information corresponding to the user's query requirements, the blockchain node where the user's query information is located is retrieved, and combined with the timestamp pointer corresponding to the user's query requirements, the ciphertext data and AES-256 encryption method of the storage node corresponding to the timestamp in each storage node are obtained; Compare the SHA-256 ciphertexts in each storage node and obtain the AES-256 ciphertext bound to the same SHA-256 ciphertext of the storage node; According to the AES-256 encryption method of the storage node, the AES-256 ciphertext bound to the same SHA-256 ciphertext is decoded to generate the required ecological environment information.
7. The method for managing ecological environment detection information based on blockchain according to claim 6 is characterized in that: The setting of ecological environment thresholds, the establishment of a data supervision model, and the determination of whether the real-time ecological environment information of each functional zone is qualified specifically include: According to the geographical information of each ecological planning area, set the second ecological environment threshold; Establish a data supervision model using ecological environment thresholds as characteristic data; Analyze the ecological environment data according to the data supervision model to determine whether the real-time ecological environment information of each functional zone exceeds the ecological environment threshold. If so, the real-time ecological environment information of the functional zone is judged to be unqualified, and the real-time ecological environment information of the functional zone is marked as abnormal. If not, the real-time ecological environment information of the functional zone is judged to be qualified.
8. According to the blockchain-based ecological environment detection information management system of claim 7, it is characterized in that: A blockchain-based ecological environment detection information management method for implementing any one of claims 1 to 7, comprising: A data acquisition module, which is used to collect ecological environment data from various environmental detection devices and transmit the collected ecological environment data to the data integration module; A data encryption module, which is used to convert the format of the received data, fill the converted data, encrypt the filled data, generate SHA-256 ciphertext and AES-256 ciphertext, and transmit the data to the data storage module; A data storage module, the data storage module is used to add a timestamp to the acquired ciphertext data, generate ciphertext data marked with a timestamp, generate a timestamp pointer according to the ciphertext data corresponding to the timestamp, store the timestamp pointer in the blockchain in the order of the timestamps, and transmit the data to the data query module; A data query module, which is used to generate corresponding timestamps and location information according to user query requirements, determine the blockchain node where the user's query information is located, retrieve the timestamp of the blockchain node where the user's query information is located, determine the timestamp pointer corresponding to the user's query requirements, obtain the ciphertext data and AES-256 encryption method of the storage node corresponding to the timestamp in each storage node, and generate the required ecological environment information; A data warning unit, which is used to mark abnormal data and issue a reminder based on the data judgment result; Data supervision module; the data supervision module is used to set the second ecological environment threshold according to the geographical information of each ecological planning area, establish a data supervision model, analyze the ecological environment data according to the data supervision model, and determine whether the real-time ecological environment information of each functional zone is qualified.
9. The blockchain-based ecological environment detection information management system according to claim 8 is characterized in that: The data encryption module specifically includes: A key generation unit, the key generation unit is used to generate a 32-byte initial key based on a random number generator, arrange the initial key in a matrix, obtain the encryption method of each round according to the round key constant and the column elements of the initial key, and generate a corresponding key; Based on the AES encryption algorithm, the ecological environment information of each functional zone is encrypted. An encryption unit, which is used to perform encryption operations on data, encrypt the ecological environment information according to the selected SHA-2 algorithm and AES encryption algorithm through the received ecological environment information and the key, and convert it into ciphertext; A key management unit is used to manage the storage, distribution and update of keys.
10. The blockchain-based ecological environment detection information management system according to claim 9 is characterized in that: The data storage module specifically includes: A first judgment unit, the first judgment unit is used to compare the SHA-256 ciphertexts of the ecological environment information data in the same partition to determine whether the SHA-256 ciphertexts of each storage node are the same; The second judgment unit is used to compare the plaintext data of the abnormal storage node with the plaintext data of the normal storage node to determine whether the two data are the same.
Citation Information
Patent Citations
Block chain architecture-based ecological environment monitoring system and implementation method thereof
CN106407481A
Data encryption and decryption method and device, equipment and storage medium
CN114448714A
User identity verification method, apparatus and system based on blockchain
WO2019052286A1