Understanding Edge Computing: The Future of IoT

At the beginning of 2018, our social circles were flooded with discussions on Artificial Intelligence and Blockchain. However, let’s not forget that the next big wave will inevitably involve the Internet of Things (IoT). In this era of interconnected devices and intelligent systems, smart IoT empowers everything with perception through networks, forming vast amounts of data in the cloud and applying intelligent solutions on the ground.

On January 18, 2018, Baidu Cloud launched the first domestic edge computing product, “Smart Edge”, which integrates Baidu’s ABC (AI, Big Data, Cloud) to create a one-stop, fully managed smart IoT platform. This platform provides a complete range of cloud services for IoT, from data collection, transmission, computation, storage, display to analysis, empowering partners and developers to build various smart IoT applications.

On April 21, the 78th Baidu Technology Salon, hosted by Baidu Developer Center and Baidu Cloud Intelligence Academy, and organized by Geekbang Technology, invited three speakers: Li Leding, a senior architect from Baidu Cloud IoT Department; Huang Miao, a senior product manager from Baidu Cloud IoT Department; and Zhong Ziyan, a front-end engineer from Baidu Cloud IoT Department. They interpreted Baidu Cloud’s edge computing and visual IoT, discussing application scenarios and development trends of IoT from edge to cloud.

1 Edge Computing: The Next Battlefield for IoT

Li Leding, a senior architect from Baidu Cloud IoT Department, delivered the opening speech. He emphasized that Baidu Cloud IoT Department has been dedicated to connecting everything through the Internet, empowering everything with intelligence through the cloud, and simplifying complex production and living processes. Over the past year, they have been deeply collaborating and exploring with various industries to actively enhance operational efficiency.

New Wave of IoT Development

The IoT is thriving in various fields, and the era of interconnected devices is approaching. However, with the development of business, it has become evident that the traditional method of connecting devices to a central server in a public cloud cannot meet the practical needs of many scenarios. For example, connecting traditional devices to a central server incurs significant costs due to network latency and bandwidth; privacy protection and compliance are becoming increasingly important; and many devices in use today are limited by power and network conditions, leading to the fundamental issue that your devices may not be able to connect to the cloud and central server in real-time.

Cloud-Based IoT Solutions

Understanding Edge Computing: The Future of IoT

To address the aforementioned issues, Baidu Cloud proposed a cloud-based IoT solution. The above image shows the overall architecture of Baidu Cloud’s Tian Gong, which supports connecting devices to the cloud through various protocols, utilizing the one-stop fully managed platform services of Tian Gong’s smart IoT platform. Baidu Cloud Tian Gong Portal:

https://cloud.baidu.com/solution/iot/index.html

In the era of edge-cloud integration, can we provide a new generation of IoT solutions that benefit locally? Baidu Cloud has thus embarked on a new exploration: Edge Computing—IntelliEdge.

IntelliEdge: Smart Edge Computing Service

Understanding Edge Computing: The Future of IoT

IntelliEdge, a smart edge computing service, is presented in software form. As shown in the image, devices are categorized into two types: one type is called core devices, which have the IntelliEdge software installed, serving as the center of the local IoT; the other type is associated devices, whether they are vehicles, household devices, or industrial equipment, can send messages to the core device, triggering messages and performing a series of calculations to discover the intelligence of the devices. However, such IntelliEdge cannot completely isolate the cloud and some devices, so Baidu Cloud connects the core devices with the cloud, enabling seamless integration of edge products with devices, synchronizing cloud capabilities and device capabilities.

If you’re interested, you can check the product details here:

https://cloud.baidu.com/solution/iot/intelligent_edge.html

Let’s take a closer look at Baidu Cloud Tian Gong’s edge computing and explore it further!

Core Functions of Edge Computing

“Smart Edge Core” is mainly responsible for local computation, message sending and receiving, security authentication, and cloud interaction. The specific functions are as follows:

  • Local message sending and receiving

    • Associated devices connect to core devices using MQTT protocol

    • Pub/Sub messaging model, supporting at-most-once and at-least-once two levels of QoS

    • Supports session retention, ensuring no message loss during disconnection

  • Maintain cloud synchronization capabilities, supporting Baidu’s infinite computing and storage

    • Supports publishing messages to the cloud and subscribing to cloud messages

    • Mandatory use of TLS to ensure data security

  • Provides a local function computing engine

    • Deeply integrated with Baidu Cloud Function Computing (CFC), cloud development and testing, local execution

    • Built-in SQL and Python runtime, supporting custom extensions, enabling easy high-speed processing capabilities

  • Local rule engine

    • General source->target forwarding mode

    • Both source and target support message topics, cloud topics, and functions

