<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/resources/xsl/jats-html.xsl"?>
<article article-type="research-article" dtd-version="1.1" xml:lang="ko" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<front>
	<journal-meta>
		<journal-id journal-id-type="publisher-id">jkits</journal-id>
		<journal-title-group>
		<journal-title>한국지식정보기술학회 논문지</journal-title>
		<journal-title xml:lang="en">Journal of Knowledge Information Technology and Systems</journal-title>
		</journal-title-group>
		<issn pub-type="ppub">1975-7700</issn>
		<publisher>
		<publisher-name>한국지식정보기술학회</publisher-name>
		<publisher-name xml:lang="en">Korea Knowledge Information Technology Society</publisher-name>
		</publisher>
	</journal-meta>
	<article-meta>
		<article-id pub-id-type="publisher-id">jkits_2019_14_04_401</article-id>
		<article-id pub-id-type="doi">10.34163/jkits.2019.14.4.009</article-id>
		<article-categories>
			<subj-group>
				<subject>Research Article</subject>
			</subj-group>
		</article-categories>
		<title-group>
			<article-title>IoT 기반 스마트 디바이스의 서비스 구성</article-title>
			<trans-title-group xml:lang="en">
				<trans-title>An Agricultural IoT Service Configuration System Using Smart Devices</trans-title>
			</trans-title-group>
		</title-group>
		<contrib-group>
			<contrib contrib-type="author" xlink:type="simple">
				<name-alternatives>
					<name name-style="eastern">
						<surname>전</surname><given-names>병천</given-names>
					</name>
					<name name-style="western" xml:lang="en">
						<surname>Jeon</surname><given-names>Byoung-Chan</given-names>
					</name>
					</name-alternatives>
				<xref ref-type="aff" rid="A1"><sup>1</sup></xref>
			</contrib>
					<contrib contrib-type="author" xlink:type="simple">
				<name-alternatives>
					<name name-style="eastern">
						<surname>강</surname><given-names>다현</given-names>
					</name>
					<name name-style="western" xml:lang="en">
						<surname>Kang</surname><given-names>Da-Hyun</given-names>
					</name>
					</name-alternatives>
				<xref ref-type="aff" rid="A2"><sup>2</sup></xref>
				</contrib>
				<contrib contrib-type="author" xlink:type="simple">
				<name-alternatives>
					<name name-style="eastern">
						<surname>김</surname><given-names>기영</given-names>
					</name>
					<name name-style="western" xml:lang="en">
						<surname>Kim</surname><given-names>Ki-Young</given-names>
					</name>
					</name-alternatives>
				<xref ref-type="aff" rid="A3"><sup>2</sup></xref>
				</contrib>
					<contrib contrib-type="author" xlink:type="simple">
				<name-alternatives>
					<name name-style="eastern">
						<surname>이</surname><given-names>상정</given-names>
					</name>
					<name name-style="western" xml:lang="en">
						<surname>Lee</surname><given-names>Sang-Jeong</given-names>
					</name>
					</name-alternatives>
				<xref ref-type="aff" rid="A4"><sup>2</sup></xref>
				<xref ref-type="fn" rid="fn001"><sup>*</sup></xref>
				</contrib>
			</contrib-group>
		<aff-alternatives id="A1">
			<aff><sup>1</sup><italic>청운대학교 교양대학 교수</italic></aff>
			<aff xml:lang="en"><italic>Division of Liberal Arts, Chungwoon University</italic></aff>
		</aff-alternatives>
				<aff-alternatives id="A2">
			<aff><sup>2</sup>순천향대학교 <italic>컴퓨터학과 졸업</italic></aff>
			<aff xml:lang="en"><italic>Department of Computer Science and Engineering, Soonchunhyang University</italic></aff>
		</aff-alternatives>
				<aff-alternatives id="A3">
			<aff><sup>3</sup>순천향대학교 <italic>컴퓨터학과 박사수료</italic></aff>
			<aff xml:lang="en"><italic>Department of Computer Science and Engineering, Soonchunhyang University</italic></aff>
		</aff-alternatives>
				<aff-alternatives id="A4">
			<aff><sup>4</sup><italic>순천향대학교 컴퓨터학과 교수</italic></aff>
			<aff xml:lang="en"><italic>Department of Computer Science and Engineering, Soonchunhyang University</italic></aff>
		</aff-alternatives>
				<author-notes>
			<fn id="fn001"><label>*</label><p>Corresponding author is with the Department of computer science and engineering in Soonchunhyang University, 22 Soonchunhyang-ro, Sinchang-myeon, Asan-si, Chungcheongnam-do, 31538, KOREA. </p>
			<p><italic>E-mail address</italic>: <email>sjlee@sch.ac.kr</email></p></fn>
		</author-notes>
		<pub-date pub-type="ppub">
			<month>8</month>
			<year>2019</year>
		</pub-date>
		<volume>14</volume>
		<issue>4</issue>
		<fpage>401</fpage>
		<lpage>410</lpage>
		<history>
			<date date-type="received">
				<day>5</day>
				<month>7</month>
				<year>2019</year>
			</date>
			<date date-type="rev-recd">
				<day>5</day>
				<month>8</month>
				<year>2019</year>
			</date>
			<date date-type="accepted">
				<day>9</day>
				<month>8</month>
				<year>2019</year>
			</date>
		</history>
		<permissions>
			<copyright-statement>&#x00A9; 2019 KKITS All rights reserved</copyright-statement>
			<copyright-year>2019</copyright-year>
		</permissions>
		<abstract>
			<title>요약</title>
			<p>IoT 시장이 점차 확대됨에 따라 다양한 분야에서 IoT 서비스가 상용화되고 있다. 하지만 기존 IoT 응용들은 독점적인 프로토콜과 디바이스의 수직적 구성으로 구축되었다. 따라서 표준 프로토콜에 기반 한 IoT 기기의 초기화 및 등록, 사용자 요구에 충족하는 유연한 사용자 서비스 구성이 필요하다. 다양한 센서를 사용하여 환경 데이터를 수집하는 농업용 IoT 서비스에서 쉽고 효율적인 디바이스 관리와 사용자 서비스 구성이 더욱 중요하다. 본 논문에서는 효율적인 IoT 디바이스 관리 및 사용자 지향 서비스를 제공하는 스마트 디바이스를 설계하고, 이를 활용한 농업용 IoT 서비스를 구축하는 시스템을 제안한다. 제안된 디바이스는 확장이 용이한 MQTT 프로토콜 메시지를 사용하여 디바이스를 초기화하고, 센서 데이터를 수집 및 액추 에이터를 제어한다. 또한 사용자의 요구에 기반하여 등록된 디바이스의 유연한 서비스 구성을 위해 비주얼 IoT 응용 제작도구인 Node-RED를 사용하였다. 제안된 스마트 디바이스 서비스 구성 기법은 프로토타입 농업용 환경 센서의 서비스 구성에 적용하여 테스트하였다. 향후 농업의 생산성 향상을 위한 환경 센서, 시설 센서를 기반으로 한 시설물 제어 및 성장 환경관리 시스템, 노지 생산에 필요한 환경 센서와 관리시스템을 구축하고, 이들 스마트 디바이스의 정보를 빅데이터 플랫폼과 연동할 예정이다.</p>
		</abstract>
		<trans-abstract xml:lang="en">
			<title>ABSTRACT</title>
			<p>As the IoT market grows, IoT services are being commercialized in various fields. However, existing IoT applications are built with proprietary protocols and vertical configurations of devices. Therefore, it requires managing , such as initialization and registration, of IoT devices based on standard protocols and flexible user service configuration that satisfy user needs. It is more important in agricultural IoT services which collects environmental data with various sensors to configure devices and user services easily and efficiently. In this paper, we design smart devices which can be managed efficiently and provide user-oriented services. Also, agricultural IoT service configuration system is proposed using the devices. Proposed smart device uses MQTT protocol which is easy to expand the device to initialized, collect sensor data and control actuators. Also, Node-RED, which is a visual IoT application development tool, is used to construct flexible services based on user's needs. The prototype for the service configuration of agricultural environment sensors is implemented and tested using the proposed service configuration techniques. In the future, we will study environmental sensors for the improvement of agricultural productivity, facilities control and growth environment management system based on facility sensors. Also, big data platform will be implemented using the information of the smart devices.</p>
		</trans-abstract>
		<kwd-group kwd-group-type="author" xml:lang="en">
			<kwd>IoT</kwd>
			<kwd>Smart device</kwd>
			<kwd>MQTT</kwd>
			<kwd>IoT service configuration</kwd>
			<kwd>Node-RED</kwd>
			<kwd>Agricultural environment services</kwd>
		</kwd-group>
	</article-meta>
