Chapterبەش 2 · Lectureوانە 2.2

Where Should the Thinking Happen?بیرکردنەوە دەبێت لە کوێ ڕووبدات؟

Cloud intelligence or local intelligence; where to process data; the relay model versus local processing (the child and the teacher); why devices must keep working when the internet fails; five questions for choosing an architecture; device, gateway or cloud; and security, trust boundaries and privacy — with the smart doorbell as the running example.

ژیریی هەور یان ژیریی ناوخۆیی؛ لە کوێ بکرێت؛ مۆدێلی ڕەوانەکردن بەرامبەر ناوخۆیی (منداڵەکە و مامۆستای پۆل)؛ بۆچی ئامێرەکان دەبێت کاتێک دەپچڕێت بەردەوام کار بکەن؛ پێنج پرسیار بۆ هەڵبژاردنی تەلارسازی؛ ئامێر، یان هەور؛ هەروەها ، و — بە زەنگی هۆشمەندی دەرگا وەک نموونەی بەردەوام.

14 min read16 خولەک خوێندنەوە · 14 stepsهەنگاو

What you will learnچی فێر دەبیت

  • Tell cloud intelligence from local intelligence with examples (a thermostat, smart traffic lights).
  • Decide whether a job should be processed on the device or in the cloud.
  • Compare the sensor-data relay model with local processing, including what happens when the internet fails.
  • Use five questions — performance and cost, computing power, networking cost, data volume and infrastructure — to choose an architecture.
  • Compare thinking on the device, on a gateway and in the cloud for latency, bandwidth, privacy and power.
  • Find the trust boundaries of a system and explain why sensitive jobs are often kept local.
  • ژیریی هەور لە ژیریی ناوخۆیی جیا بکەیتەوە بە نموونە (، گڵۆپی هاتوچۆی هۆشمەند).
  • بڕیار بدەیت کارێک لەسەر ئامێرەکە یان لە هەوردا چارەسەر بکرێت.
  • مۆدێلی ڕەوانەکردنی خوێندنەوەی لەگەڵ ناوخۆیی بەراورد بکەیت، لەوانە ئەوەی کاتێک دەپچڕێت ڕوودەدات.
  • پێنج پرسیار بەکار بهێنیت — کارایی و تێچوو، هێزی ژمێرکاری، تێچووی ، قەبارەی و ژێرخان — بۆ هەڵبژاردنی تەلارسازی.
  • بیرکردنەوە لەسەر ئامێر، لەسەر و لە هەوردا بەراورد بکەیت بۆ ، ، و هێز.
  • سیستەمێک بدۆزیتەوە و ڕوون بکەیتەوە بۆچی کارە هەستیارەکان زۆرجار لە شوێنی خۆیاندا دەهێڵرێنەوە.

Two places to thinkدوو شوێن بۆ بیرکردنەوە

Every IoT system makes decisions: open the vents, ring the bell, change a traffic light. A key design question is where the intelligence goes — where the smart thinking happens. There are two main answers:

هەموو سیستەمێکی IoT بڕیار دەدات: پەنجەرەکان بکەرەوە، زەنگەکە لێبدە، گڵۆپێکی هاتوچۆ بگۆڕە. پرسیارێکی گرنگی دیزاین ئەوەیە کە ژیری لە کوێ دادەنرێت — واتە بیرکردنەوەی زیرەک لە کوێ ڕوودەدات. دوو وەڵامی سەرەکی هەیە:

  • Cloud intelligence — the devices send simple data to big servers far away, and the servers do the thinking.
  • Local intelligence — the small device itself, such as a smart sensor, does the thinking.
  • ژیریی هەور — ئامێرەکان سادە دەنێرن بۆ گەورە و دوور و ئەوان بیر دەکەنەوە.
  • ژیریی ناوخۆیی — ئامێرە بچووکەکە خۆی، وەک هۆشمەند، بیر دەکاتەوە.

A smart thermostat at home can decide on its own, in a moment, to switch the heating on: local intelligence. A city's smart traffic lights can send their car counts to a central server, which recalculates the light timings every few minutes: cloud intelligence.

هۆشمەند لە ماڵەوە دەتوانێت خۆی و لە ساتێکدا بڕیار بدات گەرمکەرەوەکە هەڵبکات: ژیریی ناوخۆیی. گڵۆپە هۆشمەندەکانی هاتوچۆی شارێک دەتوانن ژمارەی ئۆتۆمبێلەکان بنێرن بۆ ناوەندی، کە هەموو چەند خولەکێک جارێک کاتی گڵۆپەکان دووپاتە دەژمێرێتەوە: ژیریی هەور.

Two panels. Left, local intelligence: inside a house a wall thermostat reads 19 °C and decides by itself, in a moment, to switch the heater on. Right, cloud intelligence: traffic lights at a junction send car counts to a server in a city control centre, which sends back new green times every few minutes.دوو بەش. چەپ، ژیریی ناوخۆیی: لە ناو ماڵێکدا تێرمۆستاتێکی دیوار 19 °C دەخوێنێتەوە و خۆی لە ساتێکدا بڕیار دەدات گەرمکەرەوەکە هەڵبکات. ڕاست، ژیریی هەور: گڵۆپەکانی هاتوچۆی چوارڕێیانێک ژمارەی ئۆتۆمبێلەکان دەنێرن بۆ ڕاژەکارێک لە ناوەندی کۆنترۆڵی شارەکە، کە هەموو چەند خولەکێک کاتی سەوزی نوێ دەگەڕێنێتەوە.
Local intelligence decides on the spot; cloud intelligence decides far away.ژیریی ناوخۆیی لە شوێنی خۆیدا بڕیار دەدات؛ ژیریی هەور لە دوورەوە بڕیار دەدات.CêIT

Where to clean, change and use the dataدراوە لە کوێ پاک بکرێتەوە، بگۆڕدرێت و بەکار بهێنرێت

A close cousin of that question is where the data processing happens: where the data is cleaned, changed and used.

