Method and device for compatible operation of double operating systems and computer equipment

By installing the first operating system and virtual machine startup program on the embedded device, a computing environment suitable for the second operating system is simulated, and the architecture differences and resource configuration problems of porting and running Android applications on the embedded Linux system are solved, and the compatible operation and resource optimization of the dual operating system is achieved.

CN119806746APending Publication Date: 2025-04-11镁佳(北京)科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411973864.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

How to effectively port and run Android applications on embedded Linux systems to solve architectural differences and resource configuration problems.

Method used

By installing the first operating system (based on the first Linux kernel) and the virtual machine startup program on the embedded device, the target virtual machine and resource provisioning unit are started, and the computing environment and resource configuration suitable for the second operating system (based on the second Linux kernel) are simulated to achieve compatible operation of the dual operating system.

Benefits of technology

It realizes the operation of two different operating systems on the same device at the same time, optimizes the utilization rate of memory resources, reduces mutual interference between operating systems, and improves stability and security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119806746A_ABST
    Figure CN119806746A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computer operating systems, and provides a method and device for compatible operation of double operating systems and computer device.The method comprises the steps that a first operating system is installed according to a target file system, and the first operating system is constructed based on a first Linux kernel; installing a desktop system and a virtual machine starting program on the first operating system; a target virtual machine and a resource allocation unit are started through the virtual machine starting program, and the resource allocation unit is used for managing memory resources of the target file system; and installing a second operating system by using the target virtual machine, the second operating system being constructed based on a second Linux kernel, and the second operating system having a permission to call the target file system. According to the technical scheme provided by one or more embodiments, two different operating systems can be operated at the same time, and a user can conveniently use the application programs of the different operating systems.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of computer operating systems, and in particular to a method, apparatus and computer equipment for running dual operating systems compatibly. Background Art

[0002] Currently, Android operating system is a popular mobile device operating system. With its openness, flexibility and rich ecosystem, Android operating system has promoted the rapid growth of the types and number of Android applications. It can be widely used in a variety of devices such as smartphones and tablets, and provides users with rich functions and high-quality experience in many fields such as daily life, social entertainment, business office, etc.

[0003] Embedded devices, with their specific functions, compact size and low energy consumption, are widely used in consumer electronics, industrial control, medical, smart home and other fields. Linux operating system has become the preferred operating system for many embedded devices due to its simplicity, high customizability and high stability.

[0004] As embedded devices become more versatile and market competition intensifies, manufacturers and developers increasingly want to run Android applications on embedded devices to take advantage of the Android ecosystem and improve device functionality and user experience.

[0005] However, there are technical challenges in porting Android applications to embedded Linux systems, mainly due to the architectural differences and resource allocation issues between the two. Summary of the invention

[0006] In view of this, one or more embodiments of the present disclosure provide a method, apparatus and computer device that are compatible with running dual operating systems, which can run two different operating systems at the same time, making it convenient for users to use application programs of different operating systems.

[0007] In a first aspect, the present invention provides a method for running dual operating systems compatibly, the method comprising: installing a first operating system according to a target file system, the first operating system being built based on a first Linux kernel; installing a desktop system and a virtual machine startup program on the first operating system; starting a target virtual machine and a resource allocation unit through the virtual machine startup program, the resource allocation unit being used to manage memory resources of the target file system; and installing a second operating system using the target virtual machine, the second operating system being built based on a second Linux kernel, and the second operating system having permission to call the target file system.

[0008] On the basis of installing the first operating system, through the virtual machine technology, the computing environment and resource configuration suitable for the second operating system can be simulated, so that the second operating system and the application programs in the second operating system can be installed and run in the same device. The first operating system and the second operating system are built based on the first Linux kernel and the second Linux kernel respectively, which not only ensures that both operating systems can call the target file system and realize the necessary resource sharing and communication, but also can realize resource isolation to a certain extent, reduce the mutual interference between the two operating systems, and improve the stability and security of the two operating systems. Through the resource allocation unit, the memory resources of the target file system can also be managed and allocated to optimize the utilization of memory resources.