</front>
<body>
<sec id="sec001" sec-type="intro">
	<title>1. 서 론</title>
<p>최근 네트워크 기술의 발전으로 IoT에 대한 관심이 증가되고 있고, IoT(Internet of Things) 시장이 점차 확대되고 있다. 시장조사 업체 가트너에 따르면, 2020년이 되면 약 200억 대에 가까운 기기가 인터넷에 연결될 것으로 전망하였다<xref ref-type="bibr" rid="B001">[1]</xref>.</p>
<p>범국가적 농업혁신을 위해 주요 선진국들은 ICT(Information and Communications Technologies) 융합 확대(일본), 정보 연계 강화(미국), 안정적 공급망 구축(네덜란드), 정보 활용 확대(EU, 일본)의 4대 영역으로 농업 생산성·품질 향상을 목표로 농업경쟁력 향상에 주력하고 있다<xref ref-type="bibr" rid="B002">[2]</xref>. 국내 농업의 ICT융합은 다양한 첨단 기술 접목에도 불구하고 타 산업에 비해 초보적인 단계이며 활용도가 낮다. 이에 농림식품 분야 정보화는 주요 선진국의 4대 영역의 주요전략과 추진내용을 기반으로 농업과 ICT의 생산적·효율적 융합 확산을 진행하고 있다[<xref ref-type="bibr" rid="B002">2</xref>,<xref ref-type="bibr" rid="B003">3</xref>].</p>
<p>국내에서도 다양한 분야에서 IoT 서비스가 상용화되고 있다. 그러나 기존의 IoT 응용들은 독점적인 프로토콜과 디바이스의 수직적 구성으로 구축되었다. 또한 사용자는 단일 서비스 공급자에게 종속되어, 제한적인 서비스를 제공받고 있다<xref ref-type="bibr" rid="B004">[4]</xref>. 따라서 표준 프로토콜에 기반한 IoT 기기의 초기화 및 등록 등의 관리를 하여 사용자 요구에 충족하는 유연한 서비스의 구성이 가능한 IoT 시스템이 요구되고 있다<xref ref-type="bibr" rid="B005">[5]</xref>.</p>
<p>본 논문에서는 IoT 디바이스 관리 및 사용자 지향 서비스를 제공하는 MQTT(Message Queuing Telemetry Transport) 기반의 스마트 디바이스를 설계하고 이를 활용한 IoT 서비스를 구축하는 시스템을 제안한다. 스마트 디바이스는 별도의 부가 과정 없이 설치만으로 디바이스 초기화 과정을 실행하는 PNP(Plug And Play) 기능을 구현한다. 디바이스 초기화 과정은 MQTT 프로토콜 메시지를 사용하여 IoT 플랫폼에 초기화 메시지를 송신하고, 이후 수신된 응답 메시지를 바탕으로 센서 및 액추에이터의 토픽을 생성한 후 센서 데이터를 수집하고 액추에이터의 제어 메시지를 수신한다. 또한 사용자의 요구를 충족하는 서비스를 구성하기 위해 자동으로 사용자 소유의 디바이스 정보를 검색하고 이를 Node-RED 와 연동하여 사용자의 요구사항에 맞춘 서비스를 구성한다. 제안된 스마트 디바이스 서비스 구성 기법은 프로토타입 농업용 환경센서의 서비스 구성에 적용하여 테스트 한다.</p>
<p>본 논문의 구성은 다음과 같다. 2장에서는 서비스 구성에 사용한 기술에 대해 설명하고, 3장에서는 제안한 시스템의 서비스 구성에 대하여 설명한다. 4장에서는 구현 및 테스트를 통해 제안한 시스템의 동작을 검증하였다. 마지막으로 5장에서 결론을 맺는다.</p>
</sec>
<sec id="sec002">
<title>2. 이론적 배경</title>
<sec id="sec002-1">
<title>2.1 MQTT</title>
<p>MQTT는 M2M(Machine to Machine), IoT(Internet of Things) 환경 하에서 저전력, 낮은 대역폭 환경에서도 사용할 수 있도록 설계된 경량의 메시지 프로토콜이다<xref ref-type="bibr" rid="B006">[6]</xref>. MQTT는 배포/구독(publish/subcribe)의 메시지-지향 프로토콜이다. 브로커(broker)에 연결된 디바이스, 응용, 관리자 들이 특정 메시지 토픽의 메시지의 배포와 구독을 통해 서비스와 통신을 수행한다[<xref ref-type="bibr" rid="B007">7</xref>-<xref ref-type="bibr" rid="B011">11</xref>]. 메시지 전달은 구독자가 구독한 토픽과 발행자가 발행한 메시지의 토픽이 동일할 때 이루어진다. MQTT는 배포/구독 모델을 통해 적은 설치비용 및 규모에 비해 병렬 수행, 메시지 캐싱, 트리기반 또는 네트워크 기반 라우팅 등을 통해 전통적인 클라이언트-서버 구조보다 나은 확장성을 제공한다.</p>
</sec>
<sec id="sec002-2">
<title>2.2 Node-RED</title>
<p>Node-RED는 시각화된 IoT 응용 개발 도구이다<xref ref-type="bibr" rid="B012">[12]</xref>. 프로세서와 마찬가지로 Node-RED는 하드웨어 장치와 API를 연결하기 위한 웹 기반 도구로 브라우저 기반의 흐름 편집기를 제공한다<xref ref-type="bibr" rid="B013">[13]</xref>. Node.js 프레임워크를 사용하여 JavaScript으로 구현되어 Node.js 런타임에서 동작한다. Node.js의 라이브러리를 이용해 다른 응용 프로그램들과 연동이 용이하다. 또한 브라우저 상에서 노드를 연결하여 손쉽게 IoT 응용을 제작할 수 있고, 연결된 노드들은 JSON으로 저장되어 쉽게 가져오고 내보낼 수 있다.</p>
</sec>
</sec>
<sec id="sec003">
<title>3. MQTT 기반 스마트 디바이스의 IoT 서비스 구성</title>
<sec id="sec003-1">
<title>3.1 시스템 구조</title>
<p>&lt;<xref ref-type="fig" rid="f001">그림 1</xref>&gt;은 본 논문에서 설계한 MQTT 기반 스마트 디바이스의 IoT 서비스 구성의 시스템 구조도이다. 스마트 디바이스는 디바이스 에이전트(Device Agent)의 초기화 모듈을 통해 초기화 메시지를 발행한다. 초기화 과정을 거친 후 모든 디바이스는 공통적으로 센서값 수집 및 액추에이터 제어 서비스를 제공하는 자동 서비스 모듈(Auto Service)을 실행한다. 또한 사용자는 서비스 실행 모듈(Service Executor)를 통해 IoT 플랫폼의 서비스 구성 모듈(Service Configurator)에서 구성된 서비스를 실행한다.</p>
<p>IoT 플랫폼은 MQTT 메시지 큐를 통해 스마트 디바이스가 발행한 초기화 메시지 및 센서 값들을 수신한다. 초기화 메시지를 수신한 경우 디바이스 매니저의 질의 언어를 사용하여 디바이스의 정보를 디바이스 메타 정보 저장소(Device Meta Information Repository)에 질의하여 디바이스의 등록 여부를 판단한다. 등록된 디바이스에 한 해 응답메시지를 발행한다. 수신된 메시지가 센서값 일 경우 데이터를 센서 데이터 저장소(Sensor Data Repository)에 저장한다. 센서 데이터 저장소에 저장된 센서 값들은 서비스 매니저의 서비스 어플리케이션과 연결된 웹 인터페이스에서 모니터링 가능하다. 또한 사용자는 서비스 매니저의 서비스 구성 모듈에서 사용자가 원하는 서비스를 구성하고, 스마트 디바이스의 서비스 실행 모듈로 서비스를 배포한다.</p>
<fig id="f001" orientation="portrait" position="float">
	<label>그림 1.</label>
	<caption>
		<title>MQTT 기반 스마트 디바이스의 IoT 서비스 구성시스템 구조도</title>
		<p>Figure 1. IoT service configuration for MQTT-based smart device architecture</p>
	</caption>
	<graphic xlink:href="../ingestImageView?artiId=ART002497007&amp;imageName=jkits_2019_14_04_401_f001.jpg" position="float" orientation="portrait" xlink:type="simple"></graphic>