پرسیارێکی نزیک لەوە ئەوەیە کە لە کوێ ڕوودەدات: لە کوێ پاک دەکرێتەوە، دەگۆڕدرێت و بەکار دەهێنرێت.

  • Locally, on the device — when the action must be very fast, or when there may be no internet. A car's crash sensors must trigger the airbags within milliseconds; they cannot wait for a server.
  • In the cloud — when the job needs powerful computers and a lot of memory. An app that studies thirty years of weather data from hundreds of stations to predict storms needs the cloud.
  • لە شوێنی خۆیدا، لەسەر ئامێرەکە — کاتێک کارەکە دەبێت زۆر خێرا بێت، یان لەوانەیە نەبێت. پێکدادانی ئۆتۆمبێل دەبێت لە ماوەی چەند میلیچرکەیەکدا کیسە هەواکان بکەنەوە؛ ناتوانن چاوەڕێی بکەن.
  • لە هەوردا — کاتێک کارەکە پێویستی بە بەهێز و زۆر هەیە. کە کەشوهەوای سی ساڵی سەدان وێستگە شی دەکاتەوە بۆ پێشبینیکردنی زریان، پێویستی بە هەورە.
Two panels. On the device: a car's crash sensor fires the airbag within milliseconds, with no internet needed. In the cloud: a data centre holds thirty years of readings from hundreds of weather stations and produces a storm forecast map.دوو بەش. لەسەر ئامێرەکە: هەستەوەرێکی پێکدادانی ئۆتۆمبێل لە ماوەی چەند میلیچرکەیەکدا کیسەی هەوا دەکاتەوە، بەبێ پێویستی بە ئینتەرنێت. لە هەوردا: ناوەندێکی دراوە خوێندنەوەی سی ساڵی سەدان وێستگەی کەشناسی هەڵدەگرێت و نەخشەیەکی پێشبینیی زریان دروست دەکات.
Fast and offline: process on the device. Huge and heavy: process in the cloud.خێرا و بەبێ : لەسەر ئامێرەکە. گەورە و قورس: لە هەوردا.CêIT

The relay model: the device only reportsمۆدێلی ڕەوانەکردن: ئامێرەکە تەنیا ڕاپۆرت دەدات

Take an IoT device with a couple of sensors and one output, such as a fan. In the simple sensor-data relay model, the device only forwards its sensor readings to the cloud. The cloud decides and sends back a command telling the device to change its output: "It is 33 °C — turn the fan on."

ئامێرێکی IoT وەربگرە کە دوو و یەک هەیە، وەک پانکەیەک. لە مۆدێلێکی سادەدا کە پێی دەوترێت مۆدێلی ڕەوانەکردنی خوێندنەوەی ، ئامێرەکە تەنیا خوێندنەوەکانی بۆ هەور دەنێرێت. هەور بڕیار دەدات و فەرمانێک دەگەڕێنێتەوە کە بە ئامێرەکە دەڵێت بگۆڕێت: «پلەی گەرمی گەیشتە ⁦33 °C⁩ — پانکەکە هەڵبکە.»

The relay model is easy to build and easy to change, because all the logic lives in one place. But every decision makes a round trip over the network. That adds delay, uses bandwidth for every reading, costs money on a mobile data plan — and stops completely when the connection is lost.

دروستکردنی مۆدێلی ڕەوانەکردن ئاسانە و گۆڕینیشی ئاسانە، چونکە هەموو لۆجیکەکە لە یەک شوێندایە. بەڵام هەموو بڕیارێک گەشتێکی چوون و هاتن بە دەکات. ئەمە زیاد دەکات، بۆ هەموو خوێندنەوەیەک بەکار دەهێنێت، لەسەر پاکێجی مۆبایل پارەی تێدەچێت — و کاتێک پەیوەندییەکە دەپچڕێت بە تەواوی دەوەستێت.

Bring the brain to the deviceمێشکەکە بهێنە بۆ ناو ئامێرەکە

The other way is to bring the processor to the device. The device reads its own sensors, changes its output by itself, and sends only summary information up to the cloud for storage: "Fan on at 12:00, off at 15:30." This brings four benefits:

ڕێگاکەی تر ئەوەیە پرۆسێسەرەکە بهێنیتە ناو ئامێرەکە. ئامێرەکە خۆی دەخوێنێتەوە، خۆی دەگۆڕێت و تەنیا پوختە دەنێرێت بۆ هەور تا خەزن بکرێت: «پانکە لە ⁦12:00⁩ هەڵکرا و لە ⁦15:30⁩ کوژایەوە.» ئەمە چوار سوودی هەیە:

  • it reacts in milliseconds;
  • it keeps working without the internet;
  • it sends far less data, which saves bandwidth, energy and money;
  • raw private data, such as video, can stay at home.
  • لە ماوەی چەند میلیچرکەیەکدا کاردانەوەی هەیە؛
  • بەبێ بەردەوام کار دەکات؛
  • زۆر کەمتر دەنێرێت، کە ، وزە و پارە دەپارێزێت؛
  • تایبەتی خاو، وەک ڤیدیۆ، دەتوانێت لە ماڵەوە بمێنێتەوە.

The price: the device needs a stronger processor and more energy, and changing the rules means updating every device — usually with an over-the-air update.

نرخەکەی: ئامێرەکە پێویستی بە پرۆسێسەرێکی بەهێزتر و وزەی زیاتر هەیە و گۆڕینی ڕێساکان واتە هەموو ئامێرێک — زۆرجار بە .

An animation comparing two greenhouses. Top, the relay model: the reading 33 °C travels up to the cloud, the cloud decides, the command comes back down, and the fan starts after about one second. Bottom, local processing: the device decides at once and starts the fan within milliseconds; later it sends one short summary to the cloud. In the last frame the internet link breaks: the top fan can no longer be controlled; the bottom one still can.
An animation comparing two greenhouses. Top, the relay model: the reading 33 °C travels up to the cloud, the cloud decides, the command comes back down, and the fan starts after about one second. Bottom, local processing: the device decides at once and starts the fan within milliseconds; later it sends one short summary to the cloud. In the last frame the internet link breaks: the top fan can no longer be controlled; the bottom one still can.
Relay model versus local processing: speed, data and what happens offline.مۆدێلی ڕەوانەکردن بەرامبەر ناوخۆیی: خێرایی، و ئەوەی بەبێ ڕوودەدات.CêIT

