KR102507829B1 - Batch processing method for storing continuous IoT data on the blockchain and system for storing IoT data using the method - Google Patents

Batch processing method for storing continuous IoT data on the blockchain and system for storing IoT data using the method Download PDF

Info

Publication number
KR102507829B1
KR102507829B1 KR1020200114760A KR20200114760A KR102507829B1 KR 102507829 B1 KR102507829 B1 KR 102507829B1 KR 1020200114760 A KR1020200114760 A KR 1020200114760A KR 20200114760 A KR20200114760 A KR 20200114760A KR 102507829 B1 KR102507829 B1 KR 102507829B1
Authority
KR
South Korea
Prior art keywords
data
iot data
iot
batch processing
outlier
Prior art date
Application number
KR1020200114760A
Other languages
Korean (ko)
Other versions
KR20220032884A (en
Inventor
송아람
박수용
Original Assignee
서강대학교산학협력단
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 서강대학교산학협력단 filed Critical 서강대학교산학협력단
Priority to KR1020200114760A priority Critical patent/KR102507829B1/en
Publication of KR20220032884A publication Critical patent/KR20220032884A/en
Application granted granted Critical
Publication of KR102507829B1 publication Critical patent/KR102507829B1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/906Clustering; Classification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/12Applying verification of the received information
    • H04L63/123Applying verification of the received information received data contents, e.g. message integrity
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching
    • H04L67/5682Policies or rules for updating, deleting or replacing the stored data

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Medical Informatics (AREA)
  • Bioethics (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

본 발명은 블록체인을 기반으로 한 IoT 데이터 저장을 위한 일괄 처리 방법 및 사물인터넷 시스템에 관한 것이다. 상기 일괄 처리 방법은, 사물인터넷 기기로부터 실시간 제공된 IoT 데이터에 대하여, 이상치 탐지 알고리즘에 따라 이상치인지 여부를 판단하는 단계; 상기 데이터가 이상치가 아니면, 임시 버퍼에 순차적으로 저장하여 일괄 처리하는 단계; 상기 데이터가 이상치이면, 현재 IoT 데이터와 임시 버퍼에 저장된 이전 IoT 데이터들을 모아서 일괄 처리용 스마트 컨트랙트로 전송하는 단계; 상기 일괄 처리용 스마트 컨트랙트에 의해, 상기 전송된 현재 IoT 데이터와 이전 IoT 데이터들은, 사전 설정된 규칙에 따라 분류되어 이상치인 현재 IoT 데이터는 블록체인에 저장하고 정상값인 이전 IoT 데이터들은 외부 데이터베이스에 저장되는 단계;를 구비하여, 시계열 IoT 데이터들을 일괄 처리하는 것을 특징으로 한다. The present invention relates to a batch processing method and IoT system for IoT data storage based on a block chain. The batch processing method may include determining whether IoT data provided in real time from an IoT device is an outlier according to an outlier detection algorithm; If the data is not an outlier, sequentially storing the data in a temporary buffer and processing them in batches; If the data is an outlier, collecting current IoT data and previous IoT data stored in a temporary buffer and transmitting them to a smart contract for batch processing; By the smart contract for batch processing, the transmitted current IoT data and previous IoT data are classified according to preset rules, and the current IoT data with outliers is stored in the blockchain and the previous IoT data with normal values is stored in an external database. It is characterized by batch processing of time-series IoT data.

Description

블록체인을 기반으로 한 IoT 데이터 저장을 위한 일괄 처리 방법 및 상기 방법을 이용한 IoT 데이터 저장 시스템{Batch processing method for storing continuous IoT data on the blockchain and system for storing IoT data using the method}Batch processing method for storing continuous IoT data on the blockchain and system for storing IoT data using the method}

본 발명은 블록체인을 기반으로 한 IoT 데이터 저장을 위한 일괄 처리 방법 및 상기 방법을 이용한 IoT 데이터 저장 시스템에 관한 것으로서, 더욱 구체적으로는 실시간으로 발생하는 사물 인터넷 데이터들을 일괄 처리하고 스마트 컨트랙트에 따라 데이터를 분류하여 사물 인터넷 데이터를 블록체인과 외부 데이터베이스에 저장할 수 있도록 하여, 블록체인 프로토콜의 탈중앙성, 보안성 및 확장성을 유지하면서 IoT 데이터를 블록체인에 저장할 수 있도록 하는 IoT 데이터 저장을 위한 일괄 처리 방법에 관한 것이다. The present invention relates to a batch processing method for storing IoT data based on a block chain and an IoT data storage system using the method, and more specifically, batch processing of Internet of Things data occurring in real time and data processing according to a smart contract. A batch for IoT data storage that enables IoT data to be stored on the blockchain while maintaining the decentralization, security and scalability of the blockchain protocol by classifying IoT data so that it can be stored in the blockchain and external databases. It's about how to handle it.

블록체인 네트워크 시스템은 탈중앙화 네트워크 구조로서 거래 참여자들이 모두 노드가 되어 Peer to Peer 방식으로 구성된다. 한편, 이더리움(Ethereum)은 블록체인 기술을 기반으로 스마트 컨트랙트 기능을 구현할 수 있는 분산 컴퓨팅 플랫폼이자 운영체제이다. 스마트 컨트랙트는 “당사자들이 다른 약속에 따라 수행하는 프로토콜을 포함하여 디지털 형식으로 지정된 일련의 약속”이라고 정의된다. 따라서, 스마트 컨트랙트는 사용자가 정의한 코드의 조건이 만족되면 계약이 성사된다. 스마트 컨트랙트 내의 모든 과정은 자동으로 이루어지며 모든 데이터를 서로 공유하기 때문에 특정한 사용자가 스마트 컨트랙트의 실행 결과를 조작할 수 없다. 따라서, 블록체인이 모든 트랜잭션의 무결성을 보장해 주는 방식으로 스마트 컨트랙트의 무결성도 보장할 수 있다. The blockchain network system is a decentralized network structure, where all transaction participants become nodes and are configured in a peer-to-peer manner. On the other hand, Ethereum is a distributed computing platform and operating system that can implement smart contract functions based on blockchain technology. A smart contract is defined as “a set of promises specified in digital form, including protocols that the parties perform in accordance with other promises.” Therefore, the contract is concluded when the conditions of the code defined by the user are satisfied. All processes within the smart contract are automatic and all data is shared, so a specific user cannot manipulate the execution result of the smart contract. Therefore, the integrity of the smart contract can be guaranteed in the same way that the blockchain guarantees the integrity of all transactions.

한편, 블록체인은 확장성(Scalability), 보안성(Security), 탈중앙성(Decentralization)의 트릴레마(Trilemma)를 갖는다. 도 1은 블록체인 네트워크의 트릴레마를 도시한 모식도이다. 확장성이란 개별 노드의 자원이상으로 트랜잭션을 처리할 수 있는 능력을 말하며, 보안성은 블록체인이 자원을 가진 공격자로부터 일관성을 유지할 수 있는 안전한 정도를 의미하며, 탈중앙성은 제한된 자원을 가지고 블록체인에 참여할 수 있는 정도를 의미한다. On the other hand, blockchain has the trilemma of scalability, security, and decentralization. 1 is a schematic diagram showing the trilemma of a blockchain network. Scalability refers to the ability to process transactions beyond the resources of individual nodes, security refers to the degree of security that a blockchain can maintain consistency from attackers with resources, and decentralization refers to the ability of a blockchain to operate with limited resources refers to the extent to which they can participate.

한편, 사물 인터넷 네트워크는 사물 인터넷 기기인 센서들로부터 실시간 데이터들이 기하급수적으로 증가하게 되며, 이러한 대용량의 IoT 데이터들을 처리하고 저장해야 될 필요성이 증대되고 있다. 이러한 IoT 데이터는 특정한 시간(t)에서 측정된 데이터들이라는 점에서 시계열 데이터라고 볼 수 있다. IoT 데이터들에 대한 정확한 분석 결과를 도출하기 위하여는 이상치를 탐지하여 제거하고 분류하는 과정이 필요하다. On the other hand, in the IoT network, real-time data from sensors, which are IoT devices, increases exponentially, and the need to process and store such large-capacity IoT data is increasing. Such IoT data can be regarded as time series data in that it is data measured at a specific time (t). In order to derive accurate analysis results for IoT data, it is necessary to detect, remove, and classify outliers.

시계열 데이터는 시간에 따라 생성되는 데이터로 어떤 추세나 변화에 맞춰 상승하거나 하락하는 경향이 있다. 따라서 단순히 과거 데이터 분포를 보고 이상치(Outlier)를 탐지한다면 점점 상승하거나 하락하는 추세를 갖는 시계열 데이터를 분석하는 데에는 한계가 있다. 이러한 추세 패턴을 반영하여 이상치를 탐지하기 위해 사용할 수 있는 방법이 이동평균(Moving Average)과 기준 편차를 활용한 이상 탐지 모델이다. 이동평균을 측정하는 대표적인 방법으로 단순이동평균(SMA, Simple Moving Average)과 지수이동평균(EMA, Exponential Moving Average)이 있다.Time series data is data that is generated over time and tends to rise or fall in line with some trend or change. Therefore, there is a limit to analyzing time series data with an increasing or decreasing trend by simply looking at the distribution of past data and detecting outliers. A method that can be used to detect outliers by reflecting these trend patterns is an anomaly detection model using a moving average and standard deviation. Representative methods for measuring moving averages include Simple Moving Average (SMA) and Exponential Moving Average (EMA).

블록체인과 사물 인터넷 기기간의 연동 방식은 (1) 사물 인터넷 장치에 블록체인을 직접 연동하는 방법, (2) 사물인터넷 플랫폼과 블록체인 네트워크를 연결하는 방법이다. 도 2는 사물인터넷 장치에 블록체인 네트워크를 직접 연동하는 시스템을 예시적으로 도시한 구성도이다. 도 2를 참조하면, 첫번째 방법은 각 IoT 기기가 블록체인 네트워크의 노드가 되어 데이터를 생성하고 저장하는 방법으로서, IoT 장치내에 경량 블록체인 미들웨어를 탑재하여 장치에서 측정된 데이터를 보낼 수 있게 된다. Linking methods between blockchain and IoT devices are (1) a method of directly linking a blockchain to an IoT device, and (2) a method of connecting an IoT platform and a blockchain network. 2 is a configuration diagram illustrating a system for directly linking a blockchain network to an IoT device as an example. Referring to FIG. 2, the first method is a method in which each IoT device becomes a node of a blockchain network to generate and store data. By mounting a lightweight blockchain middleware in the IoT device, data measured by the device can be sent.

도 3은 사물인터넷 플랫폼과 블록체인 네트워크를 연결하는 시스템을 예시적으로 도시한 구성도이다. 전술한 두번째 방법은 사물 인터넷 플랫폼과 블록체인 클라이언트를 연결하는 방법으로서, 도 3을 참조하면, 사물 인터넷 플랫폼에서 기기별로 생성된 데이터를 처리하여 블록체인 프록시 서버를 거쳐 최종적으로 데이터를 블록체인에 저장한다. 두번째 방법은 IoT 플랫폼에서 데이터 전처리 과정을 거쳐 데이터를 저장하기 때문에 사물 인터넷 플랫폼과 블록체인 네트워크와의 공존이 가능하다. 3 is a configuration diagram showing a system connecting an IoT platform and a blockchain network as an example. The second method described above is a method of connecting the Internet of Things platform and a blockchain client. Referring to FIG. 3, data generated for each device in the Internet of Things platform is processed, passed through a blockchain proxy server, and finally the data is stored in the blockchain. do. The second method stores data through data pre-processing in the IoT platform, so it is possible to coexist with the IoT platform and the blockchain network.

한편, 블록체인 노드를 활용하면 분산 네트워크화를 통해 중앙 서버가 불필요하며 비용이 절감되며 블록체인 기술을 활용하여 보안성과 데이터 무결성을 보장할 수 있다. 하지만, IoT 기기의 개수가 증가함에 따라 실시간 트랜잭션이 기하 급수적으로 증가하게 되고, 이로 인해 블록체인의 트랜잭션 처리량의 한계로 인하여 IoT 기기에서 생성되는 데이터들을 실시간으로 처리할 수 없게 되는 문제점이 발생한다. On the other hand, when using blockchain nodes, central servers are unnecessary and costs are reduced through distributed networking, and security and data integrity can be guaranteed by utilizing blockchain technology. However, real-time transactions increase exponentially as the number of IoT devices increases, resulting in a problem in that data generated by IoT devices cannot be processed in real time due to the limitation of transaction throughput of the blockchain.

이러한 문제점들로 인하여, 블록체인 네트워크와 IoT 네트워크의 융합을 위해 블록체인의 트랜잭션 처리량을 높이기 위한 다양한 시도들이 제안되고 있다. 이러한 시도들로는, 비순환 그래프(DAG)를 도입한 IOTA 방법, 참여자의 서버 성능을 제한하는 허가형 블록체인 방법, 선별적인 데이터를 저장하는 데이터 전처리 방법등이 있다. 전술한 IOTA 방법은 블록체인이 아닌 비순환 그래프를 통해 처리량을 높이는 방식으로 코디네이터가 노드의 거래량과 처리속도를 관리한다는 점에서 탈중앙성과 보안성은 낮아졌다. 전술한 허가형 블록체인을 통한 처리량 해결법은 블록체인에 참여하는 노드의 성능을 제한하여 처리량을 높이는 방식으로서, 네트워크에 참여할 수 있는 노드는 지정된 노드만 참여가 가능하며 Hyperledger Fabric과 같은 프라이빗 네트워크(Private Network)에서 실행된다. 이를 통해 한 번에 처리되는 데이터의 양을 늘릴 수는 있지만 연산량과 메모리 제한이 있는 IoT기기에서 실행하기 어려운 환경이다. 전술한 데이터 전처리 방식은 중앙 서버에서 IoT 기기에서 발생하는 데이터를 모아뒀다가 원본 데이터(Raw Data)를 가공하여 블록체인 네트워크로 전달하는 방식으로서, 기존의 클라우드 네트워크 환경과 비슷하게 단일 지점 장애 문제가 생길 수 있으며 보안성과 탈중앙성을 만족하지 못한다.Due to these problems, various attempts have been proposed to increase the transaction throughput of the blockchain for the convergence of the blockchain network and the IoT network. These attempts include an IOTA method that introduces an acyclic graph (DAG), a permissioned blockchain method that limits server performance of participants, and a data preprocessing method that stores selective data. The above-mentioned IOTA method increases throughput through an acyclic graph rather than a blockchain, and decentralization and security are lowered in that the coordinator manages the transaction volume and processing speed of the node. The above-described throughput solution through permissioned blockchain is a method of increasing throughput by limiting the performance of nodes participating in the blockchain. Only designated nodes can participate in the network, and private networks such as Hyperledger Fabric network). Through this, it is possible to increase the amount of data processed at one time, but it is a difficult environment to run in IoT devices with limited computation and memory. The aforementioned data pre-processing method collects data generated by IoT devices in a central server, processes raw data, and delivers it to a blockchain network. Similar to the existing cloud network environment, a single point failure problem may occur However, it does not satisfy security and decentralization.