</fig>
</sec>
<sec id="sec003-2">
<title>3.2 서비스 시나리오</title>
<p>&lt;<xref ref-type="fig" rid="f002">그림 2</xref>&gt;은 MQTT 기반 스마트 디바이스의 IoT 서비스 구성 시스템의 농업용 서비스 시나리오이다. 농업용 스마트 디바이스 제조사에서는 스마트디바이스의 제조 후 디바이스의 정보를 IoT 플랫폼의 웹 인터페이스에서 등록한다. 스마트 디바이스가 설치되면 초기화 메시지를 IoT 플랫폼으로 전송하고 응답 메시지를 수신하여 디바이스를 초기화 한다. 사용자(Farmer)는 웹 인터페이스에 접속하여 소유한 디바이스의 MAC 주소와 디바이스가 설치된 위치를 등록한다. 등록된 위치 정보는 디바이스메타 정보 저장소에 저장되고 스마트 디바이스와 매핑된다.</p>
<fig id="f002" orientation="portrait" position="float">
	<label>그림 2.</label>
	<caption>
		<title>MQTT 기반 스마트 디바이스의 IoT 서비스 구성서비스 시나리오</title>
		<p>Figure 2. A Service Scenario of IoT Service Configuration with MQTT-based Smart Device</p>
	</caption>
	<graphic xlink:href="../ingestImageView?artiId=ART002497007&amp;imageName=jkits_2019_14_04_401_f002.jpg" position="float" orientation="portrait" xlink:type="simple"></graphic>