The child and the teacherمنداڵەکە و مامۆستای پۆل

The child and the teacherمنداڵەکە و مامۆستای پۆل

In the relay model the device is like a child who reports everything to the teacher. The child looks at the thermometer and calls out: "It's getting hot in here!" The teacher answers: "Then switch the fan on," and the child does. The child does not think — every decision comes from the teacher, the cloud. With local processing the child has a brain of its own: it notices the heat, switches the fan on itself, and later tells the teacher: "I switched the fan on at noon today." Only that short summary reaches the teacher.

لە مۆدێلی ڕەوانەکردندا ئامێرەکە وەک منداڵێک وایە کە هەموو شتێک بە مامۆستای پۆل دەڵێت. منداڵەکە سەیری گەرمیپێوەکە دەکات و بانگ دەکات: «ئێرە گەرم دەبێت!» مامۆستای پۆل وەڵام دەداتەوە: «کەواتە پانکەکە هەڵبکە» و منداڵەکەش هەڵیدەکات. منداڵەکە بیر ناکاتەوە — هەموو بڕیارێک لە مامۆستای پۆلەوە دێت، واتە هەور. لە ناوخۆییدا منداڵەکە مێشکی خۆی هەیە: هەست بە گەرمییەکە دەکات، خۆی پانکەکە هەڵدەکات و دواتر بە مامۆستای پۆل دەڵێت: «ئەمڕۆ نیوەڕۆ پانکەکەم هەڵکرد.» تەنیا ئەو پوختە کورتە دەگاتە مامۆستای پۆل.

A two-panel cartoon. Panel 1, relay model: a child (the IoT device) looks at a thermometer and calls "It's hot!" to a teacher (the cloud), who replies "Switch the fan on"; the child switches the fan on. Panel 2, local processing: the child, now with a small brain icon, says "I'll switch the fan on myself" and later tells the teacher "Fan on at 12:00".کارتۆنێکی دوو بەشی. بەشی 1، مۆدێلی ڕەوانەکردن: منداڵێک (ئامێری IoT) سەیری گەرمیپێوێک دەکات و بە مامۆستایەک (هەور) دەڵێت «گەرمە!»؛ مامۆستای پۆل دەڵێت «پانکەکە هەڵبکە»؛ منداڵەکە پانکەکە هەڵدەکات. بەشی 2، چارەسەرکردنی ناوخۆیی: منداڵەکە کە ئێستا وێنەی مێشکێکی بچووکی لەگەڵە دەڵێت «خۆم پانکەکە هەڵدەکەم» و دواتر بە مامۆستای پۆل دەڵێت «پانکە لە 12:00 هەڵکرا».
The relay model asks the teacher; local processing decides alone and reports later.مۆدێلی ڕەوانەکردن لە مامۆستا دەپرسێت؛ ناوخۆیی خۆی بڕیار دەدات و دواتر ڕاپۆرت دەدات.CêIT
Where the analogy stops workingسنووری ئەم نموونەیە

A real device does not understand anything. Its "brain" is a program with rules, such as "above 30 °C, switch the fan on", and the cloud can still send it new rules.

ئامێری ڕاستەقینە هیچ تێناگات. مێشکەکەی بە چەند ڕێسایەکەوە، وەک «لە سەرووی ⁦30 °C⁩ پانکەکە هەڵبکە» و هەور دەتوانێت هێشتا ڕێسای نوێی بۆ بنێرێت.

When the internet failsکاتێک ئینتەرنێت دەپچڕێت

One requirement from the previous lesson matters a lot here: should it work when there is no internet? Internet links do fail: a cut cable, a power cut at the router, a crowded mobile network. For a safety-critical device the answer must be yes.

یەکێک لە وانەی پێشوو لێرەدا زۆر گرنگە: ئایا دەبێت بەبێ کار بکات؟ پەیوەندییەکانی دەپچڕێن: کێبڵێکی بڕاو، بڕانی کارەبای ، قەرەباڵغ. بۆ ئامێرێکی هەستیاری سەلامەتی وەڵامەکە دەبێت بەڵێ بێت.

Smart smoke alarms are built this way. They detect smoke and sound the siren by themselves, and alarms in the same home warn each other over their own radio link. Without Wi-Fi only the extras stop: phone notifications and remote status. Google documents exactly this behaviour for its Nest Protect alarms.

ئاگادارکەرەوە هۆشمەندەکانی دووکەڵ بەم شێوەیە دروست دەکرێن. خۆیان دووکەڵ دەدۆزنەوە و سیرەنەکە لێدەدەن و ئاگادارکەرەوەکانی هەمان ماڵ لە ڕێگەی پەیوەندیی ڕادیۆیی خۆیانەوە یەکتر ئاگادار دەکەنەوە. بەبێ تەنیا زیادەکان دەوەستن: مۆبایل و بینینی دۆخ لە دوورەوە. Google هەر ئەم ڕەفتارەی بۆ ئاگادارکەرەوەکانی Nest Protectـی خۆی نووسیوە.

An animation of a home during an internet outage. The link from the router to the cloud breaks. Smoke rises in the kitchen; the kitchen smoke alarm detects it and decides by itself; its siren sounds and the bedroom alarm sounds too over their own radio link. The phone notification waits because the cloud cannot be reached. When the internet returns, the notification arrives: the smoke alarm went off at 02:14.
An animation of a home during an internet outage. The link from the router to the cloud breaks. Smoke rises in the kitchen; the kitchen smoke alarm detects it and decides by itself; its siren sounds and the bedroom alarm sounds too over their own radio link. The phone notification waits because the cloud cannot be reached. When the internet returns, the notification arrives: the smoke alarm went off at 02:14.
A smoke alarm decides locally, so it still protects the home while the cloud is unreachable.ئاگادارکەرەوەی دووکەڵ لە شوێنی خۆیدا بڕیار دەدات، بۆیە کاتێک هەور بەردەست نییە هێشتا ماڵەکە دەپارێزێت.CêIT