[0009] In an optional implementation, the method further includes: changing the memory resources allocated by the target file system to the target virtual machine based on the resource utilization of the target file system by the first operating system and the resource utilization of the target file system by the second operating system.

[0010] According to the resource utilization rates of the first operating system and the second operating system, the memory resources allocated to the target virtual machine by the target file system can be dynamically adjusted, thereby further optimizing the resource utilization efficiency and avoiding resource waste.

[0011] In an optional implementation, changing the memory resources allocated by the target file system to the target virtual machine based on the resource utilization of the target file system by the first operating system and the resource utilization of the target file system by the second operating system includes: changing the memory resources allocated by the target file system to the target virtual machine based on a first call ratio of the first operating system to the target file system, a memory fragmentation rate of the first operating system, a second call ratio of the second operating system to the target file system, and a cache hit rate of the second operating system.

[0012] The indicator data of the four dimensions are optimized to accurately reflect the resource utilization of the first operating system and the second operating system, and to more efficiently adjust the memory resources allocated to the target virtual machine by the target file system.

[0013] In an optional embodiment, the changing the memory resources allocated by the target file system to the target virtual machine according to a first call ratio of the first operating system to the target file system, a memory fragmentation rate of the first operating system, a second call ratio of the second operating system to the target file system, and a cache hit rate of the second operating system includes: determining a change probability coefficient according to the first call ratio, the memory fragmentation rate, the second call ratio, and the cache hit rate; when the change probability coefficient is greater than or equal to a preset increase coefficient, increasing the memory resources allocated by the target file system to the target virtual machine; when the change probability coefficient is less than a preset decrease coefficient, reducing the memory resources allocated by the target file system to the target virtual machine.

[0014] By changing the probability coefficient, the conditions and plans for adjusting memory resources can be clarified, thereby improving the efficiency of dynamic adjustment of memory resources.

[0015] In an optional implementation, the determination of the change probability coefficient according to the first call ratio, the memory fragmentation rate, the second call ratio, and the cache hit rate is implemented by the following formula:

[0016]

[0017] In the formula, G represents the change probability coefficient, m1 represents the first call ratio of the first operating system to the target file system, m2 represents the second call ratio of the second operating system to the target file system, a represents the memory fragmentation rate of the first operating system, and c represents the cache hit rate of the second operating system.

[0018] In an optional implementation, the target file system includes a root directory file system, a user file system, and an extended file system of an extended device; the root directory file system is used to provide startup resources for the first operating system, and the user file system is used to store user files.

[0019] The first operating system and the second operating system can call the target file system, and the target file system includes not only the root file system necessary for starting the first operating system, but also the user file system for storing user files and the extended file system for extended devices. In this way, the scenario adaptability of the method is improved and can meet more application scenarios.

[0020] In a second aspect, the present invention provides a device compatible with running dual operating systems, the device comprising: a first installation unit, used to install a first operating system according to a target file system, the first operating system being built based on a first Linux kernel; a second installation unit, used to install a desktop system and a virtual machine startup program on the first operating system; a virtual startup unit, used to start a target virtual machine and a resource allocation unit through the virtual machine startup program, the resource allocation unit being used to manage memory resources of the target file system; a third installation unit, used to install a second operating system using the target virtual machine, the second operating system being built based on a second Linux kernel, and the second operating system having permission to call the target file system.

[0021] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the method for compatible running of dual operating systems according to the first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0022] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the method for compatibly running dual operating systems according to the first aspect or any corresponding embodiment thereof.

[0023] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions for causing a computer to execute the method for compatibly running dual operating systems according to the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] The features and advantages of the embodiments of the present disclosure will be more clearly understood by referring to the accompanying drawings, which are schematic and should not be construed as limiting the present disclosure in any way. In the accompanying drawings:

[0025] Figure 1 A schematic diagram showing the steps of a method for compatible operation of dual operating systems in one embodiment of the present disclosure is shown;

[0026] Figure 2 A schematic flow chart of a method for compatibly running dual operating systems in one embodiment of the present disclosure is shown;