이와 같이, 데이터 처리량을 높이기 위한 기존의 방법들은 블록체인의 탈중앙성을 포기하고 처리량만을 높이거나 탈중앙성과 보안성을 해치고 확장성만을 늘리는 방안들이 대부분이다. In this way, most of the existing methods for increasing data throughput give up decentralization of blockchain and only increase throughput, or compromise decentralization and security and only increase scalability.

따라서, 본 발명은 탈중앙성과 보안성을 고려하여 확장성을 늘리는 방안을 제안하고자 한다. Therefore, the present invention intends to propose a method for increasing scalability in consideration of decentralization and security.

한국등록특허공보 제 10-1992981호Korea Patent Registration No. 10-1992981 한국등록특허공보 제 10-2041341호Korean Registered Patent Publication No. 10-2041341

전술한 문제점을 해결하기 위한 본 발명의 목적은 블록체인을 기반으로 한 IoT 데이터 저장을 위한 일괄 처리 방법을 제공하는 것이다. An object of the present invention to solve the above problems is to provide a batch processing method for storing IoT data based on a block chain.

본 발명의 다른 목적은 IoT 데이터를 블록체인 네트워크에 저장함에 있어서 IoT 데이터 저장을 일괄 처리하도록 함으로써, 블록체인 네트워크의 탈중앙성과 보안성을 고려하여 확장성을 늘릴 수 있도록 한 블록체인을 기반으로 한 IoT 데이터 저장을 위한 IoT 플랫폼을 제공하는 것이다. Another object of the present invention is to store IoT data in a blockchain network by batch-processing IoT data storage, which is based on a blockchain that can increase scalability by considering the decentralization and security of the blockchain network. It is to provide an IoT platform for IoT data storage.