Choosing the architecture: five questionsهەڵبژاردنی تەلارسازی: پێنج پرسیار

Choosing the right architecture for an IoT application is a complex task with many factors. Five questions guide it:

هەڵبژاردنی تەلارسازیی گونجاو بۆ سیستەمێکی IoT کارێکی ئاڵۆزە و هۆکاری زۆری هەیە. پێنج پرسیار ڕێنمایی دەکەن:

  1. Performance and cost — how fast and powerful must it be, and what may it cost? That decides how and where the processing is done.
  2. Where is the computing power? Where should it be placed — in the device or in powerful cloud servers?
  3. Networking costs — what does it cost to send data? Can some of it be acted on locally, or must everything go to the cloud?
  4. How much data, and what if the link fails? Sending data to the cloud can be expensive and slow. And if the internet goes down, can the system still work locally?
  5. How much networking infrastructure — gateways, cables, mobile contracts — should be deployed?
  1. کارایی و تێچوو — دەبێت چەند خێرا و بەهێز بێت و بۆی هەیە چەندی تێبچێت؟ ئەوە دیاری دەکات چۆن و لە کوێ دەکرێت.
  2. هێزی ژمێرکاری لە کوێیە؟ دەبێت لە کوێ دابنرێت — لە ئامێرەکەدا یان لە بەهێزی هەوردا؟
  3. تێچووی — ناردنی چەندی تێدەچێت؟ دەکرێت لەسەر هەندێکی لە شوێنی خۆیدا کار بکرێت، یان دەبێت هەمووی بچێت بۆ هەور؟
  4. چەند ؟ ئەگەر پەیوەندییەکە پچڕا چی؟ ناردنی بۆ هەور دەتوانێت گران و خاو بێت. هەروەها ئەگەر پچڕا، ئایا سیستەمەکە دەتوانێت لە شوێنی خۆیدا کار بکات؟
  5. چەند ژێرخانی — ، کێبڵ، گرێبەستی مۆبایل — دەبێت دابمەزرێت؟

In the end it is a balance. Powerful cloud servers cost money but can handle huge amounts of data; small, cheap devices — like a doorbell — have little processing power. So there are two main options — devices strong enough to do the job themselves, or powerful servers in the cloud — and most real systems mix them.

لە کۆتاییدا هاوسەنگییەکە. بەهێزی هەور پارەیان تێدەچێت بەڵام دەتوانن زۆر گەورە بەڕێوە ببەن؛ ئامێری بچووک و هەرزان — وەک زەنگێکی دەرگا — هێزی کەمیان هەیە. بۆیە دوو بژاردەی سەرەکی هەیە — ئامێرێک کە بەقەد ئەوە بەهێز بێت کارەکە خۆی بکات، یان بەهێز لە هەوردا — و زۆربەی سیستەمە ڕاستەقینەکان هەردووکیان تێکەڵ دەکەن.

A balance scale. Left pan, on the device: fast reactions, works offline, little data to send, private data stays home — but a small processor and every device must be updated. Right pan, in the cloud: huge computing and storage, one place to update, sees all devices together — but delay, data costs and nothing works without the internet.تەرازوویەک. تای چەپ، لەسەر ئامێرەکە: کاردانەوەی خێرا، کارکردن بەبێ ئینتەرنێت، دراوەی کەم بۆ ناردن، دراوەی تایبەت لە ماڵەوە دەمێنێتەوە — بەڵام پرۆسێسەرێکی بچووک و هەموو ئامێرێک دەبێت نوێ بکرێتەوە. تای ڕاست، لە هەوردا: ژمێرکاری و خەزنکردنی زۆر گەورە، یەک شوێن بۆ نوێکردنەوە، هەموو ئامێرەکان پێکەوە دەبینێت — بەڵام دواکەوتن، تێچووی دراوە و بەبێ ئینتەرنێت هیچ کار ناکات.
Choosing an architecture means balancing what the device and the cloud each do best.هەڵبژاردنی تەلارسازی واتە هاوسەنگکردنی ئەوەی ئامێرەکە و هەور هەر یەکەیان باشتر دەیکەن.CêIT

Choosing the architecture: five questionsهەڵبژاردنی تەلارسازی: پێنج پرسیار

How much data must travel?چەند دراوە دەبێت بڕوات؟

Data volume can decide the design. Google's own figures for its Nest doorbells: streaming video all day and night uses about 200–300 GB a month, while recording only events — when someone comes to the door — uses about 2–10 GB a month for the battery model. A text alert such as "someone is at the door, 14:02" is only a few hundred bytes.

قەبارەی دەتوانێت دیزاینەکە دیاری بکات. ژمارەکانی Google بۆ زەنگە دەرگاکانی Nest: پەخشی ڤیدیۆ بە درێژایی شەو و ڕۆژ مانگانە نزیکەی ⁦200⁩ تا ⁦300 GB⁩ بەکار دەهێنێت، بەڵام تۆمارکردنی تەنیا ڕووداوەکان — کاتێک کەسێک دێتە بەر دەرگا — بۆ ئەو جۆرەی بە کار دەکات مانگانە نزیکەی 2 تا ⁦10 GB⁩ بەکار دەهێنێت. ئاگادارکردنەوەیەکی نووسراو وەک «کەسێک لە بەر دەرگایە، ⁦14:02⁩» تەنیا چەند سەد .

So detecting motion on the device and sending only events cuts the data 20 to 150 times. On a mobile data plan, or for hundreds of cameras, that is the difference between affordable and impossible.

