Resource processing method, device, equipment and storage medium

By adjusting the resource consumption state of the application in the user state, using swap-out and swap-in technologies, the resource waste problem of large-scale application clusters in low resource consumption states is solved, and the elastic scaling and efficient utilization of resources are achieved.

CN113626191BActive Publication Date: 2025-08-19BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110892296.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-04
Publication Date
2025-08-19
Estimated Expiration
2041-08-04

AI Technical Summary

Technical Problem

Large-scale application clusters still occupy all available resources in a low resource consumption state, resulting in waste of resources. How to improve resource utilization.

Method used

By obtaining the resource consumption status of the application, determining the target resource amount, and adjusting the application's resources according to the target resource amount, including the elastic scaling of memory and CPU resources, using swap-out and swap-in technologies to achieve resource matching in the user state.

Benefits of technology

It improves resource utilization and reduces resource waste, especially in applications with tidal characteristics, and improves the efficiency of computing and storage resources use.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113626191B_ABST
    Figure CN113626191B_ABST
Patent Text Reader

Abstract

This application discloses a resource processing method, apparatus, device, and storage medium. The method includes: obtaining a resource consumption status of a first application; the resource consumption status represents the amount of resources consumed by the first application; determining a target resource amount for a target resource based on the resource consumption status; and adjusting the target resource for the first application based on the target resource amount. This solution can improve resource utilization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and is related to but not limited to a resource processing method, apparatus, device and storage medium. Background Art

[0002] With the high degree of informatization in society, various applications have emerged. When facing massive users, the scale of application clusters is large. Large-scale application clusters will occupy a huge amount of computing and storage resources. How to manage large-scale application clusters and improve resource utilization is of great significance.

[0003] In actual practice, some applications have tidal characteristics (for example, the application is in a low resource consumption state at certain times), and generally the amount of available resources for an application is preset. Therefore, even if the application is in a low resource consumption state, it still occupies all the available resources of the application, resulting in a large amount of resource waste. Summary of the Invention

[0004] The present application provides a resource processing method and apparatus, equipment, and storage medium, which can improve resource utilization.

[0005] The technical solution of this application is achieved as follows:

[0006] This application provides a resource processing method, the method comprising:

[0007] Obtaining a resource consumption status of a first application; the resource consumption status represents an amount of resources consumed by the first application;

[0008] determining a target resource amount for a target resource based on the resource consumption status;

[0009] The target resource of the first application is adjusted based on the target resource amount.

[0010] The present application provides a resource processing device, the device comprising:

[0011] an obtaining unit, configured to obtain a resource consumption status of a first application; the resource consumption status representing an amount of resources consumed by the first application;

[0012] a determining unit, configured to determine a target resource amount for a target resource based on the resource consumption status;

[0013] An adjusting unit is configured to adjust the target resources of the first application based on the target resource amount.

[0014] The present application also provides an electronic device, comprising: a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and the processor implements the above-mentioned resource processing method when executing the program.

[0015] The present application also provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned resource processing method is implemented.

[0016] The resource processing method, apparatus, device, and storage medium provided in this application include: obtaining the resource consumption status of a first application; the resource consumption status representing the amount of resources consumed by the first application; determining a target resource amount for a target resource based on the resource consumption status; and adjusting the target resource for the first application based on the target resource amount. In this solution, the resource consumption status of the application can be obtained, the target resource amount can be determined based on the resource consumption status, and the resources available to the application can be adjusted based on the target resource amount. This allows the actual resources available to the application to match the resource consumption status, thereby improving resource utilization. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 An optional structural diagram of the resource processing system provided in an embodiment of the present application;

[0018] Figure 2 An optional flowchart of the resource processing method provided in the embodiment of the present application;

[0019] Figure 3 An optional flowchart of the resource processing method provided in the embodiment of the present application;

[0020] Figure 4 An optional flowchart of the resource processing method provided in the embodiment of the present application;

[0021] Figure 5 An optional flowchart of the resource processing method provided in the embodiment of the present application;

[0022] Figure 6 An optional flowchart of the resource processing method provided in the embodiment of the present application;

[0023] Figure 7 An optional flowchart of the resource processing method provided in the embodiment of the present application;

[0024] Figure 8 An optional structural diagram of the resource processing system provided in an embodiment of the present application;

[0025] Figure 9 An optional flowchart of the resource processing method provided in the embodiment of the present application;

[0026] Figure 10 An optional flowchart of the resource processing method provided in the embodiment of the present application;

[0027] Figure 11 A schematic diagram of an optional structure of a resource processing device provided in an embodiment of the present application;

[0028] Figure 12 This is a schematic diagram of an optional structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0029] To make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the specific technical solutions of the application will be further described in detail below in conjunction with the drawings in the embodiments of the present application. The following embodiments are used to illustrate the present application but are not intended to limit the scope of the present application.

[0030] In the following description, reference is made to “some embodiments”, which describes a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0031] In the following description, the terms "first, second, and third" are used merely as examples to distinguish between different objects and do not represent a specific order or precedence for the objects. It is understood that the specific order or precedence of "first, second, and third" can be interchanged where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0032] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.

[0033] The embodiments of the present application may provide a resource processing method and apparatus, device, and storage medium. In practical applications, the resource processing method may be implemented by a resource processing apparatus, and the functional entities in the resource processing apparatus may be collaboratively implemented by hardware resources of an electronic device (such as a terminal device), such as computing resources such as a processor, and communication resources (such as those used to support various communication methods such as optical cables and cellular communications).

[0034] The resource processing method provided in the embodiment of the present application is applied to a resource processing system, which includes a resource processing terminal. In one example, the resource processing system may also include a client.

[0035] As an example, the structure of the resource processing device 10 may be as follows: Figure 1As shown, it includes: resources 101 stored in the resource processing device 10; and at least one application 102 is deployed in the resource processing device 10.

[0036] Resources 101 may include at least one type of hardware resource.

