Multi-system compatibility method and device, electronic device, and storage medium

Through the use of SystemCall interface and HAL container, the compatibility problem between Android and Linux systems is solved, and the compatibility and isolation of multiple operating systems on mobile devices is achieved, allowing cross-system communication and improving user experience.

CN115016856BActive Publication Date: 2025-01-03DOUYIN VISION CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210170874.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-23
Publication Date
2025-01-03
Estimated Expiration
2042-02-23

AI Technical Summary

Technical Problem

Due to conflicts in file systems, environment configuration and other aspects, the Android system is not compatible, resulting in only the Android system drivers in the chip-level system on the mobile side, which limits the compatibility of multiple operating systems.

Method used

Start the kernel through the SystemCall interface, find and start the process of the first system, mount its file system, create a hardware abstraction layer (HAL) container, run the process of the second system, guide its file system mount and core service startup, and use HAL The service realizes compatibility between the second system and the first system, including a compatible encapsulation of the dynamic connection library and inter-process communication mechanism.

Benefits of technology

Compatibility between Android and Linux systems is achieved, allowing multiple operating systems to run on a single hardware device, providing cross-system communication capabilities and enhancing user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115016856B_ABST
    Figure CN115016856B_ABST
Patent Text Reader

Abstract

The present application is about a multi-system compatibility method and device, electronic device, and storage medium. The method includes: in response to a startup instruction, starting the kernel based on the SystemCall interface, the kernel searches for the first process of the first system, and starts the first process; mounting the file system of the first system through the first process, and starting the basic services of the first system; creating a hardware abstraction layer HAL container through the namespace NameSpace mechanism in the first system; running the second process of the second system through the HAL container, guiding the mounting of the file system of the second system and the startup of the core service Service and HAL service; when the service is started in the HAL container, the first process of the first system starts the subsequent system Service and system application, and deploys the second system in the first system. The present application realizes multi-system compatibility by isolating the first system and the second system from each other.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to multi-operating system compatibility technology, and more particularly to a multi-system compatibility method and device, electronic device, and storage medium. Background Art

[0002] At present, with the monopoly of Android ecosystem on mobile terminals, basically all mobile chip-level systems (System on Chip, SOC) and hardware modules only provide drivers adapted to the Android system.

[0003] Although the Android system is based on the Linux kernel, it uses the Bionic basic library and other private core libraries to form a closed ecosystem. It is incompatible with other GNU / Linux operating systems. Due to conflicts between the Android system and the Linux system in terms of file system and environment configuration, the Android system is incompatible with the Linux system. Summary of the invention

[0004] In view of this, the embodiments of the present application provide a multi-system compatibility method and device, an electronic device, and a storage medium to at least partially solve the above technical problems existing in the prior art.

[0005] According to a first aspect of an embodiment of the present application, a multi-system compatibility method is provided, the method comprising:

[0006] In response to the start instruction, a kernel is started based on a system call (SystemCall) interface, the kernel searches for a first process of a first system, and starts the first process;

[0007] Mounting the file system of the first system through the first process, and starting the basic service of the first system;

[0008] Create a Hardware Abstraction Layer (HAL) container through the NameSpace mechanism in the first system;

[0009] Running the second process of the second system through the HAL container, guiding the file system mounting of the second system and the startup of the core service (Service) and the HAL service;

[0010] When the service is started in the HAL container, the first process of the first system starts subsequent system services and system applications, and deploys the second system in the first system.

[0011] In some embodiments, the method further comprises:

[0012] In response to a call instruction for a first function in a first dynamic link library of the first system, calling the first dynamic link library, initializing the first dynamic link library, and calling a compatible connector;

[0013] The HAL service of the second system is called through the compatible connector, a second function corresponding to the first function in a second dynamic link library of the second system is called, the second function is run and a response is given to the first system.

[0014] In some embodiments, the executing the second function and responding to the first system includes:

[0015] When it is determined that the second function conflicts with the C function library interface of the first system, a third function corresponding to the first function in the C function library of the first system is searched for through the compatible connector, and the third function is run.

[0016] In some embodiments, the method further comprises:

[0017] In response to a call instruction for a fourth function of the first system, calling a compatible encapsulation library of the second system through a HAL service of the second system;

