CN114710796A - Sensor abnormity detection method, device and system based on block chain - Google Patents

Sensor abnormity detection method, device and system based on block chain Download PDF

Info

Publication number
CN114710796A
CN114710796A CN202210270935.6A CN202210270935A CN114710796A CN 114710796 A CN114710796 A CN 114710796A CN 202210270935 A CN202210270935 A CN 202210270935A CN 114710796 A CN114710796 A CN 114710796A
Authority
CN
China
Prior art keywords
function
interval
block chain
parameters
sensor
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.)
Pending
Application number
CN202210270935.6A
Other languages
Chinese (zh)
Inventor
李振军
陆芸婷
廖银萍
刘运时
周兵
夏清
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Institute of Technology
Original Assignee
Shenzhen Institute of Technology
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Shenzhen Institute of Technology filed Critical Shenzhen Institute of Technology
Priority to CN202210270935.6A priority Critical patent/CN114710796A/en
Publication of CN114710796A publication Critical patent/CN114710796A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W24/00Supervisory, monitoring or testing arrangements
    • H04W24/04Arrangements for maintaining operational condition
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/04Network management architectures or arrangements
    • H04L41/042Network management architectures or arrangements comprising distributed management centres cooperatively managing the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0631Management of faults, events, alarms or notifications using root cause analysis; using analysis of correlation between notifications, alarms or events based on decision criteria, e.g. hierarchy, tree or time analysis
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/03Protecting confidentiality, e.g. by encryption
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/08Access security
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W84/00Network topologies
    • H04W84/18Self-organising networks, e.g. ad-hoc networks or sensor networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The embodiment of the invention provides a sensor abnormity detection method, a device and a system based on a block chain, wherein the method comprises the following steps: the block chain generates a comparison result corresponding to the function interval condition parameter and the function interval reference condition parameter according to the function interval condition parameter and the function interval reference condition parameter received from the sensor; wherein the comparison result comprises no error and error; when the comparison result is wrong, the block chain terminal generates the function interval alarm parameter according to the comparison result, and sends the function interval alarm parameter and the function interval condition parameter to the user side by calling the intelligent contract; and the user side is used for receiving the function interval condition parameters and/or the function interval alarm parameters. The high cost of the cloud server is avoided through a decentralized mechanism of the block chain technology.

Description

