CN111367648A - Resource allocation method and device - Google Patents

Resource allocation method and device Download PDF

Info

Publication number
CN111367648A
CN111367648A CN201811589194.8A CN201811589194A CN111367648A CN 111367648 A CN111367648 A CN 111367648A CN 201811589194 A CN201811589194 A CN 201811589194A CN 111367648 A CN111367648 A CN 111367648A
Authority
CN
China
Prior art keywords
operating system
resource allocation
resource
allocation amount
control group
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201811589194.8A
Other languages
Chinese (zh)
Inventor
付海望
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
TD Tech Chengdu Co Ltd
Chengdu TD Tech Ltd
Original Assignee
Chengdu TD Tech Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chengdu TD Tech Ltd filed Critical Chengdu TD Tech Ltd
Priority to CN201811589194.8A priority Critical patent/CN111367648A/en
Publication of CN111367648A publication Critical patent/CN111367648A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention provides a resource allocation method and a resource allocation device, which are applied to terminal equipment running double operating systems, wherein one operating system is a foreground operating system, and the other operating system is a background operating system; the method comprises the steps that resource request information sent by a first operating system is obtained, and the resource request information is used for requesting resource allocation; determining whether to allocate resources for the first operating system according to the maximum resource allocation amount corresponding to the first operating system and the allocated resource amount; if the first operating system is a foreground operating system, the maximum resource allocation amount corresponding to the first operating system is a first resource allocation amount; if the first operating system is a background operating system, the maximum resource allocation amount corresponding to the first operating system is a second resource allocation amount, wherein the first resource allocation amount is greater than the second resource allocation amount, so that the performance of a foreground operating system is improved, and the user experience of the terminal equipment with the two operating systems is improved.

Description