[0037] The resource processing device 10 is used to configure available resources of the application 102 for at least one application 102 and can also be used to adjust the available resources of the application 102;

[0038] In the embodiment of this application, based on Figure 1 The resource processing device shown can receive user operations and perform the following based on the user operations: obtaining the resource consumption status of the first application; the resource consumption status represents the amount of resources consumed by the first application; determining the target resource amount for the target resource based on the resource consumption status; and adjusting the target resource of the first application based on the target resource amount.

[0039] In an example, the resource processing device 10 is configured to receive a user operation, and obtain a resource consumption status of a first application based on the user operation.

[0040] In another example, the resource processing device 10 periodically obtains the resource consumption status of the first application.

[0041] Next, combine Figure 1 The schematic diagram of the resource processing device shown illustrates various embodiments of the resource processing method and device, equipment and storage medium provided in the embodiments of the present application.

[0042] In the first aspect, the embodiment of the present application provides a resource processing method, which is applied to Figure 1 The resource processing device 10 shown in FIG. 1 can be deployed on an electronic device. The resource processing process is described below by taking the resource processing device 10 deployed on an electronic device and the electronic device executing the resource processing method provided in the embodiment of the present application as an example.

[0043] The electronic device may be any device capable of processing relevant information. In one embodiment, the electronic device may be a server.