Edge-Cloud Integration

From Baidu Cloud’s perspective, while private clouds are very useful for many scenarios and enterprises, they isolate the relationship between the enterprise’s IT infrastructure and the public cloud. We all know that human demand for computing is endless; if disconnected from the cloud, enterprises will lose the cost-saving benefits brought by the cloud. Therefore, a private cloud is not the only solution. The real solution is to appropriately connect private conditions and environments with public environments, achieving edge-cloud integration.

In the IoT environment, we can assume that the addition, deletion, modification, and querying of devices, as well as the creation and modification of rules, and the writing and testing of functions, will not pose serious security risks, and can be entrusted to the public cloud. Therefore, Baidu Cloud provides cloud management, sharing edge computing software on the same Baidu Cloud, allowing users to write directly in the cloud. However, due to data privacy requirements, latency needs, and bandwidth limitations, all computations should occur locally.

Understanding Edge Computing: The Future of IoT

The above image illustrates Baidu Cloud’s edge-cloud integration solution, enabling remote configuration through clicks to ensure user data security. Through edge-cloud integration, devices can work offline, automatically synchronizing with the cloud upon connection, determining what data to synchronize with the cloud, what data to retain locally, and upgrade notifications based on rules.

Features of IntelliEdge

Understanding Edge Computing: The Future of IoT

First, IntelliEdge can achieve instant response based on local computation, with message generation requiring only a millisecond.

Second, it is ultra-lightweight. Today’s IoT devices vary widely; some may require a huge server, while others may use a simple PAD at home. However, IntelliEdge only requires 10MB of memory and disk space, with no external dependencies.

Third, it is highly portable. The software supports Linux, Windows, and MacOS, while the hardware supports X86, ARM, and MIPS. IntelliEdge can run on low-power digital PADs as well as on large industrial control machines supporting hundreds of thousands of computations.

Implementation and Design of Edge Computing

In addition to introducing Baidu’s intelligent edge computing service, Li Leding also shared insights on Baidu’s edge computing technology, including detailed interpretations of how to create an IntelliEdge software and architecture.

Basic Topology

Understanding Edge Computing: The Future of IoT

First, Li Leding believes that architects should possess the ability to abstract, not diving into details first, but instead examining at the highest level what layers are needed to complete the business. Here, Baidu Cloud believes that edge computing consists of three simple components: devices, message relay, and applications. Edge computing completes message communication and routing forwarding at the message relay service center, organizing and analyzing data in applications, and performing function computations.

Device Authentication

With the above basic architecture, edge computing is 50% complete. So how do we achieve the other 50%? The first thing is security; all software must prioritize security. In device authentication, Baidu Cloud employs MQTT’s internal authentication features, including Principal and ClientID. The Principal specifies what information is allowed to be published, collected, and the management permission set, i.e., the topics allowed for PUB and SUB; the ClientID represents the device name, with each ClientID corresponding to a real device or application. The same identity can have different ClientIDs, but multiple clients cannot log in simultaneously with the same ClientID.

Message Relay

Understanding Edge Computing: The Future of IoT

After ensuring security, the next step is message relay. Here we face a 2×2 situation: one is that the publisher is responsible for publishing messages, and the other is that the subscriber needs to subscribe to messages. Both publishing and subscribing have QoS levels; due to low-power devices or overload issues, QoS0 may occur, which means message loss is possible; with QoS0, there is QoS1, indicating that messages may be duplicated but not necessarily lost. Developers familiar with the MQTT protocol may know that MQTT also has QoS=2, which signifies exactly once delivery. This was not mentioned here because having exactly one application scenario in actual use would incur high costs, making it rarely applicable. Therefore, aside from simplifying the architecture, the main focus is on handling necessary tasks and temporarily sidelining QoS2. However, as IoT deepens, QoS2 will continue to receive support.