[0018] Triggering the compatible encapsulation library to query a first client client instance of the binder service Service corresponding to the fourth function based on an inter-process communication mechanism binder; determining that the first client instance corresponds to a first calling mode of the HAL service;

[0019] The first system calls the first client instance based on the first calling method, triggers the corresponding Service in the second system to run the first client instance, and obtains the running result;

[0020] The compatible encapsulation library feeds back the running result of the first client instance to the calling instruction of the first system.

[0021] In some embodiments, the first system includes a GNU / Linux operating system;

[0022] The GNU / Linux operating system includes at least one of the following: Ubuntu, Debian, and RedHat.

[0023] In some embodiments, the second system includes the Android operating system, the Android Open Source Project AOSP, and a derivative system based on AOSP;

[0024] The derivative system includes at least one of the following: MIUI, EMUI, and One UI.

[0025] According to a second aspect of an embodiment of the present application, a multi-system compatible device is provided, including:

[0026] A first startup unit, configured to start a kernel based on a SystemCall interface in response to a startup instruction, wherein the kernel searches for a first process of a first system and starts the first process;

[0027] A second starting unit, configured to mount the file system of the first system through the first process, and start the basic service of the first system;

[0028] A creation unit, used to create a HAL container through the NameSpace mechanism in the first system;

[0029] A third starting unit, used to run the second process of the second system through the HAL container, guide the file system mounting of the second system and the starting of the core service Service and the HAL service;

[0030] The fourth starting unit is used for starting subsequent system services and system applications by the first process of the first system when the service is started in the HAL container, and deploying the second system in the first system.

[0031] In some embodiments, the apparatus further comprises:

[0032] a first calling unit, configured to call the first dynamic link library in response to a calling instruction for a first function in the first dynamic link library of the first system, initialize the first dynamic link library, and call a compatible connector;

[0033] The second calling unit is used to call the HAL service of the second system through the compatible connector, call the second function corresponding to the first function in the second dynamic link library of the second system, run the second function and respond to the first system.

[0034] In some embodiments, the second calling unit is further configured to:

[0035] When it is determined that the second function conflicts with the C function library interface of the first system, a third function corresponding to the first function in the C function library of the first system is searched for through the compatible connector, and the third function is run.

[0036] In some embodiments, the apparatus further comprises:

[0037] A third calling unit, configured to call a compatible encapsulation library of the second system through a HAL service of the second system in response to a calling instruction for a fourth function of the first system;

[0038] The first trigger unit is used to trigger the compatible encapsulation library to query the first client client instance of the binder service Service corresponding to the fourth function based on the inter-process communication mechanism binder; determine that the first client instance corresponds to the first calling mode of the HAL service;

[0039] A second triggering unit, configured to enable the first system to call the first client instance based on the first calling method, trigger the corresponding Service in the second system to run the first client instance, and obtain an operating result;

[0040] The third triggering unit is used to trigger the compatible encapsulation library to feed back the running result of the first client instance to the calling instruction of the first system.

[0041] In some embodiments, the first system includes a GNU / Linux operating system;

[0042] The GNU / Linux operating system includes at least one of the following: Ubuntu, Debian, and RedHat.

[0043] In some embodiments, the second system includes the Android operating system, the Android Open Source Project AOSP, and a derivative system based on AOSP;

[0044] The derivative system includes at least one of the following: MIUI, EMUI, and One UI.

[0045] According to a third aspect of an embodiment of the present application, an electronic device is provided, comprising a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction implements the steps of the multi-system compatibility method when executed by the processor.

[0046] According to a fourth aspect of an embodiment of the present application, a readable non-temporary storage medium is provided, on which a program or instruction is stored, and the program or instruction, when executed by a processor, implements the steps of the multi-system compatibility method.

[0047] In the embodiment of the present application, when the system starts, the first process of the first system is started first, the file system of the first system is mounted, the basic services of the first system are started, the NameSpace mechanism of the first system is used to create a HAL container, the second process of the second system is run based on the HAL container, the service in the HAL container is started, and the first process starts the subsequent system Service and system application, and the second system is deployed in the first system. The embodiment of the present application realizes multi-system compatibility and isolation between the first system and the second system. The second system can call the relevant devices in the first system through the HAL service, thereby realizing cross-system communication in multiple systems, providing users with a multi-system experience, and realizing the multi-system experience through a single hardware device. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following is a brief introduction to the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0049] Figure 1 A schematic diagram of a multi-system compatibility method according to an embodiment of the present application;

