Huawei Hongmeng OS2.0: Planting "Roots" for China's Software Industry

Huawei Hongmeng OS2.0 system definition

HarmonyOS is a "future-oriented" distributed operating system for all scenarios (mobile office, sports health, social communication, media entertainment, etc.). Based on the traditional single-device system capabilities, HarmonyOS proposes a distributed concept based on the same set of system capabilities and adapting to multiple terminal forms, which can support multiple terminal devices.

Hongmeng 1.0

 

 

From Hongmeng 1.0 to Hongmeng 2.0: Distributed capabilities

 

 

 

 

 

 

For consumers, HarmonyOS can integrate the capabilities of various terminals in life scenarios, enabling rapid connection, mutual assistance, and resource sharing between different terminal devices, matching suitable devices, and providing a smooth full-scene experience.

For application developers, HarmonyOS uses a variety of distributed technologies, making application development and implementation independent of the differences in the form of different terminal devices. This allows developers to focus on the upper-level business logic and develop applications more conveniently and efficiently.

For device developers, HarmonyOS adopts a componentized design scheme, which can be flexibly tailored according to the resource capabilities and business characteristics of the device to meet the requirements of different types of terminal devices for the operating system.

In such a special historical period, Hongmeng took the first step. Our future prosperity can be expected, and the future has come.

 

Technical characteristics

Hardware mutual assistance, resource sharing

 

Distributed soft bus is a unified base for a variety of terminal devices. It provides a unified distributed communication capability for the interconnection and intercommunication between devices. It can quickly discover and connect devices, and efficiently distribute tasks and transmit data. Distributed software bus schematic see FIG .

 

Figure 1  Schematic diagram of distributed soft bus

Distributed device virtualization

 

The distributed device virtualization platform can realize resource integration, device management, and data processing of different devices, and multiple devices together form a super virtual terminal . For different types of tasks, match users and select appropriate execution hardware to allow business to flow continuously between different devices and give full play to the resource advantages of different devices. Distributed device virtualization schematic see FIG .

 

Figure 2  Schematic diagram of distributed equipment virtualization

Distributed data management

 

Distributed data management is based on the ability of a distributed soft bus to realize distributed management of application data and user data. User data is no longer bound to a single physical device, business logic is separated from data storage, and data is seamlessly connected when applications run across devices, creating the basic conditions for creating a consistent and smooth user experience. Distributed Data Management schematic see FIG .

 

Figure 3  Schematic diagram of distributed data management

Distributed task scheduling

 

Distributed task scheduling builds a unified distributed service management (discovery, synchronization, registration, call) mechanism based on technical features such as distributed soft bus, distributed data management, and distributed profile, and supports remote startup of cross-device applications, Operations such as remote invocation, remote connection, and migration can select appropriate devices to run distributed tasks based on the capabilities, locations, business operation status, resource usage of different devices, and user habits and intentions.

Figure 4 uses application migration as an example to briefly show the distributed task scheduling capabilities.

 

Figure 4  Schematic diagram of distributed task scheduling

One-time development, multi-terminal deployment

 

HarmonyOS provides a user program framework, an Ability framework and a UI framework to support the reuse of multi-terminal business logic and interface logic in the application development process, enabling one-time application development and multi-terminal deployment, and improving the efficiency of cross-device application development. Once the development, deployment multiport schematic see Figure 5 .

 

Figure 5  Schematic diagram of one-time development and multi-terminal deployment

Unified OS, flexible deployment

 

HarmonyOS supports flexible deployment of multiple terminal devices on demand through componentization and miniaturization design methods, and can adapt to different types of hardware resources and functional requirements. Support the automatic generation of componentized dependencies through the compilation of chain relationships, form a dependency graph of component trees, support the convenient development of product systems, and lower the development threshold of hardware devices.

Support the selection of various components (components are optional) : According to the form and requirements of the hardware, you can select the required components.

Support the configuration of the function set in the component (the component can be large or small) : According to the hardware resource and function requirements, you can choose to configure the function set in the component. For example, choose to configure some controls in the graphics frame component.

Support the association of dependencies between components (the platform can be large or small) : According to the compilation chain relationship, componentized dependencies can be automatically generated. For example, if you select the graphics framework component, the dependent graphics engine components will be automatically selected.

 

Technology Architecture

HarmonyOS follows a layered design as a whole, from bottom to top: kernel layer, system service layer, framework layer and application layer. The system functions are expanded level by level according to "System> Subsystems> Functions/Modules". In a multi-device deployment scenario, it supports tailoring some non-essential subsystems or functions/modules according to actual needs. HarmonyOS technical architecture as in FIG. 1 FIG.

 

Figure 1  Technical architecture

Inner core

 