From an architectural perspective, how do we implement the 2×2 table? The dashed lines represent the message broker. When a message is published, it first enters a unified memory queue. The choice to place it in a unified memory queue has two reasons: first, to reduce system consumption; second, to improve performance. Next is routing, which is a memory queue that is configurable but limited; exceeding this length may lead to direct loss. This helps prevent subscriber overload. Additionally, messages can be written to a retry queue, which continually sends messages to QoS1 until confirmation of receipt. Once QoS1 confirms the message, it still enters the memory queue. Why choose to use the memory queue first for QoS1? If QoS1 were first allocated to the memory queue, it could lead to message loss in case of a crash. The reason for accepting this risk is that IoT devices may be installed in very low-performance situations, necessitating the use of a memory queue. Next, batch writing to KV storage is primarily for lightweight purposes; once in KV storage, it ensures that data is not lost. Then it enters the routing system, which is also divided into two backends: one that allows message loss and another that does not allow loss, forming a retry queue. This message relay architecture completes the 2×2 table.

Function Computation

Understanding Edge Computing: The Future of IoT

This section introduces function computation. A function computation is connected using Runtime, sent to the execution environment, which can be SQL, Python, or ETC. The choice to keep it independent is to prevent Runtime issues. Then, messages are deserialized via STDIN, allowing any acceptable serialization mechanism to be chosen, reflecting the function’s processor. After computation, the results are serialized again, written back to the message terminal via STDOUT, and then sent out. This is function computation.

Resource Control

Understanding Edge Computing: The Future of IoT

Another necessary aspect is resource control. Since the code may not have been written by you, but by third parties or partners, it may contain defects or consume excessive resources. How can we accurately control the resources consumed by each computation? Baidu utilizes Linux Namespace. First, it isolates the network through Linux Namespace, then sequentially uses AUFS and Cgroups, processing network forwarding through large clusters.

Reload

Understanding Edge Computing: The Future of IoT

The design and implementation of edge computing involve Reload, which includes variable and invariant processes. The invariant aspect is that the Listener can continuously send messages while the Broker can continue to operate, and device management remains unchanged. What is variable? First, authentication must change when your new configuration cannot connect to the original device, or when new devices connect, or when permissions change, meaning some devices may need to be discarded. Secondly, functions may change due to new layouts. Lastly, routing changes; while App Old is running, a new App New is created, transferring the original service to the new device, while the old one is handled by App New. After processing, the old one is discarded. Through this smooth Reload, enterprises can achieve a stable system.

Design Principles

Baidu Cloud’s edge computing has many new design principles, such as:

  • Software differs from internet products; quality outweighs efficiency

  • High portability

    • The diversity of IoT devices is significant, with huge differences in hardware and software

    • Choosing Golang, pure static compilation eliminates external dependencies, built-in cross-compilation

  • Strong scalability

    • Must span usage environments from Raspberry Pi, routers to industrial computers and servers

    • Response and throughput are not necessary performance indicators; GC is acceptable without zero-cost abstraction

    • Utilizing the built-in M:N thread model of the language

  • Single-machine architecture

    • Maintaining statelessness, minimizing the state constraint within a minimal set

    • Retaining P2P distributed expansion, broadcasting synchronization routing tables, and passing messages

2 Technical Construction and Industry Applications of Time Series Databases

The era of interconnected devices is also an era of explosive data growth, with billions of data points collected daily and at least hundreds of GB of data accumulated monthly. How to achieve high-concurrency writes for IoT devices, how to respond in seconds within TB-level data, and how to visualize changing curves are detailed answers provided by Huang Miao, a senior product manager from Baidu Cloud IoT Department.

Time Series Database

Huang Miao first interpreted the concept of time series data, which refers to data collected at different points in time, reflecting the changing state or degree of a certain entity or phenomenon over time.

Characteristics of Time Series Data

Understanding Edge Computing: The Future of IoT