Sensor abnormity detection method, device and system based on block chain
Technical Field
The invention relates to the technical field of block chains, in particular to a sensor abnormity detection method, device and system based on a block chain.
Background
The wireless sensor network is usually deployed in an unattended and severe environment, and is used for collecting environmental information, such as temperature, humidity, brightness, pressure and the like, in a monitoring area in real time. The detection capability of the device is easily influenced by external severe environmental factors. The sensors on the high-risk production line are more easily affected, manual inspection is frequently required to prevent the abnormality of the sensors, and in the inspection process, the production line needs to be completely or partially stopped to ensure the personal safety of detection personnel, so that huge economic burden is caused to enterprises.
At present, for the above problems, detection data is generally sent to a unified server to detect abnormal conditions, so as to determine whether the sensor has an abnormal problem, and since sensors are numerous and complicated on a production line, the server needs to consume a huge amount of calculation during detection, and the calculation efficiency is low; due to the centralized computing scheme, when the server is attacked, the false detection of a large-range sensor is easily caused, and the safety of a production line is seriously threatened.
Disclosure of Invention
In view of the above, the present application is directed to a method, apparatus and system for block chain based sensor anomaly detection that overcomes or at least partially solves the above problems, comprising:
a sensor abnormity detection method based on a block chain is used for detecting the abnormity of the operation parameters of a sensor on a production line, and relates to a block chain terminal, a sensor and a user terminal; the block chain terminal has a wireless self-organization function and a gateway function, and reference condition parameters between functional zones are stored; the block chain terminal and the sensor are respectively arranged in each functional interval in the production line; the block chain terminal is respectively connected with the user terminal and the sensor; specifically, the block chain terminals and the sensors in different function intervals are not connected with each other; the sensor is used for acquiring function interval status parameters, periodically encrypting the function interval status parameters and then sending the encrypted function interval status parameters to the corresponding block chain terminal; the functional interval condition parameters comprise environmental parameters and equipment running state parameters;
the method comprises the following steps:
the block chain generates a comparison result corresponding to the function interval condition parameter and the function interval reference condition parameter according to the function interval condition parameter and the function interval reference condition parameter received from the sensor; wherein, the comparison result comprises no error and error;
when the comparison result is wrong, the block chain terminal generates the function interval alarm parameter according to the comparison result, and sends the function interval alarm parameter and the function interval condition parameter to the user side by calling the intelligent contract; and the user side is used for receiving the function interval condition parameters and/or the function interval alarm parameters.
Further, the method further comprises:
the block chain terminal collects the functional interval standard condition parameters of each functional interval on the production line under the standard working state, and normalizes the functional interval standard condition parameters by a z-score normalization method to generate a standard condition parameter set;
the block chain terminal reduces the dimension of the standard condition parameter set according to a random hash function to generate a dimension reduction parameter set;
the block chain terminal performs set mapping and bucket dividing on the dimension reduction parameter set according to a primary hash function and a secondary hash function, and respectively determines a dimension mean value of the standard condition parameter set and a dimension mean value of the dimension reduction parameter set after bucket dividing;
the block chain terminal sets the dimension with the largest dimension mean difference in the standard condition parameter set and the partitioned dimensionality-reduced parameter set as a partition attribute, and takes the dimension mean of the partitioned dimensionality-reduced parameter set corresponding to the partition attribute as a partition point;
and the block chain terminal establishes an isolation tree of the isolation forest corresponding to the standard condition parameter set according to the segmentation attribute, the segmentation point and a preset tree limit height.
Further, the step of generating, by the blockchain, a comparison result corresponding to the functional interval status parameter and the functional interval reference status parameter according to the functional interval status parameter and the functional interval reference status parameter received from the sensor includes:
respectively carrying out normalization and dimension reduction on the function interval condition parameters to generate dimension reduction verification parameters;
sequentially putting the dimension reduction verification parameters into an isolation tree of the isolation forest, and determining the path length and the abnormal score of each parameter;
and determining the comparison result according to the abnormal score and a preset score threshold value.
Further, the step of acquiring, by the blockchain terminal, the function interval standard condition parameters of each function interval on the production line in the standard working state, and normalizing the function interval standard condition parameters by a z-score normalization method to generate a standard condition parameter set includes:
setting wireless sensor network node S ═ Sj: j is 1, 2, … m, every fixed time interval delta t, each node collects a group of function interval standard condition parameters and sends the parameters to the base station; wherein the node SjThe recorded set of function interval standard condition parameters is a vector v with dimension pj=(vj1,vj2,…, vjp),vj∈RpWherein p represents the type number of the standard condition parameter of the functional interval; in the next Δ t, the base station will receive n sets of function section standard condition parameters V ═ V1,v2,…vnH, wherein the number of groups n is independent of the node ID;
the dimensional mean of the functional interval standard condition parameter set V is defined as:
Figure BDA0003554637970000031
wherein time t is the time of receipt of the detected feature; defining a time period [0, T]The set of detection features received in is the training data, which is represented as matrix XT={x1,x2,…,xk},k=T/Δt。
Further, the random hash function is:
Figure BDA0003554637970000032
where α is a q-dimensional vector randomly sampled from a function satisfying a p-stable distribution, and β is a vector in the q-dimensional vector
Figure BDA0003554637970000033
Random variables distributed uniformly above; hash function hα,β(υ):Rq→ Z can map a q-dimension on the vector v to an integer set; [:]is a rounding-down operation; the data set is processed by L random hash functions h ═ h (h)1(υ),h2(υ),Λ,hL(upsilon)) dimension reduction mapping to obtain an L-dimension vector V-V (V)1,v2,…,vL)。
Further, the step of performing set mapping and bucket dividing on the dimension reduction parameter set by the block chain terminal according to a primary hash function and a secondary hash function, and respectively determining the dimension mean value of the standard condition parameter set and the dimension mean value of the dimension reduction parameter set after bucket dividing includes:
and calculating a corresponding primary hash function value G1 and a corresponding secondary hash function value G2 by using a primary hash function G1 formula and a secondary hash function G2 formula:
Figure BDA0003554637970000041
Figure BDA0003554637970000042
distributing the parameters of the primary hash function value g1 to the secondary hash function value g2 to the same bucket;
counting the number of the hash values in each bucket, and screening out all the buckets meeting the condition if the number in each bucket is larger than or equal to the sub-sampling size of the isolated forest;
sorting the index numbers corresponding to the parameters in the screened buckets, and sorting from [ V ]]n*LEach record corresponding to one index number is selected to form new data set [ A ] corresponding to the bucket and subjected to dimensionality reduction and sub-sampling]k*L,k<n, n is the number of barrels;
and respectively determining the dimension mean value of the standard condition parameter set in the bucket and the dimension mean value of the dimensionality reduction parameter set after the bucket division.
Further, the step of determining the dimension mean of the standard condition parameter set in the bucket and the dimension mean of the reduced dimension parameter set after the bucket respectively includes:
calculating the dimension mean of the new data set specifically includes: new data set [ A ]]k*LAs an input data set of the improved isolated forest algorithm, if L dimensions exist, the L dimensions respectively calculate a mean value VnewColumn means μ and V of matrix XTnewAfter respectively corresponding to the indexes, the average value difference M is obtainedLiFind MLiThe attribute Li corresponding to the maximum value is taken as the segmentation attribute, VnewiAs a division point.
Further, the step of sequentially placing the dimension reduction verification parameters into the isolation tree of the isolation forest and determining the path length and the abnormal score of each parameter includes:
putting the real-time data points into a constructed isolation tree, and recording the average path length c (n) and the abnormal score s (x, n) of the data points in the tree:
Figure BDA0003554637970000043
Figure BDA0003554637970000044
where E (h (x)) is the expected path length of sample x in the isolation tree.
A sensor abnormity detection device based on a block chain is used for detecting the abnormity of the operation parameters of a sensor on a production line, and relates to a block chain terminal, a sensor and a user terminal; the block chain terminal has a wireless self-organization function and a gateway function, and reference condition parameters between functional areas are stored; the block chain terminal and the sensor are respectively arranged in each functional interval in the production line; the block chain terminal is respectively connected with the user terminal and the sensor; specifically, the block chain terminals and the sensors in different function intervals are not connected with each other; the sensor is used for acquiring function interval status parameters, periodically encrypting the function interval status parameters and then sending the encrypted function interval status parameters to the corresponding block chain terminal; the functional interval condition parameters comprise environmental parameters and equipment running state parameters;
the device comprises:
a comparison result generation module, configured to generate a comparison result corresponding to the functional interval status parameter and the functional interval reference status parameter according to the functional interval status parameter and the functional interval reference status parameter received from the sensor; wherein the comparison result comprises no error and error;
a function interval alarm parameter generating module, configured to generate the function interval alarm parameter according to the comparison result when the comparison result is incorrect, and send the function interval alarm parameter and the function interval status parameter to the user end by calling the smart contract; and the user side is used for receiving the function interval condition parameters and/or the function interval alarm parameters.
A sensor abnormity detection system based on a block chain is used for detecting the abnormity of the operation parameters of a sensor on a production line, and relates to a block chain terminal, a sensor and a user terminal; the block chain terminal has a wireless self-organization function and a gateway function, and reference condition parameters between functional areas are stored; the block chain terminal and the sensor are respectively arranged in each functional interval in the production line; the block chain terminal is respectively connected with the user terminal and the sensor; specifically, the block chain terminals and the sensors in different function intervals are not connected with each other; the sensor is used for acquiring function interval status parameters, periodically encrypting the function interval status parameters and then sending the encrypted function interval status parameters to the corresponding block chain terminal; the functional interval condition parameters comprise environmental parameters and equipment running state parameters;
the block chain terminal is used for authenticating the sensor, storing and calculating the sensor data received through bidirectional data forwarding and protocol conversion decryption of the wireless self-organizing network and the Ethernet in parallel, and sharing the data between the block chain terminals through an intelligent contract;
the block chain terminal is further used for generating a comparison result corresponding to the function interval condition parameter and the function interval reference condition parameter according to the function interval condition parameter and the function interval reference condition parameter received from the sensor; wherein the comparison result comprises no error and error;
the sensor is used for acquiring environmental parameters and equipment running state parameters in a function interval, and periodically encrypting and sending the environmental parameters and the equipment running state parameters to a corresponding block chain terminal;
the block chain terminal is further used for generating the function interval alarm parameter according to the comparison result when the comparison result is wrong, and transmitting the function interval alarm parameter and the function interval condition parameter to the user side by calling the intelligent contract;
the user side is used for receiving the function interval condition parameters and/or the function interval alarm parameters;
and the user terminal is also used for carrying out data interaction with the block chain terminal, displaying the environmental parameters and the equipment running state parameters in each function interval on the production line site, and controlling the sensor and the production equipment in each function interval.
The application has the following advantages:
in an embodiment of the application, a comparison result corresponding to the functional interval condition parameter and the functional interval reference condition parameter is generated by the block chain according to the functional interval condition parameter and the functional interval reference condition parameter received from the sensor; wherein the comparison result comprises no error and error; when the comparison result is wrong, the block chain terminal generates the function interval alarm parameter according to the comparison result, and sends the function interval alarm parameter and the function interval condition parameter to the user side by calling the intelligent contract; and the user side is used for receiving the function interval condition parameters and/or the function interval alarm parameters. The high cost for building the server is avoided by a block chain technology decentralized mechanism; data are stored in each block chain terminal in a distributed mode, so that data loss and data tampering are effectively prevented, and data security is improved; and independent parallel computation is performed through each block chain terminal, so that the overall computing capacity and the operation efficiency are improved.
Drawings
In order to more clearly illustrate the technical solutions of the present application, the drawings needed to be used in the description of the present application will be briefly introduced below, and it is apparent that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive labor.
Fig. 1 is a flowchart illustrating steps of a method for detecting sensor anomalies based on a blockchain according to an embodiment of the present disclosure;
fig. 2 is a block diagram of a block chain-based sensor abnormality detection apparatus according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a computer device according to an embodiment of the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, the present application is described in further detail with reference to the accompanying drawings and the detailed description. It should be apparent that the embodiments described are some, but not all embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Referring to fig. 1, a block chain based sensor anomaly detection method for detecting an operational parameter anomaly of a sensor on a production line according to an embodiment of the present application is shown, the method involving a block chain terminal, a sensor and a user terminal; the block chain terminal has a wireless self-organization function and a gateway function, and a function interval reference condition parameter is stored; the block chain terminal and the sensor are respectively arranged in each functional interval in the production line; the block chain terminal is respectively connected with the user terminal and the sensor; specifically, the block chain terminals and the sensors in different function intervals are not connected with each other; the sensor is used for acquiring function interval condition parameters, periodically encrypting the function interval condition parameters and then sending the encrypted function interval condition parameters to the corresponding block chain terminal; the functional interval condition parameters comprise environmental parameters and equipment running state parameters;
the method comprises the following steps:
s110, the block chain generates a comparison result corresponding to the functional interval status parameter and the functional interval reference status parameter according to the functional interval status parameter and the functional interval reference status parameter received from the sensor; wherein the comparison result comprises no error and error;
s120, when the comparison result is wrong, the block chain terminal generates the function interval alarm parameter according to the comparison result, and sends the function interval alarm parameter and the function interval condition parameter to the user side by calling the intelligent contract; and the user side is used for receiving the function interval condition parameters and/or the function interval alarm parameters.
In an embodiment of the application, a comparison result corresponding to the functional interval condition parameter and the functional interval reference condition parameter is generated by the block chain according to the functional interval condition parameter and the functional interval reference condition parameter received from the sensor; wherein the comparison result comprises no error and error; when the comparison result is wrong, the block chain terminal generates the function interval alarm parameter according to the comparison result, and sends the function interval alarm parameter and the function interval condition parameter to the user side by calling the intelligent contract; and the user side is used for receiving the function interval condition parameters and/or the function interval alarm parameters. The high cost for building the server is avoided by a block chain technology decentralized mechanism; data are stored in each block chain terminal in a distributed mode, so that data loss and data tampering are effectively prevented, and data security is improved; and independent parallel computation is performed through each block chain terminal, so that the overall computing capacity and the operation efficiency are improved.
Next, the block chain-based sensor abnormality detection method in the present exemplary embodiment will be further described.
As described in step S110, the block chain generates a comparison result corresponding to the functional interval status parameter and the functional interval reference status parameter according to the functional interval status parameter and the functional interval reference status parameter received from the sensor; wherein the comparison result includes no error and an error.
It should be noted that the blockchain terminal is deployed in each functional section of the industrial production line, and is respectively connected with the user terminal and the sensor arranged in each functional section of the industrial production line, and the blockchain terminal corresponds to each functional section of the industrial production line one by one, and has functions of authenticating the sensor, decrypting the received sensor data, storing and calculating in parallel, and can also share data with the blockchain terminals in different functional sections through intelligent contracts; the sensor is used for acquiring environmental parameters and equipment running state parameters, and sending the environmental parameters and the equipment running state parameters to a block chain terminal directly connected with the sensor as data periodicity encryption; and the user terminal is used for carrying out data interaction with the block chain terminal.
It should be noted that the sensor may send the acquired environmental parameters and the device operating state parameters to the block chain terminal directly connected to the sensor through the wireless sensor network.
The block chain has the characteristics of multi-center and weak centralization, has a decentralized topology structure similar to the Internet of things, and has the following advantages based on the monitoring method of the Internet of things of the centerless industrial production line built by the block chain technology:
the distributed storage of the data is realized, so that the information cannot be tampered, and the data security is ensured; the data is encrypted by an asymmetric encryption technology, so that the data transmission safety and the privacy of a user are guaranteed; the multiple block chain terminals are used for interaction, parallel calculation is carried out to realize global optimization, the calculation capacity is improved, and the response speed and the operation efficiency of the monitoring system are improved; and data sharing is realized through a block chain intelligent contract.
As an example, an industrial production line is set to be composed of a plurality of similar function sections, each function section is provided with a block chain terminal, local management optimization is performed in the corresponding function section, an intelligent contract is interactively cooperated with the block chain terminals of other function sections, optimal control of a centerless system is realized through parallel computing, consensus is achieved through a consensus mechanism of workload certification, and aggregated Data of operation information, running state information and environment information of intelligent production equipment is stored in an IDSB (internet of things Data Storage block chain).
As an example, a plurality of devices are generally arranged in the functional section, each blockchain terminal monitors a sensor in the managed functional section through communication modes such as LoRa and 485, collects and processes sensor information, has the same processing calculation and data storage capabilities, fully exerts the independent processing calculation capability, completes parallel calculation of a centerless network, completes global optimization control management in a self-organizing manner, and communicates with a user terminal to inquire data and issue a control command.
As an example, the user terminal performs data interaction with the blockchain terminal, and displays various environmental parameters and/or equipment operating state parameters of a target function interval or all function intervals in the production line through a human-computer interface, or controls the production equipment connected with the sensor only through the blockchain terminal by sending a control command. The remote monitoring, the remote operation and maintenance and the remote service of the production equipment are realized. The user terminal can be a control center deployed outside a production line function interval, and can also be mobile equipment such as a mobile phone and a tablet personal computer.
As an example, the sensor may be a sensor having a function of detecting at least one of temperature, humidity, and illumination, a specific gas detection terminal (e.g., methane, carbon monoxide, carbon dioxide, etc.), a detection terminal having a human body detection function, or the like having an environment detection property.
In an embodiment of the invention, the specific process of the block chain generating the comparison result corresponding to the functional-interval status parameter and the functional-interval reference status parameter according to the functional-interval status parameter received from the sensor and the functional-interval reference status parameter in step S110 can be further described with reference to the following description.
Respectively normalizing and reducing the dimension of the condition parameters of the functional interval to generate dimension reduction verification parameters;
sequentially putting the dimension reduction verification parameters into an isolation tree of the isolation forest, and determining the path length and the abnormal score of each parameter;
as an example, real-time data points are put into a constructed isolation tree, and the average path length c (n) and the anomaly score s (x, n) of the data points in the tree are recorded:
Figure BDA0003554637970000101
Figure BDA0003554637970000102
where E (h (x)) is the expected path length of sample x in the isolation tree.
And determining the comparison result according to the abnormal score and a preset score threshold value as described in the following steps.
As an example, the abnormal score is compared with a preset score threshold value through iterative calculation, and if the abnormal score is greater than or equal to the threshold value, the data point is determined to be wrong; if the anomaly score is less than the threshold, the data point is determined to be error-free
In an embodiment of the present invention, the content of the new chunk includes a chunk header and a chunk body, where the chunk header includes a parent chunk header hash value, a Merkle tree root value, a timestamp, a chunk size, a difficulty target value, and a random value; the data content in the zone block body is corresponding function interval condition parameters uploaded by the sensor, and the data content format comprises a timestamp, a sensor identifier, a working state or an environment parameter value.
As described in the step S120, when the comparison result is incorrect, the block chain terminal generates the function interval alarm parameter according to the comparison result, and sends the function interval alarm parameter and the function interval status parameter to the user side by calling the smart contract; and the user end is used for receiving the function interval condition parameters and/or the function interval alarm parameters.
In an embodiment of the present invention, the method further includes:
the method comprises the following steps that a block chain terminal collects function interval standard condition parameters of each function interval on a production line in a standard working state, and normalizes the function interval standard condition parameters by a z-score normalization method to generate a standard condition parameter set;
as an example, set wireless sensor network node S ═ Sj: j is 1, 2, … m, every fixed time interval delta t, each node collects a group of function interval standard condition parameters and sends the parameters to the base station; wherein the node SjThe recorded set of function interval standard condition parameters is a vector v with dimension pj=(vj1,vj2,…,vjp),vj∈RpWherein p represents the type number of the standard condition parameter of the functional interval; in the next Δ t, the base station will receive n sets of function interval standard condition parameters V ═ V1,v2,…vnH, wherein the number of groups n is independent of the node ID;
the dimensional mean of the functional interval standard condition parameter set V is defined as:
Figure BDA0003554637970000111
wherein time t is the time of receipt of the detected feature; defining a time period [0, T]The set of detection features received in is the training data, which is represented as matrix XT={x1,x2,…,xk},k=T/Δt。
The block chain terminal reduces the dimension of the standard condition parameter set according to a random hash function to generate a dimension reduction parameter set;
as an example, the random hash function is:
Figure BDA0003554637970000112
where α is a q-dimensional vector randomly sampled from a function satisfying a p-stable distribution, and β is a vector in the q-dimensional vector
Figure BDA0003554637970000115
Random variables distributed uniformly above; hash function hα,β(υ):Rq→ Z can map a q-dimension on the vector v to an integer set; [:]is a rounding-down operation; the data set is processed by L random hash functions h ═ h (h)1(υ),h2(υ),Λ,hL(upsilon)) dimension reduction mapping to obtain an L-dimension vector V-V (V)1,v2,…,vL)。
Performing set mapping and bucket dividing on the dimension reduction parameter set by the block chain terminal according to a primary hash function and a secondary hash function, and respectively determining a dimension mean value of the standard condition parameter set and a dimension mean value of the dimension reduction parameter set after bucket dividing;
as an example, the primary hash function value G1 and the secondary hash function value G2 are calculated by the primary hash function G1 formula and the secondary hash function G2 formula:
Figure BDA0003554637970000113
Figure BDA0003554637970000114
distributing the parameters of the primary hash function value g1 to the secondary hash function value g2 to the same bucket;
counting the number of the hash values in each bucket, and screening out all the buckets meeting the condition if the number in each bucket is larger than or equal to the sub-sampling size of the isolated forest;
sorting the index numbers corresponding to the parameters in the screened buckets, and sorting from [ V ]]n*LEach record corresponding to one of the index numbers is selected to form a new data set [ A ] corresponding to the bucket and subjected to dimensionality reduction and sub-sampling]k*L,k<n, n is the number of barrels;
and respectively determining the dimension mean value of the standard condition parameter set in the bucket and the dimension mean value of the dimensionality reduction parameter set after the bucket division.
In a specific implementation, the step of respectively determining the dimension mean of the standard condition parameter set in the bucket and the dimension mean of the dimensionality-reduced parameter set after the bucket division may be: calculating the dimension mean of the new data set specifically includes: new data set [ A ]]k*LAs an input data set of the improved forest isolation algorithm, if L dimensions exist, the L dimensions respectively calculate the mean value VnewColumn means μ and V of matrix XTnewAfter respectively corresponding to the indexes, the average value difference M is obtainedLiFind MLiAttribute Li corresponding to the maximum value as a segmentation attribute, VnewiAs a division point
The block chain terminal sets the dimension with the largest dimension mean difference in the standard condition parameter set and the partitioned dimensionality-reduced parameter set as a partition attribute, and takes the dimension mean of the partitioned dimensionality-reduced parameter set corresponding to the partition attribute as a partition point;
and the block chain terminal establishes an isolation tree of the isolation forest corresponding to the standard condition parameter set according to the segmentation attribute, the segmentation point and a preset tree limit height.
In an embodiment of the present invention, the user equipment is configured to send a query request to the blockchain terminal; wherein the query request comprises a function interval identifier; the method further comprises the following steps:
and when the query request is received, the block chain terminal determines the corresponding function interval status parameter according to the function interval identifier and feeds the function interval status parameter back to the user terminal.
It should be noted that the blockchain integrates technologies such as distributed storage, consensus mechanism, encryption algorithm, intelligent contract and the like, is widely applied to multiple fields such as digital payment, cloud computing, internet of things, sharing economy and the like, and has the characteristics of decentralization, non-falsification, anonymous identity, collective maintenance, transparent rules and the like.
Distributed storage, in which data is stored in a plurality of network nodes in a distributed manner, the network nodes are equal in status, broadcast is carried out through a P2P network, the same block data copy is stored, and data loss caused by a central failure is prevented.
The consensus mechanism, because of differences in computation and communication of each network node, can cause block inconsistency, thus achieving consensus through the consensus mechanism, establishing trust, and storing consistent block data.
The method comprises the steps of establishing trust among network nodes by adopting a consensus mechanism of workload certification, receiving data forwarded by other network nodes by one network node, performing mathematical operation of the workload certification while searching for a random number by the other network node, performing hash operation on elements at the head of a block to enable the obtained hash value to be smaller than or equal to a target hash value, finding out the network node of the random number meeting conditions at first, and obtaining the right of generating a new block.
The encryption algorithm and the Hash operation generate 256-bit binary values for data with any length, and the binary values are used for data encryption and workload certification processes, so that the integrity of the data can be ensured, and the data can be prevented from being tampered.
The asymmetric encryption algorithm is composed of a pair of private keys and public keys, the public keys are public, the private keys are secret, data encrypted by the public keys are decrypted by using the corresponding private keys, and data encrypted by the private keys are decrypted by using the corresponding public keys. Two uses of asymmetric encryption are data encryption and digital signatures.
The digital signature is used for verifying the authenticity and the correctness of the data, the data is subjected to SHA256 Hash operation twice to generate a 256-bit Hash value, and then the Hash value is signed by using a private key to obtain the digital signature, so that the data cannot be forged. The data encryption is to encrypt the data and the digital signature by using a public key of a receiver to obtain final data, so that the data leakage is effectively prevented.
An intelligent contract is an event-driven, stateful, chained code deployed on a sharable distributed database that stores rules for data exchange. The intelligent contract code is broadcasted and verified by the network nodes, then is recorded into a specific address of the block chain and is stored in each network node, the specific address comprises a data sharing process, conditions and the like, and when a preset condition is triggered, the intelligent contract executes corresponding contract terms.
In an embodiment of the present invention, when a sensor to be authorized needs to be accessed, the sensor to be authorized is configured to upload registration information to a blockchain terminal in a connected state; the method further comprises the following steps:
the block chain terminal authenticates the registration information through an intelligent contract, and identifies the legality of the sensor to be authorized through a common identification mechanism to obtain authentication information and store the authentication information in each block chain terminal;
the block chain terminal sets the access authority of the sensor to be authorized according to the authentication information through an intelligent contract;
and when the registration is successful, the block chain terminal generates a public key address and a private key address corresponding to the sensor to be authorized and sends the public key address and the private key address to the sensor to be authorized.
It should be noted that, in the internet of things, an unauthorized sensor device is prevented from being connected to a production device internet of things system through an access authentication technology to initiate malicious attack, the sensor device scans a two-dimensional code before using the sensor device to perform device registration, the sensor reports registration information to a block chain terminal, each block chain terminal authenticates the reported device information through an intelligent contract, whether the identity of the device is legal or not is identified through a consensus mechanism, after the authentication is passed, a result is fed back to a block chain network, the authentication information is stored in the block chain, and the device access authority can be set through the intelligent contract to ensure the legality of the sensor accessed to the internet of things.
It should be noted that the sensor has limited computing power, only encryption and transmission are performed, encrypted data are sent to a block chain terminal, a verification mechanism is used for verifying the data, the sensor joins through registration or exits from a wireless ad hoc network due to a fault at any time, the system generates a pair of public key and private key addresses based on an ECDSA circular curve algorithm for each sensor, the public key addresses are equivalent to ID numbers of the Internet of things equipment, sensing data of the sensor can be obtained through the public key addresses, reliable data transmission of the IoT equipment is achieved through asymmetric encryption, and for the sensor which cannot perform operations such as signature and encryption, the computing power can be improved through an integrated security chip.
The sensor STi reports the environmental parameters or the device operating state parameters to the block chain terminal INj through the wireless sensor network following a certain time period, wherein the sensor STi obtains a digital signature signi (M) by using the built-in private key signature sensing data M, encrypts the data and the digital signature signi (M) by using the public key of the block chain terminal INj to obtain final data Ej (M + signi (M)), and sends the final data to the block chain terminal.
And the block chain terminal decrypts the encrypted data of the sensor by using a built-in private key after receiving the encrypted data, recalculates the hash value of the data, compares the hash value with the received hash value, temporarily stores the data in a local database if the data are consistent with the requirements, and discards the data if the data are not consistent with the requirements. After the blockchain terminal verifies that the sensing data meets the requirements, blockchain terminal BNk broadcasts the data to the remaining blockchain terminals.
After the block chain terminal receives the data, the data are stored in a local database after being verified to meet the requirements, a user can check the data in real time conveniently, when the user obtains real-time environmental parameters or the working state of equipment in a certain functional interval, the user terminal sends an encrypted query command to the corresponding block chain terminal, after the block chain terminal decrypts the data, the encrypted sensing data are sent to the user terminal, and the user terminal decrypts the data and displays the decrypted data, so that the data safety between the user terminal and the block chain terminal is guaranteed.
In an embodiment of the present invention, the step of performing block chaining to a preset data storage chain by the block chain terminal according to the functional interval status parameter successfully verified, and performing data sharing between the block chain terminals through an intelligent contract includes:
the block chain terminal acquires the function interval condition parameters of the connected sensors, and performs digital signature on the function interval condition parameters to request block uplink to a data storage chain of the Internet of things;
the block chain terminal broadcasts the function interval status parameters and the corresponding digital signatures to the block chain terminals of the rest function intervals through a P2P network; the block chain terminals in the rest function intervals verify the received broadcast data and store the successfully verified broadcast data into a local database; when the broadcast data fails to be verified, discarding the broadcast data; each block chain terminal performs workload proving operation while receiving broadcast data, and the block chain terminal which completes workload proving operation firstly broadcasts the generated new block to the other block chain terminals; the block chain terminals corresponding to the rest functional intervals receive the new blocks for verification, forward the new blocks which are successfully verified, and broadcast verification results; the block chain terminal generating the new block receives the verification results and the digital signatures of the other block chain terminals and broadcasts again; and the other block chain terminals are verified after receiving the verification result, and the new blocks which are successfully verified are stored in the data storage chain of the Internet of things according to the principle that a small number of verification results obey most verification.
It should be noted that the request for blockchain is to digitally sign the blockchain terminal to request blockchain to the IDSB after the blockchain terminal acquires data of the sensor within the range of the functional zone.
The block chain terminal broadcasts the data sent by the sensor and the digital signature Signk (M) through a P2P network, after the rest block chain terminals receive the data, the data is stored in a local database after being verified to be correct, the data is forwarded to the next block chain terminal, and the data is directly discarded after the verification fails without being forwarded.
In an embodiment of the present invention, the content of the new chunk includes a chunk header and a chunk body, where the chunk header includes a parent chunk header hash value, a Merkle tree root value, a timestamp, a chunk size, a difficulty target value, and a random value; the data content in the zone block body is corresponding function interval condition parameters uploaded by the sensor, and the data content format comprises a timestamp, a sensor identifier, a working state or an environment parameter value.
It should be noted that each blockchain terminal receives data forwarded by the other blockchain terminals while performing the workload proving operation, and the blockchain terminal that first completes the workload proving operation obtains the right to generate a new block.
The content of the new block comprises a block head and a block body, wherein the block head comprises a father block head hash value, a Merkle tree root value, a timestamp, a block size, a difficulty target value and a random numerical value. The data content in the block body is the data sent by the sensor, and the data content format is a time stamp, a sensor ID, a working state or an environmental parameter value.
In an embodiment of the present invention, the method further includes: the block chain terminal performs workload proving operation, specifically:
collecting all function interval condition parameters in a current period of time;
calculating Merkle root values of all functional interval condition parameters, and storing the Merkle root values in a block header;
filling the parent block head hash value of the last block into the parent block head hash value of the current block chain terminal;
acquiring a difficulty target value of a current block;
saving the current time in the timestamp of the current block;
and calculating the target hash value of the current block head until a random number which satisfies that the block head hash value is smaller than or equal to the target hash value is found.
As an example, the workload proving operation process includes the following specific steps:
the blockchain terminal collects all the sensing data of the current period of time.
The block chain terminal calculates the Merkle root value of all data and stores the Merkle root value in the block header.
And filling the block head Hash value of the last block into the parent block Hash value of the current block.
And acquiring a current difficulty target value.
The current time is saved in the Timestamp of the current block.
And searching a random number Nonce meeting the condition, and calculating the double SHA256 Hash value of the current block head until finding a random number which meets the condition that the Hash value of the block head is less than or equal to the target Hash value.
It should be noted that, the block chain terminal that performs the workload proving operation broadcasts the generated new block to the other block chain terminals, receives the verification of the other block chain terminals, and the verification process includes verifying whether the data structure of the new block is correct, verifying whether the random number meets the difficulty target value, verifying whether the data content in the block is correct, and the like.
It should be noted that, first, the block chain terminal that generates a new block collects the verification results and digital signatures of the other block chain terminals, broadcasts the verification results of the block and the other block chain terminals again, the other block chain terminals receive the verification results and then judge the verification results, when 51% of the block chain terminals in the whole network pass verification, each block chain terminal stores the new block according to the principle of a small number of obedients and a majority, all the block chain terminals perform the operation of next workload certification, and if more than 51% of the block chain terminals fail verification, all the block chain terminals discard the block and continue the operation of the workload certification.
In an embodiment of the present invention, the method further includes: each block chain terminal carries out linkage monitoring to the thing networking of industrial production line, specifically:
the block chain terminal learns according to the function interval condition parameters stored in the local database of the block chain terminal and establishes a learning model;
and the block chain terminal inputs the function interval condition parameters of the received sensor into a learning model to obtain a sensor control command, encrypts the sensor control command and transmits the encrypted sensor control command to the sensor uploaded by the function interval condition parameters.
It should be noted that, the inter-block chain terminals in the centerless network continuously interact, parallel computation is performed, global optimization control is completed through intelligent cooperation, more and more intelligent devices are currently accessed to the internet of things, data generated by the internet of things devices in each function interval of each industrial production line has great value, problems such as lack of security guarantee and information isolated island in current data sharing are solved, the security of data sharing of the block chain terminals is ensured by means of a block chain intelligent contract technology, the block chain terminals interact with other devices according to an intelligent contract specified in advance, intelligent control is achieved among the intelligent devices in a self-organizing and mutual cooperation mode, and data value transfer and sharing of the internet of things devices are promoted.
The networking mode of a block chain terminal in a centerless network is similar to that of a multi-Agent system, the production equipment IOT system is regarded as the multi-Agent system, the function interval agents complete the monitoring of local equipment, collect and process local sensor information, analyze, reason and make a decision, the central Agent manages and coordinates all the function interval agents, the multi-agents communicate with each other, the environment is perceived in a combined mode, and tasks are completed through information interaction and cooperative work. And the block chain terminal is similar to the function interval Agent, performs parallel computation, interacts with other block chain terminals, continuously updates local variables, and solves the optimization control problem of the system through repeated interaction until the operation result is converged, local computation of the multi-block chain terminal and cooperative computation.
As an example, the blockchain terminal fuses the operating state and the environmental parameters of the terminal device, and data sharing between blockchain terminals is realized through an intelligent contract technology, and the specific process is as follows:
and (4) creation of an access policy. The sensor creating access strategy serving as a data provider is issued in the blockchain and comprises the time, the times and the objects of data sharing.
And verifying the data sharing request. The block chain terminal firstly searches whether authorized access exists in the block chain account book, if authorized access exists, the block chain terminal initiates a data sharing request, and the intelligent contract judges whether the access authority exists.
The intelligent contract outputs data. And the block chain terminal executes the intelligent contract and outputs data according to the access condition set by the data provider. And the block chain terminal analyzes the shared data to complete the sensing or control task.
In a concrete realization, each function interval block chain terminal judges the personnel condition in each function interval of the production line through the behavior of the learners such as equipment information, personnel operation information and the like in the monitoring function interval by the personnel detection terminal and the equipment terminal, and intelligently tracks and positions the personnel in the function interval, such as: when a detection terminal or an entrance guard between the raw material intervals detects that a person in the functional interval leaves the interval, the cruise monitoring equipment in the interval is opened.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
Referring to fig. 2, a sensor abnormality detection device based on a blockchain is shown, which is provided in an embodiment of the present application, and is used for detecting an abnormality of an operation parameter of a sensor on a production line, wherein the device relates to a blockchain terminal, a sensor and a user terminal; the block chain terminal has a wireless self-organization function and a gateway function, and has a function interval reference condition parameter; the block chain terminal and the sensor are respectively arranged in each functional interval in the production line; the block chain terminal is respectively connected with the user terminal and the sensor; specifically, the block chain terminals and the sensors in different function intervals are not connected with each other; the sensor is used for acquiring function interval condition parameters, periodically encrypting the function interval condition parameters and then sending the encrypted function interval condition parameters to the corresponding block chain terminal; the functional interval condition parameters comprise environmental parameters and equipment running state parameters;
the device comprises:
a comparison result generating module 210, configured to generate a comparison result corresponding to the functional interval status parameter and the functional interval reference status parameter according to the functional interval status parameter and the functional interval reference status parameter received from the sensor; wherein the comparison result comprises no error and error;
a function interval alarm parameter generating module 220, configured to generate the function interval alarm parameter according to the comparison result when the comparison result is incorrect, and send the function interval alarm parameter and the function interval status parameter to the user end by invoking the intelligent contract; and the user side is used for receiving the function interval condition parameters and/or the function interval alarm parameters.
In an embodiment of the present invention, the method further includes:
the standard condition parameter set generating module is used for acquiring the standard condition parameters of the function intervals in the production line under the standard working state and normalizing the standard condition parameters of the function intervals by a z-score standardization method to generate the standard condition parameter set;
the dimension reduction parameter set generation module is used for reducing the dimension of the standard condition parameter set according to a random hash function and generating a dimension reduction parameter set;
the dimension mean value determining module is used for performing set mapping and bucket dividing on the dimension reduction parameter set according to a primary hash function and a secondary hash function, and respectively determining the dimension mean value of the standard condition parameter set and the dimension mean value of the dimension reduction parameter set after bucket dividing;
the isolation tree establishing condition determining module is used for setting the dimension with the largest dimension mean difference in the standard condition parameter set and the partitioned dimension-reduced parameter set as a partition attribute, and taking the dimension mean of the partitioned dimension-reduced parameter set corresponding to the partition attribute as a partition point;
and the isolation tree establishing module is used for establishing an isolation tree of the isolation forest corresponding to the standard condition parameter set according to the segmentation attribute, the segmentation point and a preset tree limit height.
In an embodiment of the present invention, the comparison result generating module 210 includes:
the dimension reduction verification parameter generation submodule is used for respectively normalizing and reducing the dimension of the function interval condition parameters to generate dimension reduction verification parameters;
the path length and abnormal score determining submodule is used for sequentially placing the dimension reduction verification parameters into an isolation tree of the isolation forest and determining the path length and the abnormal score of each parameter;
and the comparison result determining submodule is used for determining the comparison result according to the abnormal score and a preset score threshold value.
In an embodiment of the present invention, the standard condition parameter set generating module includes:
setting submodule of wireless sensor network node, usingSetting a wireless sensor network node S ═ S { (S)j: j is 1, 2, … m, every fixed time interval delta t, each node collects a group of function interval standard condition parameters and sends the parameters to the base station; wherein the node SjThe recorded set of function interval standard condition parameters is a vector v with p dimensionj=(vj1,vj2,…,vjp),vj∈RpWherein p represents the type number of the standard condition parameter of the functional interval; in the next Δ t, the base station will receive n sets of function section standard condition parameters V ═ V1,v2,…vnH, wherein the number of groups n is independent of the node ID;
a functional interval standard condition parameter set defining submodule, configured to define a dimensional mean of the functional interval standard condition parameter set V as:
Figure BDA0003554637970000201
wherein time t is the time of receipt of the detected feature; defining a time period [0, T]The set of detection features received in is the training data, which is represented as matrix XT={x1,x2,…,xk},k=T/Δt。
In an embodiment of the present invention, the random hash function is:
Figure BDA0003554637970000202
where α is a q-dimensional vector randomly sampled from a function satisfying a p-stable distribution, and β is a vector in the q-dimensional vector
Figure BDA0003554637970000203
Random variables distributed uniformly above; hash function hα,β(υ):Rq→ Z can map a q-dimension on the vector v to an integer set; [:]is a rounding-down operation; the data set is processed by L random hash functions h ═ h (h)1(υ),h2(υ),Λ,hLAfter (upsilon)) dimension reduction mappingObtaining an L-dimensional vector V ═ V1,v2,…,vL)。
In an embodiment of the present invention, the dimension mean determining module includes:
the primary hash function value calculation submodule and the secondary hash function value calculation submodule are used for calculating a primary hash function value G1 and a secondary hash function value G2 corresponding to the primary hash function G1 formula and the secondary hash function G2 formula:
Figure BDA0003554637970000204
Figure BDA0003554637970000205
an allocation submodule, configured to allocate parameters of the primary hash function value g 1-secondary hash function value g2 to the same bucket;
the screening submodule is used for counting the hash value in each barrel, and screening out all the barrels meeting the conditions if the number in each barrel is larger than or equal to the sampling size of the isolation forest;
an index number sorting submodule for sorting the index numbers corresponding to the parameters in the screened buckets and sorting the index numbers from [ V ]]n*LEach record in the index number corresponding to one is selected, thereby forming a new data set [ A ] corresponding to the bucket and subjected to dimensionality reduction and sub-sampling]k*L,k<n, n is the number of barrels;
and the dimension mean value determining submodule is used for respectively determining the dimension mean value of the standard condition parameter set in the bucket and the dimension mean value of the dimensionality reduction parameter set after the bucket division.
In an embodiment of the present invention, the dimension mean determining sub-module includes:
the calculation submodule, configured to calculate the dimension mean of the new data set, specifically includes: new data set [ A ]]k*LAs an input data set of the improved forest isolation algorithm, if L dimensions exist, the L dimensions respectively calculate a mean value VnewColumn means μ and V of matrix XTnewAre respectively paired withAfter indexing, the mean difference M is determinedLiFind MLiAttribute Li corresponding to the maximum value as a segmentation attribute, VnewiAs a division point.
In an embodiment of the present invention, the path length and anomaly score determining sub-module includes:
the path length and abnormal score calculation sub-module is used for putting the real-time data points into the constructed isolation tree, and recording the average path length c (n) and the abnormal score s (x, n) of the data points in the tree:
Figure BDA0003554637970000211
Figure BDA0003554637970000212
where E (h (x)) is the expected path length of sample x in the isolation tree.
A sensor abnormity detection system based on a block chain is used for detecting the abnormity of the operation parameters of a sensor on a production line, and relates to a block chain terminal, a sensor and a user terminal; the block chain terminal has a wireless self-organization function and a gateway function, and reference condition parameters between functional areas are stored; the block chain terminal and the sensor are respectively arranged in each functional interval in the production line; the block chain terminal is respectively connected with the user terminal and the sensor; specifically, the block chain terminals and the sensors in different function intervals are not connected with each other; the sensor is used for acquiring function interval status parameters, periodically encrypting the function interval status parameters and then sending the encrypted function interval status parameters to the corresponding block chain terminal; the functional interval condition parameters comprise environmental parameters and equipment running state parameters;
the block chain terminal is used for authenticating the sensor, storing and calculating the sensor data received through bidirectional data forwarding and protocol conversion decryption of the wireless self-organizing network and the Ethernet in parallel, and sharing the data between the block chain terminals through an intelligent contract;
the block chain terminal is further used for generating a comparison result corresponding to the function interval condition parameter and the function interval reference condition parameter according to the function interval condition parameter and the function interval reference condition parameter received from the sensor; wherein the comparison result comprises no error and error;
the sensor is used for acquiring environmental parameters and equipment running state parameters in a function interval, and periodically encrypting and sending the environmental parameters and the equipment running state parameters to a corresponding block chain terminal;
the block chain terminal is further used for generating the function interval alarm parameter according to the comparison result when the comparison result is wrong, and transmitting the function interval alarm parameter and the function interval condition parameter to the user side by calling the intelligent contract;
the user side is used for receiving the function interval condition parameters and/or the function interval alarm parameters;
and the user terminal is also used for carrying out data interaction with the block chain terminal, displaying the environmental parameters and the equipment running state parameters in each function interval on the production line site, and controlling the sensor and the production equipment in each function interval.
In one embodiment of the invention, the sensor sends the acquired environmental parameters and the equipment running state parameters to the corresponding block chain terminal by adopting a wireless radio frequency communication mode; and the user terminal is connected with the block chain terminal through an Ethernet, acquires the environmental parameters and the equipment running state parameters acquired by the sensor, and sends a control instruction to the sensor.
Referring to fig. 3, a computer device for illustrating a block chain-based sensor anomaly detection method according to the present application may specifically include the following:
the computer device 12 described above is embodied in the form of a general purpose computing device, and the components of the computer device 12 may include, but are not limited to: one or more processors or processing units 16, a memory 28, and a bus 18 that couples various system components including the memory 28 and the processing unit 16.
Bus 18 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Computer device 12 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by computer device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
The memory 28 may include computer system readable media in the form of volatile memory, such as random access memory 30 and/or cache memory 32. Computer device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (commonly referred to as "hard disk drives"). Although not shown in FIG. 3, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. The memory may include at least one program product having a set (e.g., at least one) of program modules 42, with the program modules 42 configured to carry out the functions of the embodiments of the application.
Program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules 42, and program data, each of which examples or some combination thereof may include an implementation of a network environment. Program modules 42 generally carry out the functions and/or methodologies of the embodiments described herein.
The computer device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, camera, etc.), with one or more devices that enable an operator to interact with the computer device 12, and/or with any devices (e.g., network card, modem, etc.) that enable the computer device 12 to communicate with one or more other computing devices. Such communication may be through the I/O interface 22. Also, computer device 12 may communicate with one or more networks (e.g., a Local Area Network (LAN)), a Wide Area Network (WAN), and/or a public network (e.g., the Internet) via network adapter 20. As shown in FIG. 3, the network adapter 20 communicates with the other modules of the computer device 12 via the bus 18. It should be appreciated that although not shown in FIG. 3, other hardware and/or software modules may be used in connection with computer device 12, including but not limited to: microcode, device drives, redundant processing units 16, external disk drive arrays, RAID systems, tape drives, and data backup storage systems 34, and the like.
The processing unit 16 executes programs stored in the memory 28 to perform various functional applications and data processing, for example, to implement a method for detecting a sensor anomaly based on a block chain provided in an embodiment of the present application.
That is, the processing unit 16 implements, when executing the program, the following: the block chain generates a comparison result corresponding to the functional interval condition parameter and the functional interval reference condition parameter according to the functional interval condition parameter and the functional interval reference condition parameter received from the sensor; wherein the comparison result comprises no error and error; when the comparison result is wrong, the block chain terminal generates the function interval alarm parameter according to the comparison result, and sends the function interval alarm parameter and the function interval condition parameter to the user side by calling the intelligent contract; and the user side is used for receiving the function interval condition parameters and/or the function interval alarm parameters.
In embodiments of the present application, the present application further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a block chain based sensor abnormality detection method as provided in all embodiments of the present application.
That is, the program when executed by the processor implements: the block chain generates a comparison result corresponding to the function interval condition parameter and the function interval reference condition parameter according to the function interval condition parameter and the function interval reference condition parameter received from the sensor; wherein the comparison result comprises no error and error; when the comparison result is wrong, the block chain terminal generates the function interval alarm parameter according to the comparison result, and sends the function interval alarm parameter and the function interval condition parameter to the user side by calling the intelligent contract; and the user side is used for receiving the function interval condition parameters and/or the function interval alarm parameters.
Any combination of one or more computer-readable media may be employed. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Computer program code for carrying out operations for aspects of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the operator's computer, partly on the operator's computer, as a stand-alone software package, partly on the operator's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the operator's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider). The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
While preferred embodiments of the present application have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including the preferred embodiment and all such alterations and modifications as fall within the true scope of the embodiments of the application.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or end device that comprises the element.
The block chain-based sensor anomaly detection method, device and system provided by the application are introduced in detail, specific examples are applied in the text to explain the principle and implementation of the application, and the description of the above embodiments is only used to help understand the method and core ideas of the application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific implementation and application scope, and as described above, the content of the present specification should not be construed as a limitation to the present application.

