HarmonyOS framework structure and technical characteristics

1. HarmonyOS framework structure The
       overall layered structure of HarmonyOS from bottom to top is: kernel layer, system service layer, application framework layer, application layer. HarmonyOS is based on a microkernel design, and the system functions are expanded step by step in accordance with "System> Subsystem> Functions/Modules". In a multi-device deployment scenario, the organization of each functional module conforms to the "drawer" design, that is, the functional module adopts the AOP design philosophy. Some non-essential subsystems or functions/modules can be tailored according to actual needs. The design of HarmonyOS realizes modular coupling, and can realize flexible deployment corresponding to different devices, so that it can be easily and intelligently adapted to devices with different memory scales from low to high such as GB, MB, KB, etc., and can be easily installed on mobile phones, smart screens, etc. Realize data transfer and migration among IoT devices such as, car, machine, and wearable devices. At the same time, it has the outstanding advantages of on-demand use of small programs and automatic cleaning of expired dates.

                                                                                            Figure 1 HarmonyOS framework structure

1) The kernel layer

       The kernel layer is based on the Linux system design, mainly including the kernel subsystem and the driver subsystem (HDF, HarmonyOS driver).

               l   Kernel subsystem : HarmonyOS adopts a multi-kernel design and supports the selection of suitable OS kernels for different resource-constrained devices. The 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.

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

2) System service layer

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

              l   System basic capabilities subsystem set : Provides basic capabilities for the operation, scheduling, migration and other operations of distributed applications on HarmonyOS multi-devices. It is operated by distributed soft bus, distributed data management, distributed task scheduling, and Ark multi-language operation Time, 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. It is also a static Java program using the self-developed Ark compiler (that is, the application or framework layer developed using Java language Part) Provide runtime.

              l   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.

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

              l   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.

3) Application framework 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 multi-language framework APIs open to the outside world for 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.

4) 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, providing the ability to interact with users; while PA has no UI interface, providing 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.

2. Technical Features of
       HarmonyOS The biggest feature of HarmonyOS is the application of a distributed architecture to the terminal OS, allowing users to conveniently implement cross-device and cross-terminal calls with the same account. Its distributed architecture includes distributed task scheduling, distributed data management, hardware capability virtualization, and distributed software bus. Especially the innovative distributed soft bus technology makes the end-to-end delay of the Hongmeng system less than 20ms, the effective throughput is as high as 1.2Gbps, and the anti-packet rate is as high as 25%. HarmonyOS intelligently allocates slow, fast, and ultra-fast lanes according to the application and device category, so as to ensure the fast and smooth operation of different applications on different devices. In terms of vehicle system, it has been tested to have a performance improvement of 3-5 times compared to the Google Fusion system. In terms of security, HarmonyOS uses microkernel technology to authenticate system security from the source. This level of security technology was only used in aviation, military and other fields in the past. Its self-developed Ark compiler is compatible with Android, ensuring that applications developed on Android can be migrated to the Hongmeng system "very easily", and it breaks that the Android system can only run on a virtual machine, and cannot directly interact with the bottom of the system. The shackles of communication, thereby greatly improving performance. The core technical characteristics of HarmonyOS are embodied in the following aspects.

                                                                                            Figure 2 Distributed architecture design

1) Distributed software bus enables mutual hardware assistance and 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.

                                                                                            Figure 3 Distributed soft bus free networking

2) Distributed equipment virtualization creates a super virtual terminal

       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 execution hardware with appropriate capabilities to allow business to continuously flow between different devices and give full play to the resource advantages of different devices.

                                                                                     Figure 4 HyperTerminal

3) Distributed data management escorts the real-time sharing of user data

      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.

                                                                           Figure 5 Distributed data provides convenient life travel data services

                                                                                            Figure 6 Superior speed advantage

4) Distributed task scheduling makes "Thousand Miles" sound transmission possible

      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 according to the capabilities, locations, business operating status, resource usage, and user habits and intentions of different devices.