</fig>
<p>초기화 과정을 거친 후 사용자(Engineer)는 IoT 플랫폼의 서비스 구성 모듈에 접속해 사용자 ID를 통해 사용자가 소유한 디바이스이 정보를 바탕으로 서비스를 구성하고 스마트 디바이스의 서비스 실행 모듈에 배포한다. 사용자(Farmer)는 스마트 디바이스의 서비스 실행 모듈에 접속하여 구성된 서비스를 이용할 수 있다.</p>
</sec>
<sec id="sec003-3">
<title>3.3 스마트 디바이스</title>
<fig id="f003" orientation="portrait" position="float">
	<label>그림 3.</label>
	<caption>
		<title>스마트 디바이스의 초기화 메시지 흐름도</title>
		<p>Figure 3. Initialization message flow of smart device</p>
	</caption>
	<graphic xlink:href="../ingestImageView?artiId=ART002497007&amp;imageName=jkits_2019_14_04_401_f003.jpg" position="float" orientation="portrait" xlink:type="simple"></graphic>
</fig>
<table-wrap id="t001">
<label>표 1.</label>
<caption>
<title>스마트 디바이스의 초기화 및 IoT 플랫폼의 응답 토픽과 메시지 형식</title>
<p>Table 1. Topics and message format of initialization and response of a smart device</p>
</caption>
<table frame="box" rules="all" width="100%">
<tbody>
<tr align="center">
<td colspan="2">항목</td>
<td>형식</td>
</tr>
<tr align="center">
<td rowspan="2" valign="middle">초기화 메시지</td>
<td valign="middle">토픽</td>
<td>Init / Device MAC addr <p>ex) Init / 704D7B628EB4</p></td>
</tr>
<tr align="center">
<td>메시지</td>
<td>[센서/액추에이터1, … , 센서N]</td>
</tr>
<tr align="center">
<td rowspan="2" valign="middle">응답 메시지</td>
<td valign="middle">토픽</td>
<td>Init_response / Device MAC addr <p>ex) Init_response / 704D7B628EB4</p></td>
</tr>
<tr align="center">
<td valign="middle">메시지</td>
<td>{ 센서/액추에이터1 ID : 타입, <p>… ,</p> 센서/액추에이터 ID : 타입}</td>
</tr>
</tbody>
</table>
</table-wrap>
<p>&lt;<xref ref-type="fig" rid="f003">그림 3</xref>&gt;은 MQTT 기반 스마트 디바이스의 IoT서비스 구성 시스템 시나리오에서 초기화 과정의스마트 디바이스와 IoT 플랫폼 간에 전달되는 메시지 흐름을 나타낸 것이다. 스마트 디바이스는 설치되는 즉시 초기화 모듈을 실행하여, 연결된 센서/액추에이터에서 값이 수신되면 디바이스의 MAC 주소 값을 토픽에 포함하고, 센서/액추에이터 이름을 메시지로 갖는 MQTT 프로토콜 형식의 초기화 메시지를 생성하여 IoT 플랫폼으로 메시지를 발행한다. 초기화 메시지에 대한 응답 메시지에는 디바이스 ID 값과 연결된 센서/액추에이터 ID 및 타입을 포함한다. &lt;<xref ref-type="table" rid="t001">표 1</xref>&gt;은 스마트 디바이스의 초기화 단계에서 사용되는 메시지의 토픽과 형식을 나타낸 것이다.</p>
<p>스마트 디바이스에 응답 메시지가 수신되면 자동 서비스 모듈이 동작하여 디바이스 ID와 센서/액추에이터 ID값을 조합하여 토픽을 생성하고, 센서/액추에이터 타입에 따라 센서는 센서 토픽으로 데이터 메시지를 발행하고, 액추에이터는 액추에이터 토픽을 구독하여 제어 메시지를 수신한다. &lt;<xref ref-type="table" rid="t002">표 2</xref>&gt;는 스마트 디바이스의 자동 서비스 모듈에서 생성하는 센서 및 액추에이터의 토픽 형식을 나타낸 것이다.</p>
<table-wrap id="t002">
<label>표 2.</label>
<caption>
<title>스마트 디바이스의 센서 및 액추에이터 토픽 형식</title>
<p>Table 2. Sensor and actuator topics of a smart device</p>
</caption>
<table frame="box" rules="all" width="100%">
<tbody>
<tr align="center">
<td>항목</td>
<td>토픽 형식</td>
</tr>
<tr align="center">
<td>센서</td>
<td>Sensor / 디바이스ID / 센서ID</td>
</tr>
<tr align="center">
<td>액추에이터</td>
<td>Control / 디바이스ID / 액추에이터ID</td>
</tr>
</tbody>
</table>
</table-wrap>
</sec>
<sec id="sec003-4">
<title>3.4 서비스 구성</title>
<fig id="f004" orientation="portrait" position="float">
	<label>그림 4.</label>
	<caption>
		<title>서비스 구성 시퀀스 다이어그램</title>
		<p>Figure 4. A Sequence diagram of service configuration</p>
	</caption>
	<graphic xlink:href="../ingestImageView?artiId=ART002497007&amp;imageName=jkits_2019_14_04_401_f004.jpg" position="float" orientation="portrait" xlink:type="simple"></graphic>