[0044] Figure 2 A flow chart illustrating an optional resource processing method is provided. The resource processing method provided in an embodiment of the present application is used to adjust the available resources of an application (hereinafter referred to as the application's resources). The processing process for adjusting the resources of each application is similar. Taking the first application (any application) as an example, the process of adjusting the application's resources is described in detail.

[0045] The resource processing method may include but is not limited to Figure 2 The following S201 to S203 are shown.

[0046] S201: The electronic device obtains a resource consumption status of a first application.

[0047] Resources are used to represent the hardware resources required during the operation of an application. The embodiments of the present application do not impose a single limit on the type of resources, and they can be configured according to actual needs; for example, resources can include at least one of the following: central processing unit (CPU) resources, memory resources, etc.

[0048] Resource quantity is used to measure the size of resources. The present application embodiment does not impose a single limit on the measurement method of resource quantity and can be configured according to actual needs. For example, resource quantity can refer to the number of CPU cores; or resource quantity can also refer to the number of memory pages, etc.

[0049] The resource consumption status of the first application represents the amount of resources consumed by the first application. The embodiment of the present application does not impose a unique limit on the specific number of resource consumption status states, and can be configured according to actual needs.

[0050] Exemplarily, the resource consumption state may include a first state (low resource consumption state) and a second state (high resource consumption state). It is understandable that the resource consumption state may also include other states.

[0051] The execution timing of S201 can be configured according to actual needs, and the embodiment of the present application does not make any sole limitation to this.

[0052] In a possible implementation, the electronic device may obtain the resource consumption status of the first application based on a user operation or instruction thereto.

[0053] When the resource consumption status of the first application is obtained based on the user's operation or instruction on the electronic device, different resource consumption statuses may be obtained for different received operations. In this case, the resource consumption status is determined by the user's operation on the electronic device.

[0054] In one example, an electronic device provides a first control for a first state and a second control for a second state; if the electronic device detects that a user operates the first control, in response to the operation on the first control, the resource consumption state of the first application is obtained as the first state; if the electronic device detects that the user operates the second control, in response to the operation on the second control, the resource consumption state of the first application is obtained as the second state.

[0055] In another possible implementation, the electronic device may periodically determine the resource consumption status of the first application.

[0056] In the case of periodically obtaining the resource consumption status of the first application, the electronic device may periodically detect the resource consumption amount of the first application and determine the resource consumption status of the first application according to the resource consumption amount.

[0057] In one example, when the electronic device determines that the detection cycle is met, it detects the resource consumption of the first application within a period of time from the current moment and determines the relationship between the consumption and a first threshold; if it is determined that the consumption is less than the first threshold, the first application is considered to be in a low resource consumption state; if it is determined that the consumption is greater than or equal to the first threshold, the first application is considered to be in a high resource consumption state.

[0058] When the types of resources are different, the corresponding resource consumption detection methods are also different, which can be configured according to actual needs. The embodiments of this application do not specifically limit this.

[0059] S202: The electronic device determines a target resource amount for a target resource based on the resource consumption status.

[0060] Resource consumption is positively correlated with the target resource amount. Different resource consumption states correspond to different target resource amounts. For example, if the resource consumption state is low, the corresponding target resource amount is small, while if the resource consumption state is high, the corresponding target resource amount is large.

[0061] In the embodiments of the present application, the target resource amount corresponding to each resource consumption state can be limited according to actual needs.

[0062] The methods for determining target resource quantities are different for different resource types.

[0063] S203: The electronic device adjusts the target resources of the first application based on the target resource amount.

[0064] In a possible implementation, the target resource amount is smaller than the resource amount available for the first application. The electronic device reduces the resource amount available for the first application based on the target resource amount, that is, releases part of the resources available for the first application.

[0065] In another possible implementation, the target resource amount is greater than the resource amount available for the first application. The electronic device increases the resource amount available for the first application based on the target resource amount, that is, reallocates some available resources to the first application.

[0066] The methods for adjusting target resources corresponding to different resource types may be the same or different.

[0067] For example, the method for adjusting the target CPU resources may be the same as or different from the method for adjusting the target memory resources.

[0068] It should be noted that the electronic device can adjust the target resources of the first application based on the target resource amount in kernel mode; or the electronic device can also adjust the target resources of the first application based on the target resource amount in user mode; it can be configured according to actual needs, and the embodiments of the present application are not limited to this.

[0069] The resource processing solution provided by the embodiment of the present application includes: obtaining the resource consumption status of a first application; the resource consumption status represents the amount of resources consumed by the first application; determining a target resource amount for a target resource based on the resource consumption status; and adjusting the target resource of the first application based on the target resource amount. In this solution, the resource consumption status of the application can be obtained, the target resource amount can be determined based on the resource consumption status, and the resources of the application can be adjusted based on the target resource amount. In this way, the resources actually available to the application can match the resource consumption status, thereby improving resource utilization.

[0070] Taking different types of target resource scenarios as an example, the following describes the process of an electronic device adjusting the target resource amount of a first application based on the resource consumption status of the first application (S202 the electronic device determines the target resource amount for the target resource based on the resource consumption status, and S203 the electronic device adjusts the target resource of the first application based on the target resource amount).

[0071] Scenario 1: Target resources include memory resources;

[0072] Scenario 2: Target resources include CPU resources;

[0073] Scenario 3: Target resources include CPU resources and memory resources.

[0074] The following describes the process of adjusting the target resource amount of the first application based on the resource consumption status of the first application in the scenario 1 where the target resource includes memory resources. This process may include but is not limited to Figure 3 S301 to S303 shown.

[0075] S301: The electronic device determines the resource amount of a first resource and the resource amount of a second resource.

[0076] The first resource is a memory resource allocated to the first application, so the resource amount of the first resource can be all memory resources started when the first application is running, or the maximum memory resource that the first application can call when the first application is running.

[0077] The second resource is a shared memory resource, that is, the second resource is a resource that can be flexibly processed (released or released); illustratively, the second resource can be a memory page in the first resource whose mapping relationship belongs to an anonymous private mapping relationship.

[0078] S301 can be implemented as follows: the electronic device obtains the area of memory resources (or the range of memory pages) that can be used by the first application when running the first application as the resource amount of the first resource, and the electronic device identifies the resource amount of shared resources related to the first application as the resource amount of the second resource.

[0079] S302: The electronic device determines a second target resource amount for the memory resource based on the resource consumption state, the resource amount of the first resource, and the resource amount of the second resource.

[0080] In a possible implementation, if the resource consumption state is the first state, S302 may be implemented as follows: the electronic device determines the second target resource amount as the difference between the resource amount of the first resource and the resource amount of the second resource; wherein the first resource includes the second resource.

[0081] It is understandable that the electronic device may determine the second target resource amount by using the difference between the resource amount of the first resource and the resource amount of the second resource, and adding a preset resource amount as the second target resource amount.

[0082] In a possible implementation, if the resource consumption state is the second state, S302 may be implemented as follows: the second target resource amount is the sum of the resource amount of the first resource and the resource amount of the second resource; wherein the first resource does not include the second resource.

[0083] It can be understood that the electronic device may determine the second target resource amount as the sum of the resource amount of the first resource and the resource amount of the second resource, reducing or increasing a preset resource amount as the second target resource amount.

[0084] It should be noted that the memory resources consumed by the first application in the first state are smaller than the memory resources consumed by the first application in the second state.

[0085] S303: The electronic device adjusts the target resources of the first application based on the second target resource amount.

[0086] The implementation of S303 may include but is not limited to the following case 1 or case 2.

[0087] Case 1: The resource consumption state is the first state, and the memory resources to be released are released based on the second target resource amount;

[0088] Case 2: The resource consumption state is the second state, and the unallocated memory resources are allocated to the first application based on the second target resource amount.

[0089] The following describes the first case. The process may include but is not limited to: Figure 4 S401 to S403 shown.

[0090] In case one, the resource consumption state of the first application is the first state, that is, the second target resource amount is less than the memory resource amount allocated by the electronic device to the first application, so some memory resources (memory resources to be released) need to be released.

[0091] S401: The electronic device determines the difference between the resource amount of the first resource and the second target resource amount as the memory resource amount to be released.

[0092] The electronic device subtracts the second target resource amount from the resource amount of the first resource as the amount of memory resources to be released.

[0093] In a possible implementation, the amount of memory resources to be released is the amount of the second resource.

[0094] In another possible implementation, the amount of memory resources to be released is smaller than the amount of the second resource.

[0095] S402: The electronic device obtains the to-be-released memory resources of the to-be-released amount from the shared memory resources.

[0096] The electronic device obtains a memory page with an anonymous private mapping relationship as a shared memory, and obtains a memory page with a data amount (or resource amount) equal to the memory resource amount to be released and the data stored therein as the memory resource to be released in the shared memory.

[0097] S403: The electronic device releases the memory resources to be released.

[0098] In other words, the electronic device releases the memory resources to be released to the free memory; wherein the free memory (also referred to as free memory resources) refers to the memory resources that are not allocated to a specific application for use.

[0099] Specifically, the implementation of S403 may include but is not limited to some or all of the following steps S4031 to S4037.

[0100] S4031. The electronic device obtains the working status of the operating system.

[0101] The electronic device checks the working state of the operating system at the current moment, wherein the working state can be a user state or a kernel state.

[0102] S4032: The electronic device determines whether the operating system is in user mode.

[0103] If the result of the electronic device's judgment is that the operating system is in user mode, the following S4033 and S4034 are executed. If the result of the judgment is that the operating system is in non-user mode (kernel mode), the following S4035 is executed.

[0104] S4033: The electronic device modifies the anonymous private mapping relationship of the memory resource to be released into a named private mapping relationship.

[0105] The electronic device calls the relevant interface of the user state to modify the anonymous private mapping relationship of the memory resource to be released into a named private mapping relationship for use in the following storage data.

[0106] S4034: The electronic device writes the data in the memory resource to be released into a disk file.

[0107] The electronic device calls the relevant interface in the user mode to write the data in the memory resource to be released into a preset area in the disk file.

[0108] Optionally, the electronic device may establish a relationship between the preset area in the disk file and the resources to be released in the first application for use in reading the data; wherein an association relationship may be established between the preset area in the disk file and the memory page corresponding to the resources to be released.

[0109] S4035. The electronic device switches the operating system from the kernel state to the user state.

[0110] After the electronic device executes S4035, it executes the above S4033 and S4034.

[0111] Optionally, before executing S4033, the electronic device may first execute the following S4036.

[0112] S4036. The electronic device freezes the first application.

[0113] The electronic device freezes the first application by calling ptrace in the user mode through the system.

[0114] It should be noted that the first application in a frozen state cannot be run, and the first application in a thawed state can be run.

[0115] When executing S4036, the electronic device may further execute S4037 after executing S4034.

[0116] S4037. The electronic device unfreezes the first application.

[0117] The electronic device unfreezes the first application by calling ptrace in the user mode through the system.

[0118] In the first scenario, when the first application is in the first state, the electronic device can release part of the memory resources (memory resources to be released) to the free memory, for example, the released memory resources can be allocated to other applications for use, thereby improving the efficiency of memory resource use.

[0119] It is understandable that S403 can also be implemented in kernel mode. The difference from implementation in user mode is: first, the relevant interfaces in kernel mode can be directly called to implement various functions; second, when the first application is subsequently run, the system kernel needs to be upgraded.

[0120] S403 is implemented in user mode without upgrading or modifying the operating system kernel.

[0121] The following describes the second case. This process may include but is not limited to: Figure 5 S501 to S503 shown.

[0122] In case 2, the resource consumption state of the first application is the second state, that is, the second target resource amount is greater than the memory resource amount allocated by the electronic device to the first application, so some memory resources need to be reallocated to the first application (memory resources to be allocated).

[0123] S501: The electronic device determines the difference between the second target resource amount and the first resource amount as the memory resource amount to be allocated.

[0124] The electronic device subtracts the resource amount of the first resource from the second target resource amount as the memory resource amount to be allocated.

[0125] In a possible implementation, the amount of memory resources to be allocated is the amount of the second resource.

[0126] In another possible implementation, the amount of memory resources to be allocated is smaller than the amount of the second resource.

[0127] S502: The electronic device obtains the to-be-allocated memory resources of the amount to be allocated from the idle memory resources.

[0128] The idle resource may be the memory resource to be released of the first application released by the electronic device, or other unprecedented resources. The embodiment of the present application does not specifically limit this and may be configured according to actual needs.

[0129] In one example, when the electronic device releases memory resources, a mapping relationship is established between the memory resources to be released of the first application (later released as free memory resources) and the disk file. The memory resource can be obtained through the mapping relationship, and the memory resource with the amount of memory resources to be allocated can be obtained from the memory resource as the memory resource to be allocated.

[0130] It is understandable that the amount of memory resources to be allocated may be obtained in other ways, and this embodiment of the present application does not limit this.

[0131] S503: The electronic device allocates the to-be-allocated memory resource to the first application.

[0132] Specifically, the implementation of S503 may include but is not limited to some or all of the following steps S5031 to S5037.

[0133] S5031. The electronic device obtains the working status of the operating system.

[0134] The specific implementation of S5031 can refer to the specific description of the electronic device obtaining the working status of the operating system in S4031, which will not be repeated here.

[0135] S5032: The electronic device determines whether the operating system is in user mode.

[0136] If the result of the electronic device's judgment is that the operating system is in user mode, the following S5033 and S5034 are executed. If the result of the judgment is that the operating system is in non-user mode (kernel mode), the following S5035 is executed.

[0137] S5033: The electronic device writes the data related to the memory resources to be allocated in the disk file into the memory resources to be processed.

[0138] The electronic device calls a relevant interface in the user state and writes data related to the memory resources to be allocated in the disk file into the memory resources to be processed.

[0139] S5034. The electronic device modifies the named private mapping relationship of the memory resource to be allocated into an anonymous private mapping relationship.

[0140] The electronic device calls the relevant interface of the user state to modify the anonymous private mapping relationship of the memory resource to be allocated into a named private mapping relationship, so that it can be used as a shared resource when it is in a low resource consumption state later.

[0141] S5035. The electronic device switches the operating system from the kernel state to the user state.

[0142] After the electronic device executes S5035, it executes the above S5033 and S5034.

[0143] Optionally, before executing S5033, the electronic device may first execute the following S5036.

[0144] S5036: The electronic device freezes the first application.

[0145] For the specific implementation of S5036, reference may be made to the specific description of freezing the first application of the electronic device in S4036, which will not be described in detail here.

[0146] When executing S5036, the electronic device may further execute the following S5037 after executing S5034.

[0147] S5037. The electronic device unfreezes the first application.

[0148] For the specific implementation of S5037, reference may be made to the specific description of the first application for unfreezing the electronic device in S4037, which will not be described in detail here.

[0149] In the second scenario, when the first application is in the second state, the electronic device can reallocate some memory resources (memory resources to be allocated) to the first application for use when the first application is in a high resource consumption state. In this way, the memory resources can be used more efficiently while not affecting the normal operation of the first application.

[0150] It is understandable that S503 can also be implemented in kernel mode. The difference from implementation in user mode is: first, the relevant interfaces in kernel mode can be directly called to implement various functions; second, when the first application is subsequently run, the system kernel needs to be upgraded.

[0151] S503 is implemented in user mode without upgrading or modifying the operating system kernel.

[0152] The following describes the process of adjusting the target resource amount of the first application based on the resource consumption status of the first application in the scenario 2 where the target resource includes CPU resources. This process may include but is not limited to Figure 6 S601 to S603 shown.

[0153] S601: The electronic device obtains the CPU resource consumption of the first application in the resource consumption state.

[0154] S601 may be implemented as: the electronic device detecting the CPU resource consumption when the first application is running in the resource consumption state.

[0155] For example, the electronic device may detect the number of CPU cores started when the first application is run in the resource consumption state.

[0156] S602: The electronic device determines a first target resource amount for the CPU resource based on the consumption of the CPU resource.

[0157] S602 can be implemented as follows: the electronic device determines the obtained CPU resource consumption as the first target resource amount for the CPU resource; or it can also predict the subsequent CPU resource consumption based on the obtained CPU resource consumption, and use the predicted CPU resource consumption as the first target resource amount; or it can also determine the CPU resource amount after the obtained CPU resource consumption is increased by a threshold as the first target resource amount.

[0158] S603: The electronic device adjusts the target resources of the first application based on the first target resource amount.

[0159] In one possible implementation, if the first target resource amount is less than the CPU resource amount allocated to the first application, the electronic device may reconfigure the CPU resources of the first application based on the first target resource amount; or the electronic device may limit the use of CPU resources to the first CPU resource adjustment amount (the difference between the CPU resource amount allocated to the first application and the first target resource amount).

[0160] For example, the electronic device may limit the use of the first CPU resource adjustment amount of CPU resources by modifying relevant parameters in the container of the first application.

[0161] In another possible implementation, if the first target resource amount is greater than the CPU resource amount allocated to the first application, the electronic device may reconfigure the CPU resources of the first application based on the first target resource amount; or the electronic device may allocate CPU resources of the second CPU resource adjustment amount (the difference between the first target resource amount and the CPU resource amount allocated to the first application) to the first application for use.

[0162] For example, the electronic device may allow the second CPU resource to adjust the usage of the CPU resource by modifying relevant parameters in the container of the first application.

[0163] In the solution of scenario 2, the CPU resources allocated to the first application can be flexibly adjusted according to the consumption of the CPU resources, which can improve the utilization rate of the CPU resources.

[0164] Scenario 3: Target resources include CPU resources and memory resources.

[0165] When the target resources include CPU resources and memory resources, the process of the electronic device adjusting the target resource amount of the first application based on the resource consumption status of the first application can refer to the specific descriptions of the above scenarios one and two, and will not be repeated here.

[0166] Further, such as Figure 7 As shown, if the first application is deployed in a container, after executing S201 to S203, the electronic device may further execute the following S204.

[0167] S204: The electronic device modifies resource parameters in the container based on the target resource.

[0168] In a possible implementation, with respect to CPU resources, the implementation of S204 may include: the electronic device modifying, based on the first target resource amount, relevant parameters in the container of the first application that limit the CPU resources used by the first application.

[0169] In another possible implementation, with respect to memory resources, the implementation of S204 may include: the electronic device modifying, based on the second target resource amount, relevant parameters of the memory resources that are limited to be used by the first application in the container of the first application.

[0170] In another possible implementation, for CPU resources and memory resources, the specific implementation refers to the above-mentioned specific description of CPU resources S204 and the specific description of memory resources S204, which are not repeated here.

[0171] Since the first application runs in a container, the adjustment of the resources of the first application is completed only after the relevant resource parameters in the container are modified; that is, if the relevant resource parameters in the container are not modified, when the first application is run, the electronic device will still start the available resources of the first application based on the parameters in the container.

[0172] Below, the resource processing method provided in the embodiment of the present application is explained through specific application scenarios.

[0173] Today's highly information-based society offers a wide variety of applications that provide convenient and fast information services. Therefore, managing large-scale application clusters is crucial, especially for information-based services that serve a massive user base. These clusters often consume vast amounts of computing and storage resources, making it crucial to improve resource utilization. Current container technology provides an efficient and fast mechanism for application deployment and management. It packages applications and environments together, offering a highly portable mechanism that effectively ensures isolation and security between applications. Consequently, container technology is now widely used to manage application clusters.

[0174] Deploying applications using container technology is simple, convenient, and easy to manage and deploy, but it doesn't take into account the runtime state of the applications. Some applications exhibit a "tidal" nature: while only providing a small amount of services at certain times of operation, they still consume significant resources, such as CPU and memory. This results in significant resource waste. In actual production, this behavior is common. For example, takeout ordering services are typically concentrated during meal times, with significantly less service required at other times. Some applications may only require minimal service at night. However, these applications still consume significant resources during periods of low traffic, reducing resource utilization and leading to significant resource waste.

[0175] This application can solve the problem of waste of application resources with "tidal" characteristics. These applications do not need to provide services all the time, but they will always occupy a large amount of CPU and memory resources. If the CPU usage and memory usage of the application are reduced during low traffic moments, this will not cause a large amount of resources to be idle, and resources can be significantly saved. The embodiment of the present application provides an elastic scaling technology for application resources. When the application only needs to serve a small amount of traffic, the application is converted into a low-power (also called low-resource consumption) application to reduce the resource usage of the application, which can significantly improve resource utilization. When the application needs to provide services normally, the application is restored to normal power consumption (also called normal resource consumption) state. In addition, when the elastic scaling technology of application resources is implemented from the user state, there is no need to upgrade or modify the operating system kernel, which is convenient for upgrading.

[0176] In order to facilitate understanding, some technical aspects are explained first.

[0177] Containers: Container technology provides a lightweight application packaging mechanism that packages the application itself and its runtime dependencies together, making it very convenient to deploy applications and providing good resource management and isolation capabilities.

[0178] User state: The space where applications run. They access resources managed by the operating system kernel, such as the CPU and memory, through operating system calls, but do not directly interact with the CPU and memory resources. In contrast, kernel state refers to the operating system kernel directly managing resources such as the CPU and memory, implementing CPU scheduling, process scheduling, and memory management.

[0179] Swap-out: In this application solution, it refers to the technology of returning the resources used by the application to the operating system.

[0180] Swap-in: In this application solution, it refers to the technology of replacing the resources used by the application from the operating system.

[0181] Page fault interrupt: The memory page that the application wants to access is not in the main memory, and the operating system needs to load it into the main memory before accessing it.

[0182] The principles of the resource processing solution provided in the embodiments of the present application are explained below.

[0183] Since the application has a "tidal" feature, it does not need to provide services all the time and may even be in a state of not providing services for a long time, and there are very few calls within the application at this time.

[0184] like Figure 8 As shown, in the solution of the embodiment of the present application, an application cluster is first started normally. When it is in a low resource consumption state, the swap-out technology is used to change the state of the application cluster to a low-power application cluster. When it is in a low resource consumption state (needing to provide formal services), the swap-in technology is used to switch the low-power application cluster to a normal power application. Since low-power applications occupy very few resources, this can significantly improve resource utilization and better utilize computing and storage resources.

[0185] Specifically, they may include:

[0186] 1) The electronic equipment starts a group of application clusters with normal power consumption.