[0050] Figure 2 A schematic diagram of the structure of a multi-system compatible device according to an embodiment of the present application;

[0051] Figure 3 A structural diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0052] The essence of the technical solution of the embodiment of the present application is explained in detail below with reference to the accompanying drawings.

[0053] In the embodiments of the present application, only the Android operating system and the Linux operating system are used as examples to describe the technical solution of the embodiments of the present application. The embodiments of the present application are not limited to the compatibility between the above-mentioned operating systems, nor are they limited to the compatibility between only two operating systems.

[0054] Figure 1 Schematic diagram of the process of the multi-system compatibility method of the embodiment of the present application, such as Figure 1As shown, the multi-system compatibility method of the embodiment of the present application includes the following processing steps:

[0055] Step 101 , in response to a startup instruction, a kernel is started based on a SystemCall interface, the kernel searches for a first process of a first system, and starts the first process.

[0056] In the embodiment of the present application, the startup instruction includes a power-on instruction, such as a power-on instruction for turning on the power, a restarting power-on instruction, etc.

[0057] In response to the startup instruction, the device starts the kernel Kernel, completes the core, subsys, and device startup, and then prepares to start the user state Init process of the first system. In the embodiment of the present application, the first process includes the Init process and the like.

[0058] After the kernel starts, it will search in several places where Init has been used in the past. If the kernel cannot find Init, it will try to run / bin / sh. If this fails, the system startup will also fail.

[0059] As an example, the first system includes a GNU / Linux operating system; the GNU / Linux operating system includes at least one of the following: Ubuntu, Debian, and RedHat.

[0060] Step 102: Mount the file system of the first system through the first process and start the basic services of the first system.

[0061] In the embodiment of the present application, the main function of the first system is called by the first process, and the main function includes a main() function, etc. The initialization script of the first system is called by the main function, and the initialization script is parsed, the file system of the first system is mounted, and the basic services of the first system are started. The basic services include mail service postfix, timing service crontab, search process, SFTP service, check system version number, delete user, etc.

[0062] Step 103: Create a hardware abstraction layer HAL container through the NameSpace mechanism in the first system.

[0063] In the embodiment of the present application, after the Linux basic service is started, the NameSpcace mechanism of the Linux kernel is used to create an Android HAL container.

[0064] The Namespaces mechanism of the Linux system provides a resource isolation solution. System resources such as process identifiers (PIDs), inter-process communication (IPCs), and networks are no longer global, but belong to specific Namespaces. The resources in each Namespace are transparent to other Namespaces. From the operating system level, there will be multiple processes with the same PID. Two processes with process numbers 0, 1, and 2 can exist in the system at the same time. Since they belong to different namespaces, there is no conflict between them. From the user level, only the resources under the user's own namespace can be seen. For example, the process status (ps) command can only list the processes under the user's own namespace. In this way, each namespace looks like a separate Linux system.

[0065] Step 104: Run the second process of the second system through the HAL container to guide the mounting of the file system of the second system and the startup of the core service Service and the HAL service.

[0066] In the embodiment of the present application, the Android HAL container will first run the second process (Init) of the second system, and then be booted and started by the Init of the second system, and gradually mount the Android file system and start the core Service and HALservice.

[0067] The second system includes the Android operating system, the Android open source project AOSP and a derivative system based on AOSP; the derivative system of AOSP includes at least one of the following: such as the MIUI operating system launched by Xiaomi, the mobile terminal operating system (EMUI) launched by Huawei, and the operating system (One UI) launched by Samsung. As an example, the second system includes the GNU / Linux operating system; the GNU / Linux operating system includes at least one of the following: Ubuntu, Debian, RedHat. It should be noted that the second operating system is not limited to running on a physical machine, but can also be an operating system hosted on other operating systems, such as WSL in the Windows system.

[0068] Step 105: When the service in the HAL container is started, the first process of the first system starts subsequent system services and system applications, and deploys the second system in the first system.

[0069] In the embodiment of the present application, after the service in the Android HAL container is started, the Init process of the Linux system continues to start subsequent system Services and system applications.