전술한 기술적 과제를 달성하기 위한 본 발명의 제1 특징에 따른 블록체인을 기반으로 한 IoT 데이터의 저장을 위한 일괄 처리 방법은, (a) IoT 네트워크 시스템으로부터 발생되는 IoT 데이터를 제공받는 단계; (b) 상기 IoT 데이터에 대한 초기 평균값을 설정하는 단계; (c) 상기 IoT 데이터가 초기 평균값을 설정한 이후에 제공된 데이터이면, 사전 설정된 이상치 탐지 알고리즘에 따라 상기 제공된 상기 IoT 데이터가 이상치인지 여부를 판단하는 단계; (d) 상기 데이터가 이상치가 아니면, 임시 버퍼에 순차적으로 저장하여 일괄 처리하는 단계; (e) 상기 데이터가 이상치이면, 현재 IoT 데이터와 임시 버퍼에 저장된 이전 IoT 데이터들을 모아서 일괄 처리용 스마트 컨트랙트로 전송하는 단계; (f) 상기 일괄 처리용 스마트 컨트랙트에 의해, 상기 전송된 현재 IoT 데이터와 이전 IoT 데이터들은, 사전 설정된 규칙에 따라 분류되어 하나의 블록으로 생성되어 블록체인에 저장되거나, 외부 데이터베이스에 저장되는 단계; 를 구비하여, 시계열 IoT 데이터들을 일괄 처리한다. A batch processing method for storing IoT data based on a block chain according to a first aspect of the present invention for achieving the above technical problem includes: (a) receiving IoT data generated from an IoT network system; (b) setting an initial average value for the IoT data; (c) if the IoT data is data provided after setting an initial average value, determining whether the provided IoT data is an outlier according to a preset outlier detection algorithm; (d) if the data are not outliers, sequentially storing them in a temporary buffer and processing them in batches; (e) if the data is an outlier, collecting current IoT data and previous IoT data stored in a temporary buffer and transmitting them to a smart contract for batch processing; (f) by the smart contract for batch processing, the transmitted current IoT data and previous IoT data are classified according to preset rules and generated as one block and stored in a block chain or stored in an external database; Equipped with, time-series IoT data are processed in batches.

전술한 제1 특징에 따른 블록체인을 기반으로 한 IoT 데이터의 저장을 위한 일괄 처리 방법에 있어서, 상기 (b) 단계의 초기 평균값 설정 단계는, 상기 데이터가 초기 데이터이면, 임시 버퍼에 저장된 초기 데이터 양이 사전 설정된 배치 사이즈(N)보다 작을 경우, 임시 버퍼에 N 만큼 데이터가 발생될 때까지 기다린 후, 이동 평균을 통해 초기 평균값을 구하는 것이 바람직하다. In the batch processing method for storing IoT data based on the blockchain according to the first feature described above, in the setting of the initial average value of step (b), if the data is the initial data, the initial data stored in the temporary buffer When the amount is smaller than the preset batch size (N), it is preferable to wait until N data are generated in the temporary buffer, and then obtain an initial average value through a moving average.

전술한 제1 특징에 따른 블록체인을 기반으로 한 IoT 데이터의 저장을 위한 일괄 처리 방법에 있어서, 상기 (c) 단계의 이상치 탐지 알고리즘은, (b1) 상기 데이터에 대하여 지수 이동 평균 방법에 따라 가중치를 두어 평균값을 구하는 단계; (b2) 현재 데이터의 이동 평균값과 이전 데이터의 편차의 크기와 사전 설정된 기준 편차값을 비교하여 이상치를 탐지하는 단계; 를 구비하는 것이 바람직하다. In the batch processing method for storing IoT data based on the blockchain according to the first feature described above, the anomaly detection algorithm in step (c) comprises: (b1) a weighting factor according to the exponential moving average method for the data; Calculating an average value by placing (b2) detecting an outlier by comparing the moving average value of the current data with the magnitude of the deviation of the previous data and a preset reference deviation value; It is desirable to have.

전술한 제1 특징에 따른 블록체인을 기반으로 한 IoT 데이터의 저장을 위한 일괄 처리 방법에 있어서, 상기 기준 편차값은 이상치를 탐지하는 민감도에 따라 결정되는 것이 바람직하다. In the batch processing method for storing IoT data based on a block chain according to the first feature described above, the reference deviation value is preferably determined according to the sensitivity of detecting an outlier.

전술한 제1 특징에 따른 블록체인을 기반으로 한 IoT 데이터의 저장을 위한 일괄 처리 방법에 있어서, 상기 (f) 단계는, 상기 일괄 처리용 스마트 컨트랙트에 의해, 상기 전송된 현재 데이터와 이전 데이터들 중 이상치인 현재 데이터는 블록으로 생성되어 블록체인에 저장되며, 정상값인 이전 데이터들은 외부 데이터베이스에 저장되는 것이 바람직하다. In the batch processing method for storing IoT data based on the blockchain according to the first feature described above, the step (f) includes the transmitted current data and previous data by the smart contract for batch processing. It is preferable that the current data, which is a medium outlier, is created as a block and stored in the blockchain, and the previous data, which is a normal value, is stored in an external database.

본 발명의 제2 특징에 따른 블록체인을 기반으로 한 사물인터넷 시스템은, 사물 인터넷 기기로부터 발생된 IoT 데이터를 실시간으로 수신하고, IoT 데이터에 대한 초기 평균값을 구하고, 상기 초기 평균값을 이용하여 사전 설정된 이상치 탐지 알고리즘에 따라 IoT 데이터가 이상치인지 여부를 판단하고, 판단 결과가 이상치가 아니면 현재 IoT 데이터를 임시 버퍼에 저장하고, 판단 결과가 이상치이면 현재 IoT 데이터 및 임시 버퍼에 저장된 이전 데이터들을 묶어서 블록체인 프록시 서버로 전송하여 일괄 처리하는 사물인터넷 플랫폼; 상기 사물 인터넷 플랫폼으로부터 현재 데이터 및 이전 데이터들이 전송되면, 상기 현재 데이터 및 이전 데이터들을 매개 변수로 하여 일괄 처리용 스마트 컨트랙트를 호출하는 블록체인 프록시 서비; 및 복수 개의 블록체인 노드들로 이루어지고, 일괄 처리용 스마트 컨트랙트를 구비하는 블록체인 네트워크;를 구비하고, 상기 일괄 처리용 스마트 컨트랙트는 현재 데이터 및 이전 데이터들이 매개변수로 입력되어 호출되면, 사전 설정된 규칙에 따라 매개 변수들을 분류하여 저장한다. An IoT system based on a blockchain according to a second aspect of the present invention receives IoT data generated from an IoT device in real time, obtains an initial average value for the IoT data, and uses the initial average value to set a predetermined value. According to the outlier detection algorithm, it is determined whether the IoT data is an outlier or not, and if the judgment result is not an outlier, the current IoT data is stored in a temporary buffer. Internet of Things platform that transmits to a proxy server for batch processing; When the current data and previous data are transmitted from the IoT platform, a blockchain proxy service that calls a smart contract for batch processing using the current data and previous data as parameters; and a blockchain network consisting of a plurality of blockchain nodes and having a smart contract for batch processing. When the smart contract for batch processing is called with current data and previous data input as parameters, a preset Parameters are classified and stored according to rules.

전술한 제2 특징에 따른 블록체인을 기반으로 한 사물인터넷 시스템에 있어서, 상기 사물인터넷 플랫폼은, 실시간으로 수신된 IoT 데이터가 초기 데이터이면, 임시 버퍼에 저장된 초기 데이터 양이 사전 설정된 배치 사이즈(N)보다 작을 경우, 임시 버퍼에 N 만큼 데이터가 발생될 때까지 기다린 후, 이동 평균을 통해 초기 평균값을 구하는 것이 바람직하다. In the IoT system based on the blockchain according to the second feature described above, the IoT platform has a batch size (N ), it is preferable to wait until N data are generated in the temporary buffer and then obtain the initial average through moving average.

전술한 제2 특징에 따른 블록체인을 기반으로 한 사물인터넷 시스템에 있어서, 상기 이상치 탐지 알고리즘은, 상기 데이터에 대하여 지수 이동 평균 방법에 따라 가중치를 두어 평균값을 구하고, 현재 IoT 데이터의 이동 평균값과 이전 데이터의 편차의 크기와 사전 설정된 기준 편차값을 비교하여 이상치를 탐지하는 것이 바람직하다. In the IoT system based on the blockchain according to the second characteristic described above, the anomaly detection algorithm obtains an average value by weighting the data according to an exponential moving average method, and calculates an average value of the current IoT data and a previous moving average value. It is preferable to detect an outlier by comparing the magnitude of the deviation of the data with a preset standard deviation value.