[0187] 2) Electronic devices use swap-out technology to transform the above-mentioned normal power consumption application cluster into a low power consumption application cluster.

[0188] Swap-out technology significantly reduces the resources, such as CPU and memory, used by applications. This allows resources allocated to applications to be reclaimed and returned to the operating system, significantly reducing the application's resource utilization. The reclaimed resources can then be allocated to other applications. Furthermore, container resource isolation technology can be used to limit an application's CPU usage. Considering the application's low power consumption, an application can be restricted to using only a small number of CPU cores, freeing up idle CPU resources for other applications.

[0189] The key to swap-out technology lies in reducing an application's memory usage. This solution targets anonymous private memory pages, first collecting the usage distribution of the application's anonymous private memory pages and saving them to a disk file. It then removes the anonymous private mappings for these memory pages, and finally maps these memory pages to the disk file. This transfers the application's memory data to the disk file. At this point, since the application is in a low-resource state, it doesn't read or write large amounts of memory data, which in turn doesn't trigger page faults. Furthermore, the application's memory usage isn't restored due to heavy reading and writing, thus reducing the application's memory usage.

[0190] The overall process of swap-out technology is as follows Figure 9 As shown, the process of converting a normal power consumption application into a low power consumption application may include but is not limited to the following S901 to S906 .

