Method and apparatus for running docker service on android operating system

By creating directories, symbolic links, and adding kernel configurations on the Android operating system, the problem of ordinary Android phones being unable to run multiple operating systems simultaneously was solved, enabling multiple Android systems to run on a single processor and reducing the cost of cloud applications.

CN115658181BActive Publication Date: 2026-03-20BEIJING HAIYUDONGXIANG TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-23
Publication Date
2026-03-20

AI Technical Summary

Technical Problem

Regular Android phones cannot run multiple Android operating systems simultaneously, which limits the multitasking capabilities of cloud applications and makes it impossible to effectively support Docker services.

Method used

On the Android operating system, create the necessary directories, a symbolic link to the root directory, add the kernel configuration and cgroup options that the Docker service depends on, and enable the Docker service to run.

Benefits of technology

This enables multiple Android operating systems to run simultaneously on a single physical processor, reducing the operating costs of cloud applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115658181B_ABST
    Figure CN115658181B_ABST
Patent Text Reader

Abstract

The application provides a method and device for running a docker service on an Android operating system, an electronic device and a storage medium, and the method comprises the following steps: creating a first directory, wherein the first directory comprises at least one directory required for running the docker service; soft connecting a second directory to a third directory, wherein the second directory is a root directory of the Android operating system, and the third directory has a write permission; adding a configuration dependent on the docker service in a kernel configuration; and adding a cgroup option dependent on the docker service in the kernel, so that the docker service can be supported, thereby achieving the purpose of simultaneously running multiple Android operating systems on one physical processor.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of cloud applications, and in particular to a method and device for running a docker service on an Android operating system, an electronic device, and a storage medium. BACKGROUND

[0002] A common Android phone is limited by the screen size and can usually only run one Android operating system at the same time, and only supports one application in the front end. In the field of cloud applications (such as cloud games), in order to maximize benefits, a processor needs to be able to run multiple Android operating systems at the same time, and each operating system runs an application. Based on performance considerations, docker (docker is an open source application container engine that allows developers to package their applications and dependent packages into a portable container and then publish them to any popular Linux or Windows operating system machine, and can also achieve virtualization. Containers are completely using a sandbox mechanism and will not have any interface with each other) technology can be used to start multiple Android operating systems. However, the default Android operating system does not support docker, and thus multiple Android operating systems cannot be run simultaneously on one physical processor.

[0003] Therefore, how to provide a solution to support docker services and achieve the purpose of running multiple Android operating systems on one physical processor simultaneously has become a technical problem to be solved. SUMMARY

[0004] To solve the technical problems existing in the prior art, the embodiments of the present application provide a method and device for running a docker service on an Android operating system, an electronic device, and a storage medium.

[0005] In a first aspect, the embodiments of the present application provide a method for running a docker service on an Android operating system, comprising:

[0006] Creating a first directory, wherein the first directory includes at least one directory required for the docker service to run;

[0007] Soft connecting a second directory to a third directory, wherein the second directory is the root directory of the Android operating system, and the third directory has write permissions;

[0008] Adding a configuration dependent on the docker service in the kernel configuration;

[0009] Adding a cgroup option dependent on the docker service in the kernel.

[0010] In a second aspect, the embodiments of the present application also provide a device for running a docker service on an Android operating system, comprising:

[0011] a creating unit, configured to create a first directory, wherein the first directory comprises at least one directory required for running a docker service;

[0012] a connecting unit, configured to soft connect a second directory to a third directory, wherein the second directory is a root directory of an Android operating system, and the third directory has a write permission;

[0013] a first adding unit, configured to add a configuration dependent on the docker service in a kernel configuration;

[0014] a second adding unit, configured to add a cgroup option dependent on the docker service in a kernel.

[0015] In a third aspect, an embodiment of the present application further provides a computer readable storage medium, and the computer readable storage medium stores a computer program, and the computer program is run by a processor to execute steps of the method for running a docker service on an Android operating system according to the first aspect.

[0016] In a fourth aspect, an embodiment of the present application further provides an electronic device, comprising a processor, a storage medium and a bus, the storage medium stores machine readable instructions executable by the processor, when the electronic device is running, the processor communicates with the storage medium through the bus, and the processor executes the machine readable instructions to execute steps of the method for running a docker service on an Android operating system according to the first aspect.

