One article to understand the difference between Hongmeng system and Android system

 一文读懂鸿蒙系统与安卓系统的区别

Origin

The Hongmeng system has recently become popular. When chatting after dinner, some friends often say, isn't Hongmeng just a cover for the Android system? Similar to Xiaomi's Mi UI and Huawei's own EMUI. Maybe many of the friends who read the article think the same way? Brother Shou can only say that this understanding is too superficial, although Brother Shou was so superficial at first.

concept

Huawei Hongmeng system is a new distributed operating system for all scenarios, creating a world of interconnected super virtual terminals, organically linking people, devices, and scenarios, and connecting consumers with a variety of scenarios in their life. The intelligent terminal realizes fast discovery, fast connection, hardware mutual assistance, resource sharing, and provides the best scene experience with the most suitable equipment. Hongmeng OS is a distributed operating system based on microkernel for all scenarios.

源起

鸿蒙系统最近火的一批,饭后聊天的时候经常有小伙伴说,鸿蒙不就是安卓系统套子个皮么?类似小米的米UI和华为自有的EMUI。可能看到文章的很多小伙伴也是这么想的吧?手哥只能说这么理解过于肤浅了,虽然手哥最初也是这么的肤浅。

概念

华为鸿蒙系统是一款全新的面向全场景的分布式操作系统,创造一个超级虚拟终端互联的世界,将人、设备、场景有机地联系在一起,将消费者在全场景生活中接触的多种智能终端实现极速发现、极速连接、硬件互助、资源共享,用最合适的设备提供最佳的场景体验。鸿蒙OS是一款基于微内核面向全场景的分布式操作系统。

microkernel

A microkernel is an operating system kernel that provides essential services; among these essential services include tasks, threads, interprocess communication, and memory management, among others. All services (including device drivers) run in user mode, and these services are handled like any other program. Because each service just runs in its own address space. So these services are protected from each other.

The concept is basically like this. Hongmeng and Android are not the same thing at all. Next time whoever says that Hongmeng system is Android is covered, as a technical person, people will laugh off their teeth.

微内核

微内核是一种能够提供必要服务的操作系统内核;其中这些必要的服务包括任务,线程,交互进程通信以及内存管理等等。所有服务(包括设备驱动)在用户模式下运行,而处理这些服务同处理其他的任何一个程序一样。因为每个服务只是在自己的地址空间运行。所以这些服务之间彼此之间都受到了保护。

概念基本就是这样,鸿蒙和安卓根本不是一个东西,下次谁再说鸿蒙系统是安卓套了个皮,做为技术人会被人笑掉大牙的。

The following is a brief in-depth look from two aspects: one is the technical architecture, and the other is the application field level.

Technology Architecture

Android system architecture

The Android system is based on the linux-based macro kernel design: the macro kernel contains most of the functions and modules of the operating system, and these functions and modules have the highest authority. As long as one module fails, the entire system will crash, which is also the Android system. easy to crash. The advantage is that the difficulty of system development is low. Android is written in Java language and is easy to learn. But it has a disadvantage: it cannot communicate directly with the bottom layer of the system and must be run through a virtual machine. To put it directly, the virtual machine is equivalent to the transmitter: first the Android application is installed on the virtual machine, and then transferred from the virtual machine to the bottom of the machine. If there is a problem with the virtual machine, the system is stuck.

下面简单的从两个方面深入一下:一是技术架构上,二是应用场层面。

技术架构

安卓系统架构

安卓系统是基于linux的宏内核设计:宏内核包含了操作系统绝大多数的功能和模块,而且这些功能和模块都具有最高的权限,只要一个模块出错,整个系统就会崩溃,这也是安卓系统容易崩溃的原因。好处就是系统开发难度低。Android是用Java语言编写的,很容易学习。但它有一个缺点:不能与系统底层直接进行通信活动,必须通过虚拟机来运行。说直接点就是虚拟机相当于传递者:首先Android应用程序安装在虚拟机上,然后从虚拟机传输到机器的底部,如果虚拟机出了问题话的那系统就是卡住。

Android系统架构分为四层架构,从高到低分别是应用层,应用框架层,系统运行层和Linux内核层。

鸿蒙系统架构

鸿蒙操作系统是微内核设计:微内核仅包括了操作系统必要的功能模块(任务管理、内存分配等)处在核心地位具有最高权限,其他模块不具有最高权限,也就是说其他模块出现问题,对于整个系统的运行是没有阻碍的。微内核的开发难度很大,但是系统的稳定性很高。根据目前华为公布的一些资料信息,我们可以推断出鸿蒙系统是用C、C++语言编写即直接使用机器语言编写app,取消安卓系统的ART虚拟机,直接编译为二进制机器码,这样做的好处就是不需要中转,执行速度快;但这样的操作也有一些缺点就是必须要有大量的静态方案且内存空间要求更高。


image


鸿蒙系统架构也分为4层分别为:应用层,程序框架层,基础服务层和微内核层。


架构上的主要区别

一、谷歌的安卓系统是基于Linux开发,华为的“鸿蒙”系统也是基于Linux开发,但底层对Linux进行大量优化。

二、安卓系统程序员写APP使用的是JAVA高级语言,打包成APK到安卓系统。方舟编译器,则是让APK打包之前,统一把指令换成安卓系统能读懂的机器语言,省去了"翻译"这个过程。

三、安卓的主要开发语言是基于java,而在鸿蒙系统上可以使用java和js。


应用层面

安卓系统

安卓系统适用于手机,虽然当前有好多设备都是基于安卓开发的,例如车载屏幕等。但实际上都是针对于安卓手机应用的简单扩展。


鸿蒙系统

在6月2号的发布会上,华为是这样解释的:华为带来全场景 1+8+N 智慧生活,鸿蒙系统 2.0 带来统一控制中心。,将会涵盖五大场景,包括智慧出行、智能家居、运动健康、智慧办公以及影音娱乐。

这里提的“1” 指的是手机,手机是未来智慧生活的入口,因此显得额外重要。“8“指的是平板、PC、穿戴、HD、AI音箱、耳机、VR、车机。“N”指的是泛IOT设备。


在应用上,鸿蒙系统显然更强大,并且兼容所有安卓系统的应用。


缺陷与不足

安卓系统经过多年发展,软件生态非常完善,鸿蒙系统目前来说还谈不上生态(具手哥身边的程序员了解,当前并没有程序员在鸿蒙系统上做开发)。华为推相对推出操作系统而言,更难的是如何聚拢开发者为这款操作系统持续开发各类优质应用,让这款操作系统得以具备真正价值,继而发展壮大,在系统开发商、硬件厂商、开发者与用户之间形成良性正循环。要让开发者为鸿蒙操作系统开发应用,需要的是实实在在的政策激励,利益引导,依靠情怀等是无法解决也是不可持续的,这就是华为推出鸿蒙系统之后需要解决的一大难题!


今天的最新消息

已有中国银行、中信银行(信用卡)、广发银行(信用卡)第一时间宣布接入HarmonyOS(鸿蒙),支持操作系统国产化。中国银行与中信银行称,将联合华为推出原子化服务,布局开放银行场景新生态。


作为一个中国血统的程序员,你愿意建议公司新产品的开发使用鸿蒙系统吗?