[0191] S901. The electronic device freezes the application.

[0192] Specifically, the electronic device freezes the application by calling ptrace through the operating system.

[0193] It should be noted that the application is in the trace state after this.

[0194] S902: The electronic device collects memory data of the application.

[0195] Electronic devices collect memory data actually used by applications through interfaces provided by the system kernel.

[0196] S903: The electronic device saves the memory data to a disk file.

[0197] Specifically, the electronic device saves unused data in the shared memory to a preset area of the disk file.

[0198] S904: The electronic device maps the memory area of the application to a disk file.

[0199] The electronic device calls mmap to establish an association relationship between the preset area of the disk file and the shared memory, so that data in the preset area of the disk file can be found through the association relationship.

[0200] S905, electronic equipment thawing application.

[0201] The electronic device unfreezes the application by calling ptrace through the operating system.

[0202] S906: The electronic device modifies resource specifications of the application.

[0203] The electronic device modifies the resource specification parameters of the application in the container through the application container, that is, sets the shrunk memory parameters to the memory parameters corresponding to the application in the container.

[0204] 3) When the electronic equipment needs to provide formal services, it uses swap-in technology to switch the low-power application cluster to the normal-power application cluster to provide normal services.

[0205] When an application needs to provide normal services, swap-in technology switches the application state to normal power consumption, restoring the application cluster to normal state and enabling normal service. It also restores the application's CPU usage, unmaps the application's memory area to the disk file, reallocates anonymous private memory, and loads memory data from the disk file to restore the application's memory usage. When an application runs in a low-resource consumption state, memory pages change, requiring synchronization to ensure that memory data is always up to date.