Resource allocation method and device
Technical Field
The invention relates to the technical field of intelligent terminals, in particular to a resource allocation method and device.
Background
With the wide use of intelligent terminals, the intelligent terminals of Android (Android) platform become more and more people to choose due to the superiority and convenience of the platform. Meanwhile, due to the rapid development of the mobile internet, system applications such as mobile office, electronic commerce and new media social contact become more and more popular. In order to meet different requirements of different users on system applications, an Android dual-operating-system intelligent terminal product appears, namely, two Android operating systems are installed in one intelligent terminal.
The Android dual operating system is implemented based on a Linux Container (LXC). The two Android operating systems run simultaneously, and at the same time, one of the Android operating systems is a foreground operating system, and the other Android operating system is a background operating system. The foreground operating system and the background operating system share system resources (e.g., a Central Processing Unit (CPU), a memory, or an Input/output (I/O) device). In the competition of system resources, the Linux kernel generally adopts a method of firstly requesting the operating system of the system resources to be firstly allocated.
However, all the operations of the user are handed over with the foreground operating system, and the performance of the foreground operating system directly affects the user experience of the terminal. Under the condition that the background operating system occupies higher system resources, the foreground operating system cannot obtain the system resources, and the response is slow. The foreground operating system is stuck, resulting in poor user experience.
Disclosure of Invention
The invention provides a resource allocation method and device, which are used for improving the user experience of terminal equipment with double operating systems.
In a first aspect, the present invention provides a method for resource allocation, which is applied to a terminal device running dual operating systems, wherein one operating system is a foreground operating system, and the other operating system is a background operating system; the method comprises the following steps:
acquiring resource request information sent by a first operating system, wherein the resource request information is used for requesting resource allocation;
determining whether to allocate resources for the first operating system according to a maximum resource allocation amount corresponding to the first operating system and the allocated resource amount, where the maximum resource allocation amount is used to indicate that a total resource allocated for the first operating system does not exceed the maximum resource allocation amount;
if the first operating system is a foreground operating system, the maximum resource allocation amount corresponding to the first operating system is a first resource allocation amount; if the first operating system is a background operating system, the maximum resource allocation amount corresponding to the first operating system is a second resource allocation amount, wherein the first resource allocation amount is greater than the second resource allocation amount.
Further, the determining whether to allocate resources for the first operating system according to the maximum resource allocation amount corresponding to the first operating system and the allocated resource amount includes:
and if the allocated resource amount is less than the maximum resource allocation amount, allocating resources for the first operating system.
Further, if the allocated resource amount is equal to the maximum resource allocation amount, the first operating system is refused to be allocated with the resource.
Further, the resource request information includes a first process identifier;
determining whether to allocate resources for the first operating system according to the maximum resource allocation amount corresponding to the first operating system and the allocated resource amount, including:
determining a first control group corresponding to the first operating system according to the first process identifier, wherein the first control group corresponding to the first operating system is a first control group to which the first process identifier belongs;
and determining whether to allocate resources to the first operating system according to the maximum resource allocation amount corresponding to the first control group and the allocated resource amount, wherein the maximum resource allocation amount corresponding to the first control group is the maximum resource allocation amount corresponding to the first operating system.
Further, the resource request information further includes: a resource type;
the determining whether to allocate resources to the first operating system according to the maximum resource allocation amount corresponding to the first control group and the allocated resource amount includes:
and determining whether to allocate resources for the first operating system according to the maximum resource allocation amount corresponding to the resource type of the first control group and the allocated resource amount.
Further, the resource type includes at least one of:
a Central Processing Unit (CPU) resource;
memory resources;
and inputting and outputting IO resources.
Further, before determining, according to the first process identifier, a first control group to which the first process identifier belongs, the method further includes:
and establishing a corresponding relation between the first process identification and the first control group.
In a second aspect, the present invention provides a resource allocation apparatus, which is applied to a terminal device running dual operating systems, wherein one operating system is a foreground operating system, and the other operating system is a background operating system; the method comprises the following steps:
the system comprises an acquisition module, a resource allocation module and a resource allocation module, wherein the acquisition module is used for acquiring resource request information sent by a first operating system, and the resource request information is used for requesting resource allocation;
a processing module, configured to determine whether to allocate resources to the first operating system according to a maximum resource allocation amount corresponding to the first operating system and an allocated resource amount, where the maximum resource allocation amount is used to indicate that a total resource allocated to the first operating system does not exceed the maximum resource allocation amount;
if the first operating system is a foreground operating system, the maximum resource allocation amount corresponding to the first operating system is a first resource allocation amount; if the first operating system is a background operating system, the maximum resource allocation amount corresponding to the first operating system is a second resource allocation amount, wherein the first resource allocation amount is greater than the second resource allocation amount.
Further, the processing module is specifically configured to allocate the resource to the first operating system if the allocated resource amount is smaller than the maximum resource allocation amount.
Further, the processing module is further configured to refuse to allocate resources to the first operating system if the allocated amount of resources is equal to the maximum resource allocation amount.
Further, the resource request information includes a first process identifier; the processing module is specifically configured to:
determining a first control group corresponding to the first operating system according to the first process identifier, wherein the first control group corresponding to the first operating system is a first control group to which the first process identifier belongs;
and determining whether to allocate resources to the first operating system according to the maximum resource allocation amount corresponding to the first control group and the allocated resource amount, wherein the maximum resource allocation amount corresponding to the first control group is the maximum resource allocation amount corresponding to the first operating system.
Further, the resource request information further includes: a resource type;
the processing module is specifically configured to determine whether to allocate resources to the first operating system according to a maximum resource allocation amount corresponding to the resource type of the first control group and an allocated resource amount.
Further, the resource type includes at least one of:
a Central Processing Unit (CPU) resource;
memory resources;
and inputting and outputting IO resources.
Further, before determining, according to the first process identifier, a first control group to which the first process identifier belongs, the processing module is further configured to establish a correspondence between the first process identifier and the first control group.
The invention provides a resource allocation method and a resource allocation device, which are applied to terminal equipment running double operating systems, wherein one operating system is a foreground operating system, and the other operating system is a background operating system; acquiring resource request information sent by a first operating system, wherein the resource request information is used for requesting resource allocation; determining whether to allocate resources for the first operating system according to a maximum resource allocation amount corresponding to the first operating system and the allocated resource amount, where the maximum resource allocation amount is used to indicate that a total resource allocated for the first operating system does not exceed the maximum resource allocation amount; if the first operating system is a foreground operating system, the maximum resource allocation amount corresponding to the first operating system is a first resource allocation amount; if the first operating system is a background operating system, the maximum resource allocation amount corresponding to the first operating system is a second resource allocation amount, wherein the first resource allocation amount is greater than the second resource allocation amount, so that the performance of the foreground operating system is improved, and the user experience of the terminal equipment with the two operating systems is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
FIG. 1 is a flowchart illustrating a first embodiment of a method for resource allocation according to the present invention;
FIG. 2 is a flowchart illustrating a second embodiment of a method for resource allocation according to the present invention;
FIG. 3 is a flowchart illustrating a third embodiment of a method for resource allocation according to the present invention;
fig. 4 is a schematic structural diagram of a first apparatus for resource allocation according to the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, as well as in the drawings, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are, for example, capable of operation in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
The invention is applied to terminal equipment running double operating systems, wherein one operating system is a foreground operating system, and the other operating system is a background operating system; acquiring resource request information sent by a first operating system, wherein the resource request information is used for requesting resource allocation; determining whether to allocate resources for the first operating system according to a maximum resource allocation amount corresponding to the first operating system and the allocated resource amount, where the maximum resource allocation amount is used to indicate that a total resource allocated for the first operating system does not exceed the maximum resource allocation amount; if the first operating system is a foreground operating system, the maximum resource allocation amount corresponding to the first operating system is a first resource allocation amount; if the first operating system is a background operating system, the maximum resource allocation amount corresponding to the first operating system is a second resource allocation amount, wherein the first resource allocation amount is greater than the second resource allocation amount, so that the performance of the foreground operating system is improved, and the user experience of the terminal equipment with the two operating systems is improved.
The technical solution of the present invention will be described in detail below with specific examples. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments.
Fig. 1 is a flowchart illustrating a first embodiment of a method for resource allocation according to the present invention, as shown in fig. 1, the method of this embodiment may include:
s101, acquiring resource request information sent by a first operating system.
Wherein the resource request information is used for requesting resource allocation. The first operating system may be a foreground operating system in the dual operating system, or may be a background operating system in the dual operating system.
S102, determining whether to allocate resources for the first operating system according to the maximum resource allocation amount corresponding to the first operating system and the allocated resource amount.
Wherein the maximum resource allocation amount is used to indicate that the total resource allocated for the first operating system does not exceed the maximum resource allocation amount.
If the first operating system is a foreground operating system, the maximum resource allocation amount corresponding to the first operating system is a first resource allocation amount; and if the first operating system is a background operating system, the maximum resource allocation amount corresponding to the first operating system is a second resource allocation amount, wherein the first resource allocation amount is greater than the second resource allocation amount.
In the embodiment, resource request information sent by a first operating system is acquired, and the resource request information is used for requesting resource allocation; determining whether to allocate resources for the first operating system according to the maximum resource allocation amount corresponding to the first operating system and the allocated resource amount, wherein the maximum resource allocation amount is used for indicating that the total resources allocated for the first operating system do not exceed the maximum resource allocation amount; if the first operating system is a foreground operating system, the maximum resource allocation amount corresponding to the first operating system is a first resource allocation amount; if the first operating system is a background operating system, the maximum resource allocation amount corresponding to the first operating system is a second resource allocation amount, wherein the first resource allocation amount is greater than the second resource allocation amount, so that the foreground operating system can obtain more system resources relative to the background operating system, the performance of the foreground operating system is improved, and the user experience of the terminal equipment with the two operating systems is improved.
Optionally, in step S102, it is determined whether to allocate resources to the first operating system according to the maximum resource allocation amount corresponding to the first operating system and the allocated resource amount, and one possible implementation manner is:
and if the allocated resource amount is less than the maximum resource allocation amount, allocating the resource for the first operating system.
Optionally, the method may further include:
and if the allocated resource amount is equal to the maximum resource allocation amount, refusing to allocate the resource for the first operating system.
In the first embodiment of the resource allocation method of the present invention, step S101 obtains resource request information sent by a first operating system, where the resource request information includes a first process identifier. Fig. 2 is a flowchart illustrating a second embodiment of the method for allocating resources according to the present invention, and fig. 2 is a description of a specific implementation manner of step S102 in fig. 1, based on the embodiment shown in fig. 1, in combination with a first process identifier included in a resource request message, as shown in fig. 2:
s201, determining a first control group corresponding to the first operating system according to the first process identifier.
The first control group corresponding to the first operating system is a first control group to which the first process identifier belongs.
S202, determining whether to allocate resources for the first operating system according to the maximum resource allocation amount corresponding to the first control group and the allocated resource amount.
The maximum resource allocation amount corresponding to the first control group is the maximum resource allocation amount corresponding to the first operating system.
In this embodiment, a first control group corresponding to a first operating system is determined according to a first process identifier, where the first control group corresponding to the first operating system is a first control group to which the first process identifier belongs; according to the maximum resource allocation amount corresponding to the first control group and the allocated resource amount, whether resources are allocated to the first operating system is determined, the maximum resource allocation amount corresponding to the first control group is the maximum resource allocation amount corresponding to the first operating system, and the resource amount capable of being allocated to the first operating system is controlled, so that the foreground operating system can obtain more system resources relative to the background operating system, the performance of the foreground operating system is improved, and the user experience of the dual-operating-system terminal equipment is improved.
Optionally, in the first embodiment of the method for resource allocation in the present invention, step S101 obtains resource request information sent by the first operating system, where the resource request information further includes a resource type. In step S202, it is determined whether to allocate resources to the first operating system according to the maximum resource allocation amount corresponding to the first control group and the allocated resource amount, and one possible implementation manner is as follows:
and determining whether to allocate resources for the first operating system according to the maximum resource allocation amount corresponding to the resource type of the first control group and the allocated resource amount.
Acquiring the maximum resource allocation amount corresponding to the resource type of the first control group according to the resource type in the resource request message; and determining whether to allocate resources for the first operating system according to the maximum resource allocation amount corresponding to the resource type of the first control group and the allocated resource amount of the resource type.
Wherein the resource type includes at least one of: CPU resource, memory resource, input/output IO resource.
Optionally, before determining, according to the first process identifier, the first control group corresponding to the first operating system in step S201, the method further includes:
and establishing a corresponding relation between the first process identification and the first control group.
Fig. 3 is a flowchart illustrating a third embodiment of the resource allocation method of the present invention, and fig. 3 is a description of a possible implementation manner for establishing a correspondence between a first process identifier and a first control group based on the embodiment illustrated in fig. 2, as illustrated in fig. 3:
s301, when the double operation system root domain is started, the resource control subsystem of the control group is installed.
The Control Group (CGroup) is a function of the Linux kernel, and may allocate a certain amount of system resources (such as CPU, memory, IO, etc.) to a specific Group of processes. CGroup itself is an infrastructure providing a function of performing packetization management on a process and an interface, and a specific resource management function such as IO or memory allocation control is realized by this function. These specific resource management functions are referred to as CGroup subsystems. The CGroup subsystem comprises a Memory subsystem for controlling the Memory, a CPU subsystem for controlling the process scheduling and the like.
When the intelligent terminal is started, after the Linux kernel is started, a Root domain initialization process is started. And when the Root domain is started, installing a CGroup resource control subsystem. For example, the CPU control subsystem is installed as follows:
mount cgroup none/dev/cpuctl cpu
s302, when the LXC starts the double operating systems, a corresponding control group is created for each operating system, and all process identifications in each operating system are configured into the corresponding control group.
For example, when the LXC starts the dual operating systems, respective CPU control groups are created under the directory/dev/CPU, such as vp1 and vp2, where vp1 corresponds to the first operating system and vp2 corresponds to the second operating system. Thus, two CPU control groups are created in the system;
mkdir/dev/cpuctl/vp1
mkdir/dev/cpuctl/vp2
the following configuration parameters are in each control group:
clone _ child cpu set, used to set whether a child CGroup will inherit the configuration of the cpu set of the parent CGroup. Wherein, the CPU sets allocates independent CPU and memory nodes for CGroup.
Procs, used to set up the thread group ID list for CGroup.
Rt _ period _ us, used to set the cycle of CGroup to obtain CPU resources, in microseconds.
Rt _ runtime _ us, used to set the time in microseconds that a task in CGroup can get the CPU resource the longest.
Share, used to set the relative value of the CGroup packet task to get CPU time. For example, if the cpu.share values of both control group a and control group B are 1024, then the CPU time allocated to the tasks in control group a and control group B is the same, and if the cpu.share value of control group C is 512, then the CPU time obtained by the tasks in control group C is half of that of a or B.
notify _ on _ release, which is used to set whether to execute release _ agent when the last process of the CGroup exits, and release _ agent is a path, and is usually used to automatically clean up the unused CGroup after the process exits.
tasks are used for configuring process identifications below the CGroup, and if one process identification is written into a tasks file, the process is added into the CGroup.
When the LXC starts the first operating system, all process identifications in the first operating system are written into a/dev/cpu/vp 1/tasks file, so that all processes in the first operating system are in a vp1 control group;
when the LXC starts the second operating system, all process identifications in the second operating system are written into the/dev/cpu/vp 2/tasks file, and all processes in the second operating system are in the vp2 control group.
In the embodiment, when the Root domain of the dual operating systems is started, the resource control subsystem of the CGroup is installed; when the LXC starts the dual operating systems, a corresponding control group is created for each operating system, and all process identifiers of each operating system are configured into the corresponding control group, so that the corresponding relation between the process identifiers and the control groups is established.
After the dual operating systems establish the corresponding relationship between the process identifier and the control group, when the foreground operating system and the background operating system are switched, the maximum resource allocation amount of the foreground operating system is configured to be a first resource allocation amount, and the maximum resource allocation amount of the background operating system is configured to be a second resource allocation amount, wherein the first resource allocation amount is larger than the second resource allocation amount.
For example, the allocation of CPU resources by foreground and background operating systems is controlled. When a foreground operating system and a background operation are switched, writing the CPU control group CPU, shares parameters corresponding to the foreground operating system into a first numerical value, and writing the CPU control group CPU, shares parameters corresponding to the background operating system into a second numerical value, wherein the first numerical value is larger than the second numerical value. For example, the first value is 1024 and the second value is 128. Therefore, the ratio of the foreground operating system to the background operating system to the CPU is 8:1, in this case, even if the background operating system abnormally occupies the CPU, at most 1/8 of the CPU can be occupied, and the use of the foreground operating system to the CPU is not influenced.
Fig. 4 is a schematic structural diagram of a first apparatus for resource allocation according to the present invention, as shown in fig. 4, the apparatus of the present embodiment includes: an acquisition module 401 and a processing module 402.
The obtaining module 401 is configured to obtain resource request information sent by a first operating system, where the resource request information is used to request resource allocation;
the processing module 402 is configured to determine whether to allocate resources to a first operating system according to a maximum resource allocation amount corresponding to the first operating system and an allocated resource amount, where the maximum resource allocation amount is used to indicate that a total resource allocated to the first operating system does not exceed the maximum resource allocation amount;
if the first operating system is a foreground operating system, the maximum resource allocation amount corresponding to the first operating system is a first resource allocation amount; and if the first operating system is a background operating system, the maximum resource allocation amount corresponding to the first operating system is a second resource allocation amount, wherein the first resource allocation amount is greater than the second resource allocation amount.
Further, the processing module 402 is specifically configured to allocate the resource to the first operating system if the allocated resource amount is smaller than the maximum resource allocation amount.
Further, the processing module 402 is further configured to refuse to allocate resources for the first operating system if the allocated amount of resources is equal to the maximum resource allocation amount.
Further, the resource request information includes a first process identifier; the processing module 402 is specifically configured to:
determining a first control group corresponding to a first operating system according to the first process identifier, wherein the first control group corresponding to the first operating system is a first control group to which the first process identifier belongs;
and determining whether to allocate resources for the first operating system according to the maximum resource allocation amount corresponding to the first control group and the allocated resource amount, wherein the maximum resource allocation amount corresponding to the first control group is the maximum resource allocation amount corresponding to the first operating system.
Further, the resource request information further includes: a resource type;
the processing module 402 is specifically configured to determine whether to allocate resources to the first operating system according to a maximum resource allocation amount corresponding to the resource type of the first control group and the allocated resource amount.
Further, the resource type includes at least one of:
a Central Processing Unit (CPU) resource;
memory resources;
and inputting and outputting IO resources.
Further, the processing module 402 is further configured to establish a corresponding relationship between the first process identifier and the first control group before determining, according to the first process identifier, the first control group to which the first process identifier belongs.
The apparatus of this embodiment may be used in the technical solutions of any of the above embodiments of the present invention, and the implementation principles and technical effects are similar, which are not described herein again.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (14)