[0027] Figure 3 A schematic diagram of functional modules of a device compatible with running dual operating systems in one embodiment of the present disclosure is shown;

[0028] Figure 4 A schematic diagram of the hardware structure of a computer device in one embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0029] In order to make the purpose, technical solutions and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.

[0030] In the related technology, a method for running Android applications on an embedded Linux operating system may include the following steps: installing necessary dependencies for the Android environment; providing an Android operating environment using a container (Docker); installing Android applications in the Android operating environment; configuring various hardware and software resources; customizing the user interface and interaction method of the Android application; and realizing operation control of the Android application.

[0031] However, in the related art, the resource occupancy rate of the Android system running in the container is relatively fixed. If the usage resources of the Android system need to be changed, manual adjustment is often required, resulting in cumbersome steps and low adjustment efficiency.

[0032] In view of this, the method for compatible running of dual operating systems provided by the present invention can not only run two different operating systems on the same device at the same time, making it convenient for users to use applications of different operating systems, but also effectively manage memory resources and support dynamic adjustment of memory resources allocated to the second operating system.

[0033] See also Figure 1 , a method for running dual operating systems compatibly provided by an embodiment of the present disclosure may include the following steps.

[0034] S1: According to the target file system, a first operating system is installed, where the first operating system is built based on a first Linux kernel.

[0035] In this implementation, the target file system includes a root directory file system, a user file system and an extended file system of an extended device; the root directory file system is used to provide startup resources for the first operating system, and the user file system is used to store user files.

[0036] Specifically, the root directory file system is all the files and directories under the root directory, which may include the kernel of the operating system, system libraries, command line tools, system configuration files, and user space applications, etc. The user file system includes the data stored by the user, such as various documents, audio, video, software products, etc. Expansion devices may include external hard disks, USB flash drives, optical disks, etc.

[0037] The first operating system and the second operating system can call the target file system, and the target file system includes not only the root file system necessary for starting the first operating system, but also the user file system for storing user files and the extended file system for extended devices. In this way, the scenario adaptability of the method is improved and can meet more application scenarios.

[0038] S2: Install a desktop system and a virtual machine startup program on the first operating system.

[0039] In this embodiment, after the first operating system is installed, the computing environment and resource configuration suitable for the second operating system can be simulated through virtual machine technology, so that the second operating system and the application programs in the second operating system can be installed and run in the same device. The installation of the desktop system is conducive to more convenient control and display of the first operating system.

[0040] S3: Start the target virtual machine and the resource allocation unit through the virtual machine startup program, and the resource allocation unit is used to manage the memory resources of the target file system.

[0041] In this embodiment, the memory resources of the target file system can be managed and allocated through the resource allocation unit to optimize the memory resource utilization. The resource allocation unit can manage the memory resources of the method implementation subject (such as a computer, a mobile smart device, an embedded device) that carries the target file system, including physical memory and virtual memory. The resource allocation unit can allocate, recycle and control access to memory resources. In some actual application scenarios, the resource allocation unit can also use more memory space than the actual physical memory through virtual memory technology.

[0042] S4: Using the target virtual machine, install a second operating system, where the second operating system is built based on a second Linux kernel, and the second operating system has permission to call the target file system.

[0043] In this embodiment, the first operating system and the second operating system are built based on the first Linux kernel and the second Linux kernel respectively, which not only ensures that both operating systems can call the target file system and realize necessary resource sharing and communication, but also can realize resource isolation to a certain extent, reduce mutual interference between the two operating systems, and improve the stability and security of the two operating systems.

[0044] The method for compatible running of dual operating systems provided in this embodiment may also include step S5: changing the memory resources allocated by the target file system to the target virtual machine according to the resource utilization rate of the target file system by the first operating system and the resource utilization rate of the target file system by the second operating system.

[0045] In this embodiment, the memory resources allocated by the target file system to the target virtual machine can be dynamically adjusted according to the resource utilization of the first operating system and the second operating system, thereby further optimizing resource utilization efficiency and avoiding resource waste.