[0206] The overall process of swap-in technology is as follows Figure 10 As shown, the process of converting a low-power application into a normal-power application may include but is not limited to the following S1001 to S1006 .

[0207] S1001. Resource specifications of electronic device recovery applications.

[0208] The electronic device obtains the resource specifications (memory resource amount) required for application recovery and modifies the resource parameters in the container corresponding to the application.

[0209] S1002: The electronic device obtains the status of the application.

[0210] If the application is in a frozen state, the following S1004 is executed; if the application is in a non-frozen state, the following S1003 is executed.

[0211] S1003. The electronic device freezes the application.

[0212] The electronic device freezes the application by calling ptrace through the operating system.

[0213] S1004: The electronic device synchronizes the modified memory data to the disk file.

[0214] The electronic device needs to synchronize the enabled memory data to the disk file as modified memory data.

[0215] S1005. The electronic device reads the disk file data into the memory data.

[0216] The electronic device reads the data in the disk file into the memory and modifies the mapping relationship of the memory into an anonymous private mapping.

[0217] S1006. Application of electronic equipment thawing.

[0218] The electronic device unfreezes the application by calling ptrace through the operating system.

[0219] The technical solution provided by the embodiments of this application uses swap-out and swap-in technologies to convert application states, enabling switching between different application states in seconds. Furthermore, when swap-out and swap-in are implemented in user mode, they can be directly invoked via the operating system's interfaces without modifying the operating system's kernel. This greatly facilitates upgrades and deployments, eliminating the need for extensive modifications to the compiled operating system's kernel, making actual deployment and use much more convenient.

[0220] It can be seen that the embodiment of the present application implements a technology for elastic scaling of application resources:

[0221] On the one hand, when the application is in a low resource consumption state, the electronic device uses swap-out technology to save the shared memory data of the normal power consumption application to a disk file, and maps the shared memory to the disk file, thereby reducing the memory usage of the application. It can also further limit the application to use only a small number of CPU cores through resource isolation technology, thereby converting the normal power consumption application into a low-power consumption application; among them, the application can continue to be in a running state after swap-out, ensuring that the application service maintains low power consumption and continues to operate normally.

[0222] On the other hand, when an application is in a high resource consumption state (needs to provide services normally), the electronic device restores the application's memory occupancy and CPU occupancy through swap-in technology, converting the low-power application into a normal-power application so as to provide services normally.

[0223] In this way, the utilization rate of the system's computing and storage resources is improved, the idle rate of resources is reduced, and the system's computing and storage resources can be better utilized; and when implemented based on user mode, there is no need to modify the operating system kernel, which can facilitate simple deployment and upgrades.