1. A method for distributing resources is applied to terminal equipment running double operating systems, wherein one operating system is a foreground operating system, and the other operating system is a background operating system; it is characterized by comprising:
acquiring resource request information sent by a first operating system, wherein the resource request information is used for requesting resource allocation;
determining whether to allocate resources for the first operating system according to a maximum resource allocation amount corresponding to the first operating system and the allocated resource amount, where the maximum resource allocation amount is used to indicate that a total resource allocated for the first operating system does not exceed the maximum resource allocation amount;
if the first operating system is a foreground operating system, the maximum resource allocation amount corresponding to the first operating system is a first resource allocation amount; if the first operating system is a background operating system, the maximum resource allocation amount corresponding to the first operating system is a second resource allocation amount, wherein the first resource allocation amount is greater than the second resource allocation amount.
2. The method of claim 1, wherein the determining whether to allocate resources for the first operating system according to the maximum resource allocation amount corresponding to the first operating system and the allocated resource amount comprises:
and if the allocated resource amount is less than the maximum resource allocation amount, allocating resources for the first operating system.
3. The method of claim 2, further comprising:
and if the allocated resource amount is equal to the maximum resource allocation amount, refusing to allocate the resource for the first operating system.
4. The method according to any of claims 1-3, wherein the resource request information comprises a first process identifier;
determining whether to allocate resources for the first operating system according to the maximum resource allocation amount corresponding to the first operating system and the allocated resource amount, including:
determining a first control group corresponding to the first operating system according to the first process identifier, wherein the first control group corresponding to the first operating system is a first control group to which the first process identifier belongs;
and determining whether to allocate resources to the first operating system according to the maximum resource allocation amount corresponding to the first control group and the allocated resource amount, wherein the maximum resource allocation amount corresponding to the first control group is the maximum resource allocation amount corresponding to the first operating system.
5. The method of claim 4, wherein the resource request information further comprises: a resource type;
the determining whether to allocate resources to the first operating system according to the maximum resource allocation amount corresponding to the first control group and the allocated resource amount includes:
and determining whether to allocate resources for the first operating system according to the maximum resource allocation amount corresponding to the resource type of the first control group and the allocated resource amount.
6. The method of claim 5, wherein the resource type comprises at least one of:
a Central Processing Unit (CPU) resource;
memory resources;
and inputting and outputting IO resources.
7. The method of claim 4, wherein before determining the first control group to which the first process identifier belongs based on the first process identifier, the method further comprises:
and establishing a corresponding relation between the first process identification and the first control group.
8. A resource allocation device is applied to terminal equipment running double operating systems, wherein one operating system is a foreground operating system, and the other operating system is a background operating system; it is characterized by comprising:
the system comprises an acquisition module, a resource allocation module and a resource allocation module, wherein the acquisition module is used for acquiring resource request information sent by a first operating system, and the resource request information is used for requesting resource allocation;
a processing module, configured to determine whether to allocate resources to the first operating system according to a maximum resource allocation amount corresponding to the first operating system and an allocated resource amount, where the maximum resource allocation amount is used to indicate that a total resource allocated to the first operating system does not exceed the maximum resource allocation amount;
if the first operating system is a foreground operating system, the maximum resource allocation amount corresponding to the first operating system is a first resource allocation amount; if the first operating system is a background operating system, the maximum resource allocation amount corresponding to the first operating system is a second resource allocation amount, wherein the first resource allocation amount is greater than the second resource allocation amount.
9. The apparatus of claim 8, wherein the processing module is specifically configured to allocate resources to the first operating system if the allocated amount of resources is less than the maximum resource allocation amount.
10. The apparatus of claim 9, wherein the processing module is further configured to deny allocation of resources to the first operating system if the allocated amount of resources is equal to the maximum resource allocation amount.
11. The apparatus according to any of claims 8-10, wherein the resource request information comprises a first process identifier;
the processing module is specifically configured to:
determining a first control group corresponding to the first operating system according to the first process identifier, wherein the first control group corresponding to the first operating system is a first control group to which the first process identifier belongs;
and determining whether to allocate resources to the first operating system according to the maximum resource allocation amount corresponding to the first control group and the allocated resource amount, wherein the maximum resource allocation amount corresponding to the first control group is the maximum resource allocation amount corresponding to the first operating system.
12. The apparatus of claim 11, wherein the resource request information further comprises: a resource type;
the processing module is specifically configured to determine whether to allocate resources to the first operating system according to a maximum resource allocation amount corresponding to the resource type of the first control group and an allocated resource amount.
13. The apparatus of claim 12, wherein the resource type comprises at least one of:
a Central Processing Unit (CPU) resource;
memory resources;
and inputting and outputting IO resources.
14. The apparatus as claimed in claim 11, wherein the processing module is further configured to establish a correspondence between the first process identifier and the first control group before determining the first control group to which the first process identifier belongs according to the first process identifier.
CN201811589194.8A 2018-12-25 2018-12-25 Resource allocation method and device Pending CN111367648A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811589194.8A CN111367648A (en) 2018-12-25 2018-12-25 Resource allocation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811589194.8A CN111367648A (en) 2018-12-25 2018-12-25 Resource allocation method and device

