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

Through the SystemCall interface and namespace mechanism, the compatible operation of the Android system and the Linux system is realized, the compatibility problem between the Android and Linux systems is solved, a multi-system experience is provided and the isolation between systems is ensured.

CN114564247BActive Publication Date: 2024-10-22DOUYIN VISION CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210169744.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-23
Publication Date
2024-10-22
Estimated Expiration
2042-02-23

AI Technical Summary

Technical Problem

The Android system and the Linux system are incompatible due to conflicts in file systems, environment configurations, etc., resulting in the inability to run simultaneously on the same hardware device.

Method used

Start the kernel through the SystemCall interface, find and start the process of the first system, use the namespace mechanism to create an isolation container, mount the file system of the second system, realize cross-system communication through the HAL service, and use compatible connectors and packaging libraries to process dynamics The interface conflicts between the connection library and the function library.

Benefits of technology

It realizes the compatible operation of Android system and Linux system, provides multi-system experience, and ensures isolation and non-interference between systems through inter-process communication.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114564247B_ABST
    Figure CN114564247B_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, searching for the first process of the first system, and starting the first process; calling the main function of the first system, parsing the initialization script file of the first system, and starting the first system; through the NameSpace mechanism in the second system, creating an isolation container for the object corresponding to the PHP script in the second system that conflicts with the first system, so that the script corresponding to the object in the isolation container can be called by the second system; calling the second process corresponding to the object in the isolation container, mounting the file system of the second system through the second process, and starting the basic service of the second system, loading the second system, and deploying the first system in the second 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 current 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, the kernel is started based on a system call (SystemCall) interface, the kernel searches for a first process of the first system at a set location, and starts the first process;

[0007] Calling the main function of the first system through the first process, parsing the initialization script file of the first system, mounting the basic file system and the third-party class library (vendor), starting the core service and the hardware abstraction layer (HAL) service, and starting the first system;

[0008] By using the namespace mechanism in the second system, an isolation container is created for the object corresponding to the script of the Hypertext Preprocessor (PHP) in the second system that conflicts with the script of the first system, so that the script corresponding to the object in the isolation container can be called by the second system;

[0009] The second process corresponding to the object in the isolated container is called, the file system of the second system is mounted through the second process, the basic service of the second system is started, the second system is loaded, and the first system is deployed in the second system.

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

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

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

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

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

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

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

[0017] Triggering the compatible encapsulation library to query a first 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;

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

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

[0020] In some embodiments, the object includes at least one of a third-party class, a function, and a constant.

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

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

[0023] In some embodiments, the second system includes a GNU / Linux operating system;

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

