This is the third day of my participation in the More text Challenge. For details, see more text Challenge
Huawei HongMeng system is a new distributed operating system oriented to the whole scene, creating a super virtual terminal interconnected world, people, equipment and scene organically relates in together, will be consumers in the whole scene life contact many kinds of intelligent terminal to realize the fast detection, high speed connection, hardware support, resource sharing, in the most appropriate equipment to provide the best scenario experience
Positioning system
HarmonyOS is a “future-oriented” distributed operating system for all scenarios (mobile office, sports and health, social communications, media and entertainment, etc.). Based on the traditional capabilities of a single device system, HarmonyOS has developed a distributed concept that allows for multiple terminal configurations based on the capabilities of the same system, which can support multiple devices such as phones, tablets, wearables, smart screens, and mobile devices.
- For consumers, HarmonyOS is designed to integrate the capabilities of devices across a variety of life scenarios. It allows for rapid connectivity, interoperability, and resource sharing among devices, matching the right devices, and providing a smooth, full-scene experience.
- For application developers, HarmonyOS uses a variety of distributed technologies that allow applications to be developed regardless of the shape of the different end devices. This allows developers to focus on upper-level business logic, making it easier and more efficient to develop applications.
- For device developers, HarmonyOS uses a componentized design that can be tailored to meet the requirements of different terminal configurations based on the device’s resource capabilities and business characteristics.
The technical architecture
HarmonyOS as a whole follows a hierarchical design, starting from the bottom up: the core layer, the system services layer, the framework layer, and the application layer. Choose System > Subsystem > Function/Module to expand system functions. In a multi-device deployment scenario, you can customize some non-essential subsystems or functions or modules as required. The Technical architecture of HarmonyOS is shown below.
The kernel layer
- Kernel subsystem: HarmonyOS has a multi-kernel design that enables the selection of the OS kernel for different resource-constrained devices. The Kernel Abstract Layer (KAL) provides basic Kernel capabilities for the upper Layer, including process/thread management, memory management, file system, network management, and peripheral management, by masking the differences between multiple cores.
- Driver Subsystem: The Hardware Driver Framework (HDF) is the cornerstone of HarmonyOS ‘open hardware ecosystem, providing unified peripheral access and a driver development and management framework.
System services layer
The System Services layer is HarmonyOS’s core set of capabilities that provide services to applications through the framework layer. This layer contains the following sections:
- System sets: basic ability subsystem for distributed application on HarmonyOS much equipment running, scheduling, migration and so on provides the basis capacity, operation by distributed soft bus, distributed data management, a distributed task scheduling, ark language runtime, public libraries, multimode input, graphics, security, AI and other subsystems. Among them, the Ark Runtime provides the C/C++/JS multilanguage runtime and the base system class library, as well as the runtime for Java programs statically developed using the Ark compiler (that is, the part of the application or framework layer developed using the Java language).
- Basic Software Services Subsystem set: Provides common, universal software services For HarmonyOS, consisting of event notification, telephone, multimedia, DFX (Design For X), MSDP&DV, and other subsystems.
- Enhanced Software Services Subsystem set: Provides differentiated and capable enhanced software services for HarmonyOS across devices, consisting of smart Screen proprietary, Wearable proprietary, and IoT proprietary subsystems.
- Hardware Services Subsystem set: Provides hardware services for HarmonyOS, consisting of location Services, biometrics, wearable proprietary hardware Services, and IoT proprietary hardware services subsystems.
Based on the deployment environment of different device types, the basic software service subsystem set, enhanced software service subsystem set, and hardware service subsystem set can be tailored according to the subsystem granularity, and each subsystem can be tailored according to the function granularity.
The framework layer
The framework layer provides a user program framework in Java/C/C++/JS and the Ability framework for HarmonyOS application development. The two UI frameworks (Java UI framework for Java and JS UI framework for JS) And a multilingual framework API for various hardware and software services. The apis supported by HarmonyOS devices will vary depending on the degree of componentization tailoring of the system.
The 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 UI interface to provide 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. The background data access required by the FA for user interaction also needs to be supported by the corresponding PA. Applications developed based on FA/PA can implement specific service functions, support cross-device scheduling and distribution, and provide users with consistent and efficient application experience.
Distributed softbus
Distributed softbus is a communication base for distributed devices such as mobile phones, tablets, smart wearables, smart screens, cars and machines. It provides a unified distributed communication capability for the interconnection between devices and creates conditions for inductive discovery and zero-wait transmission between devices. Developers only need to focus on the implementation of the business logic, without paying attention to the networking mode and the underlying protocol. The distributed softbus schematic is shown in Figure 1.
Typical application scenarios:
- Smart home scene: When cooking, the phone can connect with the oven by touching it, and will automatically set cooking parameters according to the recipe, and control the oven to make dishes. Similarly, cooking machines, range hoods, air purifiers, air conditioners, lights, curtains and so on can be displayed and controlled through the phone. Connect and play between devices, without cumbersome configuration.
- Multi-screen classroom: Teachers teach with smart screens, interact with students and create classroom atmosphere; Students use mobile phones to complete the course and question-and-answer sessions. The unified and fully connected logical network ensures the high bandwidth, low latency and high reliability of the transmission channel.
Distributed Device Virtualization
The distributed device virtualization platform can realize resource integration, device management, and data processing of different devices to form a super virtual terminal. For different types of tasks, hardware with appropriate capabilities is matched and selected for users to continuously transfer services between different devices and give full play to the advantages of different devices, such as display, video, audio, interaction, and sensor capabilities. Schematic diagram of distributed device virtualization.
Typical application scenarios:
- Video call scenario: When you answer a video call while doing housework, you can connect the mobile phone to the smart screen and virtualize the screen, camera, and speaker box of the smart screen as local resources to replace the screen, camera, handset, and speaker of the mobile phone, so that you can make a video call through the smart screen and speaker box while doing housework.
- Game scene: When playing games on the smart screen, the mobile phone can be virtual as a remote control. With the help of the gravity sensor, acceleration sensor and touch control ability of the mobile phone, gamers can enjoy a more convenient and smooth game experience.
Distributed data management
Based on the capability of distributed softbus, the distributed management of application data and user data is realized. User data is no longer with a single physical binding equipment, business logic and data separation, across the equipment fast and convenient to data processing as well as the local data processing, make it easy for developers to implement the whole scene under multiple devices, data storage, share and access, to create the user experience of the consistent and smooth created the basic conditions. See distributed data management diagram.
Typical application scenarios:
- Collaborative office scenario: The document on the mobile phone is displayed on the smart screen. On the smart screen, you can perform operations such as page turning, zooming, and doodling on the document. The latest status of the document can be displayed on the mobile phone simultaneously.
- Family outing scene: Mom took a lot of pictures with her cell phone during the family outing. Through family photo sharing, dad can view, save and save the photos on his phone, and grandparents in the family can view the photos through the smart screen.
Distributed task scheduling
Based on the technical features of distributed softbus, distributed data management, and distributed Profile, distributed task scheduling builds a unified distributed service management (discovery, synchronization, registration, and invocation) mechanism to support remote startup, remote invocation, remote connection, and migration of cross-device applications. You can select appropriate devices to run distributed tasks based on the capabilities, locations, service running status, resource usage, and user habits and intentions.
Typical application scenarios:
- Navigation scenario: If the user drives, the navigation route should be planned on the phone before getting on the car; After getting on the car, the navigation automatically migrates to the car machine and the car speaker; After getting off the bus, the navigation automatically migrates back to the phone. If the user travels by bike, the navigation route is planned on the phone, and the watch can follow the navigation while riding.
- Take-out scene: After ordering take-out on the mobile phone, the order information can be migrated to the watch to check the delivery status at any time.
One development, multiple deployment
HarmonyOS provides a user application framework, Ability framework, and UI framework to enable the reuse of business and interface logic across multiple terminals in the application development process, enabling one development and multiple deployment of applications to improve the efficiency of cross-device application development. Schematic diagram of one-time development and multi-terminal deployment.
Among them, UI framework supports two development languages, Java and JS, and provides rich polymorphic controls, which can display different UI effects on mobile phones, tablets, smart wearers, smart screens and cars. Adopt the mainstream design method of the industry, provide a variety of responsive layout scheme, support rasterization layout, meet the interface adaptability of different screens.
Unified OS, flexible deployment
Through componentization and miniaturization, HarmonyOS supports flexible deployment of multiple devices on demand to accommodate different types of hardware resources and functional requirements. It supports the automatic generation of componentized dependency relationship through compilation chain relationship, forming component tree dependency graph, supporting the convenient development of product system and lowering the development threshold of hardware equipment.
- Component selection (optional) : You can select components based on the hardware configuration and requirements.
- Function sets of components can be small or large: You can configure function sets of components based on hardware resources and function requirements. For example, select some controls in the configuration graphical framework component.
- Support for association of dependencies between components (large and small platforms) : Componentized dependencies can be generated automatically based on the build chain. For example, selecting a graphics framework component automatically selects the dependent graphics engine component, etc.
Description of the GARBAGE collection mechanism