[0070] The Linux system isolation container will first run the Linux system's Init process, and then be booted and started by LinuxInit, gradually mounting the Linux file system and starting related services and applications.

[0071] Through the above steps, the embodiment of the present application constructs an isolated environment for the Android HAL and the Linux system, realizes the compatibility between the Android system and the Linux system, and can load a compatible system of the Android system and the Linux system on an electronic device such as a mobile terminal, a laptop computer, a PAD, etc.

[0072] The above-mentioned multiple operating systems are not limited to the Linux system and the Android system. The embodiments of the present application are only illustrative descriptions of the above-mentioned two operating systems as a typical application and should not be used as a limitation on the technical solution.

[0073] In an embodiment of the present application, based on the above-mentioned compatible system, in response to a call instruction for a first function function in a first dynamic link library of the first system, the first dynamic link library is called to initialize the first dynamic link library and call a compatible connector; the HAL service of the second system is called through the compatible connector, a second function corresponding to the first function in the second dynamic link library of the second system is called, the second function is run and a response is given to the first system.

[0074] When it is determined that the second function conflicts with the C function library interface of the first system, a third function corresponding to the first function in the C function library of the first system is searched for through the compatible connector, and the third function is run.

[0075] In the embodiment of the present application, the second system and the first system are called by directly calling the dynamic library through the HAL interface of the second system. Specifically, the Android HAL dynamic library is not compatible, mainly due to the incompatibility of the bionic library. A compatible connector can be used to handle the connection problem of the Android dynamic link library. Take the opengles library as an example:

[0076] When a Linux system program calls a symbolic function of the opengles library, it will first call the openGLES encapsulation library.

[0077] When the openGLES encapsulation library is initialized, a compatible connector is called, which calls the openGLES library through the HAL interface of the Android system. For example, the android HALopenGLES library can be called through the dlopen() function.

[0078] In this way, when Linux calls a function of the openGLES library, it will call the corresponding function of the real Android HAL library.

[0079] When the Android HAL function is running, it will connect to the dynamic library. There are two situations at this time: the first is that there is no conflict between the function and LinuxGlibc. When calling the function, the compatible connector will call the corresponding function of the Android system; the second is that there is a conflict between the function and LinuxGlibc, for example, when calling pthread related functions, the compatible connector will return the corresponding function of LinuxGlibc instead of directly connecting to the corresponding function of Android bionic.

[0080] Through the HAL interface of the Android system, cross-system communication can also be achieved through cross-process communication using the HIDL binder.

[0081] As an implementation method, in response to a call instruction for a fourth function of the first system, a compatible encapsulation library of the second system is called through the HAL service of the second system; the compatible encapsulation library is triggered to query a first client client instance of the binder service Service corresponding to the fourth function based on an inter-process communication mechanism binder; it is determined that the first client instance corresponds to a first calling method of the HAL service; the first system calls the first client instance based on the first calling method, triggering the corresponding Service in the second system to run the first client instance and obtain an running result; the compatible encapsulation library feeds back the running result of the first client instance to the call instruction of the first system.

[0082] The following are some examples:

[0083] The Linux system program calls the Android HAL interface and calls the compatible encapsulation library of the Android HAL interface.

[0084] The HAL compatible encapsulation library queries and obtains the client instance of the Android HAL binder Service through the binder driver.

[0085] Through the client instance of binderService, you can determine the corresponding method of calling the client instance through the HAL interface.

[0086] When the Linux system calls the client instance through the Binder call method, the corresponding AndroidHAL Service will receive the relevant request. After receiving the call request, the Service will perform corresponding processing and return the result to the Linux Binder Client through the binder.

[0087] After receiving the data returned by Binder, the HAL compatible encapsulation library will return the relevant results through the function and return the results to the Linux calling program.

[0088] In the embodiment of the present application, by means of binder compatible encapsulation calling, a Linux program can call an Android HIDL interface to start a related operating system.

[0089] In the embodiment of the present application, Android and other Linux-based operating systems are implemented based on the Linux kernel, so the kernel configuration (Config) required by other operating systems can be enabled based on the Android Linux kernel. When the electronic device starts the kernel Kernel, completes the core, subsys, and device startup, and then prepares to start the user-mode Init process to load the relevant system.

