Huawei Hongmeng OS 2.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.). On the basis of the traditional single-device system capabilities, HarmonyOS proposes a distributed concept based on the same set of system capabilities, adapting to multiple terminal forms, and can support multiple terminal devices.

Hongmeng 1.0

 

 

From Harmony 1.0 to Harmony 2.0: Distributed Capability

 

 

 

 

 

 

For consumers, HarmonyOS can integrate the capabilities of various terminals in life scenarios, realize fast connection, mutual assistance, and resource sharing between different terminal devices, match appropriate devices, and provide a smooth full-scene experience.

For application developers, HarmonyOS adopts a variety of distributed technologies, so that the development and implementation of applications are independent of the morphological differences of different terminal devices. This enables developers to focus on 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 operating system requirements of different types of terminal devices.

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

 

Technical characteristics

Hardware mutual assistance, resource sharing

 

The distributed soft bus is a unified base for various terminal devices, which provides a unified distributed communication capability for the interconnection between devices, which can quickly discover and connect devices, distribute tasks and transmit data efficiently. The schematic diagram of the distributed soft bus is shown in Figure 1 .

 

Figure 1  Schematic diagram of distributed soft bus

Distributed Device Virtualization

 

The distributed device virtualization platform can realize the resource integration, device management, and data processing of different devices, and a variety of devices together form a super virtual terminal . For different types of tasks, match and select execution hardware with suitable capabilities for users, so that services can be continuously transferred between different devices, and the resource advantages of different devices can be fully utilized. The schematic diagram of distributed equipment virtualization is shown in Figure 2 .

 

Figure 2  Schematic diagram of distributed equipment virtualization

Distributed Data Management

 

Based on the ability of distributed soft bus, distributed data management realizes 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. The schematic diagram of distributed data management is shown in Figure 3 .

 

Figure 3  Schematic diagram of distributed data management

Distributed Task Scheduling

 

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

Figure 4 briefly shows the distributed task scheduling capability by taking application migration as an example.

 

Figure 4  Schematic diagram of distributed task scheduling

One development, multiple deployments

 

HarmonyOS provides user program framework, Ability framework and UI framework, which supports the reuse of business logic and interface logic of multiple terminals in the application development process. It can realize one-time application development and multi-terminal deployment, and improve the development efficiency of cross-device applications. The schematic diagram of one-time development and multi-terminal deployment is shown in Figure 5 .

 

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

Unified OS, flexible deployment

 

HarmonyOS supports on-demand flexible deployment of various terminal devices through design methods such as componentization and miniaturization, and can adapt to different types of hardware resources and functional requirements. It supports the automatic generation of componentized dependencies through the compilation chain relationship, forms a component tree dependency graph, supports the convenient development of product systems, and reduces the development threshold of hardware devices.

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

Supports the configuration of function sets in components (components can be large or small) : According to hardware resources and functional requirements, you can choose to configure the function sets in components. For example, choose to configure some of the controls in the Graphics Framework component.

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

 

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 step by step according to "System > Subsystem > Function/Module". In the multi-device deployment scenario, some unnecessary subsystems or functions/modules can be tailored according to actual needs. The HarmonyOS technical architecture is shown in Figure 1.

 

Figure 1  Technical Architecture

kernel layer

 

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

Driver Subsystem: HarmonyOS Driver Framework (HDF) is the open foundation of HarmonyOS hardware ecosystem, providing unified peripheral access capability and driver development and management framework.

system service layer

 

The system service layer is the core capability set 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 multiple devices. , public basic library, multi-mode input, graphics, security, AI and other subsystems. Among them, Ark runtime provides C/C++/JS multi-language runtime and basic system class library, and also provides a static Java program using Ark compiler (that is, the part of application or framework layer developed using Java language) Runtime.

Basic software service subsystem set : Provide public and general software services for HarmonyOS, which consists of subsystems such as event notification, telephony, multimedia, DFX, MSDP & DV .

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

Hardware service subsystem set : Provide hardware services for HarmonyOS, which consists of subsystems such as location services, biometric identification, wear-specific hardware services, and IoT-specific hardware services.

According to the deployment environment of different device forms, the basic software service subsystem set, the enhanced software service subsystem set, and the hardware service subsystem set can be tailored according to the granularity of subsystems, and each subsystem can be tailored according to the granularity of functions.

frame layer

 

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

application layer

 

The application layer includes system applications and third-party non-system applications. The application of HarmonyOS consists of one or more FA (Feature Ability) or PA (Particle Ability) . Among them, FA has a UI interface and 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 implement specific business functions, support cross-device scheduling and distribution, and provide users with a consistent and efficient application experience.

 

system security

On a distributed terminal equipped with HarmonyOS, it is possible to ensure that "the right person, through the right device, uses the data correctly ".

the right person

 

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

Zero trust model : Based on the zero trust model, HarmonyOS implements user authentication and data access control. 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 fusion authentication : Through user identity management, HarmonyOS associates authentication credentials that identify the same user on different devices to identify a user to improve the accuracy of authentication.

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

Guarantee the "right person" through "distributed multi-terminal collaborative identity authentication".

 

correct equipment

Guarantee "correct equipment" by "building a trusted operating environment on distributed terminals".

Through "distributed data in the process of cross-terminal flow, data classification and hierarchical management" 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 leakage of user privacy.

Secure Boot

Ensure that the system firmware and applications running on each virtual appliance at the source are complete and untampered. Through secure boot, the image packages of various device manufacturers are not easily illegally replaced with malicious programs, 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, users' sensitive personal data needs to be stored and processed using devices with high security levels. HarmonyOS uses a TEE microkernel based on mathematically provable formal development and verification, and has achieved a certification rating of CC EAL5+ for commercial OS kernels.