Publications (1)

Publication Number Publication Date
CN111367648A true CN111367648A (en) 2020-07-03

Family

ID=71207868

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811589194.8A Pending CN111367648A (en) 2018-12-25 2018-12-25 Resource allocation method and device

Country Status (1)

Country Link
CN (1) CN111367648A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113821306A (en) * 2021-09-24 2021-12-21 湖北亿咖通科技有限公司 Resource isolation method and device and terminal equipment
CN116033584A (en) * 2023-02-03 2023-04-28 阿里巴巴(中国)有限公司 Air interface resource scheduling method, network access equipment and communication network

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106776013A (en) * 2016-11-29 2017-05-31 北京元心科技有限公司 Multi-system resource scheduling method and device
CN107463402A (en) * 2017-07-31 2017-12-12 腾讯科技(深圳)有限公司 The operation method and device of virtual opetrating system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106776013A (en) * 2016-11-29 2017-05-31 北京元心科技有限公司 Multi-system resource scheduling method and device
CN107463402A (en) * 2017-07-31 2017-12-12 腾讯科技(深圳)有限公司 The operation method and device of virtual opetrating system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
青岛英谷教育科技股份有限公司著, 西安:西安电子科技大学出版社 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113821306A (en) * 2021-09-24 2021-12-21 湖北亿咖通科技有限公司 Resource isolation method and device and terminal equipment
CN113821306B (en) * 2021-09-24 2023-09-05 亿咖通(湖北)技术有限公司 Resource isolation method, device and terminal equipment
CN116033584A (en) * 2023-02-03 2023-04-28 阿里巴巴(中国)有限公司 Air interface resource scheduling method, network access equipment and communication network
CN116033584B (en) * 2023-02-03 2023-10-20 阿里巴巴(中国)有限公司 Air interface resource scheduling method, network access equipment and communication network