[0090] The embodiment of the present application ensures that both AndroidHAL and Linux system can run normally without interfering with each other through the construction of Android HAL and Linux system isolation environment. Through the Android HAL interface compatibility mode, it is ensured that the Linux system can call the Android HAL interface, and the Linux operating system can be run on the Android HAL.

[0091] Figure 2 Schematic diagram of the composition structure of the multi-system compatible device according to an embodiment of the present application. Figure 2 As shown, the multi-system compatible device of the embodiment of the present application includes:

[0092] A first startup unit 20, configured to start a kernel based on a SystemCall interface in response to a startup instruction, wherein the kernel searches for a first process of a first system and starts the first process;

[0093] A second starting unit 21 is used to mount the file system of the first system through the first process and start the basic service of the first system;

[0094] A creating unit 22, configured to create a HAL container through a NameSpace mechanism in the first system;

[0095] A third starting unit 23 is used to run the second process of the second system through the HAL container, guide the file system mounting of the second system and the starting of the core service Service and the HAL service;

[0096] The fourth starting unit 24 is used for, when the service is started in the HAL container, the first process of the first system starts subsequent system services and system applications, and deploys the second system in the first system.

[0097] As a way to achieve this, Figure 2 Based on the multi-system compatible device shown, the multi-system compatible device in the embodiment of the present application further includes:

[0098] The first call unit ( Figure 2 ), for responding to a call instruction for a first function function in a first dynamic link library of the first system, calling the first dynamic link library, initializing the first dynamic link library, and calling a compatible connector;

[0099] The second call unit ( Figure 2 ), which is used to call the HAL service of the second system through the compatible connector, call the second function corresponding to the first function in the second dynamic link library of the second system, run the second function and respond to the first system.

[0100] As an implementation manner, the second calling unit is further used to:

[0101] When it is determined that the second function conflicts with the C function library interface of the first system, a third function corresponding to the first function in the C function library of the first system is searched for through the compatible connector, and the third function is run.

[0102] As a way to achieve this, Figure 2 Based on the multi-system compatible device shown, the multi-system compatible device in the embodiment of the present application further includes:

