The operating system of the Internet of Things is different from the traditional personal computer operating system and smart phone operating system, and it has some unique characteristics in the application field of the Internet of Things, as follows.
Characteristics of the kernel of the Internet of Things operating system
1, the kernel size is flexible and can adapt to different hardware platforms. For example, in extreme cases, the kernel size must be kept within 10K to support sensors with limited memory and CPU performance. At this point, the kernel already has basic task scheduling and communication functions. At the other extreme, the kernel must have perfect thread scheduling, memory management, local storage, complex network protocols, graphical user interface and other functions to meet the needs of high-configuration intelligent Internet of Things terminals. At this time, the size of the kernel will inevitably increase greatly, reaching several hundred K or even M-level. This scalability of kernel size can be achieved by two methods: recompilation and selective loading of binary modules. The measure of recompiling is very simple, just choose the required functional modules according to different application goals, and then recompile the kernel. This measure is suitable for the situation that the kernel customization is very deep, such as the situation that the kernel size is required to be below 10K. Choose to load the binary module and use it when the kernel customization is not very deep. At this point, an operating system configuration file is maintained, which lists all binary modules that the operating system needs to load. After the kernel initialization is completed, the required binary modules will be loaded according to the configuration file. This requires the terminal equipment to have external memory (such as hard disk, flash memory, etc.). ) to store the binary module to be loaded;
2. The real-time performance of the kernel must be strong enough to meet the needs of key applications. Most IOT devices require the operating system kernel to be real-time, because many key actions must be completed in a limited time, otherwise it will lose its meaning. The real-time performance of kernel contains many meanings. The first is the real-time interrupt response. Once an external interrupt occurs, the operating system must respond and handle the interrupt in a short enough time. Second, thread or task scheduling is real-time. Once the resources or conditions for further operation of a task or thread are ready, it must be scheduled immediately. Obviously, the kernel based on nonpreemptive scheduling mode is difficult to meet these real-time requirements;
3. The kernel architecture is highly scalable. The kernel of the Internet of Things operating system should be designed as a framework, which defines some interfaces and specifications. As long as these interfaces and specifications are followed, it is easy to add new functions and new hardware support to the operating system kernel. Because the application environment of the Internet of Things is broad-spectrum, it requires that the operating system must be extensible to adapt to the new application environment. The kernel should have a device management mechanism based on bus or tree structure, which can dynamically load device drivers or other core modules. At the same time, the kernel should have the dynamic loading function of external binary modules or applications, which are stored in external media, so there is no need to modify the kernel, only need to develop new applications to meet specific industry needs;
4. The kernel should be safe and reliable enough. There is no doubt that the application environment of the Internet of Things has the characteristics of high automation and less human intervention, which requires the kernel to be reliable enough to support long-term independent operation. Security is more critical for the Internet of Things, even related to the lifeline of the country. For example, if an unsafe kernel is applied to the state grid control, once it is invaded by the outside world, the impact will be incalculable. In order to strengthen security, the kernel should support memory protection (VMM and other mechanisms), exception management and other mechanisms to isolate error codes when necessary. Another security strategy is not to open the source code, or not to open the kernel source code of key parts. Unfair open source code is just a security policy, which does not mean that the kernel cannot be used for free;
5. Save energy and electricity to support sufficient battery life. When the CPU is idle, the operating system kernel should reduce the running frequency of the CPU or simply turn it off. For peripheral equipment, it is also necessary to judge the running state in real time, and once it enters the idle state, it is necessary to switch to the power-saving mode. At the same time, the operating system kernel should try to reduce the interrupt frequency, such as adjusting the clock frequency of the system to the lowest without affecting the real-time performance, and saving electricity as much as possible.
Characteristics of peripheral modules of Internet of Things operating system
Peripheral module refers to some functional features that an operating system should have in order to adapt to the application characteristics of the Internet of Things, such as remote maintenance and upgrade. At the same time, it also refers to some functional modules, such as file system and network protocol stack, which are developed to expand the functional scope of the kernel of the Internet of Things operating system. The peripheral module (or peripheral function) of the Internet of Things operating system shall at least meet the following conditions:
1. Support remote upgrade of operating system kernel, device driver or application. Remote upgrade is the most basic feature of the Internet of Things operating system, which can greatly reduce the maintenance cost. After the remote upgrade is completed, you can continue to use the original device configuration and data. Even if the upgrade fails, the operating system should be able to return to its original running state. Remote upgrade and maintenance is one of the main measures to support the large-scale deployment of the Internet of Things operating system.
2. Support universal file system and external storage. For example, it supports file systems such as FAT32/NTFS/DCFS, and common storage devices such as hard disk, USB Flash drive, ROM, etc. When the network connection is interrupted, the external storage function will play an important role. For example, the collected data can be temporarily stored and then uploaded to the data center after the network is restored. However, the code of file system and storage driver should be effectively separated from the core code of operating system and can be easily cut;
3. Support maintenance functions such as remote configuration, remote diagnosis and remote management. This includes not only common remote operation functions, such as remote modification of equipment parameters and remote viewing of operation information. It should also include deeper remote operations, such as the ability to remotely view the state of the operating system kernel, remotely debug threads or tasks, and remotely dump the state of the kernel when the kernel is abnormal. These functions need not only the support of peripheral applications, but also the natural support of the kernel;
4. Support perfect network functions. The operating system of Internet of Things must support perfect TCP/IP protocol stack, including IPv4 and IPv6. The protocol stack should be flexible and extensible to meet the needs of tailoring. For example, the protocol stack can only support IP/UDP and other protocol functions by cutting, so as to reduce the code amount. At the same time, it also supports a rich IP protocol family, such as Telnet/FTP/IPSec/SCTP, which is suitable for intelligent terminals and high security and reliability applications.
5. Provide built-in support for common wireless communication functions of the Internet of Things. For example, it supports public network wireless communication functions such as GPRS/3G/HSPA/4G, near-field communication functions such as Zigbee/NFC/RFID, and desktop network interface functions such as WLAN/ Ethernet. These different protocols should be able to convert each other, and the data messages obtained from one protocol can be converted into messages of another protocol and sent out. In addition, it should also support SMS, voice communication, video communication and other functions;
6, built-in support XML file parsing function. In the Internet of Things era, there will be serious obstacles to information enjoyment between different industries and even between different fields of the same industry. Data sharing in XML format can break this obstacle, so XML standards will be more widely used in the field of Internet of Things. The Internet of Things operating system should have built-in support for XML parsing, and the configuration data of all operating systems should be stored in XML format. At the same time, it can also parse the XML format defined by the industry itself and complete the industry conversion function;
7. Support perfect GUI function. Intelligent terminals of the Internet of Things generally use graphical user interface (GUI) to complete the interaction between users and devices. GUI should define a complete framework to facilitate the expansion of graphic functions. At the same time, we should implement common user interface elements, such as text boxes, buttons, lists and so on. In addition, the GUI module should be separated from the operating system kernel, and it is best to support the binary dynamic loading function, that is, the operating system kernel dynamically loads or unloads the GUI module according to the needs of the application. The efficiency of GUI module should be high enough, and the time from the user's input confirmation to the execution of specific actions (which can be called click-start time) should be short enough, so that users can't click OK but wait for a long time to perform tasks;
8. Support dynamic loading of applications from external storage media. The Internet of Things operating system should provide a set of APIs for different applications to call, which should change in real time according to the peripheral modules loaded by the operating system. For example, in the case of loading a GUI module, it is necessary to provide system calls for GUI operations, but in the case of no GUI module, GUI function calls should not be provided. At the same time, the operating system, GUI and other peripheral modules and application modules should be separated in binary, and the operating system can dynamically load applications from external storage media as needed. This structure makes the whole operating system have strong expansibility. Operating system kernel and peripheral modules (GUI, network, etc. ) provides basic support, and various industrial applications are realized through applications. Finally, when the software is released, only the operating system kernel, required peripheral modules and application modules can be released.
Characteristics of Integrated Development Environment for Internet of Things Operating System
Integrated development environment is a key tool to build industrial applications, and the Internet of Things operating system must provide convenient and flexible development tools to develop applications suitable for industrial applications. The development environment must be mature enough and widely used to shorten the time to market (GTMT) of applications. The integrated development environment must have the following characteristics:
1. The Internet of Things operating system should provide rich and flexible APIs for programmers to call. This API should be able to support multiple languages, such as C/C++, Java, Basic and other programming languages.
2. It is best to make full use of the existing integrated development environment. For example, you can use integrated development environments such as Eclipse and Visual Studio. These integrated development tools have a wide application base and can get good technical support directly on the Internet.
3. Besides the integrated development environment, a compact application format (similar to the PE format of Windows) should be defined and implemented to meet the special needs of the Internet of Things. By customizing the integrated development environment, the code generated by the integrated development environment can follow this format;
4. Provide a set of tools to facilitate application development and debugging. For example, provide application download tools and remote debugging tools to support the whole development process.
It can be seen that the kernel, peripheral modules and application development environment of the above-mentioned Internet of Things operating system are all supporting platforms for supporting the next level of industrial applications. Industrial application is the software that ultimately produces productivity, but the Internet of Things operating system is the basis for the strong growth and long-term effective survival of industrial applications. Only with a powerful and flexible operating system of the Internet of Things can the tree of the Internet of Things bear rich fruits.