[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 at a set location and starts the first process;

[0027] A second startup unit is used to call the main function of the first system through the first process, parse the initialization script file of the first system, mount the basic file system and the vendor, start the core service and the HAL service, and start the first system;

[0028] A creating unit, configured to create an isolation container for an object corresponding to a PHP script in the second system that conflicts with the first system through a NameSpace mechanism in the second system, so that the script corresponding to the object in the isolation container can be called by the second system;

[0029] The third startup unit is used to call the second process corresponding to the object in the isolated container, mount the file system of the second system through the second process, start the basic services of the second system, load the second system, and deploy the first system in the second system.

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

[0031] 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 second system, initialize the first dynamic link library, and call a compatible connector;

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

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

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

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

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

[0037] 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;

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

[0039] 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 second system.

[0040] In some embodiments, the object includes at least one of a third-party class, a function, and a constant.

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

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

[0043] In some embodiments, the second system includes a GNU / Linux operating system;

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

[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 an embodiment of the present application, when the system starts, the first system is first loaded through the startup process of the first system. After the first system is started, an isolation container is created using the NameSpace mechanism of the second system, and script objects that conflict with the first system are placed in the isolation container. The second system is started based on the startup process of the second system, so that the first system is deployed in the second system. The embodiment of the present application achieves multi-system compatibility and isolation between the first system and the second system. The second system can call related devices in the first system through the HAL service, thereby achieving cross-system communication in multiple systems, providing users with a multi-system experience, and achieving a 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 1 As 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 start instruction, start a kernel based on a SystemCall interface, and the kernel searches for a first process of a first system at a set location 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 core, subsys, and device startup, and then prepares to start the user mode Init process.

[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 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 Windows system.

[0060] In the embodiment of the present application, the first process includes the Init process, etc.

[0061] Step 102, calling the main function of the first system through the first process, parsing the initialization script file of the first system, mounting the basic file system and the third-party class library vendor, starting the core service and the hardware abstraction layer HAL service, and starting the first system.

[0062] In an embodiment of the present application, the main function of the first system is called through the first process. The main function includes a main() function, etc. The initialization script of the first system is called through the main function, and the initialization script is parsed. The basic file system, system, and third-party library vendor of the first system are mounted, the core service and the hardware abstraction layer HAL service are started, and the first system is started.

[0063] Step 103, using the NameSpace mechanism in the second system, create an isolation container for the objects corresponding to the PHP scripts in the second system that conflict with the first system, so that the scripts corresponding to the objects in the isolation container can be called by the second system.

[0064] In the embodiment of the present application, after the core service and HAL Service of the first system are prepared, the NameSpace mechanism of the Linux kernel is used to create a Linux system isolation container.

[0065] The Namespaces mechanism of the Linux system provides a resource isolation solution. System resources such as process identifiers (PIDs), inter-process communication (IPC), 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.

[0066] The object includes at least one of a third-party class, a function, and a constant.

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

[0068] Step 104: call the second process corresponding to the object in the isolated container, mount the file system of the second system through the second process, start the basic service of the second system, load the second system, and deploy the first system in the second system.

[0069] In the embodiment of the present application, the second process includes the Init process of the Linux system, etc.

[0070] The Linux system isolation container will first run the Linux system's Init process, and then be booted and started by Linux Init, 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 of Android HAL and Linux system Container, realizes compatibility between Android system and Linux system, and can load a compatible system of Android system and Linux system on an electronic device such as a mobile terminal, laptop computer, 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 the embodiment of the present application, based on the above-mentioned compatible system, in response to a call instruction for a first function in a first dynamic link library of the second system, the first dynamic link library is called, the first dynamic link library is initialized, and a compatible connector is called; the HAL service of the first system is called through the compatible connector, a second function corresponding to the first function in the second dynamic link library of the first system is called, the second function is run and a response is given to the second system. Here, there is no conflict between the second function and the C function library interface of the second system.

[0074] When it is determined that the second function conflicts with the C function library interface of the second system, a third function corresponding to the first function in the C function library of the second 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 calls the first system by directly calling the dynamic library through the HAL interface of the first system. Specifically, the incompatibility problem of the Android HAL dynamic library is mainly caused by the incompatibility of the bionic library. The embodiment of the present application can use a compatible connector to handle the connection problem of the Android dynamic connection 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, and the compatible connector calls the openGLES library through the HAL interface of the Android system. For example, the Android HAL openGLES 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 Linux Glibc. When calling the function, the compatible connector will call the corresponding function of the Android system; the second is that when there is a conflict between the function and Linux Glibc, for example, when calling pthread related functions, the compatible connector will return the corresponding function of Linux Glibc instead of directly connecting to the corresponding function of Androidbionic.

[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] In response to a call instruction for a fourth function of the second system, a compatible encapsulation library of the first system is called through the HAL service of the first 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 the binder; it is determined that the first client instance corresponds to a first calling method of the HAL service; the second system calls the first client instance based on the first calling method, triggers the corresponding Service in the first system to run the first client instance, and obtains an running result; the compatible encapsulation library feeds back the running result of the first client instance to the call instruction of the second 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 the binder Service, 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 Android HAL 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 at a set location and starts the first process;

[0093] A second starting unit 21 is used to call the main function of the first system through the first process, parse the initialization script file of the first system, mount the basic file system and the vendor, start the core service and the HAL service, and start the first system;

[0094] A creating unit 22 is used to create an isolation container for an object corresponding to a PHP script in the second system that conflicts with the first system through a NameSpace mechanism in the second system, so that the script corresponding to the object in the isolation container can be called by the second system;

[0095] The third startup unit 23 is used to call the second process corresponding to the object in the isolated container, mount the file system of the second system through the second process, start the basic service of the second system, load the second system, and deploy the first system in the second system.

[0096] 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:

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

[0098] The second calling unit ( Figure 2 ), for calling the HAL service of the first system through the compatible connector, calling the second function corresponding to the first function in the second dynamic link library of the first system, running the second function and responding to the second system.

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

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

[0101] 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:

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

[0103] 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;

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

[0105] 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 second system.

[0106] As an implementation manner, the object includes at least one of a third-party class, a function, and a constant.

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

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

[0109] As an implementation, the second system includes a GNU / Linux operating system;

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

[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 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, MicroController Unit), microprocessors (Microprocessors), or other electronic components to execute 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 start instruction, the kernel is started based on the system call SystemCall interface, the kernel searches for the first process of the first system at a set location, and starts the first process; Calling the main function of the first system through the first process, parsing the initialization script file of the first system, mounting the basic file system and the third-party class library vendor, starting the core service and the hardware abstraction layer HAL service, and starting the first system; By using the NameSpace mechanism in the second system, an isolation container is created for the object corresponding to the script of the hypertext preprocessor PHP in the second system that conflicts with the first system, so that the script corresponding to the object in the isolation container can be called by the second system; The second process corresponding to the object in the isolated container is called, the file system of the second system is mounted through the second process, the basic service of the second system is started, the second system is loaded, and the first system is deployed in the second 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 function in a first dynamic link library of the second system, calling the first dynamic link library, initializing the first dynamic link library, and calling a compatible connector; The HAL service of the first system is called through the compatible connector, a second function corresponding to the first function in a second dynamic link library of the first system is called, the second function is run and a response is given to the second system.

3. The method according to claim 2, characterized in that The running the second function and responding to the second system comprises: When it is determined that the second function conflicts with the C function library interface of the second system, a third function corresponding to the first function in the C function library of the second 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 second system, calling a compatible encapsulation library of the first system through a HAL service of the first system; 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; The second system calls the first client instance based on the first calling method, triggers the corresponding Service in the first 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 second system.

5. The method according to claim 1, characterized in that The object includes at least one of a third-party class, a function, and a constant.

6. The method according to any one of claims 1 to 5, characterized in that: The first 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. The method according to any one of claims 1 to 5, characterized in that: The second system includes a GNU / Linux operating system; The GNU / Linux operating system includes at least one of the following: Ubuntu, Debian, and RedHat.

8. 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 at a set location and starts the first process; A second startup unit is used to call the main function of the first system through the first process, parse the initialization script file of the first system, mount the basic file system and the vendor, start the core service and the HAL service, and start the first system; A creating unit, configured to create an isolation container for an object corresponding to a PHP script in the second system that conflicts with the first system through a NameSpace mechanism in the second system, so that the script corresponding to the object in the isolation container can be called by the second system; The third startup unit is used to call the second process corresponding to the object in the isolated container, mount the file system of the second system through the second process, start the basic services of the second system, load the second system, and deploy the first system in the second system.

9. The device according to claim 8, 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 second 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 first system through the compatible connector, call the second function corresponding to the first function in the second dynamic link library of the first system, run the second function and respond to the second system.

10. The device according to claim 9, 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 second system, a third function corresponding to the first function in the C function library of the second system is searched for through the compatible connector, and the third function is run.

11. The device according to claim 8, characterized in that The device also includes: A third calling unit, configured to call a compatible encapsulation library of the first system through a HAL service of the first system in response to a calling instruction for a fourth function of the second system; 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; A second triggering unit, configured to enable the second system to call the first client instance based on the first calling method, trigger the corresponding Service in the first 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 second system.

12. The device according to claim 9, characterized in that The object includes at least one of a third-party class, a function, and a constant.

13. The device according to any one of claims 9 to 12, characterized in that The first 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.

14. The device according to any one of claims 9 to 12, characterized in that The second system includes a GNU / Linux operating system; The GNU / Linux operating system includes at least one of the following: Ubuntu, Debian, and RedHat.

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

16. 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 8 are implemented.