</fig>
<p>&lt;<xref ref-type="fig" rid="f004">그림 4</xref>&gt;는 서비스 구성의 시퀀스 다이어그램이다. IoT 플랫폼의 서비스 구성 모듈은 사용자의 ID를 디바이스 메타 정보 저장소에 사용자 소유의 디바이스 정보를 질의한다. 질의 결과는 JSON 형식으로 사용자에게 전달된다. 사용자는 제공받은 정보를 이용하여 원하는 서비스를 구성한다. 구성된 서비스는 스마트 디바이스의 서비스 실행 모듈에 배포한다. 사용자는 서비스 실행 모듈을 통해 배포된 서비스를 이용 할 수 있다.</p>
<fig id="f005" orientation="portrait" position="float">
	<label>그림 5.</label>
	<caption>
		<title>디바이스 정보 조회 Node-RED 웹페이지</title>
		<p>Figure 5. A Node-RED web page for device information search</p>
	</caption>
	<graphic xlink:href="../ingestImageView?artiId=ART002497007&amp;imageName=jkits_2019_14_04_401_f005.jpg" position="float" orientation="portrait" xlink:type="simple"></graphic>
</fig>
<fig id="f006" orientation="portrait" position="float">
	<label>그림 6.</label>
	<caption>
		<title>JSON 형식의 디바이스 정보</title>
		<p>Figure 6. Device information with JSON format</p>
	</caption>
	<graphic xlink:href="../ingestImageView?artiId=ART002497007&amp;imageName=jkits_2019_14_04_401_f006.jpg" position="float" orientation="portrait" xlink:type="simple"></graphic>
</fig>
<p>&lt;<xref ref-type="fig" rid="f005">그림 5</xref>&gt;은 IoT 플랫폼의 서비스 구성 모듈에서 사용자의 ID를 디바이스 메타 정보 저장소에 질의하여 사용자가 소유한 디바이스의 정보를 나타내는 웹 페이지를 Node-RED로 구성한 것이다.</p>
<p>&lt;<xref ref-type="fig" rid="f006">그림 6</xref>&gt;은 IoT 플랫폼의 서비스 구성 모듈에서 사용자의 ID를 디바이스 메타 정보 저장소에 질의한 결과를 JSON 형식으로 반환한 예이다.</p>
</sec>
</sec>
<sec id="sec004">
<title>4. 구현 및 테스트</title>
<sec id="sec004-1">
<title>4.1 구현</title>
<p>본 논문의 스마트 디바이스에 연결된 센서들은 농촌진흥청에서 제공하는 농업기상 데이터를 크롤링하여 가상의 센서를 구현하였다<xref ref-type="bibr" rid="B014">[14]</xref>. 스마트 디바이스의 디바이스 초기화 모듈 및 자동 서비스 모듈은 파이썬 3을 사용하여 구현하였으며, 서비스 실행 모듈은 Node-RED 0.19.3 버전을 사용하였다. 라즈베리 파이3의 상세 스펙은 &lt;<xref ref-type="table" rid="t003">표 3</xref>&gt;과 같다.</p>
<table-wrap id="t003">
<label>표 3.</label>
<caption>
<title>라즈베리 파이3의 상세 스펙</title>
<p>Table 3. Detailed specifications of Raspberry Pi3</p>
</caption>
<table frame="box" rules="all" width="100%">
<tbody>
<tr align="center">
<td>항목</td>
<td>세부 스펙</td>
</tr>
<tr align="center">
<td>프로세서</td>
<td>BCM2837 64Bit Quad Core</td>
</tr>
<tr align="center">
<td>프로세서 속도</td>
<td>1.2 GHz</td>
</tr>
<tr align="center">
<td>메모리</td>
<td>1GB SDRAM @ 400MHz</td>
</tr>
<tr align="center">
<td>전원공급</td>
<td>5V/2.5A</td>
</tr>
</tbody>
</table>
</table-wrap>
<p>IoT 플랫폼의 MQTT 메시지 큐는 RabbitMQ 3.7.5 버전의 MQTT 플러그인을 사용하였다. 디바이스 메타 정보 저장소 및 센서 데이터 저장소는 실시간 저장 및 검색이 가능한 엘라스틱서치(Elasticsearch) 6.3.0버전을 사용하여 구현하였다<xref ref-type="bibr" rid="B015">[15]</xref>. 서비스 구성 모듈은 스마트 디바이스의 서비스 실행 모듈과 동일한 Node-RED 0.19.3 버전을 사용하였다. IoT 플랫폼의 하드웨어 사양은 &lt;<xref ref-type="table" rid="t004">표 4</xref>&gt;와 같다.</p>
<table-wrap id="t004">
<label>표 4.</label>
<caption>
<title>IoT 플랫폼 하드웨어 스펙</title>
<p>Table 4. Specification of IoT platform</p>
</caption>
<table frame="box" rules="all" width="100%">
<tbody>
<tr align="center">
<td>항목</td>
<td>세부 스펙</td>
</tr>
<tr align="center">
<td>CPU</td>
<td>Intel Core i3-4150</td>
</tr>
<tr align="center">
<td>RAM</td>
<td>8GB</td>
</tr>
<tr align="center">
<td>HDD</td>
<td>2TB</td>
</tr>
</tbody>
</table>
</table-wrap>
</sec>
<sec id="sec004-2">
<title>4.2 테스트</title>
<p>&lt;<xref ref-type="fig" rid="f007">그림 7</xref>&gt;은 실제 스마트 디바이스가 발행한 초기 화 메시지와 IoT 플랫폼의 응답 메시지를 나타낸다.</p>
<fig id="f007" orientation="portrait" position="float">
	<label>그림 7.</label>
	<caption>
		<title>스마트 디바이스 초기화 메시지 예</title>
		<p>Figure 7. An Example of smart device initializing message</p>
	</caption>
	<graphic xlink:href="../ingestImageView?artiId=ART002497007&amp;imageName=jkits_2019_14_04_401_f007.jpg" position="float" orientation="portrait" xlink:type="simple"></graphic>