[0103] The third call unit ( Figure 2 (not shown) for calling a compatible encapsulation library of the second system through a HAL service of the second system in response to a call instruction for a fourth function of the first system;

[0104] The first trigger unit ( Figure 2 ), used to trigger the compatible encapsulation library to query the first client client instance of the binder service Service corresponding to the fourth function based on the inter-process communication mechanism binder; determine that the first client instance corresponds to the first calling mode of the HAL service;

[0105] The second trigger unit ( Figure 2 ), which is used to enable the first system to call the first client instance based on the first calling method, trigger the corresponding Service in the second system to run the first client instance, and obtain the running result;

[0106] The third trigger unit ( Figure 2 ), which is used to trigger the compatible encapsulation library to feed back the running result of the first client instance to the calling instruction of the first system.

[0107] As an implementation, the first system includes a GNU / Linux operating system;

[0108] The GNU / Linux operating system includes at least one of the following: Ubuntu, Debian, and RedHat.

[0109] As an implementation, the second system includes an Android operating system, an Android open source project AOSP, and a derivative system based on AOSP;

[0110] The derivative system includes at least one of the following: MIUI, EMUI, and One UI.

[0111] In an exemplary embodiment, the first startup unit 20, the second startup unit 21, the creation unit 22, the third startup unit 23, the fourth startup unit 24, the first calling unit, the second calling unit, the third calling unit, the first trigger unit, the second trigger unit and the third trigger unit, etc. can be implemented by one or more central processing units (CPU, Central Processing Unit), application specific integrated circuits (ASIC, Application Specific Integrated Circuit), digital signal processors (Digital Signal Processor, DSP), programmable logic devices (PLD, Programmable Logic Device), complex programmable logic devices (CPLD, Complex Programmable Logic Device), field programmable gate arrays (FPGA, Field-Programmable Gate Array), general-purpose processors, controllers, microcontrollers (MCU, Micro Controller Unit), microprocessors (Microprocessors), or other electronic components, for executing the steps of the multi-system compatibility method of the aforementioned embodiments.

[0112] In the disclosed embodiment, Figure 2 The specific manner in which each unit in the illustrated multi-system compatible device performs operations has been described in detail in the embodiment of the method, and will not be elaborated on here.

[0113] Below, reference Figure 3 The electronic device 11 according to an embodiment of the present application is described.

[0114] like Figure 3 As shown, the electronic device 11 includes one or more processors 111 and a memory 112 .

[0115] The processor 111 may be a central processing unit (CPU) or other forms of processing units having data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device 11 to perform desired functions.

[0116] The memory 112 may include one or more computer program products, and the computer program product may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, a random access memory (RAM) and / or a cache memory (cache), etc. The non-volatile memory may include, for example, a read-only memory (ROM), a hard disk, a flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 111 may run the program instructions to implement the multi-system compatibility method of each embodiment of the present application described above and / or other desired functions. Various contents such as input signals, signal components, noise components, etc. may also be stored in the computer-readable storage medium.

[0117] In one example, the electronic device 11 may further include: an input device 113 and an output device 114, which are connected via a bus system and / or other forms of connection mechanisms ( Figure 3 ) interconnected.

[0118] The input device 113 may include, for example, a keyboard, a mouse, etc.

[0119] The output device 114 can output various information to the outside, including determined distance information, direction information, etc. The output device 114 can include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto, and the like.

[0120] Of course, to simplify, Figure 3 Only some of the components related to the present application in the electronic device 11 are shown, and components such as a bus, an input / output interface, etc. are omitted. In addition, according to specific application situations, the electronic device 11 may also include any other appropriate components.

[0121] The embodiment of the present application also records a readable non-temporary storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the multi-system compatibility method of the aforementioned embodiment are implemented.

[0122] In addition to the above-mentioned methods and devices, an embodiment of the present application may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps of the method according to various embodiments of the present application described in the above-mentioned "Exemplary Method" section of this specification.

[0123] The computer program product may be written in any combination of one or more programming languages ​​to write program codes for performing the operations of the embodiments of the present application, including object-oriented programming languages, such as Java, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as an independent software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0124] In addition, an embodiment of the present application may also be a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the processor executes the steps of the method according to various embodiments of the present application described in the above "Exemplary Method" section of this specification.

[0125] The computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0126] The basic principles of the present application are described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, effects, etc. mentioned in the present application are only examples and not limitations, and it cannot be considered that these advantages, strengths, effects, etc. are required by each embodiment of the present application. In addition, the specific details disclosed above are only for the purpose of illustration and ease of understanding, not for limitation, and the above details do not limit the present application to being implemented by adopting the above specific details.

[0127] The block diagrams of the devices, apparatuses, equipment, and systems involved in this application are only illustrative examples and are not intended to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagram. As will be appreciated by those skilled in the art, these devices, apparatuses, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including", "comprising", "having", etc. are open words, referring to "including but not limited to", and can be used interchangeably with them. The words "or" and "and" used here refer to the words "and / or" and can be used interchangeably with them, unless the context clearly indicates otherwise. The words "such as" used here refer to the phrase "such as but not limited to", and can be used interchangeably with them.

[0128] It should also be noted that in the apparatus, device and method of the present application, each component or each step can be decomposed and / or recombined. Such decomposition and / or recombination should be regarded as equivalent solutions of the present application.

[0129] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present application. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of the present application. Therefore, the present application is not intended to be limited to the aspects shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

[0130] The above description has been given for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present application to the forms disclosed herein. Although multiple example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, changes, additions and sub-combinations thereof.

Claims

1. A multi-system compatibility method, characterized in that: The method comprises: In response to the startup instruction, a kernel is started based on a system call SystemCall interface, the kernel searches for a first process of a first system, and starts the first process; the first process includes an init process; Mounting the file system of the first system through the first process, and starting the basic service of the first system; Create a hardware abstraction layer HAL container through the namespace mechanism in the first system; Running a second process of the second system through the HAL container to guide the mounting of the file system of the second system and the startup of the core service Service and the HAL service; the second process includes an init process; When the service is started in the HAL container, the first process of the first system starts subsequent system services and system applications, and deploys the second system in the first system.