Kernel subsystem: HarmonyOS adopts a multi-kernel design, which supports the selection of suitable OS kernels for different resource-constrained devices. Kernel Abstract Layer (KAL, KernelAbstract Layer) provides basic kernel capabilities to the upper layer by shielding multi-core differences, including process/thread management, memory management, file system, network management, and peripheral management.

Driver Subsystem: HarmonyOS Driver Framework (HDF) is the foundation of HarmonyOS hardware ecological opening, providing unified peripheral access capabilities and a framework for driver development and management.

System Service Layer

 

The system service layer is a collection of core capabilities of HarmonyOS, which provides services to applications through the framework layer. This layer contains the following parts:

System basic capability subsystem set : provides basic capabilities for the operation, scheduling, migration and other operations of distributed applications on HarmonyOS multi-devices. It consists of distributed soft bus, distributed data management, distributed task scheduling, and Ark multi-language runtime , Public basic library, multi-mode input, graphics, security, AI and other subsystems. Among them, the Ark runtime provides C/C++/JS multi-language runtime and basic system class libraries, and also provides for the static Java program (that is, the part of the application or framework layer developed in the Java language) that uses the Ark compiler Runtime.

Basic software service subsystem set : Provides public and general software services for HarmonyOS, consisting of event notification, telephone, multimedia, DFX, MSDP & DV and other subsystems.

Enhanced software service subsystem set : Provides differentiated capability-enhanced software services for different devices for HarmonyOS, consisting of smart screen proprietary business, wearable proprietary business, IoT proprietary business and other subsystems.

Hardware service subsystem set : Provides hardware services for HarmonyOS, which consists of location services, biometrics, wearable proprietary hardware services, IoT proprietary hardware services and other subsystems.

According to the deployment environment of different equipment forms, the basic software service subsystem set, the enhanced software service subsystem set, and the hardware service subsystem set can be tailored to the granularity of the subsystem, and the interior of each subsystem can be tailored to the granularity of the function.

Frame layer

 

The framework layer provides Java/C/C++/JS and other multi-language user program frameworks and Ability frameworks for HarmonyOS applications , as well as a multi-language framework API open to various software and hardware services; at the same time, it provides C for devices using HarmonyOS /C++/JS and other multi-language framework APIs, the APIs supported by different devices are related to the degree of componentization of the system.

Application layer

 

The application layer includes system applications and third-party non-system applications. The HarmonyOS application consists of one or more FA (Feature Ability) or PA (Particle Ability) . Among them, FA has a UI interface, which provides the ability to interact with users; while PA has no UI interface, it provides the ability to run tasks in the background and a unified data access abstraction. Applications developed based on FA/PA can realize specific business functions, support cross-device scheduling and distribution, and provide users with a consistent and efficient application experience.

 

system security

On distributed terminals equipped with HarmonyOS, it can be ensured that "the right people, through the right equipment, use the data correctly ."

The right person

 

In the distributed terminal scenario, the "right person" refers to data visitors and business operators who have passed identity authentication. The "right person" is a prerequisite to ensure that user data is not illegally accessed and user privacy is not disclosed. HarmonyOS realizes collaborative identity authentication through the following three aspects:

Zero trust model : Based on the zero trust model, HarmonyOS realizes user authentication and access control to data. When users need to access data resources across devices or initiate high-security business operations (for example, operations on security devices), HarmonyOS will authenticate users to ensure the reliability of their identities.

Multi-factor integration authentication : HarmonyOS uses user identity management to associate authentication credentials that identify the same user on different devices to identify a user to improve the accuracy of authentication.

Collaboration and mutual assistance certification : HarmonyOS decouples hardware and certification capabilities (that is, information collection and certification can be completed on different devices) to achieve resource pooling of different devices and mutual assistance and sharing of capabilities, allowing high-security devices to assist Devices with low security levels complete user identity authentication.

Through the "distributed multi-terminal collaborative identity authentication" to ensure the "right person".

 

The right equipment

"Building a trusted operating environment on distributed terminals" to ensure "correct equipment".

Through the "distributed data in the process of cross-terminal flow, classification and hierarchical management of data" to ensure "correct use of data".

In the distributed terminal scenario, only by ensuring that the equipment used by the user is safe and reliable can user data be effectively protected on the virtual terminal and avoid user privacy leakage.

Safe boot

Ensure that the system firmware and applications running on each virtual device at the source are complete and unmodified. Through safe booting, the mirrored packages of various equipment manufacturers are not easily replaced by malicious programs illegally, thereby protecting users' data and privacy.

Trusted execution environment

Provides a hardware-based Trusted Execution Environment (TEE, Trusted Execution Environment) to protect the storage and processing of users' personal sensitive data and ensure that data is not leaked. Due to the different security capabilities of distributed terminal hardware, sensitive personal data of users needs to be stored and processed with high-security equipment. HarmonyOS uses a mathematically provable formal development and verification of the TEE microkernel, and has obtained the commercial OS kernel CC EAL5+ certification rating.