</fig>
<p>&lt;<xref ref-type="fig" rid="f008">그림 8</xref>&gt;은 서비스 구성을 위해 사용자의 ID를 디바이스 메타 정보 저장소에 질의하여 사용자가 소유한 디바이스의 정보를 나타내는 웹 페이지를 나타낸다.</p>
<p>&lt;<xref ref-type="fig" rid="f009">그림 9</xref>&gt;은 Node-RED에 연동된 MQTT 노드를 사용해 센서의 토픽을 구독하고, 차트 대시보드 라이브러리를 사용해 센서 데이터 모니터링 서비스를 구성한 것이다. &lt;<xref ref-type="fig" rid="f010">그림 10</xref>&gt;은 구성된 서비스를 JSON으로 저장하고 IoT 플랫폼의 서비스 구성 모듈에서 sftp 라이브러리를 사용하여 스마트 디바이스의 서비스 실행 모듈로 전송하는 과정을 나타낸다. &lt;<xref ref-type="fig" rid="f011">그림 11</xref>&gt;은 수신된 서비스를 스마트 디바이스의 서비스 실행 모듈에서 실행하여 센서 데이터를 모니터링 한 예를 보여준다.</p>
<fig id="f008" orientation="portrait" position="float">
	<label>그림 8.</label>
	<caption>
		<title>서비스 구성을 위한 디바이스 정보 조회 웹페이지 예</title>
		<p>Figure 8. An Example of web page of device information search for service configuration</p>
	</caption>
	<graphic xlink:href="../ingestImageView?artiId=ART002497007&amp;imageName=jkits_2019_14_04_401_f008.jpg" position="float" orientation="portrait" xlink:type="simple"></graphic>
</fig>
<fig id="f009" orientation="portrait" position="float">
	<label>그림 9.</label>
	<caption>
		<title>센서 데이터 모니터링 Node-RED 웹페이지 예</title>
		<p>Figure 9. An Example of Node-RED web page monitoring sensor data</p>
	</caption>
	<graphic xlink:href="../ingestImageView?artiId=ART002497007&amp;imageName=jkits_2019_14_04_401_f009.jpg" position="float" orientation="portrait" xlink:type="simple"></graphic>
</fig>
<fig id="f010" orientation="portrait" position="float">
	<label>그림 10.</label>
	<caption>
		<title>스마트 디바이스에 서비스 구성 전송 예</title>
		<p>Figure 10. An Example of sending service configuration to a smart device</p>
	</caption>
	<graphic xlink:href="../ingestImageView?artiId=ART002497007&amp;imageName=jkits_2019_14_04_401_f010.jpg" position="float" orientation="portrait" xlink:type="simple"></graphic>
</fig>
<fig id="f011" orientation="portrait" position="float">
	<label>그림 11.</label>
	<caption>
		<title>센서 데이터 모니터링 웹페이지</title>
		<p>Figure 11. Sensor data monitoring web page</p>
	</caption>
	<graphic xlink:href="../ingestImageView?artiId=ART002497007&amp;imageName=jkits_2019_14_04_401_f011.jpg" position="float" orientation="portrait" xlink:type="simple"></graphic>