[0046] In some implementations, the memory resources allocated by the target file system to the target virtual machine may be changed based on a first call ratio of the first operating system to the target file system, a memory fragmentation rate of the first operating system, a second call ratio of the second operating system to the target file system, and a cache hit rate of the second operating system.

[0047] The indicator data of the four dimensions are optimized to accurately reflect the resource utilization of the first operating system and the second operating system, and to more efficiently adjust the memory resources allocated to the target virtual machine by the target file system.

[0048] In some embodiments, the change probability coefficient may be determined based on a first call ratio of the first operating system to the target file system, a memory fragmentation rate of the first operating system, a second call ratio of the second operating system to the target file system, and a cache hit rate of the second operating system. When the change probability coefficient is greater than or equal to a preset increase coefficient, the memory resources allocated by the target file system to the target virtual machine may be increased. When the change probability coefficient is less than a preset decrease coefficient, the memory resources allocated by the target file system to the target virtual machine may be reduced.

[0049] By changing the probability coefficient, the conditions and plans for adjusting memory resources can be clarified, thereby improving the efficiency of dynamic adjustment of memory resources.

[0050] In some implementations, the change probability coefficient is determined according to the first call ratio of the first operating system to the target file system, the memory fragmentation rate of the first operating system, the second call ratio of the second operating system to the target file system, and the cache hit rate of the second operating system, which can be implemented by the following formula:

[0051]

[0052] In the formula, G represents the change probability coefficient, m1 represents the first call ratio of the first operating system to the target file system, m2 represents the second call ratio of the second operating system to the target file system, a represents the memory fragmentation rate of the first operating system, and c represents the cache hit rate of the second operating system.

[0053] In an actual application example, when G≥72%, it indicates that the resource occupation ratio of the target virtual machine or the second operating system needs to be increased. At this time, the memory resources allocated to the target virtual machine by the target file system can be increased through the resource allocation unit under certain restrictions (for example, the memory resource ratio increased each time does not exceed 20% of the currently allocated memory resources).

[0054] When G<32%, it indicates that the resource usage ratio of the target virtual machine or the second operating system needs to be reduced. At this time, the memory resources allocated to the target virtual machine by the target file system can be reduced through the resource allocation unit under certain restrictions (for example, the memory resource ratio reduced each time does not exceed 20% of the currently allocated memory resources).

[0055] See also Figure 2 , a method for running dual operating systems compatibly provided by an embodiment of the present disclosure may include the following steps.

[0056] Step 1: Install the Linux system based on Linux kernel 1 according to the file system; the file system includes all files and directories under the root directory, and other file systems and devices are connected to the main file system through mount points. Other file systems mainly include data stored by the user, and devices include hard disks, USB flash drives, and optical disks.

[0057] Step 2: Install the desktop system and virtual machine startup program on the Linux system.

[0058] Step 3: Start the VirtualBox virtual machine and resource allocation unit through the virtual machine startup program; the resource allocation unit is responsible for managing the computer's memory resources, including the allocation, recycling and access control of physical memory and virtual memory. The resource allocation unit can also use virtual memory technology to allow programs to use more memory space than actual physical memory.

[0059] Step 4: The VirtualBox virtual machine installs the Android-x86 image based on Linux kernel 2 as the boot disk, and after starting the virtual machine, the Android system can also call the file system resources;

[0060] Step 5: The resource allocation unit allocates resource usage ratios of the Linux system and the VirtualBox virtual machine according to the utilization rate of the file system by Linux kernel 1 and the utilization rate of the file system by Linux kernel 2.

[0061] In this embodiment, whether to increase or decrease the resource occupancy ratio of Linux kernel 2 is determined by the call ratio of Linux kernel 1 to the file system and the memory fragmentation rate, and the call ratio of Linux kernel 2 to the file system and the cache hit rate. This judgment method is not only more efficient, but also greatly reduces the resource allocation unit's own occupancy rate of resources.

[0062] In an actual application example, the resource allocation unit can determine whether to increase or decrease the resource usage ratio of Linux kernel 2 based on the call ratio and memory fragmentation rate of the file system in Linux kernel 1, and the call ratio and cache hit rate of Linux kernel 2 to the file system. Then:

[0063]