بۆیە دۆزینەوەی جووڵە لەسەر ئامێرەکە و ناردنی تەنیا ڕووداوەکان ⁦20⁩ تا ⁦150⁩ جار کەم دەکاتەوە. لەسەر پاکێجی مۆبایل، یان بۆ سەدان کامێرا، ئەوە جیاوازیی نێوان گونجاو و مەحاڵە.

A bar chart with a logarithmic scale of data per month for one doorbell: 24/7 video about 300 GB, event clips only about 10 GB, text alerts only about 1 MB. Each step to the right is a choice to process more on the device.هێڵکارییەکی ستوونی بە پێوەری لۆگاریتمی بۆ دراوە لە مانگێکدا بۆ یەک زەنگی دەرگا: ڤیدیۆی 24/7 نزیکەی 300 GB، تەنیا کلیپی ڕووداوەکان نزیکەی 10 GB، تەنیا ئاگادارکردنەوەی نووسراو نزیکەی 1 MB. هەر هەنگاوێک بەرەو ڕاست هەڵبژاردنێکە بۆ چارەسەرکردنی زیاتر لەسەر ئامێرەکە.
The more the device decides, the less it has to send.تا ئامێرەکە زیاتر بڕیار بدات، کەمتر دەبێت بنێرێت.CêIT

Device, gateway or cloud?ئامێر، دەروازەی ڕایەڵە یان هەور؟

In practice there are three places where the thinking can happen: on the device, on a nearby gateway that serves many devices, or in the cloud. Each one wins on some points and loses on others:

لە ڕاستیدا سێ شوێن هەیە کە بیرکردنەوە دەتوانێت تێیدا ڕووبدات: لەسەر ئامێرەکە، لەسەر نزیک کە خزمەتی زۆر ئامێر دەکات، یان لە هەوردا. هەر یەکەیان لە هەندێک خاڵدا دەباتەوە و لە هەندێکی تردا دەدۆڕێت:

A comparison table with three columns: on the device, on a gateway, in the cloud. Reaction time: milliseconds, tens of milliseconds, hundreds of milliseconds or more. Data sent over the internet: very little, a summary, everything. Privacy: data stays on the device, stays at home, leaves home. Computing power: small, medium, huge. Works without internet: yes, yes for the home, no. Updating the rules: every device, each gateway, one place.خشتەیەکی بەراوردکاری بە سێ ستوون: لەسەر ئامێرەکە، لەسەر دەروازەی ڕایەڵە، لە هەوردا. کاتی کاردانەوە: چەند میلیچرکەیەک، دەیان میلیچرکە، سەدان میلیچرکە یان زیاتر. دراوەی نێردراو بە ئینتەرنێتدا: زۆر کەم، پوختەیەک، هەمووی. تایبەتێتی: دراوە لەسەر ئامێرەکە دەمێنێتەوە، لە ماڵەوە دەمێنێتەوە، ماڵ جێدەهێڵێت. هێزی ژمێرکاری: کەم، مامناوەند، زۆر گەورە. کارکردن بەبێ ئینتەرنێت: بەڵێ، بەڵێ بۆ ناو ماڵ، نەخێر. نوێکردنەوەی ڕێساکان: هەموو ئامێرێک، هەر دەروازەی ڕایەڵەیەک، یەک شوێن.
Latency, bandwidth and privacy all improve as the thinking moves closer to the device; computing power grows as it moves to the cloud.، و هەموویان باشتر دەبن تا بیرکردنەوە نزیکتر بێتەوە لە ئامێرەکە؛ هێزی ژمێرکاری زیاد دەکات تا بڕوات بەرەو هەور.CêIT

Most real systems use all three: the device reacts at once, the gateway combines and filters readings from many devices, and the cloud stores the history and runs heavy analysis. These three places have names — edge computing, fog computing and cloud computing — and Cloud, fog and edge computing compares them in detail.

زۆربەی سیستەمە ڕاستەقینەکان هەر سێکیان بەکار دەهێنن: ئامێرەکە دەستبەجێ کاردانەوەی هەیە، خوێندنەوەی زۆر ئامێر کۆ دەکاتەوە و دەیپاڵێوێت و هەور مێژووەکە هەڵدەگرێت و شیکاریی قورس دەکات. ئەم سێ شوێنە ناویان هەیە — ، و — و وانەی هەورەژمێرکاری، ژمێرکاریی تەم و ژمێرکاریی لێوار بە وردی بەراوردیان دەکات.

Security and trust boundariesئاسایش و سنوورەکانی متمانە

The sixth question is security and trust: where are the trust boundaries? A trust boundary is a line where data passes from a part you control and trust to a part you trust less — for example, from the devices in your home to a company's cloud. Security must be designed in from the start, so that the right security and confidentiality guarantees can be made.

پرسیاری شەشەم و متمانەیە: لە کوێن؟ هێڵێکە کە لە بەشێکەوە کە کۆنترۆڵی دەکەیت و متمانەت پێیەتی تێدەپەڕێت بۆ بەشێک کە متمانەت پێی کەمترە — بۆ نموونە لە ئامێرەکانی ماڵەکەتەوە بۆ هەوری کۆمپانیایەک. دەبێت لە سەرەتاوە لە دیزایندا دابنرێت، بۆ ئەوەی گەرەنتیی گونجاوی و بدرێت.

A smart doorbell may record the video and sound of everyone who comes to your door. Before that data crosses a trust boundary it should be protected: encrypted on the way, sent only when needed, and deleted after a while. Some sensitive jobs are better done locally, so private information never travels over the internet at all — an idea called privacy by design (more in Privacy: what your devices know about you).

زەنگێکی هۆشمەندی دەرگا لەوانەیە ڤیدیۆ و دەنگی هەموو ئەو کەسانە تۆمار بکات کە دێنە بەر دەرگاکەت. پێش ئەوەی ئەو لە تێپەڕێت دەبێت بپارێزرێت: لە ڕێگادا شفرە بکرێت، تەنیا کاتی پێویست بنێردرێت و دوای ماوەیەک بسڕدرێتەوە. هەندێک کاری هەستیار باشترە لە شوێنی خۆیدا بکرێت، بۆ ئەوەی زانیاریی تایبەت هەرگیز بە نەڕوات — بیرۆکەیەک کە پێی دەوترێت (زیاتر لە تایبەتێتی: ئامێرەکانت چی لەبارەی تۆ دەزانن).