</fig>
</sec>
</sec>
<sec id="sec005" sec-type="Conclusions">
<title>5. 결 론</title>
<p>본 논문에서는 디바이스 관리 및 서비스를 제공하는 IoT 기반의 스마트 디바이스의 서비스를 설계 구현하였다.</p>
<p>스마트 디바이스는 설치 후 표준 IoT 프로토콜인 MQTT 프로토콜을 사용하여 자동으로 디바이스를 관리하고, 데이터를 수집하고 액추에이터를 제어하였다. 또한 IoT 플랫폼에 등록된 디바이스를 Node-RED와 연동하여 사용자의 요구에 맞춰 서비스를 구성하고, 스마트 디바이스의 서비스 실행 모듈에 배포하여 사용자가 스마트 디바이스에서 서비스를 제공받을 수 있게 구현하였다.</p>
<p>구현된 시스템은 기존의 IoT응용들의 독점적인 프로토콜과 디바이스의 수직적인 구성을 표준 프로토콜 기반으로 사용자 요구에 기반한 유연한 서비스를 제공할 수 있음을 검증하였다.</p>
<p>제안된 스마트 디바이스 서비스 구성 기법은 프로토타입 농업용 환경 센서의 서비스 구성에 적용하여 테스트하였다.</p>
<p>향후 농업의 생산성 향상을 위한 환경 센서, 시설 센서를 기반으로 한 시설물 제어 및 성장 환경관리 시스템, 노지 생산에 필요한 환경 센서와 관리 시스템, 센싱 기반의 축사환경 제어 및 관리 시스템을 구축하고, 이들 스마트 디바이스의 정보를 빅데이터 플랫폼과 연동할 예정이다.</p>
</sec>
</body>
<back>
<ref-list>
<title>References</title>
<!-- [1] Gartner, https://www.gartner.com/en/newsroom/press-releases/2017-02-07-gartner-says-8-billion-connected-things-will-be-in-use-in-2017-up-31-percent-from-2016, Oct. 2018.-->
<ref id="B001">
<label>[1]</label>
<element-citation publication-type="webpage" publication-format="web">
<year>2018</year>
<month>Oct.</month>
<source>Gartner, <uri>https://www.gartner.com/en/newsroom/press-releases/2017-02-07-gartner-says-8-billion-connected-things-will-be-in-use-in-2017-up-31-percent-from-2016</uri></source>
</element-citation>
</ref>
<!-- [2] https://www.nia.or.kr/site/nia_kor/ex/bbs/View.do?cbIdx=66361&bcIdx=13467&parentSeq=13467, Oct. 2018.-->
<ref id="B002">
<label>[2]</label>
<element-citation publication-type="webpage" publication-format="web">
<year>2018</year>
<month>Oct.</month>
<source><uri>https://www.nia.or.kr/site/nia_kor/ex/bbs/View.do?cbIdx=66361&#x26;bcIdx=13467&#x26;parentSeq=13467</uri></source>
</element-citation>
</ref>
<!-- [3] S. M. Kim, H. S. Choi, W.S. Rhee, IoT home gateway for auto-configuration and management of MQTT devices, IEEE Conference on Wireless Sensors, pp. 12-17, 2015.-->
<ref id="B003">
<label>[3]</label>
<element-citation publication-type="paper">
<person-group>
<name><surname>Kim</surname><given-names>S. M.</given-names></name>
<name><surname>Choi</surname><given-names>H. S.</given-names></name>
<name><surname>Rhee</surname><given-names>W.S.</given-names></name>
</person-group>
<year>2015</year>
<article-title>IoT home gateway for auto-configuration and management of MQTT devices</article-title>
<conf-name>IEEE Conference on Wireless Sensors</conf-name>
<fpage>12</fpage><lpage>17</lpage>
<pub-id pub-id-type="doi">10.1109/icwise.2015.7380346</pub-id>
</element-citation>
</ref>
<!-- [4] C. Zhou, X. Zhang, Toward the internet of things application and management: A practical approach. In: World of Wireless, Mobile and Multimedia Networks (WoWMoM), 2014 IEEE 15th International Symposium on a. IEEE, pp. 1-6. 2014.-->
<ref id="B004">
<label>[4]</label>
<element-citation publication-type="paper">
<person-group>
<name><surname>Zhou</surname><given-names>C.</given-names></name>
<name><surname>Zhang</surname><given-names>X.</given-names></name>
</person-group>
<year>2014</year>
<article-title>Toward the internet o f things application and management: A practical approach</article-title>
<conf-name>World of Wireless, Mobile and Multimedia Networks (WoWMoM), 2014 IEEE 15th International Symposium on a. IEEE</conf-name>
<fpage>1</fpage><lpage>6</lpage>
<pub-id pub-id-type="doi">10.1109/wowmom.2014.6918928</pub-id>
</element-citation>
</ref>
<!-- [5] D. Silva, WikiSensing: A collaborative sensor management system with trust assessment for big data. 2014.-->
<ref id="B005">
<label>[5]</label>
<element-citation publication-type="other">
<person-group>
<name><surname>Silva</surname><given-names>D.</given-names></name>
</person-group>
<year>2014</year>
<source>WikiSensing: A collaborative sensor management system with trust assessment for big data</source>
</element-citation>
</ref>
<!-- [6] MQTT, http://mqtt.org/, Oct. 2018.-->
<ref id="B006">
<label>[6]</label>
<element-citation publication-type="webpage" publication-format="web">
<year>2018</year>
<month>Oct.</month>
<source>MQTT, <uri>http://mqtt.org/</uri></source>
</element-citation>
</ref>
<!-- [7] Ala Al-Fuqaha, Mohsen Guizani, Mehdi Mohammadi, Mohammed Aledhari, and Moussa Ayyash, Internet of Things: A survey on enabling technologies, protocols, and applications, IEEE Communications Surveys &#x26; Tutorials. Vol. 17, No. 2, pp. 2347-2376, 2015.-->
<ref id="B007">
<label>[7]</label>
<element-citation publication-type="journal">
<person-group>
<name><surname>Al-Fuqaha</surname><given-names>Ala</given-names></name>
<name><surname>Guizani</surname><given-names>Mohsen</given-names></name>
<name><surname>Mohammadi</surname><given-names>Mehdi</given-names></name>
<name><surname>Aledhari</surname><given-names>Mohammed</given-names></name>
<name><surname>Ayyash</surname><given-names>Moussa</given-names></name>
</person-group>
<year>2015</year>
<article-title>Internet of Things: A survey on enabling technologies, protocols, and applications</article-title>
<source>IEEE Communications Surveys &#x26; Tutorials</source>
<volume>17</volume><issue>2</issue>
<fpage>2347</fpage><lpage>2376</lpage>
<pub-id pub-id-type="doi">10.1109/comst.2015.2444095</pub-id>
</element-citation>
</ref>
<!-- [8] Dinesh Thangavel, Xiaoping Ma, Alvin Valera, Hwee-Xian Tan, and Colin Keng-Yan Tan, Performance evaluation of MQTT and CoAP via a common middleware, IEEE Ninth International Conference on Intelligent Sensors, Sensor Networks and Information Processing(ISSNIP). pp. 1-6, 2014.-->
<ref id="B008">
<label>[8]</label>
<element-citation publication-type="paper">
<person-group>
<name><surname>Thangavel</surname><given-names>Dinesh</given-names></name>
<name><surname>Ma</surname><given-names>Xiaoping</given-names></name>
<name><surname>Valera</surname><given-names>Alvin</given-names></name>
<name><surname>Tan</surname><given-names>Hwee-Xian</given-names></name>
<name><surname>Tan</surname><given-names>Colin Keng-Yan</given-names></name>
</person-group>
<year>2014</year>
<article-title>Performance evaluation of MQTT and CoAP via a common middleware</article-title>
<conf-name>IEEE Ninth International Conference on Intelligent Sensors, Sensor Networks and Information Processing(ISSNIP)</conf-name>
<fpage>1</fpage><lpage>6</lpage>
<pub-id pub-id-type="doi">10.1109/issnip.2014.6827678</pub-id>
</element-citation>
</ref>
<!-- [9] S-H. Kim, Internet of a study on the data collection solution based on MQTT protoclas for stable IoT platforms, Master of Hanbat, pp. 7-13, 2016.-->
<ref id="B009">
<label>[9]</label>
<element-citation publication-type="thesis">
<person-group>
<name><surname>Kim</surname><given-names>S-H.</given-names></name>
</person-group>
<year>2016</year>
<source>Internet of a study on the data collection solution based on MQTT protoclas for stable IoT platforms</source>
<comment>Master of Hanbat</comment>
<fpage>7</fpage><lpage>13</lpage>
</element-citation>
</ref>
<!-- [10] S. H. Lee, H. W. Kim, D. K. Hong, and H. T. Ju, Correlation analysis of MQTT loss and delay according to QoS level, International Conference on Information Networking, pp. 714-717, 2013.-->
<ref id="B010">
<label>[10]</label>
<element-citation publication-type="paper">
<person-group>
<name><surname>Lee</surname><given-names>S. H.</given-names></name>
<name><surname>Kim</surname><given-names>H. W.</given-names></name>
<name><surname>Hong</surname><given-names>D. K.</given-names></name>
<name><surname>Ju</surname><given-names>H. T.</given-names></name>
</person-group>
<year>2013</year>
<article-title>Correlation analysis of MQTT loss and delay according to QoS level</article-title>
<conf-name>International Conference on Information Networking</conf-name>
<fpage>714</fpage><lpage>717</lpage>
<pub-id pub-id-type="doi">10.1109/icoin.2013.6496715</pub-id>
</element-citation>
</ref>
<!-- [11] IBM, MQTT V3.1 Protocol Specification, http://public.dhe.ibm.com/software/dw/webservices/ws-mqtt/mqttv3r1.html, 2012.-->
<ref id="B011">
<label>[11]</label>
<element-citation publication-type="webpage" publication-format="web">
<collab>IBM</collab>
<year>2012</year>
<source>MQTT V3.1 Protocol Specification, <uri>http://public.dhe.ibm.com/software/dw/webservices/ws-mqtt/mqttv3r1.html</uri></source>
</element-citation>
</ref>
<!-- [12] Node-RED, https://nodered.org/, Oct. 2018.-->
<ref id="B012">
<label>[12]</label>
<element-citation publication-type="webpage" publication-format="web">
<year>2018</year>
<month>Oct.</month>
<source>Node-RED, <uri>https://nodered.org/</uri></source>
</element-citation>
</ref>
<!-- [13] Michael Blackstock, and Rodger Lea, Toward a distributed data flow platform for the Web of Things (Distributed Node-RED), Proceedings of the 5th International Workshop on Web of Things. pp. 34-39, 2014.-->
<ref id="B013">
<label>[13]</label>
<element-citation publication-type="paper">
<person-group>
<name><surname>Blackstock</surname><given-names>Michael</given-names></name>
<name><surname>Lea</surname><given-names>Rodger</given-names></name>
</person-group>
<year>2014</year>
<article-title>Toward a distributed data flow platform for the Web of Things (Distributed Node-RED)</article-title>
<source>Proceedings of the 5th International Workshop on Web of Things</source>
<fpage>34</fpage><lpage>39</lpage>
<pub-id pub-id-type="doi">10.1145/2684432.2684439</pub-id>
</element-citation>
</ref>
<!-- [14] Agricultural Weather Information Service, http://weather.rda.go.kr/weather/observation.jsp, Oct. 2018.-->
<ref id="B014">
<label>[14]</label>
<element-citation publication-type="webpage" publication-format="web">
<year>2018</year>
<month>Oct.</month>
<source>Agricultural Weather Information Service, <uri>http://weather.rda.go.kr/weather/observation.jsp</uri></source>
</element-citation>
</ref>
<!-- [15] Elasticsearch, https://www.elastic.co/kr/products/elasticsearch, Oct. 2018.-->
<ref id="B015">
<label>[15]</label>
<element-citation publication-type="webpage" publication-format="web">
<year>2018</year>
<month>Oct.</month>
<source>Elasticsearch, <uri>https://www.elastic.co/kr/products/elasticsearch</uri></source>
</element-citation>
</ref>
</ref-list>
<ack>
<title>감사의 글</title>
<p>본 논문은 2018년도 순천향대학교 교수 연구년제에 의하여 연구하였음.</p>
</ack> 
<bio>
<p><graphic xlink:href="../ingestImageView?artiId=ART002497007&amp;imageName=jkits_2019_14_04_401_f012.jpg"></graphic><bold>Byoung-Chan Jeon</bold> received the bachelor’s degree in the department of Computer Science from the Hanbat National University in 1989. He received the M.S. degree in the Department of Computer Science from Suwon University in 1994. He received the Ph.D. degree in the Department of Computer Sicnce Engineering from Soonchunhyang University in 2001. He is currently a professor in the Department of Liberal Arts at Chungwoon University, Korea. His current research interests include computer architecture, network Application, Embedded Systems. He is a member of the KKITS.</p>
<p><italic>E-mail address</italic>: <email>jbc66@chungwoon.ac.kr</email></p>
<p><graphic xlink:href="../ingestImageView?artiId=ART002497007&amp;imageName=jkits_2019_14_04_401_f013.jpg"></graphic><bold>Da-Hyun Kang</bold> is studying in the Department of Computer Science Engineering from Soonchunhyang University. She is current research area is IoT for agriculture.</p>
<p><italic>E-mail address</italic>: <email>fleiy@naver.com</email></p>
<p><graphic xlink:href="../ingestImageView?artiId=ART002497007&amp;imageName=jkits_2019_14_04_401_f014.jpg"></graphic><bold>Ki-Young Kim</bold> received the bachelor’s degree in 2003, and the M.S. degree in 2005 in the Department of Computer Science and Engineering from the Soonchunhyang University. He was a ARM Firmware Engineer at FCI Co., Ltd. from 2005 to 2008. He was a senior researcher at msilicon Co., Ltd. from 2009 to 2010. He was a senior researcher at PrimumDesign Co., Ltd. from 2010 to 2013. He has been a senior researcher at VirtualStorm Co., Ltd. from 2014 to 2016. He has been a senior researcher at Namooplus Co., Ltd. since 2016. His current research interests include Agriculture Convergence, Network application, Embedded System, Internet of Things.</p>
<p><italic>E-mail address</italic>: <email>k71077@nate.com</email></p>
<p><graphic xlink:href="../ingestImageView?artiId=ART002497007&amp;imageName=jkits_2019_14_04_401_f015.jpg"></graphic><bold>Sang-Jeong Lee</bold> received the B.S., M.S., Ph.D. in the Department of Electronic Engineering from the Hanyang University in 1983, 1985 and 1988, respectively. He is currently a professor at the Department of Computer Science and Engineering in Soonchunhyang University, Korea. His current research area include computer architecture, network application and embedded systems.</p>
<p><italic>E-mail address</italic>: <email>sjlee@sch.ac.kr</email></p>
</bio>
</back>
</article>