Equipment certificate authentication

Support for pre-setting device certificates for devices with trusted execution environment, used to prove their security capabilities to other virtual terminals. For devices with a TEE environment, a PKI (Public Key Infrastructure) device certificate is preset to provide proof of device identity to ensure that the device is legally manufactured. The device certificate is preset on the production line, and the private key of the device certificate is written and stored safely in the TEE environment of the device, and is only used in the TEE. When the user’s sensitive data (such as keys, encrypted biometrics, etc.) must be transmitted, a secure channel will be established from the TEE of one device to the TEE of another device after using the device certificate to verify the security environment. Realize safe transmission. As in FIG. 1 in FIG.

 

Figure 1  Schematic diagram of device certificate use

Use the data correctly

In the distributed terminal scenario, it is necessary to ensure that users can use data correctly . HarmonyOS protects the entire life cycle around the process of data generation, storage, use, transmission, and destruction, so as to ensure that personal data and privacy, and confidential system data (such as keys) are not leaked.

Data generation : According to the laws, regulations and standards of the country or organization where the data is located, the data is classified and classified, and the corresponding protection level is set according to the classification. The data of each protection level needs to provide security protection of different strengths according to the corresponding security policy during the entire life cycle of its storage, use, and transmission. The access control system of the virtual hyper terminal supports access control strategies based on tags, ensuring that data can only be stored, used, and transmitted between virtual terminals that can provide adequate security protection.

Data storage: HarmonyOS protects data by distinguishing the security level of data and storing it in partitions with different security protection capabilities, and provides seamless flow of keys throughout the life cycle of keys and cross-device key access control capabilities to support distribution Services such as collaborative identity authentication and distributed data sharing.

Data usage: HarmonyOS provides a trusted execution environment for the device through hardware. The user's personal sensitive data is only used in the trusted execution environment of the distributed virtual terminal to ensure that the security and privacy of user data are not leaked.

Data transmission: In order to ensure the safe transfer of data between virtual hyperterminals, each device needs to be correct and trustworthy, a trust relationship is established (multiple devices establish a pairing relationship through Huawei ID), and the trust relationship can be verified to establish security The connection channel, according to the rules of data flow, transmits data safely. When communicating between devices, it is necessary to authenticate the devices based on their identity credentials, and on this basis, establish a secure encrypted transmission channel.

Data destruction: Destroying the key means destroying the data. The storage of data in the virtual terminal is based on the key. When destroying data, you only need to destroy the corresponding key to complete the destruction of the data.

 

Two key points: Distributed technology improvement, ecological opening

In the speech, Wang Chenglu, president of Huawei's consumer business software department, said that Hongmeng 2.0 has a very big improvement compared to 1.0, and this is a very important milestone. On the one hand, thanks to the improvement of distributed technology, EMUI’s capabilities have been fully reused in the Hongmeng 2.0 system in the past year; on the other hand, Hongmeng 2.0 has taken the first step to empower the third-party ecosystem: Huawei has already used It is open to application manufacturers to innovate.

Hongmeng is not a simple replacement for mobile phone systems, but a base for all scenarios. Its three distributed capabilities are distributed software bus, distributed data management and distributed security solutions.

Distributed soft bus

As shown in the figure below, the distributed soft bus is the base of the entire Hongmeng system, and its performance is infinitely close to the capacity of the hard bus, allowing multiple devices to be integrated, making the system extremely fast and smooth.

In the fully integrated adaptive part, Hongmeng system has realized heterogeneous network integration, different devices can be interconnected; self-discovery and self-connection, almost every time the network is changed, very cumbersome configuration is required. Self-connection is found; the third is dynamic delay calibration. Take audio and video synchronization as an example. If the video stream is sent to the large screen and the audio stream is sent to the speakers, the two can be synchronized.

Distributed data management

Distributed data management makes cross-device data processing as convenient and convenient as local. At the distributed file system level, it will be bad if the speed of remote file reading and writing between devices cannot be increased. Huawei is four times faster than the lowest speed of the best Samba system in the industry; The speed of reading between ContentProvide (reading between the same devices) is 1.3 times faster; the speed of distributed retrieval is 1.2 times faster than iOS Core Spotlight.

Distributed security

In fact, in a distributed system, there is a very good opportunity to break through the single-dimensional identity authentication on a single device, and stronger identity authentication can be performed on multiple devices through multiple factors, which not only allows the code to be written once and run on multiple terminals, It can also make the device more secure.