Time series data has many characteristics. For example, in the above image, the first characteristic is that it is written more than read; a data point is uploaded every 10 seconds, with 90% of scenarios being write scenarios. The second characteristic is that read and write are orthogonal; each yellow point represents real-time data. When writing, the same timestamp often records the current, voltage, and power of a distribution cabinet, while the most common read scenario is querying voltage values over a period of time, drawing a curve or performing aggregation operations. The third characteristic is the distinction between hot and cold data; data within six months is generally queried and calculated frequently, while data older than six months is usually placed for cold processing and analysis. The fourth characteristic is that old data is rarely deleted; even if the data is not queried, it remains stored and is beneficial for machine learning. The fifth characteristic is that aggregation analysis generally occurs under certain conditions; for example, analyzing the current, voltage, and power of distribution cabinet 2 would involve querying with the condition of distribution cabinet =2. The sixth characteristic is weak transactionality; traditional relational databases have higher transactional requirements.

Baidu Cloud’s Time Series Database (TSDB)

Baidu Cloud TSDB provides users with services divided into three levels. The first is to record changes, which is the most basic duty of a database, diligently recording every piece of data generated by user business, ensuring that it remains unchanged. This requires TSDB to achieve high-concurrency writes, three backups for reliability, defense against DDOS attacks, and separation of hot and cold storage. The second is to understand changes; TSDB has rapid query capabilities and the ability to aggregate billions of data points per second, helping customers quickly obtain the data they want from TSDB. Additionally, it supports web chart visualization and BI tools. Finally, it is about awakening changes, also known as empowering changes; data entering TSDB can seamlessly connect with Baidu’s big data AI capabilities, helping you derive greater value from your business.

Technical Focus of TSDB

As a technical product, Baidu Cloud TSDB provides users with high reliability and performance commercial products, with several important technical solutions as follows:

Understanding Edge Computing: The Future of IoT

Understanding Edge Computing: The Future of IoT

  • Storage. There are two points regarding storage: one is the use of distributed sharded storage, which can be divided into shards based on the characteristics of time series data; the other is tiered storage, analyzing data based on business conditions. For example, data used in the last day is placed in Cache, data from the last year is placed in SSD, and data older than a year, which is not frequently queried, is stored in HDD. Data entered into Cache is written back and through to SSD, while SSD data can also be periodically migrated to HDD.

  • Compression. The goals of compression are twofold: first, to reduce costs, and second, to achieve lossless compression. If data is not compressed, a factory user can generate hundreds of GB of data daily, leading to high equipment costs. Therefore, compression processing is necessary. There are two premises regarding compression: first, there is no universal compression algorithm that can compress all strings; second, there is no formula or function that tells us how short a specific string can be compressed. These two conclusions are supported by rigorous mathematical proofs, which will not be elaborated here. We just need to remember these two conclusions. Based on these conclusions, we can see the challenges of compression. First, we cannot determine which compression algorithm is optimal; second, in certain scenarios, there will be strings that cannot be compressed. Therefore, compression is a challenging task, and the greater the technical challenge, the more suitable it is for Baidu to undertake it, as Baidu has accumulated vast amounts of data in both the Internet and IoT eras, leading to a profound understanding of data’s meaning. This allows us to adopt more suitable compression methods in different scenarios and data forms, improving compression and storage efficiency, bringing us closer to the optimal solution in this challenging task.

Understanding Edge Computing: The Future of IoT

  • Query. The query adopts a sharded approach, divided into ShardA, ShardB, ShardC, and ShardD, synthesizing the final value based on the sharding results, achieving localized computation and high concurrency.

Next, we introduce several unique capabilities of TSDB:

  • Interpolation Queries. In response to issues such as network bandwidth and computational performance, users upload values at a certain frequency, usually reporting changes in data. Therefore, TSDB offers various interpolation algorithms to fill in unreported values, saving storage and upload costs while not compromising data value.

  • Preprocessing. TSDB addresses various nested complex query scenarios, placing high demands on return times, and can also set rules in advance to automatically aggregate historical data.

TSDB Use Cases

Understanding Edge Computing: The Future of IoT

At the end of his speech, Huang Miao used an electric service company as an example to illustrate the workflow of TSDB. The above image shows a data collection cabinet sending data to the IoT access point, which serves as an external service for data access in the cloud, capable of receiving massive data. After receiving the data in the cloud, it undergoes stream processing, filtering, transforming, and forwarding, directly reaching TSDB through the rule engine, forming visual displays, electricity usage analysis, energy consumption management, and energy-saving predictions. This architecture resolves the previous issue of being able to query only two months of hot data; the current time series database can perform real-time queries, returning six months of data within two seconds.