A smart doorbell system with a dashed trust boundary around the home: the doorbell, the indoor chime and the home router are inside. Outside the boundary are the internet, the doorbell company's cloud and the owner's phone on a mobile network. Video crossing the boundary is shown with a padlock (encrypted); a note says sensitive jobs such as motion detection can stay inside.سیستەمی زەنگێکی هۆشمەندی دەرگا لەگەڵ سنوورێکی متمانەی پچڕپچڕ لە دەوری ماڵەکە: زەنگی دەرگاکە، زەنگی ناو ماڵ و ڕێدۆزی ماڵ لە ناوەوەن. لە دەرەوەی سنوورەکە ئینتەرنێت، هەوری کۆمپانیای زەنگەکە و مۆبایلی خاوەنەکە لەسەر ڕایەڵەی مۆبایل هەن. ئەو ڤیدیۆیەی لە سنوورەکە تێدەپەڕێت بە قفڵێک پیشان دراوە (شفرەکراو)؛ تێبینییەک دەڵێت کاری هەستیاری وەک دۆزینەوەی جووڵە دەتوانێت لە ناوەوە بمێنێتەوە.
Find the trust boundaries first; protect data before it crosses them.سەرەتا بدۆزەرەوە؛ پێش تێپەڕینی لێیان بیپارێزە.CêIT

The smart doorbell: putting it togetherزەنگی هۆشمەندی دەرگا: کۆکردنەوەی هەمووی

The smart doorbell brings these ideas together. It is hardly a safety-critical application — but it would be annoying if the bell stopped ringing just because the internet connection was lost. So some local processing is desirable.

زەنگی هۆشمەندی دەرگا ئەم بیرۆکانە کۆ دەکاتەوە. بە زەحمەت دەتوانرێت بە دابنرێت — بەڵام بێزارکەر دەبێت ئەگەر زەنگەکە تەنیا لەبەر پچڕانی پەیوەندیی لێنەدات. بۆیە هەندێک ناوخۆیی باشە.

A well-designed doorbell therefore rings the chime inside the house directly, detects motion by itself and keeps recent clips on a local memory card. When the internet is down it still works as a doorbell, which makes it more reliable; when the link returns, it uploads only the important clips.

بۆیە زەنگێکی دەرگای باش دیزاینکراو ڕاستەوخۆ زەنگی ناو ماڵەکە لێدەدات، خۆی جووڵە دەدۆزێتەوە و کلیپە تازەکان لەسەر کارتێکی ناوخۆیی هەڵدەگرێت. کاتێک پچڕاوە هێشتا وەک زەنگی دەرگا کار دەکات، کە زیاتر دەکات؛ کاتێک پەیوەندییەکە دەگەڕێتەوە، تەنیا کلیپە گرنگەکان هەڵبار دەکات.

An animation of a smart doorbell during an internet outage. The link to the cloud breaks. A visitor presses the button and the chime inside rings at once. The doorbell detects motion and saves a clip on its memory card. A phone alert waits. When the internet returns, only the short clip and the alert go to the cloud and the phone.
An animation of a smart doorbell during an internet outage. The link to the cloud breaks. A visitor presses the button and the chime inside rings at once. The doorbell detects motion and saves a clip on its memory card. A phone alert waits. When the internet returns, only the short clip and the alert go to the cloud and the phone.
Local processing keeps the doorbell ringing and recording while the internet is down. ناوخۆیی کاتێک پچڕاوە زەنگەکە بە لێدان و تۆمارکردن دەهێڵێتەوە.CêIT

Common mistakesهەڵە باوەکان

MistakeهەڵەBetterباشتر
"Send everything to the cloud — it is the most powerful."«هەموو شتێک بنێرە بۆ هەور — بەهێزترینە.»The cloud is powerful but far away: delay, data costs and no service offline. Decide job by job.هەور بەهێزە بەڵام دوورە: ، تێچووی و هیچ خزمەتگوزارییەک بەبێ . کار بە کار بڕیار بدە.
"Local processing means no cloud at all."« ناوخۆیی واتە هیچ هەورێک نییە.»The device decides locally and still sends summaries for storage, analysis and new rules.ئامێرەکە لە شوێنی خۆیدا بڕیار دەدات و هێشتا پوختە دەنێرێت بۆ ، شیکاری و ڕێسای نوێ.
"If it is not safety-critical, it may depend fully on the internet."«ئەگەر هەستیاری سەلامەتی نەبێت، دەتوانێت تەواو پشت بە ببەستێت.»People expect basic functions — a doorbell that rings, a lock that opens — to work offline too.خەڵک چاوەڕوانی ئەوەن ئەرکە سەرەکییەکان — زەنگێک کە لێبدات، قفڵێک کە بکرێتەوە — بەبێ کار بکەن.
"Sending more data is always better."«ناردنی زیاتر هەمیشە باشترە.»Raw video and every reading cost bandwidth, energy, money and privacy. Send what the job needs.ڤیدیۆی خاو و هەموو خوێندنەوەیەک ، وزە، پارە و دەخۆن. ئەوە بنێرە کە کارەکە پێویستی پێیەتی.
"Security can be added at the end."« دەتوانرێت لە کۆتاییدا زیاد بکرێت.»Find the trust boundaries while designing, and protect data before it crosses them.لە کاتی دیزایندا بدۆزەرەوە و پێش ئەوەی لێیان تێپەڕێت بیپارێزە.

Exercisesڕاهێنانەکان

ExerciseڕاهێنانLocal or cloud?ناوخۆیی یان هەور؟