전술한 제2 특징에 따른 블록체인을 기반으로 한 사물인터넷 시스템에 있어서, 상기 기준 편차값은 이상치를 탐지하는 민감도에 따라 결정되는 것이 바람직하다. In the IoT system based on the blockchain according to the second feature described above, the standard deviation value is preferably determined according to the sensitivity of detecting an outlier.

전술한 제2 특징에 따른 블록체인을 기반으로 한 사물인터넷 시스템에 있어서, 상기 일괄 처리용 스마트 컨트랙트는, 상기 전송된 현재 IoT 데이터와 이전 IoT 데이터들 중 이상치인 현재 데이터는 블록으로 생성하여 블록체인에 저장하며, 정상값인 이전 데이터들은 외부 데이터베이스에 저장하는 것이 바람직하다. In the IoT system based on the blockchain according to the second feature described above, the smart contract for batch processing generates the current data, which is an outlier among the transmitted current IoT data and previous IoT data, as a block, , and it is desirable to store previous data, which are normal values, in an external database.

본 발명에 따른 블록체인을 기반으로 한 IoT 데이터 저장을 위한 일괄 처리 방법은, IoT 데이터를 일괄 처리함으로써 기존의 개별 처리 방법보다 데이터 개수에 따른 저장 공간을 감소시키게 된다. The batch processing method for storing IoT data based on the block chain according to the present invention reduces the storage space according to the number of data than the existing individual processing method by batch processing the IoT data.

또한, 본 발명에 따른 블록체인을 기반으로 한 IoT 데이터 저장을 위한 일괄 처리 방법은, 기준 편차의 크기를 조정함에 따라 이상치 탐지에 대한 민감도를 조절할 수 있게 된다. 즉, 기준 편차를 크게 설정하면 이상치를 탐지하는 횟수가 감소하여 민감도가 감소되며, 기준 편차를 작게 설정하면 이상치를 팀지하는 횟수가 증가하게 되어 민감도가 증가하게 된다. In addition, the batch processing method for storing IoT data based on the block chain according to the present invention can adjust the sensitivity for outlier detection by adjusting the size of the standard deviation. That is, when the standard deviation is set high, the number of detecting outliers decreases and the sensitivity is reduced.

또한, 블록체인을 기반으로 한 IoT 데이터 저장을 위한 일괄 처리 방법은, 기준 편차에 따라 한번에 처리되는 데이터의 개수가 달라지므로, 기준 편차가 커짐에 따라 데이터의 처리량이 증가될 수 있다. In addition, in the batch processing method for storing IoT data based on blockchain, since the number of data processed at one time varies according to the standard deviation, the throughput of data can increase as the standard deviation increases.

전술한 구성을 갖는 본 발명에 따른 일괄 처리 방법을 적용함으로써, 블록체인 네트워크의 탈중앙성 및 보안성을 그대로 유지하면서 확장성을 향상시킬 수 있게 된다. By applying the batch processing method according to the present invention having the above configuration, it is possible to improve the scalability while maintaining the decentralization and security of the blockchain network.

도 1은 블록체인 네트워크의 트릴레마를 도시한 모식도이다.
도 2는 사물인터넷 장치에 블록체인 네트워크를 직접 연동하는 시스템을 예시적으로 도시한 구성도이다.
도 3은 사물인터넷 플랫폼과 블록체인 네트워크를 연결하는 시스템을 예시적으로 도시한 구성도이다.
도 4는 본 발명의 바람직한 실시예에 따른 IoT 데이터 저장에 대한 일괄 처리 방법을 개략적으로 도시한 흐름도이다.
도 5는 본 발명의 바람직한 실시예에 따른 IoT 데이터 저장에 대한 일괄 처리 방법을 구현하기 위한 일괄 처리 알고리즘을 도시한 흐름도이다.
도 6은 본 발명의 바람직한 실시예에 따른 IoT 데이터 저장에 대한 일괄 처리 방법에 있어서, 이상치 탐지 알고리즘을 도시한 흐름도이다.
도 7은 본 발명의 바람직한 실시예에 따른 IoT 데이터 저장에 대한 일괄 처리 방법에 있어서, 이상치 탐지를 통한 데이터 일괄 처리 과정을 도시한 흐름도이다.
도 8은 본 발명의 바람직한 실시예에 따른 IoT 데이터 저장에 대한 일괄 처리 방법에 있어서, 사용자 규칙 기반의 데이터 필터링 알고리즘을 도시한 코드이다.
도 9는 본 발명의 바람직한 실시예에 따른 IoT 데이터 저장에 대한 일괄 처리 방법에 있어서, 데이터개수에 따른 저장 공간 크기 비교 그래프이다.
도 10은 본 발명의 바람직한 실시예에 따른 IoT 데이터 저장에 대한 일괄 처리 방법에 있어서, 기준 편차 크기에 따른 배치 개수 비교 그래프이다.
도 11은 본 발명의 바람직한 실시예에 따른 IoT 데이터 저장에 대한 일괄 처리 방법에 있어서, 기준 편차 크기에 따른 데이터 처리량 비교 그래프이다.
도 12는 본 발명의 바람직한 실시예에 따른 IoT 데이터 저장에 대한 일괄 처리 방법에 있어서, 기준 편차 크기에 따른 이상치 탐지 확률 그래프이다.
1 is a schematic diagram showing the trilemma of a blockchain network.
2 is a configuration diagram illustrating a system for directly linking a blockchain network to an IoT device as an example.
3 is a configuration diagram illustrating a system for connecting an IoT platform and a blockchain network as an example.
4 is a flowchart schematically illustrating a batch processing method for IoT data storage according to a preferred embodiment of the present invention.
5 is a flowchart illustrating a batch processing algorithm for implementing a batch processing method for IoT data storage according to a preferred embodiment of the present invention.
6 is a flowchart illustrating an outlier detection algorithm in a batch processing method for IoT data storage according to a preferred embodiment of the present invention.
7 is a flowchart illustrating a data batch processing process through outlier detection in a batch processing method for IoT data storage according to a preferred embodiment of the present invention.
8 is a code showing a user rule-based data filtering algorithm in a batch processing method for IoT data storage according to a preferred embodiment of the present invention.
9 is a storage space size comparison graph according to the number of data in a batch processing method for IoT data storage according to a preferred embodiment of the present invention.
10 is a graph comparing the number of batches according to the standard deviation size in the batch processing method for IoT data storage according to a preferred embodiment of the present invention.
11 is a data throughput comparison graph according to a standard deviation size in a batch processing method for IoT data storage according to a preferred embodiment of the present invention.
12 is an outlier detection probability graph according to standard deviation size in a batch processing method for IoT data storage according to a preferred embodiment of the present invention.

이하, 첨부된 도면을 참조하여 본 발명의 바람직한 실시예에 따른 IoT 데이터의 저장에 대한 일괄 처리 방법 및 이를 이용한 블록체인을 기반으로 한 IoT 시스템에 대하여 구체적으로 설명한다. Hereinafter, with reference to the accompanying drawings, a batch processing method for storing IoT data according to a preferred embodiment of the present invention and a blockchain-based IoT system using the same will be described in detail.

본 발명에 따른 IoT 시스템은, 사물인터넷 기기들과 연결된 사물인터넷 플랫폼, 블록체인 노드들로 이루어진 블록체인 네트워크, 상기 사물인터넷 플랫폼과 블록체인 네트워크를 연결하는 블록체인 프록시 서버로 이루어진다. 상기 사물인터넷 플랫폼은 사물인터넷 기기들로부터 발생된 IoT 데이터들이 실시간으로 수신되면, 후술하는 IoT 데이터의 저장에 대한 일괄 처리 방법을 통해 블록체인 네트워크의 블록체인에 저장하게 된다. 본 발명에 따른 사물인터넷 플랫폼은, IoT 데이터들에 대하여 이상치 탐지 함수를 실행하여 IoT 데이터가 이상치인지 정상값인지 여부를 판단하며, 정상값이면 임시 버퍼에 순차적으로 저장하여 일괄처리할 수 있도록 하며, 이상치이면 현재 데이터 및 임시 버퍼에 저장된 이전 데이터들을 문자 스트링으로 나열하여 블록체인 프록시 서버로 전송한다. 블록체인 프록시 서버는 사물인터넷 플랫폼으로부터 전송받은 문자 스트링을 매개 변수로 하여 일괄 처리용 스마트 컨트랙트를 호출한다. 일괄 처리용 스마트 컨트랙트는 문자 스트링의 형태로 전달받은 이상치와 이전 데이터들을 사전 설정된 규칙에 따라 분류하여, 이상치는 블록체인에 저장하고 정상값들은 외부 데이터베이스에 저장한다. The IoT system according to the present invention includes an IoT platform connected to IoT devices, a blockchain network composed of blockchain nodes, and a blockchain proxy server connecting the IoT platform and the blockchain network. When the IoT data generated from the IoT devices are received in real time, the IoT platform stores them in the blockchain of the blockchain network through a batch processing method for storing IoT data described later. The IoT platform according to the present invention executes an outlier detection function on IoT data to determine whether the IoT data is an outlier or a normal value, and if the IoT data is a normal value, it is sequentially stored in a temporary buffer for batch processing, If it is an outlier, the current data and previous data stored in the temporary buffer are listed as character strings and transmitted to the blockchain proxy server. The blockchain proxy server calls the smart contract for batch processing with the character string transmitted from the IoT platform as a parameter. Smart contracts for batch processing classify outliers and previous data received in the form of character strings according to preset rules, and store outliers in the blockchain and normal values in an external database.