3 Baidu Cloud’s Data Visualization Practice Journey

Baidu Cloud’s “Visual IoT” seamlessly connects massive real-time data, offering a zero-coding design for visual dashboards, supporting monitoring displays on large screens, with customization and embedding features that simplify the development of data visualization applications. Zhong Ziyan, a front-end engineer from Baidu Cloud IoT Department, demonstrated the creation and deployment of dashboards on-site and shared the data source and table creation for the visual IoT solution.

Data Visualization

Understanding Edge Computing: The Future of IoT

Data visualization encompasses three academic directions: scientific visualization, information visualization, and visual analytics, involving various disciplines such as information technology, natural sciences, statistical analysis, and graphics. The data visualization discussed this time primarily concerns the visualization of information, i.e., the interactive representation of abstract data, clearly conveying effective information through graphical means.

Features of Visual IoT

The Visual IoT product combines visualization tools and BI tools to create a data-driven visualization product offering PPT-like interaction and design experiences. Based on the basic concept of Visual IoT, we will detail its product features and advantages:

  • Real-time Insight into Data. Visual IoT supports various data inputs, such as static data, database data, stream data, etc., making data transmission more efficient and lower latency. It supports dynamic driving of basic charts, and every element, including shapes, colors, and text, is displayed in real-time.

  • Diverse Visualization Charts. Visualization charts are divided into five types: the first type includes line charts, bar charts, gauge charts, and time series charts; the second type includes Baidu Maps, featuring device traces and trajectories; the third type includes general components like images, labels, subtexts, and common components; the fourth type includes basic graphics such as circles, rectangles, and arrows; the fifth type includes configuration diagrams for industrial scenarios, such as valves, pipelines, and pumps.

  • Interaction between Applications and Visualization. Visual IoT not only provides zero-coding large-screen data construction but also offers developers a JavaScript runtime library and accompanying JS API to facilitate various complex interactions between applications and visualizations on the same page.

  • Improved Development Efficiency, allowing the completion of monitoring-related visualization application development in 10 minutes, with more features suitable for customized scenarios.

Applicable Scenarios for Visual IoT

Visual IoT is a one-stop data visualization development tool based on Baidu Cloud Tian Gong platform, presenting data to users in a visual format. In the IoT context, what are the application scenarios for Visual IoT’s data visualization?

Visual IoT can monitor data from IoT devices, such as power companies monitoring electricity consumption; it can also manage smart buildings, monitoring current temperature, humidity, and foot traffic; in vehicle networking scenarios, Visual IoT can track vehicle trajectories or logistics; it can also serve as a control center or large screen display for smart communities.

Visual IoT Practical Applications

Understanding Edge Computing: The Future of IoT

Zhong Ziyan demonstrated to the audience two major methods of using Visual IoT. The first is to create a data dashboard by quickly building it with templates or starting from scratch on a blank page to create a customized data visualization dashboard. The second method involves three steps: creating a dashboard, introducing the Visual IoT JS package, and implementing interaction logic to embed visualization components into web applications.

Understanding Edge Computing: The Future of IoT

Visual IoT also provides a variety of example templates. For instance, the above template is suitable for various monitoring large screens. Starting from the left, the top displays the company logo and name, with a digital flip card prominently highlighting electricity data below. Further down is the displayed progress, followed by the workshop temperature detected by a gauge. If any abnormalities occur, the status light and numbers at the bottom will turn red to alert. The middle shows a time series chart, clearly depicting trends. The area chart reflects the trend of electricity purchases, while the lower time series bar chart compares various devices at the same time. The upper right corner shows a clock, along with four indicators of sales data, while the bottom chart clearly lays out some important data.

4 Looking Ahead

Baidu Cloud Tian Gong serves as an essential component of the IoT ecosystem, significantly enhancing it. Meanwhile, Baidu Cloud understands that the future trend will be “big intelligence” in the cloud and “small intelligence” at the edge, gradually launching a complete one-stop “smart edge” service to help clients build intelligent edge devices.

Understanding Edge Computing: The Future of IoT

Leave a Comment