Claims (10)

1. A sensor abnormity detection method based on a block chain is used for detecting the abnormity of the operation parameters of a sensor on a production line, and the method relates to a block chain terminal, the sensor and a user terminal; the block chain terminal has a wireless self-organization function and a gateway function, and functional interval reference condition parameters are stored; the block chain terminal and the sensor are respectively arranged in each functional interval in the production line; the block chain terminal is respectively connected with the user terminal and the sensor; specifically, the block chain terminals and the sensors in different function intervals are not connected with each other; the sensor is used for acquiring function interval status parameters, periodically encrypting the function interval status parameters and then sending the encrypted function interval status parameters to the corresponding block chain terminal; the functional interval condition parameters comprise environmental parameters and equipment running state parameters;
characterized in that the method comprises:
the block chain generates a comparison result corresponding to the function interval condition parameter and the function interval reference condition parameter according to the function interval condition parameter and the function interval reference condition parameter received from the sensor; wherein the comparison result comprises no error and error;
when the comparison result is wrong, the block chain terminal generates the function interval alarm parameter according to the comparison result, and sends the function interval alarm parameter and the function interval condition parameter to the user side by calling the intelligent contract; and the user side is used for receiving the function interval condition parameters and/or the function interval alarm parameters.
2. The method of block chain based sensor anomaly detection according to claim 1, further comprising:
the block chain terminal collects the function interval standard condition parameters of each function interval on the production line under the standard working state, and normalizes the function interval standard condition parameters by a z-score standardization method to generate a standard condition parameter set;
the block chain terminal reduces the dimension of the standard condition parameter set according to a random hash function to generate a dimension reduction parameter set;
the block chain terminal carries out set mapping and bucket dividing on the dimension reduction parameter set according to a primary hash function and a secondary hash function, and respectively determines the dimension mean value of the standard condition parameter set and the dimension mean value of the dimension reduction parameter set after bucket dividing;
the block chain terminal sets the dimension with the largest dimension mean difference in the standard condition parameter set and the partitioned dimension-reduced parameter set as a partition attribute, and takes the dimension mean of the partitioned dimension-reduced parameter set corresponding to the partition attribute as a partition point;
and the block chain terminal establishes an isolation tree of the isolation forest corresponding to the standard condition parameter set according to the segmentation attribute, the segmentation point and a preset tree limit height.
3. The method according to claim 2, wherein the step of generating the comparison result corresponding to the functional interval status parameter and the functional interval reference status parameter by the blockchain based on the functional interval status parameter and the functional interval reference status parameter received from the sensor comprises:
respectively carrying out normalization and dimension reduction on the function interval condition parameters to generate dimension reduction verification parameters;
sequentially putting the dimension reduction verification parameters into an isolation tree of the isolation forest, and determining the path length and the abnormal score of each parameter;
and determining the comparison result according to the abnormal score and a preset score threshold value.
4. The method according to claim 2, wherein the step of acquiring the functional interval standard condition parameters of each functional interval on the production line in a standard working state by the blockchain terminal, and normalizing the functional interval standard condition parameters by a z-score normalization method to generate a standard condition parameter set comprises:
setting wireless sensor network node S ═ Sj: j is 1, 2, … m, every fixed time interval delta t, each node collects a group of function interval standard condition parameters and sends the parameters to the base station; wherein the node SjThe recorded set of function interval standard condition parameters is a vector v with dimension pj=(vj1,vj2,…,vjp),vj∈RpWherein p represents the type number of the standard condition parameter of the functional interval; within the next Δ t, the base station will receive n groupsFunction section standard condition parameter V ═ { V ═ V1,v2,…vnH, wherein the number of groups n is independent of the node ID;
the dimensional mean of the functional interval standard condition parameter set V is defined as:
Figure FDA0003554637960000021
wherein time t is the time of receipt of the detected feature; defining a time period [0, T]The set of detection features received in is the training data, which is represented as matrix XT={x1,x2,…,xk},k=T/Δt。
5. The method of claim 2, wherein the random hash function is:
Figure FDA0003554637960000031
where α is a q-dimensional vector randomly sampled from a function satisfying a p-stable distribution, and β is a
Figure FDA0003554637960000032
Random variables distributed uniformly above; hash function hα,β(υ):Rq→ Z can map a q-dimensional vector v onto an integer set; [:]is a rounding-down operation; the data set is processed by L random hash functions h ═ h (h)1(υ),h2(υ),Λ,hL(upsilon)) dimension reduction mapping to obtain an L-dimension vector V-V (V)1,v2,…,vL)。
6. The method according to claim 5, wherein the step of the blockchain terminal performing set mapping and bucket splitting on the dimension-reduced parameter set according to a primary and secondary hash function and respectively determining the dimension mean of the standard condition parameter set and the dimension mean of the dimension-reduced parameter set after bucket splitting comprises:
and calculating a corresponding primary hash function value G1 and a corresponding secondary hash function value G2 by using a primary hash function G1 formula and a secondary hash function G2 formula:
Figure FDA0003554637960000033
Figure FDA0003554637960000034
distributing the parameters of the primary hash function value g1 which is the secondary hash function value g2 into the same bucket;
counting the hash values in each bucket, and if the number in the bucket is larger than or equal to the sub-sampling size of the isolated forest, screening out all the buckets meeting the condition;
sorting the index numbers corresponding to the parameters in the screened buckets, and sorting from [ V ]]n*LEach record corresponding to one index number is selected to form new data set [ A ] corresponding to the bucket and subjected to dimensionality reduction and sub-sampling]k*L,k<n, n is the number of barrels;
and respectively determining the dimension mean value of the standard condition parameter set in the bucket and the dimension mean value of the dimensionality reduction parameter set after the bucket division.
7. The method of claim 6, wherein the step of determining the mean value of the dimension of the standard condition parameter set in the bucket and the mean value of the dimension of the reduced dimension parameter set after the bucket respectively comprises:
calculating the dimension mean of the new data set specifically includes: new data set [ A ]]k*LAs an input data set of the improved forest isolation algorithm, if L dimensions exist, the L dimensions respectively calculate a mean value VnewColumn means μ and V of matrix XTnewAfter respectively corresponding to the indexes, the average value difference M is obtainedLiFind MLiMaximum value corresponds toAttribute Li as a segmentation attribute, VnewiAs a division point.
8. The method for detecting sensor abnormality based on blockchain according to claim 3, wherein the step of sequentially putting the dimension-reduced verification parameters into the isolation tree of the isolation forest and determining the path length and abnormality score of each parameter includes:
putting the real-time data points into a constructed isolation tree, and recording the average path length c (n) and the abnormal score s (x, n) of the data points in the tree:
Figure FDA0003554637960000041
Figure FDA0003554637960000042
where E (h (x)) is the expected path length of sample x in the isolation tree.
9. A sensor abnormity detection device based on a block chain is used for detecting the abnormity of the operation parameters of a sensor on a production line, and relates to a block chain terminal, a sensor and a user terminal; the block chain terminal has a wireless self-organization function and a gateway function, and functional interval reference condition parameters are stored; the block chain terminal and the sensor are respectively arranged in each functional interval in the production line; the block chain terminal is respectively connected with the user terminal and the sensor; specifically, the block chain terminals and the sensors in different function intervals are not connected with each other; the sensor is used for acquiring function interval status parameters, periodically encrypting the function interval status parameters and then sending the encrypted function interval status parameters to the corresponding block chain terminal; the functional interval condition parameters comprise environmental parameters and equipment running state parameters;
characterized in that the device comprises:
a comparison result generation module, configured to generate a comparison result corresponding to the function interval status parameter and the function interval reference status parameter according to the function interval status parameter and the function interval reference status parameter received from the sensor; wherein the comparison result comprises no error and error;
a function interval alarm parameter generating module, configured to generate the function interval alarm parameter according to the comparison result when the comparison result is incorrect, and send the function interval alarm parameter and the function interval status parameter to the user side by calling the intelligent contract; and the user side is used for receiving the function interval condition parameters and/or the function interval alarm parameters.
10. A sensor abnormity detection system based on a block chain is used for detecting the abnormity of the operation parameters of a sensor on a production line, and is characterized in that the system relates to a block chain terminal, the sensor and a user terminal; the block chain terminal has a wireless self-organization function and a gateway function, and has a function interval reference condition parameter; the block chain terminal and the sensor are respectively arranged in each functional interval in the production line; the block chain terminal is respectively connected with the user terminal and the sensor; specifically, the block chain terminals and the sensors in different function intervals are not connected with each other; the sensor is used for acquiring function interval status parameters, periodically encrypting the function interval status parameters and then sending the encrypted function interval status parameters to the corresponding block chain terminal; the functional interval condition parameters comprise environmental parameters and equipment running state parameters;
the block chain terminal is used for authenticating the sensor, storing and calculating sensor data received through bidirectional data forwarding and protocol conversion decryption of a wireless self-organizing network and an Ethernet in parallel, and sharing data between the block chain terminals through an intelligent contract;
the block chain terminal is further used for generating a comparison result corresponding to the function interval condition parameter and the function interval reference condition parameter according to the function interval condition parameter and the function interval reference condition parameter received from the sensor; wherein the comparison result comprises no error and error;
the sensor is used for acquiring environmental parameters and equipment running state parameters in a function interval, and periodically encrypting and sending the environmental parameters and the equipment running state parameters to a corresponding block chain terminal;
the block chain terminal is also used for generating the function interval alarm parameter according to the comparison result when the comparison result is wrong, and transmitting the function interval alarm parameter and the function interval status parameter to the user terminal by calling the intelligent contract;
the user side is used for receiving the function interval condition parameters and/or the function interval alarm parameters;
and the user terminal is also used for carrying out data interaction with the block chain terminal, displaying the environmental parameters and the equipment running state parameters in each function interval on the production line site, and controlling the sensor and the production equipment in each function interval.
CN202210270935.6A 2022-03-18 2022-03-18 Sensor abnormity detection method, device and system based on block chain Pending CN114710796A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210270935.6A CN114710796A (en) 2022-03-18 2022-03-18 Sensor abnormity detection method, device and system based on block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210270935.6A CN114710796A (en) 2022-03-18 2022-03-18 Sensor abnormity detection method, device and system based on block chain