2. The method according to claim 1, characterized in that The method further comprises: In response to a call instruction for a first function in a first dynamic link library of the first system, calling the first dynamic link library, initializing the first dynamic link library, and calling a compatible connector; The HAL service of the second system is called through the compatible connector, a second function corresponding to the first function in a second dynamic link library of the second system is called, the second function is run and a response is given to the first system.

3. The method according to claim 2, characterized in that The running of the second function and responding to the first system comprises: When it is determined that the second function conflicts with the C function library interface of the first system, a third function corresponding to the first function in the C function library of the first system is searched for through the compatible connector, and the third function is run.

4. The method according to claim 1, characterized in that: The method further comprises: In response to a call instruction for a fourth function of the first system, calling a compatible encapsulation library of the second system through a HAL service of the second system; Triggering the compatible encapsulation library to query a first client instance of the binder service Service corresponding to the fourth function based on the inter-process communication mechanism binder; determining that the first client instance corresponds to a first calling mode of the HAL service; The first system calls the first client instance based on the first calling method, triggers the corresponding Service in the second system to run the first client instance, and obtains the running result; The compatible encapsulation library feeds back the running result of the first client instance to the calling instruction of the first system.

5. The method according to any one of claims 1 to 4, characterized in that: The first system includes a GNU / Linux operating system; The GNU / Linux operating system includes at least one of the following: Ubuntu, Debian, and RedHat.

6. The method according to any one of claims 1 to 4, characterized in that: The second system includes the Android operating system, the Android open source project AOSP, and a derivative system based on AOSP; The derivative system includes at least one of the following: MIUI, EMUI, and One UI.

7. A multi-system compatible device, characterized in that: The device comprises: A first startup unit, configured to start a kernel based on a SystemCall interface in response to a startup instruction, wherein the kernel searches for a first process of a first system and starts the first process; the first process includes an init process; A second starting unit, configured to mount the file system of the first system through the first process, and start the basic service of the first system; A creation unit, used to create a HAL container through the NameSpace mechanism in the first system; A third startup unit is used to run a second process of the second system through the HAL container, guide the file system mounting of the second system and the startup of the core service Service and the HAL service; the second process includes an init process; The fourth starting unit is used for starting subsequent system services and system applications by the first process of the first system when the service is started in the HAL container, and deploying the second system in the first system.

8. The device according to claim 7, characterized in that The device also includes: a first calling unit, configured to call the first dynamic link library in response to a calling instruction for a first function in the first dynamic link library of the first system, initialize the first dynamic link library, and call a compatible connector; The second calling unit is used to call the HAL service of the second system through the compatible connector, call the second function corresponding to the first function in the second dynamic link library of the second system, run the second function and respond to the first system.

9. The device according to claim 8, characterized in that The second calling unit is further used for: When it is determined that the second function conflicts with the C function library interface of the first system, a third function corresponding to the first function in the C function library of the first system is searched for through the compatible connector, and the third function is run.

10. The device according to claim 7, characterized in that The device also includes: A third calling unit, configured to call a compatible encapsulation library of the second system through a HAL service of the second system in response to a calling instruction for a fourth function of the first system; The first trigger unit is used to trigger the compatible encapsulation library to query the first client instance of the binder service Service corresponding to the fourth function based on the inter-process communication mechanism binder; determine that the first client instance corresponds to the first calling mode of the HAL service; A second triggering unit is used to enable the first system to call the first client instance based on the first calling method, trigger the corresponding Service in the second system to run the first client instance, and obtain an operation result; The third triggering unit is used to trigger the compatible encapsulation library to feed back the running result of the first client instance to the calling instruction of the first system.

11. The device according to any one of claims 7 to 10, characterized in that The first system includes a GNU / Linux operating system; The GNU / Linux operating system includes at least one of the following: Ubuntu, Debian, and RedHat.

12. The device according to any one of claims 7 to 10, characterized in that The second system includes the Android operating system, the Android open source project AOSP, and a derivative system based on AOSP; The derivative system includes at least one of the following: MIUI, EMUI, and One UI.

13. An electronic device, characterized in that: The method comprises a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the multi-system compatibility method described in any one of claims 1 to 6.

14. A readable non-transitory storage medium, characterized in that: The storage medium stores programs or instructions, and when the programs or instructions are executed by the processor, the steps of the multi-system compatibility method described in any one of claims 1 to 6 are implemented.