Do you know how to make dumb terminals evolve?

Time:2020-8-14

Abstract:When it comes to the Internet of things, one of the biggest problems is communication, communication between different devices and standards, and communication between software and hardware. How to solve this “communication” problem, the operating system becomes particularly important.

When it comes to operating systems, we think of Windows running on computers and Android running on mobile phones. These systems run directly in the lowest layer of “bare machine” equipment, and build the environment and foundation for other software and application operation. The rise and improvement of the operating system has contributed to the rise of software and application, which has created a brilliant era of PC and mobile Internet.

When it comes to the Internet of things, one of the biggest problems is communication, communication between different devices and standards, and communication between software and hardware. How to solve this “communication” problem, the operating system becomes particularly important. The Internet of things operating system schedules the “object” itself, and the scheduling process of “object” is realized by layer by layer distribution and release, and by scheduling the computing resources of different devices in cloud, edge, end and different levels. Therefore, the operating system in the Internet of things involves chip layer, terminal layer, edge layer, cloud layer and so on

At present, many Internet of things devices have successfully transformed from traditional dumb devices to intelligent devices. Then a device from “dumb” to intelligent, must face two problems: resource management, equipment interconnection.In this era when a hundred schools of thought contend and a hundred flowers blossom in the Internet of things operating system, how does Huawei liteos Internet of things operating system break through the waves?

Liteos resource management: Although a sparrow is small, it has five internal organs

When it comes to the operating system of the Internet of things, we have to mention the core of the Internet of things. A kernel must have strong scalability, strong real-time performance, strong scalability, security and reliability, low power consumption, energy saving and power saving. For example, in an extreme case, the kernel size must be kept within 10K to support sensors with limited memory and CPU performance. This requires the kernel to have perfect task scheduling, memory management, local storage, complex network protocol and other functions to meet the requirements of high configuration intelligent Internet of things terminals.

The resource management of liteos kernel can be divided into four parts: time management, storage management, hardware management and synchronous communication resources. In the bottom layer of liteos, we realize a general abstraction of all kinds of hardware, which is mainly to solve the coupling between liteos and CPU system. For the core of operating system, the coupling with CPU mainly lies in task scheduling and exception handling, which is strongly related to each CPU architecture. The task scheduling of liteos is based on the CPU architecture rather than a single specific CPU,At present, it supports armv6m, armv7m, risic-v, etc., which means that liteos can be seamlessly transplanted to the products of different MCU manufacturers and reduce the difficulty for device manufacturers to switch hardware.

General memory management is the use of double linked list mode, on-demand allocation. Then there will be a problem at this time, how to manage the bidirectional linked list? The common two-way linked list is troublesome to find, and the ordered two-way linked list has uncertainty on the sorting time, which will bring trouble to developers. In order to reduce the uncertainty of time search for developers,Liteos uses TLSF and binary search tree based on red black tree, which will greatly reduce the complexity of our search.When the memory has been applied and released many times, the linear linked list of the organization’s free memory may be very long. In this case, it may be very difficult to search for a matching memory, because you don’t know where the most suitable memory is (possibly at the end of the list). Instead ofTLSFBy calculating the location of the map, a hit can be made at one time, which makes the time for developers to find a piece of free memory more certain.

At the same time,The interrupt management, driver and other functions of liteos bring better development experience to traditional bare metal developers.For example, interrupt management. We know that on MCU, there are many serial ports. Each serial port may be assigned an interrupt number. If you are a bare metal developer, you will have to write many interrupt service functions and mount them to the interrupt table.For the interrupt management of liteos, developers can transfer the same service function by registering, and only need different parameters. This means that developers can realize the maximum reuse of serial interrupt functions. The same principle can also be applied to drivers.

Liteos interconnection: one of the interesting souls, a favorite bag of developers — providing fast integration and unified protocols

The resource management of liteos is to meet the demands of developers for resource management and to solve the fragmentation of hardware in the Internet of things. Taking TCPIP communication as an example, there are various ways to realize TCPIP communication, such as using socket of cellular module, PPP dialing, wiif module and LwIP software protocol stack. It’s not that it’s bad. After all, they are interesting souls. But for developers, there is a problem. In order to ensure compatibility, they have to develop based on TCPIP, which leads to various macro switches in the code. In the end, the code can hardly be maintained.

In order to solve the problem of destructive maintenance caused by various ways of adaptation by developers,Liteos proposes component function standardization。 Whether you are WiFi module, LTE module or other software stack, as long as the unified standard API is adopted, various forms of components are just like an option on the menu, and you just need to tick to select what you want.Liteos operating system from the kernel to the abstract layer framework of internet protocol, to build a unified API standard. Based on this standard, developers can quickly insert protocols or other components into the framework to help developers reuse existing capabilities and accelerate the efficiency of integration.

Liteos one click cloud: using building block components and assembly mode, it is more flexible and light

In the cloud management end strategy of Huawei cloud IOT, liteos plays a key role in the implementation of cloud servicesTherefore, how to better and more reasonable guide terminal devices to the cloud quickly is the main goal of liteos. Generally speaking, liteos can be divided into two parts

  • The core of liteos is mainly used to manage end-to-side resources, so that end-to-side devices can use various hardware resources better and more conveniently;
  • With the interconnection and interoperability of liteos, cloud services are protocol independent and can be easily integrated on various traditional devices.

In principle, the modules of liteos can be decoupled, tailorable and configurable in the development and design process. You can see from thisOn the whole, liteos belongs to “building block development”Developers can choose different solutions according to their actual application scenarios to solve the fragmentation problem of the Internet of things.

However, to build a satisfactory work with the original small building blocks, there must be a design process, including which protocol to choose and which component to use. In fact, the Internet of things equipment has a “big problem” – limited storage resources and computing resources. For example, in addition to occupying tens of KB of ROM and ram, TLS also consumes a lot of computing resources. In a 200m MCU, in echda mode, the handshake protocol process takes nearly 10 seconds, which may be longer for those low-speed devices.

In this case, would you be surprised if you were told that there is a module that can directly communicate with Huawei cloud IOT through simple at instructions?Huawei liteos integrates the interconnection function into the module, enriching self computing resources and storage resources. The device manufacturer can call the liteos interconnection API through simple at instructions, which saves the trouble of porting and configuration, and does not need to consider the underlying process and details of cloud docking.

Maybe you’re curious about liteos

Linux system is the most widely used operating system in Internet of things devices. What is the difference between liteos and Linux?

Compared with other Internet of things operating systems, what are the advantages of liteos?

Is there any difference between using Huawei liteos system and accessing Huawei cloud lot platform with other systems?

What are the new features of liteos in the future?

Watch the video to learn more

Click follow to learn about Huawei’s new cloud technologies~