[0224] In the second aspect, a resource processing device according to an embodiment of the present application is described below in conjunction with Figure 11 The structural diagram of the resource processing device is shown in FIG.

[0225] like Figure 11 As shown, the resource processing device 110 includes: an acquisition unit 1101, a determination unit 1102 and an adjustment unit 1103.

[0226] The acquisition unit 1101 is configured to obtain a resource consumption status of a first application; the resource consumption status represents an amount of resources consumed by the first application;

[0227] A determining unit 1102 is configured to determine a target resource amount for a target resource based on the resource consumption status;

[0228] The adjusting unit 1103 is configured to adjust the target resources of the first application based on the target resource amount.

[0229] In some embodiments, when the target resource includes a memory resource, the determining unit 1102 is further configured to:

[0230] Determining a resource amount of a first resource and a resource amount of a second resource, wherein the first resource is a memory resource allocated to the first application and the second resource is a shared memory resource;

[0231] A second target resource amount for the memory resource is determined based on the resource consumption status, the resource amount of the first resource, and the resource amount of the second resource.

[0232] In some embodiments, the determining unit 1102 is further configured to:

[0233] If the resource consumption state is the first state, determining the second target resource amount as the difference between the resource amount of the first resource and the resource amount of the second resource; the first resource includes the second resource;

[0234] If the resource consumption state is the second state, the second target resource amount is determined to be the sum of the resource amount of the first resource and the resource amount of the second resource; the first resource does not include the second resource; the resources consumed by the first application in the first state are less than the resources consumed by the first application in the second state.

[0235] In some embodiments, if the resource consumption state is the first state, the adjusting unit 1103 is further configured to:

[0236] Determine the difference between the resource amount of the first resource and the second target resource amount as the memory resource amount to be released;

[0237] Acquire the memory resources to be released of the amount of memory resources to be released in the shared memory resources;

[0238] Release is the memory resource to be released.

[0239] In some embodiments, the adjusting unit 1103 is further configured to:

[0240] Get the working status of the operating system;

[0241] If the operating system is in user mode, modify the anonymous private mapping relationship of the memory resource to be released into a named private mapping relationship, and write the data in the memory resource to be released into a disk file;

[0242] If the operating system is in kernel state, the operating system is switched from kernel state to user state, the anonymous private mapping relationship of the memory resource to be released is modified to a named private mapping relationship, and the data in the memory resource to be released is written into a disk file.

[0243] In some embodiments, the resource processing device 110 further includes a freezing unit.

[0244] A freezing unit is configured to freeze the first application before modifying the anonymous private mapping relationship of the to-be-released memory resource into a named private mapping relationship.

[0245] In some embodiments, the resource processing device 110 further includes a defrosting unit.

[0246] A freezing unit is configured to unfreeze the first application after writing the data in the to-be-released memory resource into a disk file.

[0247] In some embodiments, if the resource consumption state is the second state, the adjusting unit 1103 is further configured to:

[0248] Determine the difference between the second target resource amount and the first resource amount as the memory resource amount to be allocated;

[0249] Obtaining the to-be-allocated memory resources of the amount of to-be-allocated memory resources from the free memory resources;

[0250] Allocate the to-be-allocated memory resource to the first application.

[0251] In some embodiments, the adjusting unit 1103 is further configured to:

[0252] Get the working status of the operating system;

[0253] If the operating system is in user mode, write the data related to the memory resource to be allocated in the disk file into the memory resource to be processed, and modify the named private mapping relationship of the memory resource to be allocated into an anonymous private mapping relationship;

[0254] If the operating system is in kernel state, the operating system is switched from kernel state to user state, the data related to the memory resources to be allocated in the disk file is written into the memory resources to be processed, and the named private mapping relationship of the memory resources to be allocated is modified to an anonymous private mapping relationship.

[0255] In some embodiments, when the target resource includes a central processing unit (CPU) resource, the determining unit 1102 is further configured to:

[0256] Obtaining CPU resource consumption by the first application in the resource consumption state;

[0257] A first target resource amount for the CPU resource is determined based on the consumption amount of the CPU resource.

[0258] In some embodiments, the resource processing device 110 further includes a modification unit.

[0259] A modification unit is configured to modify resource parameters in the container based on the target resource.

[0260] It should be noted that the resource processing device provided in the embodiment of the present application includes the various units included, which can be implemented by a processor in an electronic device; of course, it can also be implemented by a specific logic circuit; in the implementation process, the processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP) or a field programmable gate array (FPGA), etc.

[0261] The description of the above device embodiment is similar to the description of the above method embodiment and has similar beneficial effects as the method embodiment. For technical details not disclosed in the device embodiment of this application, please refer to the description of the method embodiment of this application for understanding.

[0262] It should be noted that, in the embodiment of the present application, if the above-mentioned resource processing method is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a magnetic disk or an optical disk. In this way, the embodiment of the present application is not limited to any specific combination of hardware and software.

[0263] In a third aspect, an embodiment of the present application provides an electronic device comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the program, the steps in the resource processing method provided in the above embodiment are implemented.

[0264] The following combination Figure 12 The structure of the electrical device 120 is described below.

[0265] In one example, the electronic device 120 may be the electronic device described above. Figure 12 As shown, the electronic device 120 includes: a processor 1201, at least one communication bus 1202, a user interface 1203, at least one external communication interface 1204, and a memory 1205. The communication bus 1202 is configured to enable communication between these components. The user interface 1203 may include a display screen, and the external communication interface 1204 may include a standard wired interface and a wireless interface.

[0266] The memory 1205 is configured to store instructions and applications executable by the processor 1201, and can also cache data to be processed or processed by the processor 1201 and various modules in the electronic device (for example, image data, audio data, voice communication data and video communication data), which can be implemented through flash memory (FLASH) or random access memory (Random Access Memory, RAM).

[0267] In a fourth aspect, an embodiment of the present application provides a storage medium, that is, a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps in the resource processing method provided in the above embodiment are implemented.