[0017] In summary, the method and device for running a docker service on an Android operating system, the electronic device and the storage medium provided by the embodiments of the present application create a first directory, soft connect a second directory to a third directory, add a configuration dependent on a docker service in a kernel configuration, and add a cgroup option dependent on the docker service in a kernel, so that the docker service can be run on an Android operating system, each docker service can run a complete Android, and the purpose of running multiple Androids on one physical processor can be achieved, thereby greatly reducing the running cost of a single cloud application. BRIEF DESCRIPTION OF DRAWINGS

[0018] Figure 1 a flowchart of an embodiment of the method for running a docker service on an Android operating system provided by the embodiments of the present application;

[0019] Figure 2 a structural diagram of an embodiment of the device for running a docker service on an Android operating system provided by the embodiments of the present application;

[0020] Figure 3 FIG. 1 shows a structural schematic diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0021] In order to make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. It should be understood that the drawings in the present application only serve the purpose of description and illustration, and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn according to the actual proportions. The flowcharts used in the present application show the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowcharts can not be implemented in sequence, and the steps without logical contextual relationship can be reversed in sequence or implemented simultaneously. In addition, one or more other operations can be added to the flowcharts or one or more operations can be removed from the flowcharts under the guidance of the content of the present application.

[0022] In addition, the described embodiments are only some of the embodiments of the present application, not all the embodiments. The components of the embodiments of the present application described and shown in the drawings herein can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the claimed present application, but only represents selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.

[0023] It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the presence of the features declared thereafter, but does not exclude the addition of other features.

[0024] Reference Figure 1 FIG. 1 shows a structural schematic diagram of an electronic device according to an embodiment of the present application.

[0025] S10, creating a first directory, wherein the first directory includes at least one directory required for the docker service to run;

[0026] It should be noted that some of the directories required for the docker service to run are not in the Android system, and therefore need to be created, that is, the first directory is created.

[0027] S11, soft connecting a second directory to a third directory, wherein the second directory is the root directory of the Android operating system, and the third directory has write permission;

[0028] It should be noted that the root directory ( / ) of the default Android is read-only and has no write permission, and the docker service writes information to the above directory during running, so the above directory needs to be soft linked to a directory that can be written, that is, the third directory.

[0029] S12, adding a configuration dependent on the docker service in kernel configuration;

[0030] S13, adding a cgroup option dependent on the docker service in the kernel.

[0031] The method for running the docker service on the Android operating system provided by the embodiments of the present application creates a first directory; soft links a second directory to a third directory; adds a configuration dependent on the docker service in kernel configuration; and adds a cgroup option dependent on the docker service in the kernel. The above scheme can run the docker service on the Android operating system, and each docker service can run a complete Android, so that the purpose of running multiple Androids on one physical processor can be achieved, thereby greatly reducing the running cost of a single cloud application.

[0032] On the basis of the foregoing method embodiment, the first directory can include:

[0033] at least one of the / var directory, the / tmp directory, the / run directory, the / cpuset directory, the / blkio directory, the / cpuctl directory, the / devices directory, the / freezer directory, the / memcg directory, the / net_cls directory, the / net_prio directory, and the / perf_event directory.

[0034] On the basis of the foregoing method embodiment, the third directory can include: the / data / docker directory.

[0035] On the basis of the foregoing method embodiment, the cgroup option can include: at least one of the cpuset.cpus option and the cpuset.mems option.

[0036] On the basis of the foregoing method embodiment, the version of the docker service can be a static library version.

[0037] It should be noted that the Android system uses the bionic libc library developed by Google, and cannot use the docker service based on the c runtime library glibc, so a static library version of the docker service needs to be selected.

[0038] Reference Figure 2As shown, a structural schematic diagram of an apparatus for running a docker service on an Android operating system is provided in the embodiments of the present application, and the apparatus comprises:

[0039] A creating unit 20 is configured to create a first directory, wherein the first directory comprises at least one directory required by the docker service for running;

[0040] A connecting unit 21 is configured to soft-connect a second directory to a third directory, wherein the second directory is a root directory of the Android operating system, and the third directory has a write permission;

[0041] A first adding unit 22 is configured to add a configuration dependent on the docker service in a kernel configuration;

[0042] A second adding unit 23 is configured to add a cgroup option dependent on the docker service in the kernel.