Publications (1)

Publication Number Publication Date
CN114710796A true CN114710796A (en) 2022-07-05

Family

ID=82168830

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210270935.6A Pending CN114710796A (en) 2022-03-18 2022-03-18 Sensor abnormity detection method, device and system based on block chain

Country Status (1)

Country Link
CN (1) CN114710796A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117251707A (en) * 2023-11-20 2023-12-19 武汉大学 Block chain anchoring and verifying method and device for river data elements

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109302491A (en) * 2018-11-13 2019-02-01 爱普(福建)科技有限公司 A kind of industry internet framework and its operation method based on block chain
CN109922162A (en) * 2019-04-26 2019-06-21 山东建筑大学 A kind of flattening Architectural Equipment network monitoring system for things and method based on block chain
US20200175155A1 (en) * 2018-12-03 2020-06-04 Ebay Inc. System level function based access control for smart contract execution on a blockchain
CN111314910A (en) * 2020-02-25 2020-06-19 重庆邮电大学 Novel wireless sensor network abnormal data detection method for mapping isolation forest
CN111563433A (en) * 2020-04-27 2020-08-21 郭琼 Wisdom building site is monitored system of overflowing water based on block chain

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109302491A (en) * 2018-11-13 2019-02-01 爱普(福建)科技有限公司 A kind of industry internet framework and its operation method based on block chain
US20200175155A1 (en) * 2018-12-03 2020-06-04 Ebay Inc. System level function based access control for smart contract execution on a blockchain
CN109922162A (en) * 2019-04-26 2019-06-21 山东建筑大学 A kind of flattening Architectural Equipment network monitoring system for things and method based on block chain
CN111314910A (en) * 2020-02-25 2020-06-19 重庆邮电大学 Novel wireless sensor network abnormal data detection method for mapping isolation forest
CN111563433A (en) * 2020-04-27 2020-08-21 郭琼 Wisdom building site is monitored system of overflowing water based on block chain

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117251707A (en) * 2023-11-20 2023-12-19 武汉大学 Block chain anchoring and verifying method and device for river data elements
CN117251707B (en) * 2023-11-20 2024-02-09 武汉大学 Block chain anchoring and verifying method and device for river data elements