[0064] Where G represents the probability coefficient of increasing or decreasing the resource usage of Linux kernel 2, m1 represents the call ratio of the file system in Linux kernel 1, m2 represents the call ratio of the file system in Linux kernel 2, a represents the memory fragmentation rate of Linux kernel 1, and c represents the cache hit rate of Linux kernel 2.

[0065] When G ≥ 72%, it means that the resource usage ratio of Linux kernel 2 needs to be increased, and the resource usage ratio increased each time shall not exceed 20%;

[0066] When G<32%, it means that the resource usage ratio of Linux kernel 2 needs to be reduced, and the resource usage ratio reduced each time shall not exceed 20%.

[0067] Then, when the call ratio of the file system in Linux kernel 1 is m1=41%, the call ratio of the file system in Linux kernel 2 is m2=26%. In addition, the memory fragmentation rate of Linux kernel 1 is a=11%, and the cache hit rate of Linux kernel 2 is c=18%, then:

[0068]

[0069] From the above calculation, it can be known that the resource allocation needs to increase the resource usage ratio of Linux kernel 2, and the resource ratio increased each time does not exceed 20%.

[0070] The technical solution provided by one or more embodiments of the present disclosure can simulate the computing environment and resource configuration suitable for the second operating system through virtual machine technology on the basis of installing the first operating system, so that the second operating system and the application program in the second operating system can be installed and run in the same device. The first operating system and the second operating system are respectively constructed based on the first Linux kernel and the second Linux kernel, which not only ensures that both operating systems can call the target file system and realize the necessary resource sharing and communication, but also can realize resource isolation to a certain extent, reduce the mutual interference between the two operating systems, and improve the stability and security of the two operating systems. Through the resource allocation unit, the memory resources of the target file system can also be managed and allocated to optimize the utilization of memory resources.

[0071] See also Figure 3 The present disclosure also provides a device compatible with running dual operating systems, the device comprising:

[0072] A first installation unit 100 is used to install a first operating system according to a target file system, wherein the first operating system is built based on a first Linux kernel;

[0073] The second installation unit 200 is used to install a desktop system and a virtual machine startup program on the first operating system;

[0074] A virtual startup unit 300, used to start the target virtual machine and the resource allocation unit through the virtual machine startup program, and the resource allocation unit is used to manage the memory resources of the target file system;

[0075] The third installation unit 400 is used to install a second operating system using the target virtual machine, where the second operating system is built based on a second Linux kernel and has permission to call the target file system.

[0076] In one embodiment, the target file system includes a root directory file system, a user file system and an extended file system of an extended device; the root directory file system is used to provide startup resources for the first operating system, and the user file system is used to store user files.

[0077] In one embodiment, the device further includes a resource allocation unit 500. The resource allocation unit 500 is configured to change the memory resources allocated by the target file system to the target virtual machine according to the resource utilization rate of the target file system by the first operating system and the resource utilization rate of the target file system by the second operating system.

[0078] In one embodiment, the resource allocation unit 500 is specifically used to change the memory resources allocated by the target file system to the target virtual machine based on a first call ratio of the first operating system to the target file system, a memory fragmentation rate of the first operating system, a second call ratio of the second operating system to the target file system, and a cache hit rate of the second operating system.

[0079] In one embodiment, the resource allocation unit 500 is specifically used to determine the change probability coefficient based on the first call ratio, the memory fragmentation rate, the second call ratio, and the cache hit rate; when the change probability coefficient is greater than or equal to a preset increase coefficient, the memory resources allocated by the target file system to the target virtual machine are increased; when the change probability coefficient is less than a preset reduction coefficient, the memory resources allocated by the target file system to the target virtual machine are reduced.

[0080] In one embodiment, the change probability coefficient is determined according to the first call ratio, the memory fragmentation rate, the second call ratio, and the cache hit rate, and is implemented by the following formula:

[0081]

[0082] In the formula, G represents the change probability coefficient, m1 represents the first call ratio of the first operating system to the target file system, m2 represents the second call ratio of the second operating system to the target file system, a represents the memory fragmentation rate of the first operating system, and c represents the cache hit rate of the second operating system.