Decide where each job should run — on the device, on a gateway or in the cloud — and give a reason: (a) shutting a gas valve when a leak is detected; (b) calculating the monthly electricity bills of 100,000 homes; (c) the greenhouse rule "open the vents above 30 °C"; (d) predicting next year's tomato harvest from ten years of data; (e) a door lock that must open with the owner's phone even when the internet is down.

بڕیار بدە هەر کارێک لە کوێ ئەنجام بدرێت — لەسەر ئامێرەکە، لەسەر یان لە هەوردا — و هۆکارێک بنووسە: (أ) داخستنی سەمامی گاز کاتێک دزەیەک دەدۆزرێتەوە؛ (ب) ژماردنی پسوولەی مانگانەی کارەبای ⁦100⁩ هەزار ماڵ؛ (ج) ڕێسای سەوزەخانە «لە سەرووی ⁦30 °C⁩ پەنجەرەکان بکەرەوە»؛ (د) پێشبینیکردنی بەروبوومی تەماتەی ساڵی داهاتوو لە دە ساڵ؛ (ه) قفڵێکی دەرگا کە دەبێت بە مۆبایلی خاوەنەکەی بکرێتەوە تەنانەت کاتێک پچڕاوە.

Show answerوەڵامەکە پیشان بدە
  • (a) on the device — safety-critical, must act in milliseconds and offline;
  • (b) in the cloud — lots of data, no hurry;
  • (c) on the device (or the greenhouse gateway) — it must work without the internet;
  • (d) in the cloud — heavy analysis of years of data;
  • (e) on the device, with a direct phone link such as Bluetooth LE — the internet is not needed for the main job.
  • (أ) لەسەر ئامێرەکە — هەستیاری سەلامەتییە، دەبێت لە چەند میلیچرکەیەکدا و بەبێ کار بکات؛
  • (ب) لە هەوردا — زۆر، هیچ پەلەیەک نییە؛
  • (ج) لەسەر ئامێرەکە (یان سەوزەخانەکە) — دەبێت بەبێ کار بکات؛
  • (د) لە هەوردا — شیکاریی قورسی چەندین ساڵ؛
  • (ه) لەسەر ئامێرەکە، بە پەیوەندیی ڕاستەوخۆی مۆبایل وەک Bluetooth LE — بۆ کارە سەرەکییەکە پێویستی بە نییە.
ExerciseڕاهێنانThree hours offlineسێ کاتژمێر بەبێ ئینتەرنێت

At noon in July the internet link of the Halabja greenhouse fails for three hours. Describe what happens (a) with the relay model and (b) with local processing.

لە نیوەڕۆی مانگی تەممووزدا پەیوەندیی سەوزەخانەکەی هەڵەبجە سێ کاتژمێر دەپچڕێت. ڕوونی بکەرەوە چی ڕوودەدات (أ) لە مۆدێلی ڕەوانەکردندا و (ب) لە ناوخۆییدا.

Show answerوەڵامەکە پیشان بدە
  • (a) Relay: readings cannot reach the cloud and no commands come back. The vents stay shut while the temperature climbs past 30 °C — the plants can be damaged, and the farmer gets no alert either.
  • (b) Local: the microcontroller opens the vents by itself and sounds a local alarm. It stores the readings and sends a summary when the link returns.
  • (أ) ڕەوانەکردن: خوێندنەوەکان ناگەنە هەور و هیچ فەرمانێک ناگەڕێتەوە. پەنجەرەکان داخراو دەمێننەوە کاتێک پلەی گەرمی لە ⁦30 °C⁩ تێدەپەڕێت — ڕووەکەکان زیانیان پێدەگات و جووتیارەکەش هیچ ئاگادارییەک وەرناگرێت.
  • (ب) ناوخۆیی: خۆی پەنجەرەکان دەکاتەوە و ئاگادارکەرەوەیەکی ناوخۆیی لێدەدات. خوێندنەوەکان هەڵدەگرێت و کاتێک پەیوەندییەکە گەڕایەوە پوختەیەک دەنێرێت.
ExerciseڕاهێنانA data budgetبودجەی دراوە

A farm camera streams video at 1 Mbit/s all day. (a) How many gigabytes does it send in a 30-day month? (b) If it detects motion itself and sends only 50 clips a day, each 10 seconds long at 2 Mbit/s, how much is that per month?

کامێرایەکی کێڵگە بە درێژایی ڕۆژ بە خێرایی ⁦1 Mbit/s⁩ ڤیدیۆ پەخش دەکات. (أ) لە مانگێکی ⁦30⁩ ڕۆژیدا چەند دەنێرێت؟ (ب) ئەگەر خۆی جووڵە بدۆزێتەوە و ڕۆژانە تەنیا ⁦50⁩ کلیپ بنێرێت، هەر یەکەیان ⁦10⁩ چرکە بە ⁦2 Mbit/s⁩، مانگانە دەکاتە چەند؟

Show answerوەڵامەکە پیشان بدە
(a)1 000 0008×86 400×30=324×109 B=324 GB(b)50×10×2 000 0008×30=3.75×109 B=3.75 GB\begin{aligned} \text{(a)}\quad & \tfrac{1\,000\,000}{8} \times 86\,400 \times 30 = 324 \times 10^{9}\ \text{B} = 324\ \text{GB} \\ \text{(b)}\quad & 50 \times 10 \times \tfrac{2\,000\,000}{8} \times 30 = 3.75 \times 10^{9}\ \text{B} = 3.75\ \text{GB} \end{aligned}

(a) About 324 GB a month; (b) 3.75 GB a month, about 86 times less.

(أ) نزیکەی ⁦324 GB⁩ لە مانگێکدا؛ (ب) ⁦3.75 GB⁩ لە مانگێکدا، نزیکەی ⁦86⁩ جار کەمتر.

ExerciseڕاهێنانDraw the trust boundariesسنوورەکانی متمانە بکێشە

Draw a smart doorbell system: the doorbell, the indoor chime, the home Wi-Fi router, the internet, the doorbell company's cloud and the owner's phone. Mark the trust boundaries and say what should be protected when data crosses them.