Device certificate authentication

Supports presetting device certificates for devices with a trusted execution environment to prove their security capabilities to other virtual terminals. For devices with a TEE environment, provide proof of device identity through the preset PKI (Public Key Infrastructure) device certificate 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 securely stored in the TEE environment of the device, and is only used within the TEE. When the user's sensitive data (such as keys, encrypted biometrics, etc.) must be transmitted, a secure channel is established from the TEE of one device to the TEE of another device after the device certificate is used for security environment verification. achieve secure transmission. As shown in Figure 1 .

 

Figure 1  Schematic diagram of device certificate usage

Use data correctly

In a distributed terminal scenario, it is necessary to ensure that users can use data correctly . HarmonyOS protects the entire life cycle of data generation, storage, use, transmission and destruction, so as to ensure that personal data and privacy, as well as system confidential 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 graded, and the corresponding protection level is set according to the classification. The data of each protection level needs to be provided with different strengths of security protection according to the corresponding security policy during the entire life cycle of storage, use and transmission. The access control system of the virtual hyperterminal supports the access control policy based on the label to ensure that data can only be stored, used and transmitted between virtual terminals that can provide sufficient security protection.

Data storage: HarmonyOS protects data by distinguishing the security levels of data and storing them in partitions with different security protection capabilities, and provides seamless cross-device flow and cross-device key access control capabilities for the full life cycle of keys, supporting distribution identity authentication collaboration, distributed data sharing and other services.

Data usage: HarmonyOS provides a trusted execution environment for devices 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 the user's data are not leaked.

Data transmission: In order to ensure the safe flow of data between virtual hyperterminals, it is necessary for each device to be correct and credible, to establish a trust relationship (multiple devices establish a pairing relationship through HUAWEI ID), and to be able to establish a secure relationship after verifying the trust relationship. The connection channel, according to the rules of data flow, securely transmit data. When communicating between devices, the device needs to be authenticated based on the device's identity credentials, and on this basis, a secure encrypted transmission channel is established.

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, it is only necessary 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, the capabilities of EMUI have been 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 It is open to application manufacturers to innovate.

Hongmeng is not a simple replacement for the mobile phone system, it is the base of the whole scene. Its three distributed capabilities are distributed soft 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 ability of the hard bus, allowing multiple devices to be integrated, making the system extremely fast and smooth.

In the fully-integrated and adaptive part, the Hongmeng system realizes the integration of heterogeneous networks, and different devices can be interconnected; self-discovery and self-connection, almost every time the network is replaced, it needs to do very tedious configuration, and the device based on the Hongmeng system can be automatically configured once Self-connection is found; the third is dynamic delay calibration. Taking audio and video synchronization as an example, if you stream video to a large screen and audio to a speaker, 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, the read and write speed of remote files across devices will be very bad. Huawei's minimum speed is four times faster than the industry's best Samba system. ContentProvide (reading between the same devices) is 1.3 times faster than the reading speed between different devices; the speed of distributed retrieval is 1.2 times faster than that of iOS Core Spotlight.

Distributed Security

In fact, in a distributed system, there is a very good opportunity to break through the single-dimensional authentication on a single device, and multi-factor authentication can be used for stronger authentication on multiple devices, which not only allows the code to be written at one time and run on multiple terminals. It can also make the device more secure.

Wang Chenglu said that Huawei can deploy the microkernel elastically to 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 devices with stronger individual capabilities, and the flow of data must be governed by rules. High-level data can access low-level data, but not vice versa.

 

 

Development tool platform: HUAWEI DevEco Studio

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

DevEco Studio supports HarmonyOS application development 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 a variety of programming languages ​​for developers to develop HarmonyOS applications, including Java, JS and C/C++, and supports mixed development scenarios of multiple languages. Therefore, when creating a project for a corresponding device, the tool will preset a variety of Ability templates, and recommend you to 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

 

The fields of computer science, from bottom to top, are:

The compiler is a bridge between the human world and the machine world. Any program on a 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 mobile phone. into machine code that can be executed efficiently, and this conversion process is done by the compiler. It can be said that a compiler is a software used to generate software, a bridge connecting software and chips, and its performance and efficiency directly affect the most basic consumer experience.

A unified programming platform for multiple devices and supporting multiple languages.

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

Four technical features of OpenArkCompiler

 

It can compile different language codes 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;

a lighter language runtime;

Software and hardware collaboration give full play to hardware energy efficiency;

Support a variety of terminal device 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 compilation and running mechanism of the system and applications, directly compiling the high-level language into machine code, so that the mobile phone can directly understand the "high-level language", eliminating the additional overhead of dynamic compilation of the virtual machine, 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, the Ark compiler focuses on Java code performance. In the future, the Ark compiler will cover a variety of programming languages ​​(including C/C++, JS, etc.), a variety of chip architectures (including CPU, GPU, IPU, etc.), covering a wider range business scenario.

 

Innovation in the Internet of Things Era

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

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 running on a variety of end devices. It can run not only on resource-constrained devices and wearable devices at the 100KB level, but also on relatively resource-rich devices such as 100MB-level smart home cameras and driving recorders, as well as on 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 types of terminal equipment for the operating system.

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

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 operating system requirements of different types of terminal devices. For application developers, the unified software architecture of OpenHarmony opens up a variety of terminals, making the development and implementation of applications independent of the differences in the form of different terminal devices, reducing the difficulty and cost of development. This allows developers to focus on upper-level business logic and develop applications easily.

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 http://43.154.161.224:23101/article/api/json?id=325473200&siteId=291194637