이하, 본 발명에 따른 IoT 데이터 저장을 위한 일괄 처리 방법에 대하여 구체적으로 설명한다. Hereinafter, a batch processing method for storing IoT data according to the present invention will be described in detail.

도 4는 본 발명의 바람직한 실시예에 따른 IoT 데이터 저장에 대한 일괄 처리 방법을 개략적으로 도시한 흐름도이다. 도 4를 참조하면, 본 발명에 따른 IoT 데이터 저장에 대한 일괄 처리 방법은, 지수 이동 평균(EMA, Exponential Moving Average)을 이용하여 실시간으로 발생하는 데이터의 일괄 처리(Batch Processing) 기준을 정하는 것으로서, IoT 네트워크로부터 실시간으로 IoT 데이터를 받아와서, 데이터 전처리후에 스마트 컨트랙트를 호출하여 블록체인 네트워크에 저장하거나 외부의 데이터베이스에 저장한다. 4 is a flowchart schematically illustrating a batch processing method for IoT data storage according to a preferred embodiment of the present invention. Referring to FIG. 4, the batch processing method for IoT data storage according to the present invention uses exponential moving average (EMA) to determine batch processing standards for data generated in real time, It receives IoT data in real time from the IoT network, calls a smart contract after preprocessing the data, and saves it in the blockchain network or in an external database.

본 발명에 있어서, 이동평균을 구하기 위한 배치 사이즈는 N으로 정의한다. 시점 t에서 발생한 데이터는 datat로 정의하여 이에 따라 현재 데이터의 지수 이동 평균값과 이동 기준 편차값은 차례로 EMAt, EMSt로 구분한다. 지수 이동 평균값, 이동 기준 편차값 및 이상치는 아래의 수학식 1, 2, 3에 의해 각각 얻을 수 있다. In the present invention, the batch size for obtaining the moving average is defined as N. The data generated at time t is defined as data t , and accordingly, the exponential moving average value of the current data and the moving reference deviation value are sequentially classified as EMA t and EMS t . The exponential moving average value, the moving standard deviation value, and the outlier value can be obtained by Equations 1, 2, and 3 below, respectively.

Figure 112020095173180-pat00001
Figure 112020095173180-pat00001

Figure 112020095173180-pat00002
Figure 112020095173180-pat00002

Figure 112020095173180-pat00003
Figure 112020095173180-pat00003

스마트 컨트랙트는 함수 매개 변수로 배열을 받을 수 없기 때문에, 하나의 값이 아닌 일괄 처리가 필요한 데이터는 문자 열(String) 형태로 변환하여 전달한다. 따라서, 본 발명에서는 일괄 처리된 문자열을 batch string이라고 정의하며, 컨트랙트 내에서 문자열을 파싱하여 배열에 저장하게 된다. Since smart contracts cannot receive an array as a function parameter, data that requires batch processing rather than a single value is converted into a string form and transmitted. Therefore, in the present invention, the batch-processed string is defined as a batch string, and the string is parsed and stored in an array within the contract.

먼저, 초기 단계에서는, 일괄 처리를 진행하기 전에 사용자가 정한 일정 기간 만큼의 데이터가 모일 때까지 기다린다. 이때, 초기 단계의 데이터는 서버의 임시 버퍼에 저장되며, 초기 단계에서의 이동 평균은 단순 이동 평균 방법을 통해 초기 평균값이 구해진다. 초기 평균값이 구해진 이후의 데이터는 지수 이동 평균 방법을 이용하여 최신 데이터에 가중치를 두어 평균값을 구하게 된다. First, in the initial stage, it waits until data for a certain period set by the user is collected before performing batch processing. At this time, the data of the initial stage is stored in a temporary buffer of the server, and the initial average value of the moving average in the initial stage is obtained through a simple moving average method. After the initial average value is obtained, the average value is obtained by weighting the latest data using the exponential moving average method.

다음, 현재 데이터의 이동 평균값과 이전 데이터의 편차의 크기를 비교하여 이상치를 탐지하게 된다. 이상치 탐지 과정을 통해 데이터를 함께 처리할 지, 하나의 값을 보낼지 결정된 후, 일괄 처리용 스마트 컨트랙트로 값이 전달된다. 이때, 일괄 처리용 스마트 컨트랙트로 전달된 값은 사용자에 의해 사전 설정된 규칙에 따라 저장 공간이 블록체인과 외부 데이터베이스로 나뉘게 된다. Next, an outlier is detected by comparing the moving average value of the current data and the size of the deviation of the previous data. Through the outlier detection process, it is decided whether to process the data together or send a single value, and then the value is delivered to the smart contract for batch processing. At this time, the value passed to the smart contract for batch processing is divided into a block chain and an external database according to the rules set by the user.

도 5는 본 발명의 바람직한 실시예에 따른 IoT 데이터 저장에 대한 일괄 처리 방법을 구현하기 위한 일괄 처리 알고리즘을 도시한 흐름도이다. 5 is a flowchart illustrating a batch processing algorithm for implementing a batch processing method for IoT data storage according to a preferred embodiment of the present invention.

도 5를 참조하면, 본 발명에 있어서, 일괄 처리하는 기준은 이상치를 탐지하기 전과 후로 구분이 되며, 실시간으로 발생하는 데이터가 이상치가 아니면 임시 버퍼에 데이터들을 모아두었다가, 이상치가 발생한 순간에 데이터들을 일괄 처리하게 된다. 처리되는 데이터는 이상치인 현재 측정값과 현재 측정값 이전까지 모아진 데이터들로서, 이들은 일괄 처리용 스마트 컨트랙트로 보내게 된다. Referring to FIG. 5, in the present invention, the criterion for batch processing is divided into before and after detecting an outlier. batch processing. The data to be processed are the current measurement value, which is the outlier, and the data collected before the current measurement value, which are sent to the smart contract for batch processing.

본 발명에 있어서, 지수 이동 평균 방법을 적용할 때, a 값에 따라 최근 데이터의 가중치가 결정된다. 본 발명에서는 일반적으로 많이 사용되는 a 값을 2/(N+1) 로 정의한다. 초기 데이터의 양이 배치 사이즈(N)보다 작을 경우, 임시 버퍼에 N 만큼 데이터가 발생할 때까지 기다린 후, 초기 평균은 단순 이동 평균을 통해 초기 평균값을 구한다. 초기 평균값이 구해진 이후 발생되는 데이터는 지수 이동 평균 방법에 따라 가중치를 두어 평균값을 구한다. 초기 평균값이 설정되면 이상치 탐지 함수(Outlier Detection)를 호출하여 현재 데이터의 값이 기존 데이터보다 편차가 큰 데이터인지 아니면 정상값인지를 판단하여 결과값에 따라 데이터의 처리방식이 정해진다. 이상치 탐지 함수의 반환값이 TRUE 이면 해당 데이터의 값과 그 이전까지의 일괄 처리된 데이터들의 문자열을 컨트랙트의 매개변수로 전달된다. 이상치 탐지 함수의 반환값이 FALSE 이면 이상치가 탐지되지 않은 것이므로 기존 일괄 처리된 데이터에 현재 데이터를 추가한다. 이를 통해, 이상치가 탐지되는 경우에만 컨트랙트를 호출함으로써, 컨트랙트 호출시 발생되는 하나의 트랜잭션에서 여러 개의 데이터를 담게 되어 처리 시간이 향상될 수 있다. In the present invention, when the exponential moving average method is applied, the weight of recent data is determined according to the value of a. In the present invention, a commonly used value of a is defined as 2/(N+1). If the amount of initial data is smaller than the batch size (N), after waiting until data as much as N is generated in the temporary buffer, the initial average is obtained through simple moving average. Data generated after the initial average value is obtained is averaged by weighting according to the exponential moving average method. When the initial average value is set, an outlier detection function is called to determine whether the current data value has a larger deviation than the existing data or whether it is a normal value, and the data processing method is determined according to the result value. If the return value of the outlier detection function is TRUE, the value of the data and the string of batch-processed data up to that point are passed as parameters of the contract. If the return value of the outlier detection function is FALSE, the outlier is not detected, so the current data is added to the existing batched data. Through this, by calling the contract only when an outlier is detected, processing time can be improved by including multiple data in one transaction that occurs when calling the contract.