[0083] Each unit described in the above embodiments may be implemented by a computer chip or a product having a certain function. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0084] For the convenience of description, the above devices are described in terms of functions and are described separately in various units. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0085] The embodiment of the present invention also provides a computer device having the above Figure 3 Devices shown are compatible with running dual operating systems.

[0086] See also Figure 4 , Figure 4 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 4 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 4 A processor 10 is taken as an example.

[0087] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0088] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.

[0089] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0090] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0091] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.

[0092] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0093] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.

[0094] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the embodiments of the device, equipment, and storage medium, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.

[0095] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

[0096] Although the embodiments of the present disclosure have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present disclosure, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A method for running dual operating systems compatibly, characterized in that: The method comprises: According to the target file system, installing a first operating system, wherein the first operating system is built based on a first Linux kernel; Installing a desktop system and a virtual machine startup program on the first operating system; Starting the target virtual machine and the resource allocation unit through the virtual machine startup program, wherein the resource allocation unit is used to manage the memory resources of the target file system; A second operating system is installed using the target virtual machine, where the second operating system is built based on a second Linux kernel and has permission to call the target file system.

2. The method according to claim 1, characterized in that The method further comprises: The memory resources allocated by the target file system to the target virtual machine are changed according to the resource utilization rate of the target file system by the first operating system and the resource utilization rate of the target file system by the second operating system.

3. The method according to claim 2, characterized in that The changing the memory resources allocated by the target file system to the target virtual machine according to the resource utilization rate of the target file system by the first operating system and the resource utilization rate of the target file system by the second operating system includes: The memory resources allocated by the target file system to the target virtual machine are changed according to a first call ratio of the first operating system to the target file system, a memory fragmentation rate of the first operating system, a second call ratio of the second operating system to the target file system, and a cache hit rate of the second operating system.

4. The method according to claim 3, characterized in that The changing the memory resources allocated by the target file system to the target virtual machine according to the first calling ratio of the first operating system to the target file system, the memory fragmentation rate of the first operating system, the second calling ratio of the second operating system to the target file system, and the cache hit rate of the second operating system includes: Determining a change probability coefficient according to the first call ratio, the memory fragmentation rate, the second call ratio, and the cache hit rate; When the change probability coefficient is greater than or equal to a preset increase coefficient, increasing the memory resources allocated by the target file system to the target virtual machine; When the change probability coefficient is less than a preset reduction coefficient, the memory resources allocated by the target file system to the target virtual machine are reduced.

5. The method according to claim 4, characterized in that The determining of the change probability coefficient according to the first call ratio, the memory fragmentation rate, the second call ratio, and the cache hit rate is implemented by the following formula: In the formula, G represents the change probability coefficient, m1 represents the first call ratio of the first operating system to the target file system, m2 represents the second call ratio of the second operating system to the target file system, a represents the memory fragmentation rate of the first operating system, and c represents the cache hit rate of the second operating system.

6. The method according to any one of claims 1 to 5, characterized in that: The target file system includes a root directory file system, a user file system and an extended file system of an extended device; the root directory file system is used to provide startup resources for the first operating system, and the user file system is used to store user files.

7. A device compatible with running dual operating systems, characterized in that: The device comprises: A first installation unit, configured to install a first operating system according to a target file system, wherein the first operating system is built based on a first Linux kernel; A second installation unit, used to install a desktop system and a virtual machine startup program on the first operating system; A virtual startup unit, used to start the target virtual machine and the resource allocation unit through the virtual machine startup program, and the resource allocation unit is used to manage the memory resources of the target file system; The third installation unit is used to use the target virtual machine to install a second operating system, where the second operating system is built based on a second Linux kernel and has permission to call the target file system.

8. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method for compatible running of dual operating systems as described in any one of claims 1 to 6 by executing the computer instructions.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method for compatible operation of dual operating systems according to any one of claims 1 to 6.

10. A computer program product, characterized in that The method comprises computer instructions for causing a computer to execute the method for compatible operation of dual operating systems according to any one of claims 1 to 6.