Similar Documents

Publication Publication Date Title
CN109922162B (en) Flat building equipment Internet of things monitoring system and method based on block chain
Sharma et al. Role of machine learning and deep learning in securing 5G-driven industrial IoT applications
Yousefnezhad et al. Security in product lifecycle of IoT devices: A survey
Hou et al. A survey on internet of things security from data perspectives
Li et al. RETRACTED ARTICLE: Information security model of block chain based on intrusion sensing in the IoT environment
Zhu et al. Autonomic identity framework for the internet of things
Puthal et al. SEEN: A selective encryption method to ensure confidentiality for big sensing data streams
Hei et al. A trusted feature aggregator federated learning for distributed malicious attack detection
CN114499895B (en) Data trusted processing method and system fusing trusted computing and block chain
CN109547407B (en) Whole-process tracking method for environment monitoring data and block chain link points
CN116881981B (en) Digital signature system and method based on certificate
Babu et al. Blockchain-based Intrusion Detection System of IoT urban data with device authentication against DDoS attacks
CN112214544A (en) Ubiquitous power Internet of things edge data safe storage method based on permission block chain
CN117040896A (en) Internet of things management method and Internet of things management platform
Fan et al. Understanding security in smart city domains from the ANT-centric perspective
CN115865526A (en) Industrial internet security detection method and system based on cloud edge cooperation
Ahamed Ahanger et al. Distributed Blockchain‐Based Platform for Unmanned Aerial Vehicles
CN114710796A (en) Sensor abnormity detection method, device and system based on block chain
Pandey et al. A review of security concerns in smart grid
Feng et al. Autonomous vehicles' forensics in smart cities
Rajawat et al. Analysis assaulting pattern for the security problem monitoring in 5G‐enabled sensor network systems with big data environment using artificial intelligence/machine learning
Samriya et al. Blockchain and Reinforcement Neural Network for Trusted Cloud-Enabled IoT Network
Cheng et al. Ocean data sharing based on blockchain
Wang et al. Analysis and Design of Identity Authentication for IoT Devices in the Blockchain Using Hashing and Digital Signature Algorithms
CN114785513A (en) Internet of things monitoring method and device of industrial production line based on block chain

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20220705