Disclosure of Invention
The invention aims at overcoming the defects of the prior art and provides a whole process tracking method of environment monitoring data and an environment detection equipment node.
In order to achieve the above object, in a first aspect, an embodiment of the present invention provides a whole process tracking method for environmental monitoring data, including:
a first environment monitoring equipment node in the block chain system monitors environment data to obtain environment monitoring data;
the first environment monitoring equipment node comprises an acquisition module; the acquisition module is used for acquiring environment monitoring data; the environmental monitoring data includes: environmental monitoring data of a factory link of the equipment, environmental monitoring data of an installation link of the equipment, environmental monitoring data of an operation and maintenance link of the equipment and environmental monitoring data of a technical support link of the equipment;
the encryption and decryption module in the first environment monitoring equipment node encrypts the environment monitoring data to obtain encrypted environment monitoring data;
a broadcasting module in the first environment monitoring equipment node generates a new block according to the encrypted environment monitoring data, and broadcasts the new block so that all second environment monitoring equipment nodes in the blockchain system receive the new block;
when the acquisition module of each second environment monitoring equipment node receives the newly-added block, the encryption and decryption module of the second environment monitoring equipment node carries out password verification on the newly-added block;
if the verification is passed, the consensus confirming module in each second environment monitoring equipment node carries out consensus confirmation on the newly-added block according to a preset consensus algorithm;
and after the newly added block achieves the common identification, the storage module in the second environment monitoring equipment node stores the newly added block according to the type information of the first environment monitoring equipment node.
Preferably, the encryption and decryption module encrypts the environmental monitoring data, and the obtained encrypted environmental monitoring data specifically includes:
calculating a hash value of the environment monitoring data to obtain a first encryption verification code value;
and adding a hash value of the current environment monitoring data at the end of the environment monitoring data to obtain encrypted environment monitoring data.
Further preferably, the encrypting and decrypting module performs password verification on the newly added block specifically includes:
when each second environment monitoring equipment node receives the newly-added block, each second environment monitoring equipment node calculates the hash value of the environment monitoring data in the newly-added block again to obtain a second encryption verification code value;
comparing the second encrypted verification code value with the first encrypted verification code value;
and when the second encryption verification code value is consistent with the first encryption verification code value, verification is passed, and when the second encryption verification code value is not consistent with the first encryption verification code value, verification is not passed.
Further preferably, if the verification is not passed, the method further comprises:
and the second environment monitoring equipment node generates alarm information and outputs the alarm information.
Further preferably, after the calculating the hash value of the environmental monitoring data to obtain the first encrypted verification code value, the method further includes:
and generating a public key according to the first encryption verification code value, and sending the public key to user terminals of the equipment delivery link, the equipment installation link, the equipment operation and maintenance link and the equipment technical support link, wherein the user terminals are used for checking the environment monitoring data and the encrypted environment monitoring data according to the public key.
Preferably, broadcasting the new block specifically includes:
and the broadcasting module broadcasts the newly added block through GPRS communication.
Preferably, after the when the newly added block reaches the consensus confirmation, the method further comprises:
and all the environment monitoring equipment nodes in the block chain system perform information synchronization.
Further preferably, the information synchronization of all the environmental monitoring equipment nodes in the blockchain system is specifically:
the information synchronization module in the environment monitoring equipment node compares the blocks in the environment monitoring equipment node with the blocks in other environment monitoring equipment nodes in the blockchain system;
and determining a comparison result according to a preset rule, and synchronizing information with other environment monitoring equipment in the block chain system according to the comparison result.
Preferably, the storing module stores the new added block according to the type information of the first environmental monitoring device node specifically includes:
and the storage module in the second environment monitoring equipment node adds the newly added block to the tail of the last block according to the type information of the first environment monitoring equipment node, so that a blockchain is formed.
In a second aspect, an embodiment of the present invention provides a blockchain node for environmental monitoring data tracking, the blockchain node for environmental monitoring data tracking including: the first aspect of the present invention provides an acquisition module, an encryption/decryption module, a broadcast module, a consensus confirmation module, an information synchronization module, and a storage module
The whole process tracking method of the environment monitoring data provided by the embodiment of the invention verifies the stored data through the blockchain technology and cryptography, and updates the data by utilizing the distributed nodes and the consensus algorithm, so that the problems that the environment monitoring equipment is easy to lose data, falsify the data, change the data, have low data reliability and the like in the data transmission process are thoroughly solved, the reliability of the data transmission is greatly improved, the accuracy of the data is ensured, and valuable data can be analyzed and evaluated by the front end without distortion, thereby obtaining the truest environmental condition analysis and prediction. In addition, the whole process tracking method of the environment monitoring data provided by the embodiment of the invention also solves the problem of inconsistent information data among links of equipment when the equipment leaves a factory, equipment is installed, equipment is operated and maintained and technical departments, and ensures the safety of data transmission and access among the links.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in further detail below with reference to the accompanying drawings, and it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Blockchains are a kind of chained data structures that combine blocks of data in a sequential manner in time order, and cryptographically guaranteed, non-tamperable and non-counterfeitable distributed ledgers. In broad terms, blockchain technology is a completely new distributed infrastructure and computing paradigm that utilizes blockchain data structures to validate and store data, distributed node consensus algorithms to generate and update data, cryptography to secure data transfer and access, and intelligent contracts composed of automated script code to program and manipulate data. The block chain technology is characterized in that the information is transparent and can not be tampered, intelligent contracts can be automatically executed, and no centralized mechanism is required to audit.
According to the technical scheme, an environment data monitoring block chain system is constructed based on a block chain technology, the block chain system comprises a plurality of environment monitoring devices, and each environment monitoring device is used as environment monitoring data in one block chain node in the block chain system and is completely opened to other block chain nodes in the block chain system. The data of each block chain node in the block chain system is collected in real time and updated at fixed time, the updated data can send new data to other block chain nodes in the block chain system in a mode including GPRS data broadcasting but not limited to the mode, meanwhile, the block chain nodes adopt a consensus algorithm to agree on the new data, and a cryptography method is adopted to ensure that the existing data cannot be tampered.
Based on the above description, the embodiment of the invention provides an overall process tracking method of environmental monitoring data, which is implemented in an environmental data monitoring blockchain system, and a flowchart of the method is shown in fig. 1, and includes the following steps:
step 101, each environmental monitoring equipment node in the block chain system monitors environmental data to obtain the environmental monitoring data;
specifically, the environment monitoring device is provided with a plurality of sensors, and the environment monitoring device is used for monitoring the environment where the device is located in real time to obtain environment monitoring data. All the environmental monitoring devices deployed to the working environment together form a collaborative blockchain system, and each environmental monitoring device is respectively used as a node in the blockchain system, that is, each environmental monitoring device node in the blockchain system monitors environmental data in real time to obtain environmental monitoring data.
Further specifically, the environmental monitoring equipment node comprises an acquisition module as a blockchain node. The acquisition module is used for acquiring the environment monitoring data of each operation stage of the environment monitoring equipment in real time. The environmental monitoring data can thus be divided into, depending on the operational phase of the environmental monitoring device: environmental monitoring data of a factory link of the equipment, environmental monitoring data of an installation link of the equipment, environmental monitoring data of an operation and maintenance link of the equipment and environmental monitoring data of a technical support link of the equipment. That is, the environmental monitoring equipment nodes in each blockchain system can acquire environmental monitoring data in real time in the factory link, the installation link, the operation and maintenance link and the technical support link of the environmental monitoring equipment, and the process runs through each operation stage of the environmental monitoring equipment.
For ease of description, the environmental monitoring devices of active broadcast data in a blockchain system are referred to herein as first environmental monitoring device nodes, while the other environmental monitoring devices in a blockchain system that receive broadcast data, except for the first environmental monitoring device nodes, are referred to herein as second environmental monitoring device nodes.
102, an encryption and decryption module in a first environment monitoring equipment node encrypts environment monitoring data to obtain encrypted environment monitoring data;
specifically, the environmental monitoring equipment node further comprises an encryption and decryption module, wherein the encryption and decryption module is used for verifying the integrity and accuracy of the data, and the acquired environmental monitoring data is processed in a cryptography mode. During processing, an encryption and decryption module in the first environmental equipment node, namely an encryption and decryption module in the node which is about to broadcast data outwards, calculates a hash value of the environmental monitoring data to obtain a first encryption verification code value, and adds the hash value of the current environmental monitoring data to the end of the environmental monitoring data to obtain the encrypted environmental monitoring data. The hash value of the environment monitoring data, namely the first encryption verification code value, can be understood as the identity ID of the data, the hash value is small, the speed of data transmission cannot be influenced, and meanwhile, the calculation is convenient.
In some preferred embodiments, the device factory side, the device installer side, the device operation and maintenance side, and the device technical support side all have a "public key" that can view all the data in the blockchain and calculate the hash value of the encrypted data.
Further specifically, the encryption and decryption module in the first environment monitoring equipment node generates a public key according to the first encryption verification code value, and sends the public key to the user terminals of the equipment delivery link, the equipment installation link, the equipment operation and maintenance link and the equipment technical support link, so that users of the equipment delivery link, the equipment installation link, the equipment operation and maintenance link and the equipment technical support link can check the environment monitoring data and the encrypted environment monitoring data according to the public key.
Step 103, the environment monitoring data is encrypted by a broadcasting module in the first environment monitoring equipment node to generate a new block, and the new block is broadcasted;
specifically, the environmental monitoring equipment node further includes a broadcasting module, where the broadcasting module is configured to broadcast the newly added block data to all blockchain nodes in the blockchain system, by way of communication including, but not limited to, general packet radio service technology (General Packet Radio Service, GPRS), so that all second environmental monitoring equipment nodes, that is, other nodes in the system except the first environmental monitoring equipment node, store the newly added block.
Step 104, the encryption and decryption module of the second environment monitoring equipment node performs password verification on the newly-added block;
specifically, when the acquisition modules of the second environment monitoring equipment nodes in the system receive the newly-added block, the encryption and decryption modules of all the second environment monitoring equipment nodes perform password verification on the newly-added block. If the data is lost or tampered in the transmission process, the hash value of the data is also changed, so that whether the current data is lost or tampered can be judged by comparing the hash value of the current data. Therefore, during verification, the encryption and decryption module of the second environment monitoring equipment node needs to calculate the hash value of the environment monitoring data in the newly-added block again to obtain a second encryption verification code value, and compares the second encryption verification code value with the first encryption verification code value. When the second encrypted verification code value matches the first encrypted verification code value, which indicates that the data is not lost or tampered, the verification is passed, and step 105 is performed. When the second encryption verification code value is not consistent with the first encryption verification code value, the data is lost or tampered, verification is not passed, and the second environment monitoring equipment node generates and outputs alarm information.
Step 105, a consensus confirming module in the second environmental monitoring equipment node confirms the consensus of the newly added block according to a preset consensus algorithm;
specifically, the environmental monitoring equipment node further comprises a consensus confirmation module. The consensus confirming module is mainly used for confirming whether the data reach consensus or not to the data of all nodes in the system through a consensus algorithm so as to prevent various consensus attacks.
In a specific example, the consensus confirmation module uses a PBFT consensus algorithm, and when more than 2/3 of the second environmental monitoring equipment nodes generate confirmation information, the consensus is achieved. And because the PBFT consensus algorithm needs longer consensus time, a homogeneous multi-chain architecture can be used for accelerating the consensus speed. The isomorphic multiple chains are simultaneously identified by a plurality of isomorphic chains each time, in the identification time, when 2/3 block chain nodes generate the identification information, the identification information continues to wait for a period of time to obtain more identifications, and each chain is identified to reach identification when the identification time is about to end and the identification time is about to exceed 2/3 of the identification.
Step 106, all the environmental monitoring equipment nodes in the block chain system perform information synchronization;
specifically, the environmental monitoring equipment node further comprises an information synchronization module. The encryption and decryption module in the environment monitoring equipment node solves the problems of data loss and the like in the data transmission process, and the information synchronization module is used for solving the problem that the second environment monitoring equipment, namely the receiving end, is subjected to data loss or tampering again when receiving the data and storing the data.
After the newly added blocks reach consensus confirmation, the information synchronization modules in all the environment monitoring equipment nodes in the blockchain system compare the blocks in the environment monitoring equipment nodes with the blocks in other environment monitoring equipment nodes in the blockchain system, then determine comparison results according to preset rules, and perform information synchronization with other environment monitoring equipment in the blockchain system according to the comparison results. The process can be understood that after a certain second environmental monitoring equipment node receives the block of the first environmental monitoring equipment node, the certain second environmental monitoring equipment node performs information synchronization with all other second environmental monitoring equipment nodes which receive the first environmental monitoring equipment node, and according to a preset rule, data inconsistent with the other second environmental monitoring equipment nodes in the certain second environmental monitoring equipment node can be replaced by normal data in the other second environmental monitoring equipment nodes, so that the reliability of the current data is secondarily ensured.
Step 107, a storage module in the second environmental monitoring equipment node stores the newly added block according to the type information of the first environmental monitoring equipment node;
specifically, the environmental monitoring equipment node further comprises a storage module. The storage module is used for storing block data in the block chain. The storage module in the second environmental monitoring equipment node adds the newly added block to the end of the last block according to the type information of the first environmental monitoring equipment node, so that a blockchain is formed.
It can be appreciated that since the environmental monitoring data in the newly added block is divided into the following: the environmental monitoring data of the equipment delivery link, the environmental monitoring data of the equipment installation link, the environmental monitoring data of the equipment operation and maintenance link and the environmental monitoring data of the equipment technical support link can be understood as the data of the environmental monitoring equipment in each operation stage is recorded on the blockchain, so that the real and effective data of the environmental monitoring equipment from other stages in each operation stage is ensured.
In addition, it should be further noted that, in the foregoing embodiment, the method provided by the present invention is described by taking the block data generated by one environmental monitoring data node as an example, and in the method provided by the present invention, all environmental monitoring data nodes in a blockchain system may implement the foregoing steps. That is, in the method provided by the present invention, all the environmental monitoring data nodes in the blockchain system perform all the above steps.
The whole process tracking method of the environment monitoring data provided by the embodiment of the invention verifies the stored data through the blockchain technology and cryptography, and updates the data by utilizing the distributed nodes and the consensus algorithm, so that the problems that the environment monitoring equipment is easy to lose data, falsify the data, change the data, have low data reliability and the like in the data transmission process are thoroughly solved, the reliability of the data transmission is greatly improved, the accuracy of the data is ensured, and valuable data can be analyzed and evaluated by the front end without distortion, thereby obtaining the truest environmental condition analysis and prediction. In addition, the whole process tracking method of the environment monitoring data provided by the embodiment of the invention also solves the problem of inconsistent information data among links of equipment when the equipment leaves a factory, equipment is installed, equipment is operated and maintained and technical departments, and ensures the safety of data transmission and access among the links.
Correspondingly, the embodiment of the invention also provides an environmental monitoring equipment node for realizing the whole process tracking method of the environmental monitoring data, the structural schematic diagram of which is shown in fig. 2, wherein the blockchain system comprises a plurality of environmental monitoring equipment nodes 1 … x, and each environmental monitoring equipment node further comprises: the system comprises an acquisition module 21, an encryption and decryption module 22, a broadcasting module 23, a common identification confirming module 24, an information synchronizing module 25 and a storage module 26.
The environmental monitoring equipment node 1 acquiring module 21 is configured to acquire environmental monitoring data. The encryption and decryption module 22 is connected with the acquisition module 21, and is used for encrypting the environment monitoring data to obtain the encrypted environment monitoring data. The broadcasting module 23 is connected to the encryption/decryption module 22, and is configured to generate a new block according to the encrypted environment monitoring data, and broadcast the new block, so that other environment monitoring device nodes 2 … x in the blockchain system receive the new block. When the acquisition module 21 of other environmental monitoring equipment nodes in the blockchain system receives the newly-added block, the encryption and decryption module 22 of the environmental monitoring equipment node performs password verification on the newly-added block. The encryption and decryption module 22 is connected to the consensus validation module 24. If the verification is passed, the consensus confirmation module 24 in the other environmental monitoring equipment nodes in each blockchain system performs consensus confirmation on the newly added blocks according to a preset consensus algorithm. The consensus validation module 24 is connected to the information synchronization module 25. When the newly added block achieves consensus confirmation, all the environmental monitoring equipment nodes perform information synchronization through the information synchronization module 25. The information synchronization module 25 is connected with the storage module 26, and the storage module 26 in other environmental monitoring equipment nodes in the blockchain system adds blocks according to storage.
It can be understood that, in the embodiment of the present invention, the specific workflow of the acquiring module 21, the encrypting and decrypting module 22, the broadcasting module 23, the consensus confirming module 24, the information synchronizing module 25 and the storing module 26 may refer to the whole process tracking method of the environmental monitoring data, which is not described herein.
According to the environment data monitoring blockchain system provided by the embodiment of the invention, the stored data is verified through the blockchain technology and cryptography, and the data is updated by utilizing the distributed nodes and the consensus algorithm, so that the problems that the environment monitoring equipment is easy to lose data, tampered, mutated and not high in data reliability and the like in the data transmission process are thoroughly solved, the reliability of data transmission is greatly improved, the accuracy of the data is ensured, and valuable data can be analyzed and evaluated by the front end without distortion, so that the most real environment condition analysis and prediction are obtained.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative elements and steps are described above generally in terms of function in order to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied in hardware, in a software module executed by a processor, or in a combination of the two. The software modules may be disposed in Random Access Memory (RAM), memory, read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM power system control method, or any other form of storage medium known in the art.
The foregoing description of the embodiments has been provided for the purpose of illustrating the general principles of the invention, and is not meant to limit the scope of the invention, but to limit the invention to the particular embodiments, and any modifications, equivalents, improvements, etc. that fall within the spirit and principles of the invention are intended to be included within the scope of the invention.