데이터를 처리할 때 기존의 데이터의 추세와 크게 차이가 나는 값은 데이터를 분석하는 데 있어 왜곡된 결과를 얻을 수 있다. 정확한 분석 결과를 얻기 위해서는 실시간으로 발생하는 센서 데이터의 이상치를 측정하는 것이 중요하다. 본 발명에서는 이상치를 탐지하기 위하여 일정 기간 구해진 지수 이동 평균과 현재 데이터의 편차를 활용한다. When processing data, a value that is significantly different from the trend of the existing data may lead to distorted results in analyzing the data. In order to obtain accurate analysis results, it is important to measure outliers in sensor data that occur in real time. In the present invention, the deviation between the exponential moving average obtained for a certain period and the current data is used to detect an outlier.

도 6은 본 발명의 바람직한 실시예에 따른 IoT 데이터 저장에 대한 일괄 처리 방법에 있어서, 이상치 탐지 알고리즘을 도시한 흐름도이다. 도 7은 본 발명의 바람직한 실시예에 따른 IoT 데이터 저장에 대한 일괄 처리 방법에 있어서, 이상치 탐지를 통한 데이터 일괄 처리 과정을 도시한 흐름도이다. 6 is a flowchart illustrating an outlier detection algorithm in a batch processing method for IoT data storage according to a preferred embodiment of the present invention. 7 is a flowchart illustrating a data batch processing process through outlier detection in a batch processing method for IoT data storage according to a preferred embodiment of the present invention.

도 6 및 도 7을 참조하면, 본 발명에 따른 방법에서는 이상치를 탐지하기 위하여 비교하는 기준 편차의 크기는 사용자에 의해 사전 설정된 민감도 비율에 따라 달라진다. n 값이 작을수록 이상치라고 판단하는 경우가 많아지며, n 값이 클수록 정상치로 판단되는 경우가 많아져, 일괄 처리되는 데이터의 양이 많아진다. 따라서, 데이터의 특성에 맞게 값의 편차에 따라 값을 적절하게 조정되어야 한다. Referring to FIGS. 6 and 7 , in the method according to the present invention, the size of the standard deviation to be compared to detect an outlier varies according to a sensitivity ratio preset by a user. The smaller the value of n, the more cases determined as outliers, and the larger the value of n, the more cases determined as normal values, increasing the amount of batch-processed data. Therefore, the value should be appropriately adjusted according to the deviation of the value according to the characteristics of the data.

본 발명에서는 데이터의 저장 공간을 블록체인과 외부 데이터베이스로 구분한다. 도 8에 따라 데이터를 저장할 곳을 결정하게 된다. In the present invention, the storage space of data is divided into a block chain and an external database. According to FIG. 8, a location to store data is determined.

도 8은 본 발명의 바람직한 실시예에 따른 IoT 데이터 저장에 대한 일괄 처리 방법에 있어서, 사용자 규칙 기반의 데이터 필터링 알고리즘을 도시한 코드이다. 도 8은 스마트 컨트랙트 내 진행되는 코드를 나태내며, 사용자가 처음 지정한 규칙에 따라 부합되는 데이터는 블록체인에 저장되며, 외부 데이터베이스에는 이상치를 제외한 정상값들이 배치 형태로 저장된다. 데이터의 형태는 데이터가 생성된 시간(TIMESTAMP)과 현재 데이터의 값이 저장된다. 8 is a code showing a user rule-based data filtering algorithm in a batch processing method for IoT data storage according to a preferred embodiment of the present invention. Figure 8 shows the code in progress in the smart contract, and the data that meets the rules initially specified by the user are stored in the blockchain, and normal values excluding outliers are stored in batches in an external database. As for the type of data, the time the data was created (TIMESTAMP) and the value of the current data are stored.

본 발명에서 제안한 방법에 따른 연속적인 데이터 처리를 위한 성능 측정을 위해 기준 편차의 크기와 데이터 개수에 따라 처리되는 시간 및 저장 공간의 변화에 대한 실험을 진행함으로써, 일괄 처리와 개별 처리에 따른 저장 공간과 처리 시간의 비교를 통해 본 발명에 따른 방법의 효율성을 평가한다. In order to measure the performance for continuous data processing according to the method proposed in the present invention, an experiment is conducted on the change in processing time and storage space according to the size of the standard deviation and the number of data, and the storage space according to batch processing and individual processing. Efficiency of the method according to the present invention is evaluated by comparing the processing time and the processing time.

먼저, 데이터 개수에 따라 기존의 방법에 따라 개별 처리했을 때의 저장 공간과 본 발명에 따라 일괄 처리했을 때의 저장 공간을 비교한다. 도 9는 본 발명의 바람직한 실시예에 따른 IoT 데이터 저장에 대한 일괄 처리 방법에 있어서, 데이터개수에 따른 저장 공간 크기 비교 그래프이다. 도 9를 참조하면, 개별 처리 했을 경우 double형으로 데이터를 저장하여 (8 byte*데이터 개수)만큼의 저장 공간을 차지했다면, 본 발명에 따라 일괄 처리한 경우 해당 데이터의 유효 숫자를 제외후 데이터를 처리하기 때문에, 기존 방법보다 일괄 처리된 총 데이터의 크기가 평균 약 24% 감소했다. First, the storage space when individually processed according to the existing method according to the number of data is compared with the storage space when collectively processed according to the present invention. 9 is a storage space size comparison graph according to the number of data in a batch processing method for IoT data storage according to a preferred embodiment of the present invention. Referring to FIG. 9, in the case of individual processing, if data is stored in double type and occupies a storage space of (8 bytes * number of data), in the case of batch processing according to the present invention, the data after excluding the significant digits of the data processing, the size of the total batched data was reduced by about 24% on average compared to the existing method.

다음, 기준 편차 크기에 따라 일괄 처리될 수 있는 배치개수의 변화에 대해 살펴본다. 본 발명에 따른 방법은 이상치를 탐지함에 따라 한번에 처리될 수 있는 데이터의 개수가 정해진다. 이상치가 탐지되지 않을 때는 계속해서 배치 스트링에 해당 데이터를 추가하다가 이상치를 탐지된 순간 이상치와 이전 정상 데이터를 한번에 컨트랙트에 전달한다. 이때, 기준 편차의 크기에 따라 이상치를 탐지하는 횟수가 정해지는 데, 이상치를 탐지하기 위하여 지정한 편차의 크기가 크면 이상치를 탐지하는 횟수가 적어지며(false positive), 편차가 작을 때는 이상치를 탐지하는 횟수가 증가한다. 도 10은 본 발명의 바람직한 실시예에 따른 IoT 데이터 저장에 대한 일괄 처리 방법에 있어서, 기준 편차 크기에 따른 배치 개수 비교 그래프이다. 도 10을 참조하면, 기준 편차의 크기에 따라 이상치를 탐지하는 비율이 달라지는데, 기준 편차의 크기를 너무 낮게 잡으면 이상치를 탐지하는 횟수가 증가한다(false positive). 또한, 기준 편차의 크기를 너무 높게 잡으면 이상치를 정상값으로 판단하는 경우가 증가한다(false negative). 따라서 기준 편차의 크기가 이상치를 탐지하는 민감도를 결정함을 알 수 있다. Next, we look at the change in the number of batches that can be batch-processed according to the size of the standard deviation. In the method according to the present invention, the number of data that can be processed at one time is determined by detecting an outlier. When an outlier is not detected, the corresponding data is continuously added to the batch string, and the moment an outlier is detected, the outlier and previous normal data are delivered to the contract at once. At this time, the number of times to detect outliers is determined according to the size of the standard deviation. the number of times increases 10 is a graph comparing the number of batches according to the standard deviation size in the batch processing method for IoT data storage according to a preferred embodiment of the present invention. Referring to FIG. 10 , the rate at which an outlier is detected varies according to the size of the standard deviation. If the size of the standard deviation is set too low, the number of times an outlier is detected increases (false positive). In addition, if the size of the standard deviation is set too high, the number of cases in which an outlier is judged as a normal value increases (false negative). Therefore, it can be seen that the size of the standard deviation determines the sensitivity of detecting outliers.