[0043] The apparatus for running the docker service on the Android operating system provided in the embodiments of the present application creates the first directory by means of the creating unit 20, soft-connects the second directory to the third directory by means of the connecting unit 21, adds the configuration dependent on the docker service in the kernel configuration by means of the first adding unit 22, and adds the cgroup option dependent on the docker service in the kernel by means of the second adding unit 23. Through the above-mentioned solutions, the docker service can be run on the Android operating system, and each docker service can run a complete Android, so that the purpose of running multiple Androids on one physical processor can be achieved, thereby greatly reducing the running cost of a single cloud application.

[0044] On the basis of the foregoing apparatus embodiment, the first directory can comprise:

[0045] At least one of the / var directory, the / tmp directory, the / run directory, the / cpuset directory, the / blkio directory, the / cpuctl directory, the / devices directory, the / freezer directory, the / memcg directory, the / net_cls directory, the / net_prio directory, and the / perf_event directory.

[0046] On the basis of the foregoing apparatus embodiment, the third directory can comprise a / data / docker directory.

[0047] As Figure 3As shown, the electronic device provided by the embodiment of the present application comprises a processor 30, a memory 31 and a bus 32, the memory 31 stores machine readable instructions executable by the processor 30, when the electronic device is running, the processor 30 and the memory 31 communicate through the bus 32, and the processor 30 executes the machine readable instructions to perform the steps of the method for running the docker service on the Android operating system.

[0048] Specifically, the memory 31 and the processor 30 can be general memory and processor, which are not specifically limited here, and when the processor 30 runs the computer program stored in the memory 31, the method for running the docker service on the Android operating system can be executed.

[0049] Corresponding to the method for running the docker service on the Android operating system, the embodiment of the present application further provides a computer readable storage medium, the computer readable storage medium stores a computer program, and the computer program is executed by the processor to perform the steps of the method for running the docker service on the Android operating system.

[0050] Those skilled in the art can clearly understand that, for the convenience and brevity of the description, the specific working process of the system and device described above can refer to the corresponding process in the method embodiment, which will not be described in detail in the present application. In the several embodiments provided by the present application, it should be understood that the disclosed system, device and method can be implemented by other ways. The device embodiments described above are only schematic, for example, the division of the modules is only a logical function division, and there can be another division way in actual implementation, and for example, a plurality of modules or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some communication interfaces, devices or modules, and can be electrical, mechanical or other forms.

[0051] The modules described as separate components can or can not be physically separated, and the components shown as modules can or can not be physical units, that is, they can be located in one place, or can be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiment of the present application.

[0052] In addition, the functional units in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit.

[0053] The above merely provides the specific implementation of the present application, but the protection scope of the present application is not limited to this. Any person skilled in the art can easily think of the changes or replacements within the technical range disclosed by the present application, which should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A method for running Docker services on the Android operating system, characterized in that, include: Create a first directory, which includes at least one directory required for the Docker service to run. The first directory includes: The directories are / var, / tmp, / run, / cpuset, / blkio, / cpuctl, / devices, / freezer, / memcg, / net_cls, / net_prio, and / perf_event. Create a symbolic link from the second directory to the third directory, where the second directory is the root directory of the Android operating system and the third directory has write permissions; Add the Docker service dependency configuration to the kernel configuration; Add cgroup options to the kernel that the Docker service depends on, including at least one of the cpuset.cpus and cpuset.mems options; The third directory includes: the / data / docker directory; The Docker service version mentioned is the static link library version.

2. A device for running Docker services on the Android operating system, characterized in that, include: A creation unit is used to create a first directory, wherein the first directory includes at least one directory required for the Docker service to run. The first directory includes: The directories are / var, / tmp, / run, / cpuset, / blkio, / cpuctl, / devices, / freezer, / memcg, / net_cls, / net_prio, and / perf_event. A connection unit is used to soft link a second directory to a third directory, wherein the second directory is the root directory of the Android operating system, and the third directory has write permissions; The first addition unit is used to add Docker service dependency configurations to the kernel configuration; The second adding unit is used to add cgroup options that the Docker service depends on in the kernel. The cgroup options include at least one of the cpuset.cpus and cpuset.mems options. The third directory includes the / data / docker directory. The Docker service version mentioned is the static link library version.

3. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the method for running a Docker service on the Android operating system as described in claim 1.

4. An electronic device, characterized in that, include: The device includes a processor, a storage medium, and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of the method for running a Docker service on the Android operating system as described in claim 1.