[0268] It should be noted that the description of the above storage medium and device embodiments is similar to the description of the above method embodiments and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium and device embodiments of this application, please refer to the description of the method embodiments of this application for understanding.

[0269] It should be understood that “one embodiment” or “an embodiment” mentioned throughout the specification means that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, “in one embodiment” or “in some embodiments” appearing throughout the specification do not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. The above-mentioned serial numbers of the embodiments of the present application are for description only and do not represent the advantages and disadvantages of the embodiments.

[0270] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.

[0271] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0272] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed across multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the scheme of this embodiment.

[0273] In addition, all functional units in the embodiments of the present application can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the above-mentioned integrated units can be implemented in the form of hardware or in the form of hardware plus software functional units.

[0274] Those skilled in the art will understand that all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiment; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM), magnetic disks or optical disks, and other media that can store program codes.

[0275] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application can be essentially or in other words, the part that contributes to the relevant technology can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks, or optical disks.

[0276] The above is merely an embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

Claims

1. A resource processing method, characterized in that: The method comprises: Obtaining a resource consumption status of a first application; the resource consumption status represents an amount of resources consumed by the first application; determining a target resource amount for a target resource based on the resource consumption status; adjusting the target resources of the first application based on the target resource amount; When the target resource includes a memory resource, determining a target resource amount for the target resource based on the resource consumption state includes: Determining a resource amount of a first resource and a resource amount of a second resource, wherein the first resource is a memory resource allocated to the first application and the second resource is a shared memory resource; determining a second target resource amount for the memory resource based on the resource consumption state, the resource amount of the first resource, and the resource amount of the second resource; The determining, based on the resource consumption state, the resource amount of the first resource, and the resource amount of the second resource, a second target resource amount for the memory resource includes: If the resource consumption state is the first state, determining the second target resource amount as the difference between the resource amount of the first resource and the resource amount of the second resource; the first resource includes the second resource; Alternatively, if the resource consumption state is the second state, the second target resource amount is determined to be the sum of the resource amount of the first resource and the resource amount of the second resource; the first resource does not include the second resource.

2. The method according to claim 1, characterized in that If the resource consumption state is the first state, adjusting the target resources of the first application based on the target resource amount includes: Determine the difference between the resource amount of the first resource and the second target resource amount as the memory resource amount to be released; Acquire the memory resources to be released of the amount of memory resources to be released in the shared memory resources; Release the memory resource to be released.

3. The method according to claim 2, characterized in that The releasing of the memory resources to be released includes: Get the working status of the operating system; If the operating system is in user mode, modify the anonymous private mapping relationship of the memory resource to be released into a named private mapping relationship, and write the data in the memory resource to be released into a disk file; If the operating system is in kernel state, the operating system is switched from kernel state to user state, the anonymous private mapping relationship of the memory resource to be released is modified to a named private mapping relationship, and the data in the memory resource to be released is written into a disk file.

4. The method according to claim 3, characterized in that Before performing the step of modifying the anonymous private mapping relationship of the to-be-released memory resource into a named private mapping relationship, the method further includes: freezing the first application; After writing the data in the to-be-released memory resource into a disk file, the method further includes: Unfreeze the first application.

5. The method according to claim 1, wherein If the resource consumption state is the second state, adjusting the target resource of the first application based on the target resource amount includes: Determine the difference between the second target resource amount and the first resource amount as the memory resource amount to be allocated; Obtaining the to-be-allocated memory resources of the amount of to-be-allocated memory resources from the free memory resources; Allocate the to-be-allocated memory resource to the first application.

6. The method according to claim 5, characterized in that Allocating the to-be-allocated memory resource to the first application includes: Get the working status of the operating system; If the operating system is in user mode, write the data related to the memory resource to be allocated in the disk file into the memory resource to be processed, and modify the named private mapping relationship of the memory resource to be allocated into an anonymous private mapping relationship; If the operating system is in kernel state, the operating system is switched from kernel state to user state, the data related to the memory resources to be allocated in the disk file is written into the memory resources to be processed, and the named private mapping relationship of the memory resources to be allocated is modified to an anonymous private mapping relationship.

7. The method according to any one of claims 1 to 6, characterized in that When the target resource includes a central processing unit (CPU) resource, determining a target resource amount for the target resource based on the resource consumption state includes: Obtaining CPU resource consumption by the first application in the resource consumption state; A first target resource amount for the CPU resource is determined based on the consumption amount of the CPU resource.

8. The method according to claim 1, characterized in that If the first application is deployed in a container, the method further includes: Based on the target resource, resource parameters in the container are modified.

9. A resource processing device, characterized in that: The device comprises: an obtaining unit, configured to obtain a resource consumption status of a first application; the resource consumption status representing an amount of resources consumed by the first application; a determining unit, configured to determine a target resource amount for a target resource based on the resource consumption status; an adjusting unit, configured to adjust the target resources of the first application based on the target resource amount; When the target resource includes a memory resource, the determining unit is further configured to determine a resource amount of a first resource and a resource amount of a second resource, the first resource being a memory resource allocated to the first application, and the second resource being a shared memory resource; and determining a second target resource amount for the memory resource based on the resource consumption status, the resource amount of the first resource, and the resource amount of the second resource; The determination unit is further used to determine the second target resource amount as the difference between the resource amount of the first resource and the resource amount of the second resource if the resource consumption state is the first state; the first resource includes the second resource; or, if the resource consumption state is the second state, determine the second target resource amount as the sum of the resource amount of the first resource and the resource amount of the second resource; the first resource does not include the second resource.

10. An electronic device comprising a memory and a processor, characterized in that: The memory stores a computer program that can be run on the processor, and when the processor executes the program, the resource processing method according to any one of claims 1 to 8 is implemented.

11. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the resource processing method according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Cloud rendering resource scheduling method and device, electronic equipment and storage medium

    CN111061560A