다음, 기준 편차 크기에 따른 실제 처리 시간을 비교한다. 도 11은 본 발명의 바람직한 실시예에 따른 IoT 데이터 저장에 대한 일괄 처리 방법에 있어서, 기준 편차 크기에 따른 데이터 처리량 비교 그래프이다. 도 11을 참조하면, 기존 방법은 하나의 트랜잭션에 하나의 데이터만 처리할 경우를 나타내는 것으로서, 기준 편차와 상관없이 동일한 데이터 처리량을 갖는다. 반면에, 본 발명에 따른 방법은 기준 편차에 따라 한번에 처리되는 데이터의 개수가 달라지므로 편차가 커짐에 따라 데이터의 처리량이 증가됨을 확인할 수 있다. Next, the actual processing time according to the size of the standard deviation is compared. 11 is a data throughput comparison graph according to a standard deviation size in a batch processing method for IoT data storage according to a preferred embodiment of the present invention. Referring to FIG. 11, the existing method shows a case of processing only one data per transaction, and has the same data throughput regardless of the standard deviation. On the other hand, in the method according to the present invention, since the number of data processed at one time varies according to the standard deviation, it can be seen that the throughput of data increases as the deviation increases.

한편, 앞서 설명한 바와 같이, 기준 편차의 크기와 한번에 처리되는 데이터의 크기는 비례한다. 즉, 기준 편차의 크기가 커지면 이상치 탐지 횟수가 적어져 정상값으로 분류되는 데이터가 많아 일괄 처리량이 많아지기 때문이다. 실험을 통해, 기존 데이터에 임의로 이상치 값 100개를 넣어 본 발명에 따른 방법의 이상치 탐지율을 통한 데이터 신뢰도를 측정했다. 도 12는 본 발명의 바람직한 실시예에 따른 IoT 데이터 저장에 대한 일괄 처리 방법에 있어서, 기준 편차 크기에 따른 이상치 탐지 확률 그래프이다. 도 12를 참조하면, 기준 편차의 크기를 너무 크게 잡으면 이상치 탐지율이 낮아지는 것을 확인할 수 있다. Meanwhile, as described above, the size of the standard deviation is proportional to the size of data processed at one time. That is, as the size of the standard deviation increases, the number of outlier detections decreases, and the number of data classified as normal values increases, thereby increasing the amount of batch processing. Through experiments, data reliability was measured through the outlier detection rate of the method according to the present invention by randomly inserting 100 outlier values into the existing data. 12 is an outlier detection probability graph according to standard deviation size in a batch processing method for IoT data storage according to a preferred embodiment of the present invention. Referring to FIG. 12 , it can be seen that the outlier detection rate decreases when the size of the standard deviation is too large.

이상에서 본 발명에 대하여 그 바람직한 실시예를 중심으로 설명하였으나, 이는 단지 예시일 뿐 본 발명을 한정하는 것이 아니며, 본 발명이 속하는 분야의 통상의 지식을 가진 자라면 본 발명의 본질적인 특성을 벗어나지 않는 범위에서 이상에 예시되지 않은 여러 가지의 변형과 응용이 가능함을 알 수 있을 것이다. 그리고, 이러한 변형과 응용에 관계된 차이점들은 첨부된 청구 범위에서 규정하는 본 발명의 범위에 포함되는 것으로 해석되어야 할 것이다. Although the present invention has been described above with reference to preferred embodiments, this is only an example and does not limit the present invention, and those skilled in the art to which the present invention belongs will not deviate from the essential characteristics of the present invention. It will be appreciated that various modifications and applications not exemplified above are possible within the range. And, differences related to these variations and applications should be construed as being included in the scope of the present invention defined in the appended claims.

Claims (10)

(a) IoT 네트워크 시스템으로부터 발생되는 IoT 데이터를 제공받는 단계;
(b) 상기 IoT 데이터에 대한 초기 평균값을 설정하는 단계;
(c) 상기 IoT 데이터가 초기 평균값을 설정한 이후에 제공된 데이터이면, 사전 설정된 이상치 탐지 알고리즘에 따라 상기 제공된 상기 IoT 데이터가 이상치인지 여부를 판단하는 단계;
(d) 상기 IoT 데이터가 이상치가 아니면, 임시 버퍼에 순차적으로 저장하여 일괄 처리하는 단계;
(e) 상기 IoT 데이터가 이상치이면, 현재 IoT 데이터와 임시 버퍼에 저장된 이전 IoT 데이터들을 모아서 일괄 처리용 스마트 컨트랙트로 전송하는 단계; 및
(f) 상기 일괄 처리용 스마트 컨트랙트에 의해, 상기 전송된 현재 IoT 데이터와 이전 IoT 데이터들은, 사전 설정된 규칙에 따라 분류되고, 상기 전송된 데이터들 중 이상치인 현재 IoT 데이터는 블록으로 생성되어 블록체인에 저장되며, 정상값인 이전 IoT 데이터들은 외부 데이터베이스에 저장되는 단계;
를 구비하여 시계열 IoT 데이터들을 일괄 처리하는 것을 특징으로 하는 블록체인을 기반으로 한 IoT 데이터의 저장을 위한 일괄 처리 방법.
(a) receiving IoT data generated from the IoT network system;
(b) setting an initial average value for the IoT data;
(c) if the IoT data is data provided after setting an initial average value, determining whether the provided IoT data is an outlier according to a preset outlier detection algorithm;
(d) if the IoT data is not an outlier, sequentially storing them in a temporary buffer and batch processing;
(e) if the IoT data is an outlier, collecting the current IoT data and previous IoT data stored in a temporary buffer and transmitting them to a smart contract for batch processing; and
(f) By the smart contract for batch processing, the transmitted current IoT data and previous IoT data are classified according to preset rules, and the current IoT data, which is an outlier among the transmitted data, is created as a block and chained Stored in, storing the previous IoT data of normal values in an external database;
A batch processing method for storing IoT data based on a block chain, characterized in that for batch processing time series IoT data.
제1항에 있어서, 상기 (b) 단계의 초기 평균값 설정 단계는,
상기 IoT 데이터가 초기 데이터이면, 임시 버퍼에 저장된 초기 데이터 양이 사전 설정된 배치 사이즈(N)보다 작을 경우, 임시 버퍼에 N 만큼 데이터가 발생될 때까지 기다린 후, 이동 평균을 통해 초기 평균값을 구하는 것을 특징으로 하는 블록체인을 기반으로 한 IoT 데이터의 저장을 위한 일괄 처리 방법.
The method of claim 1, wherein the initial average value setting step of step (b) is,
If the IoT data is initial data, if the amount of initial data stored in the temporary buffer is smaller than the preset batch size (N), waiting until N data is generated in the temporary buffer and then calculating the initial average through moving average Batch processing method for storage of IoT data based on the characterized blockchain.
제1항에 있어서, 상기 (c) 단계의 이상치 탐지 알고리즘은,
(b1) 상기 IoT 데이터에 대하여 지수 이동 평균 방법에 따라 가중치를 두어 평균값을 구하는 단계;
(b2) 현재 IoT 데이터의 이동 평균값과 이전 IoT 데이터의 편차의 크기와 사전 설정된 기준 편차값을 비교하여 이상치를 탐지하는 단계;
를 구비하는 것을 특징으로 하는 블록체인을 기반으로 한 IoT 데이터의 저장을 위한 일괄 처리 방법.
The method of claim 1, wherein the anomaly detection algorithm in step (c),
(b1) obtaining an average value by weighting the IoT data according to an exponential moving average method;
(b2) detecting an outlier by comparing a moving average value of the current IoT data with a deviation size of previous IoT data and a preset standard deviation value;
A batch processing method for storing IoT data based on a block chain, characterized in that it comprises a.
제3항에 있어서, 상기 기준 편차값은 이상치를 탐지하는 민감도에 따라 결정되는 것을 특징으로 하는 블록체인을 기반으로 한 IoT 데이터의 저장을 위한 일괄 처리 방법.The batch processing method for storing IoT data based on a block chain according to claim 3, wherein the reference deviation value is determined according to a sensitivity for detecting an outlier. 삭제delete 사물 인터넷 기기로부터 발생된 IoT 데이터를 실시간으로 수신하고, IoT 데이터에 대한 초기 평균값을 구하고, 상기 초기 평균값을 이용하여 사전 설정된 이상치 탐지 알고리즘에 따라 IoT 데이터가 이상치인지 여부를 판단하고, 판단 결과가 이상치가 아니면 현재 IoT 데이터를 임시 버퍼에 저장하고, 판단 결과가 이상치이면 현재 IoT 데이터 및 임시 버퍼에 저장된 이전 IoT 데이터들을 묶어서 블록체인 프록시 서버로 전송하여 일괄 처리하는 사물인터넷 플랫폼;
상기 사물 인터넷 플랫폼으로부터 현재 IoT 데이터 및 이전 IoT 데이터들이 전송되면, 상기 현재 IoT 데이터 및 이전 IoT 데이터들을 매개 변수로 하여 일괄 처리용 스마트 컨트랙트를 호출하는 블록체인 프록시 서비; 및
복수 개의 블록체인 노드들로 이루어지고, 일괄 처리용 스마트 컨트랙트를 구비하는 블록체인 네트워크;를 구비하고,
상기 일괄 처리용 스마트 컨트랙트는 현재 IoT 데이터 및 이전 IoT 데이터들이 매개변수로 입력되어 호출되면, 사전 설정된 규칙에 따라 매개 변수들을 분류하고, 상기 현재 IoT 데이터와 이전 IoT 데이터들 중 이상치인 현재 IoT 데이터는 블록으로 생성하여 블록체인에 저장하며, 정상값인 이전 IoT 데이터들은 외부 데이터베이스에 저장하는 것을 특징으로 하는 블록체인을 기반으로 한 사물인터넷 시스템.
IoT data generated from the IoT device is received in real time, an initial average value for the IoT data is obtained, and using the initial average value, it is determined whether or not the IoT data is an outlier according to a preset anomaly detection algorithm, and the determination result is abnormal. If it is not a value, the current IoT data is stored in a temporary buffer, and if the judgment result is an outlier, the current IoT data and previous IoT data stored in the temporary buffer are bundled and transmitted to a blockchain proxy server for batch processing. Internet of Things platform;
a blockchain proxy service that calls a smart contract for batch processing with the current IoT data and previous IoT data as parameters when the current IoT data and previous IoT data are transmitted from the IoT platform; and
A blockchain network consisting of a plurality of blockchain nodes and having a smart contract for batch processing;
When the smart contract for batch processing is called with current IoT data and previous IoT data input as parameters, the parameters are classified according to preset rules, and the current IoT data, which is an outlier among the current IoT data and previous IoT data, is An IoT system based on a block chain, characterized in that it is created as a block and stored in a block chain, and the previous IoT data, which is a normal value, is stored in an external database.
제6항에 있어서, 상기 사물인터넷 플랫폼은,
실시간으로 수신된 IoT 데이터가 초기 데이터이면, 임시 버퍼에 저장된 초기 데이터 양이 사전 설정된 배치 사이즈(N)보다 작을 경우, 임시 버퍼에 N 만큼 데이터가 발생될 때까지 기다린 후, 이동 평균을 통해 초기 평균값을 구하는 것을 특징으로 하는 블록체인을 기반으로 한 사물인터넷 시스템.
The method of claim 6, wherein the IoT platform,
If the IoT data received in real time is the initial data, if the amount of initial data stored in the temporary buffer is smaller than the preset batch size (N), after waiting until N data is generated in the temporary buffer, the initial average value through the moving average IoT system based on block chain, characterized in that for obtaining.
제6항에 있어서, 상기 이상치 탐지 알고리즘은,
상기 데이터에 대하여 지수 이동 평균 방법에 따라 가중치를 두어 평균값을 구하고, 현재 IoT 데이터의 이동 평균값과 이전 IoT 데이터의 편차의 크기와 사전 설정된 기준 편차값을 비교하여 이상치를 탐지하는 것을 특징으로 하는 블록체인을 기반으로 한 사물인터넷 시스템.
The method of claim 6, wherein the outlier detection algorithm,
Blockchain characterized in that the average value is obtained by weighting the data according to the exponential moving average method, and an outlier is detected by comparing the moving average value of the current IoT data with the size of the deviation of the previous IoT data and a preset standard deviation value. based IoT system.
제8항에 있어서, 상기 기준 편차값은 이상치를 탐지하는 민감도에 따라 결정되는 것을 특징으로 하는 블록체인을 기반으로 한 사물인터넷 시스템.