سیستەمی زەنگێکی هۆشمەندی دەرگا بکێشە: زەنگی دەرگاکە، زەنگی ناو ماڵ، ماڵ، ، هەوری کۆمپانیای زەنگەکە و مۆبایلی خاوەنەکە. دیاری بکە و بڵێ کاتێک لێیان تێدەپەڕێت چی دەبێت بپارێزرێت.

Show answerوەڵامەکە پیشان بدە

One boundary runs around the home network (doorbell, chime and router inside). A second runs around the company's cloud. The owner's phone sits outside the home, on a mobile network. Video and alerts that cross the boundaries should be encrypted and authenticated; the cloud should keep as little video as possible and delete it after a set time; motion detection can stay inside the home.

سنوورێک بە دەوری ماڵدا دەڕوات (زەنگی دەرگا، زەنگی ناو ماڵ و لە ناوەوەن). سنوورێکی تر بە دەوری هەوری کۆمپانیاکەدا. مۆبایلی خاوەنەکە لە دەرەوەی ماڵە، لەسەر . ئەو ڤیدیۆ و ئاگادارکردنەوانەی لە سنوورەکان تێدەپەڕن دەبێت شفرە بکرێن و ڕەسەنایەتییان بپشکنرێت؛ هەور دەبێت کەمترین ڤیدیۆ هەڵبگرێت و دوای ماوەیەکی دیاریکراو بیسڕێتەوە؛ دۆزینەوەی جووڵە دەتوانێت لە ناو ماڵدا بمێنێتەوە.

Summaryپوختە

  • Cloud intelligence: devices send simple data and far-away servers decide. Local intelligence: the device decides itself (a thermostat).
  • Process locally for speed and offline work (crash sensors); in the cloud for heavy computing and big storage (storm prediction).
  • The relay model forwards readings and waits for commands; local processing decides on the device and sends only summaries.
  • Choosing the architecture balances performance and cost, where the computing power sits, networking costs, data volume (and offline needs) and infrastructure — plus security and trust boundaries.
  • Device, gateway and cloud each have their strengths; together they are edge, fog and cloud computing.
  • ژیریی هەور: ئامێرەکان سادە دەنێرن و دوور بڕیار دەدەن. ژیریی ناوخۆیی: ئامێرەکە خۆی بڕیار دەدات ().
  • لە شوێنی خۆیدا بۆ خێرایی و کارکردن بەبێ ( پێکدادان)؛ لە هەوردا بۆ ژمێرکاریی قورس و گەورە (پێشبینیی زریان).
  • مۆدێلی ڕەوانەکردن خوێندنەوەکان دەنێرێت و چاوەڕێی فەرمان دەکات؛ ناوخۆیی لەسەر ئامێرەکە بڕیار دەدات و تەنیا پوختە دەنێرێت.
  • هەڵبژاردنی تەلارسازی هاوسەنگییە لە نێوان کارایی و تێچوو، شوێنی هێزی ژمێرکاری، تێچووی ، قەبارەی (و پێویستیی کارکردن بەبێ ) و ژێرخان — لەگەڵ و .
  • ئامێر، و هەور هەر یەکەیان خاڵی بەهێزی خۆی هەیە؛ پێکەوە ، و .
Review questionsپرسیارەکانی پێداچوونەوە
What is the sensor-data relay model?مۆدێلی ڕەوانەکردنی خوێندنەوەی هەستەوەرەکان چییە؟

The device only forwards its sensor readings to the cloud, and the cloud sends back commands to change its output.

ئامێرەکە تەنیا خوێندنەوەکانی دەنێرێت بۆ هەور و هەور فەرمان دەگەڕێنێتەوە بۆ گۆڕینی .

Give two reasons to process data on the device.دوو هۆکار بۆ چارەسەرکردنی دراوە لەسەر ئامێرەکە بنووسە.

Any two: fast reactions, working without the internet, less data to send, private data stays home.

هەر دووان: کاردانەوەی خێرا، کارکردن بەبێ ، کەمتر بۆ ناردن، تایبەت لە ماڵەوە دەمێنێتەوە.

What is a trust boundary?سنووری متمانە چییە؟

A line where data passes from a part you control and trust to a part you trust less, such as from your home to a company's cloud.

هێڵێکە کە لە بەشێکی کۆنترۆڵکراو و جێی متمانەوە تێدەپەڕێت بۆ بەشێکی کەمتر جێی متمانە، وەک لە ماڵەکەتەوە بۆ هەوری کۆمپانیایەک.

Why does a smart doorbell keep some processing local?بۆچی زەنگی هۆشمەندی دەرگا هەندێک چارەسەرکردن لە شوێنی خۆیدا دەکات؟

So it still rings and records when the internet is down, and so private video need not leave the home.

بۆ ئەوەی کاتێک پچڕاوە هێشتا لێبدات و تۆمار بکات و ڤیدیۆی تایبەت پێویست نەکات ماڵ جێبهێڵێت.

Lesson complete!وانەکە تەواو بوو!

Well done. Review the key terms, then go on to the next lesson.دەستخۆش. سەیرێکی زاراوە سەرەکییەکان بکەرەوە، پاشان بڕۆ بۆ وانەی داهاتوو.

Key termsزاراوە سەرەکییەکان

Next lessonوانەی داهاتوو

Cloud, Fog and Edge Computingهەورەژمێرکاری، ژمێرکاریی تەم و ژمێرکاریی لێوار

References and further readingسەرچاوەکان و خوێندنەوەی زیاتر

This lecture is a first edition. The Kurdish text and terminology are waiting for review by Kurdish IT teachers.ئەم وانەیە چاپی یەکەمە. دەقە کوردییەکە و زاراوەکانی چاوەڕێی پێداچوونەوەی مامۆستایانی کوردی بواری IT ن.

Appearanceڕووکار

Modeدۆخ
Styleشێواز
Coloursڕەنگەکان

Saved on this device only.تەنیا لەسەر ئەم ئامێرە پاشەکەوت دەکرێت.