Similar Documents

Publication Publication Date Title
US11704144B2 (en) Creating virtual machine groups based on request
CN108924268B (en) Container cloud service system and pod creation method and device
US20170083381A1 (en) System and method for processing task resources
CN113037794B (en) Method, device and system for computing resource allocation scheduling
CN105897484A (en) Traffic management device, server and method
JP2013513174A (en) Method and system for managing virtual machine storage space and physical hosts
CN109766172B (en) Asynchronous task scheduling method and device
CN112148489A (en) Game resource scheduling method, device, equipment and storage medium
CN105791254B (en) Network request processing method and device and terminal
CN112865993B (en) Method and device for switching slave nodes in distributed master-slave system
CN107301093A (en) A kind of method and apparatus for managing resource
WO2023174037A1 (en) Resource scheduling method, apparatus and system, device, medium, and program product
CN108028806B (en) Method and device for allocating virtual resources in Network Function Virtualization (NFV) network
CN111367648A (en) Resource allocation method and device
CN104869229A (en) Task allocation method
CN110673787A (en) Volume configuration method and device
CN108647090B (en) Resource allocation method and device and server cluster
RU2522995C2 (en) Method and apparatus for creating peer-to-peer group in peer-to-peer application and method of using peer-to-peer group
CN114780232A (en) Cloud application scheduling method and device, electronic equipment and storage medium
CN114281473A (en) Cloud platform test environment management method, system, terminal and storage medium
CN113504981A (en) Task scheduling method and device, storage medium and electronic equipment
CN111240830A (en) Public link contract resource allocation method and device, electronic equipment and storage medium
CN114168094B (en) Miracast message processing method, device and equipment based on inheritable state machine
CN112583653A (en) Pressure testing method and device and computer storage medium
CN110750464A (en) Computer node storage pooling method, device and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200703