[Claim 9] The system of claim 8, wherein the reference deviation value is determined according to a sensitivity for detecting an anomaly.

삭제delete
KR1020200114760A 2020-09-08 2020-09-08 Batch processing method for storing continuous IoT data on the blockchain and system for storing IoT data using the method KR102507829B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020200114760A KR102507829B1 (en) 2020-09-08 2020-09-08 Batch processing method for storing continuous IoT data on the blockchain and system for storing IoT data using the method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020200114760A KR102507829B1 (en) 2020-09-08 2020-09-08 Batch processing method for storing continuous IoT data on the blockchain and system for storing IoT data using the method

Publications (2)

Publication Number Publication Date
KR20220032884A KR20220032884A (en) 2022-03-15
KR102507829B1 true KR102507829B1 (en) 2023-03-07

Family

ID=80817042

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020200114760A KR102507829B1 (en) 2020-09-08 2020-09-08 Batch processing method for storing continuous IoT data on the blockchain and system for storing IoT data using the method

Country Status (1)

Country Link
KR (1) KR102507829B1 (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140245071A1 (en) * 2009-06-22 2014-08-28 Johnson Controls Technology Company Automated fault detection and diagnostics in a building management system

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102041341B1 (en) 2017-09-14 2019-11-27 숭실대학교산학협력단 IoT Security System Based on the BlockChain and Security Method thereof
KR102137641B1 (en) * 2018-06-12 2020-07-27 주식회사 호윤 Transactional Batch Processing System and Method using Block Chain
KR102160664B1 (en) * 2018-08-13 2020-09-29 인제대학교 산학협력단 General Data Protection Regulation Complied Blockchain Architecture for Personally Identifiable Information Management
KR101992981B1 (en) 2018-12-07 2019-06-25 한전케이디엔 주식회사 IoT Platform System using IoT Herb and Block-Chain

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140245071A1 (en) * 2009-06-22 2014-08-28 Johnson Controls Technology Company Automated fault detection and diagnostics in a building management system

Also Published As

Publication number Publication date
KR20220032884A (en) 2022-03-15

Similar Documents

Publication Publication Date Title
US8611219B2 (en) Method of detecting anomalies in a communication system using symbolic packet features
CN114189347B (en) Data safety transmission method combining data granulation and gatekeeper
CN112235264A (en) Network traffic identification method and device based on deep migration learning
CN112653682B (en) Method and device for detecting block chain eclipse attack
CN113206860B (en) DRDoS attack detection method based on machine learning and feature selection
CN110430226B (en) Network attack detection method and device, computer equipment and storage medium
CN110572297A (en) Network performance evaluation method, server and storage medium
CN116684878B (en) 5G information transmission data safety monitoring system
CN112488299A (en) Neural network acquisition method and device
CN113705604A (en) Botnet flow classification detection method and device, electronic equipment and storage medium
KR102507829B1 (en) Batch processing method for storing continuous IoT data on the blockchain and system for storing IoT data using the method
CN116738354B (en) Method and system for detecting abnormal behavior of electric power Internet of things terminal
CN100493001C (en) Automatic clustering method for multi-particle size network under G bit flow rate
CN117009903A (en) Data anomaly detection method, device, equipment and storage medium
Roudière et al. Evaluating the Impact of Traffic Sampling on AATAC's DDoS Detection
Aljojo Network transmission flags data affinity-based classification by K-nearest neighbor
Oikawa et al. Density-based data selection and management for edge computing
CN114095265B (en) ICMP hidden tunnel detection method and device and computer equipment
CN115085948B (en) Network security situation assessment method based on improved D-S evidence theory
CN111586052B (en) Multi-level-based crowd sourcing contract abnormal transaction identification method and identification system
CN115018646B (en) IP distinguishing method and system based on virtual currency public network transaction originating node
CN118074861A (en) Method, device, equipment and storage medium for eliminating transmission redundancy
WO2019227227A1 (en) A method of digital signal feature extraction comprising multiscale analysis
Benova et al. Web server load prediction and anomaly detection from hypertext transfer protocol logs
CN118035927B (en) Multi-source data fusion method based on cloud computing

Legal Events

Date Code Title Description
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right
GRNT Written decision to grant