5) One-time development, multi-terminal deployment to realize cross-terminal ecological sharing

      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 development efficiency of cross-device applications.

      Hongmeng OS relies on multi-terminal development IDE, multi-language unified compilation, distributed architecture Kit provides screen layout controls and automatic adaptation of interaction, supports drag and drop of controls, and preview-oriented visual programming, so that developers can efficiently build multiple terminals based on the same project Automatically run the App, realize true one-time development, multi-terminal deployment, and realize a shared ecology between cross-devices. Huawei's Ark Compiler is the first static compiler to replace the Android virtual machine mode, allowing developers to compile high-level languages ​​into machine code at one time in the development environment. In addition, the Ark compiler will support multi-language unified compilation in the future, which can greatly improve development efficiency.

                                                                                            Figure 7 Building an intelligent ecosystem

6) Unified OS, flexible deployment, know what you need

       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. It supports the automatic generation of componentized dependencies through the compilation of chain relationships, forms a component tree dependency graph, supports the convenient development of product systems, and reduces the development threshold of hardware devices.

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

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

            l 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.

                                                                                            Figure 8 Highly decoupling on-demand matching

                                                                                            Figure 9 1+8+N mode 

7) Based on the micro-kernel architecture to reshape the trusted security of terminal equipment

       HarmonyOS adopts a brand-new micro-kernel design, with stronger security features and low latency. The basic idea of ​​micro-kernel design is to simplify the kernel function, realize as many system services as possible in the user mode outside the kernel, and add mutual security protection. The microkernel only provides the most basic services, such as multi-process scheduling and multi-process communication.

       HarmonyOS applies microkernel technology to the Trusted Execution Environment (TEE), and reshapes trusted security through formal methods. The formal method is an effective method to verify that the system is correct and without loopholes from the source using mathematical methods. Traditional verification methods such as functional verification and simulation can only be verified in selected limited scenarios, while formal methods can verify all software running paths through data models. For the first time, HarmonyOS uses a formal method for terminal TEE, which significantly improves the security level. At the same time, since the code volume of the HarmonyOS microkernel is only one-thousandth of that of the Linux macrokernel, its chance of being victimized is also greatly reduced.

3. HarmonyOS system security
       On distributed terminals equipped with HarmonyOS, it can ensure that "the right people, through the right equipment, use the data correctly".

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

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

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

                                                                                            Figure 10 "Correct" to ensure safety

1) 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 implements collaborative identity authentication through the following three aspects:

              l   Zero trust model : HarmonyOS is based on the zero trust model, which realizes 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.

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

              l   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 and mutual assistance and sharing of capabilities for different devices, allowing high-security devices Assist devices with low security levels to complete user identity authentication.

2) The right equipment

      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.

              l   Secure boot ensures 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 easy to be illegally replaced with malicious programs, thereby protecting users' data and privacy.

              l   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.

              l   Device certificate authentication supports pre-setting device certificates for devices with a trusted execution environment 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.

3) Use data correctly

       In the distributed terminal scenario, it is necessary to ensure that users can use data correctly. HarmonyOS protects the entire lifecycle 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.

              l   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 be provided with different strengths of security protection 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.

              l   Data storage : HarmonyOS protects the data by distinguishing the security level of the data and storing it in the partitions with different security protection capabilities, and provides the seamless flow of keys throughout the life cycle of the key and cross-device key access control capabilities, support Distributed identity authentication collaboration, distributed data sharing and other services.

              l   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.

              l   Data transmission : In order to ensure the safe transfer of data between virtual hyperterminals, each device needs to be correct and trustworthy, and a trust relationship established (multiple devices establish a pairing relationship through a Huawei account), and the trust relationship can be established after verification The secure connection channel, in accordance with the rules of data flow, safely transmits data. 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.

              l   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.

                                                                                            Figure 11 High-level kernel security


Guess you like

Origin blog.51cto.com/weiweili/2562272