Wang Chenglu said that Huawei can flexibly deploy the microkernel on any device and will open up this capability. At the data level, Huawei has set a series of rules. For example, the highest-level data must be stored on a single-capable device, and the data flow must be ruled. High-level access to low-level is not possible.

 

 

Development tool platform: HUAWEI DevEco Studio

https://developer.harmonyos.com/cn/home/

DevEco Studio supports the development of HarmonyOS applications including smart screens, smart wearables and lightweight smart wearables. It can easily create projects suitable for various devices according to the project wizard, and automatically generate corresponding code and resource templates. At the same time, DevEco Studio also provides multiple programming languages ​​for developers to develop HarmonyOS applications, including Java, JS and C/C++ three programming languages, and supports mixed development scenarios of multiple languages. Therefore, when creating a project for the corresponding equipment, the tool will preset a variety of Ability templates, and recommend that you use a suitable development language.

Reference: https://developer.harmonyos.com/cn/docs/documentation/doc-guides/software_install-0000001053582415

Ark Compiler

Have a macro understanding of computer knowledge (field): https://www.zhihu.com/question/265434988

 

In the field of computer science, from the bottom to the top:

The compiler is a bridge between the human world and the machine world. Any program on the mobile phone needs to go through the process of software development. The language used for software development is a high-level language that is easy for programmers to understand. The program needs to be converted to run on the phone. Into machine code that can be executed efficiently, this conversion process is completed by the compiler. It can be said that the compiler is the software used to generate software, and it is the bridge connecting the software and the chip. Its performance and efficiency directly affect the most basic consumer experience.

A unified programming platform that faces multiple devices and supports multiple languages.

OpenArkCompiler is an open source project from Huawei's Ark Compiler. Huawei Ark Compiler (HuaWei Ark Compiler), static compilation, running platform: HarmonyOS, EMUI, MagicUI, etc.

Four technical features of OpenArkCompiler

 

Able to compile codes in different languages ​​into a set of executable files and execute them efficiently in the runtime environment:

Support multi-language joint optimization and eliminate cross-language call overhead;

Lighter language runtime;

Cooperate with hardware and software to give full play to hardware energy efficiency;

Support diversified terminal equipment platforms.

Source code: https://code.opensource.huaweicloud.com/HarmonyOS/OpenArkCompiler/home

Official website: https://code.opensource.huaweicloud.com/HarmonyOS/OpenArkCompiler/readme

The Ark compiler changes the compiling and operating mechanism of the system and applications, directly compiling high-level languages ​​into machine code, so that the mobile phone can directly understand the "high-level language", eliminating the additional overhead of dynamic compilation of virtual machines, and improving the operating efficiency of the mobile phone.

At the same time, the Ark compiler can also understand program features and use appropriate instructions to execute the program, so it can maximize the capabilities of the chip.

At present, Ark Compiler focuses on Java code performance. In the future, Ark Compiler will cover multiple programming languages ​​(including C/C++, JS, etc.), multiple chip architectures (including CPU, GPU, IPU, etc.), and cover a wider range Business scenario.

 

Innovation in the Internet of Things

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

https://www.openatom.org/#/indexPage

 

Register as a Huawei developer

https://developer.huawei.com/consumer/cn/

 

 

"Open Atom" Open Source Foundation

"Open Atom" Open Source Foundation: https://www.openatom.org/#/indexPage

The goal of OpenHarmony is to support a variety of terminal devices. It can run on 100KB-level resource-constrained devices and wearable devices, and can also run on 100MB-level smart home cameras, driving recorders and other relatively resource-rich devices, as well as GB-level smart TVs and other devices . The first version supports 128KB-128MB memory devices.

Technical value: OpenHarmony adopts a componentized design scheme, which can be flexibly tailored according to the resource capabilities and business characteristics of the equipment to meet the requirements of different forms of terminal equipment for the operating system.

Business value: It will be widely used in smart home IoT terminals, smart wearables, smart large screens, car smart cockpits, speakers and other smart terminals to provide the ultimate experience across all scenarios and devices.

Ecological value: For device developers, OpenHarmony adopts a componentized design scheme, which can be flexibly tailored according to the resource capabilities and business characteristics of the device to meet the requirements of different types of terminal devices for the operating system. For application developers, the OpenHarmony unified software architecture opens up a variety of terminals, making the development of applications independent of the differences in the form of different terminal devices, reducing development difficulty and cost. This allows developers to focus on the upper-level business logic and facilitate the development of applications.

harmony os source code: https://openharmony.gitee.com/openharmony

Huawei Developer Conference

Huawei Developer Conference 2020 (Together)丨Review of the live keynote speech:

https://developer.huawei.com/consumer/cn/training/detail/101600172153624030?channelname=HeZuo58&ha_source=banner

Guess you like

Origin blog.csdn.net/universsky2015/article/details/108737478