CN112364388B - Sensor data authentication method and device based on block chain - Google Patents
Sensor data authentication method and device based on block chain Download PDFInfo
- Publication number
- CN112364388B CN112364388B CN202011171078.1A CN202011171078A CN112364388B CN 112364388 B CN112364388 B CN 112364388B CN 202011171078 A CN202011171078 A CN 202011171078A CN 112364388 B CN112364388 B CN 112364388B
- Authority
- CN
- China
- Prior art keywords
- data
- sensor data
- block
- node
- authentication
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/64—Protecting data integrity, e.g. using checksums, certificates or signatures
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/044—Recurrent networks, e.g. Hopfield networks
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Health & Medical Sciences (AREA)
- Health & Medical Sciences (AREA)
- Software Systems (AREA)
- Data Mining & Analysis (AREA)
- Computing Systems (AREA)
- Biophysics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Evolutionary Computation (AREA)
- Computational Linguistics (AREA)
- Biomedical Technology (AREA)
- Mathematical Physics (AREA)
- Artificial Intelligence (AREA)
- Molecular Biology (AREA)
- Computer Security & Cryptography (AREA)
- Databases & Information Systems (AREA)
- Bioethics (AREA)
- Computer Hardware Design (AREA)
- Measurement Of The Respiration, Hearing Ability, Form, And Blood Characteristics Of Living Organisms (AREA)
- Collating Specific Patterns (AREA)
Abstract
The embodiment of the invention provides a sensor data authentication method and device based on block chain implementation. Wherein the method comprises the following steps: acquiring sensor data in a block generated by a data node; inputting the sensor data into a consensus neural network architecture to obtain a probability value which is output by the consensus neural network architecture and represents the reliability of the node data; and if the probability value is larger than a preset probability threshold value, adding the block to a block chain. By adopting the sensor data authentication method based on the blockchain implementation, which is disclosed by the embodiment of the invention, the authentication efficiency of the sensor data can be effectively improved, and the credibility of the data stream in a network is ensured, so that the reliable acquisition, transmission and use of the sensor data are realized.
Description
Technical Field
The invention relates to the technical field of computer application, in particular to a sensor data authentication method and device based on block chain implementation. In addition, an electronic device and a non-transitory computer readable storage medium are also provided.
Background
In recent years, along with the rapid development of the technology of the internet of things, various types of sensor equipment are increasingly widely applied to the field of monitoring. The existing sensor network aims at enhancing the sensing state quantity through the sensor network, realizing the improvement of the sensing range and the accuracy, and ensuring the authenticity of the data of each node of the network is the basis of the normal operation of the sensor network. However, there are many problems of device management and data security in a sensor network deployed on a large scale, for example, in the processes of collecting, transmitting and storing sensor data, there are situations that the sensor device is damaged and the sensor data is easily tampered by people, so that the sensing accuracy of the sensor network is reduced. Therefore, legal sensor data input equipment needs to be verified, malicious equipment is resisted, data is prevented from being tampered, and data reliability is guaranteed by adopting a data security mechanism.
In order to solve the above problems, in the prior art, a digital certificate authentication method is generally adopted to verify sensor data, so as to improve the reliability of the sensor data. However, in the digital certificate authentication mode, the certificate credentials are easy to steal, and the security is low. The distributed recording strategy in the block chain system can effectively prevent the data from being tampered, and the trust problem of the authenticity of the node data in the sensor network is solved. Therefore, how to adapt to the mass data interaction process in the sensor network by using the blockchain technology to effectively improve the authentication efficiency and reliability of the sensor data becomes a needed topic to be solved in the industry.
Disclosure of Invention
Therefore, the embodiment of the invention provides a sensor data authentication method and device based on blockchain implementation, which are used for solving the problems that the data authentication efficiency and reliability are low and the safety cannot meet the current actual demands in a large-scale deployment sensor network in the prior art.
In a first aspect, an embodiment of the present invention provides a sensor data authentication method implemented based on a blockchain, including:
acquiring sensor data in a block generated by a data node;
inputting the sensor data into a consensus neural network architecture to obtain a probability value which is output by the consensus neural network architecture and represents the reliability of the node data;
The consensus neural network architecture is obtained based on sample sensor data, a prediction result corresponding to the sample sensor data and sample label training;
And if the probability value is larger than a preset probability threshold value, adding the block to a block chain.
Further, the inputting the sensor data into a consensus neural network architecture to obtain a probability value which is output by the consensus neural network architecture and represents the reliability of the node data specifically includes:
inputting the sensor data into a preset authentication code generation model to obtain a block authentication code output by the authentication code generation model;
The block authentication code is used for correspondingly identifying the block;
Sequentially passing the block authentication codes through self-encoders constructed by corresponding to a plurality of data nodes respectively to obtain corresponding feature graphs;
Inputting the feature map to a consensus authentication model to obtain a probability value which is output by the consensus authentication model and represents the reliability of the node data;
the consensus authentication model is obtained through training based on sensor data acquired by a sample data node, an identification result corresponding to the sensor data acquired by the sample data node and a sample label.
Further, the step of sequentially passing the block authentication code through self-encoders constructed by respectively corresponding to a plurality of data nodes to obtain a corresponding feature map specifically includes:
Inputting the block authentication code into a self-encoder corresponding to the first data node to obtain a first block authentication code; inputting the first block authentication code into a self-encoder corresponding to a second data node to obtain a second block authentication code; wherein the second data node represents a number of data nodes other than the first data node;
And splicing the block authentication code and the second block authentication code to obtain target data, and splitting the target data according to a preset rule to obtain the feature map.
Further, the self-encoder includes a number of hidden layers;
the hidden layer is used for recoding and decoding the input block authentication code.
Further, the sensor data authentication method based on the blockchain implementation further comprises the following steps: performing source verification on the sensor data before the data node generates a block;
the source verification of the sensor data specifically comprises:
Acquiring sensor data to be verified;
Inputting the sensor data into a verification network model to obtain a verification result output by the verification network model; the verification network model is obtained by training based on sample sensor data, a prediction result corresponding to the sample sensor data and a sample data label;
And if the data authenticity probability value contained in the verification result meets a preset condition, receiving the sensor data and executing subsequent operations.
Further, the inputting the sensor data into the verification network model to obtain a verification result output by the verification network model specifically includes:
inputting the sensor data into a preset convolutional neural network model for data dimension reduction to obtain sensor data of a target dimension;
Inputting the sensor data of the target dimension into a preset long-short-term memory network model for feature extraction to obtain data features;
And inputting the data characteristics to a logistic regression layer to obtain the verification result.
Further, the data node comprises an embedded computer with operation capability and a data collector;
the data acquisition device integrates communication protocols of various types of sensors, is used for docking different types of sensors, and converts acquired sensor data into an array sequence recognized by the embedded computer.
In a second aspect, an embodiment of the present invention provides a sensor data authentication apparatus implemented based on a blockchain, including:
The data acquisition unit is used for acquiring sensor data in the block generated by the data node;
The probability prediction unit is used for inputting the sensor data into a consensus neural network architecture to obtain a probability value which is output by the consensus neural network architecture and represents the reliability of the node data; the consensus neural network architecture is obtained based on sample sensor data, a prediction result corresponding to the sample sensor data and sample label training; the characteristic diagram obtaining unit is used for inputting the block authentication code to a preset self-encoder to obtain a corresponding characteristic diagram;
And the evidence storage unit is used for adding the block to the block chain if the probability value is larger than a preset probability threshold value.
Further, the probability prediction unit specifically includes:
The block authentication code generation unit is used for inputting the sensor data into a preset authentication code generation model to obtain a block authentication code output by the authentication code generation model;
The block authentication code is used for correspondingly identifying the block;
The characteristic diagram obtaining unit is used for sequentially passing the block authentication codes through the self-encoders constructed by respectively corresponding to the plurality of data nodes to obtain corresponding characteristic diagrams;
the reliability probability value prediction unit is used for inputting the feature map into a consensus authentication model to obtain a probability value which is output by the consensus authentication model and represents the reliability of the node data;
the consensus authentication model is obtained through training based on sensor data acquired by a sample data node, an identification result corresponding to the sensor data acquired by the sample data node and a sample label.
Further, the feature map obtaining unit is specifically configured to:
Inputting the block authentication code into a self-encoder corresponding to the first data node to obtain a first block authentication code; inputting the first block authentication code into a self-encoder corresponding to a second data node to obtain a second block authentication code; wherein the second data node represents a number of data nodes other than the first data node;
And splicing the block authentication code and the second block authentication code to obtain target data, and splitting the target data according to a preset rule to obtain the feature map.
Further, the self-encoder includes a number of hidden layers;
the hidden layer is used for recoding and decoding the input block authentication code.
Further, the sensor data authentication device based on the blockchain implementation further comprises: a data source verification unit, configured to perform source verification on the sensor data before the data node generates a block;
the data source verification unit specifically includes:
the data acquisition subunit is used for acquiring sensor data to be verified;
the data source verification subunit is used for inputting the sensor data into a verification network model to obtain a verification result output by the verification network model; the verification network model is obtained by training based on sample sensor data, a prediction result corresponding to the sample sensor data and a sample data label;
and the data receiving subunit is used for receiving the sensor data and executing subsequent operations if the data authenticity probability value contained in the verification result meets the preset condition.
Further, the data source verification subunit is specifically configured to:
inputting the sensor data into a preset convolutional neural network model for data dimension reduction to obtain sensor data of a target dimension;
Inputting the sensor data of the target dimension into a preset long-short-term memory network model for feature extraction to obtain data features;
And inputting the data characteristics to a logistic regression layer to obtain the verification result.
Further, the data node comprises an embedded computer with operation capability and a data collector;
the data acquisition device integrates communication protocols of various types of sensors, is used for docking different types of sensors, and converts acquired sensor data into an array sequence recognized by the embedded computer.
In a third aspect, an embodiment of the present invention further provides an electronic device, including: memory, a processor and a computer program stored on the memory and executable on the processor, which when executed implements the steps of the blockchain-based implemented sensor data authentication method as described in any of the preceding claims.
In a fourth aspect, embodiments of the present invention also provide a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of a blockchain-based implemented sensor data authentication method as described in any of the above.
By adopting the sensor data authentication method based on the blockchain implementation, which is disclosed by the embodiment of the invention, the sensor data in the data node generation block is processed and authenticated by introducing the consensus neural network architecture, so that the authentication efficiency of the sensor data can be effectively improved, the credibility of the data flow in the network is ensured, and the reliable acquisition, transmission and use of the sensor data are realized.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following description will briefly describe the drawings that are required to be used in the embodiments or the prior art, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings may be obtained according to these drawings without any inventive effort for a person skilled in the art.
Fig. 1 is a schematic flow chart of a sensor data authentication method based on a blockchain implementation according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of performing source verification on sensor data in a sensor data authentication method based on blockchain implementation according to an embodiment of the present invention;
Fig. 3 is a schematic flow chart of performing consensus authentication on sensor data in a sensor data authentication method based on blockchain implementation according to an embodiment of the present invention
Fig. 4 is a schematic structural diagram of a sensor data authentication device based on a blockchain implementation according to an embodiment of the present invention;
Fig. 5 is a schematic entity structure diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which are derived by a person skilled in the art from the embodiments according to the invention without creative efforts, fall within the protection scope of the invention.
Embodiments of the present invention are described in detail below based on a sensor data authentication method based on a blockchain implementation. As shown in fig. 1, which is a flowchart of a sensor data authentication method based on a blockchain implementation according to an embodiment of the present invention, a specific implementation process includes the following steps:
Step S101: sensor data in a block generated by the data node is acquired.
In the embodiment of the invention, each node can receive the data uploaded by all the correspondingly connected sensors, so that the sensor layers are compatible with more types of sensors, the invention simplifies the requirements on the functions of the sensors at the bottom layer, and further sets the data nodes to have certain computing capacity so as to realize a series of functions of checking the sources of the sensor data, executing a blockchain protocol, generating blocks, establishing consensus and the like. Specifically, each data node is composed of an embedded computer with operation capability and a data collector. Because the types of the sensors are different, the communication protocols corresponding to the sensors are also various, so the data collector integrates the communication protocols of the sensors of various types, is used for interfacing the sensors of different types, and converts the acquired sensor data into an array sequence recognized by the embedded computer so as to be used for subsequent calculation.
The block containing the sensor data needs to be generated by the data node in advance before the sensor data in the block generated by the data node is acquired.
In the embodiment of the present invention, in order to meet the real-time requirement of the sensor data, the block generation time interval may be set to 1 second. Each block consists of a block header and a block body. The block header includes information such as block id, block generation time, belonging node, and block authentication code. The block id is used to identify which block on the blockchain the block belongs to, specifically, the block id+1 of the previous block. The node to which it belongs is used to identify which data node the block is specifically generated from. The block main body records all collected and verified sensor data of the data node within 1 second. The hash value corresponding to each group of sensor data can be obtained by carrying out hash calculation on each group of sensor data, and then each hash value is subjected to hash operation in pairs, so that a hash root value, namely Merkel root, is finally obtained and stored in the block head. The block authentication code in the block header is obtained by calculating the sensor data in the block main body through the authentication code generation model, and will be described in detail below.
In addition, as shown in fig. 2, before the data node generates the block, it is further required to perform source verification on the sensor data in advance, and determine whether to receive the sensor data according to the verification result. The method for verifying the source of the sensor data comprises the following specific implementation processes: and acquiring sensor data to be verified, inputting the sensor data into a verification network model to obtain a verification result output by the verification network model, and if the data authenticity probability value contained in the verification result meets a preset condition, receiving the sensor data and executing subsequent operation.
The verification network model is obtained through training based on sample sensor data, a prediction result corresponding to the sample sensor data and a sample data label. Specifically, a normal data node is firstly established and comprises an embedded computer and a data receiver, sensor data of a period of time is collected as sample sensor data, the sample sensor data are marked as normal data, and a sample introduction library is added. In addition, some sensor data are artificially forged, marked as forged data, and a sample introduction library is also added. Then, a deep neural network formed by combining a plurality of convolutional neural network models (Convolutional Neural Networks, CNN for Short) and a Long-Term Memory network model (LSTM for Short) is established, sensor data segmented according to one second intervals are input into the Long-Term Memory network model after the dimension of the convolutional neural network model is reduced, the Long-Term Memory network model outputs the calculated characteristics to a logistic regression layer (sofmax layer), and the logistic regression layer outputs the calculated characteristics to a numerical value, wherein the numerical value is a probability value representing that the sensor data is normal data instead of fake data and is used for representing the reliability of the sensor data. Training the neural network by using the data in the sample library, and finally enabling the neural network to distinguish whether the source of the sensor data is a verification network model of a real sensor rather than a fake sensor so as to ensure the authenticity of the sensor data. Finally, the verification network model is loaded into the calculation process of the data node.
Correspondingly, the inputting the sensor data into the verification network model to obtain the verification result output by the verification network model may include: inputting the sensor data into a preset convolutional neural network model for data dimension reduction to obtain sensor data of a target dimension; inputting the sensor data of the target dimension into a preset long-short-term memory network model for feature extraction to obtain data features; and inputting the data characteristics to a logistic regression layer to obtain the verification result.
Step S102: and inputting the sensor data into a consensus neural network architecture to obtain a probability value which is output by the consensus neural network architecture and represents the reliability of the node data. The consensus neural network architecture is obtained based on sample sensor data, a prediction result corresponding to the sample sensor data and sample label training.
In the embodiment of the invention, the consensus neural network architecture at least comprises an authentication code generation model, a self-encoder constructed by corresponding to a plurality of data nodes respectively and a consensus authentication model.
The authentication code generation model is a convolution neural network which is preset and completed, and is a feedforward neural network which comprises convolution calculation and has a depth structure. In the embodiment of the invention, the method has certain sensing data characteristic extraction capability and is mainly used for converting all sensing data in a block generated by a data node into 128-dimensional block authentication codes which correspond to the block and are identified.
The self-encoder is respectively established corresponding to different data nodes, and has the same number as the data nodes, the input of the self-encoder is defined as a 128-dimensional vector, the output of the self-encoder is also 128-dimensional, the hidden layer at least comprises 3-5 layers of structures such as an encoder layer, a decoder layer and the like, and the sequence constructed in the hidden layer is generally as follows: encoder-decoder-output. In the embodiment of the invention, the method is mainly used for recoding and decoding the inputted block authentication code
The consensus authentication model is composed of at least several convolution layers, a downsampling layer, a full connection layer and a final logistic regression layer (softmax layer). In the embodiment of the present invention, the input of the consensus authentication model is a 16×16 feature map obtained from the encoder, and the output is a probability value indicating whether the data of the corresponding data node is trusted. If the probability is sufficiently high, the data node wraps the block containing sensor data and adds it to the sense blockchain.
As shown in fig. 3, in the implementation process, the inputting the sensor data into the consensus neural network architecture to obtain the probability value that is output by the consensus neural network architecture and indicates the reliability of the node data may include: firstly, inputting sensor data into the authentication code generation model to obtain a block authentication code output by the authentication code generation model, wherein the block authentication code is used for correspondingly identifying the block; then, the block authentication code sequentially passes through self-encoders constructed by corresponding to a plurality of data nodes respectively to obtain a corresponding 16 x 16 characteristic diagram; and then inputting the feature map into a consensus authentication model to obtain a probability value which is output by the consensus authentication model and represents the reliability of the node data. The consensus authentication model is obtained by training based on sensor data acquired by the sample data nodes, recognition results corresponding to the sensor data acquired by the sample data nodes and sample labels.
The block authentication code is sequentially passed through the self-encoders constructed by respectively corresponding to the plurality of data nodes to obtain corresponding feature graphs, and the specific implementation process comprises the following steps: inputting the block authentication code into a self-encoder corresponding to the first data node to obtain a first block authentication code; and inputting the first block authentication code into a self-encoder corresponding to the second data node to obtain a second block authentication code. Wherein the second data node represents a number of data nodes other than the first data node. And splicing the block authentication code and the second block authentication code to obtain target data, and splitting the target data according to a preset rule to obtain the feature map.
The following will describe an example of a data node layer composed of 3 data nodes:
Three automatic encoders A, B, C are built for the data nodes 1,2,3 respectively, the input from the encoders being defined as 128-dimensional vectors and the output being 128-dimensional. For the block authentication code 1 of the data node 1, the block authentication code 1 is input from the encoder A preferentially, the block authentication code A1 is obtained through conversion, and then the block authentication code A1 is sequentially input from the encoders B and C to obtain A2. For data node 2, the input from encoder B is preferred, and then from encoders C and a. For data node 3, the priority is input from encoder C, and then from encoders a and B. And for the block authentication code 1 generated by the node 1 and the A2 obtained after the encoding by the self-encoder, 256-dimensional target data are obtained through splicing. The target data is split into a 16 x 16 signature. At this time, the 16×16 feature map is input to the consensus authentication CNNs network and output as a numerical value, which is a probability value representing whether the node data is trusted. If the probability is sufficiently high, the data node wraps this block and adds it to the sense blockchain.
It should be noted that, the number of data nodes in the data node layer in the embodiment of the present invention is not limited to the above listed examples including 3 data nodes, and may be set according to actual situations in a specific implementation process, which is not described in detail herein.
In the training phase of the consensus neural network architecture: (1) And (3) artificially establishing a plurality of normal data nodes, and collecting sensor data for a period of time as sample sensor data. (2) For the data node 1, a block is normally generated, at this time, the data of the block main body is converted to 128 dimensions by using an authentication code generation model, and then the corresponding block authentication code 1 is input from the encoder A, and the block authentication code A1 is obtained by conversion. A1 is sequentially input from encoders B and C to obtain A2, and the block authentication code 1 and the block authentication code A2 are spliced to obtain 256-dimensional target data. Splitting the target data becomes a 16 x 16 signature that will serve as input to the consensus authentication network because it originates from normal data nodes, and therefore the sample tag is 1. (3) For the data node 2, a block is also normally generated, the data of the block main body is converted to 128 dimensions by using a block authentication code generation model, and then the block authentication code 2 is firstly input into the encoder B to be converted into a block authentication code B1. B1 is sequentially input into a self-encoder C and a self-encoder A to obtain B2, and the block authentication code 2 and the block authentication code B2 are spliced to obtain 256-dimensional target data. The split target data becomes a 16 x 16 signature that will serve as input to the consensus authentication model, since it originates from normal data nodes, the sample tag is 1. The same is true for the data node 3, except that the self-encoder input preferentially is C, and then the self-encoder a and the self-encoder B are sequentially input. (4) The data nodes are artificially forged to replace part of the normal data nodes, and then sensor data is collected for a period of time to be used as sample sensor data. For example, the data node 2 is replaced by a forged data node, after the block authentication code 2 is generated, the block authentication code 2' is sequentially input into three self-encoders of the self-encoder B, the self-encoder C and the self-encoder a, the block authentication code 2' is obtained, the block authentication code 2 and the block authentication code 2' are spliced and then split into a characteristic diagram of 16 x 16, and the characteristic diagram is used as the input of a consensus authentication model because the characteristic diagram is derived from the forged data node, so that the sample label is 0.
And continuously adjusting the parameter weight of the consensus neural network architecture according to the training result, so that the consensus neural network architecture can distinguish the block authentication codes corresponding to the normal or fake data nodes. Wherein the self-encoders of each data node in the consensus neural network architecture are distinct, but the authentication code generation model and the consensus authentication model are common and stored in each data node.
For the data node layer, as each data node participates in the generation process of the block authentication code, a close relation is formed by training the coding rule of each encoder, once a certain data node is forged, the block authentication code of the data node layer is easier to show loopholes in the layer-by-layer coding and decoding process, so that the block authentication code is captured by the consensus authentication model, and finally the forged data node is prevented from being mixed into a sensing network to endanger data security.
After training, the encapsulation layer of the consensus neural network architecture is embedded into an operation program, so that the data node can perform calculation more quickly.
Step S103: and if the probability value is larger than a preset probability threshold value, adding the block to a block chain.
In the use process, when a data node generates a block, a 128-dimensional block authentication code is generated based on the sensing data, the block authentication code sequentially passes through the self-encoder of the subsequent data node to generate a feature map, the feature map is transmitted into a consensus authentication model, and finally the probability value of the block generated by the data node is output. If the probability value is higher than a preset probability threshold, the data node is voted for by other data nodes, and can be linked to a block on the node for permanent storage by adding to the blockchain.
In addition, a data stream is generated from the sensor layer, and different types of state amounts are acquired by various types of sensors. The sensor is usually powered by a battery and operates embedded codes, so that the low power consumption characteristic of the sensor is ensured. The operation flow mainly comprises three aspects: (1) sensor data acquisition; (2) sensor data encapsulation; (3) uploading sensor data. In addition to performing the operation, the sensor is in sleep mode for power conservation and extended battery time. After the sensor finishes the tasks of data collection and encapsulation, the collected sensor data is finally submitted to the corresponding data node in the upper layer (namely the data node layer).
Furthermore, an application service layer can be further provided in the embodiment of the invention, and the layer can provide services such as ubiquitous sensing for users based on the functions such as state sensing, fault prediction, health period management and the like of the monitored equipment by the sensor data. Through the architecture formed by the sensor layer and the data node layer, a data server in the application service layer can easily obtain a trusted block containing sensor data, so that the calculation efficiency of the sensor network is improved.
By adopting the sensor data authentication method based on the blockchain implementation, which is disclosed by the embodiment of the invention, the sensor data in the data node generation block is processed and authenticated by introducing the consensus neural network architecture, so that the authentication efficiency of the sensor data can be effectively improved, the credibility of the data flow in the network is ensured, and the reliable acquisition, transmission and use of the sensor data are realized.
Corresponding to the sensor data authentication method based on the block chain implementation, the invention also provides a sensor data authentication device based on the block chain implementation. Since the embodiments of the device are similar to the method embodiments described above, the description is relatively simple, and reference should be made to the description of the method embodiments section above, and the embodiments of the sensor data authentication device based on blockchain implementation described below are merely illustrative. Fig. 4 is a schematic structural diagram of a sensor data authentication device based on a blockchain implementation according to an embodiment of the present invention.
The invention relates to a sensor data authentication device based on block chain realization, which specifically comprises the following parts:
the data acquisition unit 401 is configured to acquire sensor data in a block generated by the data node.
The probability prediction unit 402 is configured to input the sensor data into a consensus neural network architecture, and obtain a probability value that is output by the consensus neural network architecture and represents the reliability of node data; the consensus neural network architecture is obtained based on sample sensor data, a prediction result corresponding to the sample sensor data and sample label training; and the characteristic diagram obtaining unit is used for inputting the block authentication code to a preset self-encoder to obtain corresponding characteristics.
The certification unit 403 is configured to add the block to the blockchain if the probability value is greater than a preset probability threshold.
By adopting the sensor data authentication device based on the blockchain implementation, which is disclosed by the embodiment of the invention, the sensor data in the data node generation block is processed and authenticated by introducing the consensus neural network architecture, so that the authentication efficiency of the sensor data can be effectively improved, the credibility of the data flow in the network is ensured, and the reliable acquisition, transmission and use of the sensor data are realized.
Corresponding to the sensor data authentication method based on the block chain implementation, the invention further provides electronic equipment. Since the embodiments of the electronic device are similar to the method embodiments described above, the description is relatively simple, and reference should be made to the description of the method embodiments described above, and the electronic device described below is merely illustrative. Fig. 5 is a schematic diagram of the physical structure of an electronic device according to an embodiment of the present invention. The electronic device may include: a processor (processor) 501, a memory (memory) 502 and a communication bus 503, wherein the processor 501 and the memory 502 communicate with each other via the communication bus 503. The processor 501 may invoke logic instructions in the memory 502 to perform a sensor data authentication method based on a blockchain implementation, the method comprising: acquiring sensor data in a block generated by a data node; inputting the sensor data into a consensus neural network architecture to obtain a probability value which is output by the consensus neural network architecture and represents the reliability of the node data; the consensus neural network architecture is obtained based on sample sensor data, a prediction result corresponding to the sample sensor data and sample label training; and if the probability value is larger than a preset probability threshold value, adding the block to a block chain.
Further, the logic instructions in the memory 502 described above may be implemented in the form of software functional units and stored in a computer readable storage medium when sold or used as a stand alone product. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In another aspect, embodiments of the present invention also provide a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, enable the computer to perform the blockchain-based sensor data authentication method provided by the above method embodiments, the method comprising: acquiring sensor data in a block generated by a data node; inputting the sensor data into a consensus neural network architecture to obtain a probability value which is output by the consensus neural network architecture and represents the reliability of the node data; the consensus neural network architecture is obtained based on sample sensor data, a prediction result corresponding to the sample sensor data and sample label training; and if the probability value is larger than a preset probability threshold value, adding the block to a block chain.
In yet another aspect, embodiments of the present invention further provide a non-transitory computer readable storage medium having stored thereon a computer program that, when executed by a processor, is implemented to perform the blockchain-based implemented sensor data authentication method provided by the above embodiments, the method comprising: acquiring sensor data in a block generated by a data node; inputting the sensor data into a consensus neural network architecture to obtain a probability value which is output by the consensus neural network architecture and represents the reliability of the node data; the consensus neural network architecture is obtained based on sample sensor data, a prediction result corresponding to the sample sensor data and sample label training; and if the probability value is larger than a preset probability threshold value, adding the block to a block chain.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims (9)
1. A blockchain-based sensor data authentication method, comprising:
acquiring sensor data in a block generated by a data node;
inputting the sensor data into a consensus neural network architecture to obtain a probability value which is output by the consensus neural network architecture and represents the reliability of the node data;
The consensus neural network architecture is obtained based on sample sensor data, a prediction result corresponding to the sample sensor data and sample label training;
If the probability value is larger than a preset probability threshold value, adding the block to a block chain;
The method for obtaining the probability value of the node data reliability output by the consensus neural network architecture specifically comprises the following steps:
inputting the sensor data into a preset authentication code generation model to obtain a block authentication code output by the authentication code generation model;
The block authentication code is used for correspondingly identifying the block;
Sequentially passing the block authentication codes through self-encoders constructed by corresponding to a plurality of data nodes respectively to obtain corresponding feature graphs;
Inputting the feature map to a consensus authentication model to obtain a probability value which is output by the consensus authentication model and represents the reliability of the node data;
the consensus authentication model is obtained through training based on sensor data acquired by a sample data node, an identification result corresponding to the sensor data acquired by the sample data node and a sample label.
2. The sensor data authentication method based on the blockchain implementation of claim 1, wherein the step of sequentially passing the blockchain authentication code through self-encoders constructed by respectively corresponding to a plurality of data nodes to obtain a corresponding feature map specifically includes:
Inputting the block authentication code into a self-encoder corresponding to the first data node to obtain a first block authentication code; inputting the first block authentication code into a self-encoder corresponding to a second data node to obtain a second block authentication code; wherein the second data node represents a number of data nodes other than the first data node;
And splicing the block authentication code and the second block authentication code to obtain target data, and splitting the target data according to a preset rule to obtain the feature map.
3. The blockchain-based implemented sensor data authentication method of claim 1 or 2, wherein the self-encoder comprises a number of hidden layers;
the hidden layer is used for recoding and decoding the input block authentication code.
4. The blockchain-based implemented sensor data authentication method of claim 1, further comprising: performing source verification on the sensor data before the data node generates a block;
the source verification of the sensor data specifically comprises:
Acquiring sensor data to be verified;
Inputting the sensor data into a verification network model to obtain a verification result output by the verification network model; the verification network model is obtained by training based on sample sensor data, a prediction result corresponding to the sample sensor data and a sample data label;
And if the data authenticity probability value contained in the verification result meets a preset condition, receiving the sensor data and executing subsequent operations.
5. The blockchain-based sensor data authentication method of claim 4, wherein the inputting the sensor data into a verification network model to obtain a verification result output by the verification network model specifically comprises:
inputting the sensor data into a preset convolutional neural network model for data dimension reduction to obtain sensor data of a target dimension;
Inputting the sensor data of the target dimension into a preset long-short-term memory network model for feature extraction to obtain data features;
And inputting the data characteristics to a logistic regression layer to obtain the verification result.
6. The blockchain-based sensor data authentication method of claim 1, wherein the data node comprises an embedded computer with computing capability and a data collector;
the data acquisition device integrates communication protocols of various types of sensors, is used for docking different types of sensors, and converts acquired sensor data into an array sequence recognized by the embedded computer.
7. A sensor data authentication apparatus implemented based on a blockchain, comprising:
The data acquisition unit is used for acquiring sensor data in the block generated by the data node;
The probability prediction unit is used for inputting the sensor data into a consensus neural network architecture to obtain a probability value which is output by the consensus neural network architecture and represents the reliability of the node data; the consensus neural network architecture is obtained based on sample sensor data, a prediction result corresponding to the sample sensor data and sample label training; the characteristic diagram obtaining unit is used for inputting the block authentication code to a preset self-encoder to obtain a corresponding characteristic diagram;
the storage unit is used for adding the block to a block chain if the probability value is larger than a preset probability threshold value;
The probability prediction unit is specifically configured to: inputting the sensor data into a preset authentication code generation model to obtain a block authentication code output by the authentication code generation model; the block authentication code is used for correspondingly identifying the block;
Sequentially passing the block authentication codes through self-encoders constructed by corresponding to a plurality of data nodes respectively to obtain corresponding feature graphs;
Inputting the feature map to a consensus authentication model to obtain a probability value which is output by the consensus authentication model and represents the reliability of the node data;
the consensus authentication model is obtained through training based on sensor data acquired by a sample data node, an identification result corresponding to the sensor data acquired by the sample data node and a sample label.
8. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor performs the steps of the blockchain-based sensor data authentication method as claimed in any of claims 1-6.
9. A non-transitory computer readable storage medium, having stored thereon a computer program, characterized in that the computer program when executed by a processor implements the steps of the blockchain-based implemented sensor data authentication method according to any of claims 1-6.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202011171078.1A CN112364388B (en) | 2020-10-28 | 2020-10-28 | Sensor data authentication method and device based on block chain |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202011171078.1A CN112364388B (en) | 2020-10-28 | 2020-10-28 | Sensor data authentication method and device based on block chain |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN112364388A CN112364388A (en) | 2021-02-12 |
| CN112364388B true CN112364388B (en) | 2024-06-14 |
Family
ID=74511113
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202011171078.1A Active CN112364388B (en) | 2020-10-28 | 2020-10-28 | Sensor data authentication method and device based on block chain |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN112364388B (en) |
Families Citing this family (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113158212A (en) * | 2021-04-23 | 2021-07-23 | 深圳前海华兆新能源有限公司 | Distributed database security authentication method based on block chain technology |
| CN114760066B (en) * | 2022-03-28 | 2023-05-23 | 深蓝感知(杭州)物联科技有限公司 | Time sequence data slicing double-chain authentication method and device |
| CN114861912B (en) * | 2022-07-06 | 2022-09-16 | 武汉山川软件有限公司 | Data verification method and device based on big data |
Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109889326A (en) * | 2019-02-19 | 2019-06-14 | 北京工业大学 | A Blockchain-based IoT Architecture and Verified Data Proof Consensus Method |
| CN111680793A (en) * | 2020-04-21 | 2020-09-18 | 广州中科易德科技有限公司 | Block chain consensus method and system based on deep learning model training |
Family Cites Families (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112215608B (en) * | 2019-01-18 | 2024-08-09 | 创新先进技术有限公司 | Data processing method and device |
| CN110138597B (en) * | 2019-04-17 | 2021-11-05 | 上海大学 | Improvement method of blockchain DPOS consensus mechanism based on credit points and node clustering |
-
2020
- 2020-10-28 CN CN202011171078.1A patent/CN112364388B/en active Active
Patent Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109889326A (en) * | 2019-02-19 | 2019-06-14 | 北京工业大学 | A Blockchain-based IoT Architecture and Verified Data Proof Consensus Method |
| CN111680793A (en) * | 2020-04-21 | 2020-09-18 | 广州中科易德科技有限公司 | Block chain consensus method and system based on deep learning model training |
Also Published As
| Publication number | Publication date |
|---|---|
| CN112364388A (en) | 2021-02-12 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN112364388B (en) | Sensor data authentication method and device based on block chain | |
| CN112818257B (en) | Account detection method, device and equipment based on graph neural network | |
| CN111914873A (en) | Two-stage cloud server unsupervised anomaly prediction method | |
| CN111967571A (en) | MHMA-based anomaly detection method and equipment | |
| CN110874646B (en) | An exception handling method, device and electronic device for federated learning | |
| CN114627412B (en) | Method, device, processor and computer storage medium for unsupervised deep fake video detection based on error reconstruction | |
| CN115480946B (en) | Modeling method of fault detection model, protection implementation method and related equipment | |
| CN111265860B (en) | Game archiving processing method and device, terminal equipment and readable storage medium | |
| CN113111359A (en) | Big data resource sharing method and resource sharing system based on information security | |
| CN117768152A (en) | Industrial Internet of things intrusion detection method based on federal learning and self-attention | |
| CN117375855A (en) | Abnormality detection method, model training method and related equipment | |
| CN117521065A (en) | A security detection method and device for blockchain decentralized finance | |
| CN116500335A (en) | Smart power grid electricity larceny detection method and system based on one-dimensional features and two-dimensional features | |
| Aljabri et al. | Enhancing real-time intrusion detection system for in-vehicle networks by employing novel feature engineering techniques and lightweight modeling | |
| CN116108369A (en) | Fault detection method, device, equipment and medium for intelligent micro-grid protection | |
| CN111506313B (en) | Program control flow confusion method and system based on neural network | |
| CN115277123B (en) | Method and system for detecting vehicle CAN bus injection attack abnormality | |
| Mowla et al. | Selective fuzzy ensemble learner for cognitive detection of bio-identifiable modality spoofing in MCPS | |
| CN113709092B (en) | Data detection method, device, computer equipment and storage medium | |
| CN115361307A (en) | Data center anomaly detection method and device and related products | |
| CN114925740A (en) | Construction method of industrial control intrusion detection system based on adversarial domain adaptation | |
| CN112950222A (en) | Resource processing abnormity detection method and device, electronic equipment and storage medium | |
| CN116090021A (en) | Authentication method and device of access equipment and communication equipment | |
| CN113347182A (en) | Transaction consensus method for block link points | |
| Zhao et al. | [Retracted] Application of Wireless Sensor Network Data Fusion Technology in Mechanical Fault Diagnosis |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |